{-# 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.RestoreCertificateAuthority
(
RestoreCertificateAuthority (..),
newRestoreCertificateAuthority,
restoreCertificateAuthority_certificateAuthorityArn,
RestoreCertificateAuthorityResponse (..),
newRestoreCertificateAuthorityResponse,
)
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 RestoreCertificateAuthority = RestoreCertificateAuthority'
{
RestoreCertificateAuthority -> Text
certificateAuthorityArn :: Prelude.Text
}
deriving (RestoreCertificateAuthority -> RestoreCertificateAuthority -> Bool
(RestoreCertificateAuthority
-> RestoreCertificateAuthority -> Bool)
-> (RestoreCertificateAuthority
-> RestoreCertificateAuthority -> Bool)
-> Eq RestoreCertificateAuthority
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: RestoreCertificateAuthority -> RestoreCertificateAuthority -> Bool
$c/= :: RestoreCertificateAuthority -> RestoreCertificateAuthority -> Bool
== :: RestoreCertificateAuthority -> RestoreCertificateAuthority -> Bool
$c== :: RestoreCertificateAuthority -> RestoreCertificateAuthority -> Bool
Prelude.Eq, ReadPrec [RestoreCertificateAuthority]
ReadPrec RestoreCertificateAuthority
Int -> ReadS RestoreCertificateAuthority
ReadS [RestoreCertificateAuthority]
(Int -> ReadS RestoreCertificateAuthority)
-> ReadS [RestoreCertificateAuthority]
-> ReadPrec RestoreCertificateAuthority
-> ReadPrec [RestoreCertificateAuthority]
-> Read RestoreCertificateAuthority
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [RestoreCertificateAuthority]
$creadListPrec :: ReadPrec [RestoreCertificateAuthority]
readPrec :: ReadPrec RestoreCertificateAuthority
$creadPrec :: ReadPrec RestoreCertificateAuthority
readList :: ReadS [RestoreCertificateAuthority]
$creadList :: ReadS [RestoreCertificateAuthority]
readsPrec :: Int -> ReadS RestoreCertificateAuthority
$creadsPrec :: Int -> ReadS RestoreCertificateAuthority
Prelude.Read, Int -> RestoreCertificateAuthority -> ShowS
[RestoreCertificateAuthority] -> ShowS
RestoreCertificateAuthority -> String
(Int -> RestoreCertificateAuthority -> ShowS)
-> (RestoreCertificateAuthority -> String)
-> ([RestoreCertificateAuthority] -> ShowS)
-> Show RestoreCertificateAuthority
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [RestoreCertificateAuthority] -> ShowS
$cshowList :: [RestoreCertificateAuthority] -> ShowS
show :: RestoreCertificateAuthority -> String
$cshow :: RestoreCertificateAuthority -> String
showsPrec :: Int -> RestoreCertificateAuthority -> ShowS
$cshowsPrec :: Int -> RestoreCertificateAuthority -> ShowS
Prelude.Show, (forall x.
RestoreCertificateAuthority -> Rep RestoreCertificateAuthority x)
-> (forall x.
Rep RestoreCertificateAuthority x -> RestoreCertificateAuthority)
-> Generic RestoreCertificateAuthority
forall x.
Rep RestoreCertificateAuthority x -> RestoreCertificateAuthority
forall x.
RestoreCertificateAuthority -> Rep RestoreCertificateAuthority x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep RestoreCertificateAuthority x -> RestoreCertificateAuthority
$cfrom :: forall x.
RestoreCertificateAuthority -> Rep RestoreCertificateAuthority x
Prelude.Generic)
newRestoreCertificateAuthority ::
Prelude.Text ->
RestoreCertificateAuthority
newRestoreCertificateAuthority :: Text -> RestoreCertificateAuthority
newRestoreCertificateAuthority
Text
pCertificateAuthorityArn_ =
RestoreCertificateAuthority' :: Text -> RestoreCertificateAuthority
RestoreCertificateAuthority'
{ $sel:certificateAuthorityArn:RestoreCertificateAuthority' :: Text
certificateAuthorityArn =
Text
pCertificateAuthorityArn_
}
restoreCertificateAuthority_certificateAuthorityArn :: Lens.Lens' RestoreCertificateAuthority Prelude.Text
restoreCertificateAuthority_certificateAuthorityArn :: (Text -> f Text)
-> RestoreCertificateAuthority -> f RestoreCertificateAuthority
restoreCertificateAuthority_certificateAuthorityArn = (RestoreCertificateAuthority -> Text)
-> (RestoreCertificateAuthority
-> Text -> RestoreCertificateAuthority)
-> Lens
RestoreCertificateAuthority RestoreCertificateAuthority Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RestoreCertificateAuthority' {Text
certificateAuthorityArn :: Text
$sel:certificateAuthorityArn:RestoreCertificateAuthority' :: RestoreCertificateAuthority -> Text
certificateAuthorityArn} -> Text
certificateAuthorityArn) (\s :: RestoreCertificateAuthority
s@RestoreCertificateAuthority' {} Text
a -> RestoreCertificateAuthority
s {$sel:certificateAuthorityArn:RestoreCertificateAuthority' :: Text
certificateAuthorityArn = Text
a} :: RestoreCertificateAuthority)
instance Core.AWSRequest RestoreCertificateAuthority where
type
AWSResponse RestoreCertificateAuthority =
RestoreCertificateAuthorityResponse
request :: RestoreCertificateAuthority -> Request RestoreCertificateAuthority
request = Service
-> RestoreCertificateAuthority
-> Request RestoreCertificateAuthority
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy RestoreCertificateAuthority
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse RestoreCertificateAuthority)))
response =
AWSResponse RestoreCertificateAuthority
-> Logger
-> Service
-> Proxy RestoreCertificateAuthority
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse RestoreCertificateAuthority)))
forall (m :: * -> *) a.
MonadResource m =>
AWSResponse a
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveNull
AWSResponse RestoreCertificateAuthority
RestoreCertificateAuthorityResponse
RestoreCertificateAuthorityResponse'
instance Prelude.Hashable RestoreCertificateAuthority
instance Prelude.NFData RestoreCertificateAuthority
instance Core.ToHeaders RestoreCertificateAuthority where
toHeaders :: RestoreCertificateAuthority -> [Header]
toHeaders =
[Header] -> RestoreCertificateAuthority -> [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.RestoreCertificateAuthority" ::
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 RestoreCertificateAuthority where
toJSON :: RestoreCertificateAuthority -> Value
toJSON RestoreCertificateAuthority' {Text
certificateAuthorityArn :: Text
$sel:certificateAuthorityArn:RestoreCertificateAuthority' :: RestoreCertificateAuthority -> 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
"CertificateAuthorityArn"
Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
certificateAuthorityArn
)
]
)
instance Core.ToPath RestoreCertificateAuthority where
toPath :: RestoreCertificateAuthority -> ByteString
toPath = ByteString -> RestoreCertificateAuthority -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery RestoreCertificateAuthority where
toQuery :: RestoreCertificateAuthority -> QueryString
toQuery = QueryString -> RestoreCertificateAuthority -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data RestoreCertificateAuthorityResponse = RestoreCertificateAuthorityResponse'
{
}
deriving (RestoreCertificateAuthorityResponse
-> RestoreCertificateAuthorityResponse -> Bool
(RestoreCertificateAuthorityResponse
-> RestoreCertificateAuthorityResponse -> Bool)
-> (RestoreCertificateAuthorityResponse
-> RestoreCertificateAuthorityResponse -> Bool)
-> Eq RestoreCertificateAuthorityResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: RestoreCertificateAuthorityResponse
-> RestoreCertificateAuthorityResponse -> Bool
$c/= :: RestoreCertificateAuthorityResponse
-> RestoreCertificateAuthorityResponse -> Bool
== :: RestoreCertificateAuthorityResponse
-> RestoreCertificateAuthorityResponse -> Bool
$c== :: RestoreCertificateAuthorityResponse
-> RestoreCertificateAuthorityResponse -> Bool
Prelude.Eq, ReadPrec [RestoreCertificateAuthorityResponse]
ReadPrec RestoreCertificateAuthorityResponse
Int -> ReadS RestoreCertificateAuthorityResponse
ReadS [RestoreCertificateAuthorityResponse]
(Int -> ReadS RestoreCertificateAuthorityResponse)
-> ReadS [RestoreCertificateAuthorityResponse]
-> ReadPrec RestoreCertificateAuthorityResponse
-> ReadPrec [RestoreCertificateAuthorityResponse]
-> Read RestoreCertificateAuthorityResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [RestoreCertificateAuthorityResponse]
$creadListPrec :: ReadPrec [RestoreCertificateAuthorityResponse]
readPrec :: ReadPrec RestoreCertificateAuthorityResponse
$creadPrec :: ReadPrec RestoreCertificateAuthorityResponse
readList :: ReadS [RestoreCertificateAuthorityResponse]
$creadList :: ReadS [RestoreCertificateAuthorityResponse]
readsPrec :: Int -> ReadS RestoreCertificateAuthorityResponse
$creadsPrec :: Int -> ReadS RestoreCertificateAuthorityResponse
Prelude.Read, Int -> RestoreCertificateAuthorityResponse -> ShowS
[RestoreCertificateAuthorityResponse] -> ShowS
RestoreCertificateAuthorityResponse -> String
(Int -> RestoreCertificateAuthorityResponse -> ShowS)
-> (RestoreCertificateAuthorityResponse -> String)
-> ([RestoreCertificateAuthorityResponse] -> ShowS)
-> Show RestoreCertificateAuthorityResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [RestoreCertificateAuthorityResponse] -> ShowS
$cshowList :: [RestoreCertificateAuthorityResponse] -> ShowS
show :: RestoreCertificateAuthorityResponse -> String
$cshow :: RestoreCertificateAuthorityResponse -> String
showsPrec :: Int -> RestoreCertificateAuthorityResponse -> ShowS
$cshowsPrec :: Int -> RestoreCertificateAuthorityResponse -> ShowS
Prelude.Show, (forall x.
RestoreCertificateAuthorityResponse
-> Rep RestoreCertificateAuthorityResponse x)
-> (forall x.
Rep RestoreCertificateAuthorityResponse x
-> RestoreCertificateAuthorityResponse)
-> Generic RestoreCertificateAuthorityResponse
forall x.
Rep RestoreCertificateAuthorityResponse x
-> RestoreCertificateAuthorityResponse
forall x.
RestoreCertificateAuthorityResponse
-> Rep RestoreCertificateAuthorityResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep RestoreCertificateAuthorityResponse x
-> RestoreCertificateAuthorityResponse
$cfrom :: forall x.
RestoreCertificateAuthorityResponse
-> Rep RestoreCertificateAuthorityResponse x
Prelude.Generic)
newRestoreCertificateAuthorityResponse ::
RestoreCertificateAuthorityResponse
newRestoreCertificateAuthorityResponse :: RestoreCertificateAuthorityResponse
newRestoreCertificateAuthorityResponse =
RestoreCertificateAuthorityResponse
RestoreCertificateAuthorityResponse'
instance
Prelude.NFData
RestoreCertificateAuthorityResponse