Google Cloud Translation v3 API - Class TranslationServiceClient (3.8.0)

public abstract class TranslationServiceClient

Reference documentation and code samples for the Google Cloud Translation v3 API class TranslationServiceClient.

TranslationService client wrapper, for convenient use.

Inheritance

object > TranslationServiceClient

Namespace

Google.Cloud.Translate.V3

Assembly

Google.Cloud.Translate.V3.dll

Remarks

Provides natural language translation operations.

Properties

BatchTranslateDocumentOperationsClient

public virtual OperationsClient BatchTranslateDocumentOperationsClient { get; }

The long-running operations client for BatchTranslateDocument.

Property Value
Type Description
OperationsClient

BatchTranslateTextOperationsClient

public virtual OperationsClient BatchTranslateTextOperationsClient { get; }

The long-running operations client for BatchTranslateText.

Property Value
Type Description
OperationsClient

CreateDatasetOperationsClient

public virtual OperationsClient CreateDatasetOperationsClient { get; }

The long-running operations client for CreateDataset.

Property Value
Type Description
OperationsClient

CreateGlossaryOperationsClient

public virtual OperationsClient CreateGlossaryOperationsClient { get; }

The long-running operations client for CreateGlossary.

Property Value
Type Description
OperationsClient

CreateModelOperationsClient

public virtual OperationsClient CreateModelOperationsClient { get; }

The long-running operations client for CreateModel.

Property Value
Type Description
OperationsClient

DefaultEndpoint

public static string DefaultEndpoint { get; }

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

Property Value
Type Description
string

DefaultScopes

public static IReadOnlyList<string> DefaultScopes { get; }

The default TranslationService scopes.

Property Value
Type Description
IReadOnlyListstring
Remarks

DeleteDatasetOperationsClient

public virtual OperationsClient DeleteDatasetOperationsClient { get; }

The long-running operations client for DeleteDataset.

Property Value
Type Description
OperationsClient

DeleteGlossaryOperationsClient

public virtual OperationsClient DeleteGlossaryOperationsClient { get; }

The long-running operations client for DeleteGlossary.

Property Value
Type Description
OperationsClient

DeleteModelOperationsClient

public virtual OperationsClient DeleteModelOperationsClient { get; }

The long-running operations client for DeleteModel.

Property Value
Type Description
OperationsClient

ExportDataOperationsClient

public virtual OperationsClient ExportDataOperationsClient { get; }

The long-running operations client for ExportData.

Property Value
Type Description
OperationsClient

GrpcClient

public virtual TranslationService.TranslationServiceClient GrpcClient { get; }

The underlying gRPC TranslationService client

Property Value
Type Description
TranslationServiceTranslationServiceClient

IAMPolicyClient

public virtual IAMPolicyClient IAMPolicyClient { get; }

The IAMPolicyClient associated with this client.

Property Value
Type Description
IAMPolicyClient

ImportDataOperationsClient

public virtual OperationsClient ImportDataOperationsClient { get; }

The long-running operations client for ImportData.

Property Value
Type Description
OperationsClient

LocationsClient

public virtual LocationsClient LocationsClient { get; }

The LocationsClient associated with this client.

Property Value
Type Description
LocationsClient

ServiceMetadata

public static ServiceMetadata ServiceMetadata { get; }

The service metadata associated with this client type.

Property Value
Type Description
ServiceMetadata

UpdateGlossaryOperationsClient

public virtual OperationsClient UpdateGlossaryOperationsClient { get; }

The long-running operations client for UpdateGlossary.

Property Value
Type Description
OperationsClient

Methods

AdaptiveMtTranslate(LocationName, IEnumerable<string>, CallSettings)

public virtual AdaptiveMtTranslateResponse AdaptiveMtTranslate(LocationName parent, IEnumerable<string> content, CallSettings callSettings = null)

Translate text using Adaptive MT.

Parameters
Name Description
parent LocationName

Required. Location to make a regional call.

Format: projects/{project-number-or-id}/locations/{location-id}.

content IEnumerablestring

Required. The content of the input in string format.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
AdaptiveMtTranslateResponse

The RPC response.

Example
// Create client
TranslationServiceClient translationServiceClient = TranslationServiceClient.Create();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
IEnumerable<string> content = new string[] { "", };
// Make the request
AdaptiveMtTranslateResponse response = translationServiceClient.AdaptiveMtTranslate(parent, content);

AdaptiveMtTranslate(AdaptiveMtTranslateRequest, CallSettings)

public virtual AdaptiveMtTranslateResponse AdaptiveMtTranslate(AdaptiveMtTranslateRequest request, CallSettings callSettings = null)

Translate text using Adaptive MT.

Parameters
Name Description
request AdaptiveMtTranslateRequest

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
AdaptiveMtTranslateResponse

The RPC response.

Example
// Create client
TranslationServiceClient translationServiceClient = TranslationServiceClient.Create();
// Initialize request argument(s)
AdaptiveMtTranslateRequest request = new AdaptiveMtTranslateRequest
{
    ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
    DatasetAsAdaptiveMtDatasetName = AdaptiveMtDatasetName.FromProjectLocationDataset("[PROJECT]", "[LOCATION]", "[DATASET]"),
    Content = { "", },
    ReferenceSentenceConfig = new AdaptiveMtTranslateRequest.Types.ReferenceSentenceConfig(),
    GlossaryConfig = new AdaptiveMtTranslateRequest.Types.GlossaryConfig(),
};
// Make the request
AdaptiveMtTranslateResponse response = translationServiceClient.AdaptiveMtTranslate(request);

AdaptiveMtTranslate(string, IEnumerable<string>, CallSettings)

public virtual AdaptiveMtTranslateResponse AdaptiveMtTranslate(string parent, IEnumerable<string> content, CallSettings callSettings = null)

Translate text using Adaptive MT.

Parameters
Name Description
parent string

Required. Location to make a regional call.

Format: projects/{project-number-or-id}/locations/{location-id}.

content IEnumerablestring

Required. The content of the input in string format.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
AdaptiveMtTranslateResponse

The RPC response.

Example
// Create client
TranslationServiceClient translationServiceClient = TranslationServiceClient.Create();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]";
IEnumerable<string> content = new string[] { "", };
// Make the request
AdaptiveMtTranslateResponse response = translationServiceClient.AdaptiveMtTranslate(parent, content);

AdaptiveMtTranslateAsync(LocationName, IEnumerable<string>, CallSettings)

public virtual Task<AdaptiveMtTranslateResponse> AdaptiveMtTranslateAsync(LocationName parent, IEnumerable<string> content, CallSettings callSettings = null)

Translate text using Adaptive MT.

Parameters
Name Description
parent LocationName

Required. Location to make a regional call.

Format: projects/{project-number-or-id}/locations/{location-id}.

content IEnumerablestring

Required. The content of the input in string format.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskAdaptiveMtTranslateResponse

A Task containing the RPC response.

Example
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
IEnumerable<string> content = new string[] { "", };
// Make the request
AdaptiveMtTranslateResponse response = await translationServiceClient.AdaptiveMtTranslateAsync(parent, content);

AdaptiveMtTranslateAsync(LocationName, IEnumerable<string>, CancellationToken)

public virtual Task<AdaptiveMtTranslateResponse> AdaptiveMtTranslateAsync(LocationName parent, IEnumerable<string> content, CancellationToken cancellationToken)

Translate text using Adaptive MT.

Parameters
Name Description
parent LocationName

Required. Location to make a regional call.

Format: projects/{project-number-or-id}/locations/{location-id}.

content IEnumerablestring

Required. The content of the input in string format.

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskAdaptiveMtTranslateResponse

A Task containing the RPC response.

Example
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
IEnumerable<string> content = new string[] { "", };
// Make the request
AdaptiveMtTranslateResponse response = await translationServiceClient.AdaptiveMtTranslateAsync(parent, content);

AdaptiveMtTranslateAsync(AdaptiveMtTranslateRequest, CallSettings)

public virtual Task<AdaptiveMtTranslateResponse> AdaptiveMtTranslateAsync(AdaptiveMtTranslateRequest request, CallSettings callSettings = null)

Translate text using Adaptive MT.

Parameters
Name Description
request AdaptiveMtTranslateRequest

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
TaskAdaptiveMtTranslateResponse

A Task containing the RPC response.

Example
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
AdaptiveMtTranslateRequest request = new AdaptiveMtTranslateRequest
{
    ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
    DatasetAsAdaptiveMtDatasetName = AdaptiveMtDatasetName.FromProjectLocationDataset("[PROJECT]", "[LOCATION]", "[DATASET]"),
    Content = { "", },
    ReferenceSentenceConfig = new AdaptiveMtTranslateRequest.Types.ReferenceSentenceConfig(),
    GlossaryConfig = new AdaptiveMtTranslateRequest.Types.GlossaryConfig(),
};
// Make the request
AdaptiveMtTranslateResponse response = await translationServiceClient.AdaptiveMtTranslateAsync(request);

AdaptiveMtTranslateAsync(AdaptiveMtTranslateRequest, CancellationToken)

public virtual Task<AdaptiveMtTranslateResponse> AdaptiveMtTranslateAsync(AdaptiveMtTranslateRequest request, CancellationToken cancellationToken)

Translate text using Adaptive MT.

Parameters
Name Description
request AdaptiveMtTranslateRequest

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

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskAdaptiveMtTranslateResponse

A Task containing the RPC response.

Example
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
AdaptiveMtTranslateRequest request = new AdaptiveMtTranslateRequest
{
    ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
    DatasetAsAdaptiveMtDatasetName = AdaptiveMtDatasetName.FromProjectLocationDataset("[PROJECT]", "[LOCATION]", "[DATASET]"),
    Content = { "", },
    ReferenceSentenceConfig = new AdaptiveMtTranslateRequest.Types.ReferenceSentenceConfig(),
    GlossaryConfig = new AdaptiveMtTranslateRequest.Types.GlossaryConfig(),
};
// Make the request
AdaptiveMtTranslateResponse response = await translationServiceClient.AdaptiveMtTranslateAsync(request);

AdaptiveMtTranslateAsync(string, IEnumerable<string>, CallSettings)

public virtual Task<AdaptiveMtTranslateResponse> AdaptiveMtTranslateAsync(string parent, IEnumerable<string> content, CallSettings callSettings = null)

Translate text using Adaptive MT.

Parameters
Name Description
parent string

Required. Location to make a regional call.

Format: projects/{project-number-or-id}/locations/{location-id}.

content IEnumerablestring

Required. The content of the input in string format.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskAdaptiveMtTranslateResponse

A Task containing the RPC response.

Example
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]";
IEnumerable<string> content = new string[] { "", };
// Make the request
AdaptiveMtTranslateResponse response = await translationServiceClient.AdaptiveMtTranslateAsync(parent, content);

AdaptiveMtTranslateAsync(string, IEnumerable<string>, CancellationToken)

public virtual Task<AdaptiveMtTranslateResponse> AdaptiveMtTranslateAsync(string parent, IEnumerable<string> content, CancellationToken cancellationToken)

Translate text using Adaptive MT.

Parameters
Name Description
parent string

Required. Location to make a regional call.

Format: projects/{project-number-or-id}/locations/{location-id}.

content IEnumerablestring

Required. The content of the input in string format.

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskAdaptiveMtTranslateResponse

A Task containing the RPC response.

Example
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]";
IEnumerable<string> content = new string[] { "", };
// Make the request
AdaptiveMtTranslateResponse response = await translationServiceClient.AdaptiveMtTranslateAsync(parent, content);

BatchTranslateDocument(LocationName, string, IEnumerable<string>, IEnumerable<BatchDocumentInputConfig>, BatchDocumentOutputConfig, CallSettings)

public virtual Operation<BatchTranslateDocumentResponse, BatchTranslateDocumentMetadata> BatchTranslateDocument(LocationName parent, string sourceLanguageCode, IEnumerable<string> targetLanguageCodes, IEnumerable<BatchDocumentInputConfig> inputConfigs, BatchDocumentOutputConfig outputConfig, CallSettings callSettings = null)

