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