{-# 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.WorkMail.DeleteAccessControlRule
(
DeleteAccessControlRule (..),
newDeleteAccessControlRule,
deleteAccessControlRule_organizationId,
deleteAccessControlRule_name,
DeleteAccessControlRuleResponse (..),
newDeleteAccessControlRuleResponse,
deleteAccessControlRuleResponse_httpStatus,
)
where
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
import Amazonka.WorkMail.Types
data DeleteAccessControlRule = DeleteAccessControlRule'
{
DeleteAccessControlRule -> Text
organizationId :: Prelude.Text,
DeleteAccessControlRule -> Text
name :: Prelude.Text
}
deriving (DeleteAccessControlRule -> DeleteAccessControlRule -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteAccessControlRule -> DeleteAccessControlRule -> Bool
$c/= :: DeleteAccessControlRule -> DeleteAccessControlRule -> Bool
== :: DeleteAccessControlRule -> DeleteAccessControlRule -> Bool
$c== :: DeleteAccessControlRule -> DeleteAccessControlRule -> Bool
Prelude.Eq, ReadPrec [DeleteAccessControlRule]
ReadPrec DeleteAccessControlRule
Int -> ReadS DeleteAccessControlRule
ReadS [DeleteAccessControlRule]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteAccessControlRule]
$creadListPrec :: ReadPrec [DeleteAccessControlRule]
readPrec :: ReadPrec DeleteAccessControlRule
$creadPrec :: ReadPrec DeleteAccessControlRule
readList :: ReadS [DeleteAccessControlRule]
$creadList :: ReadS [DeleteAccessControlRule]
readsPrec :: Int -> ReadS DeleteAccessControlRule
$creadsPrec :: Int -> ReadS DeleteAccessControlRule
Prelude.Read, Int -> DeleteAccessControlRule -> ShowS
[DeleteAccessControlRule] -> ShowS
DeleteAccessControlRule -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteAccessControlRule] -> ShowS
$cshowList :: [DeleteAccessControlRule] -> ShowS
show :: DeleteAccessControlRule -> String
$cshow :: DeleteAccessControlRule -> String
showsPrec :: Int -> DeleteAccessControlRule -> ShowS
$cshowsPrec :: Int -> DeleteAccessControlRule -> ShowS
Prelude.Show, forall x. Rep DeleteAccessControlRule x -> DeleteAccessControlRule
forall x. DeleteAccessControlRule -> Rep DeleteAccessControlRule x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteAccessControlRule x -> DeleteAccessControlRule
$cfrom :: forall x. DeleteAccessControlRule -> Rep DeleteAccessControlRule x
Prelude.Generic)
newDeleteAccessControlRule ::
Prelude.Text ->
Prelude.Text ->
DeleteAccessControlRule
newDeleteAccessControlRule :: Text -> Text -> DeleteAccessControlRule
newDeleteAccessControlRule Text
pOrganizationId_ Text
pName_ =
DeleteAccessControlRule'
{ $sel:organizationId:DeleteAccessControlRule' :: Text
organizationId =
Text
pOrganizationId_,
$sel:name:DeleteAccessControlRule' :: Text
name = Text
pName_
}
deleteAccessControlRule_organizationId :: Lens.Lens' DeleteAccessControlRule Prelude.Text
deleteAccessControlRule_organizationId :: Lens' DeleteAccessControlRule Text
deleteAccessControlRule_organizationId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteAccessControlRule' {Text
organizationId :: Text
$sel:organizationId:DeleteAccessControlRule' :: DeleteAccessControlRule -> Text
organizationId} -> Text
organizationId) (\s :: DeleteAccessControlRule
s@DeleteAccessControlRule' {} Text
a -> DeleteAccessControlRule
s {$sel:organizationId:DeleteAccessControlRule' :: Text
organizationId = Text
a} :: DeleteAccessControlRule)
deleteAccessControlRule_name :: Lens.Lens' DeleteAccessControlRule Prelude.Text
deleteAccessControlRule_name :: Lens' DeleteAccessControlRule Text
deleteAccessControlRule_name = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteAccessControlRule' {Text
name :: Text
$sel:name:DeleteAccessControlRule' :: DeleteAccessControlRule -> Text
name} -> Text
name) (\s :: DeleteAccessControlRule
s@DeleteAccessControlRule' {} Text
a -> DeleteAccessControlRule
s {$sel:name:DeleteAccessControlRule' :: Text
name = Text
a} :: DeleteAccessControlRule)
instance Core.AWSRequest DeleteAccessControlRule where
type
AWSResponse DeleteAccessControlRule =
DeleteAccessControlRuleResponse
request :: (Service -> Service)
-> DeleteAccessControlRule -> Request DeleteAccessControlRule
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 DeleteAccessControlRule
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DeleteAccessControlRule)))
response =
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> () -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveEmpty
( \Int
s ResponseHeaders
h ()
x ->
Int -> DeleteAccessControlRuleResponse
DeleteAccessControlRuleResponse'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
)
instance Prelude.Hashable DeleteAccessControlRule where
hashWithSalt :: Int -> DeleteAccessControlRule -> Int
hashWithSalt Int
_salt DeleteAccessControlRule' {Text
name :: Text
organizationId :: Text
$sel:name:DeleteAccessControlRule' :: DeleteAccessControlRule -> Text
$sel:organizationId:DeleteAccessControlRule' :: DeleteAccessControlRule -> Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
organizationId
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
name
instance Prelude.NFData DeleteAccessControlRule where
rnf :: DeleteAccessControlRule -> ()
rnf DeleteAccessControlRule' {Text
name :: Text
organizationId :: Text
$sel:name:DeleteAccessControlRule' :: DeleteAccessControlRule -> Text
$sel:organizationId:DeleteAccessControlRule' :: DeleteAccessControlRule -> Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Text
organizationId
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
name
instance Data.ToHeaders DeleteAccessControlRule where
toHeaders :: DeleteAccessControlRule -> ResponseHeaders
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 -> ResponseHeaders
Data.=# ( ByteString
"WorkMailService.DeleteAccessControlRule" ::
Prelude.ByteString
),
HeaderName
"Content-Type"
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Data.ToJSON DeleteAccessControlRule where
toJSON :: DeleteAccessControlRule -> Value
toJSON DeleteAccessControlRule' {Text
name :: Text
organizationId :: Text
$sel:name:DeleteAccessControlRule' :: DeleteAccessControlRule -> Text
$sel:organizationId:DeleteAccessControlRule' :: DeleteAccessControlRule -> Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ forall a. a -> Maybe a
Prelude.Just
(Key
"OrganizationId" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
organizationId),
forall a. a -> Maybe a
Prelude.Just (Key
"Name" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
name)
]
)
instance Data.ToPath DeleteAccessControlRule where
toPath :: DeleteAccessControlRule -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Data.ToQuery DeleteAccessControlRule where
toQuery :: DeleteAccessControlRule -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data DeleteAccessControlRuleResponse = DeleteAccessControlRuleResponse'
{
DeleteAccessControlRuleResponse -> Int
httpStatus :: Prelude.Int
}
deriving (DeleteAccessControlRuleResponse
-> DeleteAccessControlRuleResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteAccessControlRuleResponse
-> DeleteAccessControlRuleResponse -> Bool
$c/= :: DeleteAccessControlRuleResponse
-> DeleteAccessControlRuleResponse -> Bool
== :: DeleteAccessControlRuleResponse
-> DeleteAccessControlRuleResponse -> Bool
$c== :: DeleteAccessControlRuleResponse
-> DeleteAccessControlRuleResponse -> Bool
Prelude.Eq, ReadPrec [DeleteAccessControlRuleResponse]
ReadPrec DeleteAccessControlRuleResponse
Int -> ReadS DeleteAccessControlRuleResponse
ReadS [DeleteAccessControlRuleResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteAccessControlRuleResponse]
$creadListPrec :: ReadPrec [DeleteAccessControlRuleResponse]
readPrec :: ReadPrec DeleteAccessControlRuleResponse
$creadPrec :: ReadPrec DeleteAccessControlRuleResponse
readList :: ReadS [DeleteAccessControlRuleResponse]
$creadList :: ReadS [DeleteAccessControlRuleResponse]
readsPrec :: Int -> ReadS DeleteAccessControlRuleResponse
$creadsPrec :: Int -> ReadS DeleteAccessControlRuleResponse
Prelude.Read, Int -> DeleteAccessControlRuleResponse -> ShowS
[DeleteAccessControlRuleResponse] -> ShowS
DeleteAccessControlRuleResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteAccessControlRuleResponse] -> ShowS
$cshowList :: [DeleteAccessControlRuleResponse] -> ShowS
show :: DeleteAccessControlRuleResponse -> String
$cshow :: DeleteAccessControlRuleResponse -> String
showsPrec :: Int -> DeleteAccessControlRuleResponse -> ShowS
$cshowsPrec :: Int -> DeleteAccessControlRuleResponse -> ShowS
Prelude.Show, forall x.
Rep DeleteAccessControlRuleResponse x
-> DeleteAccessControlRuleResponse
forall x.
DeleteAccessControlRuleResponse
-> Rep DeleteAccessControlRuleResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DeleteAccessControlRuleResponse x
-> DeleteAccessControlRuleResponse
$cfrom :: forall x.
DeleteAccessControlRuleResponse
-> Rep DeleteAccessControlRuleResponse x
Prelude.Generic)
newDeleteAccessControlRuleResponse ::
Prelude.Int ->
DeleteAccessControlRuleResponse
newDeleteAccessControlRuleResponse :: Int -> DeleteAccessControlRuleResponse
newDeleteAccessControlRuleResponse Int
pHttpStatus_ =
DeleteAccessControlRuleResponse'
{ $sel:httpStatus:DeleteAccessControlRuleResponse' :: Int
httpStatus =
Int
pHttpStatus_
}
deleteAccessControlRuleResponse_httpStatus :: Lens.Lens' DeleteAccessControlRuleResponse Prelude.Int
deleteAccessControlRuleResponse_httpStatus :: Lens' DeleteAccessControlRuleResponse Int
deleteAccessControlRuleResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteAccessControlRuleResponse' {Int
httpStatus :: Int
$sel:httpStatus:DeleteAccessControlRuleResponse' :: DeleteAccessControlRuleResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DeleteAccessControlRuleResponse
s@DeleteAccessControlRuleResponse' {} Int
a -> DeleteAccessControlRuleResponse
s {$sel:httpStatus:DeleteAccessControlRuleResponse' :: Int
httpStatus = Int
a} :: DeleteAccessControlRuleResponse)
instance
Prelude.NFData
DeleteAccessControlRuleResponse
where
rnf :: DeleteAccessControlRuleResponse -> ()
rnf DeleteAccessControlRuleResponse' {Int
httpStatus :: Int
$sel:httpStatus:DeleteAccessControlRuleResponse' :: DeleteAccessControlRuleResponse -> Int
..} =
forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus