{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.CertificateManager.ExportCertificate
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Exports a private certificate issued by a private certificate authority
-- (CA) for use anywhere. The exported file contains the certificate, the
-- certificate chain, and the encrypted private 2048-bit RSA key associated
-- with the public key that is embedded in the certificate. For security,
-- you must assign a passphrase for the private key when exporting it.
--
-- For information about exporting and formatting a certificate using the
-- ACM console or CLI, see
-- <https://docs.aws.amazon.com/acm/latest/userguide/gs-acm-export-private.html Export a Private Certificate>.
module Amazonka.CertificateManager.ExportCertificate
  ( -- * Creating a Request
    ExportCertificate (..),
    newExportCertificate,

    -- * Request Lenses
    exportCertificate_certificateArn,
    exportCertificate_passphrase,

    -- * Destructuring the Response
    ExportCertificateResponse (..),
    newExportCertificateResponse,

    -- * Response Lenses
    exportCertificateResponse_privateKey,
    exportCertificateResponse_certificate,
    exportCertificateResponse_certificateChain,
    exportCertificateResponse_httpStatus,
  )
where

import Amazonka.CertificateManager.Types
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | /See:/ 'newExportCertificate' smart constructor.
data ExportCertificate = ExportCertificate'
  { -- | An Amazon Resource Name (ARN) of the issued certificate. This must be of
    -- the form:
    --
    -- @arn:aws:acm:region:account:certificate\/12345678-1234-1234-1234-123456789012@
    ExportCertificate -> Text
certificateArn :: Prelude.Text,
    -- | Passphrase to associate with the encrypted exported private key. If you
    -- want to later decrypt the private key, you must have the passphrase. You
    -- can use the following OpenSSL command to decrypt a private key:
    --
    -- @openssl rsa -in encrypted_key.pem -out decrypted_key.pem@
    ExportCertificate -> Sensitive Base64
passphrase :: Core.Sensitive Core.Base64
  }
  deriving (ExportCertificate -> ExportCertificate -> Bool
(ExportCertificate -> ExportCertificate -> Bool)
-> (ExportCertificate -> ExportCertificate -> Bool)
-> Eq ExportCertificate
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ExportCertificate -> ExportCertificate -> Bool
$c/= :: ExportCertificate -> ExportCertificate -> Bool
== :: ExportCertificate -> ExportCertificate -> Bool
$c== :: ExportCertificate -> ExportCertificate -> Bool
Prelude.Eq, Int -> ExportCertificate -> ShowS
[ExportCertificate] -> ShowS
ExportCertificate -> String
(Int -> ExportCertificate -> ShowS)
-> (ExportCertificate -> String)
-> ([ExportCertificate] -> ShowS)
-> Show ExportCertificate
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ExportCertificate] -> ShowS
$cshowList :: [ExportCertificate] -> ShowS
show :: ExportCertificate -> String
$cshow :: ExportCertificate -> String
showsPrec :: Int -> ExportCertificate -> ShowS
$cshowsPrec :: Int -> ExportCertificate -> ShowS
Prelude.Show, (forall x. ExportCertificate -> Rep ExportCertificate x)
-> (forall x. Rep ExportCertificate x -> ExportCertificate)
-> Generic ExportCertificate
forall x. Rep ExportCertificate x -> ExportCertificate
forall x. ExportCertificate -> Rep ExportCertificate x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ExportCertificate x -> ExportCertificate
$cfrom :: forall x. ExportCertificate -> Rep ExportCertificate x
Prelude.Generic)

-- |
-- Create a value of 'ExportCertificate' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'certificateArn', 'exportCertificate_certificateArn' - An Amazon Resource Name (ARN) of the issued certificate. This must be of
-- the form:
--
-- @arn:aws:acm:region:account:certificate\/12345678-1234-1234-1234-123456789012@
--
-- 'passphrase', 'exportCertificate_passphrase' - Passphrase to associate with the encrypted exported private key. If you
-- want to later decrypt the private key, you must have the passphrase. You
-- can use the following OpenSSL command to decrypt a private key:
--
-- @openssl rsa -in encrypted_key.pem -out decrypted_key.pem@--
-- -- /Note:/ This 'Lens' automatically encodes and decodes Base64 data.
-- -- The underlying isomorphism will encode to Base64 representation during
-- -- serialisation, and decode from Base64 representation during deserialisation.
-- -- This 'Lens' accepts and returns only raw unencoded data.
newExportCertificate ::
  -- | 'certificateArn'
  Prelude.Text ->
  -- | 'passphrase'
  Prelude.ByteString ->
  ExportCertificate
