Google Cloud Translation v3 API - Class TranslationServiceClient (3.5.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
TypeDescription
OperationsClient

BatchTranslateTextOperationsClient

public virtual OperationsClient BatchTranslateTextOperationsClient { get; }

The long-running operations client for BatchTranslateText.

Property Value
TypeDescription
OperationsClient

CreateGlossaryOperationsClient

public virtual OperationsClient CreateGlossaryOperationsClient { get; }

The long-running operations client for CreateGlossary.

Property Value
TypeDescription
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
TypeDescription
string

DefaultScopes

public static IReadOnlyList<string> DefaultScopes { get; }

The default TranslationService scopes.

Property Value
TypeDescription
IReadOnlyListstring
Remarks

DeleteGlossaryOperationsClient

public virtual OperationsClient DeleteGlossaryOperationsClient { get; }

The long-running operations client for DeleteGlossary.

Property Value
TypeDescription
OperationsClient

GrpcClient

public virtual TranslationService.TranslationServiceClient GrpcClient { get; }

The underlying gRPC TranslationService client

Property Value
TypeDescription
TranslationServiceTranslationServiceClient

ServiceMetadata

public static ServiceMetadata ServiceMetadata { get; }

The service metadata associated with this client type.

Property Value
TypeDescription
ServiceMetadata

Methods

AdaptiveMtTranslate(LocationName, IEnumerable<string>, CallSettings)

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

Translate text using Adaptive MT.

Parameters
NameDescription
parentLocationName

Required. Location to make a regional call.

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

contentIEnumerablestring

Required. The content of the input in string format. For now only one sentence per request is supported.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
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
NameDescription
requestAdaptiveMtTranslateRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
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 = { "", },
};
// 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
NameDescription
parentstring

Required. Location to make a regional call.

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

contentIEnumerablestring

Required. The content of the input in string format. For now only one sentence per request is supported.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
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
NameDescription
parentLocationName

Required. Location to make a regional call.

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

contentIEnumerablestring

Required. The content of the input in string format. For now only one sentence per request is supported.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
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
NameDescription
parentLocationName

Required. Location to make a regional call.

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

contentIEnumerablestring

Required. The content of the input in string format. For now only one sentence per request is supported.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
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
NameDescription
requestAdaptiveMtTranslateRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
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 = { "", },
};
// 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
NameDescription
requestAdaptiveMtTranslateRequest

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

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
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 = { "", },
};
// 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
NameDescription
parentstring

Required. Location to make a regional call.

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

contentIEnumerablestring

Required. The content of the input in string format. For now only one sentence per request is supported.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
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
NameDescription
parentstring

Required. Location to make a regional call.

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

contentIEnumerablestring

Required. The content of the input in string format. For now only one sentence per request is supported.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
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
NameDescription
parentLocationName

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.

sourceLanguageCodestring

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.

targetLanguageCodesIEnumerablestring

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

inputConfigsIEnumerableBatchDocumentInputConfig

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.

outputConfigBatchDocumentOutputConfig

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.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
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
NameDescription
requestBatchTranslateDocumentRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
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
NameDescription
parentstring

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.

sourceLanguageCodestring

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.

targetLanguageCodesIEnumerablestring

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

inputConfigsIEnumerableBatchDocumentInputConfig

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.

outputConfigBatchDocumentOutputConfig

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.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
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
NameDescription
parentLocationName

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.

sourceLanguageCodestring

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.

targetLanguageCodesIEnumerablestring

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

inputConfigsIEnumerableBatchDocumentInputConfig

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.

outputConfigBatchDocumentOutputConfig

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.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
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
NameDescription
parentLocationName

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.

sourceLanguageCodestring

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.

targetLanguageCodesIEnumerablestring

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

inputConfigsIEnumerableBatchDocumentInputConfig

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.

outputConfigBatchDocumentOutputConfig

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.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
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
NameDescription
requestBatchTranslateDocumentRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
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
NameDescription
requestBatchTranslateDocumentRequest

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

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
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
NameDescription
parentstring

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.

sourceLanguageCodestring

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.

targetLanguageCodesIEnumerablestring

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

inputConfigsIEnumerableBatchDocumentInputConfig

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.

outputConfigBatchDocumentOutputConfig

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.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
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
NameDescription
parentstring

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.

