{-# 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.RevokeCertificate
(
RevokeCertificate (..),
newRevokeCertificate,
revokeCertificate_certificateAuthorityArn,
revokeCertificate_certificateSerial,
revokeCertificate_revocationReason,
RevokeCertificateResponse (..),
newRevokeCertificateResponse,
)
where
import Amazonka.CertificateManagerPCA.Types
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data RevokeCertificate = RevokeCertificate'
{
RevokeCertificate -> Text
certificateAuthorityArn :: Prelude.Text,
RevokeCertificate -> Text
certificateSerial :: Prelude.Text,
RevokeCertificate -> RevocationReason
revocationReason :: RevocationReason
}
deriving (RevokeCertificate -> RevokeCertificate -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: RevokeCertificate -> RevokeCertificate -> Bool
$c/= :: RevokeCertificate -> RevokeCertificate -> Bool
== :: RevokeCertificate -> RevokeCertificate -> Bool
$c== :: RevokeCertificate -> RevokeCertificate -> Bool
Prelude.Eq, ReadPrec [RevokeCertificate]
ReadPrec RevokeCertificate
Int -> ReadS RevokeCertificate
ReadS [RevokeCertificate]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [RevokeCertificate]
$creadListPrec :: ReadPrec [RevokeCertificate]
readPrec :: ReadPrec RevokeCertificate
$creadPrec :: ReadPrec RevokeCertificate
readList :: ReadS [RevokeCertificate]
$creadList :: ReadS [RevokeCertificate]
readsPrec :: Int -> ReadS RevokeCertificate
$creadsPrec :: Int -> ReadS RevokeCertificate
Prelude.Read, Int -> RevokeCertificate -> ShowS
[RevokeCertificate] -> ShowS
RevokeCertificate -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [RevokeCertificate] -> ShowS
$cshowList :: [RevokeCertificate] -> ShowS
show :: RevokeCertificate -> String
$cshow :: RevokeCertificate -> String
showsPrec :: Int -> RevokeCertificate -> ShowS
$cshowsPrec :: Int -> RevokeCertificate -> ShowS
Prelude.Show, forall x. Rep RevokeCertificate x -> RevokeCertificate
forall x. RevokeCertificate -> Rep RevokeCertificate x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep RevokeCertificate x -> RevokeCertificate
$cfrom :: forall x. RevokeCertificate -> Rep RevokeCertificate x
Prelude.Generic)
newRevokeCertificate ::
Prelude.Text ->
Prelude.Text ->
RevocationReason ->
RevokeCertificate
newRevokeCertificate :: Text -> Text -> RevocationReason -> RevokeCertificate
newRevokeCertificate
Text
pCertificateAuthorityArn_
Text
pCertificateSerial_
RevocationReason
pRevocationReason_ =
RevokeCertificate'
{ $sel:certificateAuthorityArn:RevokeCertificate' :: Text
certificateAuthorityArn =
Text
pCertificateAuthorityArn_,
$sel:certificateSerial:RevokeCertificate' :: Text
certificateSerial = Text
pCertificateSerial_,
$sel:revocationReason:RevokeCertificate' :: RevocationReason
revocationReason = RevocationReason
pRevocationReason_
}
revokeCertificate_certificateAuthorityArn :: Lens.Lens' RevokeCertificate Prelude.Text
revokeCertificate_certificateAuthorityArn :: Lens' RevokeCertificate Text
revokeCertificate_certificateAuthorityArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RevokeCertificate' {Text
certificateAuthorityArn :: Text
$sel:certificateAuthorityArn:RevokeCertificate' :: RevokeCertificate -> Text
certificateAuthorityArn} -> Text
certificateAuthorityArn) (\s :: RevokeCertificate
s@RevokeCertificate' {} Text
a -> RevokeCertificate
s {$sel:certificateAuthorityArn:RevokeCertificate' :: Text
certificateAuthorityArn = Text
a} :: RevokeCertificate)
revokeCertificate_certificateSerial :: Lens.Lens' RevokeCertificate Prelude.Text
revokeCertificate_certificateSerial :: Lens' RevokeCertificate Text
revokeCertificate_certificateSerial = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RevokeCertificate' {Text
certificateSerial :: Text
$sel:certificateSerial:RevokeCertificate' :: RevokeCertificate -> Text
certificateSerial} -> Text
certificateSerial) (\s :: RevokeCertificate
s@RevokeCertificate' {} Text
a -> RevokeCertificate
s {$sel:certificateSerial:RevokeCertificate' :: Text
certificateSerial = Text
a} :: RevokeCertificate)
revokeCertificate_revocationReason :: Lens.Lens' RevokeCertificate RevocationReason
revokeCertificate_revocationReason :: Lens' RevokeCertificate RevocationReason
revokeCertificate_revocationReason = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RevokeCertificate' {RevocationReason
revocationReason :: RevocationReason
$sel:revocationReason:RevokeCertificate' :: RevokeCertificate -> RevocationReason
revocationReason} -> RevocationReason
revocationReason) (\s :: RevokeCertificate
s@RevokeCertificate' {} RevocationReason
a -> RevokeCertificate
s {$sel:revocationReason:RevokeCertificate' :: RevocationReason
revocationReason = RevocationReason
a} :: RevokeCertificate)
instance Core.AWSRequest RevokeCertificate where
type
AWSResponse RevokeCertificate =
RevokeCertificateResponse
request :: (Service -> Service)
-> RevokeCertificate -> Request RevokeCertificate
request Service -> Service
overrides =
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON (Service -> Service
overrides Service
defaultService)
response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy RevokeCertificate
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse RevokeCertificate)))
response =
forall (m :: * -> *) a.
MonadResource m =>
AWSResponse a
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveNull RevokeCertificateResponse
RevokeCertificateResponse'
instance Prelude.Hashable RevokeCertificate where
hashWithSalt :: Int -> RevokeCertificate -> Int
hashWithSalt Int
_salt RevokeCertificate' {Text
RevocationReason
revocationReason :: RevocationReason
certificateSerial :: Text
certificateAuthorityArn :: Text
$sel:revocationReason:RevokeCertificate' :: RevokeCertificate -> RevocationReason
$sel:certificateSerial:RevokeCertificate' :: RevokeCertificate -> Text
$sel:certificateAuthorityArn:RevokeCertificate' :: RevokeCertificate -> Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
certificateAuthorityArn
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
certificateSerial
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` RevocationReason
revocationReason
instance Prelude.NFData RevokeCertificate where
rnf :: RevokeCertificate -> ()
rnf RevokeCertificate' {Text
RevocationReason
revocationReason :: RevocationReason
certificateSerial :: Text
certificateAuthorityArn :: Text
$sel:revocationReason:RevokeCertificate' :: RevokeCertificate -> RevocationReason
$sel:certificateSerial:RevokeCertificate' :: RevokeCertificate -> Text
$sel:certificateAuthorityArn:RevokeCertificate' :: RevokeCertificate -> Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Text
certificateAuthorityArn
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
certificateSerial
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf RevocationReason
revocationReason
instance Data.ToHeaders RevokeCertificate where
toHeaders :: RevokeCertificate -> [Header]
toHeaders =
forall a b. a -> b -> a
Prelude.const
( forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"X-Amz-Target"
forall a. ToHeader a => HeaderName -> a -> [Header]
Data.=# ( ByteString
"ACMPrivateCA.RevokeCertificate" ::
Prelude.ByteString
),
HeaderName
"Content-Type"
forall a. ToHeader a => HeaderName -> a -> [Header]
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Data.ToJSON RevokeCertificate where
toJSON :: RevokeCertificate -> Value
toJSON RevokeCertificate' {Text
RevocationReason
revocationReason :: RevocationReason
certificateSerial :: Text
certificateAuthorityArn :: Text
$sel:revocationReason:RevokeCertificate' :: RevokeCertificate -> RevocationReason
$sel:certificateSerial:RevokeCertificate' :: RevokeCertificate -> Text
$sel:certificateAuthorityArn:RevokeCertificate' :: RevokeCertificate -> Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ forall a. a -> Maybe a
Prelude.Just
( Key
"CertificateAuthorityArn"
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
certificateAuthorityArn
),
forall a. a -> Maybe a
Prelude.Just
(Key
"CertificateSerial" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
certificateSerial),
forall a. a -> Maybe a
Prelude.Just
(Key
"RevocationReason" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= RevocationReason
revocationReason)
]
)
instance Data.ToPath RevokeCertificate where
toPath :: RevokeCertificate -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Data.ToQuery RevokeCertificate where
toQuery :: RevokeCertificate -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data RevokeCertificateResponse = RevokeCertificateResponse'
{
}
deriving (RevokeCertificateResponse -> RevokeCertificateResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: RevokeCertificateResponse -> RevokeCertificateResponse -> Bool
$c/= :: RevokeCertificateResponse -> RevokeCertificateResponse -> Bool
== :: RevokeCertificateResponse -> RevokeCertificateResponse -> Bool
$c== :: RevokeCertificateResponse -> RevokeCertificateResponse -> Bool
Prelude.Eq, ReadPrec [RevokeCertificateResponse]
ReadPrec RevokeCertificateResponse
Int -> ReadS RevokeCertificateResponse
ReadS [RevokeCertificateResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [RevokeCertificateResponse]
$creadListPrec :: ReadPrec [RevokeCertificateResponse]
readPrec :: ReadPrec RevokeCertificateResponse
$creadPrec :: ReadPrec RevokeCertificateResponse
readList :: ReadS [RevokeCertificateResponse]
$creadList :: ReadS [RevokeCertificateResponse]
readsPrec :: Int -> ReadS RevokeCertificateResponse
$creadsPrec :: Int -> ReadS RevokeCertificateResponse
Prelude.Read, Int -> RevokeCertificateResponse -> ShowS
[RevokeCertificateResponse] -> ShowS
RevokeCertificateResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [RevokeCertificateResponse] -> ShowS
$cshowList :: [RevokeCertificateResponse] -> ShowS
show :: RevokeCertificateResponse -> String
$cshow :: RevokeCertificateResponse -> String
showsPrec :: Int -> RevokeCertificateResponse -> ShowS
$cshowsPrec :: Int -> RevokeCertificateResponse -> ShowS
Prelude.Show, forall x.
Rep RevokeCertificateResponse x -> RevokeCertificateResponse
forall x.
RevokeCertificateResponse -> Rep RevokeCertificateResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep RevokeCertificateResponse x -> RevokeCertificateResponse
$cfrom :: forall x.
RevokeCertificateResponse -> Rep RevokeCertificateResponse x
Prelude.Generic)
newRevokeCertificateResponse ::
RevokeCertificateResponse
newRevokeCertificateResponse :: RevokeCertificateResponse
newRevokeCertificateResponse =
RevokeCertificateResponse
RevokeCertificateResponse'
instance Prelude.NFData RevokeCertificateResponse where
rnf :: RevokeCertificateResponse -> ()
rnf RevokeCertificateResponse
_ = ()