newExportCertificate :: Text -> ByteString -> ExportCertificate
newExportCertificate Text
pCertificateArn_ ByteString
pPassphrase_ =
  ExportCertificate' :: Text -> Sensitive Base64 -> ExportCertificate
ExportCertificate'
    { $sel:certificateArn:ExportCertificate' :: Text
certificateArn =
        Text
pCertificateArn_,
      $sel:passphrase:ExportCertificate' :: Sensitive Base64
passphrase =
        Tagged Base64 (Identity Base64)
-> Tagged (Sensitive Base64) (Identity (Sensitive Base64))
forall a. Iso' (Sensitive a) a
Core._Sensitive (Tagged Base64 (Identity Base64)
 -> Tagged (Sensitive Base64) (Identity (Sensitive Base64)))
-> (Tagged ByteString (Identity ByteString)
    -> Tagged Base64 (Identity Base64))
-> Tagged ByteString (Identity ByteString)
-> Tagged (Sensitive Base64) (Identity (Sensitive Base64))
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. Tagged ByteString (Identity ByteString)
-> Tagged Base64 (Identity Base64)
Iso' Base64 ByteString
Core._Base64
          (Tagged ByteString (Identity ByteString)
 -> Tagged (Sensitive Base64) (Identity (Sensitive Base64)))
-> ByteString -> Sensitive Base64
forall t b. AReview t b -> b -> t
Lens.# ByteString
pPassphrase_
    }

-- | An Amazon Resource Name (ARN) of the issued certificate. This must be of
-- the form:
--
-- @arn:aws:acm:region:account:certificate\/12345678-1234-1234-1234-123456789012@
exportCertificate_certificateArn :: Lens.Lens' ExportCertificate Prelude.Text
exportCertificate_certificateArn :: (Text -> f Text) -> ExportCertificate -> f ExportCertificate
exportCertificate_certificateArn = (ExportCertificate -> Text)
-> (ExportCertificate -> Text -> ExportCertificate)
-> Lens ExportCertificate ExportCertificate Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ExportCertificate' {Text
certificateArn :: Text
$sel:certificateArn:ExportCertificate' :: ExportCertificate -> Text
certificateArn} -> Text
certificateArn) (\s :: ExportCertificate
s@ExportCertificate' {} Text
a -> ExportCertificate
s {$sel:certificateArn:ExportCertificate' :: Text
certificateArn = Text
a} :: ExportCertificate)

-- | Passphrase to associate with the encrypted exported private key. If you
-- want to later decrypt the private key, you must have the passphrase. You
-- can use the following OpenSSL command to decrypt a private key:
--
-- @openssl rsa -in encrypted_key.pem -out decrypted_key.pem@--
-- -- /Note:/ This 'Lens' automatically encodes and decodes Base64 data.
-- -- The underlying isomorphism will encode to Base64 representation during
-- -- serialisation, and decode from Base64 representation during deserialisation.
-- -- This 'Lens' accepts and returns only raw unencoded data.
exportCertificate_passphrase :: Lens.Lens' ExportCertificate Prelude.ByteString
exportCertificate_passphrase :: (ByteString -> f ByteString)
-> ExportCertificate -> f ExportCertificate
exportCertificate_passphrase = (ExportCertificate -> Sensitive Base64)
-> (ExportCertificate -> Sensitive Base64 -> ExportCertificate)
-> Lens
     ExportCertificate
     ExportCertificate
     (Sensitive Base64)
     (Sensitive Base64)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ExportCertificate' {Sensitive Base64
passphrase :: Sensitive Base64
$sel:passphrase:ExportCertificate' :: ExportCertificate -> Sensitive Base64
passphrase} -> Sensitive Base64
passphrase) (\s :: ExportCertificate
s@ExportCertificate' {} Sensitive Base64
a -> ExportCertificate
s {$sel:passphrase:ExportCertificate' :: Sensitive Base64
passphrase = Sensitive Base64
a} :: ExportCertificate) ((Sensitive Base64 -> f (Sensitive Base64))
 -> ExportCertificate -> f ExportCertificate)