sourceLanguageCodestring

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.

targetLanguageCodesIEnumerablestring

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

inputConfigsIEnumerableBatchDocumentInputConfig

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.

outputConfigBatchDocumentOutputConfig

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.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
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
NameDescription
requestBatchTranslateTextRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
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
NameDescription
requestBatchTranslateTextRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
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
NameDescription
requestBatchTranslateTextRequest

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

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
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
TypeDescription
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
NameDescription
parentLocationName

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

adaptiveMtDatasetAdaptiveMtDataset

Required. The AdaptiveMtDataset to be created.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
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
NameDescription
requestCreateAdaptiveMtDatasetRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
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
NameDescription
parentstring

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

adaptiveMtDatasetAdaptiveMtDataset

Required. The AdaptiveMtDataset to be created.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
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
NameDescription
parentLocationName

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

adaptiveMtDatasetAdaptiveMtDataset

Required. The AdaptiveMtDataset to be created.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
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
NameDescription
parentLocationName

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

adaptiveMtDatasetAdaptiveMtDataset

Required. The AdaptiveMtDataset to be created.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
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
NameDescription
requestCreateAdaptiveMtDatasetRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
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
NameDescription
requestCreateAdaptiveMtDatasetRequest

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

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
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
NameDescription
parentstring

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

adaptiveMtDatasetAdaptiveMtDataset

Required. The AdaptiveMtDataset to be created.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
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
NameDescription
parentstring

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

adaptiveMtDatasetAdaptiveMtDataset

Required. The AdaptiveMtDataset to be created.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
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
NameDescription
cancellationTokenCancellationToken

The CancellationToken to use while creating the client.

Returns
TypeDescription
TaskTranslationServiceClient

The task representing the created TranslationServiceClient.

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
NameDescription
parentLocationName

Required. The project name.

glossaryGlossary

Required. The glossary to create.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
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
NameDescription
requestCreateGlossaryRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
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
NameDescription
parentstring

Required. The project name.

glossaryGlossary

Required. The glossary to create.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
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
NameDescription
parentLocationName

Required. The project name.

glossaryGlossary

Required. The glossary to create.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
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
NameDescription
parentLocationName

Required. The project name.

glossaryGlossary

Required. The glossary to create.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
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
NameDescription
requestCreateGlossaryRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
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
NameDescription
requestCreateGlossaryRequest

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

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
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
NameDescription
parentstring

Required. The project name.

glossaryGlossary

Required. The glossary to create.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
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
NameDescription
parentstring

Required. The project name.

glossaryGlossary

Required. The glossary to create.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
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;
}

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
NameDescription
nameAdaptiveMtDatasetName

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

callSettingsCallSettings

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
NameDescription
requestDeleteAdaptiveMtDatasetRequest

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

callSettingsCallSettings

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
NameDescription
namestring

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

callSettingsCallSettings

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
NameDescription
nameAdaptiveMtDatasetName

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
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
NameDescription
nameAdaptiveMtDatasetName

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

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
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
NameDescription
requestDeleteAdaptiveMtDatasetRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
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
NameDescription
requestDeleteAdaptiveMtDatasetRequest

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

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
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
NameDescription
namestring

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
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
NameDescription
namestring

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

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
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
NameDescription
nameAdaptiveMtFileName

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

callSettingsCallSettings

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
NameDescription
requestDeleteAdaptiveMtFileRequest

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

callSettingsCallSettings

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
NameDescription
namestring

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

callSettingsCallSettings

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
NameDescription
nameAdaptiveMtFileName

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
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
NameDescription
nameAdaptiveMtFileName

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

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
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
NameDescription
requestDeleteAdaptiveMtFileRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
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
NameDescription
requestDeleteAdaptiveMtFileRequest

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

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
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
NameDescription
namestring

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
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
NameDescription
namestring

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

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
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);

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
NameDescription
requestDeleteGlossaryRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
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
NameDescription
nameGlossaryName

Required. The name of the glossary to delete.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
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
NameDescription
namestring

Required. The name of the glossary to delete.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
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
NameDescription
requestDeleteGlossaryRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
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
NameDescription
requestDeleteGlossaryRequest

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

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
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
NameDescription
nameGlossaryName

Required. The name of the glossary to delete.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
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
NameDescription
nameGlossaryName