Translates a large volume of document in asynchronous batch mode. This function provides real-time output as the inputs are being processed. If caller cancels a request, the partial results (for an input file, it's all or nothing) may still be available on the specified output location.

This call returns immediately and you can use google.longrunning.Operation.name to poll the status of the call.

Parameters
Name Description
parent LocationName

Required. Location to make a regional call.

Format: projects/{project-number-or-id}/locations/{location-id}.

The global location is not supported for batch translation.

Only AutoML Translation models or glossaries within the same region (have the same location-id) can be used, otherwise an INVALID_ARGUMENT (400) error is returned.

sourceLanguageCode string

Required. The ISO-639 language code of the input document if known, for example, "en-US" or "sr-Latn". Supported language codes are listed in Language Support.

targetLanguageCodes IEnumerablestring

Required. The ISO-639 language code to use for translation of the input document. Specify up to 10 language codes here.

inputConfigs IEnumerableBatchDocumentInputConfig

Required. Input configurations. The total number of files matched should be <= 100. The total content size to translate should be <= 100M Unicode codepoints. The files must use UTF-8 encoding.

outputConfig BatchDocumentOutputConfig

Required. Output configuration. If 2 input configs match to the same file (that is, same input path), we don't generate output for duplicate inputs.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
OperationBatchTranslateDocumentResponseBatchTranslateDocumentMetadata

The RPC response.

Example
// Create client
TranslationServiceClient translationServiceClient = TranslationServiceClient.Create();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
string sourceLanguageCode = "";
IEnumerable<string> targetLanguageCodes = new string[] { "", };
IEnumerable<BatchDocumentInputConfig> inputConfigs = new BatchDocumentInputConfig[]
{
    new BatchDocumentInputConfig(),
};
BatchDocumentOutputConfig outputConfig = new BatchDocumentOutputConfig();
// Make the request
Operation<BatchTranslateDocumentResponse, BatchTranslateDocumentMetadata> response = translationServiceClient.BatchTranslateDocument(parent, sourceLanguageCode, targetLanguageCodes, inputConfigs, outputConfig);

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

BatchTranslateDocument(BatchTranslateDocumentRequest, CallSettings)

public virtual Operation<BatchTranslateDocumentResponse, BatchTranslateDocumentMetadata> BatchTranslateDocument(BatchTranslateDocumentRequest request, CallSettings callSettings = null)

Translates a large volume of document in asynchronous batch mode. This function provides real-time output as the inputs are being processed. If caller cancels a request, the partial results (for an input file, it's all or nothing) may still be available on the specified output location.

This call returns immediately and you can use google.longrunning.Operation.name to poll the status of the call.

Parameters
Name Description
request BatchTranslateDocumentRequest

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
OperationBatchTranslateDocumentResponseBatchTranslateDocumentMetadata

The RPC response.

Example
// Create client
TranslationServiceClient translationServiceClient = TranslationServiceClient.Create();
// Initialize request argument(s)
BatchTranslateDocumentRequest request = new BatchTranslateDocumentRequest
{
    ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
    SourceLanguageCode = "",
    TargetLanguageCodes = { "", },
    InputConfigs =
    {
        new BatchDocumentInputConfig(),
    },
    OutputConfig = new BatchDocumentOutputConfig(),
    Models = { { "", "" }, },
    Glossaries =
    {
        {
            "",
            new TranslateTextGlossaryConfig()
        },
    },
    FormatConversions = { { "", "" }, },
    CustomizedAttribution = "",
    EnableShadowRemovalNativePdf = false,
    EnableRotationCorrection = false,
};
// Make the request
Operation<BatchTranslateDocumentResponse, BatchTranslateDocumentMetadata> response = translationServiceClient.BatchTranslateDocument(request);

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

BatchTranslateDocument(string, string, IEnumerable<string>, IEnumerable<BatchDocumentInputConfig>, BatchDocumentOutputConfig, CallSettings)

public virtual Operation<BatchTranslateDocumentResponse, BatchTranslateDocumentMetadata> BatchTranslateDocument(string parent, string sourceLanguageCode, IEnumerable<string> targetLanguageCodes, IEnumerable<BatchDocumentInputConfig> inputConfigs, BatchDocumentOutputConfig outputConfig, CallSettings callSettings = null)

Translates a large volume of document in asynchronous batch mode. This function provides real-time output as the inputs are being processed. If caller cancels a request, the partial results (for an input file, it's all or nothing) may still be available on the specified output location.

This call returns immediately and you can use google.longrunning.Operation.name to poll the status of the call.

Parameters
Name Description
parent string

Required. Location to make a regional call.

Format: projects/{project-number-or-id}/locations/{location-id}.

The global location is not supported for batch translation.

Only AutoML Translation models or glossaries within the same region (have the same location-id) can be used, otherwise an INVALID_ARGUMENT (400) error is returned.

sourceLanguageCode string

Required. The ISO-639 language code of the input document if known, for example, "en-US" or "sr-Latn". Supported language codes are listed in Language Support.

targetLanguageCodes IEnumerablestring

Required. The ISO-639 language code to use for translation of the input document. Specify up to 10 language codes here.

inputConfigs IEnumerableBatchDocumentInputConfig

Required. Input configurations. The total number of files matched should be <= 100. The total content size to translate should be <= 100M Unicode codepoints. The files must use UTF-8 encoding.

outputConfig BatchDocumentOutputConfig

Required. Output configuration. If 2 input configs match to the same file (that is, same input path), we don't generate output for duplicate inputs.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
OperationBatchTranslateDocumentResponseBatchTranslateDocumentMetadata

The RPC response.

Example
// Create client
TranslationServiceClient translationServiceClient = TranslationServiceClient.Create();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]";
string sourceLanguageCode = "";
IEnumerable<string> targetLanguageCodes = new string[] { "", };
IEnumerable<BatchDocumentInputConfig> inputConfigs = new BatchDocumentInputConfig[]
{
    new BatchDocumentInputConfig(),
};
BatchDocumentOutputConfig outputConfig = new BatchDocumentOutputConfig();
// Make the request
Operation<BatchTranslateDocumentResponse, BatchTranslateDocumentMetadata> response = translationServiceClient.BatchTranslateDocument(parent, sourceLanguageCode, targetLanguageCodes, inputConfigs, outputConfig);

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

BatchTranslateDocumentAsync(LocationName, string, IEnumerable<string>, IEnumerable<BatchDocumentInputConfig>, BatchDocumentOutputConfig, CallSettings)

public virtual Task<Operation<BatchTranslateDocumentResponse, BatchTranslateDocumentMetadata>> BatchTranslateDocumentAsync(LocationName parent, string sourceLanguageCode, IEnumerable<string> targetLanguageCodes, IEnumerable<BatchDocumentInputConfig> inputConfigs, BatchDocumentOutputConfig outputConfig, CallSettings callSettings = null)

Translates a large volume of document in asynchronous batch mode. This function provides real-time output as the inputs are being processed. If caller cancels a request, the partial results (for an input file, it's all or nothing) may still be available on the specified output location.

This call returns immediately and you can use google.longrunning.Operation.name to poll the status of the call.

Parameters
Name Description
parent LocationName

Required. Location to make a regional call.

Format: projects/{project-number-or-id}/locations/{location-id}.

The global location is not supported for batch translation.

Only AutoML Translation models or glossaries within the same region (have the same location-id) can be used, otherwise an INVALID_ARGUMENT (400) error is returned.

sourceLanguageCode string

Required. The ISO-639 language code of the input document if known, for example, "en-US" or "sr-Latn". Supported language codes are listed in Language Support.

targetLanguageCodes IEnumerablestring

Required. The ISO-639 language code to use for translation of the input document. Specify up to 10 language codes here.

inputConfigs IEnumerableBatchDocumentInputConfig

Required. Input configurations. The total number of files matched should be <= 100. The total content size to translate should be <= 100M Unicode codepoints. The files must use UTF-8 encoding.

outputConfig BatchDocumentOutputConfig

Required. Output configuration. If 2 input configs match to the same file (that is, same input path), we don't generate output for duplicate inputs.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskOperationBatchTranslateDocumentResponseBatchTranslateDocumentMetadata

A Task containing the RPC response.

Example
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
string sourceLanguageCode = "";
IEnumerable<string> targetLanguageCodes = new string[] { "", };
IEnumerable<BatchDocumentInputConfig> inputConfigs = new BatchDocumentInputConfig[]
{
    new BatchDocumentInputConfig(),
};
BatchDocumentOutputConfig outputConfig = new BatchDocumentOutputConfig();
// Make the request
Operation<BatchTranslateDocumentResponse, BatchTranslateDocumentMetadata> response = await translationServiceClient.BatchTranslateDocumentAsync(parent, sourceLanguageCode, targetLanguageCodes, inputConfigs, outputConfig);

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

BatchTranslateDocumentAsync(LocationName, string, IEnumerable<string>, IEnumerable<BatchDocumentInputConfig>, BatchDocumentOutputConfig, CancellationToken)

public virtual Task<Operation<BatchTranslateDocumentResponse, BatchTranslateDocumentMetadata>> BatchTranslateDocumentAsync(LocationName parent, string sourceLanguageCode, IEnumerable<string> targetLanguageCodes, IEnumerable<BatchDocumentInputConfig> inputConfigs, BatchDocumentOutputConfig outputConfig, CancellationToken cancellationToken)

Translates a large volume of document in asynchronous batch mode. This function provides real-time output as the inputs are being processed. If caller cancels a request, the partial results (for an input file, it's all or nothing) may still be available on the specified output location.

This call returns immediately and you can use google.longrunning.Operation.name to poll the status of the call.

Parameters
Name Description
parent LocationName

Required. Location to make a regional call.

Format: projects/{project-number-or-id}/locations/{location-id}.

The global location is not supported for batch translation.

Only AutoML Translation models or glossaries within the same region (have the same location-id) can be used, otherwise an INVALID_ARGUMENT (400) error is returned.

sourceLanguageCode string

Required. The ISO-639 language code of the input document if known, for example, "en-US" or "sr-Latn". Supported language codes are listed in Language Support.

targetLanguageCodes IEnumerablestring

Required. The ISO-639 language code to use for translation of the input document. Specify up to 10 language codes here.

inputConfigs IEnumerableBatchDocumentInputConfig

Required. Input configurations. The total number of files matched should be <= 100. The total content size to translate should be <= 100M Unicode codepoints. The files must use UTF-8 encoding.

outputConfig BatchDocumentOutputConfig

Required. Output configuration. If 2 input configs match to the same file (that is, same input path), we don't generate output for duplicate inputs.

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskOperationBatchTranslateDocumentResponseBatchTranslateDocumentMetadata

A Task containing the RPC response.

Example
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
string sourceLanguageCode = "";
IEnumerable<string> targetLanguageCodes = new string[] { "", };
IEnumerable<BatchDocumentInputConfig> inputConfigs = new BatchDocumentInputConfig[]
{
    new BatchDocumentInputConfig(),
};
BatchDocumentOutputConfig outputConfig = new BatchDocumentOutputConfig();
// Make the request
Operation<BatchTranslateDocumentResponse, BatchTranslateDocumentMetadata> response = await translationServiceClient.BatchTranslateDocumentAsync(parent, sourceLanguageCode, targetLanguageCodes, inputConfigs, outputConfig);

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

BatchTranslateDocumentAsync(BatchTranslateDocumentRequest, CallSettings)

public virtual Task<Operation<BatchTranslateDocumentResponse, BatchTranslateDocumentMetadata>> BatchTranslateDocumentAsync(BatchTranslateDocumentRequest request, CallSettings callSettings = null)

Translates a large volume of document in asynchronous batch mode. This function provides real-time output as the inputs are being processed. If caller cancels a request, the partial results (for an input file, it's all or nothing) may still be available on the specified output location.

This call returns immediately and you can use google.longrunning.Operation.name to poll the status of the call.

Parameters
Name Description
request BatchTranslateDocumentRequest

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
TaskOperationBatchTranslateDocumentResponseBatchTranslateDocumentMetadata

A Task containing the RPC response.

Example
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
BatchTranslateDocumentRequest request = new BatchTranslateDocumentRequest
{
    ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
    SourceLanguageCode = "",
    TargetLanguageCodes = { "", },
    InputConfigs =
    {
        new BatchDocumentInputConfig(),
    },
    OutputConfig = new BatchDocumentOutputConfig(),
    Models = { { "", "" }, },
    Glossaries =
    {
        {
            "",
            new TranslateTextGlossaryConfig()
        },
    },
    FormatConversions = { { "", "" }, },
    CustomizedAttribution = "",
    EnableShadowRemovalNativePdf = false,
    EnableRotationCorrection = false,
};
// Make the request
Operation<BatchTranslateDocumentResponse, BatchTranslateDocumentMetadata> response = await translationServiceClient.BatchTranslateDocumentAsync(request);

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

BatchTranslateDocumentAsync(BatchTranslateDocumentRequest, CancellationToken)

public virtual Task<Operation<BatchTranslateDocumentResponse, BatchTranslateDocumentMetadata>> BatchTranslateDocumentAsync(BatchTranslateDocumentRequest request, CancellationToken cancellationToken)

Translates a large volume of document in asynchronous batch mode. This function provides real-time output as the inputs are being processed. If caller cancels a request, the partial results (for an input file, it's all or nothing) may still be available on the specified output location.

This call returns immediately and you can use google.longrunning.Operation.name to poll the status of the call.

Parameters
Name Description
request BatchTranslateDocumentRequest

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

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskOperationBatchTranslateDocumentResponseBatchTranslateDocumentMetadata

A Task containing the RPC response.

Example
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
BatchTranslateDocumentRequest request = new BatchTranslateDocumentRequest
{
    ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
    SourceLanguageCode = "",
    TargetLanguageCodes = { "", },
    InputConfigs =
    {
        new BatchDocumentInputConfig(),
    },
    OutputConfig = new BatchDocumentOutputConfig(),
    Models = { { "", "" }, },
    Glossaries =
    {
        {
            "",
            new TranslateTextGlossaryConfig()
        },
    },
    FormatConversions = { { "", "" }, },
    CustomizedAttribution = "",
    EnableShadowRemovalNativePdf = false,
    EnableRotationCorrection = false,
};
// Make the request
Operation<BatchTranslateDocumentResponse, BatchTranslateDocumentMetadata> response = await translationServiceClient.BatchTranslateDocumentAsync(request);

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

BatchTranslateDocumentAsync(string, string, IEnumerable<string>, IEnumerable<BatchDocumentInputConfig>, BatchDocumentOutputConfig, CallSettings)

public virtual Task<Operation<BatchTranslateDocumentResponse, BatchTranslateDocumentMetadata>> BatchTranslateDocumentAsync(string parent, string sourceLanguageCode, IEnumerable<string> targetLanguageCodes, IEnumerable<BatchDocumentInputConfig> inputConfigs, BatchDocumentOutputConfig outputConfig, CallSettings callSettings = null)

Translates a large volume of document in asynchronous batch mode. This function provides real-time output as the inputs are being processed. If caller cancels a request, the partial results (for an input file, it's all or nothing) may still be available on the specified output location.

This call returns immediately and you can use google.longrunning.Operation.name to poll the status of the call.

Parameters
Name Description
parent string

Required. Location to make a regional call.

Format: projects/{project-number-or-id}/locations/{location-id}.

The global location is not supported for batch translation.

Only AutoML Translation models or glossaries within the same region (have the same location-id) can be used, otherwise an INVALID_ARGUMENT (400) error is returned.

sourceLanguageCode string

Required. The ISO-639 language code of the input document if known, for example, "en-US" or "sr-Latn". Supported language codes are listed in Language Support.

targetLanguageCodes IEnumerablestring

Required. The ISO-639 language code to use for translation of the input document. Specify up to 10 language codes here.

inputConfigs IEnumerableBatchDocumentInputConfig

Required. Input configurations. The total number of files matched should be <= 100. The total content size to translate should be <= 100M Unicode codepoints. The files must use UTF-8 encoding.

outputConfig BatchDocumentOutputConfig

Required. Output configuration. If 2 input configs match to the same file (that is, same input path), we don't generate output for duplicate inputs.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskOperationBatchTranslateDocumentResponseBatchTranslateDocumentMetadata

A Task containing the RPC response.

Example
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]";
string sourceLanguageCode = "";
IEnumerable<string> targetLanguageCodes = new string[] { "", };
IEnumerable<BatchDocumentInputConfig> inputConfigs = new BatchDocumentInputConfig[]
{
    new BatchDocumentInputConfig(),
};
BatchDocumentOutputConfig outputConfig = new BatchDocumentOutputConfig();
// Make the request
Operation<BatchTranslateDocumentResponse, BatchTranslateDocumentMetadata> response = await translationServiceClient.BatchTranslateDocumentAsync(parent, sourceLanguageCode, targetLanguageCodes, inputConfigs, outputConfig);

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

BatchTranslateDocumentAsync(string, string, IEnumerable<string>, IEnumerable<BatchDocumentInputConfig>, BatchDocumentOutputConfig, CancellationToken)

public virtual Task<Operation<BatchTranslateDocumentResponse, BatchTranslateDocumentMetadata>> BatchTranslateDocumentAsync(string parent, string sourceLanguageCode, IEnumerable<string> targetLanguageCodes, IEnumerable<BatchDocumentInputConfig> inputConfigs, BatchDocumentOutputConfig outputConfig, CancellationToken cancellationToken)

Translates a large volume of document in asynchronous batch mode. This function provides real-time output as the inputs are being processed. If caller cancels a request, the partial results (for an input file, it's all or nothing) may still be available on the specified output location.

This call returns immediately and you can use google.longrunning.Operation.name to poll the status of the call.

Parameters
Name Description
parent string

Required. Location to make a regional call.

Format: projects/{project-number-or-id}/locations/{location-id}.

The global location is not supported for batch translation.

Only AutoML Translation models or glossaries within the same region (have the same location-id) can be used, otherwise an INVALID_ARGUMENT (400) error is returned.

sourceLanguageCode string

Required. The ISO-639 language code of the input document if known, for example, "en-US" or "sr-Latn". Supported language codes are listed in Language Support.

targetLanguageCodes IEnumerablestring

Required. The ISO-639 language code to use for translation of the input document. Specify up to 10 language codes here.

inputConfigs IEnumerableBatchDocumentInputConfig

Required. Input configurations. The total number of files matched should be <= 100. The total content size to translate should be <= 100M Unicode codepoints. The files must use UTF-8 encoding.

outputConfig BatchDocumentOutputConfig

Required. Output configuration. If 2 input configs match to the same file (that is, same input path), we don't generate output for duplicate inputs.

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskOperationBatchTranslateDocumentResponseBatchTranslateDocumentMetadata

A Task containing the RPC response.

Example
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]";
string sourceLanguageCode = "";
IEnumerable<string> targetLanguageCodes = new string[] { "", };
IEnumerable<BatchDocumentInputConfig> inputConfigs = new BatchDocumentInputConfig[]
{
    new BatchDocumentInputConfig(),
};
BatchDocumentOutputConfig outputConfig = new BatchDocumentOutputConfig();
// Make the request
Operation<BatchTranslateDocumentResponse, BatchTranslateDocumentMetadata> response = await translationServiceClient.BatchTranslateDocumentAsync(parent, sourceLanguageCode, targetLanguageCodes, inputConfigs, outputConfig);

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

BatchTranslateText(BatchTranslateTextRequest, CallSettings)

public virtual Operation<BatchTranslateResponse, BatchTranslateMetadata> BatchTranslateText(BatchTranslateTextRequest request, CallSettings callSettings = null)

Translates a large volume of text in asynchronous batch mode. This function provides real-time output as the inputs are being processed. If caller cancels a request, the partial results (for an input file, it's all or nothing) may still be available on the specified output location.

This call returns immediately and you can use google.longrunning.Operation.name to poll the status of the call.

Parameters
Name Description
request BatchTranslateTextRequest

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
OperationBatchTranslateResponseBatchTranslateMetadata

The RPC response.

Example
// Create client
TranslationServiceClient translationServiceClient = TranslationServiceClient.Create();
// Initialize request argument(s)
BatchTranslateTextRequest request = new BatchTranslateTextRequest
{
    ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
    SourceLanguageCode = "",
    TargetLanguageCodes = { "", },
    Models = { { "", "" }, },
    InputConfigs = { new InputConfig(), },
    OutputConfig = new OutputConfig(),
    Glossaries =
    {
        {
            "",
            new TranslateTextGlossaryConfig()
        },
    },
    Labels = { { "", "" }, },
};
// Make the request
Operation<BatchTranslateResponse, BatchTranslateMetadata> response = translationServiceClient.BatchTranslateText(request);

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

BatchTranslateTextAsync(BatchTranslateTextRequest, CallSettings)

public virtual Task<Operation<BatchTranslateResponse, BatchTranslateMetadata>> BatchTranslateTextAsync(BatchTranslateTextRequest request, CallSettings callSettings = null)

Translates a large volume of text in asynchronous batch mode. This function provides real-time output as the inputs are being processed. If caller cancels a request, the partial results (for an input file, it's all or nothing) may still be available on the specified output location.

This call returns immediately and you can use google.longrunning.Operation.name to poll the status of the call.

Parameters
Name Description
request BatchTranslateTextRequest

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
TaskOperationBatchTranslateResponseBatchTranslateMetadata

A Task containing the RPC response.

Example
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
BatchTranslateTextRequest request = new BatchTranslateTextRequest
{
    ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
    SourceLanguageCode = "",
    TargetLanguageCodes = { "", },
    Models = { { "", "" }, },
    InputConfigs = { new InputConfig(), },
    OutputConfig = new OutputConfig(),
    Glossaries =
    {
        {
            "",
            new TranslateTextGlossaryConfig()
        },
    },
    Labels = { { "", "" }, },
};
// Make the request
Operation<BatchTranslateResponse, BatchTranslateMetadata> response = await translationServiceClient.BatchTranslateTextAsync(request);

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

BatchTranslateTextAsync(BatchTranslateTextRequest, CancellationToken)

public virtual Task<Operation<BatchTranslateResponse, BatchTranslateMetadata>> BatchTranslateTextAsync(BatchTranslateTextRequest request, CancellationToken cancellationToken)

Translates a large volume of text in asynchronous batch mode. This function provides real-time output as the inputs are being processed. If caller cancels a request, the partial results (for an input file, it's all or nothing) may still be available on the specified output location.

This call returns immediately and you can use google.longrunning.Operation.name to poll the status of the call.

Parameters
Name Description
request BatchTranslateTextRequest

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

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskOperationBatchTranslateResponseBatchTranslateMetadata

A Task containing the RPC response.

Example
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
BatchTranslateTextRequest request = new BatchTranslateTextRequest
{
    ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
    SourceLanguageCode = "",
    TargetLanguageCodes = { "", },
    Models = { { "", "" }, },
    InputConfigs = { new InputConfig(), },
    OutputConfig = new OutputConfig(),
    Glossaries =
    {
        {
            "",
            new TranslateTextGlossaryConfig()
        },
    },
    Labels = { { "", "" }, },
};
// Make the request
Operation<BatchTranslateResponse, BatchTranslateMetadata> response = await translationServiceClient.BatchTranslateTextAsync(request);

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

Create()

public static TranslationServiceClient Create()

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

Returns
Type Description
TranslationServiceClient

The created TranslationServiceClient.

CreateAdaptiveMtDataset(LocationName, AdaptiveMtDataset, CallSettings)

public virtual AdaptiveMtDataset CreateAdaptiveMtDataset(LocationName parent, AdaptiveMtDataset adaptiveMtDataset, CallSettings callSettings = null)

Creates an Adaptive MT dataset.

Parameters
Name Description
parent LocationName

Required. Name of the parent project. In form of projects/{project-number-or-id}/locations/{location-id}

adaptiveMtDataset AdaptiveMtDataset

Required. The AdaptiveMtDataset to be created.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
AdaptiveMtDataset

The RPC response.

Example
// Create client
TranslationServiceClient translationServiceClient = TranslationServiceClient.Create();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
AdaptiveMtDataset adaptiveMtDataset = new AdaptiveMtDataset();
// Make the request
AdaptiveMtDataset response = translationServiceClient.CreateAdaptiveMtDataset(parent, adaptiveMtDataset);

CreateAdaptiveMtDataset(CreateAdaptiveMtDatasetRequest, CallSettings)

public virtual AdaptiveMtDataset CreateAdaptiveMtDataset(CreateAdaptiveMtDatasetRequest request, CallSettings callSettings = null)

Creates an Adaptive MT dataset.

Parameters
Name Description
request CreateAdaptiveMtDatasetRequest

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
AdaptiveMtDataset

The RPC response.

Example
// Create client
TranslationServiceClient translationServiceClient = TranslationServiceClient.Create();
// Initialize request argument(s)
CreateAdaptiveMtDatasetRequest request = new CreateAdaptiveMtDatasetRequest
{
    ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
    AdaptiveMtDataset = new AdaptiveMtDataset(),
};
// Make the request
AdaptiveMtDataset response = translationServiceClient.CreateAdaptiveMtDataset(request);

CreateAdaptiveMtDataset(string, AdaptiveMtDataset, CallSettings)

public virtual AdaptiveMtDataset CreateAdaptiveMtDataset(string parent, AdaptiveMtDataset adaptiveMtDataset, CallSettings callSettings = null)

Creates an Adaptive MT dataset.

Parameters
Name Description
parent string

Required. Name of the parent project. In form of projects/{project-number-or-id}/locations/{location-id}

adaptiveMtDataset AdaptiveMtDataset

Required. The AdaptiveMtDataset to be created.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
AdaptiveMtDataset

The RPC response.

Example
// Create client
TranslationServiceClient translationServiceClient = TranslationServiceClient.Create();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]";
AdaptiveMtDataset adaptiveMtDataset = new AdaptiveMtDataset();
// Make the request
AdaptiveMtDataset response = translationServiceClient.CreateAdaptiveMtDataset(parent, adaptiveMtDataset);

CreateAdaptiveMtDatasetAsync(LocationName, AdaptiveMtDataset, CallSettings)

public virtual Task<AdaptiveMtDataset> CreateAdaptiveMtDatasetAsync(LocationName parent, AdaptiveMtDataset adaptiveMtDataset, CallSettings callSettings = null)

Creates an Adaptive MT dataset.

Parameters
Name Description
parent LocationName

Required. Name of the parent project. In form of projects/{project-number-or-id}/locations/{location-id}

adaptiveMtDataset AdaptiveMtDataset

Required. The AdaptiveMtDataset to be created.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskAdaptiveMtDataset

A Task containing the RPC response.

Example
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
AdaptiveMtDataset adaptiveMtDataset = new AdaptiveMtDataset();
// Make the request
AdaptiveMtDataset response = await translationServiceClient.CreateAdaptiveMtDatasetAsync(parent, adaptiveMtDataset);

CreateAdaptiveMtDatasetAsync(LocationName, AdaptiveMtDataset, CancellationToken)

public virtual Task<AdaptiveMtDataset> CreateAdaptiveMtDatasetAsync(LocationName parent, AdaptiveMtDataset adaptiveMtDataset, CancellationToken cancellationToken)

Creates an Adaptive MT dataset.

Parameters
Name Description
parent LocationName

Required. Name of the parent project. In form of projects/{project-number-or-id}/locations/{location-id}

adaptiveMtDataset AdaptiveMtDataset

Required. The AdaptiveMtDataset to be created.

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskAdaptiveMtDataset

A Task containing the RPC response.

Example
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
AdaptiveMtDataset adaptiveMtDataset = new AdaptiveMtDataset();
// Make the request
AdaptiveMtDataset response = await translationServiceClient.CreateAdaptiveMtDatasetAsync(parent, adaptiveMtDataset);

CreateAdaptiveMtDatasetAsync(CreateAdaptiveMtDatasetRequest, CallSettings)

public virtual Task<AdaptiveMtDataset> CreateAdaptiveMtDatasetAsync(CreateAdaptiveMtDatasetRequest request, CallSettings callSettings = null)

Creates an Adaptive MT dataset.

Parameters
Name Description
request CreateAdaptiveMtDatasetRequest

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
TaskAdaptiveMtDataset

A Task containing the RPC response.

Example
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
CreateAdaptiveMtDatasetRequest request = new CreateAdaptiveMtDatasetRequest
{
    ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
    AdaptiveMtDataset = new AdaptiveMtDataset(),
};
// Make the request
AdaptiveMtDataset response = await translationServiceClient.CreateAdaptiveMtDatasetAsync(request);

CreateAdaptiveMtDatasetAsync(CreateAdaptiveMtDatasetRequest, CancellationToken)

public virtual Task<AdaptiveMtDataset> CreateAdaptiveMtDatasetAsync(CreateAdaptiveMtDatasetRequest request, CancellationToken cancellationToken)

Creates an Adaptive MT dataset.

Parameters
Name Description
request CreateAdaptiveMtDatasetRequest

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

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskAdaptiveMtDataset

A Task containing the RPC response.

Example
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
CreateAdaptiveMtDatasetRequest request = new CreateAdaptiveMtDatasetRequest
{
    ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
    AdaptiveMtDataset = new AdaptiveMtDataset(),
};
// Make the request
AdaptiveMtDataset response = await translationServiceClient.CreateAdaptiveMtDatasetAsync(request);

CreateAdaptiveMtDatasetAsync(string, AdaptiveMtDataset, CallSettings)

public virtual Task<AdaptiveMtDataset> CreateAdaptiveMtDatasetAsync(string parent, AdaptiveMtDataset adaptiveMtDataset, CallSettings callSettings = null)

Creates an Adaptive MT dataset.

Parameters
Name Description
parent string

Required. Name of the parent project. In form of projects/{project-number-or-id}/locations/{location-id}

adaptiveMtDataset AdaptiveMtDataset

Required. The AdaptiveMtDataset to be created.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskAdaptiveMtDataset

A Task containing the RPC response.

Example
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]";
AdaptiveMtDataset adaptiveMtDataset = new AdaptiveMtDataset();
// Make the request
AdaptiveMtDataset response = await translationServiceClient.CreateAdaptiveMtDatasetAsync(parent, adaptiveMtDataset);

CreateAdaptiveMtDatasetAsync(string, AdaptiveMtDataset, CancellationToken)

public virtual Task<AdaptiveMtDataset> CreateAdaptiveMtDatasetAsync(string parent, AdaptiveMtDataset adaptiveMtDataset, CancellationToken cancellationToken)

Creates an Adaptive MT dataset.

Parameters
Name Description
parent string

Required. Name of the parent project. In form of projects/{project-number-or-id}/locations/{location-id}

adaptiveMtDataset AdaptiveMtDataset

Required. The AdaptiveMtDataset to be created.

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskAdaptiveMtDataset

A Task containing the RPC response.

Example
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]";
AdaptiveMtDataset adaptiveMtDataset = new AdaptiveMtDataset();
// Make the request
AdaptiveMtDataset response = await translationServiceClient.CreateAdaptiveMtDatasetAsync(parent, adaptiveMtDataset);

CreateAsync(CancellationToken)

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

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

Parameter
Name Description
cancellationToken CancellationToken

The CancellationToken to use while creating the client.

Returns
Type Description
TaskTranslationServiceClient

The task representing the created TranslationServiceClient.

CreateDataset(LocationName, Dataset, CallSettings)

public virtual Operation<Dataset, CreateDatasetMetadata> CreateDataset(LocationName parent, Dataset dataset, CallSettings callSettings = null)

Creates a Dataset.

Parameters
Name Description
parent LocationName

Required. The project name.

dataset Dataset

Required. The Dataset to create.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
OperationDatasetCreateDatasetMetadata

The RPC response.

Example
// Create client
TranslationServiceClient translationServiceClient = TranslationServiceClient.Create();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
Dataset dataset = new Dataset();
// Make the request
Operation<Dataset, CreateDatasetMetadata> response = translationServiceClient.CreateDataset(parent, dataset);

// Poll until the returned long-running operation is complete
Operation<Dataset, CreateDatasetMetadata> 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, CreateDatasetMetadata> retrievedResponse = translationServiceClient.PollOnceCreateDataset(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;
}

CreateDataset(CreateDatasetRequest, CallSettings)

public virtual Operation<Dataset, CreateDatasetMetadata> CreateDataset(CreateDatasetRequest request, CallSettings callSettings = null)

Creates a Dataset.

Parameters
Name Description
request CreateDatasetRequest

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
OperationDatasetCreateDatasetMetadata

The RPC response.

Example
// Create client
TranslationServiceClient translationServiceClient = TranslationServiceClient.Create();
// Initialize request argument(s)
CreateDatasetRequest request = new CreateDatasetRequest
{
    ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
    Dataset = new Dataset(),
};
// Make the request
Operation<Dataset, CreateDatasetMetadata> response = translationServiceClient.CreateDataset(request);

// Poll until the returned long-running operation is complete
Operation<Dataset, CreateDatasetMetadata> 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, CreateDatasetMetadata> retrievedResponse = translationServiceClient.PollOnceCreateDataset(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;
}

CreateDataset(string, Dataset, CallSettings)

public virtual Operation<Dataset, CreateDatasetMetadata> CreateDataset(string parent, Dataset dataset, CallSettings callSettings = null)

Creates a Dataset.

Parameters
Name Description
parent string

Required. The project name.

dataset Dataset

Required. The Dataset to create.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
OperationDatasetCreateDatasetMetadata

The RPC response.

Example
// Create client
TranslationServiceClient translationServiceClient = TranslationServiceClient.Create();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]";
Dataset dataset = new Dataset();
// Make the request
Operation<Dataset, CreateDatasetMetadata> response = translationServiceClient.CreateDataset(parent, dataset);

// Poll until the returned long-running operation is complete
Operation<Dataset, CreateDatasetMetadata> 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, CreateDatasetMetadata> retrievedResponse = translationServiceClient.PollOnceCreateDataset(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;
}

CreateDatasetAsync(LocationName, Dataset, CallSettings)

public virtual Task<Operation<Dataset, CreateDatasetMetadata>> CreateDatasetAsync(LocationName parent, Dataset dataset, CallSettings callSettings = null)

Creates a Dataset.

Parameters
Name Description
parent LocationName

Required. The project name.

dataset Dataset

Required. The Dataset to create.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskOperationDatasetCreateDatasetMetadata

A Task containing the RPC response.

Example
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
Dataset dataset = new Dataset();
// Make the request
Operation<Dataset, CreateDatasetMetadata> response = await translationServiceClient.CreateDatasetAsync(parent, dataset);

// Poll until the returned long-running operation is complete
Operation<Dataset, CreateDatasetMetadata> 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, CreateDatasetMetadata> retrievedResponse = await translationServiceClient.PollOnceCreateDatasetAsync(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;
}

CreateDatasetAsync(LocationName, Dataset, CancellationToken)

public virtual Task<Operation<Dataset, CreateDatasetMetadata>> CreateDatasetAsync(LocationName parent, Dataset dataset, CancellationToken cancellationToken)

Creates a Dataset.

Parameters
Name Description
parent LocationName

Required. The project name.

dataset Dataset

Required. The Dataset to create.

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskOperationDatasetCreateDatasetMetadata

A Task containing the RPC response.

Example
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
Dataset dataset = new Dataset();
// Make the request
Operation<Dataset, CreateDatasetMetadata> response = await translationServiceClient.CreateDatasetAsync(parent, dataset);

// Poll until the returned long-running operation is complete
Operation<Dataset, CreateDatasetMetadata> 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, CreateDatasetMetadata> retrievedResponse = await translationServiceClient.PollOnceCreateDatasetAsync(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;
}

CreateDatasetAsync(CreateDatasetRequest, CallSettings)

public virtual Task<Operation<Dataset, CreateDatasetMetadata>> CreateDatasetAsync(CreateDatasetRequest request, CallSettings callSettings = null)

Creates a Dataset.

Parameters
Name Description
request CreateDatasetRequest

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
TaskOperationDatasetCreateDatasetMetadata

A Task containing the RPC response.

Example
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
CreateDatasetRequest request = new CreateDatasetRequest
{
    ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
    Dataset = new Dataset(),
};
// Make the request
Operation<Dataset, CreateDatasetMetadata> response = await translationServiceClient.CreateDatasetAsync(request);

// Poll until the returned long-running operation is complete
Operation<Dataset, CreateDatasetMetadata> 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, CreateDatasetMetadata> retrievedResponse = await translationServiceClient.PollOnceCreateDatasetAsync(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;
}

CreateDatasetAsync(CreateDatasetRequest, CancellationToken)

public virtual Task<Operation<Dataset, CreateDatasetMetadata>> CreateDatasetAsync(CreateDatasetRequest request, CancellationToken cancellationToken)

Creates a Dataset.

Parameters
Name Description
request CreateDatasetRequest

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

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskOperationDatasetCreateDatasetMetadata

A Task containing the RPC response.

Example
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
CreateDatasetRequest request = new CreateDatasetRequest
{
    ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
    Dataset = new Dataset(),
};
// Make the request
Operation<Dataset, CreateDatasetMetadata> response = await translationServiceClient.CreateDatasetAsync(request);

// Poll until the returned long-running operation is complete
Operation<Dataset, CreateDatasetMetadata> 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, CreateDatasetMetadata> retrievedResponse = await translationServiceClient.PollOnceCreateDatasetAsync(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;
}

CreateDatasetAsync(string, Dataset, CallSettings)

public virtual Task<Operation<Dataset, CreateDatasetMetadata>> CreateDatasetAsync(string parent, Dataset dataset, CallSettings callSettings = null)

Creates a Dataset.

Parameters
Name Description
parent string

Required. The project name.

dataset Dataset

Required. The Dataset to create.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskOperationDatasetCreateDatasetMetadata

A Task containing the RPC response.

Example
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]";
Dataset dataset = new Dataset();
// Make the request
Operation<Dataset, CreateDatasetMetadata> response = await translationServiceClient.CreateDatasetAsync(parent, dataset);

// Poll until the returned long-running operation is complete
Operation<Dataset, CreateDatasetMetadata> 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, CreateDatasetMetadata> retrievedResponse = await translationServiceClient.PollOnceCreateDatasetAsync(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;
}

CreateDatasetAsync(string, Dataset, CancellationToken)

public virtual Task<Operation<Dataset, CreateDatasetMetadata>> CreateDatasetAsync(string parent, Dataset dataset, CancellationToken cancellationToken)

Creates a Dataset.

Parameters
Name Description
parent string

Required. The project name.

dataset Dataset

Required. The Dataset to create.

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskOperationDatasetCreateDatasetMetadata

A Task containing the RPC response.

Example
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]";
Dataset dataset = new Dataset();
// Make the request
Operation<Dataset, CreateDatasetMetadata> response = await translationServiceClient.CreateDatasetAsync(parent, dataset);

// Poll until the returned long-running operation is complete
Operation<Dataset, CreateDatasetMetadata> 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, CreateDatasetMetadata> retrievedResponse = await translationServiceClient.PollOnceCreateDatasetAsync(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;
}

CreateGlossary(LocationName, Glossary, CallSettings)

public virtual Operation<Glossary, CreateGlossaryMetadata> CreateGlossary(LocationName parent, Glossary glossary, CallSettings callSettings = null)

Creates a glossary and returns the long-running operation. Returns NOT_FOUND, if the project doesn't exist.

Parameters
Name Description
parent LocationName

Required. The project name.

glossary Glossary

Required. The glossary to create.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
OperationGlossaryCreateGlossaryMetadata

The RPC response.

Example
// Create client
TranslationServiceClient translationServiceClient = TranslationServiceClient.Create();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
Glossary glossary = new Glossary();
// Make the request
Operation<Glossary, CreateGlossaryMetadata> response = translationServiceClient.CreateGlossary(parent, glossary);

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

CreateGlossary(CreateGlossaryRequest, CallSettings)

public virtual Operation<Glossary, CreateGlossaryMetadata> CreateGlossary(CreateGlossaryRequest request, CallSettings callSettings = null)

Creates a glossary and returns the long-running operation. Returns NOT_FOUND, if the project doesn't exist.

Parameters
Name Description
request CreateGlossaryRequest

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
OperationGlossaryCreateGlossaryMetadata

The RPC response.

Example
// Create client
TranslationServiceClient translationServiceClient = TranslationServiceClient.Create();
// Initialize request argument(s)
CreateGlossaryRequest request = new CreateGlossaryRequest
{
    ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
    Glossary = new Glossary(),
};
// Make the request
Operation<Glossary, CreateGlossaryMetadata> response = translationServiceClient.CreateGlossary(request);

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

CreateGlossary(string, Glossary, CallSettings)

public virtual Operation<Glossary, CreateGlossaryMetadata> CreateGlossary(string parent, Glossary glossary, CallSettings callSettings = null)

Creates a glossary and returns the long-running operation. Returns NOT_FOUND, if the project doesn't exist.

Parameters
Name Description
parent string

Required. The project name.

glossary Glossary

Required. The glossary to create.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
OperationGlossaryCreateGlossaryMetadata

The RPC response.

Example
// Create client
TranslationServiceClient translationServiceClient = TranslationServiceClient.Create();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]";
Glossary glossary = new Glossary();
// Make the request
Operation<Glossary, CreateGlossaryMetadata> response = translationServiceClient.CreateGlossary(parent, glossary);

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

CreateGlossaryAsync(LocationName, Glossary, CallSettings)

public virtual Task<Operation<Glossary, CreateGlossaryMetadata>> CreateGlossaryAsync(LocationName parent, Glossary glossary, CallSettings callSettings = null)

Creates a glossary and returns the long-running operation. Returns NOT_FOUND, if the project doesn't exist.

Parameters
Name Description
parent LocationName

Required. The project name.

glossary Glossary

Required. The glossary to create.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskOperationGlossaryCreateGlossaryMetadata

A Task containing the RPC response.

Example
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
Glossary glossary = new Glossary();
// Make the request
Operation<Glossary, CreateGlossaryMetadata> response = await translationServiceClient.CreateGlossaryAsync(parent, glossary);

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

CreateGlossaryAsync(LocationName, Glossary, CancellationToken)

public virtual Task<Operation<Glossary, CreateGlossaryMetadata>> CreateGlossaryAsync(LocationName parent, Glossary glossary, CancellationToken cancellationToken)

Creates a glossary and returns the long-running operation. Returns NOT_FOUND, if the project doesn't exist.

Parameters
Name Description
parent LocationName

Required. The project name.

glossary Glossary

Required. The glossary to create.

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskOperationGlossaryCreateGlossaryMetadata

A Task containing the RPC response.

Example
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
Glossary glossary = new Glossary();
// Make the request
Operation<Glossary, CreateGlossaryMetadata> response = await translationServiceClient.CreateGlossaryAsync(parent, glossary);

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

CreateGlossaryAsync(CreateGlossaryRequest, CallSettings)

public virtual Task<Operation<Glossary, CreateGlossaryMetadata>> CreateGlossaryAsync(CreateGlossaryRequest request, CallSettings callSettings = null)

Creates a glossary and returns the long-running operation. Returns NOT_FOUND, if the project doesn't exist.

Parameters
Name Description
request CreateGlossaryRequest

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
TaskOperationGlossaryCreateGlossaryMetadata

A Task containing the RPC response.

Example
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
CreateGlossaryRequest request = new CreateGlossaryRequest
{
    ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
    Glossary = new Glossary(),
};
// Make the request
Operation<Glossary, CreateGlossaryMetadata> response = await translationServiceClient.CreateGlossaryAsync(request);

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

CreateGlossaryAsync(CreateGlossaryRequest, CancellationToken)

public virtual Task<Operation<Glossary, CreateGlossaryMetadata>> CreateGlossaryAsync(CreateGlossaryRequest request, CancellationToken cancellationToken)

Creates a glossary and returns the long-running operation. Returns NOT_FOUND, if the project doesn't exist.

Parameters
Name Description
request CreateGlossaryRequest

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

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskOperationGlossaryCreateGlossaryMetadata

A Task containing the RPC response.

Example
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
CreateGlossaryRequest request = new CreateGlossaryRequest
{
    ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
    Glossary = new Glossary(),
};
// Make the request
Operation<Glossary, CreateGlossaryMetadata> response = await translationServiceClient.CreateGlossaryAsync(request);

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

CreateGlossaryAsync(string, Glossary, CallSettings)

public virtual Task<Operation<Glossary, CreateGlossaryMetadata>> CreateGlossaryAsync(string parent, Glossary glossary, CallSettings callSettings = null)

Creates a glossary and returns the long-running operation. Returns NOT_FOUND, if the project doesn't exist.

Parameters
Name Description
parent string

Required. The project name.

glossary Glossary

Required. The glossary to create.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskOperationGlossaryCreateGlossaryMetadata

A Task containing the RPC response.

Example
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]";
Glossary glossary = new Glossary();
// Make the request
Operation<Glossary, CreateGlossaryMetadata> response = await translationServiceClient.CreateGlossaryAsync(parent, glossary);

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

CreateGlossaryAsync(string, Glossary, CancellationToken)

public virtual Task<Operation<Glossary, CreateGlossaryMetadata>> CreateGlossaryAsync(string parent, Glossary glossary, CancellationToken cancellationToken)

Creates a glossary and returns the long-running operation. Returns NOT_FOUND, if the project doesn't exist.

Parameters
Name Description
parent string

Required. The project name.

glossary Glossary

Required. The glossary to create.

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskOperationGlossaryCreateGlossaryMetadata

A Task containing the RPC response.

Example
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]";
Glossary glossary = new Glossary();
// Make the request
Operation<Glossary, CreateGlossaryMetadata> response = await translationServiceClient.CreateGlossaryAsync(parent, glossary);

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

CreateGlossaryEntry(CreateGlossaryEntryRequest, CallSettings)

public virtual GlossaryEntry CreateGlossaryEntry(CreateGlossaryEntryRequest request, CallSettings callSettings = null)

Creates a glossary entry.

Parameters
Name Description
request CreateGlossaryEntryRequest

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
GlossaryEntry

The RPC response.

Example
// Create client
TranslationServiceClient translationServiceClient = TranslationServiceClient.Create();
// Initialize request argument(s)
CreateGlossaryEntryRequest request = new CreateGlossaryEntryRequest
{
    ParentAsGlossaryName = GlossaryName.FromProjectLocationGlossary("[PROJECT]", "[LOCATION]", "[GLOSSARY]"),
    GlossaryEntry = new GlossaryEntry(),
};
// Make the request
GlossaryEntry response = translationServiceClient.CreateGlossaryEntry(request);

CreateGlossaryEntry(GlossaryName, GlossaryEntry, CallSettings)

public virtual GlossaryEntry CreateGlossaryEntry(GlossaryName parent, GlossaryEntry glossaryEntry, CallSettings callSettings = null)

Creates a glossary entry.

Parameters
Name Description
parent GlossaryName

Required. The resource name of the glossary to create the entry under.

glossaryEntry GlossaryEntry

Required. The glossary entry to create

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
GlossaryEntry

The RPC response.

Example
// Create client
TranslationServiceClient translationServiceClient = TranslationServiceClient.Create();
// Initialize request argument(s)
GlossaryName parent = GlossaryName.FromProjectLocationGlossary("[PROJECT]", "[LOCATION]", "[GLOSSARY]");
GlossaryEntry glossaryEntry = new GlossaryEntry();
// Make the request
GlossaryEntry response = translationServiceClient.CreateGlossaryEntry(parent, glossaryEntry);

CreateGlossaryEntry(string, GlossaryEntry, CallSettings)

public virtual GlossaryEntry CreateGlossaryEntry(string parent, GlossaryEntry glossaryEntry, CallSettings callSettings = null)

Creates a glossary entry.

Parameters
Name Description
parent string

Required. The resource name of the glossary to create the entry under.

glossaryEntry GlossaryEntry

Required. The glossary entry to create

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
GlossaryEntry

The RPC response.

Example
// Create client
TranslationServiceClient translationServiceClient = TranslationServiceClient.Create();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]/glossaries/[GLOSSARY]";
GlossaryEntry glossaryEntry = new GlossaryEntry();
// Make the request
GlossaryEntry response = translationServiceClient.CreateGlossaryEntry(parent, glossaryEntry);

CreateGlossaryEntryAsync(CreateGlossaryEntryRequest, CallSettings)

public virtual Task<GlossaryEntry> CreateGlossaryEntryAsync(CreateGlossaryEntryRequest request, CallSettings callSettings = null)

Creates a glossary entry.

Parameters
Name Description
request CreateGlossaryEntryRequest

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
TaskGlossaryEntry

A Task containing the RPC response.

Example
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
CreateGlossaryEntryRequest request = new CreateGlossaryEntryRequest
{
    ParentAsGlossaryName = GlossaryName.FromProjectLocationGlossary("[PROJECT]", "[LOCATION]", "[GLOSSARY]"),
    GlossaryEntry = new GlossaryEntry(),
};
// Make the request
GlossaryEntry response = await translationServiceClient.CreateGlossaryEntryAsync(request);

CreateGlossaryEntryAsync(CreateGlossaryEntryRequest, CancellationToken)

public virtual Task<GlossaryEntry> CreateGlossaryEntryAsync(CreateGlossaryEntryRequest request, CancellationToken cancellationToken)

Creates a glossary entry.

Parameters
Name Description
request CreateGlossaryEntryRequest

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

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskGlossaryEntry

A Task containing the RPC response.

Example
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
CreateGlossaryEntryRequest request = new CreateGlossaryEntryRequest
{
    ParentAsGlossaryName = GlossaryName.FromProjectLocationGlossary("[PROJECT]", "[LOCATION]", "[GLOSSARY]"),
    GlossaryEntry = new GlossaryEntry(),
};
// Make the request
GlossaryEntry response = await translationServiceClient.CreateGlossaryEntryAsync(request);

CreateGlossaryEntryAsync(GlossaryName, GlossaryEntry, CallSettings)

public virtual Task<GlossaryEntry> CreateGlossaryEntryAsync(GlossaryName parent, GlossaryEntry glossaryEntry, CallSettings callSettings = null)

Creates a glossary entry.

Parameters
Name Description
parent GlossaryName

Required. The resource name of the glossary to create the entry under.

glossaryEntry GlossaryEntry

Required. The glossary entry to create

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskGlossaryEntry

A Task containing the RPC response.

Example
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
GlossaryName parent = GlossaryName.FromProjectLocationGlossary("[PROJECT]", "[LOCATION]", "[GLOSSARY]");
GlossaryEntry glossaryEntry = new GlossaryEntry();
// Make the request
GlossaryEntry response = await translationServiceClient.CreateGlossaryEntryAsync(parent, glossaryEntry);

CreateGlossaryEntryAsync(GlossaryName, GlossaryEntry, CancellationToken)

public virtual Task<GlossaryEntry> CreateGlossaryEntryAsync(GlossaryName parent, GlossaryEntry glossaryEntry, CancellationToken cancellationToken)

Creates a glossary entry.

Parameters
Name Description
parent GlossaryName

Required. The resource name of the glossary to create the entry under.

glossaryEntry GlossaryEntry

Required. The glossary entry to create

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskGlossaryEntry

A Task containing the RPC response.

Example
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
GlossaryName parent = GlossaryName.FromProjectLocationGlossary("[PROJECT]", "[LOCATION]", "[GLOSSARY]");
GlossaryEntry glossaryEntry = new GlossaryEntry();
// Make the request
GlossaryEntry response = await translationServiceClient.CreateGlossaryEntryAsync(parent, glossaryEntry);

CreateGlossaryEntryAsync(string, GlossaryEntry, CallSettings)

public virtual Task<GlossaryEntry> CreateGlossaryEntryAsync(string parent, GlossaryEntry glossaryEntry, CallSettings callSettings = null)

Creates a glossary entry.

Parameters
Name Description
parent string

Required. The resource name of the glossary to create the entry under.

glossaryEntry GlossaryEntry

Required. The glossary entry to create

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskGlossaryEntry

A Task containing the RPC response.

Example
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]/glossaries/[GLOSSARY]";
GlossaryEntry glossaryEntry = new GlossaryEntry();
// Make the request
GlossaryEntry response = await translationServiceClient.CreateGlossaryEntryAsync(parent, glossaryEntry);

CreateGlossaryEntryAsync(string, GlossaryEntry, CancellationToken)

public virtual Task<GlossaryEntry> CreateGlossaryEntryAsync(string parent, GlossaryEntry glossaryEntry, CancellationToken cancellationToken)

Creates a glossary entry.

Parameters
Name Description
parent string

Required. The resource name of the glossary to create the entry under.

glossaryEntry GlossaryEntry

Required. The glossary entry to create

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskGlossaryEntry

A Task containing the RPC response.

Example
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]/glossaries/[GLOSSARY]";
GlossaryEntry glossaryEntry = new GlossaryEntry();
// Make the request
GlossaryEntry response = await translationServiceClient.CreateGlossaryEntryAsync(parent, glossaryEntry);

CreateModel(LocationName, Model, CallSettings)

public virtual Operation<Model, CreateModelMetadata> CreateModel(LocationName parent, Model model, CallSettings callSettings = null)

Creates a Model.

Parameters
Name Description
parent LocationName

Required. The project name, in form of projects/{project}/locations/{location}

model Model

Required. The Model to create.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
OperationModelCreateModelMetadata

The RPC response.

Example
// Create client
TranslationServiceClient translationServiceClient = TranslationServiceClient.Create();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
Model model = new Model();
// Make the request
Operation<Model, CreateModelMetadata> response = translationServiceClient.CreateModel(parent, model);

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

CreateModel(CreateModelRequest, CallSettings)

public virtual Operation<Model, CreateModelMetadata> CreateModel(CreateModelRequest request, CallSettings callSettings = null)

Creates a Model.

Parameters
Name Description
request CreateModelRequest

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
OperationModelCreateModelMetadata

The RPC response.

Example
// Create client
TranslationServiceClient translationServiceClient = TranslationServiceClient.Create();
// Initialize request argument(s)
CreateModelRequest request = new CreateModelRequest
{
    ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
    Model = new Model(),
};
// Make the request
Operation<Model, CreateModelMetadata> response = translationServiceClient.CreateModel(request);

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

CreateModel(string, Model, CallSettings)

public virtual Operation<Model, CreateModelMetadata> CreateModel(string parent, Model model, CallSettings callSettings = null)

Creates a Model.

Parameters
Name Description
parent string

Required. The project name, in form of projects/{project}/locations/{location}

model Model

Required. The Model to create.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
OperationModelCreateModelMetadata

The RPC response.

Example
// Create client
TranslationServiceClient translationServiceClient = TranslationServiceClient.Create();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]";
Model model = new Model();
// Make the request
Operation<Model, CreateModelMetadata> response = translationServiceClient.CreateModel(parent, model);

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

CreateModelAsync(LocationName, Model, CallSettings)

public virtual Task<Operation<Model, CreateModelMetadata>> CreateModelAsync(LocationName parent, Model model, CallSettings callSettings = null)

Creates a Model.

Parameters
Name Description
parent LocationName

Required. The project name, in form of projects/{project}/locations/{location}

model Model

Required. The Model to create.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskOperationModelCreateModelMetadata

A Task containing the RPC response.

Example
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
Model model = new Model();
// Make the request
Operation<Model, CreateModelMetadata> response = await translationServiceClient.CreateModelAsync(parent, model);

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

CreateModelAsync(LocationName, Model, CancellationToken)

public virtual Task<Operation<Model, CreateModelMetadata>> CreateModelAsync(LocationName parent, Model model, CancellationToken cancellationToken)

Creates a Model.

Parameters
Name Description
parent LocationName

Required. The project name, in form of projects/{project}/locations/{location}

model Model

Required. The Model to create.

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskOperationModelCreateModelMetadata

A Task containing the RPC response.

Example
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
Model model = new Model();
// Make the request
Operation<Model, CreateModelMetadata> response = await translationServiceClient.CreateModelAsync(parent, model);

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

CreateModelAsync(CreateModelRequest, CallSettings)

public virtual Task<Operation<Model, CreateModelMetadata>> CreateModelAsync(CreateModelRequest request, CallSettings callSettings = null)

Creates a Model.

Parameters
Name Description
request CreateModelRequest

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
TaskOperationModelCreateModelMetadata

A Task containing the RPC response.

Example
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
CreateModelRequest request = new CreateModelRequest
{
    ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
    Model = new Model(),
};
// Make the request
Operation<Model, CreateModelMetadata> response = await translationServiceClient.CreateModelAsync(request);

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

CreateModelAsync(CreateModelRequest, CancellationToken)

