{-# 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.CertificateManagerPCA.ImportCertificateAuthorityCertificate
-- 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)
--
-- Imports a signed private CA certificate into ACM Private CA. This action
-- is used when you are using a chain of trust whose root is located
-- outside ACM Private CA. Before you can call this action, the following
-- preparations must in place:
--
-- 1.  In ACM Private CA, call the
--     <https://docs.aws.amazon.com/acm-pca/latest/APIReference/API_CreateCertificateAuthority.html CreateCertificateAuthority>
--     action to create the private CA that you plan to back with the
--     imported certificate.
--
-- 2.  Call the
--     <https://docs.aws.amazon.com/acm-pca/latest/APIReference/API_GetCertificateAuthorityCsr.html GetCertificateAuthorityCsr>
--     action to generate a certificate signing request (CSR).
--
-- 3.  Sign the CSR using a root or intermediate CA hosted by either an
--     on-premises PKI hierarchy or by a commercial CA.
--
-- 4.  Create a certificate chain and copy the signed certificate and the
--     certificate chain to your working directory.
--
-- ACM Private CA supports three scenarios for installing a CA certificate:
--
-- -   Installing a certificate for a root CA hosted by ACM Private CA.
--
-- -   Installing a subordinate CA certificate whose parent authority is
--     hosted by ACM Private CA.
--
-- -   Installing a subordinate CA certificate whose parent authority is
--     externally hosted.
--
-- The following additional requirements apply when you import a CA
-- certificate.
--
-- -   Only a self-signed certificate can be imported as a root CA.
--
-- -   A self-signed certificate cannot be imported as a subordinate CA.
--
-- -   Your certificate chain must not include the private CA certificate
--     that you are importing.
--
-- -   Your root CA must be the last certificate in your chain. The
--     subordinate certificate, if any, that your root CA signed must be
--     next to last. The subordinate certificate signed by the preceding
--     subordinate CA must come next, and so on until your chain is built.
--
-- -   The chain must be PEM-encoded.
--
-- -   The maximum allowed size of a certificate is 32 KB.
--
-- -   The maximum allowed size of a certificate chain is 2 MB.
--
-- /Enforcement of Critical Constraints/
--
-- ACM Private CA allows the following extensions to be marked critical in
-- the imported CA certificate or chain.
--
-- -   Basic constraints (/must/ be marked critical)
--
-- -   Subject alternative names
--
-- -   Key usage
--
-- -   Extended key usage
--
-- -   Authority key identifier
--
-- -   Subject key identifier
--
-- -   Issuer alternative name
--
-- -   Subject directory attributes
--
-- -   Subject information access
--
-- -   Certificate policies
--
-- -   Policy mappings
--
-- -   Inhibit anyPolicy
--
-- ACM Private CA rejects the following extensions when they are marked
-- critical in an imported CA certificate or chain.
--
-- -   Name constraints
--
-- -   Policy constraints
--
-- -   CRL distribution points
--
-- -   Authority information access
--
-- -   Freshest CRL
--
-- -   Any other extension
module Amazonka.CertificateManagerPCA.ImportCertificateAuthorityCertificate
  ( -- * Creating a Request
    ImportCertificateAuthorityCertificate (..),
    newImportCertificateAuthorityCertificate,

    -- * Request Lenses
    importCertificateAuthorityCertificate_certificateChain,
    importCertificateAuthorityCertificate_certificateAuthorityArn,
    importCertificateAuthorityCertificate_certificate,

    -- * Destructuring the Response
    ImportCertificateAuthorityCertificateResponse (..),
    newImportCertificateAuthorityCertificateResponse,
  )
where