Required. The name of the glossary to delete.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
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
NameDescription
namestring

Required. The name of the glossary to delete.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
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
NameDescription
namestring

Required. The name of the glossary to delete.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
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;
}

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
NameDescription
parentLocationName

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.

modelstring

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.

mimeTypestring

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

contentstring

The content of the input stored as a string.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
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
NameDescription
requestDetectLanguageRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
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
NameDescription
parentstring

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.

modelstring

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.

mimeTypestring

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

contentstring

The content of the input stored as a string.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
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
NameDescription
parentLocationName

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.

modelstring

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.

mimeTypestring

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

contentstring

The content of the input stored as a string.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
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
NameDescription
parentLocationName

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.

modelstring

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.

mimeTypestring

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

contentstring

The content of the input stored as a string.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
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
NameDescription
requestDetectLanguageRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
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
NameDescription
requestDetectLanguageRequest

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

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
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
NameDescription
parentstring

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.

modelstring

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.

mimeTypestring

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

contentstring

The content of the input stored as a string.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
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
NameDescription
parentstring

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.

modelstring

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.

mimeTypestring

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

contentstring

The content of the input stored as a string.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
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);

GetAdaptiveMtDataset(AdaptiveMtDatasetName, CallSettings)

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

Gets the Adaptive MT dataset.

Parameters
NameDescription
nameAdaptiveMtDatasetName

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
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
NameDescription
requestGetAdaptiveMtDatasetRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
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
NameDescription
namestring

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
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
NameDescription
nameAdaptiveMtDatasetName

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
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
NameDescription
nameAdaptiveMtDatasetName

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

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
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
NameDescription
requestGetAdaptiveMtDatasetRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
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
NameDescription
requestGetAdaptiveMtDatasetRequest

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

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
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
NameDescription
namestring

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
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
NameDescription
namestring

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

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
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
NameDescription
nameAdaptiveMtFileName

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
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
NameDescription
requestGetAdaptiveMtFileRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
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
NameDescription
namestring

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
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
NameDescription
nameAdaptiveMtFileName

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
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
NameDescription
nameAdaptiveMtFileName

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

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
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
NameDescription
requestGetAdaptiveMtFileRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
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
NameDescription
requestGetAdaptiveMtFileRequest

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

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
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
NameDescription
namestring

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
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
NameDescription
namestring

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

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
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);

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
NameDescription
requestGetGlossaryRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
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
NameDescription
nameGlossaryName

Required. The name of the glossary to retrieve.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
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
NameDescription
namestring

Required. The name of the glossary to retrieve.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
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
NameDescription
requestGetGlossaryRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
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
NameDescription
requestGetGlossaryRequest

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

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
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
NameDescription
nameGlossaryName

Required. The name of the glossary to retrieve.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
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
NameDescription
nameGlossaryName

Required. The name of the glossary to retrieve.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
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
NameDescription
namestring

Required. The name of the glossary to retrieve.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
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
NameDescription
namestring

Required. The name of the glossary to retrieve.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
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);

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
NameDescription
parentLocationName

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.

modelstring

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.

displayLanguageCodestring

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.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
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
NameDescription
requestGetSupportedLanguagesRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
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
NameDescription
parentstring

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.

modelstring

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.

displayLanguageCodestring

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.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
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
NameDescription
parentLocationName

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.

modelstring

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.

displayLanguageCodestring

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.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
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
NameDescription
parentLocationName

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.

modelstring

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.

displayLanguageCodestring

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.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
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
NameDescription
requestGetSupportedLanguagesRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
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
NameDescription
requestGetSupportedLanguagesRequest

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

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
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
NameDescription
parentstring

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.

modelstring

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.

displayLanguageCodestring

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.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
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
NameDescription
parentstring

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.

modelstring

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.

displayLanguageCodestring

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.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
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
NameDescription
parentAdaptiveMtDatasetName

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
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
NameDescription
requestImportAdaptiveMtFileRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
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
NameDescription
parentstring

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
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
NameDescription
parentAdaptiveMtDatasetName

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
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
NameDescription
parentAdaptiveMtDatasetName

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

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
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
NameDescription
requestImportAdaptiveMtFileRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
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
NameDescription
requestImportAdaptiveMtFileRequest

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

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
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
NameDescription
parentstring

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
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
NameDescription
parentstring

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

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
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);

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
NameDescription
parentLocationName

Required. The resource name of the project from which to list the Adaptive MT datasets. projects/{project-number-or-id}/locations/{location-id}

pageTokenstring

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

pageSizeint

The size of page to request. The response will not be larger than this, but may be smaller. A value of null or 0 uses a server-defined page size.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
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
NameDescription
requestListAdaptiveMtDatasetsRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
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
NameDescription
parentstring

Required. The resource name of the project from which to list the Adaptive MT datasets. projects/{project-number-or-id}/locations/{location-id}

pageTokenstring

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

pageSizeint

The size of page to request. The response will not be larger than this, but may be smaller. A value of null or 0 uses a server-defined page size.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
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
NameDescription
parentLocationName

Required. The resource name of the project from which to list the Adaptive MT datasets. projects/{project-number-or-id}/locations/{location-id}

pageTokenstring

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

pageSizeint

The size of page to request. The response will not be larger than this, but may be smaller. A value of null or 0 uses a server-defined page size.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
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
NameDescription
requestListAdaptiveMtDatasetsRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
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
NameDescription
parentstring

Required. The resource name of the project from which to list the Adaptive MT datasets. projects/{project-number-or-id}/locations/{location-id}

pageTokenstring

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

pageSizeint

The size of page to request. The response will not be larger than this, but may be smaller. A value of null or 0 uses a server-defined page size.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
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
NameDescription
parentAdaptiveMtDatasetName

Required. The resource name of the project from which to list the Adaptive MT files. projects/{project}/locations/{location}/adaptiveMtDatasets/{dataset}

pageTokenstring

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

pageSizeint

The size of page to request. The response will not be larger than this, but may be smaller. A value of null or 0 uses a server-defined page size.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
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
NameDescription
requestListAdaptiveMtFilesRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
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
NameDescription
parentstring

Required. The resource name of the project from which to list the Adaptive MT files. projects/{project}/locations/{location}/adaptiveMtDatasets/{dataset}

pageTokenstring

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

pageSizeint

The size of page to request. The response will not be larger than this, but may be smaller. A value of null or 0 uses a server-defined page size.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
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
NameDescription
parentAdaptiveMtDatasetName

Required. The resource name of the project from which to list the Adaptive MT files. projects/{project}/locations/{location}/adaptiveMtDatasets/{dataset}

pageTokenstring

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

pageSizeint

The size of page to request. The response will not be larger than this, but may be smaller. A value of null or 0 uses a server-defined page size.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
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
NameDescription
requestListAdaptiveMtFilesRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
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
NameDescription
parentstring

Required. The resource name of the project from which to list the Adaptive MT files. projects/{project}/locations/{location}/adaptiveMtDatasets/{dataset}

pageTokenstring

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

pageSizeint

The size of page to request. The response will not be larger than this, but may be smaller. A value of null or 0 uses a server-defined page size.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
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
NameDescription
parentAdaptiveMtFileName

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}

pageTokenstring

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

pageSizeint

The size of page to request. The response will not be larger than this, but may be smaller. A value of null or 0 uses a server-defined page size.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
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
NameDescription
requestListAdaptiveMtSentencesRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
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
NameDescription
parentstring

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}

pageTokenstring

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

pageSizeint

The size of page to request. The response will not be larger than this, but may be smaller. A value of null or 0 uses a server-defined page size.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
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
NameDescription
parentAdaptiveMtFileName

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}

pageTokenstring

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

pageSizeint

The size of page to request. The response will not be larger than this, but may be smaller. A value of null or 0 uses a server-defined page size.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
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
NameDescription
requestListAdaptiveMtSentencesRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
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
NameDescription
parentstring

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}

pageTokenstring

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

pageSizeint

The size of page to request. The response will not be larger than this, but may be smaller. A value of null or 0 uses a server-defined page size.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
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;

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
NameDescription
parentLocationName

Required. The name of the project from which to list all of the glossaries.

pageTokenstring

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

pageSizeint

The size of page to request. The response will not be larger than this, but may be smaller. A value of null or 0 uses a server-defined page size.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
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
NameDescription
requestListGlossariesRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
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
NameDescription
parentstring

Required. The name of the project from which to list all of the glossaries.

pageTokenstring

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

pageSizeint