public virtual Task<Operation<Model, CreateModelMetadata>> CreateModelAsync(CreateModelRequest request, CancellationToken cancellationToken)

Creates a Model.

Parameters
Name Description
request CreateModelRequest

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

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskOperationModelCreateModelMetadata

A Task containing the RPC response.

Example
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
CreateModelRequest request = new CreateModelRequest
{
    ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
    Model = new Model(),
};
// Make the request
Operation<Model, CreateModelMetadata> response = await translationServiceClient.CreateModelAsync(request);

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

CreateModelAsync(string, Model, CallSettings)

public virtual Task<Operation<Model, CreateModelMetadata>> CreateModelAsync(string parent, Model model, CallSettings callSettings = null)

Creates a Model.

Parameters
Name Description
parent string

Required. The project name, in form of projects/{project}/locations/{location}

model Model

Required. The Model to create.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskOperationModelCreateModelMetadata

A Task containing the RPC response.

Example
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]";
Model model = new Model();
// Make the request
Operation<Model, CreateModelMetadata> response = await translationServiceClient.CreateModelAsync(parent, model);

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

CreateModelAsync(string, Model, CancellationToken)

public virtual Task<Operation<Model, CreateModelMetadata>> CreateModelAsync(string parent, Model model, CancellationToken cancellationToken)

Creates a Model.

Parameters
Name Description
parent string

Required. The project name, in form of projects/{project}/locations/{location}

model Model

Required. The Model to create.

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskOperationModelCreateModelMetadata

A Task containing the RPC response.

Example
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]";
Model model = new Model();
// Make the request
Operation<Model, CreateModelMetadata> response = await translationServiceClient.CreateModelAsync(parent, model);

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

DeleteAdaptiveMtDataset(AdaptiveMtDatasetName, CallSettings)

public virtual void DeleteAdaptiveMtDataset(AdaptiveMtDatasetName name, CallSettings callSettings = null)

Deletes an Adaptive MT dataset, including all its entries and associated metadata.

Parameters
Name Description
name AdaptiveMtDatasetName

Required. Name of the dataset. In the form of projects/{project-number-or-id}/locations/{location-id}/adaptiveMtDatasets/{adaptive-mt-dataset-id}

callSettings CallSettings

If not null, applies overrides to this RPC call.

Example
// Create client
TranslationServiceClient translationServiceClient = TranslationServiceClient.Create();
// Initialize request argument(s)
AdaptiveMtDatasetName name = AdaptiveMtDatasetName.FromProjectLocationDataset("[PROJECT]", "[LOCATION]", "[DATASET]");
// Make the request
translationServiceClient.DeleteAdaptiveMtDataset(name);

DeleteAdaptiveMtDataset(DeleteAdaptiveMtDatasetRequest, CallSettings)

public virtual void DeleteAdaptiveMtDataset(DeleteAdaptiveMtDatasetRequest request, CallSettings callSettings = null)

Deletes an Adaptive MT dataset, including all its entries and associated metadata.

Parameters
Name Description
request DeleteAdaptiveMtDatasetRequest

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

callSettings CallSettings

If not null, applies overrides to this RPC call.

Example
// Create client
TranslationServiceClient translationServiceClient = TranslationServiceClient.Create();
// Initialize request argument(s)
DeleteAdaptiveMtDatasetRequest request = new DeleteAdaptiveMtDatasetRequest
{
    AdaptiveMtDatasetName = AdaptiveMtDatasetName.FromProjectLocationDataset("[PROJECT]", "[LOCATION]", "[DATASET]"),
};
// Make the request
translationServiceClient.DeleteAdaptiveMtDataset(request);

DeleteAdaptiveMtDataset(string, CallSettings)

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

Deletes an Adaptive MT dataset, including all its entries and associated metadata.

Parameters
Name Description
name string

Required. Name of the dataset. In the form of projects/{project-number-or-id}/locations/{location-id}/adaptiveMtDatasets/{adaptive-mt-dataset-id}

callSettings CallSettings

If not null, applies overrides to this RPC call.

Example
// Create client
TranslationServiceClient translationServiceClient = TranslationServiceClient.Create();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/adaptiveMtDatasets/[DATASET]";
// Make the request
translationServiceClient.DeleteAdaptiveMtDataset(name);

DeleteAdaptiveMtDatasetAsync(AdaptiveMtDatasetName, CallSettings)

public virtual Task DeleteAdaptiveMtDatasetAsync(AdaptiveMtDatasetName name, CallSettings callSettings = null)

Deletes an Adaptive MT dataset, including all its entries and associated metadata.

Parameters
Name Description
name AdaptiveMtDatasetName

Required. Name of the dataset. In the form of projects/{project-number-or-id}/locations/{location-id}/adaptiveMtDatasets/{adaptive-mt-dataset-id}

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Task

A Task containing the RPC response.

Example
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
AdaptiveMtDatasetName name = AdaptiveMtDatasetName.FromProjectLocationDataset("[PROJECT]", "[LOCATION]", "[DATASET]");
// Make the request
await translationServiceClient.DeleteAdaptiveMtDatasetAsync(name);

DeleteAdaptiveMtDatasetAsync(AdaptiveMtDatasetName, CancellationToken)

public virtual Task DeleteAdaptiveMtDatasetAsync(AdaptiveMtDatasetName name, CancellationToken cancellationToken)

Deletes an Adaptive MT dataset, including all its entries and associated metadata.

Parameters
Name Description
name AdaptiveMtDatasetName

Required. Name of the dataset. In the form of projects/{project-number-or-id}/locations/{location-id}/adaptiveMtDatasets/{adaptive-mt-dataset-id}

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
Task

A Task containing the RPC response.

Example
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
AdaptiveMtDatasetName name = AdaptiveMtDatasetName.FromProjectLocationDataset("[PROJECT]", "[LOCATION]", "[DATASET]");
// Make the request
await translationServiceClient.DeleteAdaptiveMtDatasetAsync(name);

DeleteAdaptiveMtDatasetAsync(DeleteAdaptiveMtDatasetRequest, CallSettings)

public virtual Task DeleteAdaptiveMtDatasetAsync(DeleteAdaptiveMtDatasetRequest request, CallSettings callSettings = null)

Deletes an Adaptive MT dataset, including all its entries and associated metadata.

Parameters
Name Description
request DeleteAdaptiveMtDatasetRequest

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

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Task

A Task containing the RPC response.

Example
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
DeleteAdaptiveMtDatasetRequest request = new DeleteAdaptiveMtDatasetRequest
{
    AdaptiveMtDatasetName = AdaptiveMtDatasetName.FromProjectLocationDataset("[PROJECT]", "[LOCATION]", "[DATASET]"),
};
// Make the request
await translationServiceClient.DeleteAdaptiveMtDatasetAsync(request);

DeleteAdaptiveMtDatasetAsync(DeleteAdaptiveMtDatasetRequest, CancellationToken)

public virtual Task DeleteAdaptiveMtDatasetAsync(DeleteAdaptiveMtDatasetRequest request, CancellationToken cancellationToken)

Deletes an Adaptive MT dataset, including all its entries and associated metadata.

Parameters
Name Description
request DeleteAdaptiveMtDatasetRequest

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

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
Task

A Task containing the RPC response.

Example
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
DeleteAdaptiveMtDatasetRequest request = new DeleteAdaptiveMtDatasetRequest
{
    AdaptiveMtDatasetName = AdaptiveMtDatasetName.FromProjectLocationDataset("[PROJECT]", "[LOCATION]", "[DATASET]"),
};
// Make the request
await translationServiceClient.DeleteAdaptiveMtDatasetAsync(request);

DeleteAdaptiveMtDatasetAsync(string, CallSettings)

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

Deletes an Adaptive MT dataset, including all its entries and associated metadata.

Parameters
Name Description
name string

Required. Name of the dataset. In the form of projects/{project-number-or-id}/locations/{location-id}/adaptiveMtDatasets/{adaptive-mt-dataset-id}

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Task

A Task containing the RPC response.

Example
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/adaptiveMtDatasets/[DATASET]";
// Make the request
await translationServiceClient.DeleteAdaptiveMtDatasetAsync(name);

DeleteAdaptiveMtDatasetAsync(string, CancellationToken)

public virtual Task DeleteAdaptiveMtDatasetAsync(string name, CancellationToken cancellationToken)

Deletes an Adaptive MT dataset, including all its entries and associated metadata.

Parameters
Name Description
name string

Required. Name of the dataset. In the form of projects/{project-number-or-id}/locations/{location-id}/adaptiveMtDatasets/{adaptive-mt-dataset-id}

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
Task

A Task containing the RPC response.

Example
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/adaptiveMtDatasets/[DATASET]";
// Make the request
await translationServiceClient.DeleteAdaptiveMtDatasetAsync(name);

DeleteAdaptiveMtFile(AdaptiveMtFileName, CallSettings)

public virtual void DeleteAdaptiveMtFile(AdaptiveMtFileName name, CallSettings callSettings = null)

Deletes an AdaptiveMtFile along with its sentences.

Parameters
Name Description
name AdaptiveMtFileName

Required. The resource name of the file to delete, in form of projects/{project-number-or-id}/locations/{location_id}/adaptiveMtDatasets/{dataset}/adaptiveMtFiles/{file}

callSettings CallSettings

If not null, applies overrides to this RPC call.

Example
// Create client
TranslationServiceClient translationServiceClient = TranslationServiceClient.Create();
// Initialize request argument(s)
AdaptiveMtFileName name = AdaptiveMtFileName.FromProjectLocationDatasetFile("[PROJECT]", "[LOCATION]", "[DATASET]", "[FILE]");
// Make the request
translationServiceClient.DeleteAdaptiveMtFile(name);

DeleteAdaptiveMtFile(DeleteAdaptiveMtFileRequest, CallSettings)

public virtual void DeleteAdaptiveMtFile(DeleteAdaptiveMtFileRequest request, CallSettings callSettings = null)

Deletes an AdaptiveMtFile along with its sentences.

Parameters
Name Description
request DeleteAdaptiveMtFileRequest

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

callSettings CallSettings

If not null, applies overrides to this RPC call.

Example
// Create client
TranslationServiceClient translationServiceClient = TranslationServiceClient.Create();
// Initialize request argument(s)
DeleteAdaptiveMtFileRequest request = new DeleteAdaptiveMtFileRequest
{
    AdaptiveMtFileName = AdaptiveMtFileName.FromProjectLocationDatasetFile("[PROJECT]", "[LOCATION]", "[DATASET]", "[FILE]"),
};
// Make the request
translationServiceClient.DeleteAdaptiveMtFile(request);

DeleteAdaptiveMtFile(string, CallSettings)

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

Deletes an AdaptiveMtFile along with its sentences.

Parameters
Name Description
name string

Required. The resource name of the file to delete, in form of projects/{project-number-or-id}/locations/{location_id}/adaptiveMtDatasets/{dataset}/adaptiveMtFiles/{file}

callSettings CallSettings

If not null, applies overrides to this RPC call.

Example
// Create client
TranslationServiceClient translationServiceClient = TranslationServiceClient.Create();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/adaptiveMtDatasets/[DATASET]/adaptiveMtFiles/[FILE]";
// Make the request
translationServiceClient.DeleteAdaptiveMtFile(name);

DeleteAdaptiveMtFileAsync(AdaptiveMtFileName, CallSettings)

public virtual Task DeleteAdaptiveMtFileAsync(AdaptiveMtFileName name, CallSettings callSettings = null)

Deletes an AdaptiveMtFile along with its sentences.

Parameters
Name Description
name AdaptiveMtFileName

Required. The resource name of the file to delete, in form of projects/{project-number-or-id}/locations/{location_id}/adaptiveMtDatasets/{dataset}/adaptiveMtFiles/{file}

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Task

A Task containing the RPC response.

Example
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
AdaptiveMtFileName name = AdaptiveMtFileName.FromProjectLocationDatasetFile("[PROJECT]", "[LOCATION]", "[DATASET]", "[FILE]");
// Make the request
await translationServiceClient.DeleteAdaptiveMtFileAsync(name);

DeleteAdaptiveMtFileAsync(AdaptiveMtFileName, CancellationToken)

public virtual Task DeleteAdaptiveMtFileAsync(AdaptiveMtFileName name, CancellationToken cancellationToken)

Deletes an AdaptiveMtFile along with its sentences.

Parameters
Name Description
name AdaptiveMtFileName

Required. The resource name of the file to delete, in form of projects/{project-number-or-id}/locations/{location_id}/adaptiveMtDatasets/{dataset}/adaptiveMtFiles/{file}

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
Task

A Task containing the RPC response.

Example
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
AdaptiveMtFileName name = AdaptiveMtFileName.FromProjectLocationDatasetFile("[PROJECT]", "[LOCATION]", "[DATASET]", "[FILE]");
// Make the request
await translationServiceClient.DeleteAdaptiveMtFileAsync(name);

DeleteAdaptiveMtFileAsync(DeleteAdaptiveMtFileRequest, CallSettings)

public virtual Task DeleteAdaptiveMtFileAsync(DeleteAdaptiveMtFileRequest request, CallSettings callSettings = null)

Deletes an AdaptiveMtFile along with its sentences.

Parameters
Name Description
request DeleteAdaptiveMtFileRequest

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

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Task

A Task containing the RPC response.

Example
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
DeleteAdaptiveMtFileRequest request = new DeleteAdaptiveMtFileRequest
{
    AdaptiveMtFileName = AdaptiveMtFileName.FromProjectLocationDatasetFile("[PROJECT]", "[LOCATION]", "[DATASET]", "[FILE]"),
};
// Make the request
await translationServiceClient.DeleteAdaptiveMtFileAsync(request);

DeleteAdaptiveMtFileAsync(DeleteAdaptiveMtFileRequest, CancellationToken)

public virtual Task DeleteAdaptiveMtFileAsync(DeleteAdaptiveMtFileRequest request, CancellationToken cancellationToken)

Deletes an AdaptiveMtFile along with its sentences.

Parameters
Name Description
request DeleteAdaptiveMtFileRequest

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

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
Task

A Task containing the RPC response.

Example
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
DeleteAdaptiveMtFileRequest request = new DeleteAdaptiveMtFileRequest
{
    AdaptiveMtFileName = AdaptiveMtFileName.FromProjectLocationDatasetFile("[PROJECT]", "[LOCATION]", "[DATASET]", "[FILE]"),
};
// Make the request
await translationServiceClient.DeleteAdaptiveMtFileAsync(request);

DeleteAdaptiveMtFileAsync(string, CallSettings)

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

Deletes an AdaptiveMtFile along with its sentences.

Parameters
Name Description
name string

Required. The resource name of the file to delete, in form of projects/{project-number-or-id}/locations/{location_id}/adaptiveMtDatasets/{dataset}/adaptiveMtFiles/{file}

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Task

A Task containing the RPC response.

Example
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/adaptiveMtDatasets/[DATASET]/adaptiveMtFiles/[FILE]";
// Make the request
await translationServiceClient.DeleteAdaptiveMtFileAsync(name);

DeleteAdaptiveMtFileAsync(string, CancellationToken)

public virtual Task DeleteAdaptiveMtFileAsync(string name, CancellationToken cancellationToken)

Deletes an AdaptiveMtFile along with its sentences.

Parameters
Name Description
name string

Required. The resource name of the file to delete, in form of projects/{project-number-or-id}/locations/{location_id}/adaptiveMtDatasets/{dataset}/adaptiveMtFiles/{file}

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
Task

A Task containing the RPC response.

Example
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/adaptiveMtDatasets/[DATASET]/adaptiveMtFiles/[FILE]";
// Make the request
await translationServiceClient.DeleteAdaptiveMtFileAsync(name);

DeleteDataset(DatasetName, CallSettings)

public virtual Operation<Empty, DeleteDatasetMetadata> DeleteDataset(DatasetName name, CallSettings callSettings = null)

Deletes a dataset and all of its contents.

Parameters
Name Description
name DatasetName

Required. The name of the dataset to delete.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
OperationEmptyDeleteDatasetMetadata

The RPC response.

Example
// Create client
TranslationServiceClient translationServiceClient = TranslationServiceClient.Create();
// Initialize request argument(s)
DatasetName name = DatasetName.FromProjectLocationDataset("[PROJECT]", "[LOCATION]", "[DATASET]");
// Make the request
Operation<Empty, DeleteDatasetMetadata> response = translationServiceClient.DeleteDataset(name);

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

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

DeleteDataset(DeleteDatasetRequest, CallSettings)

public virtual Operation<Empty, DeleteDatasetMetadata> DeleteDataset(DeleteDatasetRequest request, CallSettings callSettings = null)

Deletes a dataset and all of its contents.

Parameters
Name Description
request DeleteDatasetRequest

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
OperationEmptyDeleteDatasetMetadata

The RPC response.

Example
// Create client
TranslationServiceClient translationServiceClient = TranslationServiceClient.Create();
// Initialize request argument(s)
DeleteDatasetRequest request = new DeleteDatasetRequest
{
    DatasetName = DatasetName.FromProjectLocationDataset("[PROJECT]", "[LOCATION]", "[DATASET]"),
};
// Make the request
Operation<Empty, DeleteDatasetMetadata> response = translationServiceClient.DeleteDataset(request);

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

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

DeleteDataset(string, CallSettings)

public virtual Operation<Empty, DeleteDatasetMetadata> DeleteDataset(string name, CallSettings callSettings = null)

Deletes a dataset and all of its contents.

Parameters
Name Description
name string

Required. The name of the dataset to delete.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
OperationEmptyDeleteDatasetMetadata

The RPC response.

Example
// Create client
TranslationServiceClient translationServiceClient = TranslationServiceClient.Create();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/datasets/[DATASET]";
// Make the request
Operation<Empty, DeleteDatasetMetadata> response = translationServiceClient.DeleteDataset(name);

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

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

DeleteDatasetAsync(DatasetName, CallSettings)

public virtual Task<Operation<Empty, DeleteDatasetMetadata>> DeleteDatasetAsync(DatasetName name, CallSettings callSettings = null)

Deletes a dataset and all of its contents.

Parameters
Name Description
name DatasetName

Required. The name of the dataset to delete.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskOperationEmptyDeleteDatasetMetadata

A Task containing the RPC response.

Example
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
DatasetName name = DatasetName.FromProjectLocationDataset("[PROJECT]", "[LOCATION]", "[DATASET]");
// Make the request
Operation<Empty, DeleteDatasetMetadata> response = await translationServiceClient.DeleteDatasetAsync(name);

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

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

DeleteDatasetAsync(DatasetName, CancellationToken)

public virtual Task<Operation<Empty, DeleteDatasetMetadata>> DeleteDatasetAsync(DatasetName name, CancellationToken cancellationToken)

Deletes a dataset and all of its contents.

Parameters
Name Description
name DatasetName

Required. The name of the dataset to delete.

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskOperationEmptyDeleteDatasetMetadata

A Task containing the RPC response.

Example
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
DatasetName name = DatasetName.FromProjectLocationDataset("[PROJECT]", "[LOCATION]", "[DATASET]");
// Make the request
Operation<Empty, DeleteDatasetMetadata> response = await translationServiceClient.DeleteDatasetAsync(name);

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

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

DeleteDatasetAsync(DeleteDatasetRequest, CallSettings)

public virtual Task<Operation<Empty, DeleteDatasetMetadata>> DeleteDatasetAsync(DeleteDatasetRequest request, CallSettings callSettings = null)

Deletes a dataset and all of its contents.

Parameters
Name Description
request DeleteDatasetRequest

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
TaskOperationEmptyDeleteDatasetMetadata

A Task containing the RPC response.

Example
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
DeleteDatasetRequest request = new DeleteDatasetRequest
{
    DatasetName = DatasetName.FromProjectLocationDataset("[PROJECT]", "[LOCATION]", "[DATASET]"),
};
// Make the request
Operation<Empty, DeleteDatasetMetadata> response = await translationServiceClient.DeleteDatasetAsync(request);

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

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

DeleteDatasetAsync(DeleteDatasetRequest, CancellationToken)

public virtual Task<Operation<Empty, DeleteDatasetMetadata>> DeleteDatasetAsync(DeleteDatasetRequest request, CancellationToken cancellationToken)

Deletes a dataset and all of its contents.

Parameters
Name Description
request DeleteDatasetRequest

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

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskOperationEmptyDeleteDatasetMetadata

A Task containing the RPC response.

Example
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
DeleteDatasetRequest request = new DeleteDatasetRequest
{
    DatasetName = DatasetName.FromProjectLocationDataset("[PROJECT]", "[LOCATION]", "[DATASET]"),
};
// Make the request
Operation<Empty, DeleteDatasetMetadata> response = await translationServiceClient.DeleteDatasetAsync(request);

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

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

DeleteDatasetAsync(string, CallSettings)

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

Deletes a dataset and all of its contents.

Parameters
Name Description
name string

Required. The name of the dataset to delete.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskOperationEmptyDeleteDatasetMetadata

A Task containing the RPC response.

Example
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/datasets/[DATASET]";
// Make the request
Operation<Empty, DeleteDatasetMetadata> response = await translationServiceClient.DeleteDatasetAsync(name);

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

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

DeleteDatasetAsync(string, CancellationToken)

public virtual Task<Operation<Empty, DeleteDatasetMetadata>> DeleteDatasetAsync(string name, CancellationToken cancellationToken)

Deletes a dataset and all of its contents.

Parameters
Name Description
name string

Required. The name of the dataset to delete.

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskOperationEmptyDeleteDatasetMetadata

A Task containing the RPC response.

Example
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/datasets/[DATASET]";
// Make the request
Operation<Empty, DeleteDatasetMetadata> response = await translationServiceClient.DeleteDatasetAsync(name);

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

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

DeleteGlossary(DeleteGlossaryRequest, CallSettings)

public virtual Operation<DeleteGlossaryResponse, DeleteGlossaryMetadata> DeleteGlossary(DeleteGlossaryRequest request, CallSettings callSettings = null)

Deletes a glossary, or cancels glossary construction if the glossary isn't created yet. Returns NOT_FOUND, if the glossary doesn't exist.

Parameters
Name Description
request DeleteGlossaryRequest

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
OperationDeleteGlossaryResponseDeleteGlossaryMetadata

The RPC response.

Example
// Create client
TranslationServiceClient translationServiceClient = TranslationServiceClient.Create();
// Initialize request argument(s)
DeleteGlossaryRequest request = new DeleteGlossaryRequest
{
    GlossaryName = GlossaryName.FromProjectLocationGlossary("[PROJECT]", "[LOCATION]", "[GLOSSARY]"),
};
// Make the request
Operation<DeleteGlossaryResponse, DeleteGlossaryMetadata> response = translationServiceClient.DeleteGlossary(request);

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

DeleteGlossary(GlossaryName, CallSettings)

public virtual Operation<DeleteGlossaryResponse, DeleteGlossaryMetadata> DeleteGlossary(GlossaryName name, CallSettings callSettings = null)

Deletes a glossary, or cancels glossary construction if the glossary isn't created yet. Returns NOT_FOUND, if the glossary doesn't exist.

Parameters
Name Description
name GlossaryName

Required. The name of the glossary to delete.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
OperationDeleteGlossaryResponseDeleteGlossaryMetadata

The RPC response.

Example
// Create client
TranslationServiceClient translationServiceClient = TranslationServiceClient.Create();
// Initialize request argument(s)
GlossaryName name = GlossaryName.FromProjectLocationGlossary("[PROJECT]", "[LOCATION]", "[GLOSSARY]");
// Make the request
Operation<DeleteGlossaryResponse, DeleteGlossaryMetadata> response = translationServiceClient.DeleteGlossary(name);

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

DeleteGlossary(string, CallSettings)

public virtual Operation<DeleteGlossaryResponse, DeleteGlossaryMetadata> DeleteGlossary(string name, CallSettings callSettings = null)

Deletes a glossary, or cancels glossary construction if the glossary isn't created yet. Returns NOT_FOUND, if the glossary doesn't exist.

Parameters
Name Description
name string

Required. The name of the glossary to delete.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
OperationDeleteGlossaryResponseDeleteGlossaryMetadata

The RPC response.

Example
// Create client
TranslationServiceClient translationServiceClient = TranslationServiceClient.Create();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/glossaries/[GLOSSARY]";
// Make the request
Operation<DeleteGlossaryResponse, DeleteGlossaryMetadata> response = translationServiceClient.DeleteGlossary(name);

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

DeleteGlossaryAsync(DeleteGlossaryRequest, CallSettings)

public virtual Task<Operation<DeleteGlossaryResponse, DeleteGlossaryMetadata>> DeleteGlossaryAsync(DeleteGlossaryRequest request, CallSettings callSettings = null)

Deletes a glossary, or cancels glossary construction if the glossary isn't created yet. Returns NOT_FOUND, if the glossary doesn't exist.

Parameters
Name Description
request DeleteGlossaryRequest

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
TaskOperationDeleteGlossaryResponseDeleteGlossaryMetadata

A Task containing the RPC response.

Example
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
DeleteGlossaryRequest request = new DeleteGlossaryRequest
{
    GlossaryName = GlossaryName.FromProjectLocationGlossary("[PROJECT]", "[LOCATION]", "[GLOSSARY]"),
};
// Make the request
Operation<DeleteGlossaryResponse, DeleteGlossaryMetadata> response = await translationServiceClient.DeleteGlossaryAsync(request);

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

DeleteGlossaryAsync(DeleteGlossaryRequest, CancellationToken)

public virtual Task<Operation<DeleteGlossaryResponse, DeleteGlossaryMetadata>> DeleteGlossaryAsync(DeleteGlossaryRequest request, CancellationToken cancellationToken)

Deletes a glossary, or cancels glossary construction if the glossary isn't created yet. Returns NOT_FOUND, if the glossary doesn't exist.

Parameters
Name Description
request DeleteGlossaryRequest

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

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskOperationDeleteGlossaryResponseDeleteGlossaryMetadata

A Task containing the RPC response.

Example
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
DeleteGlossaryRequest request = new DeleteGlossaryRequest
{
    GlossaryName = GlossaryName.FromProjectLocationGlossary("[PROJECT]", "[LOCATION]", "[GLOSSARY]"),
};
// Make the request
Operation<DeleteGlossaryResponse, DeleteGlossaryMetadata> response = await translationServiceClient.DeleteGlossaryAsync(request);

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

DeleteGlossaryAsync(GlossaryName, CallSettings)

public virtual Task<Operation<DeleteGlossaryResponse, DeleteGlossaryMetadata>> DeleteGlossaryAsync(GlossaryName name, CallSettings callSettings = null)

Deletes a glossary, or cancels glossary construction if the glossary isn't created yet. Returns NOT_FOUND, if the glossary doesn't exist.

Parameters
Name Description
name GlossaryName

Required. The name of the glossary to delete.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskOperationDeleteGlossaryResponseDeleteGlossaryMetadata

A Task containing the RPC response.

Example
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
GlossaryName name = GlossaryName.FromProjectLocationGlossary("[PROJECT]", "[LOCATION]", "[GLOSSARY]");
// Make the request
Operation<DeleteGlossaryResponse, DeleteGlossaryMetadata> response = await translationServiceClient.DeleteGlossaryAsync(name);

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

DeleteGlossaryAsync(GlossaryName, CancellationToken)

public virtual Task<Operation<DeleteGlossaryResponse, DeleteGlossaryMetadata>> DeleteGlossaryAsync(GlossaryName name, CancellationToken cancellationToken)

Deletes a glossary, or cancels glossary construction if the glossary isn't created yet. Returns NOT_FOUND, if the glossary doesn't exist.

Parameters
Name Description
name GlossaryName

Required. The name of the glossary to delete.

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskOperationDeleteGlossaryResponseDeleteGlossaryMetadata

A Task containing the RPC response.

Example
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
GlossaryName name = GlossaryName.FromProjectLocationGlossary("[PROJECT]", "[LOCATION]", "[GLOSSARY]");
// Make the request
Operation<DeleteGlossaryResponse, DeleteGlossaryMetadata> response = await translationServiceClient.DeleteGlossaryAsync(name);

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

DeleteGlossaryAsync(string, CallSettings)

public virtual Task<Operation<DeleteGlossaryResponse, DeleteGlossaryMetadata>> DeleteGlossaryAsync(string name, CallSettings callSettings = null)

Deletes a glossary, or cancels glossary construction if the glossary isn't created yet. Returns NOT_FOUND, if the glossary doesn't exist.

Parameters
Name Description
name string

Required. The name of the glossary to delete.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskOperationDeleteGlossaryResponseDeleteGlossaryMetadata

A Task containing the RPC response.

Example
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/glossaries/[GLOSSARY]";
// Make the request
Operation<DeleteGlossaryResponse, DeleteGlossaryMetadata> response = await translationServiceClient.DeleteGlossaryAsync(name);

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

DeleteGlossaryAsync(string, CancellationToken)

public virtual Task<Operation<DeleteGlossaryResponse, DeleteGlossaryMetadata>> DeleteGlossaryAsync(string name, CancellationToken cancellationToken)

Deletes a glossary, or cancels glossary construction if the glossary isn't created yet. Returns NOT_FOUND, if the glossary doesn't exist.

Parameters
Name Description
name string

Required. The name of the glossary to delete.

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskOperationDeleteGlossaryResponseDeleteGlossaryMetadata

A Task containing the RPC response.

Example
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/glossaries/[GLOSSARY]";
// Make the request
Operation<DeleteGlossaryResponse, DeleteGlossaryMetadata> response = await translationServiceClient.DeleteGlossaryAsync(name);

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

DeleteGlossaryEntry(DeleteGlossaryEntryRequest, CallSettings)

public virtual void DeleteGlossaryEntry(DeleteGlossaryEntryRequest request, CallSettings callSettings = null)

Deletes a single entry from the glossary

Parameters
Name Description
request DeleteGlossaryEntryRequest

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

callSettings CallSettings

If not null, applies overrides to this RPC call.

Example
// Create client
TranslationServiceClient translationServiceClient = TranslationServiceClient.Create();
// Initialize request argument(s)
DeleteGlossaryEntryRequest request = new DeleteGlossaryEntryRequest
{
    GlossaryEntryName = GlossaryEntryName.FromProjectLocationGlossaryGlossaryEntry("[PROJECT]", "[LOCATION]", "[GLOSSARY]", "[GLOSSARY_ENTRY]"),
};
// Make the request
translationServiceClient.DeleteGlossaryEntry(request);

DeleteGlossaryEntry(GlossaryEntryName, CallSettings)

public virtual void DeleteGlossaryEntry(GlossaryEntryName name, CallSettings callSettings = null)

Deletes a single entry from the glossary

Parameters
Name Description
name GlossaryEntryName

Required. The resource name of the glossary entry to delete

callSettings CallSettings

If not null, applies overrides to this RPC call.

Example
// Create client
TranslationServiceClient translationServiceClient = TranslationServiceClient.Create();
// Initialize request argument(s)
GlossaryEntryName name = GlossaryEntryName.FromProjectLocationGlossaryGlossaryEntry("[PROJECT]", "[LOCATION]", "[GLOSSARY]", "[GLOSSARY_ENTRY]");
// Make the request
translationServiceClient.DeleteGlossaryEntry(name);

DeleteGlossaryEntry(string, CallSettings)

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

Deletes a single entry from the glossary

Parameters
Name Description
name string

Required. The resource name of the glossary entry to delete

callSettings CallSettings

If not null, applies overrides to this RPC call.

Example
// Create client
TranslationServiceClient translationServiceClient = TranslationServiceClient.Create();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/glossaries/[GLOSSARY]/glossaryEntries/[GLOSSARY_ENTRY]";
// Make the request
translationServiceClient.DeleteGlossaryEntry(name);

DeleteGlossaryEntryAsync(DeleteGlossaryEntryRequest, CallSettings)

public virtual Task DeleteGlossaryEntryAsync(DeleteGlossaryEntryRequest request, CallSettings callSettings = null)

Deletes a single entry from the glossary

Parameters
Name Description
request DeleteGlossaryEntryRequest

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

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Task

A Task containing the RPC response.

Example
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
DeleteGlossaryEntryRequest request = new DeleteGlossaryEntryRequest
{
    GlossaryEntryName = GlossaryEntryName.FromProjectLocationGlossaryGlossaryEntry("[PROJECT]", "[LOCATION]", "[GLOSSARY]", "[GLOSSARY_ENTRY]"),
};
// Make the request
await translationServiceClient.DeleteGlossaryEntryAsync(request);

DeleteGlossaryEntryAsync(DeleteGlossaryEntryRequest, CancellationToken)

public virtual Task DeleteGlossaryEntryAsync(DeleteGlossaryEntryRequest request, CancellationToken cancellationToken)

Deletes a single entry from the glossary

Parameters
Name Description
request DeleteGlossaryEntryRequest

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

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
Task

A Task containing the RPC response.

Example
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
DeleteGlossaryEntryRequest request = new DeleteGlossaryEntryRequest
{
    GlossaryEntryName = GlossaryEntryName.FromProjectLocationGlossaryGlossaryEntry("[PROJECT]", "[LOCATION]", "[GLOSSARY]", "[GLOSSARY_ENTRY]"),
};
// Make the request
await translationServiceClient.DeleteGlossaryEntryAsync(request);

DeleteGlossaryEntryAsync(GlossaryEntryName, CallSettings)

public virtual Task DeleteGlossaryEntryAsync(GlossaryEntryName name, CallSettings callSettings = null)

Deletes a single entry from the glossary

Parameters
Name Description
name GlossaryEntryName

Required. The resource name of the glossary entry to delete

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Task

A Task containing the RPC response.

Example
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
GlossaryEntryName name = GlossaryEntryName.FromProjectLocationGlossaryGlossaryEntry("[PROJECT]", "[LOCATION]", "[GLOSSARY]", "[GLOSSARY_ENTRY]");
// Make the request
await translationServiceClient.DeleteGlossaryEntryAsync(name);

DeleteGlossaryEntryAsync(GlossaryEntryName, CancellationToken)

public virtual Task DeleteGlossaryEntryAsync(GlossaryEntryName name, CancellationToken cancellationToken)

Deletes a single entry from the glossary

Parameters
Name Description
name GlossaryEntryName

Required. The resource name of the glossary entry to delete

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
Task

A Task containing the RPC response.