import Amazonka.CertificateManagerPCA.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:/ 'newImportCertificateAuthorityCertificate' smart constructor.
data ImportCertificateAuthorityCertificate = ImportCertificateAuthorityCertificate'
  { -- | A PEM-encoded file that contains all of your certificates, other than
    -- the certificate you\'re importing, chaining up to your root CA. Your ACM
    -- Private CA-hosted or on-premises root certificate is the last in the
    -- chain, and each certificate in the chain signs the one preceding.
    --
    -- This parameter must be supplied when you import a subordinate CA. When
    -- you import a root CA, there is no chain.
    ImportCertificateAuthorityCertificate -> Maybe Base64
certificateChain :: Prelude.Maybe Core.Base64,
    -- | The Amazon Resource Name (ARN) that was returned when you called
    -- <https://docs.aws.amazon.com/acm-pca/latest/APIReference/API_CreateCertificateAuthority.html CreateCertificateAuthority>.
    -- This must be of the form:
    --
    -- @arn:aws:acm-pca:region:account:certificate-authority\/12345678-1234-1234-1234-123456789012 @
    ImportCertificateAuthorityCertificate -> Text
certificateAuthorityArn :: Prelude.Text,
    -- | The PEM-encoded certificate for a private CA. This may be a self-signed
    -- certificate in the case of a root CA, or it may be signed by another CA
    -- that you control.
    ImportCertificateAuthorityCertificate -> Base64
certificate :: Core.Base64
  }
  deriving (ImportCertificateAuthorityCertificate
-> ImportCertificateAuthorityCertificate -> Bool
(ImportCertificateAuthorityCertificate
 -> ImportCertificateAuthorityCertificate -> Bool)
-> (ImportCertificateAuthorityCertificate
    -> ImportCertificateAuthorityCertificate -> Bool)
-> Eq ImportCertificateAuthorityCertificate
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ImportCertificateAuthorityCertificate
-> ImportCertificateAuthorityCertificate -> Bool
$c/= :: ImportCertificateAuthorityCertificate
-> ImportCertificateAuthorityCertificate -> Bool
== :: ImportCertificateAuthorityCertificate
-> ImportCertificateAuthorityCertificate -> Bool
$c== :: ImportCertificateAuthorityCertificate
-> ImportCertificateAuthorityCertificate -> Bool
Prelude.Eq, ReadPrec [ImportCertificateAuthorityCertificate]
ReadPrec ImportCertificateAuthorityCertificate
Int -> ReadS ImportCertificateAuthorityCertificate
ReadS [ImportCertificateAuthorityCertificate]
(Int -> ReadS ImportCertificateAuthorityCertificate)
-> ReadS [ImportCertificateAuthorityCertificate]
-> ReadPrec ImportCertificateAuthorityCertificate
-> ReadPrec [ImportCertificateAuthorityCertificate]
-> Read ImportCertificateAuthorityCertificate
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ImportCertificateAuthorityCertificate]
$creadListPrec :: ReadPrec [ImportCertificateAuthorityCertificate]
readPrec :: ReadPrec ImportCertificateAuthorityCertificate
$creadPrec :: ReadPrec ImportCertificateAuthorityCertificate
readList :: ReadS [ImportCertificateAuthorityCertificate]
$creadList :: ReadS [ImportCertificateAuthorityCertificate]
readsPrec :: Int -> ReadS ImportCertificateAuthorityCertificate
$creadsPrec :: Int -> ReadS ImportCertificateAuthorityCertificate
Prelude.Read, Int -> ImportCertificateAuthorityCertificate -> ShowS
[ImportCertificateAuthorityCertificate] -> ShowS
ImportCertificateAuthorityCertificate -> String
(Int -> ImportCertificateAuthorityCertificate -> ShowS)
-> (ImportCertificateAuthorityCertificate -> String)
-> ([ImportCertificateAuthorityCertificate] -> ShowS)
-> Show ImportCertificateAuthorityCertificate
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ImportCertificateAuthorityCertificate] -> ShowS
$cshowList :: [ImportCertificateAuthorityCertificate] -> ShowS
show :: ImportCertificateAuthorityCertificate -> String
$cshow :: ImportCertificateAuthorityCertificate -> String
showsPrec :: Int -> ImportCertificateAuthorityCertificate -> ShowS
$cshowsPrec :: Int -> ImportCertificateAuthorityCertificate -> ShowS
Prelude.Show, (forall x.
 ImportCertificateAuthorityCertificate
 -> Rep ImportCertificateAuthorityCertificate x)
-> (forall x.
    Rep ImportCertificateAuthorityCertificate x
    -> ImportCertificateAuthorityCertificate)
-> Generic ImportCertificateAuthorityCertificate
forall x.
Rep ImportCertificateAuthorityCertificate x
-> ImportCertificateAuthorityCertificate
forall x.
ImportCertificateAuthorityCertificate
-> Rep ImportCertificateAuthorityCertificate x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ImportCertificateAuthorityCertificate x
-> ImportCertificateAuthorityCertificate
$cfrom :: forall x.
ImportCertificateAuthorityCertificate
-> Rep ImportCertificateAuthorityCertificate x
Prelude.Generic)

-- |
-- Create a value of 'ImportCertificateAuthorityCertificate' 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:
--
-- 'certificateChain', 'importCertificateAuthorityCertificate_certificateChain' - A PEM-encoded file that contains all of your certificates, other than
-- the certificate you\'re importing, chaining up to your root CA. Your ACM
-- Private CA-hosted or on-premises root certificate is the last in the
-- chain, and each certificate in the chain signs the one preceding.
--
-- This parameter must be supplied when you import a subordinate CA. When
-- you import a root CA, there is no chain.--
-- -- /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.
--
-- 'certificateAuthorityArn', 'importCertificateAuthorityCertificate_certificateAuthorityArn' - The Amazon Resource Name (ARN) that was returned when you called
-- <https://docs.aws.amazon.com/acm-pca/latest/APIReference/API_CreateCertificateAuthority.html CreateCertificateAuthority>.
-- This must be of the form:
--
-- @arn:aws:acm-pca:region:account:certificate-authority\/12345678-1234-1234-1234-123456789012 @
--
-- 'certificate', 'importCertificateAuthorityCertificate_certificate' - The PEM-encoded certificate for a private CA. This may be a self-signed
-- certificate in the case of a root CA, or it may be signed by another CA
-- that you control.--
-- -- /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.
newImportCertificateAuthorityCertificate ::
  -- | 'certificateAuthorityArn'
  Prelude.Text ->
  -- | 'certificate'
  Prelude.ByteString ->
  ImportCertificateAuthorityCertificate
newImportCertificateAuthorityCertificate :: Text -> ByteString -> ImportCertificateAuthorityCertificate
newImportCertificateAuthorityCertificate
  Text
pCertificateAuthorityArn_
  ByteString
pCertificate_ =
    ImportCertificateAuthorityCertificate' :: Maybe Base64
-> Text -> Base64 -> ImportCertificateAuthorityCertificate
ImportCertificateAuthorityCertificate'
      { $sel:certificateChain:ImportCertificateAuthorityCertificate' :: Maybe Base64
certificateChain =
          Maybe Base64
forall a. Maybe a
Prelude.Nothing,
        $sel:certificateAuthorityArn:ImportCertificateAuthorityCertificate' :: Text
certificateAuthorityArn =
          Text
pCertificateAuthorityArn_,
        $sel:certificate:ImportCertificateAuthorityCertificate' :: Base64
certificate =
          Tagged ByteString (Identity ByteString)
-> Tagged Base64 (Identity Base64)
Iso' Base64 ByteString
Core._Base64 (Tagged ByteString (Identity ByteString)
 -> Tagged Base64 (Identity Base64))
-> ByteString -> Base64
forall t b. AReview t b -> b -> t
Lens.# ByteString
pCertificate_
      }

-- | A PEM-encoded file that contains all of your certificates, other than
-- the certificate you\'re importing, chaining up to your root CA. Your ACM
-- Private CA-hosted or on-premises root certificate is the last in the
-- chain, and each certificate in the chain signs the one preceding.
--
-- This parameter must be supplied when you import a subordinate CA. When
-- you import a root CA, there is no chain.--
-- -- /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.
importCertificateAuthorityCertificate_certificateChain :: Lens.Lens' ImportCertificateAuthorityCertificate (Prelude.Maybe Prelude.ByteString)
importCertificateAuthorityCertificate_certificateChain :: (Maybe ByteString -> f (Maybe ByteString))
-> ImportCertificateAuthorityCertificate
-> f ImportCertificateAuthorityCertificate
importCertificateAuthorityCertificate_certificateChain = (ImportCertificateAuthorityCertificate -> Maybe Base64)
-> (ImportCertificateAuthorityCertificate
    -> Maybe Base64 -> ImportCertificateAuthorityCertificate)