The size of page to request. The response will not be larger than this, but may be smaller. A value of null or 0 uses a server-defined page size.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
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
NameDescription
parentLocationName

Required. The name of the project from which to list all of the glossaries.

pageTokenstring

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

pageSizeint

The size of page to request. The response will not be larger than this, but may be smaller. A value of null or 0 uses a server-defined page size.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
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
NameDescription
requestListGlossariesRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
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
NameDescription
parentstring

Required. The name of the project from which to list all of the glossaries.

pageTokenstring

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

pageSizeint

The size of page to request. The response will not be larger than this, but may be smaller. A value of null or 0 uses a server-defined page size.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
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;

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
NameDescription
operationNamestring

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
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
NameDescription
operationNamestring

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
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
NameDescription
operationNamestring

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
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
NameDescription
operationNamestring

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskOperationBatchTranslateResponseBatchTranslateMetadata

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
NameDescription
operationNamestring

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
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
NameDescription
operationNamestring

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskOperationGlossaryCreateGlossaryMetadata

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
NameDescription
operationNamestring

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
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
NameDescription
operationNamestring

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskOperationDeleteGlossaryResponseDeleteGlossaryMetadata

A task representing the result of polling the operation.

ShutdownDefaultChannelsAsync()

public static Task ShutdownDefaultChannelsAsync()

Shuts down any channels automatically created by Create() and CreateAsync(CancellationToken). Channels which weren't automatically created are not affected.

Returns
TypeDescription
Task

A task representing the asynchronous shutdown operation.

Remarks

After calling this method, further calls to Create() and CreateAsync(CancellationToken) will create new channels, which could in turn be shut down by another call to this method.

TranslateDocument(TranslateDocumentRequest, CallSettings)

public virtual TranslateDocumentResponse TranslateDocument(TranslateDocumentRequest request, CallSettings callSettings = null)

Translates documents in synchronous mode.

Parameters
NameDescription
requestTranslateDocumentRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
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
NameDescription
requestTranslateDocumentRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
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
NameDescription
requestTranslateDocumentRequest

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

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
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
NameDescription
parentLocationName

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.

targetLanguageCodestring

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.

contentsIEnumerablestring

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.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
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
NameDescription
parentLocationName

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.

modelstring

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,

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

mimeTypestring

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

sourceLanguageCodestring

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.

targetLanguageCodestring

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.

contentsIEnumerablestring

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.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
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
NameDescription
requestTranslateTextRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
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 = { { "", "" }, },
};
// 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
NameDescription
parentstring

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.

targetLanguageCodestring

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.

contentsIEnumerablestring

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.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
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
NameDescription
parentstring

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.

modelstring

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,

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

mimeTypestring

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

sourceLanguageCodestring

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.

targetLanguageCodestring

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.

contentsIEnumerablestring

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.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
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
NameDescription
parentLocationName

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.

targetLanguageCodestring

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.

contentsIEnumerablestring

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.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
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
NameDescription
parentLocationName

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.

targetLanguageCodestring

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.

contentsIEnumerablestring

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.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
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
NameDescription
parentLocationName

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.

modelstring

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,

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

mimeTypestring

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

sourceLanguageCodestring

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.

targetLanguageCodestring

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.

contentsIEnumerablestring

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.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
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
NameDescription
parentLocationName

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.

modelstring

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,

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

mimeTypestring

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

sourceLanguageCodestring

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.

targetLanguageCodestring

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.

contentsIEnumerablestring

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.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
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
NameDescription
requestTranslateTextRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
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 = { { "", "" }, },
};
// 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
NameDescription
requestTranslateTextRequest

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

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
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 = { { "", "" }, },
};
// 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
NameDescription
parentstring

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.

targetLanguageCodestring

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.

contentsIEnumerablestring

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.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
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
NameDescription
parentstring

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.

targetLanguageCodestring

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.

contentsIEnumerablestring

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.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
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
NameDescription
parentstring

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.

modelstring

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,

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

mimeTypestring

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

sourceLanguageCodestring

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.

targetLanguageCodestring

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.

contentsIEnumerablestring

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.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
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
NameDescription
parentstring

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.

modelstring

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,

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

mimeTypestring

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

sourceLanguageCodestring

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.

targetLanguageCodestring

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.

contentsIEnumerablestring

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.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
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);