{-# 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.PutAccessControlRule
(
PutAccessControlRule (..),
newPutAccessControlRule,
putAccessControlRule_userIds,
putAccessControlRule_actions,
putAccessControlRule_notUserIds,
putAccessControlRule_ipRanges,
putAccessControlRule_notIpRanges,
putAccessControlRule_notActions,
putAccessControlRule_name,
putAccessControlRule_effect,
putAccessControlRule_description,
putAccessControlRule_organizationId,
PutAccessControlRuleResponse (..),
newPutAccessControlRuleResponse,
putAccessControlRuleResponse_httpStatus,
)
where
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
import Amazonka.WorkMail.Types
data PutAccessControlRule = PutAccessControlRule'
{
PutAccessControlRule -> Maybe [Text]
userIds :: Prelude.Maybe [Prelude.Text],
PutAccessControlRule -> Maybe [Text]
actions :: Prelude.Maybe [Prelude.Text],
PutAccessControlRule -> Maybe [Text]
notUserIds :: Prelude.Maybe [Prelude.Text],
PutAccessControlRule -> Maybe [Text]
ipRanges :: Prelude.Maybe [Prelude.Text],
PutAccessControlRule -> Maybe [Text]
notIpRanges :: Prelude.Maybe [Prelude.Text],
PutAccessControlRule -> Maybe [Text]
notActions :: Prelude.Maybe [Prelude.Text],
PutAccessControlRule -> Text
name :: Prelude.Text,
PutAccessControlRule -> AccessControlRuleEffect
effect :: AccessControlRuleEffect,
PutAccessControlRule -> Text
description :: Prelude.Text,
PutAccessControlRule -> Text
organizationId :: Prelude.Text
}
deriving (PutAccessControlRule -> PutAccessControlRule -> Bool
(PutAccessControlRule -> PutAccessControlRule -> Bool)
-> (PutAccessControlRule -> PutAccessControlRule -> Bool)
-> Eq PutAccessControlRule
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PutAccessControlRule -> PutAccessControlRule -> Bool
$c/= :: PutAccessControlRule -> PutAccessControlRule -> Bool
== :: PutAccessControlRule -> PutAccessControlRule -> Bool
$c== :: PutAccessControlRule -> PutAccessControlRule -> Bool
Prelude.Eq, ReadPrec [PutAccessControlRule]
ReadPrec PutAccessControlRule
Int -> ReadS PutAccessControlRule
ReadS [PutAccessControlRule]
(Int -> ReadS PutAccessControlRule)
-> ReadS [PutAccessControlRule]
-> ReadPrec PutAccessControlRule
-> ReadPrec [PutAccessControlRule]
-> Read PutAccessControlRule
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PutAccessControlRule]
$creadListPrec :: ReadPrec [PutAccessControlRule]
readPrec :: ReadPrec PutAccessControlRule
$creadPrec :: ReadPrec PutAccessControlRule
readList :: ReadS [PutAccessControlRule]
$creadList :: ReadS [PutAccessControlRule]
readsPrec :: Int -> ReadS PutAccessControlRule
$creadsPrec :: Int -> ReadS PutAccessControlRule
Prelude.Read, Int -> PutAccessControlRule -> ShowS
[PutAccessControlRule] -> ShowS
PutAccessControlRule -> String
(Int -> PutAccessControlRule -> ShowS)
-> (PutAccessControlRule -> String)
-> ([PutAccessControlRule] -> ShowS)
-> Show PutAccessControlRule
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PutAccessControlRule] -> ShowS
$cshowList :: [PutAccessControlRule] -> ShowS
show :: PutAccessControlRule -> String
$cshow :: PutAccessControlRule -> String
showsPrec :: Int -> PutAccessControlRule -> ShowS
$cshowsPrec :: Int -> PutAccessControlRule -> ShowS
Prelude.Show, (forall x. PutAccessControlRule -> Rep PutAccessControlRule x)
-> (forall x. Rep PutAccessControlRule x -> PutAccessControlRule)
-> Generic PutAccessControlRule
forall x. Rep PutAccessControlRule x -> PutAccessControlRule
forall x. PutAccessControlRule -> Rep PutAccessControlRule x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep PutAccessControlRule x -> PutAccessControlRule
$cfrom :: forall x. PutAccessControlRule -> Rep PutAccessControlRule x
Prelude.Generic)
newPutAccessControlRule ::
Prelude.Text ->
AccessControlRuleEffect ->
Prelude.Text ->
Prelude.Text ->
PutAccessControlRule
newPutAccessControlRule :: Text
-> AccessControlRuleEffect -> Text -> Text -> PutAccessControlRule
newPutAccessControlRule
Text
pName_
AccessControlRuleEffect
pEffect_
Text
pDescription_
Text
pOrganizationId_ =
PutAccessControlRule' :: Maybe [Text]
-> Maybe [Text]
-> Maybe [Text]
-> Maybe [Text]
-> Maybe [Text]
-> Maybe [Text]
-> Text
-> AccessControlRuleEffect
-> Text
-> Text
-> PutAccessControlRule
PutAccessControlRule'
{ $sel:userIds:PutAccessControlRule' :: Maybe [Text]
userIds = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
$sel:actions:PutAccessControlRule' :: Maybe [Text]
actions = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
$sel:notUserIds:PutAccessControlRule' :: Maybe [Text]
notUserIds = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
$sel:ipRanges:PutAccessControlRule' :: Maybe [Text]
ipRanges = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
$sel:notIpRanges:PutAccessControlRule' :: Maybe [Text]
notIpRanges = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
$sel:notActions:PutAccessControlRule' :: Maybe [Text]
notActions = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
$sel:name:PutAccessControlRule' :: Text
name = Text
pName_,
$sel:effect:PutAccessControlRule' :: AccessControlRuleEffect
effect = AccessControlRuleEffect
pEffect_,
$sel:description:PutAccessControlRule' :: Text
description = Text
pDescription_,
$sel:organizationId:PutAccessControlRule' :: Text
organizationId = Text
pOrganizationId_
}
putAccessControlRule_userIds :: Lens.Lens' PutAccessControlRule (Prelude.Maybe [Prelude.Text])
putAccessControlRule_userIds :: (Maybe [Text] -> f (Maybe [Text]))
-> PutAccessControlRule -> f PutAccessControlRule
putAccessControlRule_userIds = (PutAccessControlRule -> Maybe [Text])
-> (PutAccessControlRule -> Maybe [Text] -> PutAccessControlRule)
-> Lens
PutAccessControlRule
PutAccessControlRule
(Maybe [Text])
(Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutAccessControlRule' {Maybe [Text]
userIds :: Maybe [Text]
$sel:userIds:PutAccessControlRule' :: PutAccessControlRule -> Maybe [Text]
userIds} -> Maybe [Text]
userIds) (\s :: PutAccessControlRule
s@PutAccessControlRule' {} Maybe [Text]
a -> PutAccessControlRule
s {$sel:userIds:PutAccessControlRule' :: Maybe [Text]
userIds = Maybe [Text]
a} :: PutAccessControlRule) ((Maybe [Text] -> f (Maybe [Text]))
-> PutAccessControlRule -> f PutAccessControlRule)
-> ((Maybe [Text] -> f (Maybe [Text]))
-> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> PutAccessControlRule
-> f PutAccessControlRule
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [Text]) (Maybe [Text]) (Maybe [Text])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso [Text] [Text] [Text] [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
putAccessControlRule_actions :: Lens.Lens' PutAccessControlRule (Prelude.Maybe [Prelude.Text])
putAccessControlRule_actions :: (Maybe [Text] -> f (Maybe [Text]))
-> PutAccessControlRule -> f PutAccessControlRule
putAccessControlRule_actions = (PutAccessControlRule -> Maybe [Text])
-> (PutAccessControlRule -> Maybe [Text] -> PutAccessControlRule)
-> Lens
PutAccessControlRule
PutAccessControlRule
(Maybe [Text])
(Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutAccessControlRule' {Maybe [Text]
actions :: Maybe [Text]
$sel:actions:PutAccessControlRule' :: PutAccessControlRule -> Maybe [Text]
actions} -> Maybe [Text]
actions) (\s :: PutAccessControlRule
s@PutAccessControlRule' {} Maybe [Text]
a -> PutAccessControlRule
s {$sel:actions:PutAccessControlRule' :: Maybe [Text]
actions = Maybe [Text]
a} :: PutAccessControlRule) ((Maybe [Text] -> f (Maybe [Text]))
-> PutAccessControlRule -> f PutAccessControlRule)
-> ((Maybe [Text] -> f (Maybe [Text]))
-> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> PutAccessControlRule
-> f PutAccessControlRule
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [Text]) (Maybe [Text]) (Maybe [Text])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso [Text] [Text] [Text] [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
putAccessControlRule_notUserIds :: Lens.Lens' PutAccessControlRule (Prelude.Maybe [Prelude.Text])
putAccessControlRule_notUserIds :: (Maybe [Text] -> f (Maybe [Text]))
-> PutAccessControlRule -> f PutAccessControlRule
putAccessControlRule_notUserIds = (PutAccessControlRule -> Maybe [Text])
-> (PutAccessControlRule -> Maybe [Text] -> PutAccessControlRule)
-> Lens
PutAccessControlRule
PutAccessControlRule
(Maybe [Text])
(Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutAccessControlRule' {Maybe [Text]
notUserIds :: Maybe [Text]
$sel:notUserIds:PutAccessControlRule' :: PutAccessControlRule -> Maybe [Text]
notUserIds} -> Maybe [Text]
notUserIds) (\s :: PutAccessControlRule
s@PutAccessControlRule' {} Maybe [Text]
a -> PutAccessControlRule
s {$sel:notUserIds:PutAccessControlRule' :: Maybe [Text]
notUserIds = Maybe [Text]
a} :: PutAccessControlRule) ((Maybe [Text] -> f (Maybe [Text]))
-> PutAccessControlRule -> f PutAccessControlRule)
-> ((Maybe [Text] -> f (Maybe [Text]))
-> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> PutAccessControlRule
-> f PutAccessControlRule
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [Text]) (Maybe [Text]) (Maybe [Text])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso [Text] [Text] [Text] [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
putAccessControlRule_ipRanges :: Lens.Lens' PutAccessControlRule (Prelude.Maybe [Prelude.Text])
putAccessControlRule_ipRanges :: (Maybe [Text] -> f (Maybe [Text]))
-> PutAccessControlRule -> f PutAccessControlRule
putAccessControlRule_ipRanges = (PutAccessControlRule -> Maybe [Text])
-> (PutAccessControlRule -> Maybe [Text] -> PutAccessControlRule)
-> Lens
PutAccessControlRule
PutAccessControlRule
(Maybe [Text])
(Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutAccessControlRule' {Maybe [Text]
ipRanges :: Maybe [Text]
$sel:ipRanges:PutAccessControlRule' :: PutAccessControlRule -> Maybe [Text]
ipRanges} -> Maybe [Text]
ipRanges) (\s :: PutAccessControlRule
s@PutAccessControlRule' {} Maybe [Text]
a -> PutAccessControlRule
s {$sel:ipRanges:PutAccessControlRule' :: Maybe [Text]
ipRanges = Maybe [Text]
a} :: PutAccessControlRule) ((Maybe [Text] -> f (Maybe [Text]))
-> PutAccessControlRule -> f PutAccessControlRule)
-> ((Maybe [Text] -> f (Maybe [Text]))
-> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> PutAccessControlRule
-> f PutAccessControlRule
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [Text]) (Maybe [Text]) (Maybe [Text])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso [Text] [Text] [Text] [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
putAccessControlRule_notIpRanges :: Lens.Lens' PutAccessControlRule (Prelude.Maybe [Prelude.Text])
putAccessControlRule_notIpRanges :: (Maybe [Text] -> f (Maybe [Text]))
-> PutAccessControlRule -> f PutAccessControlRule
putAccessControlRule_notIpRanges = (PutAccessControlRule -> Maybe [Text])
-> (PutAccessControlRule -> Maybe [Text] -> PutAccessControlRule)
-> Lens
PutAccessControlRule
PutAccessControlRule
(Maybe [Text])
(Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutAccessControlRule' {Maybe [Text]
notIpRanges :: Maybe [Text]
$sel:notIpRanges:PutAccessControlRule' :: PutAccessControlRule -> Maybe [Text]
notIpRanges} -> Maybe [Text]
notIpRanges) (\s :: PutAccessControlRule
s@PutAccessControlRule' {} Maybe [Text]
a -> PutAccessControlRule
s {$sel:notIpRanges:PutAccessControlRule' :: Maybe [Text]
notIpRanges = Maybe [Text]
a} :: PutAccessControlRule) ((Maybe [Text] -> f (Maybe [Text]))
-> PutAccessControlRule -> f PutAccessControlRule)
-> ((Maybe [Text] -> f (Maybe [Text]))
-> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> PutAccessControlRule
-> f PutAccessControlRule
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [Text]) (Maybe [Text]) (Maybe [Text])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso [Text] [Text] [Text] [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
putAccessControlRule_notActions :: Lens.Lens' PutAccessControlRule (Prelude.Maybe [Prelude.Text])
putAccessControlRule_notActions :: (Maybe [Text] -> f (Maybe [Text]))
-> PutAccessControlRule -> f PutAccessControlRule
putAccessControlRule_notActions = (PutAccessControlRule -> Maybe [Text])
-> (PutAccessControlRule -> Maybe [Text] -> PutAccessControlRule)
-> Lens
PutAccessControlRule
PutAccessControlRule
(Maybe [Text])
(Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutAccessControlRule' {Maybe [Text]
notActions :: Maybe [Text]
$sel:notActions:PutAccessControlRule' :: PutAccessControlRule -> Maybe [Text]
notActions} -> Maybe [Text]
notActions) (\s :: PutAccessControlRule
s@PutAccessControlRule' {} Maybe [Text]
a -> PutAccessControlRule
s {$sel:notActions:PutAccessControlRule' :: Maybe [Text]
notActions = Maybe [Text]
a} :: PutAccessControlRule) ((Maybe [Text] -> f (Maybe [Text]))
-> PutAccessControlRule -> f PutAccessControlRule)
-> ((Maybe [Text] -> f (Maybe [Text]))
-> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> PutAccessControlRule
-> f PutAccessControlRule
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [Text]) (Maybe [Text]) (Maybe [Text])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso [Text] [Text] [Text] [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
putAccessControlRule_name :: Lens.Lens' PutAccessControlRule Prelude.Text
putAccessControlRule_name :: (Text -> f Text) -> PutAccessControlRule -> f PutAccessControlRule
putAccessControlRule_name = (PutAccessControlRule -> Text)
-> (PutAccessControlRule -> Text -> PutAccessControlRule)
-> Lens PutAccessControlRule PutAccessControlRule Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutAccessControlRule' {Text
name :: Text
$sel:name:PutAccessControlRule' :: PutAccessControlRule -> Text
name} -> Text
name) (\s :: PutAccessControlRule
s@PutAccessControlRule' {} Text
a -> PutAccessControlRule
s {$sel:name:PutAccessControlRule' :: Text
name = Text
a} :: PutAccessControlRule)
putAccessControlRule_effect :: Lens.Lens' PutAccessControlRule AccessControlRuleEffect
putAccessControlRule_effect :: (AccessControlRuleEffect -> f AccessControlRuleEffect)
-> PutAccessControlRule -> f PutAccessControlRule
putAccessControlRule_effect = (PutAccessControlRule -> AccessControlRuleEffect)
-> (PutAccessControlRule
-> AccessControlRuleEffect -> PutAccessControlRule)
-> Lens
PutAccessControlRule
PutAccessControlRule
AccessControlRuleEffect
AccessControlRuleEffect
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutAccessControlRule' {AccessControlRuleEffect
effect :: AccessControlRuleEffect
$sel:effect:PutAccessControlRule' :: PutAccessControlRule -> AccessControlRuleEffect
effect} -> AccessControlRuleEffect
effect) (\s :: PutAccessControlRule
s@PutAccessControlRule' {} AccessControlRuleEffect
a -> PutAccessControlRule
s {$sel:effect:PutAccessControlRule' :: AccessControlRuleEffect
effect = AccessControlRuleEffect
a} :: PutAccessControlRule)
putAccessControlRule_description :: Lens.Lens' PutAccessControlRule Prelude.Text
putAccessControlRule_description :: (Text -> f Text) -> PutAccessControlRule -> f PutAccessControlRule
putAccessControlRule_description = (PutAccessControlRule -> Text)
-> (PutAccessControlRule -> Text -> PutAccessControlRule)
-> Lens PutAccessControlRule PutAccessControlRule Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutAccessControlRule' {Text
description :: Text
$sel:description:PutAccessControlRule' :: PutAccessControlRule -> Text
description} -> Text
description) (\s :: PutAccessControlRule
s@PutAccessControlRule' {} Text
a -> PutAccessControlRule
s {$sel:description:PutAccessControlRule' :: Text
description = Text
a} :: PutAccessControlRule)
putAccessControlRule_organizationId :: Lens.Lens' PutAccessControlRule Prelude.Text
putAccessControlRule_organizationId :: (Text -> f Text) -> PutAccessControlRule -> f PutAccessControlRule
putAccessControlRule_organizationId = (PutAccessControlRule -> Text)
-> (PutAccessControlRule -> Text -> PutAccessControlRule)
-> Lens PutAccessControlRule PutAccessControlRule Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutAccessControlRule' {Text
organizationId :: Text
$sel:organizationId:PutAccessControlRule' :: PutAccessControlRule -> Text
organizationId} -> Text
organizationId) (\s :: PutAccessControlRule
s@PutAccessControlRule' {} Text
a -> PutAccessControlRule
s {$sel:organizationId:PutAccessControlRule' :: Text
organizationId = Text
a} :: PutAccessControlRule)
instance Core.AWSRequest PutAccessControlRule where
type
AWSResponse PutAccessControlRule =
PutAccessControlRuleResponse
request :: PutAccessControlRule -> Request PutAccessControlRule
request = Service -> PutAccessControlRule -> Request PutAccessControlRule
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy PutAccessControlRule
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse PutAccessControlRule)))
response =
(Int
-> ResponseHeaders
-> ()
-> Either String (AWSResponse PutAccessControlRule))
-> Logger
-> Service
-> Proxy PutAccessControlRule
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse PutAccessControlRule)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> () -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveEmpty
( \Int
s ResponseHeaders
h ()
x ->
Int -> PutAccessControlRuleResponse
PutAccessControlRuleResponse'
(Int -> PutAccessControlRuleResponse)
-> Either String Int -> Either String PutAccessControlRuleResponse
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Int -> Either String Int
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (Int -> Int
forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
)
instance Prelude.Hashable PutAccessControlRule
instance Prelude.NFData PutAccessControlRule
instance Core.ToHeaders PutAccessControlRule where
toHeaders :: PutAccessControlRule -> ResponseHeaders
toHeaders =
ResponseHeaders -> PutAccessControlRule -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"X-Amz-Target"
HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"WorkMailService.PutAccessControlRule" ::
Prelude.ByteString
),
HeaderName
"Content-Type"
HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Core.ToJSON PutAccessControlRule where
toJSON :: PutAccessControlRule -> Value
toJSON PutAccessControlRule' {Maybe [Text]
Text
AccessControlRuleEffect
organizationId :: Text
description :: Text
effect :: AccessControlRuleEffect
name :: Text
notActions :: Maybe [Text]
notIpRanges :: Maybe [Text]
ipRanges :: Maybe [Text]
notUserIds :: Maybe [Text]
actions :: Maybe [Text]
userIds :: Maybe [Text]
$sel:organizationId:PutAccessControlRule' :: PutAccessControlRule -> Text
$sel:description:PutAccessControlRule' :: PutAccessControlRule -> Text
$sel:effect:PutAccessControlRule' :: PutAccessControlRule -> AccessControlRuleEffect
$sel:name:PutAccessControlRule' :: PutAccessControlRule -> Text
$sel:notActions:PutAccessControlRule' :: PutAccessControlRule -> Maybe [Text]
$sel:notIpRanges:PutAccessControlRule' :: PutAccessControlRule -> Maybe [Text]
$sel:ipRanges:PutAccessControlRule' :: PutAccessControlRule -> Maybe [Text]
$sel:notUserIds:PutAccessControlRule' :: PutAccessControlRule -> Maybe [Text]
$sel:actions:PutAccessControlRule' :: PutAccessControlRule -> Maybe [Text]
$sel:userIds:PutAccessControlRule' :: PutAccessControlRule -> Maybe [Text]
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"UserIds" 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]
userIds,
(Text
"Actions" 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]
actions,
(Text
"NotUserIds" 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]
notUserIds,
(Text
"IpRanges" 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]
ipRanges,
(Text
"NotIpRanges" 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]
notIpRanges,
(Text
"NotActions" 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]
notActions,
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Name" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
name),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Effect" Text -> AccessControlRuleEffect -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= AccessControlRuleEffect
effect),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Description" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
description),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
(Text
"OrganizationId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
organizationId)
]
)
instance Core.ToPath PutAccessControlRule where
toPath :: PutAccessControlRule -> ByteString
toPath = ByteString -> PutAccessControlRule -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery PutAccessControlRule where
toQuery :: PutAccessControlRule -> QueryString
toQuery = QueryString -> PutAccessControlRule -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data PutAccessControlRuleResponse = PutAccessControlRuleResponse'
{
PutAccessControlRuleResponse -> Int
httpStatus :: Prelude.Int
}
deriving (PutAccessControlRuleResponse
-> PutAccessControlRuleResponse -> Bool
(PutAccessControlRuleResponse
-> PutAccessControlRuleResponse -> Bool)
-> (PutAccessControlRuleResponse
-> PutAccessControlRuleResponse -> Bool)
-> Eq PutAccessControlRuleResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PutAccessControlRuleResponse
-> PutAccessControlRuleResponse -> Bool
$c/= :: PutAccessControlRuleResponse
-> PutAccessControlRuleResponse -> Bool
== :: PutAccessControlRuleResponse
-> PutAccessControlRuleResponse -> Bool
$c== :: PutAccessControlRuleResponse
-> PutAccessControlRuleResponse -> Bool
Prelude.Eq, ReadPrec [PutAccessControlRuleResponse]
ReadPrec PutAccessControlRuleResponse
Int -> ReadS PutAccessControlRuleResponse
ReadS [PutAccessControlRuleResponse]
(Int -> ReadS PutAccessControlRuleResponse)
-> ReadS [PutAccessControlRuleResponse]
-> ReadPrec PutAccessControlRuleResponse
-> ReadPrec [PutAccessControlRuleResponse]
-> Read PutAccessControlRuleResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PutAccessControlRuleResponse]
$creadListPrec :: ReadPrec [PutAccessControlRuleResponse]
readPrec :: ReadPrec PutAccessControlRuleResponse
$creadPrec :: ReadPrec PutAccessControlRuleResponse
readList :: ReadS [PutAccessControlRuleResponse]
$creadList :: ReadS [PutAccessControlRuleResponse]
readsPrec :: Int -> ReadS PutAccessControlRuleResponse
$creadsPrec :: Int -> ReadS PutAccessControlRuleResponse
Prelude.Read, Int -> PutAccessControlRuleResponse -> ShowS
[PutAccessControlRuleResponse] -> ShowS
PutAccessControlRuleResponse -> String
(Int -> PutAccessControlRuleResponse -> ShowS)
-> (PutAccessControlRuleResponse -> String)
-> ([PutAccessControlRuleResponse] -> ShowS)
-> Show PutAccessControlRuleResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PutAccessControlRuleResponse] -> ShowS
$cshowList :: [PutAccessControlRuleResponse] -> ShowS
show :: PutAccessControlRuleResponse -> String
$cshow :: PutAccessControlRuleResponse -> String
showsPrec :: Int -> PutAccessControlRuleResponse -> ShowS
$cshowsPrec :: Int -> PutAccessControlRuleResponse -> ShowS
Prelude.Show, (forall x.
PutAccessControlRuleResponse -> Rep PutAccessControlRuleResponse x)
-> (forall x.
Rep PutAccessControlRuleResponse x -> PutAccessControlRuleResponse)
-> Generic PutAccessControlRuleResponse
forall x.
Rep PutAccessControlRuleResponse x -> PutAccessControlRuleResponse
forall x.
PutAccessControlRuleResponse -> Rep PutAccessControlRuleResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep PutAccessControlRuleResponse x -> PutAccessControlRuleResponse
$cfrom :: forall x.
PutAccessControlRuleResponse -> Rep PutAccessControlRuleResponse x
Prelude.Generic)
newPutAccessControlRuleResponse ::
Prelude.Int ->
PutAccessControlRuleResponse
newPutAccessControlRuleResponse :: Int -> PutAccessControlRuleResponse
newPutAccessControlRuleResponse Int
pHttpStatus_ =
PutAccessControlRuleResponse' :: Int -> PutAccessControlRuleResponse
PutAccessControlRuleResponse'
{ $sel:httpStatus:PutAccessControlRuleResponse' :: Int
httpStatus =
Int
pHttpStatus_
}
putAccessControlRuleResponse_httpStatus :: Lens.Lens' PutAccessControlRuleResponse Prelude.Int
putAccessControlRuleResponse_httpStatus :: (Int -> f Int)
-> PutAccessControlRuleResponse -> f PutAccessControlRuleResponse
putAccessControlRuleResponse_httpStatus = (PutAccessControlRuleResponse -> Int)
-> (PutAccessControlRuleResponse
-> Int -> PutAccessControlRuleResponse)
-> Lens
PutAccessControlRuleResponse PutAccessControlRuleResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutAccessControlRuleResponse' {Int
httpStatus :: Int
$sel:httpStatus:PutAccessControlRuleResponse' :: PutAccessControlRuleResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: PutAccessControlRuleResponse
s@PutAccessControlRuleResponse' {} Int
a -> PutAccessControlRuleResponse
s {$sel:httpStatus:PutAccessControlRuleResponse' :: Int
httpStatus = Int
a} :: PutAccessControlRuleResponse)
instance Prelude.NFData PutAccessControlRuleResponse