-> Lens
     ImportCertificateAuthorityCertificate
     ImportCertificateAuthorityCertificate
     (Maybe Base64)
     (Maybe Base64)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ImportCertificateAuthorityCertificate' {Maybe Base64
certificateChain :: Maybe Base64
$sel:certificateChain:ImportCertificateAuthorityCertificate' :: ImportCertificateAuthorityCertificate -> Maybe Base64
certificateChain} -> Maybe Base64
certificateChain) (\s :: ImportCertificateAuthorityCertificate
s@ImportCertificateAuthorityCertificate' {} Maybe Base64
a -> ImportCertificateAuthorityCertificate
s {$sel:certificateChain:ImportCertificateAuthorityCertificate' :: Maybe Base64
certificateChain = Maybe Base64
a} :: ImportCertificateAuthorityCertificate) ((Maybe Base64 -> f (Maybe Base64))
 -> ImportCertificateAuthorityCertificate
 -> f ImportCertificateAuthorityCertificate)
-> ((Maybe ByteString -> f (Maybe ByteString))
    -> Maybe Base64 -> f (Maybe Base64))
-> (Maybe ByteString -> f (Maybe ByteString))
-> ImportCertificateAuthorityCertificate
-> f ImportCertificateAuthorityCertificate
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso Base64 Base64 ByteString ByteString
-> Iso
     (Maybe Base64) (Maybe Base64) (Maybe ByteString) (Maybe ByteString)
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 Base64 Base64 ByteString ByteString
Iso' Base64 ByteString
Core._Base64

-- | The Amazon Resource Name (ARN) that was returned when you called
-- <https://docs.aws.amazon.com/acm-pca/latest/APIReference/API_CreateCertificateAuthority.html CreateCertificateAuthority>.
-- This must be of the form:
--
-- @arn:aws:acm-pca:region:account:certificate-authority\/12345678-1234-1234-1234-123456789012 @
importCertificateAuthorityCertificate_certificateAuthorityArn :: Lens.Lens' ImportCertificateAuthorityCertificate Prelude.Text
importCertificateAuthorityCertificate_certificateAuthorityArn :: (Text -> f Text)
-> ImportCertificateAuthorityCertificate
-> f ImportCertificateAuthorityCertificate
importCertificateAuthorityCertificate_certificateAuthorityArn = (ImportCertificateAuthorityCertificate -> Text)
-> (ImportCertificateAuthorityCertificate
    -> Text -> ImportCertificateAuthorityCertificate)
-> Lens
     ImportCertificateAuthorityCertificate
     ImportCertificateAuthorityCertificate
     Text
     Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ImportCertificateAuthorityCertificate' {Text
certificateAuthorityArn :: Text
$sel:certificateAuthorityArn:ImportCertificateAuthorityCertificate' :: ImportCertificateAuthorityCertificate -> Text
certificateAuthorityArn} -> Text
certificateAuthorityArn) (\s :: ImportCertificateAuthorityCertificate
s@ImportCertificateAuthorityCertificate' {} Text
a -> ImportCertificateAuthorityCertificate
s {$sel:certificateAuthorityArn:ImportCertificateAuthorityCertificate' :: Text
certificateAuthorityArn = Text
a} :: ImportCertificateAuthorityCertificate)

-- | The PEM-encoded certificate for a private CA. This may be a self-signed
-- certificate in the case of a root CA, or it may be signed by another CA
-- that you control.--
-- -- /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.
importCertificateAuthorityCertificate_certificate :: Lens.Lens' ImportCertificateAuthorityCertificate Prelude.ByteString
importCertificateAuthorityCertificate_certificate :: (ByteString -> f ByteString)
-> ImportCertificateAuthorityCertificate
-> f ImportCertificateAuthorityCertificate
importCertificateAuthorityCertificate_certificate = (ImportCertificateAuthorityCertificate -> Base64)
-> (ImportCertificateAuthorityCertificate
    -> Base64 -> ImportCertificateAuthorityCertificate)
-> Lens
     ImportCertificateAuthorityCertificate
     ImportCertificateAuthorityCertificate
     Base64
     Base64
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ImportCertificateAuthorityCertificate' {Base64
certificate :: Base64
$sel:certificate:ImportCertificateAuthorityCertificate' :: ImportCertificateAuthorityCertificate -> Base64
certificate} -> Base64
certificate) (\s :: ImportCertificateAuthorityCertificate
s@ImportCertificateAuthorityCertificate' {} Base64
a -> ImportCertificateAuthorityCertificate
s {$sel:certificate:ImportCertificateAuthorityCertificate' :: Base64
certificate = Base64
a} :: ImportCertificateAuthorityCertificate) ((Base64 -> f Base64)
 -> ImportCertificateAuthorityCertificate
 -> f ImportCertificateAuthorityCertificate)
-> ((ByteString -> f ByteString) -> Base64 -> f Base64)
-> (ByteString -> f ByteString)
-> ImportCertificateAuthorityCertificate
-> f ImportCertificateAuthorityCertificate
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
    ImportCertificateAuthorityCertificate
  where
  type
    AWSResponse
      ImportCertificateAuthorityCertificate =
      ImportCertificateAuthorityCertificateResponse
  request :: ImportCertificateAuthorityCertificate
-> Request ImportCertificateAuthorityCertificate
request = Service
-> ImportCertificateAuthorityCertificate
-> Request ImportCertificateAuthorityCertificate
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy ImportCertificateAuthorityCertificate
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse
           (AWSResponse ImportCertificateAuthorityCertificate)))
response =
    AWSResponse ImportCertificateAuthorityCertificate
-> Logger
-> Service
-> Proxy ImportCertificateAuthorityCertificate
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse
           (AWSResponse ImportCertificateAuthorityCertificate)))
forall (m :: * -> *) a.
MonadResource m =>
AWSResponse a
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveNull
      AWSResponse ImportCertificateAuthorityCertificate
ImportCertificateAuthorityCertificateResponse
ImportCertificateAuthorityCertificateResponse'

instance
  Prelude.Hashable
    ImportCertificateAuthorityCertificate

instance
  Prelude.NFData
    ImportCertificateAuthorityCertificate

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

instance
  Core.ToJSON
    ImportCertificateAuthorityCertificate
  where
  toJSON :: ImportCertificateAuthorityCertificate -> Value
toJSON ImportCertificateAuthorityCertificate' {Maybe Base64
Text
Base64
certificate :: Base64
certificateAuthorityArn :: Text
certificateChain :: Maybe Base64
$sel:certificate:ImportCertificateAuthorityCertificate' :: ImportCertificateAuthorityCertificate -> Base64
$sel:certificateAuthorityArn:ImportCertificateAuthorityCertificate' :: ImportCertificateAuthorityCertificate -> Text
$sel:certificateChain:ImportCertificateAuthorityCertificate' :: ImportCertificateAuthorityCertificate -> Maybe Base64
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"CertificateChain" Text -> Base64 -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Base64 -> Pair) -> Maybe Base64 -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Base64
certificateChain,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              ( Text
"CertificateAuthorityArn"
                  Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
certificateAuthorityArn
              ),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Certificate" Text -> Base64 -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Base64
certificate)
          ]
      )

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

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

