{-# 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.UpdateParticipantRoleConfig
(
UpdateParticipantRoleConfig (..),
newUpdateParticipantRoleConfig,
updateParticipantRoleConfig_instanceId,
updateParticipantRoleConfig_contactId,
updateParticipantRoleConfig_channelConfiguration,
UpdateParticipantRoleConfigResponse (..),
newUpdateParticipantRoleConfigResponse,
updateParticipantRoleConfigResponse_httpStatus,
)
where
import Amazonka.Connect.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 UpdateParticipantRoleConfig = UpdateParticipantRoleConfig'
{
UpdateParticipantRoleConfig -> Text
instanceId :: Prelude.Text,
UpdateParticipantRoleConfig -> Text
contactId :: Prelude.Text,
UpdateParticipantRoleConfig
-> UpdateParticipantRoleConfigChannelInfo
channelConfiguration :: UpdateParticipantRoleConfigChannelInfo
}
deriving (UpdateParticipantRoleConfig -> UpdateParticipantRoleConfig -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateParticipantRoleConfig -> UpdateParticipantRoleConfig -> Bool
$c/= :: UpdateParticipantRoleConfig -> UpdateParticipantRoleConfig -> Bool
== :: UpdateParticipantRoleConfig -> UpdateParticipantRoleConfig -> Bool
$c== :: UpdateParticipantRoleConfig -> UpdateParticipantRoleConfig -> Bool
Prelude.Eq, ReadPrec [UpdateParticipantRoleConfig]
ReadPrec UpdateParticipantRoleConfig
Int -> ReadS UpdateParticipantRoleConfig
ReadS [UpdateParticipantRoleConfig]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateParticipantRoleConfig]
$creadListPrec :: ReadPrec [UpdateParticipantRoleConfig]
readPrec :: ReadPrec UpdateParticipantRoleConfig
$creadPrec :: ReadPrec UpdateParticipantRoleConfig
readList :: ReadS [UpdateParticipantRoleConfig]
$creadList :: ReadS [UpdateParticipantRoleConfig]
readsPrec :: Int -> ReadS UpdateParticipantRoleConfig
$creadsPrec :: Int -> ReadS UpdateParticipantRoleConfig
Prelude.Read, Int -> UpdateParticipantRoleConfig -> ShowS
[UpdateParticipantRoleConfig] -> ShowS
UpdateParticipantRoleConfig -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateParticipantRoleConfig] -> ShowS
$cshowList :: [UpdateParticipantRoleConfig] -> ShowS
show :: UpdateParticipantRoleConfig -> String
$cshow :: UpdateParticipantRoleConfig -> String
showsPrec :: Int -> UpdateParticipantRoleConfig -> ShowS
$cshowsPrec :: Int -> UpdateParticipantRoleConfig -> ShowS
Prelude.Show, forall x.
Rep UpdateParticipantRoleConfig x -> UpdateParticipantRoleConfig
forall x.
UpdateParticipantRoleConfig -> Rep UpdateParticipantRoleConfig x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UpdateParticipantRoleConfig x -> UpdateParticipantRoleConfig
$cfrom :: forall x.
UpdateParticipantRoleConfig -> Rep UpdateParticipantRoleConfig x
Prelude.Generic)
newUpdateParticipantRoleConfig ::
Prelude.Text ->
Prelude.Text ->
UpdateParticipantRoleConfigChannelInfo ->
UpdateParticipantRoleConfig
newUpdateParticipantRoleConfig :: Text
-> Text
-> UpdateParticipantRoleConfigChannelInfo
-> UpdateParticipantRoleConfig
newUpdateParticipantRoleConfig
Text
pInstanceId_
Text
pContactId_
UpdateParticipantRoleConfigChannelInfo
pChannelConfiguration_ =
UpdateParticipantRoleConfig'
{ $sel:instanceId:UpdateParticipantRoleConfig' :: Text
instanceId =
Text
pInstanceId_,
$sel:contactId:UpdateParticipantRoleConfig' :: Text
contactId = Text
pContactId_,
$sel:channelConfiguration:UpdateParticipantRoleConfig' :: UpdateParticipantRoleConfigChannelInfo
channelConfiguration = UpdateParticipantRoleConfigChannelInfo
pChannelConfiguration_
}
updateParticipantRoleConfig_instanceId :: Lens.Lens' UpdateParticipantRoleConfig Prelude.Text
updateParticipantRoleConfig_instanceId :: Lens' UpdateParticipantRoleConfig Text
updateParticipantRoleConfig_instanceId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateParticipantRoleConfig' {Text
instanceId :: Text
$sel:instanceId:UpdateParticipantRoleConfig' :: UpdateParticipantRoleConfig -> Text
instanceId} -> Text
instanceId) (\s :: UpdateParticipantRoleConfig
s@UpdateParticipantRoleConfig' {} Text
a -> UpdateParticipantRoleConfig
s {$sel:instanceId:UpdateParticipantRoleConfig' :: Text
instanceId = Text
a} :: UpdateParticipantRoleConfig)
updateParticipantRoleConfig_contactId :: Lens.Lens' UpdateParticipantRoleConfig Prelude.Text
updateParticipantRoleConfig_contactId :: Lens' UpdateParticipantRoleConfig Text
updateParticipantRoleConfig_contactId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateParticipantRoleConfig' {Text
contactId :: Text
$sel:contactId:UpdateParticipantRoleConfig' :: UpdateParticipantRoleConfig -> Text
contactId} -> Text
contactId) (\s :: UpdateParticipantRoleConfig
s@UpdateParticipantRoleConfig' {} Text
a -> UpdateParticipantRoleConfig
s {$sel:contactId:UpdateParticipantRoleConfig' :: Text
contactId = Text
a} :: UpdateParticipantRoleConfig)
updateParticipantRoleConfig_channelConfiguration :: Lens.Lens' UpdateParticipantRoleConfig UpdateParticipantRoleConfigChannelInfo
updateParticipantRoleConfig_channelConfiguration :: Lens'
UpdateParticipantRoleConfig UpdateParticipantRoleConfigChannelInfo
updateParticipantRoleConfig_channelConfiguration = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateParticipantRoleConfig' {UpdateParticipantRoleConfigChannelInfo
channelConfiguration :: UpdateParticipantRoleConfigChannelInfo
$sel:channelConfiguration:UpdateParticipantRoleConfig' :: UpdateParticipantRoleConfig
-> UpdateParticipantRoleConfigChannelInfo
channelConfiguration} -> UpdateParticipantRoleConfigChannelInfo
channelConfiguration) (\s :: UpdateParticipantRoleConfig
s@UpdateParticipantRoleConfig' {} UpdateParticipantRoleConfigChannelInfo
a -> UpdateParticipantRoleConfig
s {$sel:channelConfiguration:UpdateParticipantRoleConfig' :: UpdateParticipantRoleConfigChannelInfo
channelConfiguration = UpdateParticipantRoleConfigChannelInfo
a} :: UpdateParticipantRoleConfig)
instance Core.AWSRequest UpdateParticipantRoleConfig where
type
AWSResponse UpdateParticipantRoleConfig =
UpdateParticipantRoleConfigResponse
request :: (Service -> Service)
-> UpdateParticipantRoleConfig
-> Request UpdateParticipantRoleConfig
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 UpdateParticipantRoleConfig
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse UpdateParticipantRoleConfig)))
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 -> UpdateParticipantRoleConfigResponse
UpdateParticipantRoleConfigResponse'
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 UpdateParticipantRoleConfig where
hashWithSalt :: Int -> UpdateParticipantRoleConfig -> Int
hashWithSalt Int
_salt UpdateParticipantRoleConfig' {Text
UpdateParticipantRoleConfigChannelInfo
channelConfiguration :: UpdateParticipantRoleConfigChannelInfo
contactId :: Text
instanceId :: Text
$sel:channelConfiguration:UpdateParticipantRoleConfig' :: UpdateParticipantRoleConfig
-> UpdateParticipantRoleConfigChannelInfo
$sel:contactId:UpdateParticipantRoleConfig' :: UpdateParticipantRoleConfig -> Text
$sel:instanceId:UpdateParticipantRoleConfig' :: UpdateParticipantRoleConfig -> Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
instanceId
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
contactId
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` UpdateParticipantRoleConfigChannelInfo
channelConfiguration
instance Prelude.NFData UpdateParticipantRoleConfig where
rnf :: UpdateParticipantRoleConfig -> ()
rnf UpdateParticipantRoleConfig' {Text
UpdateParticipantRoleConfigChannelInfo
channelConfiguration :: UpdateParticipantRoleConfigChannelInfo
contactId :: Text
instanceId :: Text
$sel:channelConfiguration:UpdateParticipantRoleConfig' :: UpdateParticipantRoleConfig
-> UpdateParticipantRoleConfigChannelInfo
$sel:contactId:UpdateParticipantRoleConfig' :: UpdateParticipantRoleConfig -> Text
$sel:instanceId:UpdateParticipantRoleConfig' :: UpdateParticipantRoleConfig -> Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Text
instanceId
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
contactId
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf UpdateParticipantRoleConfigChannelInfo
channelConfiguration
instance Data.ToHeaders UpdateParticipantRoleConfig where
toHeaders :: UpdateParticipantRoleConfig -> ResponseHeaders
toHeaders =
forall a b. a -> b -> a
Prelude.const
( forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"Content-Type"
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Data.ToJSON UpdateParticipantRoleConfig where
toJSON :: UpdateParticipantRoleConfig -> Value
toJSON UpdateParticipantRoleConfig' {Text
UpdateParticipantRoleConfigChannelInfo
channelConfiguration :: UpdateParticipantRoleConfigChannelInfo
contactId :: Text
instanceId :: Text
$sel:channelConfiguration:UpdateParticipantRoleConfig' :: UpdateParticipantRoleConfig
-> UpdateParticipantRoleConfigChannelInfo
$sel:contactId:UpdateParticipantRoleConfig' :: UpdateParticipantRoleConfig -> Text
$sel:instanceId:UpdateParticipantRoleConfig' :: UpdateParticipantRoleConfig -> Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ forall a. a -> Maybe a
Prelude.Just
( Key
"ChannelConfiguration"
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= UpdateParticipantRoleConfigChannelInfo
channelConfiguration
)
]
)
instance Data.ToPath UpdateParticipantRoleConfig where
toPath :: UpdateParticipantRoleConfig -> ByteString
toPath UpdateParticipantRoleConfig' {Text
UpdateParticipantRoleConfigChannelInfo
channelConfiguration :: UpdateParticipantRoleConfigChannelInfo
contactId :: Text
instanceId :: Text
$sel:channelConfiguration:UpdateParticipantRoleConfig' :: UpdateParticipantRoleConfig
-> UpdateParticipantRoleConfigChannelInfo
$sel:contactId:UpdateParticipantRoleConfig' :: UpdateParticipantRoleConfig -> Text
$sel:instanceId:UpdateParticipantRoleConfig' :: UpdateParticipantRoleConfig -> Text
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"/contact/participant-role-config/",
forall a. ToByteString a => a -> ByteString
Data.toBS Text
instanceId,
ByteString
"/",
forall a. ToByteString a => a -> ByteString
Data.toBS Text
contactId
]
instance Data.ToQuery UpdateParticipantRoleConfig where
toQuery :: UpdateParticipantRoleConfig -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data UpdateParticipantRoleConfigResponse = UpdateParticipantRoleConfigResponse'
{
UpdateParticipantRoleConfigResponse -> Int
httpStatus :: Prelude.Int
}
deriving (UpdateParticipantRoleConfigResponse
-> UpdateParticipantRoleConfigResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateParticipantRoleConfigResponse
-> UpdateParticipantRoleConfigResponse -> Bool
$c/= :: UpdateParticipantRoleConfigResponse
-> UpdateParticipantRoleConfigResponse -> Bool
== :: UpdateParticipantRoleConfigResponse
-> UpdateParticipantRoleConfigResponse -> Bool
$c== :: UpdateParticipantRoleConfigResponse
-> UpdateParticipantRoleConfigResponse -> Bool
Prelude.Eq, ReadPrec [UpdateParticipantRoleConfigResponse]
ReadPrec UpdateParticipantRoleConfigResponse
Int -> ReadS UpdateParticipantRoleConfigResponse
ReadS [UpdateParticipantRoleConfigResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateParticipantRoleConfigResponse]
$creadListPrec :: ReadPrec [UpdateParticipantRoleConfigResponse]
readPrec :: ReadPrec UpdateParticipantRoleConfigResponse
$creadPrec :: ReadPrec UpdateParticipantRoleConfigResponse
readList :: ReadS [UpdateParticipantRoleConfigResponse]
$creadList :: ReadS [UpdateParticipantRoleConfigResponse]
readsPrec :: Int -> ReadS UpdateParticipantRoleConfigResponse
$creadsPrec :: Int -> ReadS UpdateParticipantRoleConfigResponse
Prelude.Read, Int -> UpdateParticipantRoleConfigResponse -> ShowS
[UpdateParticipantRoleConfigResponse] -> ShowS
UpdateParticipantRoleConfigResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateParticipantRoleConfigResponse] -> ShowS
$cshowList :: [UpdateParticipantRoleConfigResponse] -> ShowS
show :: UpdateParticipantRoleConfigResponse -> String
$cshow :: UpdateParticipantRoleConfigResponse -> String
showsPrec :: Int -> UpdateParticipantRoleConfigResponse -> ShowS
$cshowsPrec :: Int -> UpdateParticipantRoleConfigResponse -> ShowS
Prelude.Show, forall x.
Rep UpdateParticipantRoleConfigResponse x
-> UpdateParticipantRoleConfigResponse
forall x.
UpdateParticipantRoleConfigResponse
-> Rep UpdateParticipantRoleConfigResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UpdateParticipantRoleConfigResponse x
-> UpdateParticipantRoleConfigResponse
$cfrom :: forall x.
UpdateParticipantRoleConfigResponse
-> Rep UpdateParticipantRoleConfigResponse x
Prelude.Generic)
newUpdateParticipantRoleConfigResponse ::
Prelude.Int ->
UpdateParticipantRoleConfigResponse
newUpdateParticipantRoleConfigResponse :: Int -> UpdateParticipantRoleConfigResponse
newUpdateParticipantRoleConfigResponse Int
pHttpStatus_ =
UpdateParticipantRoleConfigResponse'
{ $sel:httpStatus:UpdateParticipantRoleConfigResponse' :: Int
httpStatus =
Int
pHttpStatus_
}
updateParticipantRoleConfigResponse_httpStatus :: Lens.Lens' UpdateParticipantRoleConfigResponse Prelude.Int
updateParticipantRoleConfigResponse_httpStatus :: Lens' UpdateParticipantRoleConfigResponse Int
updateParticipantRoleConfigResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateParticipantRoleConfigResponse' {Int
httpStatus :: Int
$sel:httpStatus:UpdateParticipantRoleConfigResponse' :: UpdateParticipantRoleConfigResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: UpdateParticipantRoleConfigResponse
s@UpdateParticipantRoleConfigResponse' {} Int
a -> UpdateParticipantRoleConfigResponse
s {$sel:httpStatus:UpdateParticipantRoleConfigResponse' :: Int
httpStatus = Int
a} :: UpdateParticipantRoleConfigResponse)
instance
Prelude.NFData
UpdateParticipantRoleConfigResponse
where
rnf :: UpdateParticipantRoleConfigResponse -> ()
rnf UpdateParticipantRoleConfigResponse' {Int
httpStatus :: Int
$sel:httpStatus:UpdateParticipantRoleConfigResponse' :: UpdateParticipantRoleConfigResponse -> Int
..} =
forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus