Retrieves a custom terminology.
Parameters:
-
name
(ResourceName)
–
The name of the custom terminology being retrieved.
-
terminology_data_format
(Optional[TerminologyDataFormat], default:
None
)
–
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.
Raises:
-
InternalServerException
–
An internal server error occurred. Retry your request.
-
InvalidParameterValueException
–
The value of the parameter is not valid. Review the value of the parameter you are using to correct it, and then retry your operation.
-
ResourceNotFoundException
–
The resource you are looking for has not been found. Review the resource you're looking for and see if a different resource will accomplish your needs before retrying the revised request.
-
TooManyRequestsException
–
You have made too many requests within a short period of time. Wait for a short time and then try your request again.
-
UnknownServiceError
–
The service returned an error code this client does not model.
Source code in docs_src/capo_translate/_services/translate.py
| def get_terminology(
self,
name: "capo_translate.types.resource_name.ResourceName",
*,
config_overrides: Optional[TranslateClientConfig] = None,
terminology_data_format: Optional[
"capo_translate.types.terminology_data_format.TerminologyDataFormat"
] = None,
) -> "capo_translate.types.get_terminology_response.GetTerminologyResponse":
"""<p>Retrieves a custom terminology.</p>
Args:
name: <p>The name of the custom terminology being retrieved.</p>
terminology_data_format: <p>The data format of the custom terminology being retrieved.</p> <p>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. </p> <p>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.</p>
Raises:
capo_translate.errors.internal_server_exception.InternalServerException: <p>An internal server error occurred. Retry your request.</p>
capo_translate.errors.invalid_parameter_value_exception.InvalidParameterValueException: <p>The value of the parameter is not valid. Review the value of the parameter you are using to correct it, and then retry your operation.</p>
capo_translate.errors.resource_not_found_exception.ResourceNotFoundException: <p>The resource you are looking for has not been found. Review the resource you're looking for and see if a different resource will accomplish your needs before retrying the revised request.</p>
capo_translate.errors.too_many_requests_exception.TooManyRequestsException: <p> You have made too many requests within a short period of time. Wait for a short time and then try your request again.</p>
capo_translate.errors.UnknownServiceError: The service returned an error code this client does not model.
"""
def _handler(
req: "OperationRequest[capo_translate.types.get_terminology_request.GetTerminologyRequest]",
) -> OperationResponse[
"capo_translate.types.get_terminology_response.GetTerminologyResponse"
]:
import capo_translate._operations.aws_shine_frontend_service_20170701.get_terminology
output, http_response = (
capo_translate._operations.aws_shine_frontend_service_20170701.get_terminology.get_terminology(
req.options, req.input
)
)
return OperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("GetTerminology")
)
input_: capo_translate.types.get_terminology_request.GetTerminologyRequest = {
"name": name
}
if terminology_data_format is not None:
input_["terminology_data_format"] = terminology_data_format
response = execute_pipeline(
OperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
response.response.close()
return response.output
|