{-# 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.Chime.UpdateAccountSettings
(
UpdateAccountSettings (..),
newUpdateAccountSettings,
updateAccountSettings_accountId,
updateAccountSettings_accountSettings,
UpdateAccountSettingsResponse (..),
newUpdateAccountSettingsResponse,
updateAccountSettingsResponse_httpStatus,
)
where
import Amazonka.Chime.Types
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
data UpdateAccountSettings = UpdateAccountSettings'
{
UpdateAccountSettings -> Text
accountId :: Prelude.Text,
UpdateAccountSettings -> AccountSettings
accountSettings :: AccountSettings
}
deriving (UpdateAccountSettings -> UpdateAccountSettings -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateAccountSettings -> UpdateAccountSettings -> Bool
$c/= :: UpdateAccountSettings -> UpdateAccountSettings -> Bool
== :: UpdateAccountSettings -> UpdateAccountSettings -> Bool
$c== :: UpdateAccountSettings -> UpdateAccountSettings -> Bool
Prelude.Eq, ReadPrec [UpdateAccountSettings]
ReadPrec UpdateAccountSettings
Int -> ReadS UpdateAccountSettings
ReadS [UpdateAccountSettings]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateAccountSettings]
$creadListPrec :: ReadPrec [UpdateAccountSettings]
readPrec :: ReadPrec UpdateAccountSettings
$creadPrec :: ReadPrec UpdateAccountSettings
readList :: ReadS [UpdateAccountSettings]
$creadList :: ReadS [UpdateAccountSettings]
readsPrec :: Int -> ReadS UpdateAccountSettings
$creadsPrec :: Int -> ReadS UpdateAccountSettings
Prelude.Read, Int -> UpdateAccountSettings -> ShowS
[UpdateAccountSettings] -> ShowS
UpdateAccountSettings -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateAccountSettings] -> ShowS
$cshowList :: [UpdateAccountSettings] -> ShowS
show :: UpdateAccountSettings -> String
$cshow :: UpdateAccountSettings -> String
showsPrec :: Int -> UpdateAccountSettings -> ShowS
$cshowsPrec :: Int -> UpdateAccountSettings -> ShowS
Prelude.Show, forall x. Rep UpdateAccountSettings x -> UpdateAccountSettings
forall x. UpdateAccountSettings -> Rep UpdateAccountSettings x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdateAccountSettings x -> UpdateAccountSettings
$cfrom :: forall x. UpdateAccountSettings -> Rep UpdateAccountSettings x
Prelude.Generic)
newUpdateAccountSettings ::
Prelude.Text ->
AccountSettings ->
UpdateAccountSettings
newUpdateAccountSettings :: Text -> AccountSettings -> UpdateAccountSettings
newUpdateAccountSettings
Text
pAccountId_
AccountSettings
pAccountSettings_ =
UpdateAccountSettings'
{ $sel:accountId:UpdateAccountSettings' :: Text
accountId = Text
pAccountId_,
$sel:accountSettings:UpdateAccountSettings' :: AccountSettings
accountSettings = AccountSettings
pAccountSettings_
}
updateAccountSettings_accountId :: Lens.Lens' UpdateAccountSettings Prelude.Text
updateAccountSettings_accountId :: Lens' UpdateAccountSettings Text
updateAccountSettings_accountId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateAccountSettings' {Text
accountId :: Text
$sel:accountId:UpdateAccountSettings' :: UpdateAccountSettings -> Text
accountId} -> Text
accountId) (\s :: UpdateAccountSettings
s@UpdateAccountSettings' {} Text
a -> UpdateAccountSettings
s {$sel:accountId:UpdateAccountSettings' :: Text
accountId = Text
a} :: UpdateAccountSettings)
updateAccountSettings_accountSettings :: Lens.Lens' UpdateAccountSettings AccountSettings
updateAccountSettings_accountSettings :: Lens' UpdateAccountSettings AccountSettings
updateAccountSettings_accountSettings = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateAccountSettings' {AccountSettings
accountSettings :: AccountSettings
$sel:accountSettings:UpdateAccountSettings' :: UpdateAccountSettings -> AccountSettings
accountSettings} -> AccountSettings
accountSettings) (\s :: UpdateAccountSettings
s@UpdateAccountSettings' {} AccountSettings
a -> UpdateAccountSettings
s {$sel:accountSettings:UpdateAccountSettings' :: AccountSettings
accountSettings = AccountSettings
a} :: UpdateAccountSettings)
instance Core.AWSRequest UpdateAccountSettings where
type
AWSResponse UpdateAccountSettings =
UpdateAccountSettingsResponse
request :: (Service -> Service)
-> UpdateAccountSettings -> Request UpdateAccountSettings
request Service -> Service
overrides =
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.putJSON (Service -> Service
overrides Service
defaultService)
response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy UpdateAccountSettings
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse UpdateAccountSettings)))
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 -> UpdateAccountSettingsResponse
UpdateAccountSettingsResponse'
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 UpdateAccountSettings where
hashWithSalt :: Int -> UpdateAccountSettings -> Int
hashWithSalt Int
_salt UpdateAccountSettings' {Text
AccountSettings
accountSettings :: AccountSettings
accountId :: Text
$sel:accountSettings:UpdateAccountSettings' :: UpdateAccountSettings -> AccountSettings
$sel:accountId:UpdateAccountSettings' :: UpdateAccountSettings -> Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
accountId
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` AccountSettings
accountSettings
instance Prelude.NFData UpdateAccountSettings where
rnf :: UpdateAccountSettings -> ()
rnf UpdateAccountSettings' {Text
AccountSettings
accountSettings :: AccountSettings
accountId :: Text
$sel:accountSettings:UpdateAccountSettings' :: UpdateAccountSettings -> AccountSettings
$sel:accountId:UpdateAccountSettings' :: UpdateAccountSettings -> Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Text
accountId
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf AccountSettings
accountSettings
instance Data.ToHeaders UpdateAccountSettings where
toHeaders :: UpdateAccountSettings -> ResponseHeaders
toHeaders = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
instance Data.ToJSON UpdateAccountSettings where
toJSON :: UpdateAccountSettings -> Value
toJSON UpdateAccountSettings' {Text
AccountSettings
accountSettings :: AccountSettings
accountId :: Text
$sel:accountSettings:UpdateAccountSettings' :: UpdateAccountSettings -> AccountSettings
$sel:accountId:UpdateAccountSettings' :: UpdateAccountSettings -> Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ forall a. a -> Maybe a
Prelude.Just
(Key
"AccountSettings" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= AccountSettings
accountSettings)
]
)
instance Data.ToPath UpdateAccountSettings where
toPath :: UpdateAccountSettings -> ByteString
toPath UpdateAccountSettings' {Text
AccountSettings
accountSettings :: AccountSettings
accountId :: Text
$sel:accountSettings:UpdateAccountSettings' :: UpdateAccountSettings -> AccountSettings
$sel:accountId:UpdateAccountSettings' :: UpdateAccountSettings -> Text
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ByteString
"/accounts/", forall a. ToByteString a => a -> ByteString
Data.toBS Text
accountId, ByteString
"/settings"]
instance Data.ToQuery UpdateAccountSettings where
toQuery :: UpdateAccountSettings -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data UpdateAccountSettingsResponse = UpdateAccountSettingsResponse'
{
UpdateAccountSettingsResponse -> Int
httpStatus :: Prelude.Int
}
deriving (UpdateAccountSettingsResponse
-> UpdateAccountSettingsResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateAccountSettingsResponse
-> UpdateAccountSettingsResponse -> Bool
$c/= :: UpdateAccountSettingsResponse
-> UpdateAccountSettingsResponse -> Bool
== :: UpdateAccountSettingsResponse
-> UpdateAccountSettingsResponse -> Bool
$c== :: UpdateAccountSettingsResponse
-> UpdateAccountSettingsResponse -> Bool
Prelude.Eq, ReadPrec [UpdateAccountSettingsResponse]
ReadPrec UpdateAccountSettingsResponse
Int -> ReadS UpdateAccountSettingsResponse
ReadS [UpdateAccountSettingsResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateAccountSettingsResponse]
$creadListPrec :: ReadPrec [UpdateAccountSettingsResponse]
readPrec :: ReadPrec UpdateAccountSettingsResponse
$creadPrec :: ReadPrec UpdateAccountSettingsResponse
readList :: ReadS [UpdateAccountSettingsResponse]
$creadList :: ReadS [UpdateAccountSettingsResponse]
readsPrec :: Int -> ReadS UpdateAccountSettingsResponse
$creadsPrec :: Int -> ReadS UpdateAccountSettingsResponse
Prelude.Read, Int -> UpdateAccountSettingsResponse -> ShowS
[UpdateAccountSettingsResponse] -> ShowS
UpdateAccountSettingsResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateAccountSettingsResponse] -> ShowS
$cshowList :: [UpdateAccountSettingsResponse] -> ShowS
show :: UpdateAccountSettingsResponse -> String
$cshow :: UpdateAccountSettingsResponse -> String
showsPrec :: Int -> UpdateAccountSettingsResponse -> ShowS
$cshowsPrec :: Int -> UpdateAccountSettingsResponse -> ShowS
Prelude.Show, forall x.
Rep UpdateAccountSettingsResponse x
-> UpdateAccountSettingsResponse
forall x.
UpdateAccountSettingsResponse
-> Rep UpdateAccountSettingsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UpdateAccountSettingsResponse x
-> UpdateAccountSettingsResponse
$cfrom :: forall x.
UpdateAccountSettingsResponse
-> Rep UpdateAccountSettingsResponse x
Prelude.Generic)
newUpdateAccountSettingsResponse ::
Prelude.Int ->
UpdateAccountSettingsResponse
newUpdateAccountSettingsResponse :: Int -> UpdateAccountSettingsResponse
newUpdateAccountSettingsResponse Int
pHttpStatus_ =
UpdateAccountSettingsResponse'
{ $sel:httpStatus:UpdateAccountSettingsResponse' :: Int
httpStatus =
Int
pHttpStatus_
}
updateAccountSettingsResponse_httpStatus :: Lens.Lens' UpdateAccountSettingsResponse Prelude.Int
updateAccountSettingsResponse_httpStatus :: Lens' UpdateAccountSettingsResponse Int
updateAccountSettingsResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateAccountSettingsResponse' {Int
httpStatus :: Int
$sel:httpStatus:UpdateAccountSettingsResponse' :: UpdateAccountSettingsResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: UpdateAccountSettingsResponse
s@UpdateAccountSettingsResponse' {} Int
a -> UpdateAccountSettingsResponse
s {$sel:httpStatus:UpdateAccountSettingsResponse' :: Int
httpStatus = Int
a} :: UpdateAccountSettingsResponse)
instance Prelude.NFData UpdateAccountSettingsResponse where
rnf :: UpdateAccountSettingsResponse -> ()
rnf UpdateAccountSettingsResponse' {Int
httpStatus :: Int
$sel:httpStatus:UpdateAccountSettingsResponse' :: UpdateAccountSettingsResponse -> Int
..} =
forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus