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