-> ((ByteString -> f ByteString)
    -> Sensitive Base64 -> f (Sensitive Base64))
-> (ByteString -> f ByteString)
-> ExportCertificate
-> f ExportCertificate
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (Base64 -> f Base64) -> Sensitive Base64 -> f (Sensitive Base64)
forall a. Iso' (Sensitive a) a
Core._Sensitive ((Base64 -> f Base64) -> Sensitive Base64 -> f (Sensitive Base64))
-> ((ByteString -> f ByteString) -> Base64 -> f Base64)
-> (ByteString -> f ByteString)
-> Sensitive Base64
-> f (Sensitive Base64)
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (ByteString -> f ByteString) -> Base64 -> f Base64
Iso' Base64 ByteString
Core._Base64

instance Core.AWSRequest ExportCertificate where
  type
    AWSResponse ExportCertificate =
      ExportCertificateResponse
  request :: ExportCertificate -> Request ExportCertificate
request = Service -> ExportCertificate -> Request ExportCertificate
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy ExportCertificate
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse ExportCertificate)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse ExportCertificate))
-> Logger
-> Service
-> Proxy ExportCertificate
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse ExportCertificate)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe (Sensitive Text)
-> Maybe Text -> Maybe Text -> Int -> ExportCertificateResponse
ExportCertificateResponse'
            (Maybe (Sensitive Text)
 -> Maybe Text -> Maybe Text -> Int -> ExportCertificateResponse)
-> Either String (Maybe (Sensitive Text))
-> Either
     String
     (Maybe Text -> Maybe Text -> Int -> ExportCertificateResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe (Sensitive Text))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"PrivateKey")
            Either
  String
  (Maybe Text -> Maybe Text -> Int -> ExportCertificateResponse)
-> Either String (Maybe Text)
-> Either String (Maybe Text -> Int -> ExportCertificateResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"Certificate")
            Either String (Maybe Text -> Int -> ExportCertificateResponse)
-> Either String (Maybe Text)
-> Either String (Int -> ExportCertificateResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"CertificateChain")
            Either String (Int -> ExportCertificateResponse)
-> Either String Int -> Either String ExportCertificateResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Int -> Either String Int
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (Int -> Int
forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance Prelude.Hashable ExportCertificate

instance Prelude.NFData ExportCertificate

instance Core.ToHeaders ExportCertificate where
  toHeaders :: ExportCertificate -> ResponseHeaders
toHeaders =
    ResponseHeaders -> ExportCertificate -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
      ( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"X-Amz-Target"
              HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"CertificateManager.ExportCertificate" ::
                          Prelude.ByteString
                      ),
            HeaderName
"Content-Type"
              HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"application/x-amz-json-1.1" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Core.ToJSON ExportCertificate where
  toJSON :: ExportCertificate -> Value
toJSON ExportCertificate' {Text
Sensitive Base64
passphrase :: Sensitive Base64
certificateArn :: Text
$sel:passphrase:ExportCertificate' :: ExportCertificate -> Sensitive Base64
$sel:certificateArn:ExportCertificate' :: ExportCertificate -> Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              (Text
"CertificateArn" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
certificateArn),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Passphrase" Text -> Sensitive Base64 -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Sensitive Base64
passphrase)
          ]
      )

instance Core.ToPath ExportCertificate where
  toPath :: ExportCertificate -> ByteString
toPath = ByteString -> ExportCertificate -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"

instance Core.ToQuery ExportCertificate where
  toQuery :: ExportCertificate -> QueryString
toQuery = QueryString -> ExportCertificate -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty

-- | /See:/ 'newExportCertificateResponse' smart constructor.
data ExportCertificateResponse = ExportCertificateResponse'
  { -- | The encrypted private key associated with the public key in the
    -- certificate. The key is output in PKCS #8 format and is base64
    -- PEM-encoded.
    ExportCertificateResponse -> Maybe (Sensitive Text)
privateKey :: Prelude.Maybe (Core.Sensitive Prelude.Text),
    -- | The base64 PEM-encoded certificate.
    ExportCertificateResponse -> Maybe Text
certificate :: Prelude.Maybe Prelude.Text,
    -- | The base64 PEM-encoded certificate chain. This does not include the
    -- certificate that you are exporting.
    ExportCertificateResponse -> Maybe Text
certificateChain :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    ExportCertificateResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (ExportCertificateResponse -> ExportCertificateResponse -> Bool
(ExportCertificateResponse -> ExportCertificateResponse -> Bool)
-> (ExportCertificateResponse -> ExportCertificateResponse -> Bool)
-> Eq ExportCertificateResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ExportCertificateResponse -> ExportCertificateResponse -> Bool
$c/= :: ExportCertificateResponse -> ExportCertificateResponse -> Bool
== :: ExportCertificateResponse -> ExportCertificateResponse -> Bool
$c== :: ExportCertificateResponse -> ExportCertificateResponse -> Bool
Prelude.Eq, Int -> ExportCertificateResponse -> ShowS
[ExportCertificateResponse] -> ShowS
ExportCertificateResponse -> String
(Int -> ExportCertificateResponse -> ShowS)
-> (ExportCertificateResponse -> String)
-> ([ExportCertificateResponse] -> ShowS)
-> Show ExportCertificateResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ExportCertificateResponse] -> ShowS
$cshowList :: [ExportCertificateResponse] -> ShowS
show :: ExportCertificateResponse -> String
$cshow :: ExportCertificateResponse -> String
showsPrec :: Int -> ExportCertificateResponse -> ShowS
$cshowsPrec :: Int -> ExportCertificateResponse -> ShowS
Prelude.Show, (forall x.
 ExportCertificateResponse -> Rep ExportCertificateResponse x)
-> (forall x.
    Rep ExportCertificateResponse x -> ExportCertificateResponse)
-> Generic ExportCertificateResponse
forall x.
Rep ExportCertificateResponse x -> ExportCertificateResponse
forall x.
ExportCertificateResponse -> Rep ExportCertificateResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ExportCertificateResponse x -> ExportCertificateResponse
$cfrom :: forall x.
ExportCertificateResponse -> Rep ExportCertificateResponse x
Prelude.Generic)

-- |
-- Create a value of 'ExportCertificateResponse' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'privateKey', 'exportCertificateResponse_privateKey' - The encrypted private key associated with the public key in the
-- certificate. The key is output in PKCS #8 format and is base64
-- PEM-encoded.
--
-- 'certificate', 'exportCertificateResponse_certificate' - The base64 PEM-encoded certificate.
--
-- 'certificateChain', 'exportCertificateResponse_certificateChain' - The base64 PEM-encoded certificate chain. This does not include the
-- certificate that you are exporting.
--
-- 'httpStatus', 'exportCertificateResponse_httpStatus' - The response's http status code.
newExportCertificateResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ExportCertificateResponse
newExportCertificateResponse :: Int -> ExportCertificateResponse
newExportCertificateResponse Int
pHttpStatus_ =
  ExportCertificateResponse' :: Maybe (Sensitive Text)
