{-# 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.UpdateMailboxQuota
(
UpdateMailboxQuota (..),
newUpdateMailboxQuota,
updateMailboxQuota_organizationId,
updateMailboxQuota_userId,
updateMailboxQuota_mailboxQuota,
UpdateMailboxQuotaResponse (..),
newUpdateMailboxQuotaResponse,
updateMailboxQuotaResponse_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 UpdateMailboxQuota = UpdateMailboxQuota'
{
UpdateMailboxQuota -> Text
organizationId :: Prelude.Text,
UpdateMailboxQuota -> Text
userId :: Prelude.Text,
UpdateMailboxQuota -> Natural
mailboxQuota :: Prelude.Natural
}
deriving (UpdateMailboxQuota -> UpdateMailboxQuota -> Bool
(UpdateMailboxQuota -> UpdateMailboxQuota -> Bool)
-> (UpdateMailboxQuota -> UpdateMailboxQuota -> Bool)
-> Eq UpdateMailboxQuota
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateMailboxQuota -> UpdateMailboxQuota -> Bool
$c/= :: UpdateMailboxQuota -> UpdateMailboxQuota -> Bool
== :: UpdateMailboxQuota -> UpdateMailboxQuota -> Bool
$c== :: UpdateMailboxQuota -> UpdateMailboxQuota -> Bool
Prelude.Eq, ReadPrec [UpdateMailboxQuota]
ReadPrec UpdateMailboxQuota
Int -> ReadS UpdateMailboxQuota
ReadS [UpdateMailboxQuota]
(Int -> ReadS UpdateMailboxQuota)
-> ReadS [UpdateMailboxQuota]
-> ReadPrec UpdateMailboxQuota
-> ReadPrec [UpdateMailboxQuota]
-> Read UpdateMailboxQuota
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateMailboxQuota]
$creadListPrec :: ReadPrec [UpdateMailboxQuota]
readPrec :: ReadPrec UpdateMailboxQuota
$creadPrec :: ReadPrec UpdateMailboxQuota
readList :: ReadS [UpdateMailboxQuota]
$creadList :: ReadS [UpdateMailboxQuota]
readsPrec :: Int -> ReadS UpdateMailboxQuota
$creadsPrec :: Int -> ReadS UpdateMailboxQuota
Prelude.Read, Int -> UpdateMailboxQuota -> ShowS
[UpdateMailboxQuota] -> ShowS
UpdateMailboxQuota -> String
(Int -> UpdateMailboxQuota -> ShowS)
-> (UpdateMailboxQuota -> String)
-> ([UpdateMailboxQuota] -> ShowS)
-> Show UpdateMailboxQuota
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateMailboxQuota] -> ShowS
$cshowList :: [UpdateMailboxQuota] -> ShowS
show :: UpdateMailboxQuota -> String
$cshow :: UpdateMailboxQuota -> String
showsPrec :: Int -> UpdateMailboxQuota -> ShowS
$cshowsPrec :: Int -> UpdateMailboxQuota -> ShowS
Prelude.Show, (forall x. UpdateMailboxQuota -> Rep UpdateMailboxQuota x)
-> (forall x. Rep UpdateMailboxQuota x -> UpdateMailboxQuota)
-> Generic UpdateMailboxQuota
forall x. Rep UpdateMailboxQuota x -> UpdateMailboxQuota
forall x. UpdateMailboxQuota -> Rep UpdateMailboxQuota x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdateMailboxQuota x -> UpdateMailboxQuota
$cfrom :: forall x. UpdateMailboxQuota -> Rep UpdateMailboxQuota x
Prelude.Generic)
newUpdateMailboxQuota ::
Prelude.Text ->
Prelude.Text ->
Prelude.Natural ->
UpdateMailboxQuota
newUpdateMailboxQuota :: Text -> Text -> Natural -> UpdateMailboxQuota
newUpdateMailboxQuota
Text
pOrganizationId_
Text
pUserId_
Natural
pMailboxQuota_ =
UpdateMailboxQuota' :: Text -> Text -> Natural -> UpdateMailboxQuota
UpdateMailboxQuota'
{ $sel:organizationId:UpdateMailboxQuota' :: Text
organizationId =
Text
pOrganizationId_,
$sel:userId:UpdateMailboxQuota' :: Text
userId = Text
pUserId_,
$sel:mailboxQuota:UpdateMailboxQuota' :: Natural
mailboxQuota = Natural
pMailboxQuota_
}
updateMailboxQuota_organizationId :: Lens.Lens' UpdateMailboxQuota Prelude.Text
updateMailboxQuota_organizationId :: (Text -> f Text) -> UpdateMailboxQuota -> f UpdateMailboxQuota
updateMailboxQuota_organizationId = (UpdateMailboxQuota -> Text)
-> (UpdateMailboxQuota -> Text -> UpdateMailboxQuota)
-> Lens UpdateMailboxQuota UpdateMailboxQuota Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateMailboxQuota' {Text
organizationId :: Text
$sel:organizationId:UpdateMailboxQuota' :: UpdateMailboxQuota -> Text
organizationId} -> Text
organizationId) (\s :: UpdateMailboxQuota
s@UpdateMailboxQuota' {} Text
a -> UpdateMailboxQuota
s {$sel:organizationId:UpdateMailboxQuota' :: Text
organizationId = Text
a} :: UpdateMailboxQuota)
updateMailboxQuota_userId :: Lens.Lens' UpdateMailboxQuota Prelude.Text
updateMailboxQuota_userId :: (Text -> f Text) -> UpdateMailboxQuota -> f UpdateMailboxQuota
updateMailboxQuota_userId = (UpdateMailboxQuota -> Text)
-> (UpdateMailboxQuota -> Text -> UpdateMailboxQuota)
-> Lens UpdateMailboxQuota UpdateMailboxQuota Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateMailboxQuota' {Text
userId :: Text
$sel:userId:UpdateMailboxQuota' :: UpdateMailboxQuota -> Text
userId} -> Text
userId) (\s :: UpdateMailboxQuota
s@UpdateMailboxQuota' {} Text
a -> UpdateMailboxQuota
s {$sel:userId:UpdateMailboxQuota' :: Text
userId = Text
a} :: UpdateMailboxQuota)
updateMailboxQuota_mailboxQuota :: Lens.Lens' UpdateMailboxQuota Prelude.Natural
updateMailboxQuota_mailboxQuota :: (Natural -> f Natural)
-> UpdateMailboxQuota -> f UpdateMailboxQuota
updateMailboxQuota_mailboxQuota = (UpdateMailboxQuota -> Natural)
-> (UpdateMailboxQuota -> Natural -> UpdateMailboxQuota)
-> Lens UpdateMailboxQuota UpdateMailboxQuota Natural Natural
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateMailboxQuota' {Natural
mailboxQuota :: Natural
$sel:mailboxQuota:UpdateMailboxQuota' :: UpdateMailboxQuota -> Natural
mailboxQuota} -> Natural
mailboxQuota) (\s :: UpdateMailboxQuota
s@UpdateMailboxQuota' {} Natural
a -> UpdateMailboxQuota
s {$sel:mailboxQuota:UpdateMailboxQuota' :: Natural
mailboxQuota = Natural
a} :: UpdateMailboxQuota)
instance Core.AWSRequest UpdateMailboxQuota where
type
AWSResponse UpdateMailboxQuota =
UpdateMailboxQuotaResponse
request :: UpdateMailboxQuota -> Request UpdateMailboxQuota
request = Service -> UpdateMailboxQuota -> Request UpdateMailboxQuota
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy UpdateMailboxQuota
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse UpdateMailboxQuota)))
response =
(Int
-> ResponseHeaders
-> ()
-> Either String (AWSResponse UpdateMailboxQuota))
-> Logger
-> Service
-> Proxy UpdateMailboxQuota
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse UpdateMailboxQuota)))
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 -> UpdateMailboxQuotaResponse
UpdateMailboxQuotaResponse'
(Int -> UpdateMailboxQuotaResponse)
-> Either String Int -> Either String UpdateMailboxQuotaResponse
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 UpdateMailboxQuota
instance Prelude.NFData UpdateMailboxQuota
instance Core.ToHeaders UpdateMailboxQuota where
toHeaders :: UpdateMailboxQuota -> ResponseHeaders
toHeaders =
ResponseHeaders -> UpdateMailboxQuota -> 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.UpdateMailboxQuota" ::
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 UpdateMailboxQuota where
toJSON :: UpdateMailboxQuota -> Value
toJSON UpdateMailboxQuota' {Natural
Text
mailboxQuota :: Natural
userId :: Text
organizationId :: Text
$sel:mailboxQuota:UpdateMailboxQuota' :: UpdateMailboxQuota -> Natural
$sel:userId:UpdateMailboxQuota' :: UpdateMailboxQuota -> Text
$sel:organizationId:UpdateMailboxQuota' :: UpdateMailboxQuota -> Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ 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),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"UserId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
userId),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"MailboxQuota" Text -> Natural -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Natural
mailboxQuota)
]
)
instance Core.ToPath UpdateMailboxQuota where
toPath :: UpdateMailboxQuota -> ByteString
toPath = ByteString -> UpdateMailboxQuota -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery UpdateMailboxQuota where
toQuery :: UpdateMailboxQuota -> QueryString
toQuery = QueryString -> UpdateMailboxQuota -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data UpdateMailboxQuotaResponse = UpdateMailboxQuotaResponse'
{
UpdateMailboxQuotaResponse -> Int
httpStatus :: Prelude.Int
}
deriving (UpdateMailboxQuotaResponse -> UpdateMailboxQuotaResponse -> Bool
(UpdateMailboxQuotaResponse -> UpdateMailboxQuotaResponse -> Bool)
-> (UpdateMailboxQuotaResponse
-> UpdateMailboxQuotaResponse -> Bool)
-> Eq UpdateMailboxQuotaResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateMailboxQuotaResponse -> UpdateMailboxQuotaResponse -> Bool
$c/= :: UpdateMailboxQuotaResponse -> UpdateMailboxQuotaResponse -> Bool
== :: UpdateMailboxQuotaResponse -> UpdateMailboxQuotaResponse -> Bool
$c== :: UpdateMailboxQuotaResponse -> UpdateMailboxQuotaResponse -> Bool
Prelude.Eq, ReadPrec [UpdateMailboxQuotaResponse]
ReadPrec UpdateMailboxQuotaResponse
Int -> ReadS UpdateMailboxQuotaResponse
ReadS [UpdateMailboxQuotaResponse]
(Int -> ReadS UpdateMailboxQuotaResponse)
-> ReadS [UpdateMailboxQuotaResponse]
-> ReadPrec UpdateMailboxQuotaResponse
-> ReadPrec [UpdateMailboxQuotaResponse]
-> Read UpdateMailboxQuotaResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateMailboxQuotaResponse]
$creadListPrec :: ReadPrec [UpdateMailboxQuotaResponse]
readPrec :: ReadPrec UpdateMailboxQuotaResponse
$creadPrec :: ReadPrec UpdateMailboxQuotaResponse
readList :: ReadS [UpdateMailboxQuotaResponse]
$creadList :: ReadS [UpdateMailboxQuotaResponse]
readsPrec :: Int -> ReadS UpdateMailboxQuotaResponse
$creadsPrec :: Int -> ReadS UpdateMailboxQuotaResponse
Prelude.Read, Int -> UpdateMailboxQuotaResponse -> ShowS
[UpdateMailboxQuotaResponse] -> ShowS
UpdateMailboxQuotaResponse -> String
(Int -> UpdateMailboxQuotaResponse -> ShowS)
-> (UpdateMailboxQuotaResponse -> String)
-> ([UpdateMailboxQuotaResponse] -> ShowS)
-> Show UpdateMailboxQuotaResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateMailboxQuotaResponse] -> ShowS
$cshowList :: [UpdateMailboxQuotaResponse] -> ShowS
show :: UpdateMailboxQuotaResponse -> String
$cshow :: UpdateMailboxQuotaResponse -> String
showsPrec :: Int -> UpdateMailboxQuotaResponse -> ShowS
$cshowsPrec :: Int -> UpdateMailboxQuotaResponse -> ShowS
Prelude.Show, (forall x.
UpdateMailboxQuotaResponse -> Rep UpdateMailboxQuotaResponse x)
-> (forall x.
Rep UpdateMailboxQuotaResponse x -> UpdateMailboxQuotaResponse)
-> Generic UpdateMailboxQuotaResponse
forall x.
Rep UpdateMailboxQuotaResponse x -> UpdateMailboxQuotaResponse
forall x.
UpdateMailboxQuotaResponse -> Rep UpdateMailboxQuotaResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UpdateMailboxQuotaResponse x -> UpdateMailboxQuotaResponse
$cfrom :: forall x.
UpdateMailboxQuotaResponse -> Rep UpdateMailboxQuotaResponse x
Prelude.Generic)
newUpdateMailboxQuotaResponse ::
Prelude.Int ->
UpdateMailboxQuotaResponse
newUpdateMailboxQuotaResponse :: Int -> UpdateMailboxQuotaResponse
newUpdateMailboxQuotaResponse Int
pHttpStatus_ =
UpdateMailboxQuotaResponse' :: Int -> UpdateMailboxQuotaResponse
UpdateMailboxQuotaResponse'
{ $sel:httpStatus:UpdateMailboxQuotaResponse' :: Int
httpStatus =
Int
pHttpStatus_
}
updateMailboxQuotaResponse_httpStatus :: Lens.Lens' UpdateMailboxQuotaResponse Prelude.Int
updateMailboxQuotaResponse_httpStatus :: (Int -> f Int)
-> UpdateMailboxQuotaResponse -> f UpdateMailboxQuotaResponse
updateMailboxQuotaResponse_httpStatus = (UpdateMailboxQuotaResponse -> Int)
-> (UpdateMailboxQuotaResponse
-> Int -> UpdateMailboxQuotaResponse)
-> Lens
UpdateMailboxQuotaResponse UpdateMailboxQuotaResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateMailboxQuotaResponse' {Int
httpStatus :: Int
$sel:httpStatus:UpdateMailboxQuotaResponse' :: UpdateMailboxQuotaResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: UpdateMailboxQuotaResponse
s@UpdateMailboxQuotaResponse' {} Int
a -> UpdateMailboxQuotaResponse
s {$sel:httpStatus:UpdateMailboxQuotaResponse' :: Int
httpStatus = Int
a} :: UpdateMailboxQuotaResponse)
instance Prelude.NFData UpdateMailboxQuotaResponse