def retrieve_domain_auth_code(
self,
domain_name: "capo_route_53_domains.types.domain_name.DomainName",
*,
config_overrides: Optional[Route53DomainsClientConfig] = None,
) -> "capo_route_53_domains.types.retrieve_domain_auth_code_response.RetrieveDomainAuthCodeResponse":
"""<p>This operation returns the authorization code for the domain. To transfer a domain to another registrar, you provide this value to the new registrar.</p>
Args:
domain_name: <p>The name of the domain that you want to get an authorization code for.</p>
Raises:
capo_route_53_domains.errors.invalid_input.InvalidInput: <p>The requested item is not acceptable. For example, for APIs that accept a domain name, the request might specify a domain name that doesn't belong to the account that submitted the request. For <code>AcceptDomainTransferFromAnotherAwsAccount</code>, the password might be invalid.</p>
capo_route_53_domains.errors.tld_in_maintenance.TLDInMaintenance: <p>The top-level domain is currently undergoing maintenance and the request cannot be processed. Try again later.</p>
capo_route_53_domains.errors.unsupported_tld.UnsupportedTLD: <p>Amazon Route 53 does not support this top-level domain (TLD).</p>
capo_route_53_domains.errors.UnknownServiceError: The service returned an error code this client does not model.
"""
def _handler(
req: "OperationRequest[capo_route_53_domains.types.retrieve_domain_auth_code_request.RetrieveDomainAuthCodeRequest]",
) -> OperationResponse[
"capo_route_53_domains.types.retrieve_domain_auth_code_response.RetrieveDomainAuthCodeResponse"
]:
import capo_route_53_domains._operations.route53_domains_v20140515.retrieve_domain_auth_code
output, http_response = (
capo_route_53_domains._operations.route53_domains_v20140515.retrieve_domain_auth_code.retrieve_domain_auth_code(
req.options, req.input
)
)
return OperationResponse(output=output, response=http_response)
def _redact_output(
output: "capo_route_53_domains.types.retrieve_domain_auth_code_response.RetrieveDomainAuthCodeResponse",
) -> dict[str, Any]:
import capo_route_53_domains.types.retrieve_domain_auth_code_response
return capo_route_53_domains.types.retrieve_domain_auth_code_response.redact_sensitive(
output
)
interceptors_, options_ = self.operation_options(
config_overrides,
OperationLogging("RetrieveDomainAuthCode", redact_output=_redact_output),
)
input_: capo_route_53_domains.types.retrieve_domain_auth_code_request.RetrieveDomainAuthCodeRequest = {
"domain_name": domain_name
}
response = execute_pipeline(
OperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
response.response.close()
return response.output