-> Maybe Text -> Maybe Text -> Int -> ExportCertificateResponse
ExportCertificateResponse'
    { $sel:privateKey:ExportCertificateResponse' :: Maybe (Sensitive Text)
privateKey =
        Maybe (Sensitive Text)
forall a. Maybe a
Prelude.Nothing,
      $sel:certificate:ExportCertificateResponse' :: Maybe Text
certificate = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:certificateChain:ExportCertificateResponse' :: Maybe Text
certificateChain = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ExportCertificateResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The encrypted private key associated with the public key in the
-- certificate. The key is output in PKCS #8 format and is base64
-- PEM-encoded.
exportCertificateResponse_privateKey :: Lens.Lens' ExportCertificateResponse (Prelude.Maybe Prelude.Text)
exportCertificateResponse_privateKey :: (Maybe Text -> f (Maybe Text))
-> ExportCertificateResponse -> f ExportCertificateResponse
exportCertificateResponse_privateKey = (ExportCertificateResponse -> Maybe (Sensitive Text))
-> (ExportCertificateResponse
    -> Maybe (Sensitive Text) -> ExportCertificateResponse)
-> Lens
     ExportCertificateResponse
     ExportCertificateResponse
     (Maybe (Sensitive Text))
     (Maybe (Sensitive Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ExportCertificateResponse' {Maybe (Sensitive Text)
privateKey :: Maybe (Sensitive Text)
$sel:privateKey:ExportCertificateResponse' :: ExportCertificateResponse -> Maybe (Sensitive Text)
privateKey} -> Maybe (Sensitive Text)
privateKey) (\s :: ExportCertificateResponse
s@ExportCertificateResponse' {} Maybe (Sensitive Text)
a -> ExportCertificateResponse
s {$sel:privateKey:ExportCertificateResponse' :: Maybe (Sensitive Text)
privateKey = Maybe (Sensitive Text)
a} :: ExportCertificateResponse) ((Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
 -> ExportCertificateResponse -> f ExportCertificateResponse)
-> ((Maybe Text -> f (Maybe Text))
    -> Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
-> (Maybe Text -> f (Maybe Text))
-> ExportCertificateResponse
-> f ExportCertificateResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso (Sensitive Text) (Sensitive Text) Text Text
-> Iso
     (Maybe (Sensitive Text))
     (Maybe (Sensitive Text))
     (Maybe Text)
     (Maybe Text)
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso (Sensitive Text) (Sensitive Text) Text Text
forall a. Iso' (Sensitive a) a
Core._Sensitive

-- | The base64 PEM-encoded certificate.
exportCertificateResponse_certificate :: Lens.Lens' ExportCertificateResponse (Prelude.Maybe Prelude.Text)
exportCertificateResponse_certificate :: (Maybe Text -> f (Maybe Text))
-> ExportCertificateResponse -> f ExportCertificateResponse
exportCertificateResponse_certificate = (ExportCertificateResponse -> Maybe Text)
-> (ExportCertificateResponse
    -> Maybe Text -> ExportCertificateResponse)
-> Lens
     ExportCertificateResponse
     ExportCertificateResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ExportCertificateResponse' {Maybe Text
certificate :: Maybe Text
$sel:certificate:ExportCertificateResponse' :: ExportCertificateResponse -> Maybe Text
certificate} -> Maybe Text
certificate) (\s :: ExportCertificateResponse
s@ExportCertificateResponse' {} Maybe Text
a -> ExportCertificateResponse
s {$sel:certificate:ExportCertificateResponse' :: Maybe Text
certificate = Maybe Text
a} :: ExportCertificateResponse)

-- | The base64 PEM-encoded certificate chain. This does not include the
-- certificate that you are exporting.
exportCertificateResponse_certificateChain :: Lens.Lens' ExportCertificateResponse (Prelude.Maybe Prelude.Text)
exportCertificateResponse_certificateChain :: (Maybe Text -> f (Maybe Text))
-> ExportCertificateResponse -> f ExportCertificateResponse
exportCertificateResponse_certificateChain = (ExportCertificateResponse -> Maybe Text)
-> (ExportCertificateResponse
    -> Maybe Text -> ExportCertificateResponse)
-> Lens
     ExportCertificateResponse
     ExportCertificateResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ExportCertificateResponse' {Maybe Text
certificateChain :: Maybe Text
$sel:certificateChain:ExportCertificateResponse' :: ExportCertificateResponse -> Maybe Text
certificateChain} -> Maybe Text
certificateChain) (\s :: ExportCertificateResponse
s@ExportCertificateResponse' {} Maybe Text
a -> ExportCertificateResponse
s {$sel:certificateChain:ExportCertificateResponse' :: Maybe Text
certificateChain = Maybe Text
a} :: ExportCertificateResponse)

-- | The response's http status code.
exportCertificateResponse_httpStatus :: Lens.Lens' ExportCertificateResponse Prelude.Int
exportCertificateResponse_httpStatus :: (Int -> f Int)
-> ExportCertificateResponse -> f ExportCertificateResponse
exportCertificateResponse_httpStatus = (ExportCertificateResponse -> Int)
-> (ExportCertificateResponse -> Int -> ExportCertificateResponse)
-> Lens ExportCertificateResponse ExportCertificateResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ExportCertificateResponse' {Int
httpStatus :: Int
$sel:httpStatus:ExportCertificateResponse' :: ExportCertificateResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: ExportCertificateResponse
s@ExportCertificateResponse' {} Int
a -> ExportCertificateResponse
s {$sel:httpStatus:ExportCertificateResponse' :: Int
httpStatus = Int
a} :: ExportCertificateResponse)

instance Prelude.NFData ExportCertificateResponse