-- | /See:/ 'newImportCertificateAuthorityCertificateResponse' smart constructor.
data ImportCertificateAuthorityCertificateResponse = ImportCertificateAuthorityCertificateResponse'
  {
  }
  deriving (ImportCertificateAuthorityCertificateResponse
-> ImportCertificateAuthorityCertificateResponse -> Bool
(ImportCertificateAuthorityCertificateResponse
 -> ImportCertificateAuthorityCertificateResponse -> Bool)
-> (ImportCertificateAuthorityCertificateResponse
    -> ImportCertificateAuthorityCertificateResponse -> Bool)
-> Eq ImportCertificateAuthorityCertificateResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ImportCertificateAuthorityCertificateResponse
-> ImportCertificateAuthorityCertificateResponse -> Bool
$c/= :: ImportCertificateAuthorityCertificateResponse
-> ImportCertificateAuthorityCertificateResponse -> Bool
== :: ImportCertificateAuthorityCertificateResponse
-> ImportCertificateAuthorityCertificateResponse -> Bool
$c== :: ImportCertificateAuthorityCertificateResponse
-> ImportCertificateAuthorityCertificateResponse -> Bool
Prelude.Eq, ReadPrec [ImportCertificateAuthorityCertificateResponse]
ReadPrec ImportCertificateAuthorityCertificateResponse
Int -> ReadS ImportCertificateAuthorityCertificateResponse
ReadS [ImportCertificateAuthorityCertificateResponse]
(Int -> ReadS ImportCertificateAuthorityCertificateResponse)
-> ReadS [ImportCertificateAuthorityCertificateResponse]
-> ReadPrec ImportCertificateAuthorityCertificateResponse
-> ReadPrec [ImportCertificateAuthorityCertificateResponse]
-> Read ImportCertificateAuthorityCertificateResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ImportCertificateAuthorityCertificateResponse]
$creadListPrec :: ReadPrec [ImportCertificateAuthorityCertificateResponse]
readPrec :: ReadPrec ImportCertificateAuthorityCertificateResponse
$creadPrec :: ReadPrec ImportCertificateAuthorityCertificateResponse
readList :: ReadS [ImportCertificateAuthorityCertificateResponse]
$creadList :: ReadS [ImportCertificateAuthorityCertificateResponse]
readsPrec :: Int -> ReadS ImportCertificateAuthorityCertificateResponse
$creadsPrec :: Int -> ReadS ImportCertificateAuthorityCertificateResponse
Prelude.Read, Int -> ImportCertificateAuthorityCertificateResponse -> ShowS
[ImportCertificateAuthorityCertificateResponse] -> ShowS
ImportCertificateAuthorityCertificateResponse -> String
(Int -> ImportCertificateAuthorityCertificateResponse -> ShowS)
-> (ImportCertificateAuthorityCertificateResponse -> String)
-> ([ImportCertificateAuthorityCertificateResponse] -> ShowS)
-> Show ImportCertificateAuthorityCertificateResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ImportCertificateAuthorityCertificateResponse] -> ShowS
$cshowList :: [ImportCertificateAuthorityCertificateResponse] -> ShowS
show :: ImportCertificateAuthorityCertificateResponse -> String
$cshow :: ImportCertificateAuthorityCertificateResponse -> String
showsPrec :: Int -> ImportCertificateAuthorityCertificateResponse -> ShowS
$cshowsPrec :: Int -> ImportCertificateAuthorityCertificateResponse -> ShowS
Prelude.Show, (forall x.
 ImportCertificateAuthorityCertificateResponse
 -> Rep ImportCertificateAuthorityCertificateResponse x)
-> (forall x.
    Rep ImportCertificateAuthorityCertificateResponse x
    -> ImportCertificateAuthorityCertificateResponse)
-> Generic ImportCertificateAuthorityCertificateResponse
forall x.
Rep ImportCertificateAuthorityCertificateResponse x
-> ImportCertificateAuthorityCertificateResponse
forall x.
ImportCertificateAuthorityCertificateResponse
-> Rep ImportCertificateAuthorityCertificateResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ImportCertificateAuthorityCertificateResponse x
-> ImportCertificateAuthorityCertificateResponse
$cfrom :: forall x.
ImportCertificateAuthorityCertificateResponse
-> Rep ImportCertificateAuthorityCertificateResponse x
Prelude.Generic)

-- |
-- Create a value of 'ImportCertificateAuthorityCertificateResponse' 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.
newImportCertificateAuthorityCertificateResponse ::
  ImportCertificateAuthorityCertificateResponse
newImportCertificateAuthorityCertificateResponse :: ImportCertificateAuthorityCertificateResponse
newImportCertificateAuthorityCertificateResponse =
  ImportCertificateAuthorityCertificateResponse
ImportCertificateAuthorityCertificateResponse'

instance
  Prelude.NFData
    ImportCertificateAuthorityCertificateResponse