getTerminology method
Future<GetTerminologyResponse>
getTerminology({
- required String name,
- TerminologyDataFormat? terminologyDataFormat,
Retrieves a custom terminology.
May throw InternalServerException.
May throw InvalidParameterValueException.
May throw ResourceNotFoundException.
May throw TooManyRequestsException.
Parameter name :
The name of the custom terminology being retrieved.
Parameter terminologyDataFormat :
The data format of the custom terminology being retrieved.
If you don't specify this parameter, Amazon Translate returns a file with the same format as the file that was imported to create the terminology.
If you specify this parameter when you retrieve a multi-directional terminology resource, you must specify the same format as the input file that was imported to create it. Otherwise, Amazon Translate throws an error.
Implementation
Future<GetTerminologyResponse> getTerminology({
required String name,
TerminologyDataFormat? terminologyDataFormat,
}) async {
final headers = <String, String>{
'Content-Type': 'application/x-amz-json-1.1',
'X-Amz-Target': 'AWSShineFrontendService_20170701.GetTerminology'
};
final jsonResponse = await _protocol.send(
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
// TODO queryParams
headers: headers,
payload: {
'Name': name,
if (terminologyDataFormat != null)
'TerminologyDataFormat': terminologyDataFormat.value,
},
);
return GetTerminologyResponse.fromJson(jsonResponse.body);
}