async def get_public_key(
self,
id: "capo_cloudfront.types.string.string",
*,
config_overrides: Optional[AsyncCloudFrontClientConfig] = None,
) -> "capo_cloudfront.types.get_public_key_result.GetPublicKeyResult":
"""<p>Gets a public key.</p>
Args:
id: <p>The identifier of the public key you are getting.</p>
Raises:
capo_cloudfront.errors.access_denied.AccessDenied: <p>Access denied.</p>
capo_cloudfront.errors.no_such_public_key.NoSuchPublicKey: <p>The specified public key doesn't exist.</p>
capo_cloudfront.errors.UnknownServiceError: The service returned an error code this client does not model.
"""
async def _handler(
req: "AsyncOperationRequest[capo_cloudfront.types.get_public_key_request.GetPublicKeyRequest]",
) -> AsyncOperationResponse[
"capo_cloudfront.types.get_public_key_result.GetPublicKeyResult"
]:
import capo_cloudfront._operations.cloudfront2020_05_31.get_public_key
(
output,
http_response,
) = await capo_cloudfront._operations.cloudfront2020_05_31.get_public_key.async_get_public_key(
req.options, req.input
)
return AsyncOperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("GetPublicKey")
)
input_: capo_cloudfront.types.get_public_key_request.GetPublicKeyRequest = {
"id": id
}
response = await aexecute_pipeline(
AsyncOperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
await response.response.aclose()
return response.output