Example
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
GlossaryEntryName name = GlossaryEntryName.FromProjectLocationGlossaryGlossaryEntry("[PROJECT]", "[LOCATION]", "[GLOSSARY]", "[GLOSSARY_ENTRY]");
// Make the request
await translationServiceClient.DeleteGlossaryEntryAsync(name);

DeleteGlossaryEntryAsync(string, CallSettings)

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

Deletes a single entry from the glossary

Parameters
Name Description
name string

Required. The resource name of the glossary entry to delete

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Task

A Task containing the RPC response.

Example
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/glossaries/[GLOSSARY]/glossaryEntries/[GLOSSARY_ENTRY]";
// Make the request
await translationServiceClient.DeleteGlossaryEntryAsync(name);

DeleteGlossaryEntryAsync(string, CancellationToken)

public virtual Task DeleteGlossaryEntryAsync(string name, CancellationToken cancellationToken)

Deletes a single entry from the glossary

Parameters
Name Description
name string

Required. The resource name of the glossary entry to delete

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
Task

A Task containing the RPC response.

Example
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/glossaries/[GLOSSARY]/glossaryEntries/[GLOSSARY_ENTRY]";
// Make the request
await translationServiceClient.DeleteGlossaryEntryAsync(name);

DeleteModel(DeleteModelRequest, CallSettings)

public virtual Operation<Empty, DeleteModelMetadata> DeleteModel(DeleteModelRequest request, CallSettings callSettings = null)

Deletes a model.

Parameters
Name Description
request DeleteModelRequest

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
OperationEmptyDeleteModelMetadata

The RPC response.

Example
// Create client
TranslationServiceClient translationServiceClient = TranslationServiceClient.Create();
// Initialize request argument(s)
DeleteModelRequest request = new DeleteModelRequest
{
    ModelName = ModelName.FromProjectLocationModel("[PROJECT]", "[LOCATION]", "[MODEL]"),
};
// Make the request
Operation<Empty, DeleteModelMetadata> response = translationServiceClient.DeleteModel(request);

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

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

DeleteModel(ModelName, CallSettings)

public virtual Operation<Empty, DeleteModelMetadata> DeleteModel(ModelName name, CallSettings callSettings = null)

Deletes a model.

Parameters
Name Description
name ModelName

Required. The name of the model to delete.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
OperationEmptyDeleteModelMetadata

The RPC response.

Example
// Create client
TranslationServiceClient translationServiceClient = TranslationServiceClient.Create();
// Initialize request argument(s)
ModelName name = ModelName.FromProjectLocationModel("[PROJECT]", "[LOCATION]", "[MODEL]");
// Make the request
Operation<Empty, DeleteModelMetadata> response = translationServiceClient.DeleteModel(name);

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

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

DeleteModel(string, CallSettings)

public virtual Operation<Empty, DeleteModelMetadata> DeleteModel(string name, CallSettings callSettings = null)

Deletes a model.

Parameters
Name Description
name string

Required. The name of the model to delete.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
OperationEmptyDeleteModelMetadata

The RPC response.

Example
// Create client
TranslationServiceClient translationServiceClient = TranslationServiceClient.Create();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/models/[MODEL]";
// Make the request
Operation<Empty, DeleteModelMetadata> response = translationServiceClient.DeleteModel(name);

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

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

DeleteModelAsync(DeleteModelRequest, CallSettings)

public virtual Task<Operation<Empty, DeleteModelMetadata>> DeleteModelAsync(DeleteModelRequest request, CallSettings callSettings = null)

Deletes a model.

Parameters
Name Description
request DeleteModelRequest

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
TaskOperationEmptyDeleteModelMetadata

A Task containing the RPC response.

Example
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
DeleteModelRequest request = new DeleteModelRequest
{
    ModelName = ModelName.FromProjectLocationModel("[PROJECT]", "[LOCATION]", "[MODEL]"),
};
// Make the request
Operation<Empty, DeleteModelMetadata> response = await translationServiceClient.DeleteModelAsync(request);

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

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

DeleteModelAsync(DeleteModelRequest, CancellationToken)

public virtual Task<Operation<Empty, DeleteModelMetadata>> DeleteModelAsync(DeleteModelRequest request, CancellationToken cancellationToken)

Deletes a model.

Parameters
Name Description
request DeleteModelRequest

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

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskOperationEmptyDeleteModelMetadata

A Task containing the RPC response.

Example
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
DeleteModelRequest request = new DeleteModelRequest
{
    ModelName = ModelName.FromProjectLocationModel("[PROJECT]", "[LOCATION]", "[MODEL]"),
};
// Make the request
Operation<Empty, DeleteModelMetadata> response = await translationServiceClient.DeleteModelAsync(request);

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

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

DeleteModelAsync(ModelName, CallSettings)

public virtual Task<Operation<Empty, DeleteModelMetadata>> DeleteModelAsync(ModelName name, CallSettings callSettings = null)

Deletes a model.

Parameters
Name Description
name ModelName

Required. The name of the model to delete.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskOperationEmptyDeleteModelMetadata

A Task containing the RPC response.

Example
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
ModelName name = ModelName.FromProjectLocationModel("[PROJECT]", "[LOCATION]", "[MODEL]");
// Make the request
Operation<Empty, DeleteModelMetadata> response = await translationServiceClient.DeleteModelAsync(name);

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

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

DeleteModelAsync(ModelName, CancellationToken)

public virtual Task<Operation<Empty, DeleteModelMetadata>> DeleteModelAsync(ModelName name, CancellationToken cancellationToken)

Deletes a model.

Parameters
Name Description
name ModelName

Required. The name of the model to delete.

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskOperationEmptyDeleteModelMetadata

A Task containing the RPC response.

Example
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
ModelName name = ModelName.FromProjectLocationModel("[PROJECT]", "[LOCATION]", "[MODEL]");
// Make the request
Operation<Empty, DeleteModelMetadata> response = await translationServiceClient.DeleteModelAsync(name);

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

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

DeleteModelAsync(string, CallSettings)

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

Deletes a model.

Parameters
Name Description
name string

Required. The name of the model to delete.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskOperationEmptyDeleteModelMetadata

A Task containing the RPC response.

Example
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/models/[MODEL]";
// Make the request
Operation<Empty, DeleteModelMetadata> response = await translationServiceClient.DeleteModelAsync(name);

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

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

DeleteModelAsync(string, CancellationToken)

public virtual Task<Operation<Empty, DeleteModelMetadata>> DeleteModelAsync(string name, CancellationToken cancellationToken)

Deletes a model.

Parameters
Name Description
name string

Required. The name of the model to delete.

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskOperationEmptyDeleteModelMetadata

A Task containing the RPC response.

Example
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/models/[MODEL]";
// Make the request
Operation<Empty, DeleteModelMetadata> response = await translationServiceClient.DeleteModelAsync(name);

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

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

DetectLanguage(LocationName, string, string, string, CallSettings)

public virtual DetectLanguageResponse DetectLanguage(LocationName parent, string model, string mimeType, string content, CallSettings callSettings = null)

Detects the language of text within a request.

Parameters
Name Description
parent LocationName

Required. Project or location to make a call. Must refer to a caller's project.

Format: projects/{project-number-or-id}/locations/{location-id} or projects/{project-number-or-id}.

For global calls, use projects/{project-number-or-id}/locations/global or projects/{project-number-or-id}.

Only models within the same region (has same location-id) can be used. Otherwise an INVALID_ARGUMENT (400) error is returned.

model string

Optional. The language detection model to be used.

Format: projects/{project-number-or-id}/locations/{location-id}/models/language-detection/{model-id}

Only one language detection model is currently supported: projects/{project-number-or-id}/locations/{location-id}/models/language-detection/default.

If not specified, the default model is used.

mimeType string

Optional. The format of the source text, for example, "text/html", "text/plain". If left blank, the MIME type defaults to "text/html".

content string

The content of the input stored as a string.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
DetectLanguageResponse

The RPC response.

Example
// Create client
TranslationServiceClient translationServiceClient = TranslationServiceClient.Create();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
string model = "";
string mimeType = "";
string content = "";
// Make the request
DetectLanguageResponse response = translationServiceClient.DetectLanguage(parent, model, mimeType, content);

DetectLanguage(DetectLanguageRequest, CallSettings)

public virtual DetectLanguageResponse DetectLanguage(DetectLanguageRequest request, CallSettings callSettings = null)

Detects the language of text within a request.

Parameters
Name Description
request DetectLanguageRequest

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
DetectLanguageResponse

The RPC response.

Example
// Create client
TranslationServiceClient translationServiceClient = TranslationServiceClient.Create();
// Initialize request argument(s)
DetectLanguageRequest request = new DetectLanguageRequest
{
    Content = "",
    MimeType = "",
    Model = "",
    ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
    Labels = { { "", "" }, },
};
// Make the request
DetectLanguageResponse response = translationServiceClient.DetectLanguage(request);

DetectLanguage(string, string, string, string, CallSettings)

public virtual DetectLanguageResponse DetectLanguage(string parent, string model, string mimeType, string content, CallSettings callSettings = null)

Detects the language of text within a request.

Parameters
Name Description
parent string

Required. Project or location to make a call. Must refer to a caller's project.

Format: projects/{project-number-or-id}/locations/{location-id} or projects/{project-number-or-id}.

For global calls, use projects/{project-number-or-id}/locations/global or projects/{project-number-or-id}.

Only models within the same region (has same location-id) can be used. Otherwise an INVALID_ARGUMENT (400) error is returned.

model string

Optional. The language detection model to be used.

Format: projects/{project-number-or-id}/locations/{location-id}/models/language-detection/{model-id}

Only one language detection model is currently supported: projects/{project-number-or-id}/locations/{location-id}/models/language-detection/default.

If not specified, the default model is used.

mimeType string

Optional. The format of the source text, for example, "text/html", "text/plain". If left blank, the MIME type defaults to "text/html".

content string

The content of the input stored as a string.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
DetectLanguageResponse

The RPC response.

Example
// Create client
TranslationServiceClient translationServiceClient = TranslationServiceClient.Create();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]";
string model = "";
string mimeType = "";
string content = "";
// Make the request
DetectLanguageResponse response = translationServiceClient.DetectLanguage(parent, model, mimeType, content);

DetectLanguageAsync(LocationName, string, string, string, CallSettings)

public virtual Task<DetectLanguageResponse> DetectLanguageAsync(LocationName parent, string model, string mimeType, string content, CallSettings callSettings = null)

Detects the language of text within a request.

Parameters
Name Description
parent LocationName

Required. Project or location to make a call. Must refer to a caller's project.

Format: projects/{project-number-or-id}/locations/{location-id} or projects/{project-number-or-id}.

For global calls, use projects/{project-number-or-id}/locations/global or projects/{project-number-or-id}.

Only models within the same region (has same location-id) can be used. Otherwise an INVALID_ARGUMENT (400) error is returned.

model string

Optional. The language detection model to be used.

Format: projects/{project-number-or-id}/locations/{location-id}/models/language-detection/{model-id}

Only one language detection model is currently supported: projects/{project-number-or-id}/locations/{location-id}/models/language-detection/default.

If not specified, the default model is used.

mimeType string

Optional. The format of the source text, for example, "text/html", "text/plain". If left blank, the MIME type defaults to "text/html".

content string

The content of the input stored as a string.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskDetectLanguageResponse

A Task containing the RPC response.

Example
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
string model = "";
string mimeType = "";
string content = "";
// Make the request
DetectLanguageResponse response = await translationServiceClient.DetectLanguageAsync(parent, model, mimeType, content);

DetectLanguageAsync(LocationName, string, string, string, CancellationToken)

public virtual Task<DetectLanguageResponse> DetectLanguageAsync(LocationName parent, string model, string mimeType, string content, CancellationToken cancellationToken)

Detects the language of text within a request.

Parameters
Name Description
parent LocationName

Required. Project or location to make a call. Must refer to a caller's project.

Format: projects/{project-number-or-id}/locations/{location-id} or projects/{project-number-or-id}.

For global calls, use projects/{project-number-or-id}/locations/global or projects/{project-number-or-id}.

Only models within the same region (has same location-id) can be used. Otherwise an INVALID_ARGUMENT (400) error is returned.

model string

Optional. The language detection model to be used.

Format: projects/{project-number-or-id}/locations/{location-id}/models/language-detection/{model-id}

Only one language detection model is currently supported: projects/{project-number-or-id}/locations/{location-id}/models/language-detection/default.

If not specified, the default model is used.

mimeType string

Optional. The format of the source text, for example, "text/html", "text/plain". If left blank, the MIME type defaults to "text/html".

content string

The content of the input stored as a string.

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskDetectLanguageResponse

A Task containing the RPC response.

Example
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
string model = "";
string mimeType = "";
string content = "";
// Make the request
DetectLanguageResponse response = await translationServiceClient.DetectLanguageAsync(parent, model, mimeType, content);

DetectLanguageAsync(DetectLanguageRequest, CallSettings)

public virtual Task<DetectLanguageResponse> DetectLanguageAsync(DetectLanguageRequest request, CallSettings callSettings = null)

Detects the language of text within a request.

Parameters
Name Description
request DetectLanguageRequest

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
TaskDetectLanguageResponse

A Task containing the RPC response.

Example
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
DetectLanguageRequest request = new DetectLanguageRequest
{
    Content = "",
    MimeType = "",
    Model = "",
    ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
    Labels = { { "", "" }, },
};
// Make the request
DetectLanguageResponse response = await translationServiceClient.DetectLanguageAsync(request);

DetectLanguageAsync(DetectLanguageRequest, CancellationToken)

public virtual Task<DetectLanguageResponse> DetectLanguageAsync(DetectLanguageRequest request, CancellationToken cancellationToken)

Detects the language of text within a request.

Parameters
Name Description
request DetectLanguageRequest

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

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskDetectLanguageResponse

A Task containing the RPC response.

Example
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
DetectLanguageRequest request = new DetectLanguageRequest
{
    Content = "",
    MimeType = "",
    Model = "",
    ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
    Labels = { { "", "" }, },
};
// Make the request
DetectLanguageResponse response = await translationServiceClient.DetectLanguageAsync(request);

DetectLanguageAsync(string, string, string, string, CallSettings)

public virtual Task<DetectLanguageResponse> DetectLanguageAsync(string parent, string model, string mimeType, string content, CallSettings callSettings = null)

Detects the language of text within a request.

Parameters
Name Description
parent string

Required. Project or location to make a call. Must refer to a caller's project.

Format: projects/{project-number-or-id}/locations/{location-id} or projects/{project-number-or-id}.

For global calls, use projects/{project-number-or-id}/locations/global or projects/{project-number-or-id}.

Only models within the same region (has same location-id) can be used. Otherwise an INVALID_ARGUMENT (400) error is returned.

model string

Optional. The language detection model to be used.

Format: projects/{project-number-or-id}/locations/{location-id}/models/language-detection/{model-id}

Only one language detection model is currently supported: projects/{project-number-or-id}/locations/{location-id}/models/language-detection/default.

If not specified, the default model is used.

mimeType string

Optional. The format of the source text, for example, "text/html", "text/plain". If left blank, the MIME type defaults to "text/html".

content string

The content of the input stored as a string.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskDetectLanguageResponse

A Task containing the RPC response.

Example
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]";
string model = "";
string mimeType = "";
string content = "";
// Make the request
DetectLanguageResponse response = await translationServiceClient.DetectLanguageAsync(parent, model, mimeType, content);

DetectLanguageAsync(string, string, string, string, CancellationToken)

public virtual Task<DetectLanguageResponse> DetectLanguageAsync(string parent, string model, string mimeType, string content, CancellationToken cancellationToken)

Detects the language of text within a request.

Parameters
Name Description
parent string

Required. Project or location to make a call. Must refer to a caller's project.

Format: projects/{project-number-or-id}/locations/{location-id} or projects/{project-number-or-id}.

For global calls, use projects/{project-number-or-id}/locations/global or projects/{project-number-or-id}.

Only models within the same region (has same location-id) can be used. Otherwise an INVALID_ARGUMENT (400) error is returned.

model string

Optional. The language detection model to be used.

Format: projects/{project-number-or-id}/locations/{location-id}/models/language-detection/{model-id}

Only one language detection model is currently supported: projects/{project-number-or-id}/locations/{location-id}/models/language-detection/default.

If not specified, the default model is used.

mimeType string

Optional. The format of the source text, for example, "text/html", "text/plain". If left blank, the MIME type defaults to "text/html".

content string

The content of the input stored as a string.

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskDetectLanguageResponse

A Task containing the RPC response.

Example
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]";
string model = "";
string mimeType = "";
string content = "";
// Make the request
DetectLanguageResponse response = await translationServiceClient.DetectLanguageAsync(parent, model, mimeType, content);

ExportData(ExportDataRequest, CallSettings)

public virtual Operation<Empty, ExportDataMetadata> ExportData(ExportDataRequest request, CallSettings callSettings = null)

Exports dataset's data to the provided output location.

Parameters
Name Description
request ExportDataRequest

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
OperationEmptyExportDataMetadata

The RPC response.

Example
// Create client
TranslationServiceClient translationServiceClient = TranslationServiceClient.Create();
// Initialize request argument(s)
ExportDataRequest request = new ExportDataRequest
{
    Dataset = "",
    OutputConfig = new DatasetOutputConfig(),
};
// Make the request
Operation<Empty, ExportDataMetadata> response = translationServiceClient.ExportData(request);

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

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

ExportData(string, DatasetOutputConfig, CallSettings)

public virtual Operation<Empty, ExportDataMetadata> ExportData(string dataset, DatasetOutputConfig outputConfig, CallSettings callSettings = null)

Exports dataset's data to the provided output location.

Parameters
Name Description
dataset string

Required. Name of the dataset. In form of projects/{project-number-or-id}/locations/{location-id}/datasets/{dataset-id}

outputConfig DatasetOutputConfig

Required. The config for the output content.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
OperationEmptyExportDataMetadata

The RPC response.

Example
// Create client
TranslationServiceClient translationServiceClient = TranslationServiceClient.Create();
// Initialize request argument(s)
string dataset = "";
DatasetOutputConfig outputConfig = new DatasetOutputConfig();
// Make the request
Operation<Empty, ExportDataMetadata> response = translationServiceClient.ExportData(dataset, outputConfig);

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

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

ExportDataAsync(ExportDataRequest, CallSettings)

public virtual Task<Operation<Empty, ExportDataMetadata>> ExportDataAsync(ExportDataRequest request, CallSettings callSettings = null)

Exports dataset's data to the provided output location.

Parameters
Name Description
request ExportDataRequest

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
TaskOperationEmptyExportDataMetadata

A Task containing the RPC response.

Example
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
ExportDataRequest request = new ExportDataRequest
{
    Dataset = "",
    OutputConfig = new DatasetOutputConfig(),
};
// Make the request
Operation<Empty, ExportDataMetadata> response = await translationServiceClient.ExportDataAsync(request);

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

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

ExportDataAsync(ExportDataRequest, CancellationToken)

public virtual Task<Operation<Empty, ExportDataMetadata>> ExportDataAsync(ExportDataRequest request, CancellationToken cancellationToken)

Exports dataset's data to the provided output location.

Parameters
Name Description
request ExportDataRequest

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

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskOperationEmptyExportDataMetadata

A Task containing the RPC response.

Example
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
ExportDataRequest request = new ExportDataRequest
{
    Dataset = "",
    OutputConfig = new DatasetOutputConfig(),
};
// Make the request
Operation<Empty, ExportDataMetadata> response = await translationServiceClient.ExportDataAsync(request);

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

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

ExportDataAsync(string, DatasetOutputConfig, CallSettings)

public virtual Task<Operation<Empty, ExportDataMetadata>> ExportDataAsync(string dataset, DatasetOutputConfig outputConfig, CallSettings callSettings = null)

Exports dataset's data to the provided output location.

Parameters
Name Description
dataset string

Required. Name of the dataset. In form of projects/{project-number-or-id}/locations/{location-id}/datasets/{dataset-id}

outputConfig DatasetOutputConfig

Required. The config for the output content.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskOperationEmptyExportDataMetadata

A Task containing the RPC response.

Example
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
string dataset = "";
DatasetOutputConfig outputConfig = new DatasetOutputConfig();
// Make the request
Operation<Empty, ExportDataMetadata> response = await translationServiceClient.ExportDataAsync(dataset, outputConfig);

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

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

ExportDataAsync(string, DatasetOutputConfig, CancellationToken)

public virtual Task<Operation<Empty, ExportDataMetadata>> ExportDataAsync(string dataset, DatasetOutputConfig outputConfig, CancellationToken cancellationToken)

Exports dataset's data to the provided output location.

Parameters
Name Description
dataset string

Required. Name of the dataset. In form of projects/{project-number-or-id}/locations/{location-id}/datasets/{dataset-id}

outputConfig DatasetOutputConfig

Required. The config for the output content.

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskOperationEmptyExportDataMetadata

A Task containing the RPC response.

Example
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
string dataset = "";
DatasetOutputConfig outputConfig = new DatasetOutputConfig();
// Make the request
Operation<Empty, ExportDataMetadata> response = await translationServiceClient.ExportDataAsync(dataset, outputConfig);

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

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

GetAdaptiveMtDataset(AdaptiveMtDatasetName, CallSettings)

public virtual AdaptiveMtDataset GetAdaptiveMtDataset(AdaptiveMtDatasetName name, CallSettings callSettings = null)

Gets the Adaptive MT dataset.

Parameters
Name Description
name AdaptiveMtDatasetName

Required. Name of the dataset. In the form of projects/{project-number-or-id}/locations/{location-id}/adaptiveMtDatasets/{adaptive-mt-dataset-id}

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
AdaptiveMtDataset

The RPC response.

Example
// Create client
TranslationServiceClient translationServiceClient = TranslationServiceClient.Create();
// Initialize request argument(s)
AdaptiveMtDatasetName name = AdaptiveMtDatasetName.FromProjectLocationDataset("[PROJECT]", "[LOCATION]", "[DATASET]");
// Make the request
AdaptiveMtDataset response = translationServiceClient.GetAdaptiveMtDataset(name);

GetAdaptiveMtDataset(GetAdaptiveMtDatasetRequest, CallSettings)

public virtual AdaptiveMtDataset GetAdaptiveMtDataset(GetAdaptiveMtDatasetRequest request, CallSettings callSettings = null)

Gets the Adaptive MT dataset.

Parameters
Name Description
request GetAdaptiveMtDatasetRequest

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
AdaptiveMtDataset

The RPC response.

Example
// Create client
TranslationServiceClient translationServiceClient = TranslationServiceClient.Create();
// Initialize request argument(s)
GetAdaptiveMtDatasetRequest request = new GetAdaptiveMtDatasetRequest
{
    AdaptiveMtDatasetName = AdaptiveMtDatasetName.FromProjectLocationDataset("[PROJECT]", "[LOCATION]", "[DATASET]"),
};
// Make the request
AdaptiveMtDataset response = translationServiceClient.GetAdaptiveMtDataset(request);

GetAdaptiveMtDataset(string, CallSettings)

public virtual AdaptiveMtDataset GetAdaptiveMtDataset(string name, CallSettings callSettings = null)

Gets the Adaptive MT dataset.

Parameters
Name Description
name string

Required. Name of the dataset. In the form of projects/{project-number-or-id}/locations/{location-id}/adaptiveMtDatasets/{adaptive-mt-dataset-id}

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
AdaptiveMtDataset

The RPC response.

Example
// Create client
TranslationServiceClient translationServiceClient = TranslationServiceClient.Create();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/adaptiveMtDatasets/[DATASET]";
// Make the request
AdaptiveMtDataset response = translationServiceClient.GetAdaptiveMtDataset(name);

GetAdaptiveMtDatasetAsync(AdaptiveMtDatasetName, CallSettings)

public virtual Task<AdaptiveMtDataset> GetAdaptiveMtDatasetAsync(AdaptiveMtDatasetName name, CallSettings callSettings = null)

Gets the Adaptive MT dataset.

Parameters
Name Description
name AdaptiveMtDatasetName

Required. Name of the dataset. In the form of projects/{project-number-or-id}/locations/{location-id}/adaptiveMtDatasets/{adaptive-mt-dataset-id}

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskAdaptiveMtDataset

A Task containing the RPC response.

Example
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
AdaptiveMtDatasetName name = AdaptiveMtDatasetName.FromProjectLocationDataset("[PROJECT]", "[LOCATION]", "[DATASET]");
// Make the request
AdaptiveMtDataset response = await translationServiceClient.GetAdaptiveMtDatasetAsync(name);

GetAdaptiveMtDatasetAsync(AdaptiveMtDatasetName, CancellationToken)

public virtual Task<AdaptiveMtDataset> GetAdaptiveMtDatasetAsync(AdaptiveMtDatasetName name, CancellationToken cancellationToken)

Gets the Adaptive MT dataset.

Parameters
Name Description
name AdaptiveMtDatasetName

Required. Name of the dataset. In the form of projects/{project-number-or-id}/locations/{location-id}/adaptiveMtDatasets/{adaptive-mt-dataset-id}

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskAdaptiveMtDataset

A Task containing the RPC response.

Example
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
AdaptiveMtDatasetName name = AdaptiveMtDatasetName.FromProjectLocationDataset("[PROJECT]", "[LOCATION]", "[DATASET]");
// Make the request
AdaptiveMtDataset response = await translationServiceClient.GetAdaptiveMtDatasetAsync(name);

GetAdaptiveMtDatasetAsync(GetAdaptiveMtDatasetRequest, CallSettings)

public virtual Task<AdaptiveMtDataset> GetAdaptiveMtDatasetAsync(GetAdaptiveMtDatasetRequest request, CallSettings callSettings = null)

Gets the Adaptive MT dataset.

Parameters
Name Description
request GetAdaptiveMtDatasetRequest

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
TaskAdaptiveMtDataset

A Task containing the RPC response.

Example
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
GetAdaptiveMtDatasetRequest request = new GetAdaptiveMtDatasetRequest
{
    AdaptiveMtDatasetName = AdaptiveMtDatasetName.FromProjectLocationDataset("[PROJECT]", "[LOCATION]", "[DATASET]"),
};
// Make the request
AdaptiveMtDataset response = await translationServiceClient.GetAdaptiveMtDatasetAsync(request);

GetAdaptiveMtDatasetAsync(GetAdaptiveMtDatasetRequest, CancellationToken)

public virtual Task<AdaptiveMtDataset> GetAdaptiveMtDatasetAsync(GetAdaptiveMtDatasetRequest request, CancellationToken cancellationToken)

Gets the Adaptive MT dataset.

Parameters
Name Description
request GetAdaptiveMtDatasetRequest

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

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskAdaptiveMtDataset

A Task containing the RPC response.

Example
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
GetAdaptiveMtDatasetRequest request = new GetAdaptiveMtDatasetRequest
{
    AdaptiveMtDatasetName = AdaptiveMtDatasetName.FromProjectLocationDataset("[PROJECT]", "[LOCATION]", "[DATASET]"),
};
// Make the request
AdaptiveMtDataset response = await translationServiceClient.GetAdaptiveMtDatasetAsync(request);

GetAdaptiveMtDatasetAsync(string, CallSettings)

public virtual Task<AdaptiveMtDataset> GetAdaptiveMtDatasetAsync(string name, CallSettings callSettings = null)

Gets the Adaptive MT dataset.

Parameters
Name Description
name string

Required. Name of the dataset. In the form of projects/{project-number-or-id}/locations/{location-id}/adaptiveMtDatasets/{adaptive-mt-dataset-id}

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskAdaptiveMtDataset

A Task containing the RPC response.

Example
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/adaptiveMtDatasets/[DATASET]";
// Make the request
AdaptiveMtDataset response = await translationServiceClient.GetAdaptiveMtDatasetAsync(name);

GetAdaptiveMtDatasetAsync(string, CancellationToken)

public virtual Task<AdaptiveMtDataset> GetAdaptiveMtDatasetAsync(string name, CancellationToken cancellationToken)

Gets the Adaptive MT dataset.

Parameters
Name Description
name string

Required. Name of the dataset. In the form of projects/{project-number-or-id}/locations/{location-id}/adaptiveMtDatasets/{adaptive-mt-dataset-id}

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskAdaptiveMtDataset

A Task containing the RPC response.

Example
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/adaptiveMtDatasets/[DATASET]";
// Make the request
AdaptiveMtDataset response = await translationServiceClient.GetAdaptiveMtDatasetAsync(name);

GetAdaptiveMtFile(AdaptiveMtFileName, CallSettings)

public virtual AdaptiveMtFile GetAdaptiveMtFile(AdaptiveMtFileName name, CallSettings callSettings = null)

Gets and AdaptiveMtFile

Parameters
Name Description
name AdaptiveMtFileName

Required. The resource name of the file, in form of projects/{project-number-or-id}/locations/{location_id}/adaptiveMtDatasets/{dataset}/adaptiveMtFiles/{file}

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
AdaptiveMtFile

The RPC response.

Example
// Create client
TranslationServiceClient translationServiceClient = TranslationServiceClient.Create();
// Initialize request argument(s)
AdaptiveMtFileName name = AdaptiveMtFileName.FromProjectLocationDatasetFile("[PROJECT]", "[LOCATION]", "[DATASET]", "[FILE]");
// Make the request
AdaptiveMtFile response = translationServiceClient.GetAdaptiveMtFile(name);

GetAdaptiveMtFile(GetAdaptiveMtFileRequest, CallSettings)

public virtual AdaptiveMtFile GetAdaptiveMtFile(GetAdaptiveMtFileRequest request, CallSettings callSettings = null)

Gets and AdaptiveMtFile

Parameters
Name Description
request GetAdaptiveMtFileRequest

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
AdaptiveMtFile

The RPC response.

Example
// Create client
TranslationServiceClient translationServiceClient = TranslationServiceClient.Create();
// Initialize request argument(s)
GetAdaptiveMtFileRequest request = new GetAdaptiveMtFileRequest
{
    AdaptiveMtFileName = AdaptiveMtFileName.FromProjectLocationDatasetFile("[PROJECT]", "[LOCATION]", "[DATASET]", "[FILE]"),
};
// Make the request
AdaptiveMtFile response = translationServiceClient.GetAdaptiveMtFile(request);

GetAdaptiveMtFile(string, CallSettings)

public virtual AdaptiveMtFile GetAdaptiveMtFile(string name, CallSettings callSettings = null)

Gets and AdaptiveMtFile

Parameters
Name Description
name string

Required. The resource name of the file, in form of projects/{project-number-or-id}/locations/{location_id}/adaptiveMtDatasets/{dataset}/adaptiveMtFiles/{file}

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
AdaptiveMtFile

The RPC response.

Example
// Create client
TranslationServiceClient translationServiceClient = TranslationServiceClient.Create();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/adaptiveMtDatasets/[DATASET]/adaptiveMtFiles/[FILE]";
// Make the request
AdaptiveMtFile response = translationServiceClient.GetAdaptiveMtFile(name);

GetAdaptiveMtFileAsync(AdaptiveMtFileName, CallSettings)

public virtual Task<AdaptiveMtFile> GetAdaptiveMtFileAsync(AdaptiveMtFileName name, CallSettings callSettings = null)

Gets and AdaptiveMtFile

Parameters
Name Description
name AdaptiveMtFileName

Required. The resource name of the file, in form of projects/{project-number-or-id}/locations/{location_id}/adaptiveMtDatasets/{dataset}/adaptiveMtFiles/{file}

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskAdaptiveMtFile

A Task containing the RPC response.

Example
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
AdaptiveMtFileName name = AdaptiveMtFileName.FromProjectLocationDatasetFile("[PROJECT]", "[LOCATION]", "[DATASET]", "[FILE]");
// Make the request
AdaptiveMtFile response = await translationServiceClient.GetAdaptiveMtFileAsync(name);

GetAdaptiveMtFileAsync(AdaptiveMtFileName, CancellationToken)

public virtual Task<AdaptiveMtFile> GetAdaptiveMtFileAsync(AdaptiveMtFileName name, CancellationToken cancellationToken)

Gets and AdaptiveMtFile

Parameters
Name Description
name AdaptiveMtFileName

Required. The resource name of the file, in form of projects/{project-number-or-id}/locations/{location_id}/adaptiveMtDatasets/{dataset}/adaptiveMtFiles/{file}

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskAdaptiveMtFile

A Task containing the RPC response.

Example
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
AdaptiveMtFileName name = AdaptiveMtFileName.FromProjectLocationDatasetFile("[PROJECT]", "[LOCATION]", "[DATASET]", "[FILE]");
// Make the request
AdaptiveMtFile response = await translationServiceClient.GetAdaptiveMtFileAsync(name);

GetAdaptiveMtFileAsync(GetAdaptiveMtFileRequest, CallSettings)

public virtual Task<AdaptiveMtFile> GetAdaptiveMtFileAsync(GetAdaptiveMtFileRequest request, CallSettings callSettings = null)

Gets and AdaptiveMtFile

Parameters
Name Description
request GetAdaptiveMtFileRequest

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
TaskAdaptiveMtFile

A Task containing the RPC response.

Example
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
GetAdaptiveMtFileRequest request = new GetAdaptiveMtFileRequest
{
    AdaptiveMtFileName = AdaptiveMtFileName.FromProjectLocationDatasetFile("[PROJECT]", "[LOCATION]", "[DATASET]", "[FILE]"),
};
// Make the request
AdaptiveMtFile response = await translationServiceClient.GetAdaptiveMtFileAsync(request);

GetAdaptiveMtFileAsync(GetAdaptiveMtFileRequest, CancellationToken)

public virtual Task<AdaptiveMtFile> GetAdaptiveMtFileAsync(GetAdaptiveMtFileRequest request, CancellationToken cancellationToken)

Gets and AdaptiveMtFile

Parameters
Name Description
request GetAdaptiveMtFileRequest

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

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskAdaptiveMtFile

A Task containing the RPC response.

Example
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
GetAdaptiveMtFileRequest request = new GetAdaptiveMtFileRequest
{
    AdaptiveMtFileName = AdaptiveMtFileName.FromProjectLocationDatasetFile("[PROJECT]", "[LOCATION]", "[DATASET]", "[FILE]"),
};
// Make the request
AdaptiveMtFile response = await translationServiceClient.GetAdaptiveMtFileAsync(request);

GetAdaptiveMtFileAsync(string, CallSettings)

public virtual Task<AdaptiveMtFile> GetAdaptiveMtFileAsync(string name, CallSettings callSettings = null)

Gets and AdaptiveMtFile

Parameters
Name Description
name string

Required. The resource name of the file, in form of projects/{project-number-or-id}/locations/{location_id}/adaptiveMtDatasets/{dataset}/adaptiveMtFiles/{file}

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskAdaptiveMtFile

A Task containing the RPC response.

Example
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/adaptiveMtDatasets/[DATASET]/adaptiveMtFiles/[FILE]";
// Make the request
AdaptiveMtFile response = await translationServiceClient.GetAdaptiveMtFileAsync(name);

GetAdaptiveMtFileAsync(string, CancellationToken)

public virtual Task<AdaptiveMtFile> GetAdaptiveMtFileAsync(string name, CancellationToken cancellationToken)

Gets and AdaptiveMtFile

Parameters
Name Description
name string

Required. The resource name of the file, in form of projects/{project-number-or-id}/locations/{location_id}/adaptiveMtDatasets/{dataset}/adaptiveMtFiles/{file}

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskAdaptiveMtFile

A Task containing the RPC response.

Example
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/adaptiveMtDatasets/[DATASET]/adaptiveMtFiles/[FILE]";
// Make the request
AdaptiveMtFile response = await translationServiceClient.GetAdaptiveMtFileAsync(name);

GetDataset(DatasetName, CallSettings)

public virtual Dataset GetDataset(DatasetName name, CallSettings callSettings = null)

Gets a Dataset.

Parameters
Name Description
name DatasetName

Required. The resource name of the dataset to retrieve.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Dataset

The RPC response.

Example
// Create client
TranslationServiceClient translationServiceClient = TranslationServiceClient.Create();
// Initialize request argument(s)
DatasetName name = DatasetName.FromProjectLocationDataset("[PROJECT]", "[LOCATION]", "[DATASET]");
// Make the request
Dataset response = translationServiceClient.GetDataset(name);

GetDataset(GetDatasetRequest, CallSettings)

public virtual Dataset GetDataset(GetDatasetRequest request, CallSettings callSettings = null)

Gets a Dataset.

Parameters
Name Description
request GetDatasetRequest

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
Dataset

The RPC response.

Example
// Create client
TranslationServiceClient translationServiceClient = TranslationServiceClient.Create();
// Initialize request argument(s)
GetDatasetRequest request = new GetDatasetRequest
{
    DatasetName = DatasetName.FromProjectLocationDataset("[PROJECT]", "[LOCATION]", "[DATASET]"),
};
// Make the request
Dataset response = translationServiceClient.GetDataset(request);

GetDataset(string, CallSettings)

public virtual Dataset GetDataset(string name, CallSettings callSettings = null)

Gets a Dataset.

Parameters
Name Description
name string

Required. The resource name of the dataset to retrieve.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Dataset

The RPC response.

Example
// Create client
TranslationServiceClient translationServiceClient = TranslationServiceClient.Create();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/datasets/[DATASET]";
// Make the request
Dataset response = translationServiceClient.GetDataset(name);

GetDatasetAsync(DatasetName, CallSettings)

public virtual Task<Dataset> GetDatasetAsync(DatasetName name, CallSettings callSettings = null)

Gets a Dataset.

Parameters
Name Description
name DatasetName

Required. The resource name of the dataset to retrieve.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskDataset

A Task containing the RPC response.

Example
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
DatasetName name = DatasetName.FromProjectLocationDataset("[PROJECT]", "[LOCATION]", "[DATASET]");
// Make the request
Dataset response = await translationServiceClient.GetDatasetAsync(name);

GetDatasetAsync(DatasetName, CancellationToken)

public virtual Task<Dataset> GetDatasetAsync(DatasetName name, CancellationToken cancellationToken)

Gets a Dataset.

Parameters
Name Description
name DatasetName

Required. The resource name of the dataset to retrieve.

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskDataset

A Task containing the RPC response.

Example
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
DatasetName name = DatasetName.FromProjectLocationDataset("[PROJECT]", "[LOCATION]", "[DATASET]");
// Make the request
Dataset response = await translationServiceClient.GetDatasetAsync(name);

GetDatasetAsync(GetDatasetRequest, CallSettings)

public virtual Task<Dataset> GetDatasetAsync(GetDatasetRequest request, CallSettings callSettings = null)

Gets a Dataset.

Parameters
Name Description
request GetDatasetRequest

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
TaskDataset

A Task containing the RPC response.

Example
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
GetDatasetRequest request = new GetDatasetRequest
{
    DatasetName = DatasetName.FromProjectLocationDataset("[PROJECT]", "[LOCATION]", "[DATASET]"),
};
// Make the request
Dataset response = await translationServiceClient.GetDatasetAsync(request);

GetDatasetAsync(GetDatasetRequest, CancellationToken)

public virtual Task<Dataset> GetDatasetAsync(GetDatasetRequest request, CancellationToken cancellationToken)

Gets a Dataset.

Parameters
Name Description
request GetDatasetRequest

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

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskDataset

A Task containing the RPC response.

Example
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
GetDatasetRequest request = new GetDatasetRequest
{
    DatasetName = DatasetName.FromProjectLocationDataset("[PROJECT]", "[LOCATION]", "[DATASET]"),
};
// Make the request
Dataset response = await translationServiceClient.GetDatasetAsync(request);

GetDatasetAsync(string, CallSettings)

public virtual Task<Dataset> GetDatasetAsync(string name, CallSettings callSettings = null)

Gets a Dataset.

Parameters
Name Description
name string

Required. The resource name of the dataset to retrieve.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskDataset

A Task containing the RPC response.

Example
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/datasets/[DATASET]";
// Make the request
Dataset response = await translationServiceClient.GetDatasetAsync(name);

GetDatasetAsync(string, CancellationToken)

public virtual Task<Dataset> GetDatasetAsync(string name, CancellationToken cancellationToken)

Gets a Dataset.

Parameters
Name Description
name string

Required. The resource name of the dataset to retrieve.

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskDataset

A Task containing the RPC response.

Example
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/datasets/[DATASET]";
// Make the request
Dataset response = await translationServiceClient.GetDatasetAsync(name);

GetGlossary(GetGlossaryRequest, CallSettings)

public virtual Glossary GetGlossary(GetGlossaryRequest request, CallSettings callSettings = null)

Gets a glossary. Returns NOT_FOUND, if the glossary doesn't exist.

Parameters
Name Description
request GetGlossaryRequest

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
Glossary

The RPC response.

Example
// Create client
TranslationServiceClient translationServiceClient = TranslationServiceClient.Create();
// Initialize request argument(s)
GetGlossaryRequest request = new GetGlossaryRequest
{
    GlossaryName = GlossaryName.FromProjectLocationGlossary("[PROJECT]", "[LOCATION]", "[GLOSSARY]"),
};
// Make the request
Glossary response = translationServiceClient.GetGlossary(request);

GetGlossary(GlossaryName, CallSettings)

public virtual Glossary GetGlossary(GlossaryName name, CallSettings callSettings = null)

Gets a glossary. Returns NOT_FOUND, if the glossary doesn't exist.

Parameters
Name Description
name GlossaryName

Required. The name of the glossary to retrieve.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Glossary

The RPC response.

Example
// Create client
TranslationServiceClient translationServiceClient = TranslationServiceClient.Create();
// Initialize request argument(s)
GlossaryName name = GlossaryName.FromProjectLocationGlossary("[PROJECT]", "[LOCATION]", "[GLOSSARY]");
// Make the request
Glossary response = translationServiceClient.GetGlossary(name);

GetGlossary(string, CallSettings)

public virtual Glossary GetGlossary(string name, CallSettings callSettings = null)

Gets a glossary. Returns NOT_FOUND, if the glossary doesn't exist.

Parameters
Name Description
name string

Required. The name of the glossary to retrieve.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Glossary

The RPC response.

Example
// Create client
TranslationServiceClient translationServiceClient = TranslationServiceClient.Create();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/glossaries/[GLOSSARY]";
// Make the request
Glossary response = translationServiceClient.GetGlossary(name);

GetGlossaryAsync(GetGlossaryRequest, CallSettings)

public virtual Task<Glossary> GetGlossaryAsync(GetGlossaryRequest request, CallSettings callSettings = null)

Gets a glossary. Returns NOT_FOUND, if the glossary doesn't exist.

Parameters
Name Description
request GetGlossaryRequest

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
TaskGlossary

A Task containing the RPC response.

Example
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
GetGlossaryRequest request = new GetGlossaryRequest
{
    GlossaryName = GlossaryName.FromProjectLocationGlossary("[PROJECT]", "[LOCATION]", "[GLOSSARY]"),
};
// Make the request
Glossary response = await translationServiceClient.GetGlossaryAsync(request);

GetGlossaryAsync(GetGlossaryRequest, CancellationToken)

public virtual Task<Glossary> GetGlossaryAsync(GetGlossaryRequest request, CancellationToken cancellationToken)

Gets a glossary. Returns NOT_FOUND, if the glossary doesn't exist.

Parameters
Name Description
request GetGlossaryRequest

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

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskGlossary

A Task containing the RPC response.

Example
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
GetGlossaryRequest request = new GetGlossaryRequest
{
    GlossaryName = GlossaryName.FromProjectLocationGlossary("[PROJECT]", "[LOCATION]", "[GLOSSARY]"),
};
// Make the request
Glossary response = await translationServiceClient.GetGlossaryAsync(request);

GetGlossaryAsync(GlossaryName, CallSettings)

public virtual Task<Glossary> GetGlossaryAsync(GlossaryName name, CallSettings callSettings = null)

Gets a glossary. Returns NOT_FOUND, if the glossary doesn't exist.

Parameters
Name Description
name GlossaryName

Required. The name of the glossary to retrieve.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskGlossary

A Task containing the RPC response.

Example
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
GlossaryName name = GlossaryName.FromProjectLocationGlossary("[PROJECT]", "[LOCATION]", "[GLOSSARY]");
// Make the request
Glossary response = await translationServiceClient.GetGlossaryAsync(name);

GetGlossaryAsync(GlossaryName, CancellationToken)

public virtual Task<Glossary> GetGlossaryAsync(GlossaryName name, CancellationToken cancellationToken)

Gets a glossary. Returns NOT_FOUND, if the glossary doesn't exist.

Parameters
Name Description
name GlossaryName

Required. The name of the glossary to retrieve.

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskGlossary

A Task containing the RPC response.

Example
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
GlossaryName name = GlossaryName.FromProjectLocationGlossary("[PROJECT]", "[LOCATION]", "[GLOSSARY]");
// Make the request
Glossary response = await translationServiceClient.GetGlossaryAsync(name);

GetGlossaryAsync(string, CallSettings)

public virtual Task<Glossary> GetGlossaryAsync(string name, CallSettings callSettings = null)

Gets a glossary. Returns NOT_FOUND, if the glossary doesn't exist.

Parameters
Name Description
name string

Required. The name of the glossary to retrieve.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskGlossary

A Task containing the RPC response.

Example
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/glossaries/[GLOSSARY]";
// Make the request
Glossary response = await translationServiceClient.GetGlossaryAsync(name);

GetGlossaryAsync(string, CancellationToken)

public virtual Task<Glossary> GetGlossaryAsync(string name, CancellationToken cancellationToken)

Gets a glossary. Returns NOT_FOUND, if the glossary doesn't exist.

Parameters
Name Description
name string

Required. The name of the glossary to retrieve.

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskGlossary

A Task containing the RPC response.

Example
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/glossaries/[GLOSSARY]";
// Make the request
Glossary response = await translationServiceClient.GetGlossaryAsync(name);

GetGlossaryEntry(GetGlossaryEntryRequest, CallSettings)

public virtual GlossaryEntry GetGlossaryEntry(GetGlossaryEntryRequest request, CallSettings callSettings = null)

Gets a single glossary entry by the given id.

Parameters
Name Description
request GetGlossaryEntryRequest

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
GlossaryEntry

The RPC response.

Example
// Create client
TranslationServiceClient translationServiceClient = TranslationServiceClient.Create();
// Initialize request argument(s)
GetGlossaryEntryRequest request = new GetGlossaryEntryRequest
{
    GlossaryEntryName = GlossaryEntryName.FromProjectLocationGlossaryGlossaryEntry("[PROJECT]", "[LOCATION]", "[GLOSSARY]", "[GLOSSARY_ENTRY]"),
};
// Make the request
GlossaryEntry response = translationServiceClient.GetGlossaryEntry(request);

GetGlossaryEntry(GlossaryEntryName, CallSettings)

public virtual GlossaryEntry GetGlossaryEntry(GlossaryEntryName name, CallSettings callSettings = null)

Gets a single glossary entry by the given id.

Parameters
Name Description
name GlossaryEntryName

Required. The resource name of the glossary entry to get

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
GlossaryEntry

The RPC response.

Example
// Create client
TranslationServiceClient translationServiceClient = TranslationServiceClient.Create();
// Initialize request argument(s)
GlossaryEntryName name = GlossaryEntryName.FromProjectLocationGlossaryGlossaryEntry("[PROJECT]", "[LOCATION]", "[GLOSSARY]", "[GLOSSARY_ENTRY]");
// Make the request
GlossaryEntry response = translationServiceClient.GetGlossaryEntry(name);

GetGlossaryEntry(string, CallSettings)

public virtual GlossaryEntry GetGlossaryEntry(string name, CallSettings callSettings = null)

Gets a single glossary entry by the given id.

Parameters
Name Description
name string

Required. The resource name of the glossary entry to get

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
GlossaryEntry

The RPC response.

Example
// Create client
TranslationServiceClient translationServiceClient = TranslationServiceClient.Create();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/glossaries/[GLOSSARY]/glossaryEntries/[GLOSSARY_ENTRY]";
// Make the request
GlossaryEntry response = translationServiceClient.GetGlossaryEntry(name);

GetGlossaryEntryAsync(GetGlossaryEntryRequest, CallSettings)

public virtual Task<GlossaryEntry> GetGlossaryEntryAsync(GetGlossaryEntryRequest request, CallSettings callSettings = null)

Gets a single glossary entry by the given id.

Parameters
Name Description
request GetGlossaryEntryRequest

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
TaskGlossaryEntry

A Task containing the RPC response.

Example
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
GetGlossaryEntryRequest request = new GetGlossaryEntryRequest
{
    GlossaryEntryName = GlossaryEntryName.FromProjectLocationGlossaryGlossaryEntry("[PROJECT]", "[LOCATION]", "[GLOSSARY]", "[GLOSSARY_ENTRY]"),
};
// Make the request
GlossaryEntry response = await translationServiceClient.GetGlossaryEntryAsync(request);

GetGlossaryEntryAsync(GetGlossaryEntryRequest, CancellationToken)

public virtual Task<GlossaryEntry> GetGlossaryEntryAsync(GetGlossaryEntryRequest request, CancellationToken cancellationToken)

Gets a single glossary entry by the given id.

Parameters
Name Description
request GetGlossaryEntryRequest

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

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskGlossaryEntry

A Task containing the RPC response.

Example
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
GetGlossaryEntryRequest request = new GetGlossaryEntryRequest
{
    GlossaryEntryName = GlossaryEntryName.FromProjectLocationGlossaryGlossaryEntry("[PROJECT]", "[LOCATION]", "[GLOSSARY]", "[GLOSSARY_ENTRY]"),
};
// Make the request
GlossaryEntry response = await translationServiceClient.GetGlossaryEntryAsync(request);

GetGlossaryEntryAsync(GlossaryEntryName, CallSettings)

public virtual Task<GlossaryEntry> GetGlossaryEntryAsync(GlossaryEntryName name, CallSettings callSettings = null)

Gets a single glossary entry by the given id.

Parameters
Name Description
name GlossaryEntryName

Required. The resource name of the glossary entry to get

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskGlossaryEntry

A Task containing the RPC response.

Example
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
GlossaryEntryName name = GlossaryEntryName.FromProjectLocationGlossaryGlossaryEntry("[PROJECT]", "[LOCATION]", "[GLOSSARY]", "[GLOSSARY_ENTRY]");
// Make the request
GlossaryEntry response = await translationServiceClient.GetGlossaryEntryAsync(name);

GetGlossaryEntryAsync(GlossaryEntryName, CancellationToken)

public virtual Task<GlossaryEntry> GetGlossaryEntryAsync(GlossaryEntryName name, CancellationToken cancellationToken)

Gets a single glossary entry by the given id.

Parameters
Name Description
name GlossaryEntryName

Required. The resource name of the glossary entry to get

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskGlossaryEntry

A Task containing the RPC response.

Example
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
GlossaryEntryName name = GlossaryEntryName.FromProjectLocationGlossaryGlossaryEntry("[PROJECT]", "[LOCATION]", "[GLOSSARY]", "[GLOSSARY_ENTRY]");
// Make the request
GlossaryEntry response = await translationServiceClient.GetGlossaryEntryAsync(name);

GetGlossaryEntryAsync(string, CallSettings)

public virtual Task<GlossaryEntry> GetGlossaryEntryAsync(string name, CallSettings callSettings = null)

Gets a single glossary entry by the given id.

Parameters
Name Description
name string

Required. The resource name of the glossary entry to get

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskGlossaryEntry

A Task containing the RPC response.

Example
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/glossaries/[GLOSSARY]/glossaryEntries/[GLOSSARY_ENTRY]";
// Make the request
GlossaryEntry response = await translationServiceClient.GetGlossaryEntryAsync(name);

GetGlossaryEntryAsync(string, CancellationToken)

public virtual Task<GlossaryEntry> GetGlossaryEntryAsync(string name, CancellationToken cancellationToken)

Gets a single glossary entry by the given id.

Parameters
Name Description
name string

Required. The resource name of the glossary entry to get

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskGlossaryEntry

A Task containing the RPC response.

Example
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/glossaries/[GLOSSARY]/glossaryEntries/[GLOSSARY_ENTRY]";
// Make the request
GlossaryEntry response = await translationServiceClient.GetGlossaryEntryAsync(name);

GetModel(GetModelRequest, CallSettings)

public virtual Model GetModel(GetModelRequest request, CallSettings callSettings = null)

Gets a model.

Parameters
Name Description
request GetModelRequest

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
Model

The RPC response.

Example
// Create client
TranslationServiceClient translationServiceClient = TranslationServiceClient.Create();
// Initialize request argument(s)
GetModelRequest request = new GetModelRequest
{
    ModelName = ModelName.FromProjectLocationModel("[PROJECT]", "[LOCATION]", "[MODEL]"),
};
// Make the request
Model response = translationServiceClient.GetModel(request);

GetModel(ModelName, CallSettings)

public virtual Model GetModel(ModelName name, CallSettings callSettings = null)

Gets a model.

Parameters
Name Description
name ModelName

Required. The resource name of the model to retrieve.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Model

The RPC response.

Example
// Create client
TranslationServiceClient translationServiceClient = TranslationServiceClient.Create();
// Initialize request argument(s)
ModelName name = ModelName.FromProjectLocationModel("[PROJECT]", "[LOCATION]", "[MODEL]");
// Make the request
Model response = translationServiceClient.GetModel(name);

GetModel(string, CallSettings)

public virtual Model GetModel(string name, CallSettings callSettings = null)

Gets a model.

Parameters
Name Description
name string

Required. The resource name of the model to retrieve.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Model

The RPC response.

Example
// Create client
TranslationServiceClient translationServiceClient = TranslationServiceClient.Create();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/models/[MODEL]";
// Make the request
Model response = translationServiceClient.GetModel(name);

GetModelAsync(GetModelRequest, CallSettings)

public virtual Task<Model> GetModelAsync(GetModelRequest request, CallSettings callSettings = null)

Gets a model.

Parameters
Name Description
request GetModelRequest

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
TaskModel

A Task containing the RPC response.

Example
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
GetModelRequest request = new GetModelRequest
{
    ModelName = ModelName.FromProjectLocationModel("[PROJECT]", "[LOCATION]", "[MODEL]"),
};
// Make the request
Model response = await translationServiceClient.GetModelAsync(request);

GetModelAsync(GetModelRequest, CancellationToken)

public virtual Task<Model> GetModelAsync(GetModelRequest request, CancellationToken cancellationToken)

Gets a model.

Parameters
Name Description
request GetModelRequest

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

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskModel

A Task containing the RPC response.

Example
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
GetModelRequest request = new GetModelRequest
{
    ModelName = ModelName.FromProjectLocationModel("[PROJECT]", "[LOCATION]", "[MODEL]"),
};
// Make the request
Model response = await translationServiceClient.GetModelAsync(request);

GetModelAsync(ModelName, CallSettings)

public virtual Task<Model> GetModelAsync(ModelName name, CallSettings callSettings = null)

Gets a model.

Parameters
Name Description
name ModelName

Required. The resource name of the model to retrieve.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskModel

A Task containing the RPC response.

Example
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
ModelName name = ModelName.FromProjectLocationModel("[PROJECT]", "[LOCATION]", "[MODEL]");
// Make the request
Model response = await translationServiceClient.GetModelAsync(name);

GetModelAsync(ModelName, CancellationToken)

public virtual Task<Model> GetModelAsync(ModelName name, CancellationToken cancellationToken)

Gets a model.

Parameters
Name Description
name ModelName

Required. The resource name of the model to retrieve.

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskModel

A Task containing the RPC response.

Example
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
ModelName name = ModelName.FromProjectLocationModel("[PROJECT]", "[LOCATION]", "[MODEL]");
// Make the request
Model response = await translationServiceClient.GetModelAsync(name);

GetModelAsync(string, CallSettings)

public virtual Task<Model> GetModelAsync(string name, CallSettings callSettings = null)

Gets a model.

Parameters
Name Description
name string

Required. The resource name of the model to retrieve.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskModel

A Task containing the RPC response.

Example
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/models/[MODEL]";
// Make the request
Model response = await translationServiceClient.GetModelAsync(name);

GetModelAsync(string, CancellationToken)

public virtual Task<Model> GetModelAsync(string name, CancellationToken cancellationToken)

Gets a model.

Parameters
Name Description
name string

Required. The resource name of the model to retrieve.

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskModel

A Task containing the RPC response.

Example
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/models/[MODEL]";
// Make the request
Model response = await translationServiceClient.GetModelAsync(name);

GetSupportedLanguages(LocationName, string, string, CallSettings)

public virtual SupportedLanguages GetSupportedLanguages(LocationName parent, string model, string displayLanguageCode, CallSettings callSettings = null)

Returns a list of supported languages for translation.

Parameters
Name Description
parent LocationName

Required. Project or location to make a call. Must refer to a caller's project.

Format: projects/{project-number-or-id} or projects/{project-number-or-id}/locations/{location-id}.

For global calls, use projects/{project-number-or-id}/locations/global or projects/{project-number-or-id}.

Non-global location is required for AutoML models.

Only models within the same region (have same location-id) can be used, otherwise an INVALID_ARGUMENT (400) error is returned.

model string

Optional. Get supported languages of this model.

The format depends on model type:

  • AutoML Translation models: projects/{project-number-or-id}/locations/{location-id}/models/{model-id}

  • General (built-in) models: projects/{project-number-or-id}/locations/{location-id}/models/general/nmt,

Returns languages supported by the specified model. If missing, we get supported languages of Google general NMT model.

displayLanguageCode string

Optional. The language to use to return localized, human readable names of supported languages. If missing, then display names are not returned in a response.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
SupportedLanguages

The RPC response.

Example
// Create client
TranslationServiceClient translationServiceClient = TranslationServiceClient.Create();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
string model = "";
string displayLanguageCode = "";
// Make the request
SupportedLanguages response = translationServiceClient.GetSupportedLanguages(parent, model, displayLanguageCode);

GetSupportedLanguages(GetSupportedLanguagesRequest, CallSettings)

public virtual SupportedLanguages GetSupportedLanguages(GetSupportedLanguagesRequest request, CallSettings callSettings = null)

Returns a list of supported languages for translation.

Parameters
Name Description
request GetSupportedLanguagesRequest

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
SupportedLanguages

The RPC response.

Example
// Create client
TranslationServiceClient translationServiceClient = TranslationServiceClient.Create();
// Initialize request argument(s)
GetSupportedLanguagesRequest request = new GetSupportedLanguagesRequest
{
    DisplayLanguageCode = "",
    Model = "",
    ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
};
// Make the request
SupportedLanguages response = translationServiceClient.GetSupportedLanguages(request);

GetSupportedLanguages(string, string, string, CallSettings)

public virtual SupportedLanguages GetSupportedLanguages(string parent, string model, string displayLanguageCode, CallSettings callSettings = null)

Returns a list of supported languages for translation.

Parameters
Name Description
parent string

Required. Project or location to make a call. Must refer to a caller's project.

Format: projects/{project-number-or-id} or projects/{project-number-or-id}/locations/{location-id}.

For global calls, use projects/{project-number-or-id}/locations/global or projects/{project-number-or-id}.

Non-global location is required for AutoML models.

Only models within the same region (have same location-id) can be used, otherwise an INVALID_ARGUMENT (400) error is returned.

model string

Optional. Get supported languages of this model.

The format depends on model type:

  • AutoML Translation models: projects/{project-number-or-id}/locations/{location-id}/models/{model-id}

  • General (built-in) models: projects/{project-number-or-id}/locations/{location-id}/models/general/nmt,

Returns languages supported by the specified model. If missing, we get supported languages of Google general NMT model.

displayLanguageCode string

Optional. The language to use to return localized, human readable names of supported languages. If missing, then display names are not returned in a response.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
SupportedLanguages

The RPC response.

Example
// Create client
TranslationServiceClient translationServiceClient = TranslationServiceClient.Create();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]";
string model = "";
string displayLanguageCode = "";
// Make the request
SupportedLanguages response = translationServiceClient.GetSupportedLanguages(parent, model, displayLanguageCode);

GetSupportedLanguagesAsync(LocationName, string, string, CallSettings)

public virtual Task<SupportedLanguages> GetSupportedLanguagesAsync(LocationName parent, string model, string displayLanguageCode, CallSettings callSettings = null)

Returns a list of supported languages for translation.

Parameters
Name Description
parent LocationName

Required. Project or location to make a call. Must refer to a caller's project.

Format: projects/{project-number-or-id} or projects/{project-number-or-id}/locations/{location-id}.

For global calls, use projects/{project-number-or-id}/locations/global or projects/{project-number-or-id}.

Non-global location is required for AutoML models.

Only models within the same region (have same location-id) can be used, otherwise an INVALID_ARGUMENT (400) error is returned.

model string

Optional. Get supported languages of this model.

The format depends on model type:

  • AutoML Translation models: projects/{project-number-or-id}/locations/{location-id}/models/{model-id}

  • General (built-in) models: projects/{project-number-or-id}/locations/{location-id}/models/general/nmt,

Returns languages supported by the specified model. If missing, we get supported languages of Google general NMT model.

displayLanguageCode string

Optional. The language to use to return localized, human readable names of supported languages. If missing, then display names are not returned in a response.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskSupportedLanguages

A Task containing the RPC response.

Example
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
string model = "";
string displayLanguageCode = "";
// Make the request
SupportedLanguages response = await translationServiceClient.GetSupportedLanguagesAsync(parent, model, displayLanguageCode);

GetSupportedLanguagesAsync(LocationName, string, string, CancellationToken)

public virtual Task<SupportedLanguages> GetSupportedLanguagesAsync(LocationName parent, string model, string displayLanguageCode, CancellationToken cancellationToken)

Returns a list of supported languages for translation.

Parameters
Name Description
parent LocationName

Required. Project or location to make a call. Must refer to a caller's project.

Format: projects/{project-number-or-id} or projects/{project-number-or-id}/locations/{location-id}.

For global calls, use projects/{project-number-or-id}/locations/global or projects/{project-number-or-id}.

Non-global location is required for AutoML models.

Only models within the same region (have same location-id) can be used, otherwise an INVALID_ARGUMENT (400) error is returned.

model string

Optional. Get supported languages of this model.

The format depends on model type:

  • AutoML Translation models: projects/{project-number-or-id}/locations/{location-id}/models/{model-id}

  • General (built-in) models: projects/{project-number-or-id}/locations/{location-id}/models/general/nmt,

Returns languages supported by the specified model. If missing, we get supported languages of Google general NMT model.

displayLanguageCode string

Optional. The language to use to return localized, human readable names of supported languages. If missing, then display names are not returned in a response.

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskSupportedLanguages

A Task containing the RPC response.

Example
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
string model = "";
string displayLanguageCode = "";
// Make the request
SupportedLanguages response = await translationServiceClient.GetSupportedLanguagesAsync(parent, model, displayLanguageCode);

GetSupportedLanguagesAsync(GetSupportedLanguagesRequest, CallSettings)

public virtual Task<SupportedLanguages> GetSupportedLanguagesAsync(GetSupportedLanguagesRequest request, CallSettings callSettings = null)

Returns a list of supported languages for translation.

Parameters
Name Description
request GetSupportedLanguagesRequest

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
TaskSupportedLanguages

A Task containing the RPC response.

Example
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
GetSupportedLanguagesRequest request = new GetSupportedLanguagesRequest
{
    DisplayLanguageCode = "",
    Model = "",
    ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
};
// Make the request
SupportedLanguages response = await translationServiceClient.GetSupportedLanguagesAsync(request);

GetSupportedLanguagesAsync(GetSupportedLanguagesRequest, CancellationToken)

public virtual Task<SupportedLanguages> GetSupportedLanguagesAsync(GetSupportedLanguagesRequest request, CancellationToken cancellationToken)

Returns a list of supported languages for translation.

Parameters
Name Description
request GetSupportedLanguagesRequest

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

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskSupportedLanguages

A Task containing the RPC response.

Example
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
GetSupportedLanguagesRequest request = new GetSupportedLanguagesRequest
{
    DisplayLanguageCode = "",
    Model = "",
    ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
};
// Make the request
SupportedLanguages response = await translationServiceClient.GetSupportedLanguagesAsync(request);

GetSupportedLanguagesAsync(string, string, string, CallSettings)

public virtual Task<SupportedLanguages> GetSupportedLanguagesAsync(string parent, string model, string displayLanguageCode, CallSettings callSettings = null)

Returns a list of supported languages for translation.

Parameters
Name Description
parent string

Required. Project or location to make a call. Must refer to a caller's project.

Format: projects/{project-number-or-id} or projects/{project-number-or-id}/locations/{location-id}.

For global calls, use projects/{project-number-or-id}/locations/global or projects/{project-number-or-id}.

Non-global location is required for AutoML models.

Only models within the same region (have same location-id) can be used, otherwise an INVALID_ARGUMENT (400) error is returned.

model string

Optional. Get supported languages of this model.

The format depends on model type:

  • AutoML Translation models: projects/{project-number-or-id}/locations/{location-id}/models/{model-id}

  • General (built-in) models: projects/{project-number-or-id}/locations/{location-id}/models/general/nmt,

Returns languages supported by the specified model. If missing, we get supported languages of Google general NMT model.

displayLanguageCode string

Optional. The language to use to return localized, human readable names of supported languages. If missing, then display names are not returned in a response.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskSupportedLanguages

A Task containing the RPC response.

Example
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]";
string model = "";
string displayLanguageCode = "";
// Make the request
SupportedLanguages response = await translationServiceClient.GetSupportedLanguagesAsync(parent, model, displayLanguageCode);

GetSupportedLanguagesAsync(string, string, string, CancellationToken)

public virtual Task<SupportedLanguages> GetSupportedLanguagesAsync(string parent, string model, string displayLanguageCode, CancellationToken cancellationToken)

Returns a list of supported languages for translation.

Parameters
Name Description
parent string

Required. Project or location to make a call. Must refer to a caller's project.

Format: projects/{project-number-or-id} or projects/{project-number-or-id}/locations/{location-id}.

For global calls, use projects/{project-number-or-id}/locations/global or projects/{project-number-or-id}.

Non-global location is required for AutoML models.

Only models within the same region (have same location-id) can be used, otherwise an INVALID_ARGUMENT (400) error is returned.

model string

Optional. Get supported languages of this model.

The format depends on model type:

  • AutoML Translation models: projects/{project-number-or-id}/locations/{location-id}/models/{model-id}

  • General (built-in) models: projects/{project-number-or-id}/locations/{location-id}/models/general/nmt,

Returns languages supported by the specified model. If missing, we get supported languages of Google general NMT model.

displayLanguageCode string

Optional. The language to use to return localized, human readable names of supported languages. If missing, then display names are not returned in a response.

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskSupportedLanguages

A Task containing the RPC response.

Example
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]";
string model = "";
string displayLanguageCode = "";
// Make the request
SupportedLanguages response = await translationServiceClient.GetSupportedLanguagesAsync(parent, model, displayLanguageCode);

ImportAdaptiveMtFile(AdaptiveMtDatasetName, CallSettings)

public virtual ImportAdaptiveMtFileResponse ImportAdaptiveMtFile(AdaptiveMtDatasetName parent, CallSettings callSettings = null)

Imports an AdaptiveMtFile and adds all of its sentences into the AdaptiveMtDataset.

Parameters
Name Description
parent AdaptiveMtDatasetName

Required. The resource name of the file, in form of projects/{project-number-or-id}/locations/{location_id}/adaptiveMtDatasets/{dataset}

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
ImportAdaptiveMtFileResponse

The RPC response.

Example
// Create client
TranslationServiceClient translationServiceClient = TranslationServiceClient.Create();
// Initialize request argument(s)
AdaptiveMtDatasetName parent = AdaptiveMtDatasetName.FromProjectLocationDataset("[PROJECT]", "[LOCATION]", "[DATASET]");
// Make the request
ImportAdaptiveMtFileResponse response = translationServiceClient.ImportAdaptiveMtFile(parent);

ImportAdaptiveMtFile(ImportAdaptiveMtFileRequest, CallSettings)

public virtual ImportAdaptiveMtFileResponse ImportAdaptiveMtFile(ImportAdaptiveMtFileRequest request, CallSettings callSettings = null)

Imports an AdaptiveMtFile and adds all of its sentences into the AdaptiveMtDataset.

