{-# 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.Connect.UpdateUserPhoneConfig
(
UpdateUserPhoneConfig (..),
newUpdateUserPhoneConfig,
updateUserPhoneConfig_phoneConfig,
updateUserPhoneConfig_userId,
updateUserPhoneConfig_instanceId,
UpdateUserPhoneConfigResponse (..),
newUpdateUserPhoneConfigResponse,
)
where
import Amazonka.Connect.Types
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
data UpdateUserPhoneConfig = UpdateUserPhoneConfig'
{
UpdateUserPhoneConfig -> UserPhoneConfig
phoneConfig :: UserPhoneConfig,
UpdateUserPhoneConfig -> Text
userId :: Prelude.Text,
UpdateUserPhoneConfig -> Text
instanceId :: Prelude.Text
}
deriving (UpdateUserPhoneConfig -> UpdateUserPhoneConfig -> Bool
(UpdateUserPhoneConfig -> UpdateUserPhoneConfig -> Bool)
-> (UpdateUserPhoneConfig -> UpdateUserPhoneConfig -> Bool)
-> Eq UpdateUserPhoneConfig
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateUserPhoneConfig -> UpdateUserPhoneConfig -> Bool
$c/= :: UpdateUserPhoneConfig -> UpdateUserPhoneConfig -> Bool
== :: UpdateUserPhoneConfig -> UpdateUserPhoneConfig -> Bool
$c== :: UpdateUserPhoneConfig -> UpdateUserPhoneConfig -> Bool
Prelude.Eq, ReadPrec [UpdateUserPhoneConfig]
ReadPrec UpdateUserPhoneConfig
Int -> ReadS UpdateUserPhoneConfig
ReadS [UpdateUserPhoneConfig]
(Int -> ReadS UpdateUserPhoneConfig)
-> ReadS [UpdateUserPhoneConfig]
-> ReadPrec UpdateUserPhoneConfig
-> ReadPrec [UpdateUserPhoneConfig]
-> Read UpdateUserPhoneConfig
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateUserPhoneConfig]
$creadListPrec :: ReadPrec [UpdateUserPhoneConfig]
readPrec :: ReadPrec UpdateUserPhoneConfig
$creadPrec :: ReadPrec UpdateUserPhoneConfig
readList :: ReadS [UpdateUserPhoneConfig]
$creadList :: ReadS [UpdateUserPhoneConfig]
readsPrec :: Int -> ReadS UpdateUserPhoneConfig
$creadsPrec :: Int -> ReadS UpdateUserPhoneConfig
Prelude.Read, Int -> UpdateUserPhoneConfig -> ShowS
[UpdateUserPhoneConfig] -> ShowS
UpdateUserPhoneConfig -> String
(Int -> UpdateUserPhoneConfig -> ShowS)
-> (UpdateUserPhoneConfig -> String)
-> ([UpdateUserPhoneConfig] -> ShowS)
-> Show UpdateUserPhoneConfig
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateUserPhoneConfig] -> ShowS
$cshowList :: [UpdateUserPhoneConfig] -> ShowS
show :: UpdateUserPhoneConfig -> String
$cshow :: UpdateUserPhoneConfig -> String
showsPrec :: Int -> UpdateUserPhoneConfig -> ShowS
$cshowsPrec :: Int -> UpdateUserPhoneConfig -> ShowS
Prelude.Show, (forall x. UpdateUserPhoneConfig -> Rep UpdateUserPhoneConfig x)
-> (forall x. Rep UpdateUserPhoneConfig x -> UpdateUserPhoneConfig)
-> Generic UpdateUserPhoneConfig
forall x. Rep UpdateUserPhoneConfig x -> UpdateUserPhoneConfig
forall x. UpdateUserPhoneConfig -> Rep UpdateUserPhoneConfig x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdateUserPhoneConfig x -> UpdateUserPhoneConfig
$cfrom :: forall x. UpdateUserPhoneConfig -> Rep UpdateUserPhoneConfig x
Prelude.Generic)
newUpdateUserPhoneConfig ::
UserPhoneConfig ->
Prelude.Text ->
Prelude.Text ->
UpdateUserPhoneConfig
newUpdateUserPhoneConfig :: UserPhoneConfig -> Text -> Text -> UpdateUserPhoneConfig
newUpdateUserPhoneConfig
UserPhoneConfig
pPhoneConfig_
Text
pUserId_
Text
pInstanceId_ =
UpdateUserPhoneConfig' :: UserPhoneConfig -> Text -> Text -> UpdateUserPhoneConfig
UpdateUserPhoneConfig'
{ $sel:phoneConfig:UpdateUserPhoneConfig' :: UserPhoneConfig
phoneConfig = UserPhoneConfig
pPhoneConfig_,
$sel:userId:UpdateUserPhoneConfig' :: Text
userId = Text
pUserId_,
$sel:instanceId:UpdateUserPhoneConfig' :: Text
instanceId = Text
pInstanceId_
}
updateUserPhoneConfig_phoneConfig :: Lens.Lens' UpdateUserPhoneConfig UserPhoneConfig
updateUserPhoneConfig_phoneConfig :: (UserPhoneConfig -> f UserPhoneConfig)
-> UpdateUserPhoneConfig -> f UpdateUserPhoneConfig
updateUserPhoneConfig_phoneConfig = (UpdateUserPhoneConfig -> UserPhoneConfig)
-> (UpdateUserPhoneConfig
-> UserPhoneConfig -> UpdateUserPhoneConfig)
-> Lens
UpdateUserPhoneConfig
UpdateUserPhoneConfig
UserPhoneConfig
UserPhoneConfig
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateUserPhoneConfig' {UserPhoneConfig
phoneConfig :: UserPhoneConfig
$sel:phoneConfig:UpdateUserPhoneConfig' :: UpdateUserPhoneConfig -> UserPhoneConfig
phoneConfig} -> UserPhoneConfig
phoneConfig) (\s :: UpdateUserPhoneConfig
s@UpdateUserPhoneConfig' {} UserPhoneConfig
a -> UpdateUserPhoneConfig
s {$sel:phoneConfig:UpdateUserPhoneConfig' :: UserPhoneConfig
phoneConfig = UserPhoneConfig
a} :: UpdateUserPhoneConfig)
updateUserPhoneConfig_userId :: Lens.Lens' UpdateUserPhoneConfig Prelude.Text
updateUserPhoneConfig_userId :: (Text -> f Text)
-> UpdateUserPhoneConfig -> f UpdateUserPhoneConfig
updateUserPhoneConfig_userId = (UpdateUserPhoneConfig -> Text)
-> (UpdateUserPhoneConfig -> Text -> UpdateUserPhoneConfig)
-> Lens UpdateUserPhoneConfig UpdateUserPhoneConfig Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateUserPhoneConfig' {Text
userId :: Text
$sel:userId:UpdateUserPhoneConfig' :: UpdateUserPhoneConfig -> Text
userId} -> Text
userId) (\s :: UpdateUserPhoneConfig
s@UpdateUserPhoneConfig' {} Text
a -> UpdateUserPhoneConfig
s {$sel:userId:UpdateUserPhoneConfig' :: Text
userId = Text
a} :: UpdateUserPhoneConfig)
updateUserPhoneConfig_instanceId :: Lens.Lens' UpdateUserPhoneConfig Prelude.Text
updateUserPhoneConfig_instanceId :: (Text -> f Text)
-> UpdateUserPhoneConfig -> f UpdateUserPhoneConfig
updateUserPhoneConfig_instanceId = (UpdateUserPhoneConfig -> Text)
-> (UpdateUserPhoneConfig -> Text -> UpdateUserPhoneConfig)
-> Lens UpdateUserPhoneConfig UpdateUserPhoneConfig Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateUserPhoneConfig' {Text
instanceId :: Text
$sel:instanceId:UpdateUserPhoneConfig' :: UpdateUserPhoneConfig -> Text
instanceId} -> Text
instanceId) (\s :: UpdateUserPhoneConfig
s@UpdateUserPhoneConfig' {} Text
a -> UpdateUserPhoneConfig
s {$sel:instanceId:UpdateUserPhoneConfig' :: Text
instanceId = Text
a} :: UpdateUserPhoneConfig)
instance Core.AWSRequest UpdateUserPhoneConfig where
type
AWSResponse UpdateUserPhoneConfig =
UpdateUserPhoneConfigResponse
request :: UpdateUserPhoneConfig -> Request UpdateUserPhoneConfig
request = Service -> UpdateUserPhoneConfig -> Request UpdateUserPhoneConfig
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy UpdateUserPhoneConfig
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse UpdateUserPhoneConfig)))
response =
AWSResponse UpdateUserPhoneConfig
-> Logger
-> Service
-> Proxy UpdateUserPhoneConfig
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse UpdateUserPhoneConfig)))
forall (m :: * -> *) a.
MonadResource m =>
AWSResponse a
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveNull AWSResponse UpdateUserPhoneConfig
UpdateUserPhoneConfigResponse
UpdateUserPhoneConfigResponse'
instance Prelude.Hashable UpdateUserPhoneConfig
instance Prelude.NFData UpdateUserPhoneConfig
instance Core.ToHeaders UpdateUserPhoneConfig where
toHeaders :: UpdateUserPhoneConfig -> [Header]
toHeaders =
[Header] -> UpdateUserPhoneConfig -> [Header]
forall a b. a -> b -> a
Prelude.const
( [[Header]] -> [Header]
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"Content-Type"
HeaderName -> ByteString -> [Header]
forall a. ToHeader a => HeaderName -> a -> [Header]
Core.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Core.ToJSON UpdateUserPhoneConfig where
toJSON :: UpdateUserPhoneConfig -> Value
toJSON UpdateUserPhoneConfig' {Text
UserPhoneConfig
instanceId :: Text
userId :: Text
phoneConfig :: UserPhoneConfig
$sel:instanceId:UpdateUserPhoneConfig' :: UpdateUserPhoneConfig -> Text
$sel:userId:UpdateUserPhoneConfig' :: UpdateUserPhoneConfig -> Text
$sel:phoneConfig:UpdateUserPhoneConfig' :: UpdateUserPhoneConfig -> UserPhoneConfig
..} =
[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
"PhoneConfig" Text -> UserPhoneConfig -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= UserPhoneConfig
phoneConfig)]
)
instance Core.ToPath UpdateUserPhoneConfig where
toPath :: UpdateUserPhoneConfig -> ByteString
toPath UpdateUserPhoneConfig' {Text
UserPhoneConfig
instanceId :: Text
userId :: Text
phoneConfig :: UserPhoneConfig
$sel:instanceId:UpdateUserPhoneConfig' :: UpdateUserPhoneConfig -> Text
$sel:userId:UpdateUserPhoneConfig' :: UpdateUserPhoneConfig -> Text
$sel:phoneConfig:UpdateUserPhoneConfig' :: UpdateUserPhoneConfig -> UserPhoneConfig
..} =
[ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"/users/",
Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
instanceId,
ByteString
"/",
Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
userId,
ByteString
"/phone-config"
]
instance Core.ToQuery UpdateUserPhoneConfig where
toQuery :: UpdateUserPhoneConfig -> QueryString
toQuery = QueryString -> UpdateUserPhoneConfig -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data UpdateUserPhoneConfigResponse = UpdateUserPhoneConfigResponse'
{
}
deriving (UpdateUserPhoneConfigResponse
-> UpdateUserPhoneConfigResponse -> Bool
(UpdateUserPhoneConfigResponse
-> UpdateUserPhoneConfigResponse -> Bool)
-> (UpdateUserPhoneConfigResponse
-> UpdateUserPhoneConfigResponse -> Bool)
-> Eq UpdateUserPhoneConfigResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateUserPhoneConfigResponse
-> UpdateUserPhoneConfigResponse -> Bool
$c/= :: UpdateUserPhoneConfigResponse
-> UpdateUserPhoneConfigResponse -> Bool
== :: UpdateUserPhoneConfigResponse
-> UpdateUserPhoneConfigResponse -> Bool
$c== :: UpdateUserPhoneConfigResponse
-> UpdateUserPhoneConfigResponse -> Bool
Prelude.Eq, ReadPrec [UpdateUserPhoneConfigResponse]
ReadPrec UpdateUserPhoneConfigResponse
Int -> ReadS UpdateUserPhoneConfigResponse
ReadS [UpdateUserPhoneConfigResponse]
(Int -> ReadS UpdateUserPhoneConfigResponse)
-> ReadS [UpdateUserPhoneConfigResponse]
-> ReadPrec UpdateUserPhoneConfigResponse
-> ReadPrec [UpdateUserPhoneConfigResponse]
-> Read UpdateUserPhoneConfigResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateUserPhoneConfigResponse]
$creadListPrec :: ReadPrec [UpdateUserPhoneConfigResponse]
readPrec :: ReadPrec UpdateUserPhoneConfigResponse
$creadPrec :: ReadPrec UpdateUserPhoneConfigResponse
readList :: ReadS [UpdateUserPhoneConfigResponse]
$creadList :: ReadS [UpdateUserPhoneConfigResponse]
readsPrec :: Int -> ReadS UpdateUserPhoneConfigResponse
$creadsPrec :: Int -> ReadS UpdateUserPhoneConfigResponse
Prelude.Read, Int -> UpdateUserPhoneConfigResponse -> ShowS
[UpdateUserPhoneConfigResponse] -> ShowS
UpdateUserPhoneConfigResponse -> String
(Int -> UpdateUserPhoneConfigResponse -> ShowS)
-> (UpdateUserPhoneConfigResponse -> String)
-> ([UpdateUserPhoneConfigResponse] -> ShowS)
-> Show UpdateUserPhoneConfigResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateUserPhoneConfigResponse] -> ShowS
$cshowList :: [UpdateUserPhoneConfigResponse] -> ShowS
show :: UpdateUserPhoneConfigResponse -> String
$cshow :: UpdateUserPhoneConfigResponse -> String
showsPrec :: Int -> UpdateUserPhoneConfigResponse -> ShowS
$cshowsPrec :: Int -> UpdateUserPhoneConfigResponse -> ShowS
Prelude.Show, (forall x.
UpdateUserPhoneConfigResponse
-> Rep UpdateUserPhoneConfigResponse x)
-> (forall x.
Rep UpdateUserPhoneConfigResponse x
-> UpdateUserPhoneConfigResponse)
-> Generic UpdateUserPhoneConfigResponse
forall x.
Rep UpdateUserPhoneConfigResponse x
-> UpdateUserPhoneConfigResponse
forall x.
UpdateUserPhoneConfigResponse
-> Rep UpdateUserPhoneConfigResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UpdateUserPhoneConfigResponse x
-> UpdateUserPhoneConfigResponse
$cfrom :: forall x.
UpdateUserPhoneConfigResponse
-> Rep UpdateUserPhoneConfigResponse x
Prelude.Generic)
newUpdateUserPhoneConfigResponse ::
UpdateUserPhoneConfigResponse
newUpdateUserPhoneConfigResponse :: UpdateUserPhoneConfigResponse
newUpdateUserPhoneConfigResponse =
UpdateUserPhoneConfigResponse
UpdateUserPhoneConfigResponse'
instance Prelude.NFData UpdateUserPhoneConfigResponse