public abstract class TranslationServiceClient
Reference documentation and code samples for the Google Cloud Translation v3 API class TranslationServiceClient.
TranslationService client wrapper, for convenient use.
Derived Types
Namespace
Google.Cloud.Translate.V3Assembly
Google.Cloud.Translate.V3.dll
Remarks
Provides natural language translation operations.
Properties
BatchTranslateDocumentOperationsClient
public virtual OperationsClient BatchTranslateDocumentOperationsClient { get; }
The long-running operations client for BatchTranslateDocument
.
Property Value | |
---|---|
Type | Description |
OperationsClient |
BatchTranslateTextOperationsClient
public virtual OperationsClient BatchTranslateTextOperationsClient { get; }
The long-running operations client for BatchTranslateText
.
Property Value | |
---|---|
Type | Description |
OperationsClient |
CreateGlossaryOperationsClient
public virtual OperationsClient CreateGlossaryOperationsClient { get; }
The long-running operations client for CreateGlossary
.
Property Value | |
---|---|
Type | Description |
OperationsClient |
DefaultEndpoint
public static string DefaultEndpoint { get; }
The default endpoint for the TranslationService service, which is a host of "translate.googleapis.com" and a port of 443.
Property Value | |
---|---|
Type | Description |
string |
DefaultScopes
public static IReadOnlyList<string> DefaultScopes { get; }
The default TranslationService scopes.
Property Value | |
---|---|
Type | Description |
IReadOnlyListstring |
The default TranslationService scopes are:
DeleteGlossaryOperationsClient
public virtual OperationsClient DeleteGlossaryOperationsClient { get; }
The long-running operations client for DeleteGlossary
.
Property Value | |
---|---|
Type | Description |
OperationsClient |
GrpcClient
public virtual TranslationService.TranslationServiceClient GrpcClient { get; }
The underlying gRPC TranslationService client
Property Value | |
---|---|
Type | Description |
TranslationServiceTranslationServiceClient |
ServiceMetadata
public static ServiceMetadata ServiceMetadata { get; }
The service metadata associated with this client type.
Property Value | |
---|---|
Type | Description |
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 | |
---|---|
Name | Description |
parent | LocationName Required. Location to make a regional call. Format: |
content | IEnumerablestring Required. The content of the input in string format. For now only one sentence per request is supported. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
AdaptiveMtTranslateResponse | The RPC response. |
// Create client
TranslationServiceClient translationServiceClient = TranslationServiceClient.Create();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
IEnumerable<string> content = new string[] { "", };
// Make the request
AdaptiveMtTranslateResponse response = translationServiceClient.AdaptiveMtTranslate(parent, content);
AdaptiveMtTranslate(AdaptiveMtTranslateRequest, CallSettings)
public virtual AdaptiveMtTranslateResponse AdaptiveMtTranslate(AdaptiveMtTranslateRequest request, CallSettings callSettings = null)
Translate text using Adaptive MT.
Parameters | |
---|---|
Name | Description |
request | AdaptiveMtTranslateRequest The request object containing all of the parameters for the API call. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
AdaptiveMtTranslateResponse | The RPC response. |
// 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 | |
---|---|
Name | Description |
parent | string Required. Location to make a regional call. Format: |
content | IEnumerablestring Required. The content of the input in string format. For now only one sentence per request is supported. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
AdaptiveMtTranslateResponse | The RPC response. |
// Create client
TranslationServiceClient translationServiceClient = TranslationServiceClient.Create();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]";
IEnumerable<string> content = new string[] { "", };
// Make the request
AdaptiveMtTranslateResponse response = translationServiceClient.AdaptiveMtTranslate(parent, content);
AdaptiveMtTranslateAsync(LocationName, IEnumerable<string>, CallSettings)
public virtual Task<AdaptiveMtTranslateResponse> AdaptiveMtTranslateAsync(LocationName parent, IEnumerable<string> content, CallSettings callSettings = null)
Translate text using Adaptive MT.
Parameters | |
---|---|
Name | Description |
parent | LocationName Required. Location to make a regional call. Format: |
content | IEnumerablestring Required. The content of the input in string format. For now only one sentence per request is supported. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
TaskAdaptiveMtTranslateResponse | A Task containing the RPC response. |
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
IEnumerable<string> content = new string[] { "", };
// Make the request
AdaptiveMtTranslateResponse response = await translationServiceClient.AdaptiveMtTranslateAsync(parent, content);
AdaptiveMtTranslateAsync(LocationName, IEnumerable<string>, CancellationToken)
public virtual Task<AdaptiveMtTranslateResponse> AdaptiveMtTranslateAsync(LocationName parent, IEnumerable<string> content, CancellationToken cancellationToken)
Translate text using Adaptive MT.
Parameters | |
---|---|
Name | Description |
parent | LocationName Required. Location to make a regional call. Format: |
content | IEnumerablestring Required. The content of the input in string format. For now only one sentence per request is supported. |
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
TaskAdaptiveMtTranslateResponse | A Task containing the RPC response. |
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
IEnumerable<string> content = new string[] { "", };
// Make the request
AdaptiveMtTranslateResponse response = await translationServiceClient.AdaptiveMtTranslateAsync(parent, content);
AdaptiveMtTranslateAsync(AdaptiveMtTranslateRequest, CallSettings)
public virtual Task<AdaptiveMtTranslateResponse> AdaptiveMtTranslateAsync(AdaptiveMtTranslateRequest request, CallSettings callSettings = null)
Translate text using Adaptive MT.
Parameters | |
---|---|
Name | Description |
request | AdaptiveMtTranslateRequest The request object containing all of the parameters for the API call. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
TaskAdaptiveMtTranslateResponse | A Task containing the RPC response. |
// 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 | |
---|---|
Name | Description |
request | AdaptiveMtTranslateRequest The request object containing all of the parameters for the API call. |
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
TaskAdaptiveMtTranslateResponse | A Task containing the RPC response. |
// 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 | |
---|---|
Name | Description |
parent | string Required. Location to make a regional call. Format: |
content | IEnumerablestring Required. The content of the input in string format. For now only one sentence per request is supported. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
TaskAdaptiveMtTranslateResponse | A Task containing the RPC response. |
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]";
IEnumerable<string> content = new string[] { "", };
// Make the request
AdaptiveMtTranslateResponse response = await translationServiceClient.AdaptiveMtTranslateAsync(parent, content);
AdaptiveMtTranslateAsync(string, IEnumerable<string>, CancellationToken)
public virtual Task<AdaptiveMtTranslateResponse> AdaptiveMtTranslateAsync(string parent, IEnumerable<string> content, CancellationToken cancellationToken)
Translate text using Adaptive MT.
Parameters | |
---|---|
Name | Description |
parent | string Required. Location to make a regional call. Format: |
content | IEnumerablestring Required. The content of the input in string format. For now only one sentence per request is supported. |
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
TaskAdaptiveMtTranslateResponse | A Task containing the RPC response. |
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]";
IEnumerable<string> content = new string[] { "", };
// Make the request
AdaptiveMtTranslateResponse response = await translationServiceClient.AdaptiveMtTranslateAsync(parent, content);
BatchTranslateDocument(LocationName, string, IEnumerable<string>, IEnumerable<BatchDocumentInputConfig>, BatchDocumentOutputConfig, CallSettings)
public virtual Operation<BatchTranslateDocumentResponse, BatchTranslateDocumentMetadata> BatchTranslateDocument(LocationName parent, string sourceLanguageCode, IEnumerable<string> targetLanguageCodes, IEnumerable<BatchDocumentInputConfig> inputConfigs, BatchDocumentOutputConfig outputConfig, CallSettings callSettings = null)
Translates a large volume of document in asynchronous batch mode. This function provides real-time output as the inputs are being processed. If caller cancels a request, the partial results (for an input file, it's all or nothing) may still be available on the specified output location.
This call returns immediately and you can use google.longrunning.Operation.name to poll the status of the call.
Parameters | |
---|---|
Name | Description |
parent | LocationName Required. Location to make a regional call. Format: The Only AutoML Translation models or glossaries within the same region (have the same location-id) can be used, otherwise an INVALID_ARGUMENT (400) error is returned. |
sourceLanguageCode | string Required. The ISO-639 language code of the input document if known, for example, "en-US" or "sr-Latn". Supported language codes are listed in Language Support. |
targetLanguageCodes | IEnumerablestring Required. The ISO-639 language code to use for translation of the input document. Specify up to 10 language codes here. |
inputConfigs | IEnumerableBatchDocumentInputConfig Required. Input configurations. The total number of files matched should be <= 100. The total content size to translate should be <= 100M Unicode codepoints. The files must use UTF-8 encoding. |
outputConfig | BatchDocumentOutputConfig Required. Output configuration. If 2 input configs match to the same file (that is, same input path), we don't generate output for duplicate inputs. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
OperationBatchTranslateDocumentResponseBatchTranslateDocumentMetadata | The RPC response. |
// Create client
TranslationServiceClient translationServiceClient = TranslationServiceClient.Create();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
string sourceLanguageCode = "";
IEnumerable<string> targetLanguageCodes = new string[] { "", };
IEnumerable<BatchDocumentInputConfig> inputConfigs = new BatchDocumentInputConfig[]
{
new BatchDocumentInputConfig(),
};
BatchDocumentOutputConfig outputConfig = new BatchDocumentOutputConfig();
// Make the request
Operation<BatchTranslateDocumentResponse, BatchTranslateDocumentMetadata> response = translationServiceClient.BatchTranslateDocument(parent, sourceLanguageCode, targetLanguageCodes, inputConfigs, outputConfig);
// Poll until the returned long-running operation is complete
Operation<BatchTranslateDocumentResponse, BatchTranslateDocumentMetadata> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
BatchTranslateDocumentResponse result = completedResponse.Result;
// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<BatchTranslateDocumentResponse, BatchTranslateDocumentMetadata> retrievedResponse = translationServiceClient.PollOnceBatchTranslateDocument(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
BatchTranslateDocumentResponse retrievedResult = retrievedResponse.Result;
}
BatchTranslateDocument(BatchTranslateDocumentRequest, CallSettings)
public virtual Operation<BatchTranslateDocumentResponse, BatchTranslateDocumentMetadata> BatchTranslateDocument(BatchTranslateDocumentRequest request, CallSettings callSettings = null)
Translates a large volume of document in asynchronous batch mode. This function provides real-time output as the inputs are being processed. If caller cancels a request, the partial results (for an input file, it's all or nothing) may still be available on the specified output location.
This call returns immediately and you can use google.longrunning.Operation.name to poll the status of the call.
Parameters | |
---|---|
Name | Description |
request | BatchTranslateDocumentRequest The request object containing all of the parameters for the API call. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
OperationBatchTranslateDocumentResponseBatchTranslateDocumentMetadata | The RPC response. |
// Create client
TranslationServiceClient translationServiceClient = TranslationServiceClient.Create();
// Initialize request argument(s)
BatchTranslateDocumentRequest request = new BatchTranslateDocumentRequest
{
ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
SourceLanguageCode = "",
TargetLanguageCodes = { "", },
InputConfigs =
{
new BatchDocumentInputConfig(),
},
OutputConfig = new BatchDocumentOutputConfig(),
Models = { { "", "" }, },
Glossaries =
{
{
"",
new TranslateTextGlossaryConfig()
},
},
FormatConversions = { { "", "" }, },
CustomizedAttribution = "",
EnableShadowRemovalNativePdf = false,
EnableRotationCorrection = false,
};
// Make the request
Operation<BatchTranslateDocumentResponse, BatchTranslateDocumentMetadata> response = translationServiceClient.BatchTranslateDocument(request);
// Poll until the returned long-running operation is complete
Operation<BatchTranslateDocumentResponse, BatchTranslateDocumentMetadata> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
BatchTranslateDocumentResponse result = completedResponse.Result;
// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<BatchTranslateDocumentResponse, BatchTranslateDocumentMetadata> retrievedResponse = translationServiceClient.PollOnceBatchTranslateDocument(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
BatchTranslateDocumentResponse retrievedResult = retrievedResponse.Result;
}
BatchTranslateDocument(string, string, IEnumerable<string>, IEnumerable<BatchDocumentInputConfig>, BatchDocumentOutputConfig, CallSettings)
public virtual Operation<BatchTranslateDocumentResponse, BatchTranslateDocumentMetadata> BatchTranslateDocument(string parent, string sourceLanguageCode, IEnumerable<string> targetLanguageCodes, IEnumerable<BatchDocumentInputConfig> inputConfigs, BatchDocumentOutputConfig outputConfig, CallSettings callSettings = null)
Translates a large volume of document in asynchronous batch mode. This function provides real-time output as the inputs are being processed. If caller cancels a request, the partial results (for an input file, it's all or nothing) may still be available on the specified output location.
This call returns immediately and you can use google.longrunning.Operation.name to poll the status of the call.
Parameters | |
---|---|
Name | Description |
parent | string Required. Location to make a regional call. Format: The Only AutoML Translation models or glossaries within the same region (have the same location-id) can be used, otherwise an INVALID_ARGUMENT (400) error is returned. |
sourceLanguageCode | string Required. The ISO-639 language code of the input document if known, for example, "en-US" or "sr-Latn". Supported language codes are listed in Language Support. |
targetLanguageCodes | IEnumerablestring Required. The ISO-639 language code to use for translation of the input document. Specify up to 10 language codes here. |
inputConfigs | IEnumerableBatchDocumentInputConfig Required. Input configurations. The total number of files matched should be <= 100. The total content size to translate should be <= 100M Unicode codepoints. The files must use UTF-8 encoding. |
outputConfig | BatchDocumentOutputConfig Required. Output configuration. If 2 input configs match to the same file (that is, same input path), we don't generate output for duplicate inputs. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
OperationBatchTranslateDocumentResponseBatchTranslateDocumentMetadata | The RPC response. |
// Create client
TranslationServiceClient translationServiceClient = TranslationServiceClient.Create();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]";
string sourceLanguageCode = "";
IEnumerable<string> targetLanguageCodes = new string[] { "", };
IEnumerable<BatchDocumentInputConfig> inputConfigs = new BatchDocumentInputConfig[]
{
new BatchDocumentInputConfig(),
};
BatchDocumentOutputConfig outputConfig = new BatchDocumentOutputConfig();
// Make the request
Operation<BatchTranslateDocumentResponse, BatchTranslateDocumentMetadata> response = translationServiceClient.BatchTranslateDocument(parent, sourceLanguageCode, targetLanguageCodes, inputConfigs, outputConfig);
// Poll until the returned long-running operation is complete
Operation<BatchTranslateDocumentResponse, BatchTranslateDocumentMetadata> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
BatchTranslateDocumentResponse result = completedResponse.Result;
// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<BatchTranslateDocumentResponse, BatchTranslateDocumentMetadata> retrievedResponse = translationServiceClient.PollOnceBatchTranslateDocument(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
BatchTranslateDocumentResponse retrievedResult = retrievedResponse.Result;
}
BatchTranslateDocumentAsync(LocationName, string, IEnumerable<string>, IEnumerable<BatchDocumentInputConfig>, BatchDocumentOutputConfig, CallSettings)
public virtual Task<Operation<BatchTranslateDocumentResponse, BatchTranslateDocumentMetadata>> BatchTranslateDocumentAsync(LocationName parent, string sourceLanguageCode, IEnumerable<string> targetLanguageCodes, IEnumerable<BatchDocumentInputConfig> inputConfigs, BatchDocumentOutputConfig outputConfig, CallSettings callSettings = null)
Translates a large volume of document in asynchronous batch mode. This function provides real-time output as the inputs are being processed. If caller cancels a request, the partial results (for an input file, it's all or nothing) may still be available on the specified output location.
This call returns immediately and you can use google.longrunning.Operation.name to poll the status of the call.
Parameters | |
---|---|
Name | Description |
parent | LocationName Required. Location to make a regional call. Format: The Only AutoML Translation models or glossaries within the same region (have the same location-id) can be used, otherwise an INVALID_ARGUMENT (400) error is returned. |
sourceLanguageCode | string Required. The ISO-639 language code of the input document if known, for example, "en-US" or "sr-Latn". Supported language codes are listed in Language Support. |
targetLanguageCodes | IEnumerablestring Required. The ISO-639 language code to use for translation of the input document. Specify up to 10 language codes here. |
inputConfigs | IEnumerableBatchDocumentInputConfig Required. Input configurations. The total number of files matched should be <= 100. The total content size to translate should be <= 100M Unicode codepoints. The files must use UTF-8 encoding. |
outputConfig | BatchDocumentOutputConfig Required. Output configuration. If 2 input configs match to the same file (that is, same input path), we don't generate output for duplicate inputs. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
TaskOperationBatchTranslateDocumentResponseBatchTranslateDocumentMetadata | A Task containing the RPC response. |
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
string sourceLanguageCode = "";
IEnumerable<string> targetLanguageCodes = new string[] { "", };
IEnumerable<BatchDocumentInputConfig> inputConfigs = new BatchDocumentInputConfig[]
{
new BatchDocumentInputConfig(),
};
BatchDocumentOutputConfig outputConfig = new BatchDocumentOutputConfig();
// Make the request
Operation<BatchTranslateDocumentResponse, BatchTranslateDocumentMetadata> response = await translationServiceClient.BatchTranslateDocumentAsync(parent, sourceLanguageCode, targetLanguageCodes, inputConfigs, outputConfig);
// Poll until the returned long-running operation is complete
Operation<BatchTranslateDocumentResponse, BatchTranslateDocumentMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
BatchTranslateDocumentResponse result = completedResponse.Result;
// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<BatchTranslateDocumentResponse, BatchTranslateDocumentMetadata> retrievedResponse = await translationServiceClient.PollOnceBatchTranslateDocumentAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
BatchTranslateDocumentResponse retrievedResult = retrievedResponse.Result;
}
BatchTranslateDocumentAsync(LocationName, string, IEnumerable<string>, IEnumerable<BatchDocumentInputConfig>, BatchDocumentOutputConfig, CancellationToken)
public virtual Task<Operation<BatchTranslateDocumentResponse, BatchTranslateDocumentMetadata>> BatchTranslateDocumentAsync(LocationName parent, string sourceLanguageCode, IEnumerable<string> targetLanguageCodes, IEnumerable<BatchDocumentInputConfig> inputConfigs, BatchDocumentOutputConfig outputConfig, CancellationToken cancellationToken)
Translates a large volume of document in asynchronous batch mode. This function provides real-time output as the inputs are being processed. If caller cancels a request, the partial results (for an input file, it's all or nothing) may still be available on the specified output location.
This call returns immediately and you can use google.longrunning.Operation.name to poll the status of the call.
Parameters | |
---|---|
Name | Description |
parent | LocationName Required. Location to make a regional call. Format: The Only AutoML Translation models or glossaries within the same region (have the same location-id) can be used, otherwise an INVALID_ARGUMENT (400) error is returned. |
sourceLanguageCode | string Required. The ISO-639 language code of the input document if known, for example, "en-US" or "sr-Latn". Supported language codes are listed in Language Support. |
targetLanguageCodes | IEnumerablestring Required. The ISO-639 language code to use for translation of the input document. Specify up to 10 language codes here. |
inputConfigs | IEnumerableBatchDocumentInputConfig Required. Input configurations. The total number of files matched should be <= 100. The total content size to translate should be <= 100M Unicode codepoints. The files must use UTF-8 encoding. |
outputConfig | BatchDocumentOutputConfig Required. Output configuration. If 2 input configs match to the same file (that is, same input path), we don't generate output for duplicate inputs. |
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
TaskOperationBatchTranslateDocumentResponseBatchTranslateDocumentMetadata | A Task containing the RPC response. |
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
string sourceLanguageCode = "";
IEnumerable<string> targetLanguageCodes = new string[] { "", };
IEnumerable<BatchDocumentInputConfig> inputConfigs = new BatchDocumentInputConfig[]
{
new BatchDocumentInputConfig(),
};
BatchDocumentOutputConfig outputConfig = new BatchDocumentOutputConfig();
// Make the request
Operation<BatchTranslateDocumentResponse, BatchTranslateDocumentMetadata> response = await translationServiceClient.BatchTranslateDocumentAsync(parent, sourceLanguageCode, targetLanguageCodes, inputConfigs, outputConfig);
// Poll until the returned long-running operation is complete
Operation<BatchTranslateDocumentResponse, BatchTranslateDocumentMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
BatchTranslateDocumentResponse result = completedResponse.Result;
// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<BatchTranslateDocumentResponse, BatchTranslateDocumentMetadata> retrievedResponse = await translationServiceClient.PollOnceBatchTranslateDocumentAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
BatchTranslateDocumentResponse retrievedResult = retrievedResponse.Result;
}
BatchTranslateDocumentAsync(BatchTranslateDocumentRequest, CallSettings)
public virtual Task<Operation<BatchTranslateDocumentResponse, BatchTranslateDocumentMetadata>> BatchTranslateDocumentAsync(BatchTranslateDocumentRequest request, CallSettings callSettings = null)
Translates a large volume of document in asynchronous batch mode. This function provides real-time output as the inputs are being processed. If caller cancels a request, the partial results (for an input file, it's all or nothing) may still be available on the specified output location.
This call returns immediately and you can use google.longrunning.Operation.name to poll the status of the call.
Parameters | |
---|---|
Name | Description |
request | BatchTranslateDocumentRequest The request object containing all of the parameters for the API call. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
TaskOperationBatchTranslateDocumentResponseBatchTranslateDocumentMetadata | A Task containing the RPC response. |
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
BatchTranslateDocumentRequest request = new BatchTranslateDocumentRequest
{
ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
SourceLanguageCode = "",
TargetLanguageCodes = { "", },
InputConfigs =
{
new BatchDocumentInputConfig(),
},
OutputConfig = new BatchDocumentOutputConfig(),
Models = { { "", "" }, },
Glossaries =
{
{
"",
new TranslateTextGlossaryConfig()
},
},
FormatConversions = { { "", "" }, },
CustomizedAttribution = "",
EnableShadowRemovalNativePdf = false,
EnableRotationCorrection = false,
};
// Make the request
Operation<BatchTranslateDocumentResponse, BatchTranslateDocumentMetadata> response = await translationServiceClient.BatchTranslateDocumentAsync(request);
// Poll until the returned long-running operation is complete
Operation<BatchTranslateDocumentResponse, BatchTranslateDocumentMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
BatchTranslateDocumentResponse result = completedResponse.Result;
// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<BatchTranslateDocumentResponse, BatchTranslateDocumentMetadata> retrievedResponse = await translationServiceClient.PollOnceBatchTranslateDocumentAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
BatchTranslateDocumentResponse retrievedResult = retrievedResponse.Result;
}
BatchTranslateDocumentAsync(BatchTranslateDocumentRequest, CancellationToken)
public virtual Task<Operation<BatchTranslateDocumentResponse, BatchTranslateDocumentMetadata>> BatchTranslateDocumentAsync(BatchTranslateDocumentRequest request, CancellationToken cancellationToken)
Translates a large volume of document in asynchronous batch mode. This function provides real-time output as the inputs are being processed. If caller cancels a request, the partial results (for an input file, it's all or nothing) may still be available on the specified output location.
This call returns immediately and you can use google.longrunning.Operation.name to poll the status of the call.
Parameters | |
---|---|
Name | Description |
request | BatchTranslateDocumentRequest The request object containing all of the parameters for the API call. |
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
TaskOperationBatchTranslateDocumentResponseBatchTranslateDocumentMetadata | A Task containing the RPC response. |
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
BatchTranslateDocumentRequest request = new BatchTranslateDocumentRequest
{
ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
SourceLanguageCode = "",
TargetLanguageCodes = { "", },
InputConfigs =
{
new BatchDocumentInputConfig(),
},
OutputConfig = new BatchDocumentOutputConfig(),
Models = { { "", "" }, },
Glossaries =
{
{
"",
new TranslateTextGlossaryConfig()
},
},
FormatConversions = { { "", "" }, },
CustomizedAttribution = "",
EnableShadowRemovalNativePdf = false,
EnableRotationCorrection = false,
};
// Make the request
Operation<BatchTranslateDocumentResponse, BatchTranslateDocumentMetadata> response = await translationServiceClient.BatchTranslateDocumentAsync(request);
// Poll until the returned long-running operation is complete
Operation<BatchTranslateDocumentResponse, BatchTranslateDocumentMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
BatchTranslateDocumentResponse result = completedResponse.Result;
// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<BatchTranslateDocumentResponse, BatchTranslateDocumentMetadata> retrievedResponse = await translationServiceClient.PollOnceBatchTranslateDocumentAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
BatchTranslateDocumentResponse retrievedResult = retrievedResponse.Result;
}
BatchTranslateDocumentAsync(string, string, IEnumerable<string>, IEnumerable<BatchDocumentInputConfig>, BatchDocumentOutputConfig, CallSettings)
public virtual Task<Operation<BatchTranslateDocumentResponse, BatchTranslateDocumentMetadata>> BatchTranslateDocumentAsync(string parent, string sourceLanguageCode, IEnumerable<string> targetLanguageCodes, IEnumerable<BatchDocumentInputConfig> inputConfigs, BatchDocumentOutputConfig outputConfig, CallSettings callSettings = null)
Translates a large volume of document in asynchronous batch mode. This function provides real-time output as the inputs are being processed. If caller cancels a request, the partial results (for an input file, it's all or nothing) may still be available on the specified output location.
This call returns immediately and you can use google.longrunning.Operation.name to poll the status of the call.
Parameters | |
---|---|
Name | Description |
parent | string Required. Location to make a regional call. Format: The Only AutoML Translation models or glossaries within the same region (have the same location-id) can be used, otherwise an INVALID_ARGUMENT (400) error is returned. |
sourceLanguageCode | string Required. The ISO-639 language code of the input document if known, for example, "en-US" or "sr-Latn". Supported language codes are listed in Language Support. |
targetLanguageCodes | IEnumerablestring Required. The ISO-639 language code to use for translation of the input document. Specify up to 10 language codes here. |
inputConfigs | IEnumerableBatchDocumentInputConfig Required. Input configurations. The total number of files matched should be <= 100. The total content size to translate should be <= 100M Unicode codepoints. The files must use UTF-8 encoding. |
outputConfig | BatchDocumentOutputConfig Required. Output configuration. If 2 input configs match to the same file (that is, same input path), we don't generate output for duplicate inputs. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
TaskOperationBatchTranslateDocumentResponseBatchTranslateDocumentMetadata | A Task containing the RPC response. |
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]";
string sourceLanguageCode = "";
IEnumerable<string> targetLanguageCodes = new string[] { "", };
IEnumerable<BatchDocumentInputConfig> inputConfigs = new BatchDocumentInputConfig[]
{
new BatchDocumentInputConfig(),
};
BatchDocumentOutputConfig outputConfig = new BatchDocumentOutputConfig();
// Make the request
Operation<BatchTranslateDocumentResponse, BatchTranslateDocumentMetadata> response = await translationServiceClient.BatchTranslateDocumentAsync(parent, sourceLanguageCode, targetLanguageCodes, inputConfigs, outputConfig);
// Poll until the returned long-running operation is complete
Operation<BatchTranslateDocumentResponse, BatchTranslateDocumentMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
BatchTranslateDocumentResponse result = completedResponse.Result;
// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<BatchTranslateDocumentResponse, BatchTranslateDocumentMetadata> retrievedResponse = await translationServiceClient.PollOnceBatchTranslateDocumentAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
BatchTranslateDocumentResponse retrievedResult = retrievedResponse.Result;
}
BatchTranslateDocumentAsync(string, string, IEnumerable<string>, IEnumerable<BatchDocumentInputConfig>, BatchDocumentOutputConfig, CancellationToken)
public virtual Task<Operation<BatchTranslateDocumentResponse, BatchTranslateDocumentMetadata>> BatchTranslateDocumentAsync(string parent, string sourceLanguageCode, IEnumerable<string> targetLanguageCodes, IEnumerable<BatchDocumentInputConfig> inputConfigs, BatchDocumentOutputConfig outputConfig, CancellationToken cancellationToken)
Translates a large volume of document in asynchronous batch mode. This function provides real-time output as the inputs are being processed. If caller cancels a request, the partial results (for an input file, it's all or nothing) may still be available on the specified output location.
This call returns immediately and you can use google.longrunning.Operation.name to poll the status of the call.
Parameters | |
---|---|
Name | Description |
parent | string Required. Location to make a regional call. Format: The Only AutoML Translation models or glossaries within the same region (have the same location-id) can be used, otherwise an INVALID_ARGUMENT (400) error is returned. |
sourceLanguageCode | string Required. The ISO-639 language code of the input document if known, for example, "en-US" or "sr-Latn". Supported language codes are listed in Language Support. |
targetLanguageCodes | IEnumerablestring Required. The ISO-639 language code to use for translation of the input document. Specify up to 10 language codes here. |
inputConfigs | IEnumerableBatchDocumentInputConfig Required. Input configurations. The total number of files matched should be <= 100. The total content size to translate should be <= 100M Unicode codepoints. The files must use UTF-8 encoding. |
outputConfig | BatchDocumentOutputConfig Required. Output configuration. If 2 input configs match to the same file (that is, same input path), we don't generate output for duplicate inputs. |
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
TaskOperationBatchTranslateDocumentResponseBatchTranslateDocumentMetadata | A Task containing the RPC response. |
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]";
string sourceLanguageCode = "";
IEnumerable<string> targetLanguageCodes = new string[] { "", };
IEnumerable<BatchDocumentInputConfig> inputConfigs = new BatchDocumentInputConfig[]
{
new BatchDocumentInputConfig(),
};
BatchDocumentOutputConfig outputConfig = new BatchDocumentOutputConfig();
// Make the request
Operation<BatchTranslateDocumentResponse, BatchTranslateDocumentMetadata> response = await translationServiceClient.BatchTranslateDocumentAsync(parent, sourceLanguageCode, targetLanguageCodes, inputConfigs, outputConfig);
// Poll until the returned long-running operation is complete
Operation<BatchTranslateDocumentResponse, BatchTranslateDocumentMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
BatchTranslateDocumentResponse result = completedResponse.Result;
// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<BatchTranslateDocumentResponse, BatchTranslateDocumentMetadata> retrievedResponse = await translationServiceClient.PollOnceBatchTranslateDocumentAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
BatchTranslateDocumentResponse retrievedResult = retrievedResponse.Result;
}
BatchTranslateText(BatchTranslateTextRequest, CallSettings)
public virtual Operation<BatchTranslateResponse, BatchTranslateMetadata> BatchTranslateText(BatchTranslateTextRequest request, CallSettings callSettings = null)
Translates a large volume of text in asynchronous batch mode. This function provides real-time output as the inputs are being processed. If caller cancels a request, the partial results (for an input file, it's all or nothing) may still be available on the specified output location.
This call returns immediately and you can use google.longrunning.Operation.name to poll the status of the call.
Parameters | |
---|---|
Name | Description |
request | BatchTranslateTextRequest The request object containing all of the parameters for the API call. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
OperationBatchTranslateResponseBatchTranslateMetadata | The RPC response. |
// Create client
TranslationServiceClient translationServiceClient = TranslationServiceClient.Create();
// Initialize request argument(s)
BatchTranslateTextRequest request = new BatchTranslateTextRequest
{
ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
SourceLanguageCode = "",
TargetLanguageCodes = { "", },
Models = { { "", "" }, },
InputConfigs = { new InputConfig(), },
OutputConfig = new OutputConfig(),
Glossaries =
{
{
"",
new TranslateTextGlossaryConfig()
},
},
Labels = { { "", "" }, },
};
// Make the request
Operation<BatchTranslateResponse, BatchTranslateMetadata> response = translationServiceClient.BatchTranslateText(request);
// Poll until the returned long-running operation is complete
Operation<BatchTranslateResponse, BatchTranslateMetadata> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
BatchTranslateResponse result = completedResponse.Result;
// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<BatchTranslateResponse, BatchTranslateMetadata> retrievedResponse = translationServiceClient.PollOnceBatchTranslateText(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
BatchTranslateResponse retrievedResult = retrievedResponse.Result;
}
BatchTranslateTextAsync(BatchTranslateTextRequest, CallSettings)
public virtual Task<Operation<BatchTranslateResponse, BatchTranslateMetadata>> BatchTranslateTextAsync(BatchTranslateTextRequest request, CallSettings callSettings = null)
Translates a large volume of text in asynchronous batch mode. This function provides real-time output as the inputs are being processed. If caller cancels a request, the partial results (for an input file, it's all or nothing) may still be available on the specified output location.
This call returns immediately and you can use google.longrunning.Operation.name to poll the status of the call.
Parameters | |
---|---|
Name | Description |
request | BatchTranslateTextRequest The request object containing all of the parameters for the API call. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
TaskOperationBatchTranslateResponseBatchTranslateMetadata | A Task containing the RPC response. |
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
BatchTranslateTextRequest request = new BatchTranslateTextRequest
{
ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
SourceLanguageCode = "",
TargetLanguageCodes = { "", },
Models = { { "", "" }, },
InputConfigs = { new InputConfig(), },
OutputConfig = new OutputConfig(),
Glossaries =
{
{
"",
new TranslateTextGlossaryConfig()
},
},
Labels = { { "", "" }, },
};
// Make the request
Operation<BatchTranslateResponse, BatchTranslateMetadata> response = await translationServiceClient.BatchTranslateTextAsync(request);
// Poll until the returned long-running operation is complete
Operation<BatchTranslateResponse, BatchTranslateMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
BatchTranslateResponse result = completedResponse.Result;
// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<BatchTranslateResponse, BatchTranslateMetadata> retrievedResponse = await translationServiceClient.PollOnceBatchTranslateTextAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
BatchTranslateResponse retrievedResult = retrievedResponse.Result;
}
BatchTranslateTextAsync(BatchTranslateTextRequest, CancellationToken)
public virtual Task<Operation<BatchTranslateResponse, BatchTranslateMetadata>> BatchTranslateTextAsync(BatchTranslateTextRequest request, CancellationToken cancellationToken)
Translates a large volume of text in asynchronous batch mode. This function provides real-time output as the inputs are being processed. If caller cancels a request, the partial results (for an input file, it's all or nothing) may still be available on the specified output location.
This call returns immediately and you can use google.longrunning.Operation.name to poll the status of the call.
Parameters | |
---|---|
Name | Description |
request | BatchTranslateTextRequest The request object containing all of the parameters for the API call. |
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
TaskOperationBatchTranslateResponseBatchTranslateMetadata | A Task containing the RPC response. |
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
BatchTranslateTextRequest request = new BatchTranslateTextRequest
{
ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
SourceLanguageCode = "",
TargetLanguageCodes = { "", },
Models = { { "", "" }, },
InputConfigs = { new InputConfig(), },
OutputConfig = new OutputConfig(),
Glossaries =
{
{
"",
new TranslateTextGlossaryConfig()
},
},
Labels = { { "", "" }, },
};
// Make the request
Operation<BatchTranslateResponse, BatchTranslateMetadata> response = await translationServiceClient.BatchTranslateTextAsync(request);
// Poll until the returned long-running operation is complete
Operation<BatchTranslateResponse, BatchTranslateMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
BatchTranslateResponse result = completedResponse.Result;
// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<BatchTranslateResponse, BatchTranslateMetadata> retrievedResponse = await translationServiceClient.PollOnceBatchTranslateTextAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
BatchTranslateResponse retrievedResult = retrievedResponse.Result;
}
Create()
public static TranslationServiceClient Create()
Synchronously creates a TranslationServiceClient using the default credentials, endpoint and settings. To specify custom credentials or other settings, use TranslationServiceClientBuilder .
Returns | |
---|---|
Type | Description |
TranslationServiceClient | The created TranslationServiceClient. |
CreateAdaptiveMtDataset(LocationName, AdaptiveMtDataset, CallSettings)
public virtual AdaptiveMtDataset CreateAdaptiveMtDataset(LocationName parent, AdaptiveMtDataset adaptiveMtDataset, CallSettings callSettings = null)
Creates an Adaptive MT dataset.
Parameters | |
---|---|
Name | Description |
parent | LocationName Required. Name of the parent project. In form of
|
adaptiveMtDataset | AdaptiveMtDataset Required. The AdaptiveMtDataset to be created. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
AdaptiveMtDataset | The RPC response. |
// Create client
TranslationServiceClient translationServiceClient = TranslationServiceClient.Create();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
AdaptiveMtDataset adaptiveMtDataset = new AdaptiveMtDataset();
// Make the request
AdaptiveMtDataset response = translationServiceClient.CreateAdaptiveMtDataset(parent, adaptiveMtDataset);
CreateAdaptiveMtDataset(CreateAdaptiveMtDatasetRequest, CallSettings)
public virtual AdaptiveMtDataset CreateAdaptiveMtDataset(CreateAdaptiveMtDatasetRequest request, CallSettings callSettings = null)
Creates an Adaptive MT dataset.
Parameters | |
---|---|
Name | Description |
request | CreateAdaptiveMtDatasetRequest The request object containing all of the parameters for the API call. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
AdaptiveMtDataset | The RPC response. |
// Create client
TranslationServiceClient translationServiceClient = TranslationServiceClient.Create();
// Initialize request argument(s)
CreateAdaptiveMtDatasetRequest request = new CreateAdaptiveMtDatasetRequest
{
ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
AdaptiveMtDataset = new AdaptiveMtDataset(),
};
// Make the request
AdaptiveMtDataset response = translationServiceClient.CreateAdaptiveMtDataset(request);
CreateAdaptiveMtDataset(string, AdaptiveMtDataset, CallSettings)
public virtual AdaptiveMtDataset CreateAdaptiveMtDataset(string parent, AdaptiveMtDataset adaptiveMtDataset, CallSettings callSettings = null)
Creates an Adaptive MT dataset.
Parameters | |
---|---|
Name | Description |
parent | string Required. Name of the parent project. In form of
|
adaptiveMtDataset | AdaptiveMtDataset Required. The AdaptiveMtDataset to be created. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
AdaptiveMtDataset | The RPC response. |
// Create client
TranslationServiceClient translationServiceClient = TranslationServiceClient.Create();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]";
AdaptiveMtDataset adaptiveMtDataset = new AdaptiveMtDataset();
// Make the request
AdaptiveMtDataset response = translationServiceClient.CreateAdaptiveMtDataset(parent, adaptiveMtDataset);
CreateAdaptiveMtDatasetAsync(LocationName, AdaptiveMtDataset, CallSettings)
public virtual Task<AdaptiveMtDataset> CreateAdaptiveMtDatasetAsync(LocationName parent, AdaptiveMtDataset adaptiveMtDataset, CallSettings callSettings = null)
Creates an Adaptive MT dataset.
Parameters | |
---|---|
Name | Description |
parent | LocationName Required. Name of the parent project. In form of
|
adaptiveMtDataset | AdaptiveMtDataset Required. The AdaptiveMtDataset to be created. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
TaskAdaptiveMtDataset | A Task containing the RPC response. |
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
AdaptiveMtDataset adaptiveMtDataset = new AdaptiveMtDataset();
// Make the request
AdaptiveMtDataset response = await translationServiceClient.CreateAdaptiveMtDatasetAsync(parent, adaptiveMtDataset);
CreateAdaptiveMtDatasetAsync(LocationName, AdaptiveMtDataset, CancellationToken)
public virtual Task<AdaptiveMtDataset> CreateAdaptiveMtDatasetAsync(LocationName parent, AdaptiveMtDataset adaptiveMtDataset, CancellationToken cancellationToken)
Creates an Adaptive MT dataset.
Parameters | |
---|---|
Name | Description |
parent | LocationName Required. Name of the parent project. In form of
|
adaptiveMtDataset | AdaptiveMtDataset Required. The AdaptiveMtDataset to be created. |
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
TaskAdaptiveMtDataset | A Task containing the RPC response. |
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
AdaptiveMtDataset adaptiveMtDataset = new AdaptiveMtDataset();
// Make the request
AdaptiveMtDataset response = await translationServiceClient.CreateAdaptiveMtDatasetAsync(parent, adaptiveMtDataset);
CreateAdaptiveMtDatasetAsync(CreateAdaptiveMtDatasetRequest, CallSettings)
public virtual Task<AdaptiveMtDataset> CreateAdaptiveMtDatasetAsync(CreateAdaptiveMtDatasetRequest request, CallSettings callSettings = null)
Creates an Adaptive MT dataset.
Parameters | |
---|---|
Name | Description |
request | CreateAdaptiveMtDatasetRequest The request object containing all of the parameters for the API call. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
TaskAdaptiveMtDataset | A Task containing the RPC response. |
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
CreateAdaptiveMtDatasetRequest request = new CreateAdaptiveMtDatasetRequest
{
ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
AdaptiveMtDataset = new AdaptiveMtDataset(),
};
// Make the request
AdaptiveMtDataset response = await translationServiceClient.CreateAdaptiveMtDatasetAsync(request);
CreateAdaptiveMtDatasetAsync(CreateAdaptiveMtDatasetRequest, CancellationToken)
public virtual Task<AdaptiveMtDataset> CreateAdaptiveMtDatasetAsync(CreateAdaptiveMtDatasetRequest request, CancellationToken cancellationToken)
Creates an Adaptive MT dataset.
Parameters | |
---|---|
Name | Description |
request | CreateAdaptiveMtDatasetRequest The request object containing all of the parameters for the API call. |
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
TaskAdaptiveMtDataset | A Task containing the RPC response. |
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
CreateAdaptiveMtDatasetRequest request = new CreateAdaptiveMtDatasetRequest
{
ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
AdaptiveMtDataset = new AdaptiveMtDataset(),
};
// Make the request
AdaptiveMtDataset response = await translationServiceClient.CreateAdaptiveMtDatasetAsync(request);
CreateAdaptiveMtDatasetAsync(string, AdaptiveMtDataset, CallSettings)
public virtual Task<AdaptiveMtDataset> CreateAdaptiveMtDatasetAsync(string parent, AdaptiveMtDataset adaptiveMtDataset, CallSettings callSettings = null)
Creates an Adaptive MT dataset.
Parameters | |
---|---|
Name | Description |
parent | string Required. Name of the parent project. In form of
|
adaptiveMtDataset | AdaptiveMtDataset Required. The AdaptiveMtDataset to be created. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
TaskAdaptiveMtDataset | A Task containing the RPC response. |
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]";
AdaptiveMtDataset adaptiveMtDataset = new AdaptiveMtDataset();
// Make the request
AdaptiveMtDataset response = await translationServiceClient.CreateAdaptiveMtDatasetAsync(parent, adaptiveMtDataset);
CreateAdaptiveMtDatasetAsync(string, AdaptiveMtDataset, CancellationToken)
public virtual Task<AdaptiveMtDataset> CreateAdaptiveMtDatasetAsync(string parent, AdaptiveMtDataset adaptiveMtDataset, CancellationToken cancellationToken)
Creates an Adaptive MT dataset.
Parameters | |
---|---|
Name | Description |
parent | string Required. Name of the parent project. In form of
|
adaptiveMtDataset | AdaptiveMtDataset Required. The AdaptiveMtDataset to be created. |
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
TaskAdaptiveMtDataset | A Task containing the RPC response. |
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]";
AdaptiveMtDataset adaptiveMtDataset = new AdaptiveMtDataset();
// Make the request
AdaptiveMtDataset response = await translationServiceClient.CreateAdaptiveMtDatasetAsync(parent, adaptiveMtDataset);
CreateAsync(CancellationToken)
public static Task<TranslationServiceClient> CreateAsync(CancellationToken cancellationToken = default)
Asynchronously creates a TranslationServiceClient using the default credentials, endpoint and settings. To specify custom credentials or other settings, use TranslationServiceClientBuilder .
Parameter | |
---|---|
Name | Description |
cancellationToken | CancellationToken The CancellationToken to use while creating the client. |
Returns | |
---|---|
Type | Description |
TaskTranslationServiceClient | The task representing the created TranslationServiceClient. |
CreateGlossary(LocationName, Glossary, CallSettings)
public virtual Operation<Glossary, CreateGlossaryMetadata> CreateGlossary(LocationName parent, Glossary glossary, CallSettings callSettings = null)
Creates a glossary and returns the long-running operation. Returns NOT_FOUND, if the project doesn't exist.
Parameters | |
---|---|
Name | Description |
parent | LocationName Required. The project name. |
glossary | Glossary Required. The glossary to create. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
OperationGlossaryCreateGlossaryMetadata | The RPC response. |
// Create client
TranslationServiceClient translationServiceClient = TranslationServiceClient.Create();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
Glossary glossary = new Glossary();
// Make the request
Operation<Glossary, CreateGlossaryMetadata> response = translationServiceClient.CreateGlossary(parent, glossary);
// Poll until the returned long-running operation is complete
Operation<Glossary, CreateGlossaryMetadata> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
Glossary result = completedResponse.Result;
// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<Glossary, CreateGlossaryMetadata> retrievedResponse = translationServiceClient.PollOnceCreateGlossary(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
Glossary retrievedResult = retrievedResponse.Result;
}
CreateGlossary(CreateGlossaryRequest, CallSettings)
public virtual Operation<Glossary, CreateGlossaryMetadata> CreateGlossary(CreateGlossaryRequest request, CallSettings callSettings = null)
Creates a glossary and returns the long-running operation. Returns NOT_FOUND, if the project doesn't exist.
Parameters | |
---|---|
Name | Description |
request | CreateGlossaryRequest The request object containing all of the parameters for the API call. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
OperationGlossaryCreateGlossaryMetadata | The RPC response. |
// Create client
TranslationServiceClient translationServiceClient = TranslationServiceClient.Create();
// Initialize request argument(s)
CreateGlossaryRequest request = new CreateGlossaryRequest
{
ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
Glossary = new Glossary(),
};
// Make the request
Operation<Glossary, CreateGlossaryMetadata> response = translationServiceClient.CreateGlossary(request);
// Poll until the returned long-running operation is complete
Operation<Glossary, CreateGlossaryMetadata> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
Glossary result = completedResponse.Result;
// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<Glossary, CreateGlossaryMetadata> retrievedResponse = translationServiceClient.PollOnceCreateGlossary(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
Glossary retrievedResult = retrievedResponse.Result;
}
CreateGlossary(string, Glossary, CallSettings)
public virtual Operation<Glossary, CreateGlossaryMetadata> CreateGlossary(string parent, Glossary glossary, CallSettings callSettings = null)
Creates a glossary and returns the long-running operation. Returns NOT_FOUND, if the project doesn't exist.
Parameters | |
---|---|
Name | Description |
parent | string Required. The project name. |
glossary | Glossary Required. The glossary to create. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
OperationGlossaryCreateGlossaryMetadata | The RPC response. |
// Create client
TranslationServiceClient translationServiceClient = TranslationServiceClient.Create();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]";
Glossary glossary = new Glossary();
// Make the request
Operation<Glossary, CreateGlossaryMetadata> response = translationServiceClient.CreateGlossary(parent, glossary);
// Poll until the returned long-running operation is complete
Operation<Glossary, CreateGlossaryMetadata> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
Glossary result = completedResponse.Result;
// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<Glossary, CreateGlossaryMetadata> retrievedResponse = translationServiceClient.PollOnceCreateGlossary(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
Glossary retrievedResult = retrievedResponse.Result;
}
CreateGlossaryAsync(LocationName, Glossary, CallSettings)
public virtual Task<Operation<Glossary, CreateGlossaryMetadata>> CreateGlossaryAsync(LocationName parent, Glossary glossary, CallSettings callSettings = null)
Creates a glossary and returns the long-running operation. Returns NOT_FOUND, if the project doesn't exist.
Parameters | |
---|---|
Name | Description |
parent | LocationName Required. The project name. |
glossary | Glossary Required. The glossary to create. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
TaskOperationGlossaryCreateGlossaryMetadata | A Task containing the RPC response. |
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
Glossary glossary = new Glossary();
// Make the request
Operation<Glossary, CreateGlossaryMetadata> response = await translationServiceClient.CreateGlossaryAsync(parent, glossary);
// Poll until the returned long-running operation is complete
Operation<Glossary, CreateGlossaryMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Glossary result = completedResponse.Result;
// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<Glossary, CreateGlossaryMetadata> retrievedResponse = await translationServiceClient.PollOnceCreateGlossaryAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
Glossary retrievedResult = retrievedResponse.Result;
}
CreateGlossaryAsync(LocationName, Glossary, CancellationToken)
public virtual Task<Operation<Glossary, CreateGlossaryMetadata>> CreateGlossaryAsync(LocationName parent, Glossary glossary, CancellationToken cancellationToken)
Creates a glossary and returns the long-running operation. Returns NOT_FOUND, if the project doesn't exist.
Parameters | |
---|---|
Name | Description |
parent | LocationName Required. The project name. |
glossary | Glossary Required. The glossary to create. |
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
TaskOperationGlossaryCreateGlossaryMetadata | A Task containing the RPC response. |
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
Glossary glossary = new Glossary();
// Make the request
Operation<Glossary, CreateGlossaryMetadata> response = await translationServiceClient.CreateGlossaryAsync(parent, glossary);
// Poll until the returned long-running operation is complete
Operation<Glossary, CreateGlossaryMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Glossary result = completedResponse.Result;
// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<Glossary, CreateGlossaryMetadata> retrievedResponse = await translationServiceClient.PollOnceCreateGlossaryAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
Glossary retrievedResult = retrievedResponse.Result;
}
CreateGlossaryAsync(CreateGlossaryRequest, CallSettings)
public virtual Task<Operation<Glossary, CreateGlossaryMetadata>> CreateGlossaryAsync(CreateGlossaryRequest request, CallSettings callSettings = null)
Creates a glossary and returns the long-running operation. Returns NOT_FOUND, if the project doesn't exist.
Parameters | |
---|---|
Name | Description |
request | CreateGlossaryRequest The request object containing all of the parameters for the API call. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
TaskOperationGlossaryCreateGlossaryMetadata | A Task containing the RPC response. |
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
CreateGlossaryRequest request = new CreateGlossaryRequest
{
ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
Glossary = new Glossary(),
};
// Make the request
Operation<Glossary, CreateGlossaryMetadata> response = await translationServiceClient.CreateGlossaryAsync(request);
// Poll until the returned long-running operation is complete
Operation<Glossary, CreateGlossaryMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Glossary result = completedResponse.Result;
// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<Glossary, CreateGlossaryMetadata> retrievedResponse = await translationServiceClient.PollOnceCreateGlossaryAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
Glossary retrievedResult = retrievedResponse.Result;
}
CreateGlossaryAsync(CreateGlossaryRequest, CancellationToken)
public virtual Task<Operation<Glossary, CreateGlossaryMetadata>> CreateGlossaryAsync(CreateGlossaryRequest request, CancellationToken cancellationToken)
Creates a glossary and returns the long-running operation. Returns NOT_FOUND, if the project doesn't exist.
Parameters | |
---|---|
Name | Description |
request | CreateGlossaryRequest The request object containing all of the parameters for the API call. |
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
TaskOperationGlossaryCreateGlossaryMetadata | A Task containing the RPC response. |
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
CreateGlossaryRequest request = new CreateGlossaryRequest
{
ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
Glossary = new Glossary(),
};
// Make the request
Operation<Glossary, CreateGlossaryMetadata> response = await translationServiceClient.CreateGlossaryAsync(request);
// Poll until the returned long-running operation is complete
Operation<Glossary, CreateGlossaryMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Glossary result = completedResponse.Result;
// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<Glossary, CreateGlossaryMetadata> retrievedResponse = await translationServiceClient.PollOnceCreateGlossaryAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
Glossary retrievedResult = retrievedResponse.Result;
}
CreateGlossaryAsync(string, Glossary, CallSettings)
public virtual Task<Operation<Glossary, CreateGlossaryMetadata>> CreateGlossaryAsync(string parent, Glossary glossary, CallSettings callSettings = null)
Creates a glossary and returns the long-running operation. Returns NOT_FOUND, if the project doesn't exist.
Parameters | |
---|---|
Name | Description |
parent | string Required. The project name. |
glossary | Glossary Required. The glossary to create. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
TaskOperationGlossaryCreateGlossaryMetadata | A Task containing the RPC response. |
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]";
Glossary glossary = new Glossary();
// Make the request
Operation<Glossary, CreateGlossaryMetadata> response = await translationServiceClient.CreateGlossaryAsync(parent, glossary);
// Poll until the returned long-running operation is complete
Operation<Glossary, CreateGlossaryMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
Glossary result = completedResponse.Result;
// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<Glossary, CreateGlossaryMetadata> retrievedResponse = await translationServiceClient.PollOnceCreateGlossaryAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
Glossary retrievedResult = retrievedResponse.Result;
}
CreateGlossaryAsync(string, Glossary, CancellationToken)
public virtual Task<Operation<Glossary, CreateGlossaryMetadata>> CreateGlossaryAsync(string parent, Glossary glossary, CancellationToken cancellationToken)
Creates a glossary and returns the long-running operation. Returns NOT_FOUND, if the project doesn't exist.
Parameters | |
---|---|
Name | Description |
parent | string Required. The project name. |
glossary | Glossary Required. The glossary to create. |
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
TaskOperationGlossaryCreateGlossaryMetadata | A Task containing the RPC response. |
// 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 | |
---|---|
Name | Description |
name | AdaptiveMtDatasetName Required. Name of the dataset. In the form of
|
callSettings | CallSettings If not null, applies overrides to this RPC call. |
// Create client
TranslationServiceClient translationServiceClient = TranslationServiceClient.Create();
// Initialize request argument(s)
AdaptiveMtDatasetName name = AdaptiveMtDatasetName.FromProjectLocationDataset("[PROJECT]", "[LOCATION]", "[DATASET]");
// Make the request
translationServiceClient.DeleteAdaptiveMtDataset(name);
DeleteAdaptiveMtDataset(DeleteAdaptiveMtDatasetRequest, CallSettings)
public virtual void DeleteAdaptiveMtDataset(DeleteAdaptiveMtDatasetRequest request, CallSettings callSettings = null)
Deletes an Adaptive MT dataset, including all its entries and associated metadata.
Parameters | |
---|---|
Name | Description |
request | DeleteAdaptiveMtDatasetRequest The request object containing all of the parameters for the API call. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
// Create client
TranslationServiceClient translationServiceClient = TranslationServiceClient.Create();
// Initialize request argument(s)
DeleteAdaptiveMtDatasetRequest request = new DeleteAdaptiveMtDatasetRequest
{
AdaptiveMtDatasetName = AdaptiveMtDatasetName.FromProjectLocationDataset("[PROJECT]", "[LOCATION]", "[DATASET]"),
};
// Make the request
translationServiceClient.DeleteAdaptiveMtDataset(request);
DeleteAdaptiveMtDataset(string, CallSettings)
public virtual void DeleteAdaptiveMtDataset(string name, CallSettings callSettings = null)
Deletes an Adaptive MT dataset, including all its entries and associated metadata.
Parameters | |
---|---|
Name | Description |
name | string Required. Name of the dataset. In the form of
|
callSettings | CallSettings If not null, applies overrides to this RPC call. |
// Create client
TranslationServiceClient translationServiceClient = TranslationServiceClient.Create();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/adaptiveMtDatasets/[DATASET]";
// Make the request
translationServiceClient.DeleteAdaptiveMtDataset(name);
DeleteAdaptiveMtDatasetAsync(AdaptiveMtDatasetName, CallSettings)
public virtual Task DeleteAdaptiveMtDatasetAsync(AdaptiveMtDatasetName name, CallSettings callSettings = null)
Deletes an Adaptive MT dataset, including all its entries and associated metadata.
Parameters | |
---|---|
Name | Description |
name | AdaptiveMtDatasetName Required. Name of the dataset. In the form of
|
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Task | A Task containing the RPC response. |
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
AdaptiveMtDatasetName name = AdaptiveMtDatasetName.FromProjectLocationDataset("[PROJECT]", "[LOCATION]", "[DATASET]");
// Make the request
await translationServiceClient.DeleteAdaptiveMtDatasetAsync(name);
DeleteAdaptiveMtDatasetAsync(AdaptiveMtDatasetName, CancellationToken)
public virtual Task DeleteAdaptiveMtDatasetAsync(AdaptiveMtDatasetName name, CancellationToken cancellationToken)
Deletes an Adaptive MT dataset, including all its entries and associated metadata.
Parameters | |
---|---|
Name | Description |
name | AdaptiveMtDatasetName Required. Name of the dataset. In the form of
|
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
Task | A Task containing the RPC response. |
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
AdaptiveMtDatasetName name = AdaptiveMtDatasetName.FromProjectLocationDataset("[PROJECT]", "[LOCATION]", "[DATASET]");
// Make the request
await translationServiceClient.DeleteAdaptiveMtDatasetAsync(name);
DeleteAdaptiveMtDatasetAsync(DeleteAdaptiveMtDatasetRequest, CallSettings)
public virtual Task DeleteAdaptiveMtDatasetAsync(DeleteAdaptiveMtDatasetRequest request, CallSettings callSettings = null)
Deletes an Adaptive MT dataset, including all its entries and associated metadata.
Parameters | |
---|---|
Name | Description |
request | DeleteAdaptiveMtDatasetRequest The request object containing all of the parameters for the API call. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Task | A Task containing the RPC response. |
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
DeleteAdaptiveMtDatasetRequest request = new DeleteAdaptiveMtDatasetRequest
{
AdaptiveMtDatasetName = AdaptiveMtDatasetName.FromProjectLocationDataset("[PROJECT]", "[LOCATION]", "[DATASET]"),
};
// Make the request
await translationServiceClient.DeleteAdaptiveMtDatasetAsync(request);
DeleteAdaptiveMtDatasetAsync(DeleteAdaptiveMtDatasetRequest, CancellationToken)
public virtual Task DeleteAdaptiveMtDatasetAsync(DeleteAdaptiveMtDatasetRequest request, CancellationToken cancellationToken)
Deletes an Adaptive MT dataset, including all its entries and associated metadata.
Parameters | |
---|---|
Name | Description |
request | DeleteAdaptiveMtDatasetRequest The request object containing all of the parameters for the API call. |
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
Task | A Task containing the RPC response. |
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
DeleteAdaptiveMtDatasetRequest request = new DeleteAdaptiveMtDatasetRequest
{
AdaptiveMtDatasetName = AdaptiveMtDatasetName.FromProjectLocationDataset("[PROJECT]", "[LOCATION]", "[DATASET]"),
};
// Make the request
await translationServiceClient.DeleteAdaptiveMtDatasetAsync(request);
DeleteAdaptiveMtDatasetAsync(string, CallSettings)
public virtual Task DeleteAdaptiveMtDatasetAsync(string name, CallSettings callSettings = null)
Deletes an Adaptive MT dataset, including all its entries and associated metadata.
Parameters | |
---|---|
Name | Description |
name | string Required. Name of the dataset. In the form of
|
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Task | A Task containing the RPC response. |
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/adaptiveMtDatasets/[DATASET]";
// Make the request
await translationServiceClient.DeleteAdaptiveMtDatasetAsync(name);
DeleteAdaptiveMtDatasetAsync(string, CancellationToken)
public virtual Task DeleteAdaptiveMtDatasetAsync(string name, CancellationToken cancellationToken)
Deletes an Adaptive MT dataset, including all its entries and associated metadata.
Parameters | |
---|---|
Name | Description |
name | string Required. Name of the dataset. In the form of
|
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
Task | A Task containing the RPC response. |
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/adaptiveMtDatasets/[DATASET]";
// Make the request
await translationServiceClient.DeleteAdaptiveMtDatasetAsync(name);
DeleteAdaptiveMtFile(AdaptiveMtFileName, CallSettings)
public virtual void DeleteAdaptiveMtFile(AdaptiveMtFileName name, CallSettings callSettings = null)
Deletes an AdaptiveMtFile along with its sentences.
Parameters | |
---|---|
Name | Description |
name | AdaptiveMtFileName Required. The resource name of the file to delete, in form of
|
callSettings | CallSettings If not null, applies overrides to this RPC call. |
// Create client
TranslationServiceClient translationServiceClient = TranslationServiceClient.Create();
// Initialize request argument(s)
AdaptiveMtFileName name = AdaptiveMtFileName.FromProjectLocationDatasetFile("[PROJECT]", "[LOCATION]", "[DATASET]", "[FILE]");
// Make the request
translationServiceClient.DeleteAdaptiveMtFile(name);
DeleteAdaptiveMtFile(DeleteAdaptiveMtFileRequest, CallSettings)
public virtual void DeleteAdaptiveMtFile(DeleteAdaptiveMtFileRequest request, CallSettings callSettings = null)
Deletes an AdaptiveMtFile along with its sentences.
Parameters | |
---|---|
Name | Description |
request | DeleteAdaptiveMtFileRequest The request object containing all of the parameters for the API call. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
// Create client
TranslationServiceClient translationServiceClient = TranslationServiceClient.Create();
// Initialize request argument(s)
DeleteAdaptiveMtFileRequest request = new DeleteAdaptiveMtFileRequest
{
AdaptiveMtFileName = AdaptiveMtFileName.FromProjectLocationDatasetFile("[PROJECT]", "[LOCATION]", "[DATASET]", "[FILE]"),
};
// Make the request
translationServiceClient.DeleteAdaptiveMtFile(request);
DeleteAdaptiveMtFile(string, CallSettings)
public virtual void DeleteAdaptiveMtFile(string name, CallSettings callSettings = null)
Deletes an AdaptiveMtFile along with its sentences.
Parameters | |
---|---|
Name | Description |
name | string Required. The resource name of the file to delete, in form of
|
callSettings | CallSettings If not null, applies overrides to this RPC call. |
// Create client
TranslationServiceClient translationServiceClient = TranslationServiceClient.Create();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/adaptiveMtDatasets/[DATASET]/adaptiveMtFiles/[FILE]";
// Make the request
translationServiceClient.DeleteAdaptiveMtFile(name);
DeleteAdaptiveMtFileAsync(AdaptiveMtFileName, CallSettings)
public virtual Task DeleteAdaptiveMtFileAsync(AdaptiveMtFileName name, CallSettings callSettings = null)
Deletes an AdaptiveMtFile along with its sentences.
Parameters | |
---|---|
Name | Description |
name | AdaptiveMtFileName Required. The resource name of the file to delete, in form of
|
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Task | A Task containing the RPC response. |
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
AdaptiveMtFileName name = AdaptiveMtFileName.FromProjectLocationDatasetFile("[PROJECT]", "[LOCATION]", "[DATASET]", "[FILE]");
// Make the request
await translationServiceClient.DeleteAdaptiveMtFileAsync(name);
DeleteAdaptiveMtFileAsync(AdaptiveMtFileName, CancellationToken)
public virtual Task DeleteAdaptiveMtFileAsync(AdaptiveMtFileName name, CancellationToken cancellationToken)
Deletes an AdaptiveMtFile along with its sentences.
Parameters | |
---|---|
Name | Description |
name | AdaptiveMtFileName Required. The resource name of the file to delete, in form of
|
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
Task | A Task containing the RPC response. |
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
AdaptiveMtFileName name = AdaptiveMtFileName.FromProjectLocationDatasetFile("[PROJECT]", "[LOCATION]", "[DATASET]", "[FILE]");
// Make the request
await translationServiceClient.DeleteAdaptiveMtFileAsync(name);
DeleteAdaptiveMtFileAsync(DeleteAdaptiveMtFileRequest, CallSettings)
public virtual Task DeleteAdaptiveMtFileAsync(DeleteAdaptiveMtFileRequest request, CallSettings callSettings = null)
Deletes an AdaptiveMtFile along with its sentences.
Parameters | |
---|---|
Name | Description |
request | DeleteAdaptiveMtFileRequest The request object containing all of the parameters for the API call. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Task | A Task containing the RPC response. |
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
DeleteAdaptiveMtFileRequest request = new DeleteAdaptiveMtFileRequest
{
AdaptiveMtFileName = AdaptiveMtFileName.FromProjectLocationDatasetFile("[PROJECT]", "[LOCATION]", "[DATASET]", "[FILE]"),
};
// Make the request
await translationServiceClient.DeleteAdaptiveMtFileAsync(request);
DeleteAdaptiveMtFileAsync(DeleteAdaptiveMtFileRequest, CancellationToken)
public virtual Task DeleteAdaptiveMtFileAsync(DeleteAdaptiveMtFileRequest request, CancellationToken cancellationToken)
Deletes an AdaptiveMtFile along with its sentences.
Parameters | |
---|---|
Name | Description |
request | DeleteAdaptiveMtFileRequest The request object containing all of the parameters for the API call. |
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
Task | A Task containing the RPC response. |
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
DeleteAdaptiveMtFileRequest request = new DeleteAdaptiveMtFileRequest
{
AdaptiveMtFileName = AdaptiveMtFileName.FromProjectLocationDatasetFile("[PROJECT]", "[LOCATION]", "[DATASET]", "[FILE]"),
};
// Make the request
await translationServiceClient.DeleteAdaptiveMtFileAsync(request);
DeleteAdaptiveMtFileAsync(string, CallSettings)
public virtual Task DeleteAdaptiveMtFileAsync(string name, CallSettings callSettings = null)
Deletes an AdaptiveMtFile along with its sentences.
Parameters | |
---|---|
Name | Description |
name | string Required. The resource name of the file to delete, in form of
|
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Task | A Task containing the RPC response. |
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/adaptiveMtDatasets/[DATASET]/adaptiveMtFiles/[FILE]";
// Make the request
await translationServiceClient.DeleteAdaptiveMtFileAsync(name);
DeleteAdaptiveMtFileAsync(string, CancellationToken)
public virtual Task DeleteAdaptiveMtFileAsync(string name, CancellationToken cancellationToken)
Deletes an AdaptiveMtFile along with its sentences.
Parameters | |
---|---|
Name | Description |
name | string Required. The resource name of the file to delete, in form of
|
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
Task | A Task containing the RPC response. |
// 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 | |
---|---|
Name | Description |
request | DeleteGlossaryRequest The request object containing all of the parameters for the API call. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
OperationDeleteGlossaryResponseDeleteGlossaryMetadata | The RPC response. |
// Create client
TranslationServiceClient translationServiceClient = TranslationServiceClient.Create();
// Initialize request argument(s)
DeleteGlossaryRequest request = new DeleteGlossaryRequest
{
GlossaryName = GlossaryName.FromProjectLocationGlossary("[PROJECT]", "[LOCATION]", "[GLOSSARY]"),
};
// Make the request
Operation<DeleteGlossaryResponse, DeleteGlossaryMetadata> response = translationServiceClient.DeleteGlossary(request);
// Poll until the returned long-running operation is complete
Operation<DeleteGlossaryResponse, DeleteGlossaryMetadata> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
DeleteGlossaryResponse result = completedResponse.Result;
// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<DeleteGlossaryResponse, DeleteGlossaryMetadata> retrievedResponse = translationServiceClient.PollOnceDeleteGlossary(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
DeleteGlossaryResponse retrievedResult = retrievedResponse.Result;
}
DeleteGlossary(GlossaryName, CallSettings)
public virtual Operation<DeleteGlossaryResponse, DeleteGlossaryMetadata> DeleteGlossary(GlossaryName name, CallSettings callSettings = null)
Deletes a glossary, or cancels glossary construction if the glossary isn't created yet. Returns NOT_FOUND, if the glossary doesn't exist.
Parameters | |
---|---|
Name | Description |
name | GlossaryName Required. The name of the glossary to delete. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
OperationDeleteGlossaryResponseDeleteGlossaryMetadata | The RPC response. |
// Create client
TranslationServiceClient translationServiceClient = TranslationServiceClient.Create();
// Initialize request argument(s)
GlossaryName name = GlossaryName.FromProjectLocationGlossary("[PROJECT]", "[LOCATION]", "[GLOSSARY]");
// Make the request
Operation<DeleteGlossaryResponse, DeleteGlossaryMetadata> response = translationServiceClient.DeleteGlossary(name);
// Poll until the returned long-running operation is complete
Operation<DeleteGlossaryResponse, DeleteGlossaryMetadata> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
DeleteGlossaryResponse result = completedResponse.Result;
// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<DeleteGlossaryResponse, DeleteGlossaryMetadata> retrievedResponse = translationServiceClient.PollOnceDeleteGlossary(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
DeleteGlossaryResponse retrievedResult = retrievedResponse.Result;
}
DeleteGlossary(string, CallSettings)
public virtual Operation<DeleteGlossaryResponse, DeleteGlossaryMetadata> DeleteGlossary(string name, CallSettings callSettings = null)
Deletes a glossary, or cancels glossary construction if the glossary isn't created yet. Returns NOT_FOUND, if the glossary doesn't exist.
Parameters | |
---|---|
Name | Description |
name | string Required. The name of the glossary to delete. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
OperationDeleteGlossaryResponseDeleteGlossaryMetadata | The RPC response. |
// Create client
TranslationServiceClient translationServiceClient = TranslationServiceClient.Create();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/glossaries/[GLOSSARY]";
// Make the request
Operation<DeleteGlossaryResponse, DeleteGlossaryMetadata> response = translationServiceClient.DeleteGlossary(name);
// Poll until the returned long-running operation is complete
Operation<DeleteGlossaryResponse, DeleteGlossaryMetadata> completedResponse = response.PollUntilCompleted();
// Retrieve the operation result
DeleteGlossaryResponse result = completedResponse.Result;
// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<DeleteGlossaryResponse, DeleteGlossaryMetadata> retrievedResponse = translationServiceClient.PollOnceDeleteGlossary(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
DeleteGlossaryResponse retrievedResult = retrievedResponse.Result;
}
DeleteGlossaryAsync(DeleteGlossaryRequest, CallSettings)
public virtual Task<Operation<DeleteGlossaryResponse, DeleteGlossaryMetadata>> DeleteGlossaryAsync(DeleteGlossaryRequest request, CallSettings callSettings = null)
Deletes a glossary, or cancels glossary construction if the glossary isn't created yet. Returns NOT_FOUND, if the glossary doesn't exist.
Parameters | |
---|---|
Name | Description |
request | DeleteGlossaryRequest The request object containing all of the parameters for the API call. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
TaskOperationDeleteGlossaryResponseDeleteGlossaryMetadata | A Task containing the RPC response. |
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
DeleteGlossaryRequest request = new DeleteGlossaryRequest
{
GlossaryName = GlossaryName.FromProjectLocationGlossary("[PROJECT]", "[LOCATION]", "[GLOSSARY]"),
};
// Make the request
Operation<DeleteGlossaryResponse, DeleteGlossaryMetadata> response = await translationServiceClient.DeleteGlossaryAsync(request);
// Poll until the returned long-running operation is complete
Operation<DeleteGlossaryResponse, DeleteGlossaryMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
DeleteGlossaryResponse result = completedResponse.Result;
// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<DeleteGlossaryResponse, DeleteGlossaryMetadata> retrievedResponse = await translationServiceClient.PollOnceDeleteGlossaryAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
DeleteGlossaryResponse retrievedResult = retrievedResponse.Result;
}
DeleteGlossaryAsync(DeleteGlossaryRequest, CancellationToken)
public virtual Task<Operation<DeleteGlossaryResponse, DeleteGlossaryMetadata>> DeleteGlossaryAsync(DeleteGlossaryRequest request, CancellationToken cancellationToken)
Deletes a glossary, or cancels glossary construction if the glossary isn't created yet. Returns NOT_FOUND, if the glossary doesn't exist.
Parameters | |
---|---|
Name | Description |
request | DeleteGlossaryRequest The request object containing all of the parameters for the API call. |
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
TaskOperationDeleteGlossaryResponseDeleteGlossaryMetadata | A Task containing the RPC response. |
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
DeleteGlossaryRequest request = new DeleteGlossaryRequest
{
GlossaryName = GlossaryName.FromProjectLocationGlossary("[PROJECT]", "[LOCATION]", "[GLOSSARY]"),
};
// Make the request
Operation<DeleteGlossaryResponse, DeleteGlossaryMetadata> response = await translationServiceClient.DeleteGlossaryAsync(request);
// Poll until the returned long-running operation is complete
Operation<DeleteGlossaryResponse, DeleteGlossaryMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
DeleteGlossaryResponse result = completedResponse.Result;
// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<DeleteGlossaryResponse, DeleteGlossaryMetadata> retrievedResponse = await translationServiceClient.PollOnceDeleteGlossaryAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
DeleteGlossaryResponse retrievedResult = retrievedResponse.Result;
}
DeleteGlossaryAsync(GlossaryName, CallSettings)
public virtual Task<Operation<DeleteGlossaryResponse, DeleteGlossaryMetadata>> DeleteGlossaryAsync(GlossaryName name, CallSettings callSettings = null)
Deletes a glossary, or cancels glossary construction if the glossary isn't created yet. Returns NOT_FOUND, if the glossary doesn't exist.
Parameters | |
---|---|
Name | Description |
name | GlossaryName Required. The name of the glossary to delete. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
TaskOperationDeleteGlossaryResponseDeleteGlossaryMetadata | A Task containing the RPC response. |
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
GlossaryName name = GlossaryName.FromProjectLocationGlossary("[PROJECT]", "[LOCATION]", "[GLOSSARY]");
// Make the request
Operation<DeleteGlossaryResponse, DeleteGlossaryMetadata> response = await translationServiceClient.DeleteGlossaryAsync(name);
// Poll until the returned long-running operation is complete
Operation<DeleteGlossaryResponse, DeleteGlossaryMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
DeleteGlossaryResponse result = completedResponse.Result;
// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<DeleteGlossaryResponse, DeleteGlossaryMetadata> retrievedResponse = await translationServiceClient.PollOnceDeleteGlossaryAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
DeleteGlossaryResponse retrievedResult = retrievedResponse.Result;
}
DeleteGlossaryAsync(GlossaryName, CancellationToken)
public virtual Task<Operation<DeleteGlossaryResponse, DeleteGlossaryMetadata>> DeleteGlossaryAsync(GlossaryName name, CancellationToken cancellationToken)
Deletes a glossary, or cancels glossary construction if the glossary isn't created yet. Returns NOT_FOUND, if the glossary doesn't exist.
Parameters | |
---|---|
Name | Description |
name | GlossaryName Required. The name of the glossary to delete. |
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
TaskOperationDeleteGlossaryResponseDeleteGlossaryMetadata | A Task containing the RPC response. |
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
GlossaryName name = GlossaryName.FromProjectLocationGlossary("[PROJECT]", "[LOCATION]", "[GLOSSARY]");
// Make the request
Operation<DeleteGlossaryResponse, DeleteGlossaryMetadata> response = await translationServiceClient.DeleteGlossaryAsync(name);
// Poll until the returned long-running operation is complete
Operation<DeleteGlossaryResponse, DeleteGlossaryMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
DeleteGlossaryResponse result = completedResponse.Result;
// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<DeleteGlossaryResponse, DeleteGlossaryMetadata> retrievedResponse = await translationServiceClient.PollOnceDeleteGlossaryAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
DeleteGlossaryResponse retrievedResult = retrievedResponse.Result;
}
DeleteGlossaryAsync(string, CallSettings)
public virtual Task<Operation<DeleteGlossaryResponse, DeleteGlossaryMetadata>> DeleteGlossaryAsync(string name, CallSettings callSettings = null)
Deletes a glossary, or cancels glossary construction if the glossary isn't created yet. Returns NOT_FOUND, if the glossary doesn't exist.
Parameters | |
---|---|
Name | Description |
name | string Required. The name of the glossary to delete. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
TaskOperationDeleteGlossaryResponseDeleteGlossaryMetadata | A Task containing the RPC response. |
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/glossaries/[GLOSSARY]";
// Make the request
Operation<DeleteGlossaryResponse, DeleteGlossaryMetadata> response = await translationServiceClient.DeleteGlossaryAsync(name);
// Poll until the returned long-running operation is complete
Operation<DeleteGlossaryResponse, DeleteGlossaryMetadata> completedResponse = await response.PollUntilCompletedAsync();
// Retrieve the operation result
DeleteGlossaryResponse result = completedResponse.Result;
// Or get the name of the operation
string operationName = response.Name;
// This name can be stored, then the long-running operation retrieved later by name
Operation<DeleteGlossaryResponse, DeleteGlossaryMetadata> retrievedResponse = await translationServiceClient.PollOnceDeleteGlossaryAsync(operationName);
// Check if the retrieved long-running operation has completed
if (retrievedResponse.IsCompleted)
{
// If it has completed, then access the result
DeleteGlossaryResponse retrievedResult = retrievedResponse.Result;
}
DeleteGlossaryAsync(string, CancellationToken)
public virtual Task<Operation<DeleteGlossaryResponse, DeleteGlossaryMetadata>> DeleteGlossaryAsync(string name, CancellationToken cancellationToken)
Deletes a glossary, or cancels glossary construction if the glossary isn't created yet. Returns NOT_FOUND, if the glossary doesn't exist.
Parameters | |
---|---|
Name | Description |
name | string Required. The name of the glossary to delete. |
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
TaskOperationDeleteGlossaryResponseDeleteGlossaryMetadata | A Task containing the RPC response. |
// 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 | |
---|---|
Name | Description |
parent | LocationName Required. Project or location to make a call. Must refer to a caller's project. Format: For global calls, use Only models within the same region (has same location-id) can be used. Otherwise an INVALID_ARGUMENT (400) error is returned. |
model | string Optional. The language detection model to be used. Format:
Only one language detection model is currently supported:
If not specified, the default model is used. |
mimeType | string Optional. The format of the source text, for example, "text/html", "text/plain". If left blank, the MIME type defaults to "text/html". |
content | string The content of the input stored as a string. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
DetectLanguageResponse | The RPC response. |
// Create client
TranslationServiceClient translationServiceClient = TranslationServiceClient.Create();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
string model = "";
string mimeType = "";
string content = "";
// Make the request
DetectLanguageResponse response = translationServiceClient.DetectLanguage(parent, model, mimeType, content);
DetectLanguage(DetectLanguageRequest, CallSettings)
public virtual DetectLanguageResponse DetectLanguage(DetectLanguageRequest request, CallSettings callSettings = null)
Detects the language of text within a request.
Parameters | |
---|---|
Name | Description |
request | DetectLanguageRequest The request object containing all of the parameters for the API call. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
DetectLanguageResponse | The RPC response. |
// Create client
TranslationServiceClient translationServiceClient = TranslationServiceClient.Create();
// Initialize request argument(s)
DetectLanguageRequest request = new DetectLanguageRequest
{
Content = "",
MimeType = "",
Model = "",
ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
Labels = { { "", "" }, },
};
// Make the request
DetectLanguageResponse response = translationServiceClient.DetectLanguage(request);
DetectLanguage(string, string, string, string, CallSettings)
public virtual DetectLanguageResponse DetectLanguage(string parent, string model, string mimeType, string content, CallSettings callSettings = null)
Detects the language of text within a request.
Parameters | |
---|---|
Name | Description |
parent | string Required. Project or location to make a call. Must refer to a caller's project. Format: For global calls, use Only models within the same region (has same location-id) can be used. Otherwise an INVALID_ARGUMENT (400) error is returned. |
model | string Optional. The language detection model to be used. Format:
Only one language detection model is currently supported:
If not specified, the default model is used. |
mimeType | string Optional. The format of the source text, for example, "text/html", "text/plain". If left blank, the MIME type defaults to "text/html". |
content | string The content of the input stored as a string. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
DetectLanguageResponse | The RPC response. |
// Create client
TranslationServiceClient translationServiceClient = TranslationServiceClient.Create();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]";
string model = "";
string mimeType = "";
string content = "";
// Make the request
DetectLanguageResponse response = translationServiceClient.DetectLanguage(parent, model, mimeType, content);
DetectLanguageAsync(LocationName, string, string, string, CallSettings)
public virtual Task<DetectLanguageResponse> DetectLanguageAsync(LocationName parent, string model, string mimeType, string content, CallSettings callSettings = null)
Detects the language of text within a request.
Parameters | |
---|---|
Name | Description |
parent | LocationName Required. Project or location to make a call. Must refer to a caller's project. Format: For global calls, use Only models within the same region (has same location-id) can be used. Otherwise an INVALID_ARGUMENT (400) error is returned. |
model | string Optional. The language detection model to be used. Format:
Only one language detection model is currently supported:
If not specified, the default model is used. |
mimeType | string Optional. The format of the source text, for example, "text/html", "text/plain". If left blank, the MIME type defaults to "text/html". |
content | string The content of the input stored as a string. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
TaskDetectLanguageResponse | A Task containing the RPC response. |
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
string model = "";
string mimeType = "";
string content = "";
// Make the request
DetectLanguageResponse response = await translationServiceClient.DetectLanguageAsync(parent, model, mimeType, content);
DetectLanguageAsync(LocationName, string, string, string, CancellationToken)
public virtual Task<DetectLanguageResponse> DetectLanguageAsync(LocationName parent, string model, string mimeType, string content, CancellationToken cancellationToken)
Detects the language of text within a request.
Parameters | |
---|---|
Name | Description |
parent | LocationName Required. Project or location to make a call. Must refer to a caller's project. Format: For global calls, use Only models within the same region (has same location-id) can be used. Otherwise an INVALID_ARGUMENT (400) error is returned. |
model | string Optional. The language detection model to be used. Format:
Only one language detection model is currently supported:
If not specified, the default model is used. |
mimeType | string Optional. The format of the source text, for example, "text/html", "text/plain". If left blank, the MIME type defaults to "text/html". |
content | string The content of the input stored as a string. |
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
TaskDetectLanguageResponse | A Task containing the RPC response. |
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
string model = "";
string mimeType = "";
string content = "";
// Make the request
DetectLanguageResponse response = await translationServiceClient.DetectLanguageAsync(parent, model, mimeType, content);
DetectLanguageAsync(DetectLanguageRequest, CallSettings)
public virtual Task<DetectLanguageResponse> DetectLanguageAsync(DetectLanguageRequest request, CallSettings callSettings = null)
Detects the language of text within a request.
Parameters | |
---|---|
Name | Description |
request | DetectLanguageRequest The request object containing all of the parameters for the API call. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
TaskDetectLanguageResponse | A Task containing the RPC response. |
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
DetectLanguageRequest request = new DetectLanguageRequest
{
Content = "",
MimeType = "",
Model = "",
ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
Labels = { { "", "" }, },
};
// Make the request
DetectLanguageResponse response = await translationServiceClient.DetectLanguageAsync(request);
DetectLanguageAsync(DetectLanguageRequest, CancellationToken)
public virtual Task<DetectLanguageResponse> DetectLanguageAsync(DetectLanguageRequest request, CancellationToken cancellationToken)
Detects the language of text within a request.
Parameters | |
---|---|
Name | Description |
request | DetectLanguageRequest The request object containing all of the parameters for the API call. |
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
TaskDetectLanguageResponse | A Task containing the RPC response. |
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
DetectLanguageRequest request = new DetectLanguageRequest
{
Content = "",
MimeType = "",
Model = "",
ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
Labels = { { "", "" }, },
};
// Make the request
DetectLanguageResponse response = await translationServiceClient.DetectLanguageAsync(request);
DetectLanguageAsync(string, string, string, string, CallSettings)
public virtual Task<DetectLanguageResponse> DetectLanguageAsync(string parent, string model, string mimeType, string content, CallSettings callSettings = null)
Detects the language of text within a request.
Parameters | |
---|---|
Name | Description |
parent | string Required. Project or location to make a call. Must refer to a caller's project. Format: For global calls, use Only models within the same region (has same location-id) can be used. Otherwise an INVALID_ARGUMENT (400) error is returned. |
model | string Optional. The language detection model to be used. Format:
Only one language detection model is currently supported:
If not specified, the default model is used. |
mimeType | string Optional. The format of the source text, for example, "text/html", "text/plain". If left blank, the MIME type defaults to "text/html". |
content | string The content of the input stored as a string. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
TaskDetectLanguageResponse | A Task containing the RPC response. |
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]";
string model = "";
string mimeType = "";
string content = "";
// Make the request
DetectLanguageResponse response = await translationServiceClient.DetectLanguageAsync(parent, model, mimeType, content);
DetectLanguageAsync(string, string, string, string, CancellationToken)
public virtual Task<DetectLanguageResponse> DetectLanguageAsync(string parent, string model, string mimeType, string content, CancellationToken cancellationToken)
Detects the language of text within a request.
Parameters | |
---|---|
Name | Description |
parent | string Required. Project or location to make a call. Must refer to a caller's project. Format: For global calls, use Only models within the same region (has same location-id) can be used. Otherwise an INVALID_ARGUMENT (400) error is returned. |
model | string Optional. The language detection model to be used. Format:
Only one language detection model is currently supported:
If not specified, the default model is used. |
mimeType | string Optional. The format of the source text, for example, "text/html", "text/plain". If left blank, the MIME type defaults to "text/html". |
content | string The content of the input stored as a string. |
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
TaskDetectLanguageResponse | A Task containing the RPC response. |
// 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 | |
---|---|
Name | Description |
name | AdaptiveMtDatasetName Required. Name of the dataset. In the form of
|
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
AdaptiveMtDataset | The RPC response. |
// Create client
TranslationServiceClient translationServiceClient = TranslationServiceClient.Create();
// Initialize request argument(s)
AdaptiveMtDatasetName name = AdaptiveMtDatasetName.FromProjectLocationDataset("[PROJECT]", "[LOCATION]", "[DATASET]");
// Make the request
AdaptiveMtDataset response = translationServiceClient.GetAdaptiveMtDataset(name);
GetAdaptiveMtDataset(GetAdaptiveMtDatasetRequest, CallSettings)
public virtual AdaptiveMtDataset GetAdaptiveMtDataset(GetAdaptiveMtDatasetRequest request, CallSettings callSettings = null)
Gets the Adaptive MT dataset.
Parameters | |
---|---|
Name | Description |
request | GetAdaptiveMtDatasetRequest The request object containing all of the parameters for the API call. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
AdaptiveMtDataset | The RPC response. |
// Create client
TranslationServiceClient translationServiceClient = TranslationServiceClient.Create();
// Initialize request argument(s)
GetAdaptiveMtDatasetRequest request = new GetAdaptiveMtDatasetRequest
{
AdaptiveMtDatasetName = AdaptiveMtDatasetName.FromProjectLocationDataset("[PROJECT]", "[LOCATION]", "[DATASET]"),
};
// Make the request
AdaptiveMtDataset response = translationServiceClient.GetAdaptiveMtDataset(request);
GetAdaptiveMtDataset(string, CallSettings)
public virtual AdaptiveMtDataset GetAdaptiveMtDataset(string name, CallSettings callSettings = null)
Gets the Adaptive MT dataset.
Parameters | |
---|---|
Name | Description |
name | string Required. Name of the dataset. In the form of
|
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
AdaptiveMtDataset | The RPC response. |
// Create client
TranslationServiceClient translationServiceClient = TranslationServiceClient.Create();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/adaptiveMtDatasets/[DATASET]";
// Make the request
AdaptiveMtDataset response = translationServiceClient.GetAdaptiveMtDataset(name);
GetAdaptiveMtDatasetAsync(AdaptiveMtDatasetName, CallSettings)
public virtual Task<AdaptiveMtDataset> GetAdaptiveMtDatasetAsync(AdaptiveMtDatasetName name, CallSettings callSettings = null)
Gets the Adaptive MT dataset.
Parameters | |
---|---|
Name | Description |
name | AdaptiveMtDatasetName Required. Name of the dataset. In the form of
|
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
TaskAdaptiveMtDataset | A Task containing the RPC response. |
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
AdaptiveMtDatasetName name = AdaptiveMtDatasetName.FromProjectLocationDataset("[PROJECT]", "[LOCATION]", "[DATASET]");
// Make the request
AdaptiveMtDataset response = await translationServiceClient.GetAdaptiveMtDatasetAsync(name);
GetAdaptiveMtDatasetAsync(AdaptiveMtDatasetName, CancellationToken)
public virtual Task<AdaptiveMtDataset> GetAdaptiveMtDatasetAsync(AdaptiveMtDatasetName name, CancellationToken cancellationToken)
Gets the Adaptive MT dataset.
Parameters | |
---|---|
Name | Description |
name | AdaptiveMtDatasetName Required. Name of the dataset. In the form of
|
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
TaskAdaptiveMtDataset | A Task containing the RPC response. |
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
AdaptiveMtDatasetName name = AdaptiveMtDatasetName.FromProjectLocationDataset("[PROJECT]", "[LOCATION]", "[DATASET]");
// Make the request
AdaptiveMtDataset response = await translationServiceClient.GetAdaptiveMtDatasetAsync(name);
GetAdaptiveMtDatasetAsync(GetAdaptiveMtDatasetRequest, CallSettings)
public virtual Task<AdaptiveMtDataset> GetAdaptiveMtDatasetAsync(GetAdaptiveMtDatasetRequest request, CallSettings callSettings = null)
Gets the Adaptive MT dataset.
Parameters | |
---|---|
Name | Description |
request | GetAdaptiveMtDatasetRequest The request object containing all of the parameters for the API call. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
TaskAdaptiveMtDataset | A Task containing the RPC response. |
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
GetAdaptiveMtDatasetRequest request = new GetAdaptiveMtDatasetRequest
{
AdaptiveMtDatasetName = AdaptiveMtDatasetName.FromProjectLocationDataset("[PROJECT]", "[LOCATION]", "[DATASET]"),
};
// Make the request
AdaptiveMtDataset response = await translationServiceClient.GetAdaptiveMtDatasetAsync(request);
GetAdaptiveMtDatasetAsync(GetAdaptiveMtDatasetRequest, CancellationToken)
public virtual Task<AdaptiveMtDataset> GetAdaptiveMtDatasetAsync(GetAdaptiveMtDatasetRequest request, CancellationToken cancellationToken)
Gets the Adaptive MT dataset.
Parameters | |
---|---|
Name | Description |
request | GetAdaptiveMtDatasetRequest The request object containing all of the parameters for the API call. |
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
TaskAdaptiveMtDataset | A Task containing the RPC response. |
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
GetAdaptiveMtDatasetRequest request = new GetAdaptiveMtDatasetRequest
{
AdaptiveMtDatasetName = AdaptiveMtDatasetName.FromProjectLocationDataset("[PROJECT]", "[LOCATION]", "[DATASET]"),
};
// Make the request
AdaptiveMtDataset response = await translationServiceClient.GetAdaptiveMtDatasetAsync(request);
GetAdaptiveMtDatasetAsync(string, CallSettings)
public virtual Task<AdaptiveMtDataset> GetAdaptiveMtDatasetAsync(string name, CallSettings callSettings = null)
Gets the Adaptive MT dataset.
Parameters | |
---|---|
Name | Description |
name | string Required. Name of the dataset. In the form of
|
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
TaskAdaptiveMtDataset | A Task containing the RPC response. |
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/adaptiveMtDatasets/[DATASET]";
// Make the request
AdaptiveMtDataset response = await translationServiceClient.GetAdaptiveMtDatasetAsync(name);
GetAdaptiveMtDatasetAsync(string, CancellationToken)
public virtual Task<AdaptiveMtDataset> GetAdaptiveMtDatasetAsync(string name, CancellationToken cancellationToken)
Gets the Adaptive MT dataset.
Parameters | |
---|---|
Name | Description |
name | string Required. Name of the dataset. In the form of
|
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
TaskAdaptiveMtDataset | A Task containing the RPC response. |
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/adaptiveMtDatasets/[DATASET]";
// Make the request
AdaptiveMtDataset response = await translationServiceClient.GetAdaptiveMtDatasetAsync(name);
GetAdaptiveMtFile(AdaptiveMtFileName, CallSettings)
public virtual AdaptiveMtFile GetAdaptiveMtFile(AdaptiveMtFileName name, CallSettings callSettings = null)
Gets and AdaptiveMtFile
Parameters | |
---|---|
Name | Description |
name | AdaptiveMtFileName Required. The resource name of the file, in form of
|
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
AdaptiveMtFile | The RPC response. |
// Create client
TranslationServiceClient translationServiceClient = TranslationServiceClient.Create();
// Initialize request argument(s)
AdaptiveMtFileName name = AdaptiveMtFileName.FromProjectLocationDatasetFile("[PROJECT]", "[LOCATION]", "[DATASET]", "[FILE]");
// Make the request
AdaptiveMtFile response = translationServiceClient.GetAdaptiveMtFile(name);
GetAdaptiveMtFile(GetAdaptiveMtFileRequest, CallSettings)
public virtual AdaptiveMtFile GetAdaptiveMtFile(GetAdaptiveMtFileRequest request, CallSettings callSettings = null)
Gets and AdaptiveMtFile
Parameters | |
---|---|
Name | Description |
request | GetAdaptiveMtFileRequest The request object containing all of the parameters for the API call. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
AdaptiveMtFile | The RPC response. |
// Create client
TranslationServiceClient translationServiceClient = TranslationServiceClient.Create();
// Initialize request argument(s)
GetAdaptiveMtFileRequest request = new GetAdaptiveMtFileRequest
{
AdaptiveMtFileName = AdaptiveMtFileName.FromProjectLocationDatasetFile("[PROJECT]", "[LOCATION]", "[DATASET]", "[FILE]"),
};
// Make the request
AdaptiveMtFile response = translationServiceClient.GetAdaptiveMtFile(request);
GetAdaptiveMtFile(string, CallSettings)
public virtual AdaptiveMtFile GetAdaptiveMtFile(string name, CallSettings callSettings = null)
Gets and AdaptiveMtFile
Parameters | |
---|---|
Name | Description |
name | string Required. The resource name of the file, in form of
|
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
AdaptiveMtFile | The RPC response. |
// Create client
TranslationServiceClient translationServiceClient = TranslationServiceClient.Create();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/adaptiveMtDatasets/[DATASET]/adaptiveMtFiles/[FILE]";
// Make the request
AdaptiveMtFile response = translationServiceClient.GetAdaptiveMtFile(name);
GetAdaptiveMtFileAsync(AdaptiveMtFileName, CallSettings)
public virtual Task<AdaptiveMtFile> GetAdaptiveMtFileAsync(AdaptiveMtFileName name, CallSettings callSettings = null)
Gets and AdaptiveMtFile
Parameters | |
---|---|
Name | Description |
name | AdaptiveMtFileName Required. The resource name of the file, in form of
|
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
TaskAdaptiveMtFile | A Task containing the RPC response. |
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
AdaptiveMtFileName name = AdaptiveMtFileName.FromProjectLocationDatasetFile("[PROJECT]", "[LOCATION]", "[DATASET]", "[FILE]");
// Make the request
AdaptiveMtFile response = await translationServiceClient.GetAdaptiveMtFileAsync(name);
GetAdaptiveMtFileAsync(AdaptiveMtFileName, CancellationToken)
public virtual Task<AdaptiveMtFile> GetAdaptiveMtFileAsync(AdaptiveMtFileName name, CancellationToken cancellationToken)
Gets and AdaptiveMtFile
Parameters | |
---|---|
Name | Description |
name | AdaptiveMtFileName Required. The resource name of the file, in form of
|
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
TaskAdaptiveMtFile | A Task containing the RPC response. |
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
AdaptiveMtFileName name = AdaptiveMtFileName.FromProjectLocationDatasetFile("[PROJECT]", "[LOCATION]", "[DATASET]", "[FILE]");
// Make the request
AdaptiveMtFile response = await translationServiceClient.GetAdaptiveMtFileAsync(name);
GetAdaptiveMtFileAsync(GetAdaptiveMtFileRequest, CallSettings)
public virtual Task<AdaptiveMtFile> GetAdaptiveMtFileAsync(GetAdaptiveMtFileRequest request, CallSettings callSettings = null)
Gets and AdaptiveMtFile
Parameters | |
---|---|
Name | Description |
request | GetAdaptiveMtFileRequest The request object containing all of the parameters for the API call. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
TaskAdaptiveMtFile | A Task containing the RPC response. |
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
GetAdaptiveMtFileRequest request = new GetAdaptiveMtFileRequest
{
AdaptiveMtFileName = AdaptiveMtFileName.FromProjectLocationDatasetFile("[PROJECT]", "[LOCATION]", "[DATASET]", "[FILE]"),
};
// Make the request
AdaptiveMtFile response = await translationServiceClient.GetAdaptiveMtFileAsync(request);
GetAdaptiveMtFileAsync(GetAdaptiveMtFileRequest, CancellationToken)
public virtual Task<AdaptiveMtFile> GetAdaptiveMtFileAsync(GetAdaptiveMtFileRequest request, CancellationToken cancellationToken)
Gets and AdaptiveMtFile
Parameters | |
---|---|
Name | Description |
request | GetAdaptiveMtFileRequest The request object containing all of the parameters for the API call. |
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
TaskAdaptiveMtFile | A Task containing the RPC response. |
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
GetAdaptiveMtFileRequest request = new GetAdaptiveMtFileRequest
{
AdaptiveMtFileName = AdaptiveMtFileName.FromProjectLocationDatasetFile("[PROJECT]", "[LOCATION]", "[DATASET]", "[FILE]"),
};
// Make the request
AdaptiveMtFile response = await translationServiceClient.GetAdaptiveMtFileAsync(request);
GetAdaptiveMtFileAsync(string, CallSettings)
public virtual Task<AdaptiveMtFile> GetAdaptiveMtFileAsync(string name, CallSettings callSettings = null)
Gets and AdaptiveMtFile
Parameters | |
---|---|
Name | Description |
name | string Required. The resource name of the file, in form of
|
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
TaskAdaptiveMtFile | A Task containing the RPC response. |
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/adaptiveMtDatasets/[DATASET]/adaptiveMtFiles/[FILE]";
// Make the request
AdaptiveMtFile response = await translationServiceClient.GetAdaptiveMtFileAsync(name);
GetAdaptiveMtFileAsync(string, CancellationToken)
public virtual Task<AdaptiveMtFile> GetAdaptiveMtFileAsync(string name, CancellationToken cancellationToken)
Gets and AdaptiveMtFile
Parameters | |
---|---|
Name | Description |
name | string Required. The resource name of the file, in form of
|
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
TaskAdaptiveMtFile | A Task containing the RPC response. |
// 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 | |
---|---|
Name | Description |
request | GetGlossaryRequest The request object containing all of the parameters for the API call. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Glossary | The RPC response. |
// Create client
TranslationServiceClient translationServiceClient = TranslationServiceClient.Create();
// Initialize request argument(s)
GetGlossaryRequest request = new GetGlossaryRequest
{
GlossaryName = GlossaryName.FromProjectLocationGlossary("[PROJECT]", "[LOCATION]", "[GLOSSARY]"),
};
// Make the request
Glossary response = translationServiceClient.GetGlossary(request);
GetGlossary(GlossaryName, CallSettings)
public virtual Glossary GetGlossary(GlossaryName name, CallSettings callSettings = null)
Gets a glossary. Returns NOT_FOUND, if the glossary doesn't exist.
Parameters | |
---|---|
Name | Description |
name | GlossaryName Required. The name of the glossary to retrieve. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Glossary | The RPC response. |
// Create client
TranslationServiceClient translationServiceClient = TranslationServiceClient.Create();
// Initialize request argument(s)
GlossaryName name = GlossaryName.FromProjectLocationGlossary("[PROJECT]", "[LOCATION]", "[GLOSSARY]");
// Make the request
Glossary response = translationServiceClient.GetGlossary(name);
GetGlossary(string, CallSettings)
public virtual Glossary GetGlossary(string name, CallSettings callSettings = null)
Gets a glossary. Returns NOT_FOUND, if the glossary doesn't exist.
Parameters | |
---|---|
Name | Description |
name | string Required. The name of the glossary to retrieve. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Glossary | The RPC response. |
// Create client
TranslationServiceClient translationServiceClient = TranslationServiceClient.Create();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/glossaries/[GLOSSARY]";
// Make the request
Glossary response = translationServiceClient.GetGlossary(name);
GetGlossaryAsync(GetGlossaryRequest, CallSettings)
public virtual Task<Glossary> GetGlossaryAsync(GetGlossaryRequest request, CallSettings callSettings = null)
Gets a glossary. Returns NOT_FOUND, if the glossary doesn't exist.
Parameters | |
---|---|
Name | Description |
request | GetGlossaryRequest The request object containing all of the parameters for the API call. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
TaskGlossary | A Task containing the RPC response. |
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
GetGlossaryRequest request = new GetGlossaryRequest
{
GlossaryName = GlossaryName.FromProjectLocationGlossary("[PROJECT]", "[LOCATION]", "[GLOSSARY]"),
};
// Make the request
Glossary response = await translationServiceClient.GetGlossaryAsync(request);
GetGlossaryAsync(GetGlossaryRequest, CancellationToken)
public virtual Task<Glossary> GetGlossaryAsync(GetGlossaryRequest request, CancellationToken cancellationToken)
Gets a glossary. Returns NOT_FOUND, if the glossary doesn't exist.
Parameters | |
---|---|
Name | Description |
request | GetGlossaryRequest The request object containing all of the parameters for the API call. |
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
TaskGlossary | A Task containing the RPC response. |
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
GetGlossaryRequest request = new GetGlossaryRequest
{
GlossaryName = GlossaryName.FromProjectLocationGlossary("[PROJECT]", "[LOCATION]", "[GLOSSARY]"),
};
// Make the request
Glossary response = await translationServiceClient.GetGlossaryAsync(request);
GetGlossaryAsync(GlossaryName, CallSettings)
public virtual Task<Glossary> GetGlossaryAsync(GlossaryName name, CallSettings callSettings = null)
Gets a glossary. Returns NOT_FOUND, if the glossary doesn't exist.
Parameters | |
---|---|
Name | Description |
name | GlossaryName Required. The name of the glossary to retrieve. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
TaskGlossary | A Task containing the RPC response. |
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
GlossaryName name = GlossaryName.FromProjectLocationGlossary("[PROJECT]", "[LOCATION]", "[GLOSSARY]");
// Make the request
Glossary response = await translationServiceClient.GetGlossaryAsync(name);
GetGlossaryAsync(GlossaryName, CancellationToken)
public virtual Task<Glossary> GetGlossaryAsync(GlossaryName name, CancellationToken cancellationToken)
Gets a glossary. Returns NOT_FOUND, if the glossary doesn't exist.
Parameters | |
---|---|
Name | Description |
name | GlossaryName Required. The name of the glossary to retrieve. |
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
TaskGlossary | A Task containing the RPC response. |
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
GlossaryName name = GlossaryName.FromProjectLocationGlossary("[PROJECT]", "[LOCATION]", "[GLOSSARY]");
// Make the request
Glossary response = await translationServiceClient.GetGlossaryAsync(name);
GetGlossaryAsync(string, CallSettings)
public virtual Task<Glossary> GetGlossaryAsync(string name, CallSettings callSettings = null)
Gets a glossary. Returns NOT_FOUND, if the glossary doesn't exist.
Parameters | |
---|---|
Name | Description |
name | string Required. The name of the glossary to retrieve. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
TaskGlossary | A Task containing the RPC response. |
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/glossaries/[GLOSSARY]";
// Make the request
Glossary response = await translationServiceClient.GetGlossaryAsync(name);
GetGlossaryAsync(string, CancellationToken)
public virtual Task<Glossary> GetGlossaryAsync(string name, CancellationToken cancellationToken)
Gets a glossary. Returns NOT_FOUND, if the glossary doesn't exist.
Parameters | |
---|---|
Name | Description |
name | string Required. The name of the glossary to retrieve. |
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
TaskGlossary | A Task containing the RPC response. |
// 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 | |
---|---|
Name | Description |
parent | LocationName Required. Project or location to make a call. Must refer to a caller's project. Format: For global calls, use Non-global location is required for AutoML models. Only models within the same region (have same location-id) can be used, otherwise an INVALID_ARGUMENT (400) error is returned. |
model | string Optional. Get supported languages of this model. The format depends on model type:
Returns languages supported by the specified model. If missing, we get supported languages of Google general NMT model. |
displayLanguageCode | string Optional. The language to use to return localized, human readable names of supported languages. If missing, then display names are not returned in a response. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
SupportedLanguages | The RPC response. |
// Create client
TranslationServiceClient translationServiceClient = TranslationServiceClient.Create();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
string model = "";
string displayLanguageCode = "";
// Make the request
SupportedLanguages response = translationServiceClient.GetSupportedLanguages(parent, model, displayLanguageCode);
GetSupportedLanguages(GetSupportedLanguagesRequest, CallSettings)
public virtual SupportedLanguages GetSupportedLanguages(GetSupportedLanguagesRequest request, CallSettings callSettings = null)
Returns a list of supported languages for translation.
Parameters | |
---|---|
Name | Description |
request | GetSupportedLanguagesRequest The request object containing all of the parameters for the API call. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
SupportedLanguages | The RPC response. |
// Create client
TranslationServiceClient translationServiceClient = TranslationServiceClient.Create();
// Initialize request argument(s)
GetSupportedLanguagesRequest request = new GetSupportedLanguagesRequest
{
DisplayLanguageCode = "",
Model = "",
ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
};
// Make the request
SupportedLanguages response = translationServiceClient.GetSupportedLanguages(request);
GetSupportedLanguages(string, string, string, CallSettings)
public virtual SupportedLanguages GetSupportedLanguages(string parent, string model, string displayLanguageCode, CallSettings callSettings = null)
Returns a list of supported languages for translation.
Parameters | |
---|---|
Name | Description |
parent | string Required. Project or location to make a call. Must refer to a caller's project. Format: For global calls, use Non-global location is required for AutoML models. Only models within the same region (have same location-id) can be used, otherwise an INVALID_ARGUMENT (400) error is returned. |
model | string Optional. Get supported languages of this model. The format depends on model type:
Returns languages supported by the specified model. If missing, we get supported languages of Google general NMT model. |
displayLanguageCode | string Optional. The language to use to return localized, human readable names of supported languages. If missing, then display names are not returned in a response. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
SupportedLanguages | The RPC response. |
// Create client
TranslationServiceClient translationServiceClient = TranslationServiceClient.Create();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]";
string model = "";
string displayLanguageCode = "";
// Make the request
SupportedLanguages response = translationServiceClient.GetSupportedLanguages(parent, model, displayLanguageCode);
GetSupportedLanguagesAsync(LocationName, string, string, CallSettings)
public virtual Task<SupportedLanguages> GetSupportedLanguagesAsync(LocationName parent, string model, string displayLanguageCode, CallSettings callSettings = null)
Returns a list of supported languages for translation.
Parameters | |
---|---|
Name | Description |
parent | LocationName Required. Project or location to make a call. Must refer to a caller's project. Format: For global calls, use Non-global location is required for AutoML models. Only models within the same region (have same location-id) can be used, otherwise an INVALID_ARGUMENT (400) error is returned. |
model | string Optional. Get supported languages of this model. The format depends on model type:
Returns languages supported by the specified model. If missing, we get supported languages of Google general NMT model. |
displayLanguageCode | string Optional. The language to use to return localized, human readable names of supported languages. If missing, then display names are not returned in a response. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
TaskSupportedLanguages | A Task containing the RPC response. |
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
string model = "";
string displayLanguageCode = "";
// Make the request
SupportedLanguages response = await translationServiceClient.GetSupportedLanguagesAsync(parent, model, displayLanguageCode);
GetSupportedLanguagesAsync(LocationName, string, string, CancellationToken)
public virtual Task<SupportedLanguages> GetSupportedLanguagesAsync(LocationName parent, string model, string displayLanguageCode, CancellationToken cancellationToken)
Returns a list of supported languages for translation.
Parameters | |
---|---|
Name | Description |
parent | LocationName Required. Project or location to make a call. Must refer to a caller's project. Format: For global calls, use Non-global location is required for AutoML models. Only models within the same region (have same location-id) can be used, otherwise an INVALID_ARGUMENT (400) error is returned. |
model | string Optional. Get supported languages of this model. The format depends on model type:
Returns languages supported by the specified model. If missing, we get supported languages of Google general NMT model. |
displayLanguageCode | string Optional. The language to use to return localized, human readable names of supported languages. If missing, then display names are not returned in a response. |
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
TaskSupportedLanguages | A Task containing the RPC response. |
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
string model = "";
string displayLanguageCode = "";
// Make the request
SupportedLanguages response = await translationServiceClient.GetSupportedLanguagesAsync(parent, model, displayLanguageCode);
GetSupportedLanguagesAsync(GetSupportedLanguagesRequest, CallSettings)
public virtual Task<SupportedLanguages> GetSupportedLanguagesAsync(GetSupportedLanguagesRequest request, CallSettings callSettings = null)
Returns a list of supported languages for translation.
Parameters | |
---|---|
Name | Description |
request | GetSupportedLanguagesRequest The request object containing all of the parameters for the API call. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
TaskSupportedLanguages | A Task containing the RPC response. |
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
GetSupportedLanguagesRequest request = new GetSupportedLanguagesRequest
{
DisplayLanguageCode = "",
Model = "",
ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
};
// Make the request
SupportedLanguages response = await translationServiceClient.GetSupportedLanguagesAsync(request);
GetSupportedLanguagesAsync(GetSupportedLanguagesRequest, CancellationToken)
public virtual Task<SupportedLanguages> GetSupportedLanguagesAsync(GetSupportedLanguagesRequest request, CancellationToken cancellationToken)
Returns a list of supported languages for translation.
Parameters | |
---|---|
Name | Description |
request | GetSupportedLanguagesRequest The request object containing all of the parameters for the API call. |
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
TaskSupportedLanguages | A Task containing the RPC response. |
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
GetSupportedLanguagesRequest request = new GetSupportedLanguagesRequest
{
DisplayLanguageCode = "",
Model = "",
ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
};
// Make the request
SupportedLanguages response = await translationServiceClient.GetSupportedLanguagesAsync(request);
GetSupportedLanguagesAsync(string, string, string, CallSettings)
public virtual Task<SupportedLanguages> GetSupportedLanguagesAsync(string parent, string model, string displayLanguageCode, CallSettings callSettings = null)
Returns a list of supported languages for translation.
Parameters | |
---|---|
Name | Description |
parent | string Required. Project or location to make a call. Must refer to a caller's project. Format: For global calls, use Non-global location is required for AutoML models. Only models within the same region (have same location-id) can be used, otherwise an INVALID_ARGUMENT (400) error is returned. |
model | string Optional. Get supported languages of this model. The format depends on model type:
Returns languages supported by the specified model. If missing, we get supported languages of Google general NMT model. |
displayLanguageCode | string Optional. The language to use to return localized, human readable names of supported languages. If missing, then display names are not returned in a response. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
TaskSupportedLanguages | A Task containing the RPC response. |
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]";
string model = "";
string displayLanguageCode = "";
// Make the request
SupportedLanguages response = await translationServiceClient.GetSupportedLanguagesAsync(parent, model, displayLanguageCode);
GetSupportedLanguagesAsync(string, string, string, CancellationToken)
public virtual Task<SupportedLanguages> GetSupportedLanguagesAsync(string parent, string model, string displayLanguageCode, CancellationToken cancellationToken)
Returns a list of supported languages for translation.
Parameters | |
---|---|
Name | Description |
parent | string Required. Project or location to make a call. Must refer to a caller's project. Format: For global calls, use Non-global location is required for AutoML models. Only models within the same region (have same location-id) can be used, otherwise an INVALID_ARGUMENT (400) error is returned. |
model | string Optional. Get supported languages of this model. The format depends on model type:
Returns languages supported by the specified model. If missing, we get supported languages of Google general NMT model. |
displayLanguageCode | string Optional. The language to use to return localized, human readable names of supported languages. If missing, then display names are not returned in a response. |
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
TaskSupportedLanguages | A Task containing the RPC response. |
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]";
string model = "";
string displayLanguageCode = "";
// Make the request
SupportedLanguages response = await translationServiceClient.GetSupportedLanguagesAsync(parent, model, displayLanguageCode);
ImportAdaptiveMtFile(AdaptiveMtDatasetName, CallSettings)
public virtual ImportAdaptiveMtFileResponse ImportAdaptiveMtFile(AdaptiveMtDatasetName parent, CallSettings callSettings = null)
Imports an AdaptiveMtFile and adds all of its sentences into the AdaptiveMtDataset.
Parameters | |
---|---|
Name | Description |
parent | AdaptiveMtDatasetName Required. The resource name of the file, in form of
|
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
ImportAdaptiveMtFileResponse | The RPC response. |
// Create client
TranslationServiceClient translationServiceClient = TranslationServiceClient.Create();
// Initialize request argument(s)
AdaptiveMtDatasetName parent = AdaptiveMtDatasetName.FromProjectLocationDataset("[PROJECT]", "[LOCATION]", "[DATASET]");
// Make the request
ImportAdaptiveMtFileResponse response = translationServiceClient.ImportAdaptiveMtFile(parent);
ImportAdaptiveMtFile(ImportAdaptiveMtFileRequest, CallSettings)
public virtual ImportAdaptiveMtFileResponse ImportAdaptiveMtFile(ImportAdaptiveMtFileRequest request, CallSettings callSettings = null)
Imports an AdaptiveMtFile and adds all of its sentences into the AdaptiveMtDataset.
Parameters | |
---|---|
Name | Description |
request | ImportAdaptiveMtFileRequest The request object containing all of the parameters for the API call. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
ImportAdaptiveMtFileResponse | The RPC response. |
// Create client
TranslationServiceClient translationServiceClient = TranslationServiceClient.Create();
// Initialize request argument(s)
ImportAdaptiveMtFileRequest request = new ImportAdaptiveMtFileRequest
{
ParentAsAdaptiveMtDatasetName = AdaptiveMtDatasetName.FromProjectLocationDataset("[PROJECT]", "[LOCATION]", "[DATASET]"),
FileInputSource = new FileInputSource(),
};
// Make the request
ImportAdaptiveMtFileResponse response = translationServiceClient.ImportAdaptiveMtFile(request);
ImportAdaptiveMtFile(string, CallSettings)
public virtual ImportAdaptiveMtFileResponse ImportAdaptiveMtFile(string parent, CallSettings callSettings = null)
Imports an AdaptiveMtFile and adds all of its sentences into the AdaptiveMtDataset.
Parameters | |
---|---|
Name | Description |
parent | string Required. The resource name of the file, in form of
|
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
ImportAdaptiveMtFileResponse | The RPC response. |
// Create client
TranslationServiceClient translationServiceClient = TranslationServiceClient.Create();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]/adaptiveMtDatasets/[DATASET]";
// Make the request
ImportAdaptiveMtFileResponse response = translationServiceClient.ImportAdaptiveMtFile(parent);
ImportAdaptiveMtFileAsync(AdaptiveMtDatasetName, CallSettings)
public virtual Task<ImportAdaptiveMtFileResponse> ImportAdaptiveMtFileAsync(AdaptiveMtDatasetName parent, CallSettings callSettings = null)
Imports an AdaptiveMtFile and adds all of its sentences into the AdaptiveMtDataset.
Parameters | |
---|---|
Name | Description |
parent | AdaptiveMtDatasetName Required. The resource name of the file, in form of
|
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
TaskImportAdaptiveMtFileResponse | A Task containing the RPC response. |
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
AdaptiveMtDatasetName parent = AdaptiveMtDatasetName.FromProjectLocationDataset("[PROJECT]", "[LOCATION]", "[DATASET]");
// Make the request
ImportAdaptiveMtFileResponse response = await translationServiceClient.ImportAdaptiveMtFileAsync(parent);
ImportAdaptiveMtFileAsync(AdaptiveMtDatasetName, CancellationToken)
public virtual Task<ImportAdaptiveMtFileResponse> ImportAdaptiveMtFileAsync(AdaptiveMtDatasetName parent, CancellationToken cancellationToken)
Imports an AdaptiveMtFile and adds all of its sentences into the AdaptiveMtDataset.
Parameters | |
---|---|
Name | Description |
parent | AdaptiveMtDatasetName Required. The resource name of the file, in form of
|
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
TaskImportAdaptiveMtFileResponse | A Task containing the RPC response. |
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
AdaptiveMtDatasetName parent = AdaptiveMtDatasetName.FromProjectLocationDataset("[PROJECT]", "[LOCATION]", "[DATASET]");
// Make the request
ImportAdaptiveMtFileResponse response = await translationServiceClient.ImportAdaptiveMtFileAsync(parent);
ImportAdaptiveMtFileAsync(ImportAdaptiveMtFileRequest, CallSettings)
public virtual Task<ImportAdaptiveMtFileResponse> ImportAdaptiveMtFileAsync(ImportAdaptiveMtFileRequest request, CallSettings callSettings = null)
Imports an AdaptiveMtFile and adds all of its sentences into the AdaptiveMtDataset.
Parameters | |
---|---|
Name | Description |
request | ImportAdaptiveMtFileRequest The request object containing all of the parameters for the API call. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
TaskImportAdaptiveMtFileResponse | A Task containing the RPC response. |
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
ImportAdaptiveMtFileRequest request = new ImportAdaptiveMtFileRequest
{
ParentAsAdaptiveMtDatasetName = AdaptiveMtDatasetName.FromProjectLocationDataset("[PROJECT]", "[LOCATION]", "[DATASET]"),
FileInputSource = new FileInputSource(),
};
// Make the request
ImportAdaptiveMtFileResponse response = await translationServiceClient.ImportAdaptiveMtFileAsync(request);
ImportAdaptiveMtFileAsync(ImportAdaptiveMtFileRequest, CancellationToken)
public virtual Task<ImportAdaptiveMtFileResponse> ImportAdaptiveMtFileAsync(ImportAdaptiveMtFileRequest request, CancellationToken cancellationToken)
Imports an AdaptiveMtFile and adds all of its sentences into the AdaptiveMtDataset.
Parameters | |
---|---|
Name | Description |
request | ImportAdaptiveMtFileRequest The request object containing all of the parameters for the API call. |
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
TaskImportAdaptiveMtFileResponse | A Task containing the RPC response. |
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
ImportAdaptiveMtFileRequest request = new ImportAdaptiveMtFileRequest
{
ParentAsAdaptiveMtDatasetName = AdaptiveMtDatasetName.FromProjectLocationDataset("[PROJECT]", "[LOCATION]", "[DATASET]"),
FileInputSource = new FileInputSource(),
};
// Make the request
ImportAdaptiveMtFileResponse response = await translationServiceClient.ImportAdaptiveMtFileAsync(request);
ImportAdaptiveMtFileAsync(string, CallSettings)
public virtual Task<ImportAdaptiveMtFileResponse> ImportAdaptiveMtFileAsync(string parent, CallSettings callSettings = null)
Imports an AdaptiveMtFile and adds all of its sentences into the AdaptiveMtDataset.
Parameters | |
---|---|
Name | Description |
parent | string Required. The resource name of the file, in form of
|
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
TaskImportAdaptiveMtFileResponse | A Task containing the RPC response. |
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]/adaptiveMtDatasets/[DATASET]";
// Make the request
ImportAdaptiveMtFileResponse response = await translationServiceClient.ImportAdaptiveMtFileAsync(parent);
ImportAdaptiveMtFileAsync(string, CancellationToken)
public virtual Task<ImportAdaptiveMtFileResponse> ImportAdaptiveMtFileAsync(string parent, CancellationToken cancellationToken)
Imports an AdaptiveMtFile and adds all of its sentences into the AdaptiveMtDataset.
Parameters | |
---|---|
Name | Description |
parent | string Required. The resource name of the file, in form of
|
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
TaskImportAdaptiveMtFileResponse | A Task containing the RPC response. |
// 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 | |
---|---|
Name | Description |
parent | LocationName Required. The resource name of the project from which to list the Adaptive
MT datasets. |
pageToken | string The token returned from the previous request. A value of |
pageSize | int The size of page to request. The response will not be larger than this, but may be smaller. A value of
|
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
PagedEnumerableListAdaptiveMtDatasetsResponseAdaptiveMtDataset | A pageable sequence of AdaptiveMtDataset resources. |
// Create client
TranslationServiceClient translationServiceClient = TranslationServiceClient.Create();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
// Make the request
PagedEnumerable<ListAdaptiveMtDatasetsResponse, AdaptiveMtDataset> response = translationServiceClient.ListAdaptiveMtDatasets(parent);
// Iterate over all response items, lazily performing RPCs as required
foreach (AdaptiveMtDataset item in response)
{
// Do something with each item
Console.WriteLine(item);
}
// Or iterate over pages (of server-defined size), performing one RPC per page
foreach (ListAdaptiveMtDatasetsResponse page in response.AsRawResponses())
{
// Do something with each page of items
Console.WriteLine("A page of results:");
foreach (AdaptiveMtDataset item in page)
{
// Do something with each item
Console.WriteLine(item);
}
}
// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<AdaptiveMtDataset> singlePage = response.ReadPage(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (AdaptiveMtDataset item in singlePage)
{
// Do something with each item
Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;
ListAdaptiveMtDatasets(ListAdaptiveMtDatasetsRequest, CallSettings)
public virtual PagedEnumerable<ListAdaptiveMtDatasetsResponse, AdaptiveMtDataset> ListAdaptiveMtDatasets(ListAdaptiveMtDatasetsRequest request, CallSettings callSettings = null)
Lists all Adaptive MT datasets for which the caller has read permission.
Parameters | |
---|---|
Name | Description |
request | ListAdaptiveMtDatasetsRequest The request object containing all of the parameters for the API call. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
PagedEnumerableListAdaptiveMtDatasetsResponseAdaptiveMtDataset | A pageable sequence of AdaptiveMtDataset resources. |
// Create client
TranslationServiceClient translationServiceClient = TranslationServiceClient.Create();
// Initialize request argument(s)
ListAdaptiveMtDatasetsRequest request = new ListAdaptiveMtDatasetsRequest
{
ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
Filter = "",
};
// Make the request
PagedEnumerable<ListAdaptiveMtDatasetsResponse, AdaptiveMtDataset> response = translationServiceClient.ListAdaptiveMtDatasets(request);
// Iterate over all response items, lazily performing RPCs as required
foreach (AdaptiveMtDataset item in response)
{
// Do something with each item
Console.WriteLine(item);
}
// Or iterate over pages (of server-defined size), performing one RPC per page
foreach (ListAdaptiveMtDatasetsResponse page in response.AsRawResponses())
{
// Do something with each page of items
Console.WriteLine("A page of results:");
foreach (AdaptiveMtDataset item in page)
{
// Do something with each item
Console.WriteLine(item);
}
}
// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<AdaptiveMtDataset> singlePage = response.ReadPage(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (AdaptiveMtDataset item in singlePage)
{
// Do something with each item
Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;
ListAdaptiveMtDatasets(string, string, int?, CallSettings)
public virtual PagedEnumerable<ListAdaptiveMtDatasetsResponse, AdaptiveMtDataset> ListAdaptiveMtDatasets(string parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)
Lists all Adaptive MT datasets for which the caller has read permission.
Parameters | |
---|---|
Name | Description |
parent | string Required. The resource name of the project from which to list the Adaptive
MT datasets. |
pageToken | string The token returned from the previous request. A value of |
pageSize | int The size of page to request. The response will not be larger than this, but may be smaller. A value of
|
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
PagedEnumerableListAdaptiveMtDatasetsResponseAdaptiveMtDataset | A pageable sequence of AdaptiveMtDataset resources. |
// Create client
TranslationServiceClient translationServiceClient = TranslationServiceClient.Create();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]";
// Make the request
PagedEnumerable<ListAdaptiveMtDatasetsResponse, AdaptiveMtDataset> response = translationServiceClient.ListAdaptiveMtDatasets(parent);
// Iterate over all response items, lazily performing RPCs as required
foreach (AdaptiveMtDataset item in response)
{
// Do something with each item
Console.WriteLine(item);
}
// Or iterate over pages (of server-defined size), performing one RPC per page
foreach (ListAdaptiveMtDatasetsResponse page in response.AsRawResponses())
{
// Do something with each page of items
Console.WriteLine("A page of results:");
foreach (AdaptiveMtDataset item in page)
{
// Do something with each item
Console.WriteLine(item);
}
}
// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<AdaptiveMtDataset> singlePage = response.ReadPage(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (AdaptiveMtDataset item in singlePage)
{
// Do something with each item
Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;
ListAdaptiveMtDatasetsAsync(LocationName, string, int?, CallSettings)
public virtual PagedAsyncEnumerable<ListAdaptiveMtDatasetsResponse, AdaptiveMtDataset> ListAdaptiveMtDatasetsAsync(LocationName parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)
Lists all Adaptive MT datasets for which the caller has read permission.
Parameters | |
---|---|
Name | Description |
parent | LocationName Required. The resource name of the project from which to list the Adaptive
MT datasets. |
pageToken | string The token returned from the previous request. A value of |
pageSize | int The size of page to request. The response will not be larger than this, but may be smaller. A value of
|
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
PagedAsyncEnumerableListAdaptiveMtDatasetsResponseAdaptiveMtDataset | A pageable asynchronous sequence of AdaptiveMtDataset resources. |
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
// Make the request
PagedAsyncEnumerable<ListAdaptiveMtDatasetsResponse, AdaptiveMtDataset> response = translationServiceClient.ListAdaptiveMtDatasetsAsync(parent);
// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((AdaptiveMtDataset item) =>
{
// Do something with each item
Console.WriteLine(item);
});
// Or iterate over pages (of server-defined size), performing one RPC per page
await response.AsRawResponses().ForEachAsync((ListAdaptiveMtDatasetsResponse page) =>
{
// Do something with each page of items
Console.WriteLine("A page of results:");
foreach (AdaptiveMtDataset item in page)
{
// Do something with each item
Console.WriteLine(item);
}
});
// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<AdaptiveMtDataset> singlePage = await response.ReadPageAsync(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (AdaptiveMtDataset item in singlePage)
{
// Do something with each item
Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;
ListAdaptiveMtDatasetsAsync(ListAdaptiveMtDatasetsRequest, CallSettings)
public virtual PagedAsyncEnumerable<ListAdaptiveMtDatasetsResponse, AdaptiveMtDataset> ListAdaptiveMtDatasetsAsync(ListAdaptiveMtDatasetsRequest request, CallSettings callSettings = null)
Lists all Adaptive MT datasets for which the caller has read permission.
Parameters | |
---|---|
Name | Description |
request | ListAdaptiveMtDatasetsRequest The request object containing all of the parameters for the API call. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
PagedAsyncEnumerableListAdaptiveMtDatasetsResponseAdaptiveMtDataset | A pageable asynchronous sequence of AdaptiveMtDataset resources. |
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
ListAdaptiveMtDatasetsRequest request = new ListAdaptiveMtDatasetsRequest
{
ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
Filter = "",
};
// Make the request
PagedAsyncEnumerable<ListAdaptiveMtDatasetsResponse, AdaptiveMtDataset> response = translationServiceClient.ListAdaptiveMtDatasetsAsync(request);
// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((AdaptiveMtDataset item) =>
{
// Do something with each item
Console.WriteLine(item);
});
// Or iterate over pages (of server-defined size), performing one RPC per page
await response.AsRawResponses().ForEachAsync((ListAdaptiveMtDatasetsResponse page) =>
{
// Do something with each page of items
Console.WriteLine("A page of results:");
foreach (AdaptiveMtDataset item in page)
{
// Do something with each item
Console.WriteLine(item);
}
});
// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<AdaptiveMtDataset> singlePage = await response.ReadPageAsync(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (AdaptiveMtDataset item in singlePage)
{
// Do something with each item
Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;
ListAdaptiveMtDatasetsAsync(string, string, int?, CallSettings)
public virtual PagedAsyncEnumerable<ListAdaptiveMtDatasetsResponse, AdaptiveMtDataset> ListAdaptiveMtDatasetsAsync(string parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)
Lists all Adaptive MT datasets for which the caller has read permission.
Parameters | |
---|---|
Name | Description |
parent | string Required. The resource name of the project from which to list the Adaptive
MT datasets. |
pageToken | string The token returned from the previous request. A value of |
pageSize | int The size of page to request. The response will not be larger than this, but may be smaller. A value of
|
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
PagedAsyncEnumerableListAdaptiveMtDatasetsResponseAdaptiveMtDataset | A pageable asynchronous sequence of AdaptiveMtDataset resources. |
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]";
// Make the request
PagedAsyncEnumerable<ListAdaptiveMtDatasetsResponse, AdaptiveMtDataset> response = translationServiceClient.ListAdaptiveMtDatasetsAsync(parent);
// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((AdaptiveMtDataset item) =>
{
// Do something with each item
Console.WriteLine(item);
});
// Or iterate over pages (of server-defined size), performing one RPC per page
await response.AsRawResponses().ForEachAsync((ListAdaptiveMtDatasetsResponse page) =>
{
// Do something with each page of items
Console.WriteLine("A page of results:");
foreach (AdaptiveMtDataset item in page)
{
// Do something with each item
Console.WriteLine(item);
}
});
// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<AdaptiveMtDataset> singlePage = await response.ReadPageAsync(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (AdaptiveMtDataset item in singlePage)
{
// Do something with each item
Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;
ListAdaptiveMtFiles(AdaptiveMtDatasetName, string, int?, CallSettings)
public virtual PagedEnumerable<ListAdaptiveMtFilesResponse, AdaptiveMtFile> ListAdaptiveMtFiles(AdaptiveMtDatasetName parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)
Lists all AdaptiveMtFiles associated to an AdaptiveMtDataset.
Parameters | |
---|---|
Name | Description |
parent | AdaptiveMtDatasetName Required. The resource name of the project from which to list the Adaptive
MT files.
|
pageToken | string The token returned from the previous request. A value of |
pageSize | int The size of page to request. The response will not be larger than this, but may be smaller. A value of
|
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
PagedEnumerableListAdaptiveMtFilesResponseAdaptiveMtFile | A pageable sequence of AdaptiveMtFile resources. |
// Create client
TranslationServiceClient translationServiceClient = TranslationServiceClient.Create();
// Initialize request argument(s)
AdaptiveMtDatasetName parent = AdaptiveMtDatasetName.FromProjectLocationDataset("[PROJECT]", "[LOCATION]", "[DATASET]");
// Make the request
PagedEnumerable<ListAdaptiveMtFilesResponse, AdaptiveMtFile> response = translationServiceClient.ListAdaptiveMtFiles(parent);
// Iterate over all response items, lazily performing RPCs as required
foreach (AdaptiveMtFile item in response)
{
// Do something with each item
Console.WriteLine(item);
}
// Or iterate over pages (of server-defined size), performing one RPC per page
foreach (ListAdaptiveMtFilesResponse page in response.AsRawResponses())
{
// Do something with each page of items
Console.WriteLine("A page of results:");
foreach (AdaptiveMtFile item in page)
{
// Do something with each item
Console.WriteLine(item);
}
}
// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<AdaptiveMtFile> singlePage = response.ReadPage(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (AdaptiveMtFile item in singlePage)
{
// Do something with each item
Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;
ListAdaptiveMtFiles(ListAdaptiveMtFilesRequest, CallSettings)
public virtual PagedEnumerable<ListAdaptiveMtFilesResponse, AdaptiveMtFile> ListAdaptiveMtFiles(ListAdaptiveMtFilesRequest request, CallSettings callSettings = null)
Lists all AdaptiveMtFiles associated to an AdaptiveMtDataset.
Parameters | |
---|---|
Name | Description |
request | ListAdaptiveMtFilesRequest The request object containing all of the parameters for the API call. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
PagedEnumerableListAdaptiveMtFilesResponseAdaptiveMtFile | A pageable sequence of AdaptiveMtFile resources. |
// Create client
TranslationServiceClient translationServiceClient = TranslationServiceClient.Create();
// Initialize request argument(s)
ListAdaptiveMtFilesRequest request = new ListAdaptiveMtFilesRequest
{
ParentAsAdaptiveMtDatasetName = AdaptiveMtDatasetName.FromProjectLocationDataset("[PROJECT]", "[LOCATION]", "[DATASET]"),
};
// Make the request
PagedEnumerable<ListAdaptiveMtFilesResponse, AdaptiveMtFile> response = translationServiceClient.ListAdaptiveMtFiles(request);
// Iterate over all response items, lazily performing RPCs as required
foreach (AdaptiveMtFile item in response)
{
// Do something with each item
Console.WriteLine(item);
}
// Or iterate over pages (of server-defined size), performing one RPC per page
foreach (ListAdaptiveMtFilesResponse page in response.AsRawResponses())
{
// Do something with each page of items
Console.WriteLine("A page of results:");
foreach (AdaptiveMtFile item in page)
{
// Do something with each item
Console.WriteLine(item);
}
}
// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<AdaptiveMtFile> singlePage = response.ReadPage(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (AdaptiveMtFile item in singlePage)
{
// Do something with each item
Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;
ListAdaptiveMtFiles(string, string, int?, CallSettings)
public virtual PagedEnumerable<ListAdaptiveMtFilesResponse, AdaptiveMtFile> ListAdaptiveMtFiles(string parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)
Lists all AdaptiveMtFiles associated to an AdaptiveMtDataset.
Parameters | |
---|---|
Name | Description |
parent | string Required. The resource name of the project from which to list the Adaptive
MT files.
|
pageToken | string The token returned from the previous request. A value of |
pageSize | int The size of page to request. The response will not be larger than this, but may be smaller. A value of
|
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
PagedEnumerableListAdaptiveMtFilesResponseAdaptiveMtFile | A pageable sequence of AdaptiveMtFile resources. |
// Create client
TranslationServiceClient translationServiceClient = TranslationServiceClient.Create();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]/adaptiveMtDatasets/[DATASET]";
// Make the request
PagedEnumerable<ListAdaptiveMtFilesResponse, AdaptiveMtFile> response = translationServiceClient.ListAdaptiveMtFiles(parent);
// Iterate over all response items, lazily performing RPCs as required
foreach (AdaptiveMtFile item in response)
{
// Do something with each item
Console.WriteLine(item);
}
// Or iterate over pages (of server-defined size), performing one RPC per page
foreach (ListAdaptiveMtFilesResponse page in response.AsRawResponses())
{
// Do something with each page of items
Console.WriteLine("A page of results:");
foreach (AdaptiveMtFile item in page)
{
// Do something with each item
Console.WriteLine(item);
}
}
// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<AdaptiveMtFile> singlePage = response.ReadPage(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (AdaptiveMtFile item in singlePage)
{
// Do something with each item
Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;
ListAdaptiveMtFilesAsync(AdaptiveMtDatasetName, string, int?, CallSettings)
public virtual PagedAsyncEnumerable<ListAdaptiveMtFilesResponse, AdaptiveMtFile> ListAdaptiveMtFilesAsync(AdaptiveMtDatasetName parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)
Lists all AdaptiveMtFiles associated to an AdaptiveMtDataset.
Parameters | |
---|---|
Name | Description |
parent | AdaptiveMtDatasetName Required. The resource name of the project from which to list the Adaptive
MT files.
|
pageToken | string The token returned from the previous request. A value of |
pageSize | int The size of page to request. The response will not be larger than this, but may be smaller. A value of
|
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
PagedAsyncEnumerableListAdaptiveMtFilesResponseAdaptiveMtFile | A pageable asynchronous sequence of AdaptiveMtFile resources. |
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
AdaptiveMtDatasetName parent = AdaptiveMtDatasetName.FromProjectLocationDataset("[PROJECT]", "[LOCATION]", "[DATASET]");
// Make the request
PagedAsyncEnumerable<ListAdaptiveMtFilesResponse, AdaptiveMtFile> response = translationServiceClient.ListAdaptiveMtFilesAsync(parent);
// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((AdaptiveMtFile item) =>
{
// Do something with each item
Console.WriteLine(item);
});
// Or iterate over pages (of server-defined size), performing one RPC per page
await response.AsRawResponses().ForEachAsync((ListAdaptiveMtFilesResponse page) =>
{
// Do something with each page of items
Console.WriteLine("A page of results:");
foreach (AdaptiveMtFile item in page)
{
// Do something with each item
Console.WriteLine(item);
}
});
// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<AdaptiveMtFile> singlePage = await response.ReadPageAsync(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (AdaptiveMtFile item in singlePage)
{
// Do something with each item
Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;
ListAdaptiveMtFilesAsync(ListAdaptiveMtFilesRequest, CallSettings)
public virtual PagedAsyncEnumerable<ListAdaptiveMtFilesResponse, AdaptiveMtFile> ListAdaptiveMtFilesAsync(ListAdaptiveMtFilesRequest request, CallSettings callSettings = null)
Lists all AdaptiveMtFiles associated to an AdaptiveMtDataset.
Parameters | |
---|---|
Name | Description |
request | ListAdaptiveMtFilesRequest The request object containing all of the parameters for the API call. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
PagedAsyncEnumerableListAdaptiveMtFilesResponseAdaptiveMtFile | A pageable asynchronous sequence of AdaptiveMtFile resources. |
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
ListAdaptiveMtFilesRequest request = new ListAdaptiveMtFilesRequest
{
ParentAsAdaptiveMtDatasetName = AdaptiveMtDatasetName.FromProjectLocationDataset("[PROJECT]", "[LOCATION]", "[DATASET]"),
};
// Make the request
PagedAsyncEnumerable<ListAdaptiveMtFilesResponse, AdaptiveMtFile> response = translationServiceClient.ListAdaptiveMtFilesAsync(request);
// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((AdaptiveMtFile item) =>
{
// Do something with each item
Console.WriteLine(item);
});
// Or iterate over pages (of server-defined size), performing one RPC per page
await response.AsRawResponses().ForEachAsync((ListAdaptiveMtFilesResponse page) =>
{
// Do something with each page of items
Console.WriteLine("A page of results:");
foreach (AdaptiveMtFile item in page)
{
// Do something with each item
Console.WriteLine(item);
}
});
// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<AdaptiveMtFile> singlePage = await response.ReadPageAsync(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (AdaptiveMtFile item in singlePage)
{
// Do something with each item
Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;
ListAdaptiveMtFilesAsync(string, string, int?, CallSettings)
public virtual PagedAsyncEnumerable<ListAdaptiveMtFilesResponse, AdaptiveMtFile> ListAdaptiveMtFilesAsync(string parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)
Lists all AdaptiveMtFiles associated to an AdaptiveMtDataset.
Parameters | |
---|---|
Name | Description |
parent | string Required. The resource name of the project from which to list the Adaptive
MT files.
|
pageToken | string The token returned from the previous request. A value of |
pageSize | int The size of page to request. The response will not be larger than this, but may be smaller. A value of
|
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
PagedAsyncEnumerableListAdaptiveMtFilesResponseAdaptiveMtFile | A pageable asynchronous sequence of AdaptiveMtFile resources. |
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]/adaptiveMtDatasets/[DATASET]";
// Make the request
PagedAsyncEnumerable<ListAdaptiveMtFilesResponse, AdaptiveMtFile> response = translationServiceClient.ListAdaptiveMtFilesAsync(parent);
// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((AdaptiveMtFile item) =>
{
// Do something with each item
Console.WriteLine(item);
});
// Or iterate over pages (of server-defined size), performing one RPC per page
await response.AsRawResponses().ForEachAsync((ListAdaptiveMtFilesResponse page) =>
{
// Do something with each page of items
Console.WriteLine("A page of results:");
foreach (AdaptiveMtFile item in page)
{
// Do something with each item
Console.WriteLine(item);
}
});
// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<AdaptiveMtFile> singlePage = await response.ReadPageAsync(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (AdaptiveMtFile item in singlePage)
{
// Do something with each item
Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;
ListAdaptiveMtSentences(AdaptiveMtFileName, string, int?, CallSettings)
public virtual PagedEnumerable<ListAdaptiveMtSentencesResponse, AdaptiveMtSentence> ListAdaptiveMtSentences(AdaptiveMtFileName parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)
Lists all AdaptiveMtSentences under a given file/dataset.
Parameters | |
---|---|
Name | Description |
parent | AdaptiveMtFileName Required. The resource name of the project from which to list the Adaptive
MT files. The following format lists all sentences under a file.
|
pageToken | string The token returned from the previous request. A value of |
pageSize | int The size of page to request. The response will not be larger than this, but may be smaller. A value of
|
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
PagedEnumerableListAdaptiveMtSentencesResponseAdaptiveMtSentence | A pageable sequence of AdaptiveMtSentence resources. |
// Create client
TranslationServiceClient translationServiceClient = TranslationServiceClient.Create();
// Initialize request argument(s)
AdaptiveMtFileName parent = AdaptiveMtFileName.FromProjectLocationDatasetFile("[PROJECT]", "[LOCATION]", "[DATASET]", "[FILE]");
// Make the request
PagedEnumerable<ListAdaptiveMtSentencesResponse, AdaptiveMtSentence> response = translationServiceClient.ListAdaptiveMtSentences(parent);
// Iterate over all response items, lazily performing RPCs as required
foreach (AdaptiveMtSentence item in response)
{
// Do something with each item
Console.WriteLine(item);
}
// Or iterate over pages (of server-defined size), performing one RPC per page
foreach (ListAdaptiveMtSentencesResponse page in response.AsRawResponses())
{
// Do something with each page of items
Console.WriteLine("A page of results:");
foreach (AdaptiveMtSentence item in page)
{
// Do something with each item
Console.WriteLine(item);
}
}
// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<AdaptiveMtSentence> singlePage = response.ReadPage(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (AdaptiveMtSentence item in singlePage)
{
// Do something with each item
Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;
ListAdaptiveMtSentences(ListAdaptiveMtSentencesRequest, CallSettings)
public virtual PagedEnumerable<ListAdaptiveMtSentencesResponse, AdaptiveMtSentence> ListAdaptiveMtSentences(ListAdaptiveMtSentencesRequest request, CallSettings callSettings = null)
Lists all AdaptiveMtSentences under a given file/dataset.
Parameters | |
---|---|
Name | Description |
request | ListAdaptiveMtSentencesRequest The request object containing all of the parameters for the API call. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
PagedEnumerableListAdaptiveMtSentencesResponseAdaptiveMtSentence | A pageable sequence of AdaptiveMtSentence resources. |
// Create client
TranslationServiceClient translationServiceClient = TranslationServiceClient.Create();
// Initialize request argument(s)
ListAdaptiveMtSentencesRequest request = new ListAdaptiveMtSentencesRequest
{
ParentAsAdaptiveMtFileName = AdaptiveMtFileName.FromProjectLocationDatasetFile("[PROJECT]", "[LOCATION]", "[DATASET]", "[FILE]"),
};
// Make the request
PagedEnumerable<ListAdaptiveMtSentencesResponse, AdaptiveMtSentence> response = translationServiceClient.ListAdaptiveMtSentences(request);
// Iterate over all response items, lazily performing RPCs as required
foreach (AdaptiveMtSentence item in response)
{
// Do something with each item
Console.WriteLine(item);
}
// Or iterate over pages (of server-defined size), performing one RPC per page
foreach (ListAdaptiveMtSentencesResponse page in response.AsRawResponses())
{
// Do something with each page of items
Console.WriteLine("A page of results:");
foreach (AdaptiveMtSentence item in page)
{
// Do something with each item
Console.WriteLine(item);
}
}
// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<AdaptiveMtSentence> singlePage = response.ReadPage(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (AdaptiveMtSentence item in singlePage)
{
// Do something with each item
Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;
ListAdaptiveMtSentences(string, string, int?, CallSettings)
public virtual PagedEnumerable<ListAdaptiveMtSentencesResponse, AdaptiveMtSentence> ListAdaptiveMtSentences(string parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)
Lists all AdaptiveMtSentences under a given file/dataset.
Parameters | |
---|---|
Name | Description |
parent | string Required. The resource name of the project from which to list the Adaptive
MT files. The following format lists all sentences under a file.
|
pageToken | string The token returned from the previous request. A value of |
pageSize | int The size of page to request. The response will not be larger than this, but may be smaller. A value of
|
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
PagedEnumerableListAdaptiveMtSentencesResponseAdaptiveMtSentence | A pageable sequence of AdaptiveMtSentence resources. |
// Create client
TranslationServiceClient translationServiceClient = TranslationServiceClient.Create();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]/adaptiveMtDatasets/[DATASET]/adaptiveMtFiles/[FILE]";
// Make the request
PagedEnumerable<ListAdaptiveMtSentencesResponse, AdaptiveMtSentence> response = translationServiceClient.ListAdaptiveMtSentences(parent);
// Iterate over all response items, lazily performing RPCs as required
foreach (AdaptiveMtSentence item in response)
{
// Do something with each item
Console.WriteLine(item);
}
// Or iterate over pages (of server-defined size), performing one RPC per page
foreach (ListAdaptiveMtSentencesResponse page in response.AsRawResponses())
{
// Do something with each page of items
Console.WriteLine("A page of results:");
foreach (AdaptiveMtSentence item in page)
{
// Do something with each item
Console.WriteLine(item);
}
}
// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<AdaptiveMtSentence> singlePage = response.ReadPage(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (AdaptiveMtSentence item in singlePage)
{
// Do something with each item
Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;
ListAdaptiveMtSentencesAsync(AdaptiveMtFileName, string, int?, CallSettings)
public virtual PagedAsyncEnumerable<ListAdaptiveMtSentencesResponse, AdaptiveMtSentence> ListAdaptiveMtSentencesAsync(AdaptiveMtFileName parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)
Lists all AdaptiveMtSentences under a given file/dataset.
Parameters | |
---|---|
Name | Description |
parent | AdaptiveMtFileName Required. The resource name of the project from which to list the Adaptive
MT files. The following format lists all sentences under a file.
|
pageToken | string The token returned from the previous request. A value of |
pageSize | int The size of page to request. The response will not be larger than this, but may be smaller. A value of
|
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
PagedAsyncEnumerableListAdaptiveMtSentencesResponseAdaptiveMtSentence | A pageable asynchronous sequence of AdaptiveMtSentence resources. |
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
AdaptiveMtFileName parent = AdaptiveMtFileName.FromProjectLocationDatasetFile("[PROJECT]", "[LOCATION]", "[DATASET]", "[FILE]");
// Make the request
PagedAsyncEnumerable<ListAdaptiveMtSentencesResponse, AdaptiveMtSentence> response = translationServiceClient.ListAdaptiveMtSentencesAsync(parent);
// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((AdaptiveMtSentence item) =>
{
// Do something with each item
Console.WriteLine(item);
});
// Or iterate over pages (of server-defined size), performing one RPC per page
await response.AsRawResponses().ForEachAsync((ListAdaptiveMtSentencesResponse page) =>
{
// Do something with each page of items
Console.WriteLine("A page of results:");
foreach (AdaptiveMtSentence item in page)
{
// Do something with each item
Console.WriteLine(item);
}
});
// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<AdaptiveMtSentence> singlePage = await response.ReadPageAsync(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (AdaptiveMtSentence item in singlePage)
{
// Do something with each item
Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;
ListAdaptiveMtSentencesAsync(ListAdaptiveMtSentencesRequest, CallSettings)
public virtual PagedAsyncEnumerable<ListAdaptiveMtSentencesResponse, AdaptiveMtSentence> ListAdaptiveMtSentencesAsync(ListAdaptiveMtSentencesRequest request, CallSettings callSettings = null)
Lists all AdaptiveMtSentences under a given file/dataset.
Parameters | |
---|---|
Name | Description |
request | ListAdaptiveMtSentencesRequest The request object containing all of the parameters for the API call. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
PagedAsyncEnumerableListAdaptiveMtSentencesResponseAdaptiveMtSentence | A pageable asynchronous sequence of AdaptiveMtSentence resources. |
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
ListAdaptiveMtSentencesRequest request = new ListAdaptiveMtSentencesRequest
{
ParentAsAdaptiveMtFileName = AdaptiveMtFileName.FromProjectLocationDatasetFile("[PROJECT]", "[LOCATION]", "[DATASET]", "[FILE]"),
};
// Make the request
PagedAsyncEnumerable<ListAdaptiveMtSentencesResponse, AdaptiveMtSentence> response = translationServiceClient.ListAdaptiveMtSentencesAsync(request);
// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((AdaptiveMtSentence item) =>
{
// Do something with each item
Console.WriteLine(item);
});
// Or iterate over pages (of server-defined size), performing one RPC per page
await response.AsRawResponses().ForEachAsync((ListAdaptiveMtSentencesResponse page) =>
{
// Do something with each page of items
Console.WriteLine("A page of results:");
foreach (AdaptiveMtSentence item in page)
{
// Do something with each item
Console.WriteLine(item);
}
});
// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<AdaptiveMtSentence> singlePage = await response.ReadPageAsync(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (AdaptiveMtSentence item in singlePage)
{
// Do something with each item
Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;
ListAdaptiveMtSentencesAsync(string, string, int?, CallSettings)
public virtual PagedAsyncEnumerable<ListAdaptiveMtSentencesResponse, AdaptiveMtSentence> ListAdaptiveMtSentencesAsync(string parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)
Lists all AdaptiveMtSentences under a given file/dataset.
Parameters | |
---|---|
Name | Description |
parent | string Required. The resource name of the project from which to list the Adaptive
MT files. The following format lists all sentences under a file.
|
pageToken | string The token returned from the previous request. A value of |
pageSize | int The size of page to request. The response will not be larger than this, but may be smaller. A value of
|
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
PagedAsyncEnumerableListAdaptiveMtSentencesResponseAdaptiveMtSentence | A pageable asynchronous sequence of AdaptiveMtSentence resources. |
// 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 | |
---|---|
Name | Description |
parent | LocationName Required. The name of the project from which to list all of the glossaries. |
pageToken | string The token returned from the previous request. A value of |
pageSize | int The size of page to request. The response will not be larger than this, but may be smaller. A value of
|
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
PagedEnumerableListGlossariesResponseGlossary | A pageable sequence of Glossary resources. |
// Create client
TranslationServiceClient translationServiceClient = TranslationServiceClient.Create();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
// Make the request
PagedEnumerable<ListGlossariesResponse, Glossary> response = translationServiceClient.ListGlossaries(parent);
// Iterate over all response items, lazily performing RPCs as required
foreach (Glossary item in response)
{
// Do something with each item
Console.WriteLine(item);
}
// Or iterate over pages (of server-defined size), performing one RPC per page
foreach (ListGlossariesResponse page in response.AsRawResponses())
{
// Do something with each page of items
Console.WriteLine("A page of results:");
foreach (Glossary item in page)
{
// Do something with each item
Console.WriteLine(item);
}
}
// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<Glossary> singlePage = response.ReadPage(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (Glossary item in singlePage)
{
// Do something with each item
Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;
ListGlossaries(ListGlossariesRequest, CallSettings)
public virtual PagedEnumerable<ListGlossariesResponse, Glossary> ListGlossaries(ListGlossariesRequest request, CallSettings callSettings = null)
Lists glossaries in a project. Returns NOT_FOUND, if the project doesn't exist.
Parameters | |
---|---|
Name | Description |
request | ListGlossariesRequest The request object containing all of the parameters for the API call. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
PagedEnumerableListGlossariesResponseGlossary | A pageable sequence of Glossary resources. |
// Create client
TranslationServiceClient translationServiceClient = TranslationServiceClient.Create();
// Initialize request argument(s)
ListGlossariesRequest request = new ListGlossariesRequest
{
ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
Filter = "",
};
// Make the request
PagedEnumerable<ListGlossariesResponse, Glossary> response = translationServiceClient.ListGlossaries(request);
// Iterate over all response items, lazily performing RPCs as required
foreach (Glossary item in response)
{
// Do something with each item
Console.WriteLine(item);
}
// Or iterate over pages (of server-defined size), performing one RPC per page
foreach (ListGlossariesResponse page in response.AsRawResponses())
{
// Do something with each page of items
Console.WriteLine("A page of results:");
foreach (Glossary item in page)
{
// Do something with each item
Console.WriteLine(item);
}
}
// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<Glossary> singlePage = response.ReadPage(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (Glossary item in singlePage)
{
// Do something with each item
Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;
ListGlossaries(string, string, int?, CallSettings)
public virtual PagedEnumerable<ListGlossariesResponse, Glossary> ListGlossaries(string parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)
Lists glossaries in a project. Returns NOT_FOUND, if the project doesn't exist.
Parameters | |
---|---|
Name | Description |
parent | string Required. The name of the project from which to list all of the glossaries. |
pageToken | string The token returned from the previous request. A value of |
pageSize | int The size of page to request. The response will not be larger than this, but may be smaller. A value of
|
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
PagedEnumerableListGlossariesResponseGlossary | A pageable sequence of Glossary resources. |
// Create client
TranslationServiceClient translationServiceClient = TranslationServiceClient.Create();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]";
// Make the request
PagedEnumerable<ListGlossariesResponse, Glossary> response = translationServiceClient.ListGlossaries(parent);
// Iterate over all response items, lazily performing RPCs as required
foreach (Glossary item in response)
{
// Do something with each item
Console.WriteLine(item);
}
// Or iterate over pages (of server-defined size), performing one RPC per page
foreach (ListGlossariesResponse page in response.AsRawResponses())
{
// Do something with each page of items
Console.WriteLine("A page of results:");
foreach (Glossary item in page)
{
// Do something with each item
Console.WriteLine(item);
}
}
// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<Glossary> singlePage = response.ReadPage(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (Glossary item in singlePage)
{
// Do something with each item
Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;
ListGlossariesAsync(LocationName, string, int?, CallSettings)
public virtual PagedAsyncEnumerable<ListGlossariesResponse, Glossary> ListGlossariesAsync(LocationName parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)
Lists glossaries in a project. Returns NOT_FOUND, if the project doesn't exist.
Parameters | |
---|---|
Name | Description |
parent | LocationName Required. The name of the project from which to list all of the glossaries. |
pageToken | string The token returned from the previous request. A value of |
pageSize | int The size of page to request. The response will not be larger than this, but may be smaller. A value of
|
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
PagedAsyncEnumerableListGlossariesResponseGlossary | A pageable asynchronous sequence of Glossary resources. |
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
// Make the request
PagedAsyncEnumerable<ListGlossariesResponse, Glossary> response = translationServiceClient.ListGlossariesAsync(parent);
// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((Glossary item) =>
{
// Do something with each item
Console.WriteLine(item);
});
// Or iterate over pages (of server-defined size), performing one RPC per page
await response.AsRawResponses().ForEachAsync((ListGlossariesResponse page) =>
{
// Do something with each page of items
Console.WriteLine("A page of results:");
foreach (Glossary item in page)
{
// Do something with each item
Console.WriteLine(item);
}
});
// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<Glossary> singlePage = await response.ReadPageAsync(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (Glossary item in singlePage)
{
// Do something with each item
Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;
ListGlossariesAsync(ListGlossariesRequest, CallSettings)
public virtual PagedAsyncEnumerable<ListGlossariesResponse, Glossary> ListGlossariesAsync(ListGlossariesRequest request, CallSettings callSettings = null)
Lists glossaries in a project. Returns NOT_FOUND, if the project doesn't exist.
Parameters | |
---|---|
Name | Description |
request | ListGlossariesRequest The request object containing all of the parameters for the API call. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
PagedAsyncEnumerableListGlossariesResponseGlossary | A pageable asynchronous sequence of Glossary resources. |
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
ListGlossariesRequest request = new ListGlossariesRequest
{
ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
Filter = "",
};
// Make the request
PagedAsyncEnumerable<ListGlossariesResponse, Glossary> response = translationServiceClient.ListGlossariesAsync(request);
// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((Glossary item) =>
{
// Do something with each item
Console.WriteLine(item);
});
// Or iterate over pages (of server-defined size), performing one RPC per page
await response.AsRawResponses().ForEachAsync((ListGlossariesResponse page) =>
{
// Do something with each page of items
Console.WriteLine("A page of results:");
foreach (Glossary item in page)
{
// Do something with each item
Console.WriteLine(item);
}
});
// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<Glossary> singlePage = await response.ReadPageAsync(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (Glossary item in singlePage)
{
// Do something with each item
Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;
ListGlossariesAsync(string, string, int?, CallSettings)
public virtual PagedAsyncEnumerable<ListGlossariesResponse, Glossary> ListGlossariesAsync(string parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)
Lists glossaries in a project. Returns NOT_FOUND, if the project doesn't exist.
Parameters | |
---|---|
Name | Description |
parent | string Required. The name of the project from which to list all of the glossaries. |
pageToken | string The token returned from the previous request. A value of |
pageSize | int The size of page to request. The response will not be larger than this, but may be smaller. A value of
|
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
PagedAsyncEnumerableListGlossariesResponseGlossary | A pageable asynchronous sequence of Glossary resources. |
// 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 | |
---|---|
Name | Description |
operationName | string The name of a previously invoked operation. Must not be |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
OperationBatchTranslateDocumentResponseBatchTranslateDocumentMetadata | The result of polling the operation. |
PollOnceBatchTranslateDocumentAsync(string, CallSettings)
public virtual Task<Operation<BatchTranslateDocumentResponse, BatchTranslateDocumentMetadata>> PollOnceBatchTranslateDocumentAsync(string operationName, CallSettings callSettings = null)
Asynchronously poll an operation once, using an operationName
from a previous invocation of
BatchTranslateDocument
.
Parameters | |
---|---|
Name | Description |
operationName | string The name of a previously invoked operation. Must not be |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
TaskOperationBatchTranslateDocumentResponseBatchTranslateDocumentMetadata | A task representing the result of polling the operation. |
PollOnceBatchTranslateText(string, CallSettings)
public virtual Operation<BatchTranslateResponse, BatchTranslateMetadata> PollOnceBatchTranslateText(string operationName, CallSettings callSettings = null)
Poll an operation once, using an operationName
from a previous invocation of BatchTranslateText
.
Parameters | |
---|---|
Name | Description |
operationName | string The name of a previously invoked operation. Must not be |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
OperationBatchTranslateResponseBatchTranslateMetadata | The result of polling the operation. |
PollOnceBatchTranslateTextAsync(string, CallSettings)
public virtual Task<Operation<BatchTranslateResponse, BatchTranslateMetadata>> PollOnceBatchTranslateTextAsync(string operationName, CallSettings callSettings = null)
Asynchronously poll an operation once, using an operationName
from a previous invocation of
BatchTranslateText
.
Parameters | |
---|---|
Name | Description |
operationName | string The name of a previously invoked operation. Must not be |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
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 | |
---|---|
Name | Description |
operationName | string The name of a previously invoked operation. Must not be |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
OperationGlossaryCreateGlossaryMetadata | The result of polling the operation. |
PollOnceCreateGlossaryAsync(string, CallSettings)
public virtual Task<Operation<Glossary, CreateGlossaryMetadata>> PollOnceCreateGlossaryAsync(string operationName, CallSettings callSettings = null)
Asynchronously poll an operation once, using an operationName
from a previous invocation of
CreateGlossary
.
Parameters | |
---|---|
Name | Description |
operationName | string The name of a previously invoked operation. Must not be |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
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 | |
---|---|
Name | Description |
operationName | string The name of a previously invoked operation. Must not be |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
OperationDeleteGlossaryResponseDeleteGlossaryMetadata | The result of polling the operation. |
PollOnceDeleteGlossaryAsync(string, CallSettings)
public virtual Task<Operation<DeleteGlossaryResponse, DeleteGlossaryMetadata>> PollOnceDeleteGlossaryAsync(string operationName, CallSettings callSettings = null)
Asynchronously poll an operation once, using an operationName
from a previous invocation of
DeleteGlossary
.
Parameters | |
---|---|
Name | Description |
operationName | string The name of a previously invoked operation. Must not be |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
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 | |
---|---|
Type | Description |
Task | A task representing the asynchronous shutdown operation. |
After calling this method, further calls to Create() and CreateAsync(CancellationToken) will create new channels, which could in turn be shut down by another call to this method.
TranslateDocument(TranslateDocumentRequest, CallSettings)
public virtual TranslateDocumentResponse TranslateDocument(TranslateDocumentRequest request, CallSettings callSettings = null)
Translates documents in synchronous mode.
Parameters | |
---|---|
Name | Description |
request | TranslateDocumentRequest The request object containing all of the parameters for the API call. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
TranslateDocumentResponse | The RPC response. |
// Create client
TranslationServiceClient translationServiceClient = TranslationServiceClient.Create();
// Initialize request argument(s)
TranslateDocumentRequest request = new TranslateDocumentRequest
{
Parent = "",
SourceLanguageCode = "",
TargetLanguageCode = "",
DocumentInputConfig = new DocumentInputConfig(),
DocumentOutputConfig = new DocumentOutputConfig(),
Model = "",
GlossaryConfig = new TranslateTextGlossaryConfig(),
Labels = { { "", "" }, },
CustomizedAttribution = "",
IsTranslateNativePdfOnly = false,
EnableShadowRemovalNativePdf = false,
EnableRotationCorrection = false,
};
// Make the request
TranslateDocumentResponse response = translationServiceClient.TranslateDocument(request);
TranslateDocumentAsync(TranslateDocumentRequest, CallSettings)
public virtual Task<TranslateDocumentResponse> TranslateDocumentAsync(TranslateDocumentRequest request, CallSettings callSettings = null)
Translates documents in synchronous mode.
Parameters | |
---|---|
Name | Description |
request | TranslateDocumentRequest The request object containing all of the parameters for the API call. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
TaskTranslateDocumentResponse | A Task containing the RPC response. |
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
TranslateDocumentRequest request = new TranslateDocumentRequest
{
Parent = "",
SourceLanguageCode = "",
TargetLanguageCode = "",
DocumentInputConfig = new DocumentInputConfig(),
DocumentOutputConfig = new DocumentOutputConfig(),
Model = "",
GlossaryConfig = new TranslateTextGlossaryConfig(),
Labels = { { "", "" }, },
CustomizedAttribution = "",
IsTranslateNativePdfOnly = false,
EnableShadowRemovalNativePdf = false,
EnableRotationCorrection = false,
};
// Make the request
TranslateDocumentResponse response = await translationServiceClient.TranslateDocumentAsync(request);
TranslateDocumentAsync(TranslateDocumentRequest, CancellationToken)
public virtual Task<TranslateDocumentResponse> TranslateDocumentAsync(TranslateDocumentRequest request, CancellationToken cancellationToken)
Translates documents in synchronous mode.
Parameters | |
---|---|
Name | Description |
request | TranslateDocumentRequest The request object containing all of the parameters for the API call. |
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
TaskTranslateDocumentResponse | A Task containing the RPC response. |
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
TranslateDocumentRequest request = new TranslateDocumentRequest
{
Parent = "",
SourceLanguageCode = "",
TargetLanguageCode = "",
DocumentInputConfig = new DocumentInputConfig(),
DocumentOutputConfig = new DocumentOutputConfig(),
Model = "",
GlossaryConfig = new TranslateTextGlossaryConfig(),
Labels = { { "", "" }, },
CustomizedAttribution = "",
IsTranslateNativePdfOnly = false,
EnableShadowRemovalNativePdf = false,
EnableRotationCorrection = false,
};
// Make the request
TranslateDocumentResponse response = await translationServiceClient.TranslateDocumentAsync(request);
TranslateText(LocationName, string, IEnumerable<string>, CallSettings)
public virtual TranslateTextResponse TranslateText(LocationName parent, string targetLanguageCode, IEnumerable<string> contents, CallSettings callSettings = null)
Translates input text and returns translated text.
Parameters | |
---|---|
Name | Description |
parent | LocationName Required. Project or location to make a call. Must refer to a caller's project. Format: For global calls, use Non-global location is required for requests using AutoML models or custom glossaries. Models and glossaries must be within the same region (have same location-id), otherwise an INVALID_ARGUMENT (400) error is returned. |
targetLanguageCode | string Required. The ISO-639 language code to use for translation of the input text, set to one of the language codes listed in Language Support. |
contents | IEnumerablestring Required. The content of the input in string format. We recommend the total content be less than 30,000 codepoints. The max length of this field is 1024. Use BatchTranslateText for larger text. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
TranslateTextResponse | The RPC response. |
// Create client
TranslationServiceClient translationServiceClient = TranslationServiceClient.Create();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
string targetLanguageCode = "";
IEnumerable<string> contents = new string[] { "", };
// Make the request
TranslateTextResponse response = translationServiceClient.TranslateText(parent, targetLanguageCode, contents);
TranslateText(LocationName, string, string, string, string, IEnumerable<string>, CallSettings)
public virtual TranslateTextResponse TranslateText(LocationName parent, string model, string mimeType, string sourceLanguageCode, string targetLanguageCode, IEnumerable<string> contents, CallSettings callSettings = null)
Translates input text and returns translated text.
Parameters | |
---|---|
Name | Description |
parent | LocationName Required. Project or location to make a call. Must refer to a caller's project. Format: For global calls, use Non-global location is required for requests using AutoML models or custom glossaries. Models and glossaries must be within the same region (have same location-id), otherwise an INVALID_ARGUMENT (400) error is returned. |
model | string Optional. The The format depends on model type:
For global (non-regionalized) requests, use If not provided, the default Google model (NMT) will be used |
mimeType | string Optional. The format of the source text, for example, "text/html", "text/plain". If left blank, the MIME type defaults to "text/html". |
sourceLanguageCode | string Optional. The ISO-639 language code of the input text if known, for example, "en-US" or "sr-Latn". Supported language codes are listed in Language Support. If the source language isn't specified, the API attempts to identify the source language automatically and returns the source language within the response. |
targetLanguageCode | string Required. The ISO-639 language code to use for translation of the input text, set to one of the language codes listed in Language Support. |
contents | IEnumerablestring Required. The content of the input in string format. We recommend the total content be less than 30,000 codepoints. The max length of this field is 1024. Use BatchTranslateText for larger text. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
TranslateTextResponse | The RPC response. |
// Create client
TranslationServiceClient translationServiceClient = TranslationServiceClient.Create();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
string model = "";
string mimeType = "";
string sourceLanguageCode = "";
string targetLanguageCode = "";
IEnumerable<string> contents = new string[] { "", };
// Make the request
TranslateTextResponse response = translationServiceClient.TranslateText(parent, model, mimeType, sourceLanguageCode, targetLanguageCode, contents);
TranslateText(TranslateTextRequest, CallSettings)
public virtual TranslateTextResponse TranslateText(TranslateTextRequest request, CallSettings callSettings = null)
Translates input text and returns translated text.
Parameters | |
---|---|
Name | Description |
request | TranslateTextRequest The request object containing all of the parameters for the API call. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
TranslateTextResponse | The RPC response. |
// 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 | |
---|---|
Name | Description |
parent | string Required. Project or location to make a call. Must refer to a caller's project. Format: For global calls, use Non-global location is required for requests using AutoML models or custom glossaries. Models and glossaries must be within the same region (have same location-id), otherwise an INVALID_ARGUMENT (400) error is returned. |
targetLanguageCode | string Required. The ISO-639 language code to use for translation of the input text, set to one of the language codes listed in Language Support. |
contents | IEnumerablestring Required. The content of the input in string format. We recommend the total content be less than 30,000 codepoints. The max length of this field is 1024. Use BatchTranslateText for larger text. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
TranslateTextResponse | The RPC response. |
// Create client
TranslationServiceClient translationServiceClient = TranslationServiceClient.Create();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]";
string targetLanguageCode = "";
IEnumerable<string> contents = new string[] { "", };
// Make the request
TranslateTextResponse response = translationServiceClient.TranslateText(parent, targetLanguageCode, contents);
TranslateText(string, string, string, string, string, IEnumerable<string>, CallSettings)
public virtual TranslateTextResponse TranslateText(string parent, string model, string mimeType, string sourceLanguageCode, string targetLanguageCode, IEnumerable<string> contents, CallSettings callSettings = null)
Translates input text and returns translated text.
Parameters | |
---|---|
Name | Description |
parent | string Required. Project or location to make a call. Must refer to a caller's project. Format: For global calls, use Non-global location is required for requests using AutoML models or custom glossaries. Models and glossaries must be within the same region (have same location-id), otherwise an INVALID_ARGUMENT (400) error is returned. |
model | string Optional. The The format depends on model type:
For global (non-regionalized) requests, use If not provided, the default Google model (NMT) will be used |
mimeType | string Optional. The format of the source text, for example, "text/html", "text/plain". If left blank, the MIME type defaults to "text/html". |
sourceLanguageCode | string Optional. The ISO-639 language code of the input text if known, for example, "en-US" or "sr-Latn". Supported language codes are listed in Language Support. If the source language isn't specified, the API attempts to identify the source language automatically and returns the source language within the response. |
targetLanguageCode | string Required. The ISO-639 language code to use for translation of the input text, set to one of the language codes listed in Language Support. |
contents | IEnumerablestring Required. The content of the input in string format. We recommend the total content be less than 30,000 codepoints. The max length of this field is 1024. Use BatchTranslateText for larger text. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
TranslateTextResponse | The RPC response. |
// Create client
TranslationServiceClient translationServiceClient = TranslationServiceClient.Create();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]";
string model = "";
string mimeType = "";
string sourceLanguageCode = "";
string targetLanguageCode = "";
IEnumerable<string> contents = new string[] { "", };
// Make the request
TranslateTextResponse response = translationServiceClient.TranslateText(parent, model, mimeType, sourceLanguageCode, targetLanguageCode, contents);
TranslateTextAsync(LocationName, string, IEnumerable<string>, CallSettings)
public virtual Task<TranslateTextResponse> TranslateTextAsync(LocationName parent, string targetLanguageCode, IEnumerable<string> contents, CallSettings callSettings = null)
Translates input text and returns translated text.
Parameters | |
---|---|
Name | Description |
parent | LocationName Required. Project or location to make a call. Must refer to a caller's project. Format: For global calls, use Non-global location is required for requests using AutoML models or custom glossaries. Models and glossaries must be within the same region (have same location-id), otherwise an INVALID_ARGUMENT (400) error is returned. |
targetLanguageCode | string Required. The ISO-639 language code to use for translation of the input text, set to one of the language codes listed in Language Support. |
contents | IEnumerablestring Required. The content of the input in string format. We recommend the total content be less than 30,000 codepoints. The max length of this field is 1024. Use BatchTranslateText for larger text. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
TaskTranslateTextResponse | A Task containing the RPC response. |
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
string targetLanguageCode = "";
IEnumerable<string> contents = new string[] { "", };
// Make the request
TranslateTextResponse response = await translationServiceClient.TranslateTextAsync(parent, targetLanguageCode, contents);
TranslateTextAsync(LocationName, string, IEnumerable<string>, CancellationToken)
public virtual Task<TranslateTextResponse> TranslateTextAsync(LocationName parent, string targetLanguageCode, IEnumerable<string> contents, CancellationToken cancellationToken)
Translates input text and returns translated text.
Parameters | |
---|---|
Name | Description |
parent | LocationName Required. Project or location to make a call. Must refer to a caller's project. Format: For global calls, use Non-global location is required for requests using AutoML models or custom glossaries. Models and glossaries must be within the same region (have same location-id), otherwise an INVALID_ARGUMENT (400) error is returned. |
targetLanguageCode | string Required. The ISO-639 language code to use for translation of the input text, set to one of the language codes listed in Language Support. |
contents | IEnumerablestring Required. The content of the input in string format. We recommend the total content be less than 30,000 codepoints. The max length of this field is 1024. Use BatchTranslateText for larger text. |
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
TaskTranslateTextResponse | A Task containing the RPC response. |
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
string targetLanguageCode = "";
IEnumerable<string> contents = new string[] { "", };
// Make the request
TranslateTextResponse response = await translationServiceClient.TranslateTextAsync(parent, targetLanguageCode, contents);
TranslateTextAsync(LocationName, string, string, string, string, IEnumerable<string>, CallSettings)
public virtual Task<TranslateTextResponse> TranslateTextAsync(LocationName parent, string model, string mimeType, string sourceLanguageCode, string targetLanguageCode, IEnumerable<string> contents, CallSettings callSettings = null)
Translates input text and returns translated text.
Parameters | |
---|---|
Name | Description |
parent | LocationName Required. Project or location to make a call. Must refer to a caller's project. Format: For global calls, use Non-global location is required for requests using AutoML models or custom glossaries. Models and glossaries must be within the same region (have same location-id), otherwise an INVALID_ARGUMENT (400) error is returned. |
model | string Optional. The The format depends on model type:
For global (non-regionalized) requests, use If not provided, the default Google model (NMT) will be used |
mimeType | string Optional. The format of the source text, for example, "text/html", "text/plain". If left blank, the MIME type defaults to "text/html". |
sourceLanguageCode | string Optional. The ISO-639 language code of the input text if known, for example, "en-US" or "sr-Latn". Supported language codes are listed in Language Support. If the source language isn't specified, the API attempts to identify the source language automatically and returns the source language within the response. |
targetLanguageCode | string Required. The ISO-639 language code to use for translation of the input text, set to one of the language codes listed in Language Support. |
contents | IEnumerablestring Required. The content of the input in string format. We recommend the total content be less than 30,000 codepoints. The max length of this field is 1024. Use BatchTranslateText for larger text. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
TaskTranslateTextResponse | A Task containing the RPC response. |
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
string model = "";
string mimeType = "";
string sourceLanguageCode = "";
string targetLanguageCode = "";
IEnumerable<string> contents = new string[] { "", };
// Make the request
TranslateTextResponse response = await translationServiceClient.TranslateTextAsync(parent, model, mimeType, sourceLanguageCode, targetLanguageCode, contents);
TranslateTextAsync(LocationName, string, string, string, string, IEnumerable<string>, CancellationToken)
public virtual Task<TranslateTextResponse> TranslateTextAsync(LocationName parent, string model, string mimeType, string sourceLanguageCode, string targetLanguageCode, IEnumerable<string> contents, CancellationToken cancellationToken)
Translates input text and returns translated text.
Parameters | |
---|---|
Name | Description |
parent | LocationName Required. Project or location to make a call. Must refer to a caller's project. Format: For global calls, use Non-global location is required for requests using AutoML models or custom glossaries. Models and glossaries must be within the same region (have same location-id), otherwise an INVALID_ARGUMENT (400) error is returned. |
model | string Optional. The The format depends on model type:
For global (non-regionalized) requests, use If not provided, the default Google model (NMT) will be used |
mimeType | string Optional. The format of the source text, for example, "text/html", "text/plain". If left blank, the MIME type defaults to "text/html". |
sourceLanguageCode | string Optional. The ISO-639 language code of the input text if known, for example, "en-US" or "sr-Latn". Supported language codes are listed in Language Support. If the source language isn't specified, the API attempts to identify the source language automatically and returns the source language within the response. |
targetLanguageCode | string Required. The ISO-639 language code to use for translation of the input text, set to one of the language codes listed in Language Support. |
contents | IEnumerablestring Required. The content of the input in string format. We recommend the total content be less than 30,000 codepoints. The max length of this field is 1024. Use BatchTranslateText for larger text. |
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
TaskTranslateTextResponse | A Task containing the RPC response. |
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
string model = "";
string mimeType = "";
string sourceLanguageCode = "";
string targetLanguageCode = "";
IEnumerable<string> contents = new string[] { "", };
// Make the request
TranslateTextResponse response = await translationServiceClient.TranslateTextAsync(parent, model, mimeType, sourceLanguageCode, targetLanguageCode, contents);
TranslateTextAsync(TranslateTextRequest, CallSettings)
public virtual Task<TranslateTextResponse> TranslateTextAsync(TranslateTextRequest request, CallSettings callSettings = null)
Translates input text and returns translated text.
Parameters | |
---|---|
Name | Description |
request | TranslateTextRequest The request object containing all of the parameters for the API call. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
TaskTranslateTextResponse | A Task containing the RPC response. |
// 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 | |
---|---|
Name | Description |
request | TranslateTextRequest The request object containing all of the parameters for the API call. |
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
TaskTranslateTextResponse | A Task containing the RPC response. |
// 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 | |
---|---|
Name | Description |
parent | string Required. Project or location to make a call. Must refer to a caller's project. Format: For global calls, use Non-global location is required for requests using AutoML models or custom glossaries. Models and glossaries must be within the same region (have same location-id), otherwise an INVALID_ARGUMENT (400) error is returned. |
targetLanguageCode | string Required. The ISO-639 language code to use for translation of the input text, set to one of the language codes listed in Language Support. |
contents | IEnumerablestring Required. The content of the input in string format. We recommend the total content be less than 30,000 codepoints. The max length of this field is 1024. Use BatchTranslateText for larger text. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
TaskTranslateTextResponse | A Task containing the RPC response. |
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]";
string targetLanguageCode = "";
IEnumerable<string> contents = new string[] { "", };
// Make the request
TranslateTextResponse response = await translationServiceClient.TranslateTextAsync(parent, targetLanguageCode, contents);
TranslateTextAsync(string, string, IEnumerable<string>, CancellationToken)
public virtual Task<TranslateTextResponse> TranslateTextAsync(string parent, string targetLanguageCode, IEnumerable<string> contents, CancellationToken cancellationToken)
Translates input text and returns translated text.
Parameters | |
---|---|
Name | Description |
parent | string Required. Project or location to make a call. Must refer to a caller's project. Format: For global calls, use Non-global location is required for requests using AutoML models or custom glossaries. Models and glossaries must be within the same region (have same location-id), otherwise an INVALID_ARGUMENT (400) error is returned. |
targetLanguageCode | string Required. The ISO-639 language code to use for translation of the input text, set to one of the language codes listed in Language Support. |
contents | IEnumerablestring Required. The content of the input in string format. We recommend the total content be less than 30,000 codepoints. The max length of this field is 1024. Use BatchTranslateText for larger text. |
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
TaskTranslateTextResponse | A Task containing the RPC response. |
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]";
string targetLanguageCode = "";
IEnumerable<string> contents = new string[] { "", };
// Make the request
TranslateTextResponse response = await translationServiceClient.TranslateTextAsync(parent, targetLanguageCode, contents);
TranslateTextAsync(string, string, string, string, string, IEnumerable<string>, CallSettings)
public virtual Task<TranslateTextResponse> TranslateTextAsync(string parent, string model, string mimeType, string sourceLanguageCode, string targetLanguageCode, IEnumerable<string> contents, CallSettings callSettings = null)
Translates input text and returns translated text.
Parameters | |
---|---|
Name | Description |
parent | string Required. Project or location to make a call. Must refer to a caller's project. Format: For global calls, use Non-global location is required for requests using AutoML models or custom glossaries. Models and glossaries must be within the same region (have same location-id), otherwise an INVALID_ARGUMENT (400) error is returned. |
model | string Optional. The The format depends on model type:
For global (non-regionalized) requests, use If not provided, the default Google model (NMT) will be used |
mimeType | string Optional. The format of the source text, for example, "text/html", "text/plain". If left blank, the MIME type defaults to "text/html". |
sourceLanguageCode | string Optional. The ISO-639 language code of the input text if known, for example, "en-US" or "sr-Latn". Supported language codes are listed in Language Support. If the source language isn't specified, the API attempts to identify the source language automatically and returns the source language within the response. |
targetLanguageCode | string Required. The ISO-639 language code to use for translation of the input text, set to one of the language codes listed in Language Support. |
contents | IEnumerablestring Required. The content of the input in string format. We recommend the total content be less than 30,000 codepoints. The max length of this field is 1024. Use BatchTranslateText for larger text. |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
TaskTranslateTextResponse | A Task containing the RPC response. |
// Create client
TranslationServiceClient translationServiceClient = await TranslationServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]";
string model = "";
string mimeType = "";
string sourceLanguageCode = "";
string targetLanguageCode = "";
IEnumerable<string> contents = new string[] { "", };
// Make the request
TranslateTextResponse response = await translationServiceClient.TranslateTextAsync(parent, model, mimeType, sourceLanguageCode, targetLanguageCode, contents);
TranslateTextAsync(string, string, string, string, string, IEnumerable<string>, CancellationToken)
public virtual Task<TranslateTextResponse> TranslateTextAsync(string parent, string model, string mimeType, string sourceLanguageCode, string targetLanguageCode, IEnumerable<string> contents, CancellationToken cancellationToken)
Translates input text and returns translated text.
Parameters | |
---|---|
Name | Description |
parent | string Required. Project or location to make a call. Must refer to a caller's project. Format: For global calls, use Non-global location is required for requests using AutoML models or custom glossaries. Models and glossaries must be within the same region (have same location-id), otherwise an INVALID_ARGUMENT (400) error is returned. |
model | string Optional. The The format depends on model type:
For global (non-regionalized) requests, use If not provided, the default Google model (NMT) will be used |
mimeType | string Optional. The format of the source text, for example, "text/html", "text/plain". If left blank, the MIME type defaults to "text/html". |
sourceLanguageCode | string Optional. The ISO-639 language code of the input text if known, for example, "en-US" or "sr-Latn". Supported language codes are listed in Language Support. If the source language isn't specified, the API attempts to identify the source language automatically and returns the source language within the response. |
targetLanguageCode | string Required. The ISO-639 language code to use for translation of the input text, set to one of the language codes listed in Language Support. |
contents | IEnumerablestring Required. The content of the input in string format. We recommend the total content be less than 30,000 codepoints. The max length of this field is 1024. Use BatchTranslateText for larger text. |
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
TaskTranslateTextResponse | A Task containing the RPC response. |
// 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);