Parameters
Name Description
request ImportAdaptiveMtFileRequest

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
ImportAdaptiveMtFileResponse

The RPC response.

Example
// Create client
TranslationServiceClient translationServiceClient = TranslationServiceClient.Create();
// Initialize request argument(s)
ImportAdaptiveMtFileRequest request = new ImportAdaptiveMtFileRequest
{
    ParentAsAdaptiveMtDatasetName = AdaptiveMtDatasetName.FromProjectLocationDataset("[PROJECT]", "[LOCATION]", "[DATASET]"),
    FileInputSource = new FileInputSource(),
};
// Make the request
ImportAdaptiveMtFileResponse response = translationServiceClient.ImportAdaptiveMtFile(request);

ImportAdaptiveMtFile(string, CallSettings)

public virtual ImportAdaptiveMtFileResponse ImportAdaptiveMtFile(string parent, CallSettings callSettings = null)

Imports an AdaptiveMtFile and adds all of its sentences into the AdaptiveMtDataset.

Parameters
Name Description
parent string

Required. The resource name of the file, in form of projects/{project-number-or-id}/locations/{location_id}/adaptiveMtDatasets/{dataset}

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
ImportAdaptiveMtFileResponse

The RPC response.

Example
// Create client
TranslationServiceClient translationServiceClient = TranslationServiceClient.Create();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]/adaptiveMtDatasets/[DATASET]";
// Make the request
ImportAdaptiveMtFileResponse response = translationServiceClient.ImportAdaptiveMtFile(parent);

ImportAdaptiveMtFileAsync(AdaptiveMtDatasetName, CallSettings)

public virtual Task<ImportAdaptiveMtFileResponse> ImportAdaptiveMtFileAsync(AdaptiveMtDatasetName parent, CallSettings callSettings = null)

Imports an AdaptiveMtFile and adds all of its sentences into the AdaptiveMtDataset.

Parameters
Name Description
parent AdaptiveMtDatasetName

Required. The resource name of the file, in form of projects/{project-number-or-id}/locations/{location_id}/adaptiveMtDatasets/{dataset}

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskImportAdaptiveMtFileResponse

A Task containing the RPC response.

Example
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
AdaptiveMtDatasetName parent = AdaptiveMtDatasetName.FromProjectLocationDataset("[PROJECT]", "[LOCATION]", "[DATASET]");
// Make the request
ImportAdaptiveMtFileResponse response = await translationServiceClient.ImportAdaptiveMtFileAsync(parent);

ImportAdaptiveMtFileAsync(AdaptiveMtDatasetName, CancellationToken)

public virtual Task<ImportAdaptiveMtFileResponse> ImportAdaptiveMtFileAsync(AdaptiveMtDatasetName parent, CancellationToken cancellationToken)

Imports an AdaptiveMtFile and adds all of its sentences into the AdaptiveMtDataset.

Parameters
Name Description
parent AdaptiveMtDatasetName

Required. The resource name of the file, in form of projects/{project-number-or-id}/locations/{location_id}/adaptiveMtDatasets/{dataset}

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskImportAdaptiveMtFileResponse

A Task containing the RPC response.

Example
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
AdaptiveMtDatasetName parent = AdaptiveMtDatasetName.FromProjectLocationDataset("[PROJECT]", "[LOCATION]", "[DATASET]");
// Make the request
ImportAdaptiveMtFileResponse response = await translationServiceClient.ImportAdaptiveMtFileAsync(parent);

ImportAdaptiveMtFileAsync(ImportAdaptiveMtFileRequest, CallSettings)

public virtual Task<ImportAdaptiveMtFileResponse> ImportAdaptiveMtFileAsync(ImportAdaptiveMtFileRequest request, CallSettings callSettings = null)

Imports an AdaptiveMtFile and adds all of its sentences into the AdaptiveMtDataset.

Parameters
Name Description
request ImportAdaptiveMtFileRequest

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
TaskImportAdaptiveMtFileResponse

A Task containing the RPC response.

Example
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
ImportAdaptiveMtFileRequest request = new ImportAdaptiveMtFileRequest
{
    ParentAsAdaptiveMtDatasetName = AdaptiveMtDatasetName.FromProjectLocationDataset("[PROJECT]", "[LOCATION]", "[DATASET]"),
    FileInputSource = new FileInputSource(),
};
// Make the request
ImportAdaptiveMtFileResponse response = await translationServiceClient.ImportAdaptiveMtFileAsync(request);

ImportAdaptiveMtFileAsync(ImportAdaptiveMtFileRequest, CancellationToken)

public virtual Task<ImportAdaptiveMtFileResponse> ImportAdaptiveMtFileAsync(ImportAdaptiveMtFileRequest request, CancellationToken cancellationToken)

Imports an AdaptiveMtFile and adds all of its sentences into the AdaptiveMtDataset.

Parameters
Name Description
request ImportAdaptiveMtFileRequest

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

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskImportAdaptiveMtFileResponse

A Task containing the RPC response.

Example
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
ImportAdaptiveMtFileRequest request = new ImportAdaptiveMtFileRequest
{
    ParentAsAdaptiveMtDatasetName = AdaptiveMtDatasetName.FromProjectLocationDataset("[PROJECT]", "[LOCATION]", "[DATASET]"),
    FileInputSource = new FileInputSource(),
};
// Make the request
ImportAdaptiveMtFileResponse response = await translationServiceClient.ImportAdaptiveMtFileAsync(request);

ImportAdaptiveMtFileAsync(string, CallSettings)

public virtual Task<ImportAdaptiveMtFileResponse> ImportAdaptiveMtFileAsync(string parent, CallSettings callSettings = null)

Imports an AdaptiveMtFile and adds all of its sentences into the AdaptiveMtDataset.

Parameters
Name Description
parent string

Required. The resource name of the file, in form of projects/{project-number-or-id}/locations/{location_id}/adaptiveMtDatasets/{dataset}

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskImportAdaptiveMtFileResponse

A Task containing the RPC response.

Example
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]/adaptiveMtDatasets/[DATASET]";
// Make the request
ImportAdaptiveMtFileResponse response = await translationServiceClient.ImportAdaptiveMtFileAsync(parent);

ImportAdaptiveMtFileAsync(string, CancellationToken)

public virtual Task<ImportAdaptiveMtFileResponse> ImportAdaptiveMtFileAsync(string parent, CancellationToken cancellationToken)

Imports an AdaptiveMtFile and adds all of its sentences into the AdaptiveMtDataset.

Parameters
Name Description
parent string

Required. The resource name of the file, in form of projects/{project-number-or-id}/locations/{location_id}/adaptiveMtDatasets/{dataset}

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskImportAdaptiveMtFileResponse

A Task containing the RPC response.

Example
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]/adaptiveMtDatasets/[DATASET]";
// Make the request
ImportAdaptiveMtFileResponse response = await translationServiceClient.ImportAdaptiveMtFileAsync(parent);

ImportData(ImportDataRequest, CallSettings)

public virtual Operation<Empty, ImportDataMetadata> ImportData(ImportDataRequest request, CallSettings callSettings = null)

Import sentence pairs into translation Dataset.

Parameters
Name Description
request ImportDataRequest

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
OperationEmptyImportDataMetadata

The RPC response.

Example
// Create client
TranslationServiceClient translationServiceClient = TranslationServiceClient.Create();
// Initialize request argument(s)
ImportDataRequest request = new ImportDataRequest
{
    Dataset = "",
    InputConfig = new DatasetInputConfig(),
};
// Make the request
Operation<Empty, ImportDataMetadata> response = translationServiceClient.ImportData(request);

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

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

ImportData(string, DatasetInputConfig, CallSettings)

public virtual Operation<Empty, ImportDataMetadata> ImportData(string dataset, DatasetInputConfig inputConfig, CallSettings callSettings = null)

Import sentence pairs into translation Dataset.

Parameters
Name Description
dataset string

Required. Name of the dataset. In form of projects/{project-number-or-id}/locations/{location-id}/datasets/{dataset-id}

inputConfig DatasetInputConfig

Required. The config for the input content.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
OperationEmptyImportDataMetadata

The RPC response.

Example
// Create client
TranslationServiceClient translationServiceClient = TranslationServiceClient.Create();
// Initialize request argument(s)
string dataset = "";
DatasetInputConfig inputConfig = new DatasetInputConfig();
// Make the request
Operation<Empty, ImportDataMetadata> response = translationServiceClient.ImportData(dataset, inputConfig);

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

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

ImportDataAsync(ImportDataRequest, CallSettings)

public virtual Task<Operation<Empty, ImportDataMetadata>> ImportDataAsync(ImportDataRequest request, CallSettings callSettings = null)

Import sentence pairs into translation Dataset.

Parameters
Name Description
request ImportDataRequest

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
TaskOperationEmptyImportDataMetadata

A Task containing the RPC response.

Example
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
ImportDataRequest request = new ImportDataRequest
{
    Dataset = "",
    InputConfig = new DatasetInputConfig(),
};
// Make the request
Operation<Empty, ImportDataMetadata> response = await translationServiceClient.ImportDataAsync(request);

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

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

ImportDataAsync(ImportDataRequest, CancellationToken)

public virtual Task<Operation<Empty, ImportDataMetadata>> ImportDataAsync(ImportDataRequest request, CancellationToken cancellationToken)

Import sentence pairs into translation Dataset.

Parameters
Name Description
request ImportDataRequest

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

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskOperationEmptyImportDataMetadata

A Task containing the RPC response.

Example
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
ImportDataRequest request = new ImportDataRequest
{
    Dataset = "",
    InputConfig = new DatasetInputConfig(),
};
// Make the request
Operation<Empty, ImportDataMetadata> response = await translationServiceClient.ImportDataAsync(request);

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

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

ImportDataAsync(string, DatasetInputConfig, CallSettings)

public virtual Task<Operation<Empty, ImportDataMetadata>> ImportDataAsync(string dataset, DatasetInputConfig inputConfig, CallSettings callSettings = null)

Import sentence pairs into translation Dataset.

Parameters
Name Description
dataset string

Required. Name of the dataset. In form of projects/{project-number-or-id}/locations/{location-id}/datasets/{dataset-id}

inputConfig DatasetInputConfig

Required. The config for the input content.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskOperationEmptyImportDataMetadata

A Task containing the RPC response.

Example
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
string dataset = "";
DatasetInputConfig inputConfig = new DatasetInputConfig();
// Make the request
Operation<Empty, ImportDataMetadata> response = await translationServiceClient.ImportDataAsync(dataset, inputConfig);

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

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

ImportDataAsync(string, DatasetInputConfig, CancellationToken)

public virtual Task<Operation<Empty, ImportDataMetadata>> ImportDataAsync(string dataset, DatasetInputConfig inputConfig, CancellationToken cancellationToken)

Import sentence pairs into translation Dataset.

Parameters
Name Description
dataset string

Required. Name of the dataset. In form of projects/{project-number-or-id}/locations/{location-id}/datasets/{dataset-id}

inputConfig DatasetInputConfig

Required. The config for the input content.

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskOperationEmptyImportDataMetadata

A Task containing the RPC response.

Example
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
string dataset = "";
DatasetInputConfig inputConfig = new DatasetInputConfig();
// Make the request
Operation<Empty, ImportDataMetadata> response = await translationServiceClient.ImportDataAsync(dataset, inputConfig);

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

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

ListAdaptiveMtDatasets(LocationName, string, int?, CallSettings)

