{-# 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 #-}
module Amazonka.CertificateManagerPCA.ImportCertificateAuthorityCertificate
(
ImportCertificateAuthorityCertificate (..),
newImportCertificateAuthorityCertificate,
importCertificateAuthorityCertificate_certificateChain,
importCertificateAuthorityCertificate_certificateAuthorityArn,
importCertificateAuthorityCertificate_certificate,
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
data ImportCertificateAuthorityCertificate = ImportCertificateAuthorityCertificate'
{
ImportCertificateAuthorityCertificate -> Maybe Base64
certificateChain :: Prelude.Maybe Core.Base64,
ImportCertificateAuthorityCertificate -> Text
certificateAuthorityArn :: Prelude.Text,
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)
newImportCertificateAuthorityCertificate ::
Prelude.Text ->
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_
}
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
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)
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
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)
newImportCertificateAuthorityCertificateResponse ::
ImportCertificateAuthorityCertificateResponse
newImportCertificateAuthorityCertificateResponse :: ImportCertificateAuthorityCertificateResponse
newImportCertificateAuthorityCertificateResponse =
ImportCertificateAuthorityCertificateResponse
ImportCertificateAuthorityCertificateResponse'
instance
Prelude.NFData
ImportCertificateAuthorityCertificateResponse