{-# 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.PutMobileDeviceAccessOverride
(
PutMobileDeviceAccessOverride (..),
newPutMobileDeviceAccessOverride,
putMobileDeviceAccessOverride_description,
putMobileDeviceAccessOverride_organizationId,
putMobileDeviceAccessOverride_userId,
putMobileDeviceAccessOverride_deviceId,
putMobileDeviceAccessOverride_effect,
PutMobileDeviceAccessOverrideResponse (..),
newPutMobileDeviceAccessOverrideResponse,
putMobileDeviceAccessOverrideResponse_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 PutMobileDeviceAccessOverride = PutMobileDeviceAccessOverride'
{
PutMobileDeviceAccessOverride -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
PutMobileDeviceAccessOverride -> Text
organizationId :: Prelude.Text,
PutMobileDeviceAccessOverride -> Text
userId :: Prelude.Text,
PutMobileDeviceAccessOverride -> Text
deviceId :: Prelude.Text,
PutMobileDeviceAccessOverride -> MobileDeviceAccessRuleEffect
effect :: MobileDeviceAccessRuleEffect
}
deriving (PutMobileDeviceAccessOverride
-> PutMobileDeviceAccessOverride -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PutMobileDeviceAccessOverride
-> PutMobileDeviceAccessOverride -> Bool
$c/= :: PutMobileDeviceAccessOverride
-> PutMobileDeviceAccessOverride -> Bool
== :: PutMobileDeviceAccessOverride
-> PutMobileDeviceAccessOverride -> Bool
$c== :: PutMobileDeviceAccessOverride
-> PutMobileDeviceAccessOverride -> Bool
Prelude.Eq, ReadPrec [PutMobileDeviceAccessOverride]
ReadPrec PutMobileDeviceAccessOverride
Int -> ReadS PutMobileDeviceAccessOverride
ReadS [PutMobileDeviceAccessOverride]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PutMobileDeviceAccessOverride]
$creadListPrec :: ReadPrec [PutMobileDeviceAccessOverride]
readPrec :: ReadPrec PutMobileDeviceAccessOverride
$creadPrec :: ReadPrec PutMobileDeviceAccessOverride
readList :: ReadS [PutMobileDeviceAccessOverride]
$creadList :: ReadS [PutMobileDeviceAccessOverride]
readsPrec :: Int -> ReadS PutMobileDeviceAccessOverride
$creadsPrec :: Int -> ReadS PutMobileDeviceAccessOverride
Prelude.Read, Int -> PutMobileDeviceAccessOverride -> ShowS
[PutMobileDeviceAccessOverride] -> ShowS
PutMobileDeviceAccessOverride -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PutMobileDeviceAccessOverride] -> ShowS
$cshowList :: [PutMobileDeviceAccessOverride] -> ShowS
show :: PutMobileDeviceAccessOverride -> String
$cshow :: PutMobileDeviceAccessOverride -> String
showsPrec :: Int -> PutMobileDeviceAccessOverride -> ShowS
$cshowsPrec :: Int -> PutMobileDeviceAccessOverride -> ShowS
Prelude.Show, forall x.
Rep PutMobileDeviceAccessOverride x
-> PutMobileDeviceAccessOverride
forall x.
PutMobileDeviceAccessOverride
-> Rep PutMobileDeviceAccessOverride x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep PutMobileDeviceAccessOverride x
-> PutMobileDeviceAccessOverride
$cfrom :: forall x.
PutMobileDeviceAccessOverride
-> Rep PutMobileDeviceAccessOverride x
Prelude.Generic)
newPutMobileDeviceAccessOverride ::
Prelude.Text ->
Prelude.Text ->
Prelude.Text ->
MobileDeviceAccessRuleEffect ->
PutMobileDeviceAccessOverride
newPutMobileDeviceAccessOverride :: Text
-> Text
-> Text
-> MobileDeviceAccessRuleEffect
-> PutMobileDeviceAccessOverride
newPutMobileDeviceAccessOverride
Text
pOrganizationId_
Text
pUserId_
Text
pDeviceId_
MobileDeviceAccessRuleEffect
pEffect_ =
PutMobileDeviceAccessOverride'
{ $sel:description:PutMobileDeviceAccessOverride' :: Maybe Text
description =
forall a. Maybe a
Prelude.Nothing,
$sel:organizationId:PutMobileDeviceAccessOverride' :: Text
organizationId = Text
pOrganizationId_,
$sel:userId:PutMobileDeviceAccessOverride' :: Text
userId = Text
pUserId_,
$sel:deviceId:PutMobileDeviceAccessOverride' :: Text
deviceId = Text
pDeviceId_,
$sel:effect:PutMobileDeviceAccessOverride' :: MobileDeviceAccessRuleEffect
effect = MobileDeviceAccessRuleEffect
pEffect_
}
putMobileDeviceAccessOverride_description :: Lens.Lens' PutMobileDeviceAccessOverride (Prelude.Maybe Prelude.Text)
putMobileDeviceAccessOverride_description :: Lens' PutMobileDeviceAccessOverride (Maybe Text)
putMobileDeviceAccessOverride_description = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutMobileDeviceAccessOverride' {Maybe Text
description :: Maybe Text
$sel:description:PutMobileDeviceAccessOverride' :: PutMobileDeviceAccessOverride -> Maybe Text
description} -> Maybe Text
description) (\s :: PutMobileDeviceAccessOverride
s@PutMobileDeviceAccessOverride' {} Maybe Text
a -> PutMobileDeviceAccessOverride
s {$sel:description:PutMobileDeviceAccessOverride' :: Maybe Text
description = Maybe Text
a} :: PutMobileDeviceAccessOverride)
putMobileDeviceAccessOverride_organizationId :: Lens.Lens' PutMobileDeviceAccessOverride Prelude.Text
putMobileDeviceAccessOverride_organizationId :: Lens' PutMobileDeviceAccessOverride Text
putMobileDeviceAccessOverride_organizationId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutMobileDeviceAccessOverride' {Text
organizationId :: Text
$sel:organizationId:PutMobileDeviceAccessOverride' :: PutMobileDeviceAccessOverride -> Text
organizationId} -> Text
organizationId) (\s :: PutMobileDeviceAccessOverride
s@PutMobileDeviceAccessOverride' {} Text
a -> PutMobileDeviceAccessOverride
s {$sel:organizationId:PutMobileDeviceAccessOverride' :: Text
organizationId = Text
a} :: PutMobileDeviceAccessOverride)
putMobileDeviceAccessOverride_userId :: Lens.Lens' PutMobileDeviceAccessOverride Prelude.Text
putMobileDeviceAccessOverride_userId :: Lens' PutMobileDeviceAccessOverride Text
putMobileDeviceAccessOverride_userId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutMobileDeviceAccessOverride' {Text
userId :: Text
$sel:userId:PutMobileDeviceAccessOverride' :: PutMobileDeviceAccessOverride -> Text
userId} -> Text
userId) (\s :: PutMobileDeviceAccessOverride
s@PutMobileDeviceAccessOverride' {} Text
a -> PutMobileDeviceAccessOverride
s {$sel:userId:PutMobileDeviceAccessOverride' :: Text
userId = Text
a} :: PutMobileDeviceAccessOverride)
putMobileDeviceAccessOverride_deviceId :: Lens.Lens' PutMobileDeviceAccessOverride Prelude.Text
putMobileDeviceAccessOverride_deviceId :: Lens' PutMobileDeviceAccessOverride Text
putMobileDeviceAccessOverride_deviceId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutMobileDeviceAccessOverride' {Text
deviceId :: Text
$sel:deviceId:PutMobileDeviceAccessOverride' :: PutMobileDeviceAccessOverride -> Text
deviceId} -> Text
deviceId) (\s :: PutMobileDeviceAccessOverride
s@PutMobileDeviceAccessOverride' {} Text
a -> PutMobileDeviceAccessOverride
s {$sel:deviceId:PutMobileDeviceAccessOverride' :: Text
deviceId = Text
a} :: PutMobileDeviceAccessOverride)
putMobileDeviceAccessOverride_effect :: Lens.Lens' PutMobileDeviceAccessOverride MobileDeviceAccessRuleEffect
putMobileDeviceAccessOverride_effect :: Lens' PutMobileDeviceAccessOverride MobileDeviceAccessRuleEffect
putMobileDeviceAccessOverride_effect = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutMobileDeviceAccessOverride' {MobileDeviceAccessRuleEffect
effect :: MobileDeviceAccessRuleEffect
$sel:effect:PutMobileDeviceAccessOverride' :: PutMobileDeviceAccessOverride -> MobileDeviceAccessRuleEffect
effect} -> MobileDeviceAccessRuleEffect
effect) (\s :: PutMobileDeviceAccessOverride
s@PutMobileDeviceAccessOverride' {} MobileDeviceAccessRuleEffect
a -> PutMobileDeviceAccessOverride
s {$sel:effect:PutMobileDeviceAccessOverride' :: MobileDeviceAccessRuleEffect
effect = MobileDeviceAccessRuleEffect
a} :: PutMobileDeviceAccessOverride)
instance
Core.AWSRequest
PutMobileDeviceAccessOverride
where
type
AWSResponse PutMobileDeviceAccessOverride =
PutMobileDeviceAccessOverrideResponse
request :: (Service -> Service)
-> PutMobileDeviceAccessOverride
-> Request PutMobileDeviceAccessOverride
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 PutMobileDeviceAccessOverride
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse PutMobileDeviceAccessOverride)))
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 -> PutMobileDeviceAccessOverrideResponse
PutMobileDeviceAccessOverrideResponse'
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
PutMobileDeviceAccessOverride
where
hashWithSalt :: Int -> PutMobileDeviceAccessOverride -> Int
hashWithSalt Int
_salt PutMobileDeviceAccessOverride' {Maybe Text
Text
MobileDeviceAccessRuleEffect
effect :: MobileDeviceAccessRuleEffect
deviceId :: Text
userId :: Text
organizationId :: Text
description :: Maybe Text
$sel:effect:PutMobileDeviceAccessOverride' :: PutMobileDeviceAccessOverride -> MobileDeviceAccessRuleEffect
$sel:deviceId:PutMobileDeviceAccessOverride' :: PutMobileDeviceAccessOverride -> Text
$sel:userId:PutMobileDeviceAccessOverride' :: PutMobileDeviceAccessOverride -> Text
$sel:organizationId:PutMobileDeviceAccessOverride' :: PutMobileDeviceAccessOverride -> Text
$sel:description:PutMobileDeviceAccessOverride' :: PutMobileDeviceAccessOverride -> Maybe Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
description
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
organizationId
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
userId
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
deviceId
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` MobileDeviceAccessRuleEffect
effect
instance Prelude.NFData PutMobileDeviceAccessOverride where
rnf :: PutMobileDeviceAccessOverride -> ()
rnf PutMobileDeviceAccessOverride' {Maybe Text
Text
MobileDeviceAccessRuleEffect
effect :: MobileDeviceAccessRuleEffect
deviceId :: Text
userId :: Text
organizationId :: Text
description :: Maybe Text
$sel:effect:PutMobileDeviceAccessOverride' :: PutMobileDeviceAccessOverride -> MobileDeviceAccessRuleEffect
$sel:deviceId:PutMobileDeviceAccessOverride' :: PutMobileDeviceAccessOverride -> Text
$sel:userId:PutMobileDeviceAccessOverride' :: PutMobileDeviceAccessOverride -> Text
$sel:organizationId:PutMobileDeviceAccessOverride' :: PutMobileDeviceAccessOverride -> Text
$sel:description:PutMobileDeviceAccessOverride' :: PutMobileDeviceAccessOverride -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
description
seq :: forall a b. a -> b -> b
`Prelude.seq` 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
userId
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
deviceId
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf MobileDeviceAccessRuleEffect
effect
instance Data.ToHeaders PutMobileDeviceAccessOverride where
toHeaders :: PutMobileDeviceAccessOverride -> 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.PutMobileDeviceAccessOverride" ::
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 PutMobileDeviceAccessOverride where
toJSON :: PutMobileDeviceAccessOverride -> Value
toJSON PutMobileDeviceAccessOverride' {Maybe Text
Text
MobileDeviceAccessRuleEffect
effect :: MobileDeviceAccessRuleEffect
deviceId :: Text
userId :: Text
organizationId :: Text
description :: Maybe Text
$sel:effect:PutMobileDeviceAccessOverride' :: PutMobileDeviceAccessOverride -> MobileDeviceAccessRuleEffect
$sel:deviceId:PutMobileDeviceAccessOverride' :: PutMobileDeviceAccessOverride -> Text
$sel:userId:PutMobileDeviceAccessOverride' :: PutMobileDeviceAccessOverride -> Text
$sel:organizationId:PutMobileDeviceAccessOverride' :: PutMobileDeviceAccessOverride -> Text
$sel:description:PutMobileDeviceAccessOverride' :: PutMobileDeviceAccessOverride -> Maybe Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"Description" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
description,
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
"UserId" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
userId),
forall a. a -> Maybe a
Prelude.Just (Key
"DeviceId" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
deviceId),
forall a. a -> Maybe a
Prelude.Just (Key
"Effect" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= MobileDeviceAccessRuleEffect
effect)
]
)
instance Data.ToPath PutMobileDeviceAccessOverride where
toPath :: PutMobileDeviceAccessOverride -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Data.ToQuery PutMobileDeviceAccessOverride where
toQuery :: PutMobileDeviceAccessOverride -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data PutMobileDeviceAccessOverrideResponse = PutMobileDeviceAccessOverrideResponse'
{
PutMobileDeviceAccessOverrideResponse -> Int
httpStatus :: Prelude.Int
}
deriving (PutMobileDeviceAccessOverrideResponse
-> PutMobileDeviceAccessOverrideResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PutMobileDeviceAccessOverrideResponse
-> PutMobileDeviceAccessOverrideResponse -> Bool
$c/= :: PutMobileDeviceAccessOverrideResponse
-> PutMobileDeviceAccessOverrideResponse -> Bool
== :: PutMobileDeviceAccessOverrideResponse
-> PutMobileDeviceAccessOverrideResponse -> Bool
$c== :: PutMobileDeviceAccessOverrideResponse
-> PutMobileDeviceAccessOverrideResponse -> Bool
Prelude.Eq, ReadPrec [PutMobileDeviceAccessOverrideResponse]
ReadPrec PutMobileDeviceAccessOverrideResponse
Int -> ReadS PutMobileDeviceAccessOverrideResponse
ReadS [PutMobileDeviceAccessOverrideResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PutMobileDeviceAccessOverrideResponse]
$creadListPrec :: ReadPrec [PutMobileDeviceAccessOverrideResponse]
readPrec :: ReadPrec PutMobileDeviceAccessOverrideResponse
$creadPrec :: ReadPrec PutMobileDeviceAccessOverrideResponse
readList :: ReadS [PutMobileDeviceAccessOverrideResponse]
$creadList :: ReadS [PutMobileDeviceAccessOverrideResponse]
readsPrec :: Int -> ReadS PutMobileDeviceAccessOverrideResponse
$creadsPrec :: Int -> ReadS PutMobileDeviceAccessOverrideResponse
Prelude.Read, Int -> PutMobileDeviceAccessOverrideResponse -> ShowS
[PutMobileDeviceAccessOverrideResponse] -> ShowS
PutMobileDeviceAccessOverrideResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PutMobileDeviceAccessOverrideResponse] -> ShowS
$cshowList :: [PutMobileDeviceAccessOverrideResponse] -> ShowS
show :: PutMobileDeviceAccessOverrideResponse -> String
$cshow :: PutMobileDeviceAccessOverrideResponse -> String
showsPrec :: Int -> PutMobileDeviceAccessOverrideResponse -> ShowS
$cshowsPrec :: Int -> PutMobileDeviceAccessOverrideResponse -> ShowS
Prelude.Show, forall x.
Rep PutMobileDeviceAccessOverrideResponse x
-> PutMobileDeviceAccessOverrideResponse
forall x.
PutMobileDeviceAccessOverrideResponse
-> Rep PutMobileDeviceAccessOverrideResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep PutMobileDeviceAccessOverrideResponse x
-> PutMobileDeviceAccessOverrideResponse
$cfrom :: forall x.
PutMobileDeviceAccessOverrideResponse
-> Rep PutMobileDeviceAccessOverrideResponse x
Prelude.Generic)
newPutMobileDeviceAccessOverrideResponse ::
Prelude.Int ->
PutMobileDeviceAccessOverrideResponse
newPutMobileDeviceAccessOverrideResponse :: Int -> PutMobileDeviceAccessOverrideResponse
newPutMobileDeviceAccessOverrideResponse Int
pHttpStatus_ =
PutMobileDeviceAccessOverrideResponse'
{ $sel:httpStatus:PutMobileDeviceAccessOverrideResponse' :: Int
httpStatus =
Int
pHttpStatus_
}
putMobileDeviceAccessOverrideResponse_httpStatus :: Lens.Lens' PutMobileDeviceAccessOverrideResponse Prelude.Int
putMobileDeviceAccessOverrideResponse_httpStatus :: Lens' PutMobileDeviceAccessOverrideResponse Int
putMobileDeviceAccessOverrideResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutMobileDeviceAccessOverrideResponse' {Int
httpStatus :: Int
$sel:httpStatus:PutMobileDeviceAccessOverrideResponse' :: PutMobileDeviceAccessOverrideResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: PutMobileDeviceAccessOverrideResponse
s@PutMobileDeviceAccessOverrideResponse' {} Int
a -> PutMobileDeviceAccessOverrideResponse
s {$sel:httpStatus:PutMobileDeviceAccessOverrideResponse' :: Int
httpStatus = Int
a} :: PutMobileDeviceAccessOverrideResponse)
instance
Prelude.NFData
PutMobileDeviceAccessOverrideResponse
where
rnf :: PutMobileDeviceAccessOverrideResponse -> ()
rnf PutMobileDeviceAccessOverrideResponse' {Int
httpStatus :: Int
$sel:httpStatus:PutMobileDeviceAccessOverrideResponse' :: PutMobileDeviceAccessOverrideResponse -> Int
..} =
forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus