Skip to content

get_public_key

get_public_key(
    id: string, *, config_overrides: Optional[CloudFrontClientConfig] = None
) -> GetPublicKeyResult

Gets a public key.

Parameters:

  • id (string) –

    The identifier of the public key you are getting.

Raises:

Source code in docs_src/capo_cloudfront/_services/cloud_front.py
def get_public_key(
    self,
    id: "capo_cloudfront.types.string.string",
    *,
    config_overrides: Optional[CloudFrontClientConfig] = 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.
    """

    def _handler(
        req: "OperationRequest[capo_cloudfront.types.get_public_key_request.GetPublicKeyRequest]",
    ) -> OperationResponse[
        "capo_cloudfront.types.get_public_key_result.GetPublicKeyResult"
    ]:
        import capo_cloudfront._operations.cloudfront2020_05_31.get_public_key

        output, http_response = (
            capo_cloudfront._operations.cloudfront2020_05_31.get_public_key.get_public_key(
                req.options, req.input
            )
        )
        return OperationResponse(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 = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output