public virtual PagedEnumerable<ListAdaptiveMtDatasetsResponse, AdaptiveMtDataset> ListAdaptiveMtDatasets(LocationName parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

Lists all Adaptive MT datasets for which the caller has read permission.

Parameters
Name Description
parent LocationName

Required. The resource name of the project from which to list the Adaptive MT datasets. projects/{project-number-or-id}/locations/{location-id}

pageToken string

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

pageSize int

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

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
PagedEnumerableListAdaptiveMtDatasetsResponseAdaptiveMtDataset

A pageable sequence of AdaptiveMtDataset resources.

Example
// Create client
TranslationServiceClient translationServiceClient = TranslationServiceClient.Create();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
// Make the request
PagedEnumerable<ListAdaptiveMtDatasetsResponse, AdaptiveMtDataset> response = translationServiceClient.ListAdaptiveMtDatasets(parent);

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

ListAdaptiveMtDatasets(ListAdaptiveMtDatasetsRequest, CallSettings)

public virtual PagedEnumerable<ListAdaptiveMtDatasetsResponse, AdaptiveMtDataset> ListAdaptiveMtDatasets(ListAdaptiveMtDatasetsRequest request, CallSettings callSettings = null)

Lists all Adaptive MT datasets for which the caller has read permission.

Parameters
Name Description
request ListAdaptiveMtDatasetsRequest

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
PagedEnumerableListAdaptiveMtDatasetsResponseAdaptiveMtDataset

A pageable sequence of AdaptiveMtDataset resources.

Example
// Create client
TranslationServiceClient translationServiceClient = TranslationServiceClient.Create();
// Initialize request argument(s)
ListAdaptiveMtDatasetsRequest request = new ListAdaptiveMtDatasetsRequest
{
    ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
    Filter = "",
};
// Make the request
PagedEnumerable<ListAdaptiveMtDatasetsResponse, AdaptiveMtDataset> response = translationServiceClient.ListAdaptiveMtDatasets(request);

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

ListAdaptiveMtDatasets(string, string, int?, CallSettings)

public virtual PagedEnumerable<ListAdaptiveMtDatasetsResponse, AdaptiveMtDataset> ListAdaptiveMtDatasets(string parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

Lists all Adaptive MT datasets for which the caller has read permission.

Parameters
Name Description
parent string

Required. The resource name of the project from which to list the Adaptive MT datasets. projects/{project-number-or-id}/locations/{location-id}

pageToken string

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

pageSize int

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

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
PagedEnumerableListAdaptiveMtDatasetsResponseAdaptiveMtDataset

A pageable sequence of AdaptiveMtDataset resources.

Example
// Create client
TranslationServiceClient translationServiceClient = TranslationServiceClient.Create();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]";
// Make the request
PagedEnumerable<ListAdaptiveMtDatasetsResponse, AdaptiveMtDataset> response = translationServiceClient.ListAdaptiveMtDatasets(parent);

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

ListAdaptiveMtDatasetsAsync(LocationName, string, int?, CallSettings)

public virtual PagedAsyncEnumerable<ListAdaptiveMtDatasetsResponse, AdaptiveMtDataset> ListAdaptiveMtDatasetsAsync(LocationName parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

Lists all Adaptive MT datasets for which the caller has read permission.

Parameters
Name Description
parent LocationName

Required. The resource name of the project from which to list the Adaptive MT datasets. projects/{project-number-or-id}/locations/{location-id}

pageToken string

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

pageSize int

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

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
PagedAsyncEnumerableListAdaptiveMtDatasetsResponseAdaptiveMtDataset

A pageable asynchronous sequence of AdaptiveMtDataset resources.

Example
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
// Make the request
PagedAsyncEnumerable<ListAdaptiveMtDatasetsResponse, AdaptiveMtDataset> response = translationServiceClient.ListAdaptiveMtDatasetsAsync(parent);

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

ListAdaptiveMtDatasetsAsync(ListAdaptiveMtDatasetsRequest, CallSettings)

public virtual PagedAsyncEnumerable<ListAdaptiveMtDatasetsResponse, AdaptiveMtDataset> ListAdaptiveMtDatasetsAsync(ListAdaptiveMtDatasetsRequest request, CallSettings callSettings = null)

Lists all Adaptive MT datasets for which the caller has read permission.

Parameters
Name Description
request ListAdaptiveMtDatasetsRequest

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
PagedAsyncEnumerableListAdaptiveMtDatasetsResponseAdaptiveMtDataset

A pageable asynchronous sequence of AdaptiveMtDataset resources.

Example
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
ListAdaptiveMtDatasetsRequest request = new ListAdaptiveMtDatasetsRequest
{
    ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
    Filter = "",
};
// Make the request
PagedAsyncEnumerable<ListAdaptiveMtDatasetsResponse, AdaptiveMtDataset> response = translationServiceClient.ListAdaptiveMtDatasetsAsync(request);

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

ListAdaptiveMtDatasetsAsync(string, string, int?, CallSettings)

public virtual PagedAsyncEnumerable<ListAdaptiveMtDatasetsResponse, AdaptiveMtDataset> ListAdaptiveMtDatasetsAsync(string parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

Lists all Adaptive MT datasets for which the caller has read permission.

Parameters
Name Description
parent string

Required. The resource name of the project from which to list the Adaptive MT datasets. projects/{project-number-or-id}/locations/{location-id}

pageToken string

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

pageSize int

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

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
PagedAsyncEnumerableListAdaptiveMtDatasetsResponseAdaptiveMtDataset

A pageable asynchronous sequence of AdaptiveMtDataset resources.

Example
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]";
// Make the request
PagedAsyncEnumerable<ListAdaptiveMtDatasetsResponse, AdaptiveMtDataset> response = translationServiceClient.ListAdaptiveMtDatasetsAsync(parent);

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

ListAdaptiveMtFiles(AdaptiveMtDatasetName, string, int?, CallSettings)

public virtual PagedEnumerable<ListAdaptiveMtFilesResponse, AdaptiveMtFile> ListAdaptiveMtFiles(AdaptiveMtDatasetName parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

Lists all AdaptiveMtFiles associated to an AdaptiveMtDataset.

Parameters
Name Description
parent AdaptiveMtDatasetName

Required. The resource name of the project from which to list the Adaptive MT files. projects/{project}/locations/{location}/adaptiveMtDatasets/{dataset}

pageToken string

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

pageSize int

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

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
PagedEnumerableListAdaptiveMtFilesResponseAdaptiveMtFile

A pageable sequence of AdaptiveMtFile resources.

Example
// Create client
TranslationServiceClient translationServiceClient = TranslationServiceClient.Create();
// Initialize request argument(s)
AdaptiveMtDatasetName parent = AdaptiveMtDatasetName.FromProjectLocationDataset("[PROJECT]", "[LOCATION]", "[DATASET]");
// Make the request
PagedEnumerable<ListAdaptiveMtFilesResponse, AdaptiveMtFile> response = translationServiceClient.ListAdaptiveMtFiles(parent);

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

ListAdaptiveMtFiles(ListAdaptiveMtFilesRequest, CallSettings)

public virtual PagedEnumerable<ListAdaptiveMtFilesResponse, AdaptiveMtFile> ListAdaptiveMtFiles(ListAdaptiveMtFilesRequest request, CallSettings callSettings = null)

Lists all AdaptiveMtFiles associated to an AdaptiveMtDataset.

Parameters
Name Description
request ListAdaptiveMtFilesRequest

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
PagedEnumerableListAdaptiveMtFilesResponseAdaptiveMtFile

A pageable sequence of AdaptiveMtFile resources.

Example
// Create client
TranslationServiceClient translationServiceClient = TranslationServiceClient.Create();
// Initialize request argument(s)
ListAdaptiveMtFilesRequest request = new ListAdaptiveMtFilesRequest
{
    ParentAsAdaptiveMtDatasetName = AdaptiveMtDatasetName.FromProjectLocationDataset("[PROJECT]", "[LOCATION]", "[DATASET]"),
};
// Make the request
PagedEnumerable<ListAdaptiveMtFilesResponse, AdaptiveMtFile> response = translationServiceClient.ListAdaptiveMtFiles(request);

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

ListAdaptiveMtFiles(string, string, int?, CallSettings)

public virtual PagedEnumerable<ListAdaptiveMtFilesResponse, AdaptiveMtFile> ListAdaptiveMtFiles(string parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

Lists all AdaptiveMtFiles associated to an AdaptiveMtDataset.

Parameters
Name Description
parent string

Required. The resource name of the project from which to list the Adaptive MT files. projects/{project}/locations/{location}/adaptiveMtDatasets/{dataset}

pageToken string

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

pageSize int

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

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
PagedEnumerableListAdaptiveMtFilesResponseAdaptiveMtFile

A pageable sequence of AdaptiveMtFile resources.

Example
// Create client
TranslationServiceClient translationServiceClient = TranslationServiceClient.Create();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]/adaptiveMtDatasets/[DATASET]";
// Make the request
PagedEnumerable<ListAdaptiveMtFilesResponse, AdaptiveMtFile> response = translationServiceClient.ListAdaptiveMtFiles(parent);

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

ListAdaptiveMtFilesAsync(AdaptiveMtDatasetName, string, int?, CallSettings)

public virtual PagedAsyncEnumerable<ListAdaptiveMtFilesResponse, AdaptiveMtFile> ListAdaptiveMtFilesAsync(AdaptiveMtDatasetName parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

Lists all AdaptiveMtFiles associated to an AdaptiveMtDataset.

Parameters
Name Description
parent AdaptiveMtDatasetName

Required. The resource name of the project from which to list the Adaptive MT files. projects/{project}/locations/{location}/adaptiveMtDatasets/{dataset}

pageToken string

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

pageSize int

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

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
PagedAsyncEnumerableListAdaptiveMtFilesResponseAdaptiveMtFile

A pageable asynchronous sequence of AdaptiveMtFile resources.

Example
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
AdaptiveMtDatasetName parent = AdaptiveMtDatasetName.FromProjectLocationDataset("[PROJECT]", "[LOCATION]", "[DATASET]");
// Make the request
PagedAsyncEnumerable<ListAdaptiveMtFilesResponse, AdaptiveMtFile> response = translationServiceClient.ListAdaptiveMtFilesAsync(parent);

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

ListAdaptiveMtFilesAsync(ListAdaptiveMtFilesRequest, CallSettings)

public virtual PagedAsyncEnumerable<ListAdaptiveMtFilesResponse, AdaptiveMtFile> ListAdaptiveMtFilesAsync(ListAdaptiveMtFilesRequest request, CallSettings callSettings = null)

Lists all AdaptiveMtFiles associated to an AdaptiveMtDataset.

Parameters
Name Description
request ListAdaptiveMtFilesRequest

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
PagedAsyncEnumerableListAdaptiveMtFilesResponseAdaptiveMtFile

A pageable asynchronous sequence of AdaptiveMtFile resources.

Example
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
ListAdaptiveMtFilesRequest request = new ListAdaptiveMtFilesRequest
{
    ParentAsAdaptiveMtDatasetName = AdaptiveMtDatasetName.FromProjectLocationDataset("[PROJECT]", "[LOCATION]", "[DATASET]"),
};
// Make the request
PagedAsyncEnumerable<ListAdaptiveMtFilesResponse, AdaptiveMtFile> response = translationServiceClient.ListAdaptiveMtFilesAsync(request);

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

ListAdaptiveMtFilesAsync(string, string, int?, CallSettings)

public virtual PagedAsyncEnumerable<ListAdaptiveMtFilesResponse, AdaptiveMtFile> ListAdaptiveMtFilesAsync(string parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

Lists all AdaptiveMtFiles associated to an AdaptiveMtDataset.

Parameters
Name Description
parent string

Required. The resource name of the project from which to list the Adaptive MT files. projects/{project}/locations/{location}/adaptiveMtDatasets/{dataset}

pageToken string

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

pageSize int

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

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
PagedAsyncEnumerableListAdaptiveMtFilesResponseAdaptiveMtFile

A pageable asynchronous sequence of AdaptiveMtFile resources.

Example
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]/adaptiveMtDatasets/[DATASET]";
// Make the request
PagedAsyncEnumerable<ListAdaptiveMtFilesResponse, AdaptiveMtFile> response = translationServiceClient.ListAdaptiveMtFilesAsync(parent);

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

ListAdaptiveMtSentences(AdaptiveMtFileName, string, int?, CallSettings)

public virtual PagedEnumerable<ListAdaptiveMtSentencesResponse, AdaptiveMtSentence> ListAdaptiveMtSentences(AdaptiveMtFileName parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

Lists all AdaptiveMtSentences under a given file/dataset.

Parameters
Name Description
parent AdaptiveMtFileName

Required. The resource name of the project from which to list the Adaptive MT files. The following format lists all sentences under a file. projects/{project}/locations/{location}/adaptiveMtDatasets/{dataset}/adaptiveMtFiles/{file} The following format lists all sentences within a dataset. projects/{project}/locations/{location}/adaptiveMtDatasets/{dataset}

pageToken string

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

pageSize int

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

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
PagedEnumerableListAdaptiveMtSentencesResponseAdaptiveMtSentence

A pageable sequence of AdaptiveMtSentence resources.

Example
// Create client
TranslationServiceClient translationServiceClient = TranslationServiceClient.Create();
// Initialize request argument(s)
AdaptiveMtFileName parent = AdaptiveMtFileName.FromProjectLocationDatasetFile("[PROJECT]", "[LOCATION]", "[DATASET]", "[FILE]");
// Make the request
PagedEnumerable<ListAdaptiveMtSentencesResponse, AdaptiveMtSentence> response = translationServiceClient.ListAdaptiveMtSentences(parent);

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

ListAdaptiveMtSentences(ListAdaptiveMtSentencesRequest, CallSettings)

public virtual PagedEnumerable<ListAdaptiveMtSentencesResponse, AdaptiveMtSentence> ListAdaptiveMtSentences(ListAdaptiveMtSentencesRequest request, CallSettings callSettings = null)

Lists all AdaptiveMtSentences under a given file/dataset.

Parameters
Name Description
request ListAdaptiveMtSentencesRequest

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
PagedEnumerableListAdaptiveMtSentencesResponseAdaptiveMtSentence

A pageable sequence of AdaptiveMtSentence resources.

Example
// Create client
TranslationServiceClient translationServiceClient = TranslationServiceClient.Create();
// Initialize request argument(s)
ListAdaptiveMtSentencesRequest request = new ListAdaptiveMtSentencesRequest
{
    ParentAsAdaptiveMtFileName = AdaptiveMtFileName.FromProjectLocationDatasetFile("[PROJECT]", "[LOCATION]", "[DATASET]", "[FILE]"),
};
// Make the request
PagedEnumerable<ListAdaptiveMtSentencesResponse, AdaptiveMtSentence> response = translationServiceClient.ListAdaptiveMtSentences(request);

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

ListAdaptiveMtSentences(string, string, int?, CallSettings)

public virtual PagedEnumerable<ListAdaptiveMtSentencesResponse, AdaptiveMtSentence> ListAdaptiveMtSentences(string parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

Lists all AdaptiveMtSentences under a given file/dataset.

Parameters
Name Description
parent string

Required. The resource name of the project from which to list the Adaptive MT files. The following format lists all sentences under a file. projects/{project}/locations/{location}/adaptiveMtDatasets/{dataset}/adaptiveMtFiles/{file} The following format lists all sentences within a dataset. projects/{project}/locations/{location}/adaptiveMtDatasets/{dataset}

pageToken string

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

pageSize int

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

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
PagedEnumerableListAdaptiveMtSentencesResponseAdaptiveMtSentence

A pageable sequence of AdaptiveMtSentence resources.

Example
// Create client
TranslationServiceClient translationServiceClient = TranslationServiceClient.Create();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]/adaptiveMtDatasets/[DATASET]/adaptiveMtFiles/[FILE]";
// Make the request
PagedEnumerable<ListAdaptiveMtSentencesResponse, AdaptiveMtSentence> response = translationServiceClient.ListAdaptiveMtSentences(parent);

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

ListAdaptiveMtSentencesAsync(AdaptiveMtFileName, string, int?, CallSettings)

public virtual PagedAsyncEnumerable<ListAdaptiveMtSentencesResponse, AdaptiveMtSentence> ListAdaptiveMtSentencesAsync(AdaptiveMtFileName parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

Lists all AdaptiveMtSentences under a given file/dataset.

Parameters
Name Description
parent AdaptiveMtFileName

Required. The resource name of the project from which to list the Adaptive MT files. The following format lists all sentences under a file. projects/{project}/locations/{location}/adaptiveMtDatasets/{dataset}/adaptiveMtFiles/{file} The following format lists all sentences within a dataset. projects/{project}/locations/{location}/adaptiveMtDatasets/{dataset}

pageToken string

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

pageSize int

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

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
PagedAsyncEnumerableListAdaptiveMtSentencesResponseAdaptiveMtSentence

A pageable asynchronous sequence of AdaptiveMtSentence resources.

Example
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
AdaptiveMtFileName parent = AdaptiveMtFileName.FromProjectLocationDatasetFile("[PROJECT]", "[LOCATION]", "[DATASET]", "[FILE]");
// Make the request
PagedAsyncEnumerable<ListAdaptiveMtSentencesResponse, AdaptiveMtSentence> response = translationServiceClient.ListAdaptiveMtSentencesAsync(parent);

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

ListAdaptiveMtSentencesAsync(ListAdaptiveMtSentencesRequest, CallSettings)

public virtual PagedAsyncEnumerable<ListAdaptiveMtSentencesResponse, AdaptiveMtSentence> ListAdaptiveMtSentencesAsync(ListAdaptiveMtSentencesRequest request, CallSettings callSettings = null)

Lists all AdaptiveMtSentences under a given file/dataset.

Parameters
Name Description
request ListAdaptiveMtSentencesRequest

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
PagedAsyncEnumerableListAdaptiveMtSentencesResponseAdaptiveMtSentence

A pageable asynchronous sequence of AdaptiveMtSentence resources.

Example
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
ListAdaptiveMtSentencesRequest request = new ListAdaptiveMtSentencesRequest
{
    ParentAsAdaptiveMtFileName = AdaptiveMtFileName.FromProjectLocationDatasetFile("[PROJECT]", "[LOCATION]", "[DATASET]", "[FILE]"),
};
// Make the request
PagedAsyncEnumerable<ListAdaptiveMtSentencesResponse, AdaptiveMtSentence> response = translationServiceClient.ListAdaptiveMtSentencesAsync(request);

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

ListAdaptiveMtSentencesAsync(string, string, int?, CallSettings)

public virtual PagedAsyncEnumerable<ListAdaptiveMtSentencesResponse, AdaptiveMtSentence> ListAdaptiveMtSentencesAsync(string parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

Lists all AdaptiveMtSentences under a given file/dataset.

Parameters
Name Description
parent string

Required. The resource name of the project from which to list the Adaptive MT files. The following format lists all sentences under a file. projects/{project}/locations/{location}/adaptiveMtDatasets/{dataset}/adaptiveMtFiles/{file} The following format lists all sentences within a dataset. projects/{project}/locations/{location}/adaptiveMtDatasets/{dataset}

pageToken string

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

pageSize int

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

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
PagedAsyncEnumerableListAdaptiveMtSentencesResponseAdaptiveMtSentence

A pageable asynchronous sequence of AdaptiveMtSentence resources.

Example
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]/adaptiveMtDatasets/[DATASET]/adaptiveMtFiles/[FILE]";
// Make the request
PagedAsyncEnumerable<ListAdaptiveMtSentencesResponse, AdaptiveMtSentence> response = translationServiceClient.ListAdaptiveMtSentencesAsync(parent);

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

ListDatasets(LocationName, string, int?, CallSettings)

public virtual PagedEnumerable<ListDatasetsResponse, Dataset> ListDatasets(LocationName parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

Lists datasets.

Parameters
Name Description
parent LocationName

Required. Name of the parent project. In form of projects/{project-number-or-id}/locations/{location-id}

pageToken string

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

pageSize int

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

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
PagedEnumerableListDatasetsResponseDataset

A pageable sequence of Dataset resources.

Example
// Create client
TranslationServiceClient translationServiceClient = TranslationServiceClient.Create();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
// Make the request
PagedEnumerable<ListDatasetsResponse, Dataset> response = translationServiceClient.ListDatasets(parent);

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

ListDatasets(ListDatasetsRequest, CallSettings)

public virtual PagedEnumerable<ListDatasetsResponse, Dataset> ListDatasets(ListDatasetsRequest request, CallSettings callSettings = null)

Lists datasets.

Parameters
Name Description
request ListDatasetsRequest

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
PagedEnumerableListDatasetsResponseDataset

A pageable sequence of Dataset resources.

Example
// Create client
TranslationServiceClient translationServiceClient = TranslationServiceClient.Create();
// Initialize request argument(s)
ListDatasetsRequest request = new ListDatasetsRequest
{
    ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
};
// Make the request
PagedEnumerable<ListDatasetsResponse, Dataset> response = translationServiceClient.ListDatasets(request);

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

ListDatasets(string, string, int?, CallSettings)

public virtual PagedEnumerable<ListDatasetsResponse, Dataset> ListDatasets(string parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

Lists datasets.

Parameters
Name Description
parent string

Required. Name of the parent project. In form of projects/{project-number-or-id}/locations/{location-id}

pageToken string

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

pageSize int

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

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
PagedEnumerableListDatasetsResponseDataset

A pageable sequence of Dataset resources.

Example
// Create client
TranslationServiceClient translationServiceClient = TranslationServiceClient.Create();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]";
// Make the request
PagedEnumerable<ListDatasetsResponse, Dataset> response = translationServiceClient.ListDatasets(parent);

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

ListDatasetsAsync(LocationName, string, int?, CallSettings)

public virtual PagedAsyncEnumerable<ListDatasetsResponse, Dataset> ListDatasetsAsync(LocationName parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

Lists datasets.

Parameters
Name Description
parent LocationName

Required. Name of the parent project. In form of projects/{project-number-or-id}/locations/{location-id}

pageToken string

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

pageSize int

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

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
PagedAsyncEnumerableListDatasetsResponseDataset

A pageable asynchronous sequence of Dataset resources.

Example
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
// Make the request
PagedAsyncEnumerable<ListDatasetsResponse, Dataset> response = translationServiceClient.ListDatasetsAsync(parent);

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

ListDatasetsAsync(ListDatasetsRequest, CallSettings)

public virtual PagedAsyncEnumerable<ListDatasetsResponse, Dataset> ListDatasetsAsync(ListDatasetsRequest request, CallSettings callSettings = null)

Lists datasets.

Parameters
Name Description
request ListDatasetsRequest

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
PagedAsyncEnumerableListDatasetsResponseDataset

A pageable asynchronous sequence of Dataset resources.

Example
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
ListDatasetsRequest request = new ListDatasetsRequest
{
    ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
};
// Make the request
PagedAsyncEnumerable<ListDatasetsResponse, Dataset> response = translationServiceClient.ListDatasetsAsync(request);

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

ListDatasetsAsync(string, string, int?, CallSettings)

public virtual PagedAsyncEnumerable<ListDatasetsResponse, Dataset> ListDatasetsAsync(string parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

Lists datasets.

Parameters
Name Description
parent string

Required. Name of the parent project. In form of projects/{project-number-or-id}/locations/{location-id}

pageToken string

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

pageSize int

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

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
PagedAsyncEnumerableListDatasetsResponseDataset

A pageable asynchronous sequence of Dataset resources.

Example
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]";
// Make the request
PagedAsyncEnumerable<ListDatasetsResponse, Dataset> response = translationServiceClient.ListDatasetsAsync(parent);

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

ListExamples(DatasetName, string, int?, CallSettings)

public virtual PagedEnumerable<ListExamplesResponse, Example> ListExamples(DatasetName parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

Lists sentence pairs in the dataset.

Parameters
Name Description
parent DatasetName

Required. Name of the parent dataset. In form of projects/{project-number-or-id}/locations/{location-id}/datasets/{dataset-id}

pageToken string

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

pageSize int

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

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
PagedEnumerableListExamplesResponseExample

A pageable sequence of Example resources.

Example
// Create client
TranslationServiceClient translationServiceClient = TranslationServiceClient.Create();
// Initialize request argument(s)
DatasetName parent = DatasetName.FromProjectLocationDataset("[PROJECT]", "[LOCATION]", "[DATASET]");
// Make the request
PagedEnumerable<ListExamplesResponse, Example> response = translationServiceClient.ListExamples(parent);

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

ListExamples(ListExamplesRequest, CallSettings)

public virtual PagedEnumerable<ListExamplesResponse, Example> ListExamples(ListExamplesRequest request, CallSettings callSettings = null)

Lists sentence pairs in the dataset.

Parameters
Name Description
request ListExamplesRequest

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
PagedEnumerableListExamplesResponseExample

A pageable sequence of Example resources.

Example
// Create client
TranslationServiceClient translationServiceClient = TranslationServiceClient.Create();
// Initialize request argument(s)
ListExamplesRequest request = new ListExamplesRequest
{
    ParentAsDatasetName = DatasetName.FromProjectLocationDataset("[PROJECT]", "[LOCATION]", "[DATASET]"),
    Filter = "",
};
// Make the request
PagedEnumerable<ListExamplesResponse, Example> response = translationServiceClient.ListExamples(request);

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

ListExamples(string, string, int?, CallSettings)

public virtual PagedEnumerable<ListExamplesResponse, Example> ListExamples(string parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

Lists sentence pairs in the dataset.

Parameters
Name Description
parent string

Required. Name of the parent dataset. In form of projects/{project-number-or-id}/locations/{location-id}/datasets/{dataset-id}

pageToken string

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

pageSize int

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

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
PagedEnumerableListExamplesResponseExample

A pageable sequence of Example resources.

Example
// Create client
TranslationServiceClient translationServiceClient = TranslationServiceClient.Create();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]/datasets/[DATASET]";
// Make the request
PagedEnumerable<ListExamplesResponse, Example> response = translationServiceClient.ListExamples(parent);

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

ListExamplesAsync(DatasetName, string, int?, CallSettings)

public virtual PagedAsyncEnumerable<ListExamplesResponse, Example> ListExamplesAsync(DatasetName parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

Lists sentence pairs in the dataset.

Parameters
Name Description
parent DatasetName

Required. Name of the parent dataset. In form of projects/{project-number-or-id}/locations/{location-id}/datasets/{dataset-id}

pageToken string

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

pageSize int

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

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
PagedAsyncEnumerableListExamplesResponseExample

A pageable asynchronous sequence of Example resources.

Example
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
DatasetName parent = DatasetName.FromProjectLocationDataset("[PROJECT]", "[LOCATION]", "[DATASET]");
// Make the request
PagedAsyncEnumerable<ListExamplesResponse, Example> response = translationServiceClient.ListExamplesAsync(parent);

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

ListExamplesAsync(ListExamplesRequest, CallSettings)

public virtual PagedAsyncEnumerable<ListExamplesResponse, Example> ListExamplesAsync(ListExamplesRequest request, CallSettings callSettings = null)

Lists sentence pairs in the dataset.

Parameters
Name Description
request ListExamplesRequest

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
PagedAsyncEnumerableListExamplesResponseExample

A pageable asynchronous sequence of Example resources.

Example
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
ListExamplesRequest request = new ListExamplesRequest
{
    ParentAsDatasetName = DatasetName.FromProjectLocationDataset("[PROJECT]", "[LOCATION]", "[DATASET]"),
    Filter = "",
};
// Make the request
PagedAsyncEnumerable<ListExamplesResponse, Example> response = translationServiceClient.ListExamplesAsync(request);

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

ListExamplesAsync(string, string, int?, CallSettings)

public virtual PagedAsyncEnumerable<ListExamplesResponse, Example> ListExamplesAsync(string parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

Lists sentence pairs in the dataset.

Parameters
Name Description
parent string

Required. Name of the parent dataset. In form of projects/{project-number-or-id}/locations/{location-id}/datasets/{dataset-id}

pageToken string

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

pageSize int

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

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
PagedAsyncEnumerableListExamplesResponseExample

A pageable asynchronous sequence of Example resources.

Example
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]/datasets/[DATASET]";
// Make the request
PagedAsyncEnumerable<ListExamplesResponse, Example> response = translationServiceClient.ListExamplesAsync(parent);

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

ListGlossaries(LocationName, string, int?, CallSettings)

public virtual PagedEnumerable<ListGlossariesResponse, Glossary> ListGlossaries(LocationName parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

Lists glossaries in a project. Returns NOT_FOUND, if the project doesn't exist.

Parameters
Name Description
parent LocationName

Required. The name of the project from which to list all of the glossaries.

pageToken string

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

pageSize int

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

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
PagedEnumerableListGlossariesResponseGlossary

A pageable sequence of Glossary resources.

Example
// Create client
TranslationServiceClient translationServiceClient = TranslationServiceClient.Create();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
// Make the request
PagedEnumerable<ListGlossariesResponse, Glossary> response = translationServiceClient.ListGlossaries(parent);

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

ListGlossaries(ListGlossariesRequest, CallSettings)

public virtual PagedEnumerable<ListGlossariesResponse, Glossary> ListGlossaries(ListGlossariesRequest request, CallSettings callSettings = null)

Lists glossaries in a project. Returns NOT_FOUND, if the project doesn't exist.

Parameters
Name Description
request ListGlossariesRequest

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
PagedEnumerableListGlossariesResponseGlossary

A pageable sequence of Glossary resources.

Example
// Create client
TranslationServiceClient translationServiceClient = TranslationServiceClient.Create();
// Initialize request argument(s)
ListGlossariesRequest request = new ListGlossariesRequest
{
    ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
    Filter = "",
};
// Make the request
PagedEnumerable<ListGlossariesResponse, Glossary> response = translationServiceClient.ListGlossaries(request);

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

ListGlossaries(string, string, int?, CallSettings)

public virtual PagedEnumerable<ListGlossariesResponse, Glossary> ListGlossaries(string parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

Lists glossaries in a project. Returns NOT_FOUND, if the project doesn't exist.

Parameters
Name Description
parent string

Required. The name of the project from which to list all of the glossaries.

pageToken string

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

pageSize int

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

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
PagedEnumerableListGlossariesResponseGlossary

A pageable sequence of Glossary resources.

Example
// Create client
TranslationServiceClient translationServiceClient = TranslationServiceClient.Create();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]";
// Make the request
PagedEnumerable<ListGlossariesResponse, Glossary> response = translationServiceClient.ListGlossaries(parent);

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

ListGlossariesAsync(LocationName, string, int?, CallSettings)

public virtual PagedAsyncEnumerable<ListGlossariesResponse, Glossary> ListGlossariesAsync(LocationName parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

Lists glossaries in a project. Returns NOT_FOUND, if the project doesn't exist.

Parameters
Name Description
parent LocationName

Required. The name of the project from which to list all of the glossaries.

pageToken string

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

pageSize int

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

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
PagedAsyncEnumerableListGlossariesResponseGlossary

A pageable asynchronous sequence of Glossary resources.

Example
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
// Make the request
PagedAsyncEnumerable<ListGlossariesResponse, Glossary> response = translationServiceClient.ListGlossariesAsync(parent);

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

ListGlossariesAsync(ListGlossariesRequest, CallSettings)

public virtual PagedAsyncEnumerable<ListGlossariesResponse, Glossary> ListGlossariesAsync(ListGlossariesRequest request, CallSettings callSettings = null)

Lists glossaries in a project. Returns NOT_FOUND, if the project doesn't exist.

Parameters
Name Description
request ListGlossariesRequest

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
PagedAsyncEnumerableListGlossariesResponseGlossary

A pageable asynchronous sequence of Glossary resources.

Example
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
ListGlossariesRequest request = new ListGlossariesRequest
{
    ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
    Filter = "",
};
// Make the request
PagedAsyncEnumerable<ListGlossariesResponse, Glossary> response = translationServiceClient.ListGlossariesAsync(request);

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

ListGlossariesAsync(string, string, int?, CallSettings)

public virtual PagedAsyncEnumerable<ListGlossariesResponse, Glossary> ListGlossariesAsync(string parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

Lists glossaries in a project. Returns NOT_FOUND, if the project doesn't exist.

Parameters
Name Description
parent string

Required. The name of the project from which to list all of the glossaries.

pageToken string

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

pageSize int

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

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
PagedAsyncEnumerableListGlossariesResponseGlossary

A pageable asynchronous sequence of Glossary resources.

Example
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]";
// Make the request
PagedAsyncEnumerable<ListGlossariesResponse, Glossary> response = translationServiceClient.ListGlossariesAsync(parent);

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

ListGlossaryEntries(GlossaryName, string, int?, CallSettings)

public virtual PagedEnumerable<ListGlossaryEntriesResponse, GlossaryEntry> ListGlossaryEntries(GlossaryName parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

List the entries for the glossary.

Parameters
Name Description
parent GlossaryName

Required. The parent glossary resource name for listing the glossary's entries.

pageToken string

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

pageSize int

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

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
PagedEnumerableListGlossaryEntriesResponseGlossaryEntry

A pageable sequence of GlossaryEntry resources.

Example
// Create client
TranslationServiceClient translationServiceClient = TranslationServiceClient.Create();
// Initialize request argument(s)
GlossaryName parent = GlossaryName.FromProjectLocationGlossary("[PROJECT]", "[LOCATION]", "[GLOSSARY]");
// Make the request
PagedEnumerable<ListGlossaryEntriesResponse, GlossaryEntry> response = translationServiceClient.ListGlossaryEntries(parent);

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

ListGlossaryEntries(ListGlossaryEntriesRequest, CallSettings)

public virtual PagedEnumerable<ListGlossaryEntriesResponse, GlossaryEntry> ListGlossaryEntries(ListGlossaryEntriesRequest request, CallSettings callSettings = null)

List the entries for the glossary.

Parameters
Name Description
request ListGlossaryEntriesRequest

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
PagedEnumerableListGlossaryEntriesResponseGlossaryEntry

A pageable sequence of GlossaryEntry resources.

Example
// Create client
TranslationServiceClient translationServiceClient = TranslationServiceClient.Create();
// Initialize request argument(s)
ListGlossaryEntriesRequest request = new ListGlossaryEntriesRequest
{
    ParentAsGlossaryName = GlossaryName.FromProjectLocationGlossary("[PROJECT]", "[LOCATION]", "[GLOSSARY]"),
};
// Make the request
PagedEnumerable<ListGlossaryEntriesResponse, GlossaryEntry> response = translationServiceClient.ListGlossaryEntries(request);

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

ListGlossaryEntries(string, string, int?, CallSettings)

public virtual PagedEnumerable<ListGlossaryEntriesResponse, GlossaryEntry> ListGlossaryEntries(string parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

List the entries for the glossary.

Parameters
Name Description
parent string

Required. The parent glossary resource name for listing the glossary's entries.

pageToken string

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

pageSize int

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

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
PagedEnumerableListGlossaryEntriesResponseGlossaryEntry

A pageable sequence of GlossaryEntry resources.

Example
// Create client
TranslationServiceClient translationServiceClient = TranslationServiceClient.Create();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]/glossaries/[GLOSSARY]";
// Make the request
PagedEnumerable<ListGlossaryEntriesResponse, GlossaryEntry> response = translationServiceClient.ListGlossaryEntries(parent);

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

ListGlossaryEntriesAsync(GlossaryName, string, int?, CallSettings)

public virtual PagedAsyncEnumerable<ListGlossaryEntriesResponse, GlossaryEntry> ListGlossaryEntriesAsync(GlossaryName parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

List the entries for the glossary.

Parameters
Name Description
parent GlossaryName

Required. The parent glossary resource name for listing the glossary's entries.

pageToken string

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

pageSize int

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

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
PagedAsyncEnumerableListGlossaryEntriesResponseGlossaryEntry

A pageable asynchronous sequence of GlossaryEntry resources.

Example
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
GlossaryName parent = GlossaryName.FromProjectLocationGlossary("[PROJECT]", "[LOCATION]", "[GLOSSARY]");
// Make the request
PagedAsyncEnumerable<ListGlossaryEntriesResponse, GlossaryEntry> response = translationServiceClient.ListGlossaryEntriesAsync(parent);

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

ListGlossaryEntriesAsync(ListGlossaryEntriesRequest, CallSettings)

public virtual PagedAsyncEnumerable<ListGlossaryEntriesResponse, GlossaryEntry> ListGlossaryEntriesAsync(ListGlossaryEntriesRequest request, CallSettings callSettings = null)

List the entries for the glossary.

Parameters
Name Description
request ListGlossaryEntriesRequest

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
PagedAsyncEnumerableListGlossaryEntriesResponseGlossaryEntry

A pageable asynchronous sequence of GlossaryEntry resources.

Example
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
ListGlossaryEntriesRequest request = new ListGlossaryEntriesRequest
{
    ParentAsGlossaryName = GlossaryName.FromProjectLocationGlossary("[PROJECT]", "[LOCATION]", "[GLOSSARY]"),
};
// Make the request
PagedAsyncEnumerable<ListGlossaryEntriesResponse, GlossaryEntry> response = translationServiceClient.ListGlossaryEntriesAsync(request);

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

ListGlossaryEntriesAsync(string, string, int?, CallSettings)

public virtual PagedAsyncEnumerable<ListGlossaryEntriesResponse, GlossaryEntry> ListGlossaryEntriesAsync(string parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

List the entries for the glossary.

Parameters
Name Description
parent string

Required. The parent glossary resource name for listing the glossary's entries.

pageToken string

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

pageSize int

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

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
PagedAsyncEnumerableListGlossaryEntriesResponseGlossaryEntry

A pageable asynchronous sequence of GlossaryEntry resources.

Example
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]/glossaries/[GLOSSARY]";
// Make the request
PagedAsyncEnumerable<ListGlossaryEntriesResponse, GlossaryEntry> response = translationServiceClient.ListGlossaryEntriesAsync(parent);

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

ListModels(LocationName, string, int?, CallSettings)

public virtual PagedEnumerable<ListModelsResponse, Model> ListModels(LocationName parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

Lists models.

Parameters
Name Description
parent LocationName

Required. Name of the parent project. In form of projects/{project-number-or-id}/locations/{location-id}

pageToken string

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

pageSize int

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

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
PagedEnumerableListModelsResponseModel

A pageable sequence of Model resources.

Example
// Create client
TranslationServiceClient translationServiceClient = TranslationServiceClient.Create();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
// Make the request
PagedEnumerable<ListModelsResponse, Model> response = translationServiceClient.ListModels(parent);

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

ListModels(ListModelsRequest, CallSettings)

public virtual PagedEnumerable<ListModelsResponse, Model> ListModels(ListModelsRequest request, CallSettings callSettings = null)

Lists models.

Parameters
Name Description
request ListModelsRequest

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
PagedEnumerableListModelsResponseModel

A pageable sequence of Model resources.

Example
// Create client
TranslationServiceClient translationServiceClient = TranslationServiceClient.Create();
// Initialize request argument(s)
ListModelsRequest request = new ListModelsRequest
{
    ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
    Filter = "",
};
// Make the request
PagedEnumerable<ListModelsResponse, Model> response = translationServiceClient.ListModels(request);

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

ListModels(string, string, int?, CallSettings)

public virtual PagedEnumerable<ListModelsResponse, Model> ListModels(string parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

Lists models.

Parameters
Name Description
parent string

Required. Name of the parent project. In form of projects/{project-number-or-id}/locations/{location-id}

pageToken string

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

pageSize int

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

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
PagedEnumerableListModelsResponseModel

A pageable sequence of Model resources.

Example
// Create client
TranslationServiceClient translationServiceClient = TranslationServiceClient.Create();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]";
// Make the request
PagedEnumerable<ListModelsResponse, Model> response = translationServiceClient.ListModels(parent);

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

ListModelsAsync(LocationName, string, int?, CallSettings)

public virtual PagedAsyncEnumerable<ListModelsResponse, Model> ListModelsAsync(LocationName parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

Lists models.

Parameters
Name Description
parent LocationName

Required. Name of the parent project. In form of projects/{project-number-or-id}/locations/{location-id}

pageToken string

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

pageSize int

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

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
PagedAsyncEnumerableListModelsResponseModel

A pageable asynchronous sequence of Model resources.

Example
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
// Make the request
PagedAsyncEnumerable<ListModelsResponse, Model> response = translationServiceClient.ListModelsAsync(parent);

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

ListModelsAsync(ListModelsRequest, CallSettings)

public virtual PagedAsyncEnumerable<ListModelsResponse, Model> ListModelsAsync(ListModelsRequest request, CallSettings callSettings = null)

Lists models.

Parameters
Name Description
request ListModelsRequest

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
PagedAsyncEnumerableListModelsResponseModel

A pageable asynchronous sequence of Model resources.

Example
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
ListModelsRequest request = new ListModelsRequest
{
    ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
    Filter = "",
};
// Make the request
PagedAsyncEnumerable<ListModelsResponse, Model> response = translationServiceClient.ListModelsAsync(request);

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

ListModelsAsync(string, string, int?, CallSettings)

public virtual PagedAsyncEnumerable<ListModelsResponse, Model> ListModelsAsync(string parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

Lists models.

Parameters
Name Description
parent string

Required. Name of the parent project. In form of projects/{project-number-or-id}/locations/{location-id}

pageToken string

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

pageSize int

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

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
PagedAsyncEnumerableListModelsResponseModel

A pageable asynchronous sequence of Model resources.

Example
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]";
// Make the request
PagedAsyncEnumerable<ListModelsResponse, Model> response = translationServiceClient.ListModelsAsync(parent);

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

PollOnceBatchTranslateDocument(string, CallSettings)

public virtual Operation<BatchTranslateDocumentResponse, BatchTranslateDocumentMetadata> PollOnceBatchTranslateDocument(string operationName, CallSettings callSettings = null)

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

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
OperationBatchTranslateDocumentResponseBatchTranslateDocumentMetadata

The result of polling the operation.

PollOnceBatchTranslateDocumentAsync(string, CallSettings)

public virtual Task<Operation<BatchTranslateDocumentResponse, BatchTranslateDocumentMetadata>> PollOnceBatchTranslateDocumentAsync(string operationName, CallSettings callSettings = null)

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

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
TaskOperationBatchTranslateDocumentResponseBatchTranslateDocumentMetadata

A task representing the result of polling the operation.

PollOnceBatchTranslateText(string, CallSettings)

public virtual Operation<BatchTranslateResponse, BatchTranslateMetadata> PollOnceBatchTranslateText(string operationName, CallSettings callSettings = null)

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

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
OperationBatchTranslateResponseBatchTranslateMetadata

The result of polling the operation.

PollOnceBatchTranslateTextAsync(string, CallSettings)

public virtual Task<Operation<BatchTranslateResponse, BatchTranslateMetadata>> PollOnceBatchTranslateTextAsync(string operationName, CallSettings callSettings = null)

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

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
TaskOperationBatchTranslateResponseBatchTranslateMetadata

A task representing the result of polling the operation.

PollOnceCreateDataset(string, CallSettings)

public virtual Operation<Dataset, CreateDatasetMetadata> PollOnceCreateDataset(string operationName, CallSettings callSettings = null)

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

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
OperationDatasetCreateDatasetMetadata

The result of polling the operation.

PollOnceCreateDatasetAsync(string, CallSettings)

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

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

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
TaskOperationDatasetCreateDatasetMetadata

A task representing the result of polling the operation.

PollOnceCreateGlossary(string, CallSettings)

public virtual Operation<Glossary, CreateGlossaryMetadata> PollOnceCreateGlossary(string operationName, CallSettings callSettings = null)

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

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
OperationGlossaryCreateGlossaryMetadata

The result of polling the operation.

PollOnceCreateGlossaryAsync(string, CallSettings)

public virtual Task<Operation<Glossary, CreateGlossaryMetadata>> PollOnceCreateGlossaryAsync(string operationName, CallSettings callSettings = null)

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

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
TaskOperationGlossaryCreateGlossaryMetadata

A task representing the result of polling the operation.

PollOnceCreateModel(string, CallSettings)

public virtual Operation<Model, CreateModelMetadata> PollOnceCreateModel(string operationName, CallSettings callSettings = null)

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

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
OperationModelCreateModelMetadata

The result of polling the operation.

PollOnceCreateModelAsync(string, CallSettings)

public virtual Task<Operation<Model, CreateModelMetadata>> PollOnceCreateModelAsync(string operationName, CallSettings callSettings = null)

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

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
TaskOperationModelCreateModelMetadata

A task representing the result of polling the operation.

PollOnceDeleteDataset(string, CallSettings)

public virtual Operation<Empty, DeleteDatasetMetadata> PollOnceDeleteDataset(string operationName, CallSettings callSettings = null)

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

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
OperationEmptyDeleteDatasetMetadata

The result of polling the operation.

PollOnceDeleteDatasetAsync(string, CallSettings)

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

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

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
TaskOperationEmptyDeleteDatasetMetadata

A task representing the result of polling the operation.

PollOnceDeleteGlossary(string, CallSettings)

public virtual Operation<DeleteGlossaryResponse, DeleteGlossaryMetadata> PollOnceDeleteGlossary(string operationName, CallSettings callSettings = null)

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

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
OperationDeleteGlossaryResponseDeleteGlossaryMetadata

The result of polling the operation.

PollOnceDeleteGlossaryAsync(string, CallSettings)

public virtual Task<Operation<DeleteGlossaryResponse, DeleteGlossaryMetadata>> PollOnceDeleteGlossaryAsync(string operationName, CallSettings callSettings = null)

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

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
TaskOperationDeleteGlossaryResponseDeleteGlossaryMetadata

A task representing the result of polling the operation.

PollOnceDeleteModel(string, CallSettings)

public virtual Operation<Empty, DeleteModelMetadata> PollOnceDeleteModel(string operationName, CallSettings callSettings = null)

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

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
OperationEmptyDeleteModelMetadata

The result of polling the operation.

PollOnceDeleteModelAsync(string, CallSettings)

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

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

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
TaskOperationEmptyDeleteModelMetadata

A task representing the result of polling the operation.

PollOnceExportData(string, CallSettings)

public virtual Operation<Empty, ExportDataMetadata> PollOnceExportData(string operationName, CallSettings callSettings = null)

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

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
OperationEmptyExportDataMetadata

The result of polling the operation.

PollOnceExportDataAsync(string, CallSettings)

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

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

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
TaskOperationEmptyExportDataMetadata

A task representing the result of polling the operation.

PollOnceImportData(string, CallSettings)

public virtual Operation<Empty, ImportDataMetadata> PollOnceImportData(string operationName, CallSettings callSettings = null)

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

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
OperationEmptyImportDataMetadata

The result of polling the operation.

PollOnceImportDataAsync(string, CallSettings)

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

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

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
TaskOperationEmptyImportDataMetadata

A task representing the result of polling the operation.

PollOnceUpdateGlossary(string, CallSettings)

public virtual Operation<Glossary, UpdateGlossaryMetadata> PollOnceUpdateGlossary(string operationName, CallSettings callSettings = null)

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

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
OperationGlossaryUpdateGlossaryMetadata

The result of polling the operation.

PollOnceUpdateGlossaryAsync(string, CallSettings)

public virtual Task<Operation<Glossary, UpdateGlossaryMetadata>> PollOnceUpdateGlossaryAsync(string operationName, CallSettings callSettings = null)

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

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
TaskOperationGlossaryUpdateGlossaryMetadata

A task representing the result of polling the operation.

RomanizeText(LocationName, IEnumerable<string>, CallSettings)

public virtual RomanizeTextResponse RomanizeText(LocationName parent, IEnumerable<string> contents, CallSettings callSettings = null)

Romanize input text written in non-Latin scripts to Latin text.

Parameters
Name Description
parent LocationName

Required. Project or location to make a call. Must refer to a caller's project.

Format: projects/{project-number-or-id}/locations/{location-id} or projects/{project-number-or-id}.

For global calls, use projects/{project-number-or-id}/locations/global or projects/{project-number-or-id}.

contents IEnumerablestring

Required. The content of the input in string format.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
RomanizeTextResponse

The RPC response.

Example
// Create client
TranslationServiceClient translationServiceClient = TranslationServiceClient.Create();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
IEnumerable<string> contents = new string[] { "", };
// Make the request
RomanizeTextResponse response = translationServiceClient.RomanizeText(parent, contents);

RomanizeText(RomanizeTextRequest, CallSettings)

public virtual RomanizeTextResponse RomanizeText(RomanizeTextRequest request, CallSettings callSettings = null)

Romanize input text written in non-Latin scripts to Latin text.

Parameters
Name Description
request RomanizeTextRequest

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
RomanizeTextResponse

The RPC response.

Example
// Create client
TranslationServiceClient translationServiceClient = TranslationServiceClient.Create();
// Initialize request argument(s)
RomanizeTextRequest request = new RomanizeTextRequest
{
    Contents = { "", },
    SourceLanguageCode = "",
    ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
};
// Make the request
RomanizeTextResponse response = translationServiceClient.RomanizeText(request);

RomanizeText(string, IEnumerable<string>, CallSettings)

public virtual RomanizeTextResponse RomanizeText(string parent, IEnumerable<string> contents, CallSettings callSettings = null)

Romanize input text written in non-Latin scripts to Latin text.

Parameters
Name Description
parent string

Required. Project or location to make a call. Must refer to a caller's project.

Format: projects/{project-number-or-id}/locations/{location-id} or projects/{project-number-or-id}.

For global calls, use projects/{project-number-or-id}/locations/global or projects/{project-number-or-id}.

contents IEnumerablestring

Required. The content of the input in string format.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
RomanizeTextResponse

The RPC response.

Example
// Create client
TranslationServiceClient translationServiceClient = TranslationServiceClient.Create();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]";
IEnumerable<string> contents = new string[] { "", };
// Make the request
RomanizeTextResponse response = translationServiceClient.RomanizeText(parent, contents);

RomanizeTextAsync(LocationName, IEnumerable<string>, CallSettings)

public virtual Task<RomanizeTextResponse> RomanizeTextAsync(LocationName parent, IEnumerable<string> contents, CallSettings callSettings = null)

Romanize input text written in non-Latin scripts to Latin text.

Parameters
Name Description
parent LocationName

Required. Project or location to make a call. Must refer to a caller's project.

Format: projects/{project-number-or-id}/locations/{location-id} or projects/{project-number-or-id}.

For global calls, use projects/{project-number-or-id}/locations/global or projects/{project-number-or-id}.

contents IEnumerablestring

Required. The content of the input in string format.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskRomanizeTextResponse

A Task containing the RPC response.

Example
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
IEnumerable<string> contents = new string[] { "", };
// Make the request
RomanizeTextResponse response = await translationServiceClient.RomanizeTextAsync(parent, contents);

RomanizeTextAsync(LocationName, IEnumerable<string>, CancellationToken)

public virtual Task<RomanizeTextResponse> RomanizeTextAsync(LocationName parent, IEnumerable<string> contents, CancellationToken cancellationToken)

Romanize input text written in non-Latin scripts to Latin text.

Parameters
Name Description
parent LocationName

Required. Project or location to make a call. Must refer to a caller's project.

Format: projects/{project-number-or-id}/locations/{location-id} or projects/{project-number-or-id}.

For global calls, use projects/{project-number-or-id}/locations/global or projects/{project-number-or-id}.

contents IEnumerablestring

Required. The content of the input in string format.

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskRomanizeTextResponse

A Task containing the RPC response.

Example
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
IEnumerable<string> contents = new string[] { "", };
// Make the request
RomanizeTextResponse response = await translationServiceClient.RomanizeTextAsync(parent, contents);

RomanizeTextAsync(RomanizeTextRequest, CallSettings)

public virtual Task<RomanizeTextResponse> RomanizeTextAsync(RomanizeTextRequest request, CallSettings callSettings = null)

Romanize input text written in non-Latin scripts to Latin text.

Parameters
Name Description
request RomanizeTextRequest

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
TaskRomanizeTextResponse

A Task containing the RPC response.

Example
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
RomanizeTextRequest request = new RomanizeTextRequest
{
    Contents = { "", },
    SourceLanguageCode = "",
    ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
};
// Make the request
RomanizeTextResponse response = await translationServiceClient.RomanizeTextAsync(request);

RomanizeTextAsync(RomanizeTextRequest, CancellationToken)

public virtual Task<RomanizeTextResponse> RomanizeTextAsync(RomanizeTextRequest request, CancellationToken cancellationToken)

Romanize input text written in non-Latin scripts to Latin text.

Parameters
Name Description
request RomanizeTextRequest

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

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskRomanizeTextResponse

A Task containing the RPC response.

Example
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
RomanizeTextRequest request = new RomanizeTextRequest
{
    Contents = { "", },
    SourceLanguageCode = "",
    ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
};
// Make the request
RomanizeTextResponse response = await translationServiceClient.RomanizeTextAsync(request);

RomanizeTextAsync(string, IEnumerable<string>, CallSettings)

public virtual Task<RomanizeTextResponse> RomanizeTextAsync(string parent, IEnumerable<string> contents, CallSettings callSettings = null)

Romanize input text written in non-Latin scripts to Latin text.

Parameters
Name Description
parent string

Required. Project or location to make a call. Must refer to a caller's project.

Format: projects/{project-number-or-id}/locations/{location-id} or projects/{project-number-or-id}.

For global calls, use projects/{project-number-or-id}/locations/global or projects/{project-number-or-id}.

contents IEnumerablestring

Required. The content of the input in string format.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskRomanizeTextResponse

A Task containing the RPC response.

Example
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]";
IEnumerable<string> contents = new string[] { "", };
// Make the request
RomanizeTextResponse response = await translationServiceClient.RomanizeTextAsync(parent, contents);

RomanizeTextAsync(string, IEnumerable<string>, CancellationToken)

public virtual Task<RomanizeTextResponse> RomanizeTextAsync(string parent, IEnumerable<string> contents, CancellationToken cancellationToken)

Romanize input text written in non-Latin scripts to Latin text.

Parameters
Name Description
parent string

Required. Project or location to make a call. Must refer to a caller's project.

Format: projects/{project-number-or-id}/locations/{location-id} or projects/{project-number-or-id}.

For global calls, use projects/{project-number-or-id}/locations/global or projects/{project-number-or-id}.

contents IEnumerablestring

Required. The content of the input in string format.

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskRomanizeTextResponse

A Task containing the RPC response.

Example
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]";
IEnumerable<string> contents = new string[] { "", };
// Make the request
RomanizeTextResponse response = await translationServiceClient.RomanizeTextAsync(parent, contents);

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.

TranslateDocument(TranslateDocumentRequest, CallSettings)

public virtual TranslateDocumentResponse TranslateDocument(TranslateDocumentRequest request, CallSettings callSettings = null)

Translates documents in synchronous mode.

Parameters
Name Description
request TranslateDocumentRequest

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
TranslateDocumentResponse

The RPC response.

Example
// Create client
TranslationServiceClient translationServiceClient = TranslationServiceClient.Create();
// Initialize request argument(s)
TranslateDocumentRequest request = new TranslateDocumentRequest
{
    Parent = "",
    SourceLanguageCode = "",
    TargetLanguageCode = "",
    DocumentInputConfig = new DocumentInputConfig(),
    DocumentOutputConfig = new DocumentOutputConfig(),
    Model = "",
    GlossaryConfig = new TranslateTextGlossaryConfig(),
    Labels = { { "", "" }, },
    CustomizedAttribution = "",
    IsTranslateNativePdfOnly = false,
    EnableShadowRemovalNativePdf = false,
    EnableRotationCorrection = false,
};
// Make the request
TranslateDocumentResponse response = translationServiceClient.TranslateDocument(request);

TranslateDocumentAsync(TranslateDocumentRequest, CallSettings)

public virtual Task<TranslateDocumentResponse> TranslateDocumentAsync(TranslateDocumentRequest request, CallSettings callSettings = null)

Translates documents in synchronous mode.

Parameters
Name Description
request TranslateDocumentRequest

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
TaskTranslateDocumentResponse

A Task containing the RPC response.

Example
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
TranslateDocumentRequest request = new TranslateDocumentRequest
{
    Parent = "",
    SourceLanguageCode = "",
    TargetLanguageCode = "",
    DocumentInputConfig = new DocumentInputConfig(),
    DocumentOutputConfig = new DocumentOutputConfig(),
    Model = "",
    GlossaryConfig = new TranslateTextGlossaryConfig(),
    Labels = { { "", "" }, },
    CustomizedAttribution = "",
    IsTranslateNativePdfOnly = false,
    EnableShadowRemovalNativePdf = false,
    EnableRotationCorrection = false,
};
// Make the request
TranslateDocumentResponse response = await translationServiceClient.TranslateDocumentAsync(request);

TranslateDocumentAsync(TranslateDocumentRequest, CancellationToken)

public virtual Task<TranslateDocumentResponse> TranslateDocumentAsync(TranslateDocumentRequest request, CancellationToken cancellationToken)

Translates documents in synchronous mode.

Parameters
Name Description
request TranslateDocumentRequest

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

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskTranslateDocumentResponse

A Task containing the RPC response.

Example
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
TranslateDocumentRequest request = new TranslateDocumentRequest
{
    Parent = "",
    SourceLanguageCode = "",
    TargetLanguageCode = "",
    DocumentInputConfig = new DocumentInputConfig(),
    DocumentOutputConfig = new DocumentOutputConfig(),
    Model = "",
    GlossaryConfig = new TranslateTextGlossaryConfig(),
    Labels = { { "", "" }, },
    CustomizedAttribution = "",
    IsTranslateNativePdfOnly = false,
    EnableShadowRemovalNativePdf = false,
    EnableRotationCorrection = false,
};
// Make the request
TranslateDocumentResponse response = await translationServiceClient.TranslateDocumentAsync(request);

TranslateText(LocationName, string, IEnumerable<string>, CallSettings)

public virtual TranslateTextResponse TranslateText(LocationName parent, string targetLanguageCode, IEnumerable<string> contents, CallSettings callSettings = null)

Translates input text and returns translated text.

Parameters
Name Description
parent LocationName

Required. Project or location to make a call. Must refer to a caller's project.

Format: projects/{project-number-or-id} or projects/{project-number-or-id}/locations/{location-id}.

For global calls, use projects/{project-number-or-id}/locations/global or projects/{project-number-or-id}.

Non-global location is required for requests using AutoML models or custom glossaries.

Models and glossaries must be within the same region (have same location-id), otherwise an INVALID_ARGUMENT (400) error is returned.

targetLanguageCode string

Required. The ISO-639 language code to use for translation of the input text, set to one of the language codes listed in Language Support.

contents IEnumerablestring

Required. The content of the input in string format. We recommend the total content be less than 30,000 codepoints. The max length of this field is 1024. Use BatchTranslateText for larger text.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TranslateTextResponse

The RPC response.

Example
// Create client
TranslationServiceClient translationServiceClient = TranslationServiceClient.Create();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
string targetLanguageCode = "";
IEnumerable<string> contents = new string[] { "", };
// Make the request
TranslateTextResponse response = translationServiceClient.TranslateText(parent, targetLanguageCode, contents);

TranslateText(LocationName, string, string, string, string, IEnumerable<string>, CallSettings)

public virtual TranslateTextResponse TranslateText(LocationName parent, string model, string mimeType, string sourceLanguageCode, string targetLanguageCode, IEnumerable<string> contents, CallSettings callSettings = null)

Translates input text and returns translated text.

Parameters
Name Description
parent LocationName

Required. Project or location to make a call. Must refer to a caller's project.

Format: projects/{project-number-or-id} or projects/{project-number-or-id}/locations/{location-id}.

For global calls, use projects/{project-number-or-id}/locations/global or projects/{project-number-or-id}.

Non-global location is required for requests using AutoML models or custom glossaries.

Models and glossaries must be within the same region (have same location-id), otherwise an INVALID_ARGUMENT (400) error is returned.

model string

Optional. The model type requested for this translation.

The format depends on model type:

  • AutoML Translation models: projects/{project-number-or-id}/locations/{location-id}/models/{model-id}

  • General (built-in) models: projects/{project-number-or-id}/locations/{location-id}/models/general/nmt,

  • Translation LLM models: projects/{project-number-or-id}/locations/{location-id}/models/general/translation-llm,

For global (non-regionalized) requests, use location-id global. For example, projects/{project-number-or-id}/locations/global/models/general/nmt.

If not provided, the default Google model (NMT) will be used

mimeType string

Optional. The format of the source text, for example, "text/html", "text/plain". If left blank, the MIME type defaults to "text/html".

sourceLanguageCode string

Optional. The ISO-639 language code of the input text if known, for example, "en-US" or "sr-Latn". Supported language codes are listed in Language Support. If the source language isn't specified, the API attempts to identify the source language automatically and returns the source language within the response.

targetLanguageCode string

Required. The ISO-639 language code to use for translation of the input text, set to one of the language codes listed in Language Support.

contents IEnumerablestring

Required. The content of the input in string format. We recommend the total content be less than 30,000 codepoints. The max length of this field is 1024. Use BatchTranslateText for larger text.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TranslateTextResponse

The RPC response.

Example
// Create client
TranslationServiceClient translationServiceClient = TranslationServiceClient.Create();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
string model = "";
string mimeType = "";
string sourceLanguageCode = "";
string targetLanguageCode = "";
IEnumerable<string> contents = new string[] { "", };
// Make the request
TranslateTextResponse response = translationServiceClient.TranslateText(parent, model, mimeType, sourceLanguageCode, targetLanguageCode, contents);

TranslateText(TranslateTextRequest, CallSettings)

public virtual TranslateTextResponse TranslateText(TranslateTextRequest request, CallSettings callSettings = null)

Translates input text and returns translated text.

Parameters
Name Description
request TranslateTextRequest

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
TranslateTextResponse

The RPC response.

Example
// Create client
TranslationServiceClient translationServiceClient = TranslationServiceClient.Create();
// Initialize request argument(s)
TranslateTextRequest request = new TranslateTextRequest
{
    Contents = { "", },
    MimeType = "",
    SourceLanguageCode = "",
    TargetLanguageCode = "",
    Model = "",
    GlossaryConfig = new TranslateTextGlossaryConfig(),
    ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
    Labels = { { "", "" }, },
    TransliterationConfig = new TransliterationConfig(),
};
// Make the request
TranslateTextResponse response = translationServiceClient.TranslateText(request);

TranslateText(string, string, IEnumerable<string>, CallSettings)

public virtual TranslateTextResponse TranslateText(string parent, string targetLanguageCode, IEnumerable<string> contents, CallSettings callSettings = null)

Translates input text and returns translated text.

Parameters
Name Description
parent string

Required. Project or location to make a call. Must refer to a caller's project.

Format: projects/{project-number-or-id} or projects/{project-number-or-id}/locations/{location-id}.

For global calls, use projects/{project-number-or-id}/locations/global or projects/{project-number-or-id}.

Non-global location is required for requests using AutoML models or custom glossaries.

Models and glossaries must be within the same region (have same location-id), otherwise an INVALID_ARGUMENT (400) error is returned.

targetLanguageCode string

Required. The ISO-639 language code to use for translation of the input text, set to one of the language codes listed in Language Support.

contents IEnumerablestring

Required. The content of the input in string format. We recommend the total content be less than 30,000 codepoints. The max length of this field is 1024. Use BatchTranslateText for larger text.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TranslateTextResponse

The RPC response.

Example
// Create client
TranslationServiceClient translationServiceClient = TranslationServiceClient.Create();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]";
string targetLanguageCode = "";
IEnumerable<string> contents = new string[] { "", };
// Make the request
TranslateTextResponse response = translationServiceClient.TranslateText(parent, targetLanguageCode, contents);

TranslateText(string, string, string, string, string, IEnumerable<string>, CallSettings)

public virtual TranslateTextResponse TranslateText(string parent, string model, string mimeType, string sourceLanguageCode, string targetLanguageCode, IEnumerable<string> contents, CallSettings callSettings = null)

Translates input text and returns translated text.

Parameters
Name Description
parent string

Required. Project or location to make a call. Must refer to a caller's project.

Format: projects/{project-number-or-id} or projects/{project-number-or-id}/locations/{location-id}.

For global calls, use projects/{project-number-or-id}/locations/global or projects/{project-number-or-id}.

Non-global location is required for requests using AutoML models or custom glossaries.

Models and glossaries must be within the same region (have same location-id), otherwise an INVALID_ARGUMENT (400) error is returned.

model string

Optional. The model type requested for this translation.

The format depends on model type:

  • AutoML Translation models: projects/{project-number-or-id}/locations/{location-id}/models/{model-id}

  • General (built-in) models: projects/{project-number-or-id}/locations/{location-id}/models/general/nmt,

  • Translation LLM models: projects/{project-number-or-id}/locations/{location-id}/models/general/translation-llm,

For global (non-regionalized) requests, use location-id global. For example, projects/{project-number-or-id}/locations/global/models/general/nmt.

If not provided, the default Google model (NMT) will be used

mimeType string

Optional. The format of the source text, for example, "text/html", "text/plain". If left blank, the MIME type defaults to "text/html".

sourceLanguageCode string

Optional. The ISO-639 language code of the input text if known, for example, "en-US" or "sr-Latn". Supported language codes are listed in Language Support. If the source language isn't specified, the API attempts to identify the source language automatically and returns the source language within the response.

targetLanguageCode string

Required. The ISO-639 language code to use for translation of the input text, set to one of the language codes listed in Language Support.

contents IEnumerablestring

Required. The content of the input in string format. We recommend the total content be less than 30,000 codepoints. The max length of this field is 1024. Use BatchTranslateText for larger text.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TranslateTextResponse

The RPC response.

Example
// Create client
TranslationServiceClient translationServiceClient = TranslationServiceClient.Create();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]";
string model = "";
string mimeType = "";
string sourceLanguageCode = "";
string targetLanguageCode = "";
IEnumerable<string> contents = new string[] { "", };
// Make the request
TranslateTextResponse response = translationServiceClient.TranslateText(parent, model, mimeType, sourceLanguageCode, targetLanguageCode, contents);

TranslateTextAsync(LocationName, string, IEnumerable<string>, CallSettings)

public virtual Task<TranslateTextResponse> TranslateTextAsync(LocationName parent, string targetLanguageCode, IEnumerable<string> contents, CallSettings callSettings = null)

Translates input text and returns translated text.

Parameters
Name Description
parent LocationName

Required. Project or location to make a call. Must refer to a caller's project.

Format: projects/{project-number-or-id} or projects/{project-number-or-id}/locations/{location-id}.

For global calls, use projects/{project-number-or-id}/locations/global or projects/{project-number-or-id}.

Non-global location is required for requests using AutoML models or custom glossaries.

Models and glossaries must be within the same region (have same location-id), otherwise an INVALID_ARGUMENT (400) error is returned.

targetLanguageCode string

Required. The ISO-639 language code to use for translation of the input text, set to one of the language codes listed in Language Support.

contents IEnumerablestring

Required. The content of the input in string format. We recommend the total content be less than 30,000 codepoints. The max length of this field is 1024. Use BatchTranslateText for larger text.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskTranslateTextResponse

A Task containing the RPC response.

Example
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
string targetLanguageCode = "";
IEnumerable<string> contents = new string[] { "", };
// Make the request
TranslateTextResponse response = await translationServiceClient.TranslateTextAsync(parent, targetLanguageCode, contents);

TranslateTextAsync(LocationName, string, IEnumerable<string>, CancellationToken)

public virtual Task<TranslateTextResponse> TranslateTextAsync(LocationName parent, string targetLanguageCode, IEnumerable<string> contents, CancellationToken cancellationToken)

Translates input text and returns translated text.

Parameters
Name Description
parent LocationName

Required. Project or location to make a call. Must refer to a caller's project.

Format: projects/{project-number-or-id} or projects/{project-number-or-id}/locations/{location-id}.

For global calls, use projects/{project-number-or-id}/locations/global or projects/{project-number-or-id}.

Non-global location is required for requests using AutoML models or custom glossaries.

Models and glossaries must be within the same region (have same location-id), otherwise an INVALID_ARGUMENT (400) error is returned.

targetLanguageCode string

Required. The ISO-639 language code to use for translation of the input text, set to one of the language codes listed in Language Support.

contents IEnumerablestring

Required. The content of the input in string format. We recommend the total content be less than 30,000 codepoints. The max length of this field is 1024. Use BatchTranslateText for larger text.

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskTranslateTextResponse

A Task containing the RPC response.

Example
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
string targetLanguageCode = "";
IEnumerable<string> contents = new string[] { "", };
// Make the request
TranslateTextResponse response = await translationServiceClient.TranslateTextAsync(parent, targetLanguageCode, contents);

TranslateTextAsync(LocationName, string, string, string, string, IEnumerable<string>, CallSettings)

public virtual Task<TranslateTextResponse> TranslateTextAsync(LocationName parent, string model, string mimeType, string sourceLanguageCode, string targetLanguageCode, IEnumerable<string> contents, CallSettings callSettings = null)

Translates input text and returns translated text.

Parameters
Name Description
parent LocationName

Required. Project or location to make a call. Must refer to a caller's project.

Format: projects/{project-number-or-id} or projects/{project-number-or-id}/locations/{location-id}.

For global calls, use projects/{project-number-or-id}/locations/global or projects/{project-number-or-id}.

Non-global location is required for requests using AutoML models or custom glossaries.

Models and glossaries must be within the same region (have same location-id), otherwise an INVALID_ARGUMENT (400) error is returned.

model string

Optional. The model type requested for this translation.

The format depends on model type:

  • AutoML Translation models: projects/{project-number-or-id}/locations/{location-id}/models/{model-id}

  • General (built-in) models: projects/{project-number-or-id}/locations/{location-id}/models/general/nmt,

  • Translation LLM models: projects/{project-number-or-id}/locations/{location-id}/models/general/translation-llm,

For global (non-regionalized) requests, use location-id global. For example, projects/{project-number-or-id}/locations/global/models/general/nmt.

If not provided, the default Google model (NMT) will be used

mimeType string

Optional. The format of the source text, for example, "text/html", "text/plain". If left blank, the MIME type defaults to "text/html".

sourceLanguageCode string

Optional. The ISO-639 language code of the input text if known, for example, "en-US" or "sr-Latn". Supported language codes are listed in Language Support. If the source language isn't specified, the API attempts to identify the source language automatically and returns the source language within the response.

targetLanguageCode string

Required. The ISO-639 language code to use for translation of the input text, set to one of the language codes listed in Language Support.

contents IEnumerablestring

Required. The content of the input in string format. We recommend the total content be less than 30,000 codepoints. The max length of this field is 1024. Use BatchTranslateText for larger text.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskTranslateTextResponse

A Task containing the RPC response.

Example
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
string model = "";
string mimeType = "";
string sourceLanguageCode = "";
string targetLanguageCode = "";
IEnumerable<string> contents = new string[] { "", };
// Make the request
TranslateTextResponse response = await translationServiceClient.TranslateTextAsync(parent, model, mimeType, sourceLanguageCode, targetLanguageCode, contents);

TranslateTextAsync(LocationName, string, string, string, string, IEnumerable<string>, CancellationToken)

public virtual Task<TranslateTextResponse> TranslateTextAsync(LocationName parent, string model, string mimeType, string sourceLanguageCode, string targetLanguageCode, IEnumerable<string> contents, CancellationToken cancellationToken)

Translates input text and returns translated text.

Parameters
Name Description
parent LocationName

Required. Project or location to make a call. Must refer to a caller's project.

Format: projects/{project-number-or-id} or projects/{project-number-or-id}/locations/{location-id}.

For global calls, use projects/{project-number-or-id}/locations/global or projects/{project-number-or-id}.

Non-global location is required for requests using AutoML models or custom glossaries.

Models and glossaries must be within the same region (have same location-id), otherwise an INVALID_ARGUMENT (400) error is returned.

model string

Optional. The model type requested for this translation.

The format depends on model type:

  • AutoML Translation models: projects/{project-number-or-id}/locations/{location-id}/models/{model-id}

  • General (built-in) models: projects/{project-number-or-id}/locations/{location-id}/models/general/nmt,

  • Translation LLM models: projects/{project-number-or-id}/locations/{location-id}/models/general/translation-llm,

For global (non-regionalized) requests, use location-id global. For example, projects/{project-number-or-id}/locations/global/models/general/nmt.

If not provided, the default Google model (NMT) will be used

mimeType string

Optional. The format of the source text, for example, "text/html", "text/plain". If left blank, the MIME type defaults to "text/html".

sourceLanguageCode string

Optional. The ISO-639 language code of the input text if known, for example, "en-US" or "sr-Latn". Supported language codes are listed in Language Support. If the source language isn't specified, the API attempts to identify the source language automatically and returns the source language within the response.

targetLanguageCode string

Required. The ISO-639 language code to use for translation of the input text, set to one of the language codes listed in Language Support.

contents IEnumerablestring

Required. The content of the input in string format. We recommend the total content be less than 30,000 codepoints. The max length of this field is 1024. Use BatchTranslateText for larger text.

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskTranslateTextResponse

A Task containing the RPC response.

Example
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
string model = "";
string mimeType = "";
string sourceLanguageCode = "";
string targetLanguageCode = "";
IEnumerable<string> contents = new string[] { "", };
// Make the request
TranslateTextResponse response = await translationServiceClient.TranslateTextAsync(parent, model, mimeType, sourceLanguageCode, targetLanguageCode, contents);

TranslateTextAsync(TranslateTextRequest, CallSettings)

public virtual Task<TranslateTextResponse> TranslateTextAsync(TranslateTextRequest request, CallSettings callSettings = null)

Translates input text and returns translated text.

Parameters
Name Description
request TranslateTextRequest

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
TaskTranslateTextResponse

A Task containing the RPC response.

Example
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
TranslateTextRequest request = new TranslateTextRequest
{
    Contents = { "", },
    MimeType = "",
    SourceLanguageCode = "",
    TargetLanguageCode = "",
    Model = "",
    GlossaryConfig = new TranslateTextGlossaryConfig(),
    ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
    Labels = { { "", "" }, },
    TransliterationConfig = new TransliterationConfig(),
};
// Make the request
TranslateTextResponse response = await translationServiceClient.TranslateTextAsync(request);

TranslateTextAsync(TranslateTextRequest, CancellationToken)

public virtual Task<TranslateTextResponse> TranslateTextAsync(TranslateTextRequest request, CancellationToken cancellationToken)

Translates input text and returns translated text.

Parameters
Name Description
request TranslateTextRequest

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

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskTranslateTextResponse

A Task containing the RPC response.

Example
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
TranslateTextRequest request = new TranslateTextRequest
{
    Contents = { "", },
    MimeType = "",
    SourceLanguageCode = "",
    TargetLanguageCode = "",
    Model = "",
    GlossaryConfig = new TranslateTextGlossaryConfig(),
    ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
    Labels = { { "", "" }, },
    TransliterationConfig = new TransliterationConfig(),
};
// Make the request
TranslateTextResponse response = await translationServiceClient.TranslateTextAsync(request);

TranslateTextAsync(string, string, IEnumerable<string>, CallSettings)

public virtual Task<TranslateTextResponse> TranslateTextAsync(string parent, string targetLanguageCode, IEnumerable<string> contents, CallSettings callSettings = null)

Translates input text and returns translated text.

Parameters
Name Description
parent string

Required. Project or location to make a call. Must refer to a caller's project.

Format: projects/{project-number-or-id} or projects/{project-number-or-id}/locations/{location-id}.

For global calls, use projects/{project-number-or-id}/locations/global or projects/{project-number-or-id}.

Non-global location is required for requests using AutoML models or custom glossaries.

Models and glossaries must be within the same region (have same location-id), otherwise an INVALID_ARGUMENT (400) error is returned.

targetLanguageCode string

Required. The ISO-639 language code to use for translation of the input text, set to one of the language codes listed in Language Support.

contents IEnumerablestring

Required. The content of the input in string format. We recommend the total content be less than 30,000 codepoints. The max length of this field is 1024. Use BatchTranslateText for larger text.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskTranslateTextResponse

A Task containing the RPC response.

Example
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]";
string targetLanguageCode = "";
IEnumerable<string> contents = new string[] { "", };
// Make the request
TranslateTextResponse response = await translationServiceClient.TranslateTextAsync(parent, targetLanguageCode, contents);

TranslateTextAsync(string, string, IEnumerable<string>, CancellationToken)

public virtual Task<TranslateTextResponse> TranslateTextAsync(string parent, string targetLanguageCode, IEnumerable<string> contents, CancellationToken cancellationToken)

Translates input text and returns translated text.

Parameters
Name Description
parent string

Required. Project or location to make a call. Must refer to a caller's project.

Format: projects/{project-number-or-id} or projects/{project-number-or-id}/locations/{location-id}.

For global calls, use projects/{project-number-or-id}/locations/global or projects/{project-number-or-id}.

Non-global location is required for requests using AutoML models or custom glossaries.

Models and glossaries must be within the same region (have same location-id), otherwise an INVALID_ARGUMENT (400) error is returned.

targetLanguageCode string

Required. The ISO-639 language code to use for translation of the input text, set to one of the language codes listed in Language Support.

contents IEnumerablestring

Required. The content of the input in string format. We recommend the total content be less than 30,000 codepoints. The max length of this field is 1024. Use BatchTranslateText for larger text.

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskTranslateTextResponse

A Task containing the RPC response.

Example
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]";
string targetLanguageCode = "";
IEnumerable<string> contents = new string[] { "", };
// Make the request
TranslateTextResponse response = await translationServiceClient.TranslateTextAsync(parent, targetLanguageCode, contents);

TranslateTextAsync(string, string, string, string, string, IEnumerable<string>, CallSettings)

public virtual Task<TranslateTextResponse> TranslateTextAsync(string parent, string model, string mimeType, string sourceLanguageCode, string targetLanguageCode, IEnumerable<string> contents, CallSettings callSettings = null)

Translates input text and returns translated text.

Parameters
Name Description
parent string

Required. Project or location to make a call. Must refer to a caller's project.

Format: projects/{project-number-or-id} or projects/{project-number-or-id}/locations/{location-id}.

For global calls, use projects/{project-number-or-id}/locations/global or projects/{project-number-or-id}.

Non-global location is required for requests using AutoML models or custom glossaries.

Models and glossaries must be within the same region (have same location-id), otherwise an INVALID_ARGUMENT (400) error is returned.

model string

Optional. The model type requested for this translation.

The format depends on model type:

  • AutoML Translation models: projects/{project-number-or-id}/locations/{location-id}/models/{model-id}

  • General (built-in) models: projects/{project-number-or-id}/locations/{location-id}/models/general/nmt,

  • Translation LLM models: projects/{project-number-or-id}/locations/{location-id}/models/general/translation-llm,

For global (non-regionalized) requests, use location-id global. For example, projects/{project-number-or-id}/locations/global/models/general/nmt.

If not provided, the default Google model (NMT) will be used

mimeType string

Optional. The format of the source text, for example, "text/html", "text/plain". If left blank, the MIME type defaults to "text/html".

sourceLanguageCode string

Optional. The ISO-639 language code of the input text if known, for example, "en-US" or "sr-Latn". Supported language codes are listed in Language Support. If the source language isn't specified, the API attempts to identify the source language automatically and returns the source language within the response.

targetLanguageCode string

Required. The ISO-639 language code to use for translation of the input text, set to one of the language codes listed in Language Support.

contents IEnumerablestring

Required. The content of the input in string format. We recommend the total content be less than 30,000 codepoints. The max length of this field is 1024. Use BatchTranslateText for larger text.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskTranslateTextResponse

A Task containing the RPC response.

Example
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]";
string model = "";
string mimeType = "";
string sourceLanguageCode = "";
string targetLanguageCode = "";
IEnumerable<string> contents = new string[] { "", };
// Make the request
TranslateTextResponse response = await translationServiceClient.TranslateTextAsync(parent, model, mimeType, sourceLanguageCode, targetLanguageCode, contents);

TranslateTextAsync(string, string, string, string, string, IEnumerable<string>, CancellationToken)

public virtual Task<TranslateTextResponse> TranslateTextAsync(string parent, string model, string mimeType, string sourceLanguageCode, string targetLanguageCode, IEnumerable<string> contents, CancellationToken cancellationToken)

Translates input text and returns translated text.

Parameters
Name Description
parent string

Required. Project or location to make a call. Must refer to a caller's project.

Format: projects/{project-number-or-id} or projects/{project-number-or-id}/locations/{location-id}.

For global calls, use projects/{project-number-or-id}/locations/global or projects/{project-number-or-id}.

Non-global location is required for requests using AutoML models or custom glossaries.

Models and glossaries must be within the same region (have same location-id), otherwise an INVALID_ARGUMENT (400) error is returned.

model string

Optional. The model type requested for this translation.

The format depends on model type:

  • AutoML Translation models: projects/{project-number-or-id}/locations/{location-id}/models/{model-id}

  • General (built-in) models: projects/{project-number-or-id}/locations/{location-id}/models/general/nmt,

  • Translation LLM models: projects/{project-number-or-id}/locations/{location-id}/models/general/translation-llm,

For global (non-regionalized) requests, use location-id global. For example, projects/{project-number-or-id}/locations/global/models/general/nmt.

If not provided, the default Google model (NMT) will be used

mimeType string

Optional. The format of the source text, for example, "text/html", "text/plain". If left blank, the MIME type defaults to "text/html".

sourceLanguageCode string

Optional. The ISO-639 language code of the input text if known, for example, "en-US" or "sr-Latn". Supported language codes are listed in Language Support. If the source language isn't specified, the API attempts to identify the source language automatically and returns the source language within the response.

targetLanguageCode string

Required. The ISO-639 language code to use for translation of the input text, set to one of the language codes listed in Language Support.

contents IEnumerablestring

Required. The content of the input in string format. We recommend the total content be less than 30,000 codepoints. The max length of this field is 1024. Use BatchTranslateText for larger text.

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskTranslateTextResponse

A Task containing the RPC response.

Example
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]";
string model = "";
string mimeType = "";
string sourceLanguageCode = "";
string targetLanguageCode = "";
IEnumerable<string> contents = new string[] { "", };
// Make the request
TranslateTextResponse response = await translationServiceClient.TranslateTextAsync(parent, model, mimeType, sourceLanguageCode, targetLanguageCode, contents);

UpdateGlossary(Glossary, FieldMask, CallSettings)

public virtual Operation<Glossary, UpdateGlossaryMetadata> UpdateGlossary(Glossary glossary, FieldMask updateMask, CallSettings callSettings = null)

Updates a glossary. A LRO is used since the update can be async if the glossary's entry file is updated.

Parameters
Name Description
glossary Glossary

Required. The glossary entry to update.

updateMask FieldMask

The list of fields to be updated. Currently only display_name and 'input_config'

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
OperationGlossaryUpdateGlossaryMetadata

The RPC response.

Example
// Create client
TranslationServiceClient translationServiceClient = TranslationServiceClient.Create();
// Initialize request argument(s)
Glossary glossary = new Glossary();
FieldMask updateMask = new FieldMask();
// Make the request
Operation<Glossary, UpdateGlossaryMetadata> response = translationServiceClient.UpdateGlossary(glossary, updateMask);

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

UpdateGlossary(UpdateGlossaryRequest, CallSettings)

public virtual Operation<Glossary, UpdateGlossaryMetadata> UpdateGlossary(UpdateGlossaryRequest request, CallSettings callSettings = null)

Updates a glossary. A LRO is used since the update can be async if the glossary's entry file is updated.

Parameters
Name Description
request UpdateGlossaryRequest

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
OperationGlossaryUpdateGlossaryMetadata

The RPC response.

Example
// Create client
TranslationServiceClient translationServiceClient = TranslationServiceClient.Create();
// Initialize request argument(s)
UpdateGlossaryRequest request = new UpdateGlossaryRequest
{
    Glossary = new Glossary(),
    UpdateMask = new FieldMask(),
};
// Make the request
Operation<Glossary, UpdateGlossaryMetadata> response = translationServiceClient.UpdateGlossary(request);

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

UpdateGlossaryAsync(Glossary, FieldMask, CallSettings)

public virtual Task<Operation<Glossary, UpdateGlossaryMetadata>> UpdateGlossaryAsync(Glossary glossary, FieldMask updateMask, CallSettings callSettings = null)

Updates a glossary. A LRO is used since the update can be async if the glossary's entry file is updated.

Parameters
Name Description
glossary Glossary

Required. The glossary entry to update.

updateMask FieldMask

The list of fields to be updated. Currently only display_name and 'input_config'

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskOperationGlossaryUpdateGlossaryMetadata

A Task containing the RPC response.

Example
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
Glossary glossary = new Glossary();
FieldMask updateMask = new FieldMask();
// Make the request
Operation<Glossary, UpdateGlossaryMetadata> response = await translationServiceClient.UpdateGlossaryAsync(glossary, updateMask);

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

UpdateGlossaryAsync(Glossary, FieldMask, CancellationToken)

public virtual Task<Operation<Glossary, UpdateGlossaryMetadata>> UpdateGlossaryAsync(Glossary glossary, FieldMask updateMask, CancellationToken cancellationToken)

Updates a glossary. A LRO is used since the update can be async if the glossary's entry file is updated.

Parameters
Name Description
glossary Glossary

Required. The glossary entry to update.

updateMask FieldMask

The list of fields to be updated. Currently only display_name and 'input_config'

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskOperationGlossaryUpdateGlossaryMetadata

A Task containing the RPC response.

Example
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
Glossary glossary = new Glossary();
FieldMask updateMask = new FieldMask();
// Make the request
Operation<Glossary, UpdateGlossaryMetadata> response = await translationServiceClient.UpdateGlossaryAsync(glossary, updateMask);

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

UpdateGlossaryAsync(UpdateGlossaryRequest, CallSettings)

public virtual Task<Operation<Glossary, UpdateGlossaryMetadata>> UpdateGlossaryAsync(UpdateGlossaryRequest request, CallSettings callSettings = null)

Updates a glossary. A LRO is used since the update can be async if the glossary's entry file is updated.

Parameters
Name Description
request UpdateGlossaryRequest

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
TaskOperationGlossaryUpdateGlossaryMetadata

A Task containing the RPC response.

Example
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
UpdateGlossaryRequest request = new UpdateGlossaryRequest
{
    Glossary = new Glossary(),
    UpdateMask = new FieldMask(),
};
// Make the request
Operation<Glossary, UpdateGlossaryMetadata> response = await translationServiceClient.UpdateGlossaryAsync(request);

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

UpdateGlossaryAsync(UpdateGlossaryRequest, CancellationToken)

public virtual Task<Operation<Glossary, UpdateGlossaryMetadata>> UpdateGlossaryAsync(UpdateGlossaryRequest request, CancellationToken cancellationToken)

Updates a glossary. A LRO is used since the update can be async if the glossary's entry file is updated.

Parameters
Name Description
request UpdateGlossaryRequest

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

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskOperationGlossaryUpdateGlossaryMetadata

A Task containing the RPC response.

Example
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
UpdateGlossaryRequest request = new UpdateGlossaryRequest
{
    Glossary = new Glossary(),
    UpdateMask = new FieldMask(),
};
// Make the request
Operation<Glossary, UpdateGlossaryMetadata> response = await translationServiceClient.UpdateGlossaryAsync(request);

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

UpdateGlossaryEntry(GlossaryEntry, CallSettings)

public virtual GlossaryEntry UpdateGlossaryEntry(GlossaryEntry glossaryEntry, CallSettings callSettings = null)

Updates a glossary entry.

Parameters
Name Description
glossaryEntry GlossaryEntry

Required. The glossary entry to update.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
GlossaryEntry

The RPC response.

Example
// Create client
TranslationServiceClient translationServiceClient = TranslationServiceClient.Create();
// Initialize request argument(s)
GlossaryEntry glossaryEntry = new GlossaryEntry();
// Make the request
GlossaryEntry response = translationServiceClient.UpdateGlossaryEntry(glossaryEntry);

UpdateGlossaryEntry(UpdateGlossaryEntryRequest, CallSettings)

public virtual GlossaryEntry UpdateGlossaryEntry(UpdateGlossaryEntryRequest request, CallSettings callSettings = null)

Updates a glossary entry.

Parameters
Name Description
request UpdateGlossaryEntryRequest

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
GlossaryEntry

The RPC response.

Example
// Create client
TranslationServiceClient translationServiceClient = TranslationServiceClient.Create();
// Initialize request argument(s)
UpdateGlossaryEntryRequest request = new UpdateGlossaryEntryRequest
{
    GlossaryEntry = new GlossaryEntry(),
};
// Make the request
GlossaryEntry response = translationServiceClient.UpdateGlossaryEntry(request);

UpdateGlossaryEntryAsync(GlossaryEntry, CallSettings)

public virtual Task<GlossaryEntry> UpdateGlossaryEntryAsync(GlossaryEntry glossaryEntry, CallSettings callSettings = null)

Updates a glossary entry.

Parameters
Name Description
glossaryEntry GlossaryEntry

Required. The glossary entry to update.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskGlossaryEntry

A Task containing the RPC response.

Example
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
GlossaryEntry glossaryEntry = new GlossaryEntry();
// Make the request
GlossaryEntry response = await translationServiceClient.UpdateGlossaryEntryAsync(glossaryEntry);

UpdateGlossaryEntryAsync(GlossaryEntry, CancellationToken)

public virtual Task<GlossaryEntry> UpdateGlossaryEntryAsync(GlossaryEntry glossaryEntry, CancellationToken cancellationToken)

Updates a glossary entry.

Parameters
Name Description
glossaryEntry GlossaryEntry

Required. The glossary entry to update.

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskGlossaryEntry

A Task containing the RPC response.

Example
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
GlossaryEntry glossaryEntry = new GlossaryEntry();
// Make the request
GlossaryEntry response = await translationServiceClient.UpdateGlossaryEntryAsync(glossaryEntry);

UpdateGlossaryEntryAsync(UpdateGlossaryEntryRequest, CallSettings)

public virtual Task<GlossaryEntry> UpdateGlossaryEntryAsync(UpdateGlossaryEntryRequest request, CallSettings callSettings = null)

Updates a glossary entry.

Parameters
Name Description
request UpdateGlossaryEntryRequest

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
TaskGlossaryEntry

A Task containing the RPC response.

Example
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
UpdateGlossaryEntryRequest request = new UpdateGlossaryEntryRequest
{
    GlossaryEntry = new GlossaryEntry(),
};
// Make the request
GlossaryEntry response = await translationServiceClient.UpdateGlossaryEntryAsync(request);

UpdateGlossaryEntryAsync(UpdateGlossaryEntryRequest, CancellationToken)

public virtual Task<GlossaryEntry> UpdateGlossaryEntryAsync(UpdateGlossaryEntryRequest request, CancellationToken cancellationToken)

Updates a glossary entry.

Parameters
Name Description
request UpdateGlossaryEntryRequest

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

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskGlossaryEntry

A Task containing the RPC response.

Example
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
UpdateGlossaryEntryRequest request = new UpdateGlossaryEntryRequest
{
    GlossaryEntry = new GlossaryEntry(),
};
// Make the request
GlossaryEntry response = await translationServiceClient.UpdateGlossaryEntryAsync(request);