{-# 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.StartContactRecording
(
StartContactRecording (..),
newStartContactRecording,
startContactRecording_instanceId,
startContactRecording_contactId,
startContactRecording_initialContactId,
startContactRecording_voiceRecordingConfiguration,
StartContactRecordingResponse (..),
newStartContactRecordingResponse,
startContactRecordingResponse_httpStatus,
)
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 StartContactRecording = StartContactRecording'
{
StartContactRecording -> Text
instanceId :: Prelude.Text,
StartContactRecording -> Text
contactId :: Prelude.Text,
StartContactRecording -> Text
initialContactId :: Prelude.Text,
StartContactRecording -> VoiceRecordingConfiguration
voiceRecordingConfiguration :: VoiceRecordingConfiguration
}
deriving (StartContactRecording -> StartContactRecording -> Bool
(StartContactRecording -> StartContactRecording -> Bool)
-> (StartContactRecording -> StartContactRecording -> Bool)
-> Eq StartContactRecording
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: StartContactRecording -> StartContactRecording -> Bool
$c/= :: StartContactRecording -> StartContactRecording -> Bool
== :: StartContactRecording -> StartContactRecording -> Bool
$c== :: StartContactRecording -> StartContactRecording -> Bool
Prelude.Eq, ReadPrec [StartContactRecording]
ReadPrec StartContactRecording
Int -> ReadS StartContactRecording
ReadS [StartContactRecording]
(Int -> ReadS StartContactRecording)
-> ReadS [StartContactRecording]
-> ReadPrec StartContactRecording
-> ReadPrec [StartContactRecording]
-> Read StartContactRecording
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [StartContactRecording]
$creadListPrec :: ReadPrec [StartContactRecording]
readPrec :: ReadPrec StartContactRecording
$creadPrec :: ReadPrec StartContactRecording
readList :: ReadS [StartContactRecording]
$creadList :: ReadS [StartContactRecording]
readsPrec :: Int -> ReadS StartContactRecording
$creadsPrec :: Int -> ReadS StartContactRecording
Prelude.Read, Int -> StartContactRecording -> ShowS
[StartContactRecording] -> ShowS
StartContactRecording -> String
(Int -> StartContactRecording -> ShowS)
-> (StartContactRecording -> String)
-> ([StartContactRecording] -> ShowS)
-> Show StartContactRecording
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [StartContactRecording] -> ShowS
$cshowList :: [StartContactRecording] -> ShowS
show :: StartContactRecording -> String
$cshow :: StartContactRecording -> String
showsPrec :: Int -> StartContactRecording -> ShowS
$cshowsPrec :: Int -> StartContactRecording -> ShowS
Prelude.Show, (forall x. StartContactRecording -> Rep StartContactRecording x)
-> (forall x. Rep StartContactRecording x -> StartContactRecording)
-> Generic StartContactRecording
forall x. Rep StartContactRecording x -> StartContactRecording
forall x. StartContactRecording -> Rep StartContactRecording x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep StartContactRecording x -> StartContactRecording
$cfrom :: forall x. StartContactRecording -> Rep StartContactRecording x
Prelude.Generic)
newStartContactRecording ::
Prelude.Text ->
Prelude.Text ->
Prelude.Text ->
VoiceRecordingConfiguration ->
StartContactRecording
newStartContactRecording :: Text
-> Text
-> Text
-> VoiceRecordingConfiguration
-> StartContactRecording
newStartContactRecording
Text
pInstanceId_
Text
pContactId_
Text
pInitialContactId_
VoiceRecordingConfiguration
pVoiceRecordingConfiguration_ =
StartContactRecording' :: Text
-> Text
-> Text
-> VoiceRecordingConfiguration
-> StartContactRecording
StartContactRecording'
{ $sel:instanceId:StartContactRecording' :: Text
instanceId = Text
pInstanceId_,
$sel:contactId:StartContactRecording' :: Text
contactId = Text
pContactId_,
$sel:initialContactId:StartContactRecording' :: Text
initialContactId = Text
pInitialContactId_,
$sel:voiceRecordingConfiguration:StartContactRecording' :: VoiceRecordingConfiguration
voiceRecordingConfiguration =
VoiceRecordingConfiguration
pVoiceRecordingConfiguration_
}
startContactRecording_instanceId :: Lens.Lens' StartContactRecording Prelude.Text
startContactRecording_instanceId :: (Text -> f Text)
-> StartContactRecording -> f StartContactRecording
startContactRecording_instanceId = (StartContactRecording -> Text)
-> (StartContactRecording -> Text -> StartContactRecording)
-> Lens StartContactRecording StartContactRecording Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartContactRecording' {Text
instanceId :: Text
$sel:instanceId:StartContactRecording' :: StartContactRecording -> Text
instanceId} -> Text
instanceId) (\s :: StartContactRecording
s@StartContactRecording' {} Text
a -> StartContactRecording
s {$sel:instanceId:StartContactRecording' :: Text
instanceId = Text
a} :: StartContactRecording)
startContactRecording_contactId :: Lens.Lens' StartContactRecording Prelude.Text
startContactRecording_contactId :: (Text -> f Text)
-> StartContactRecording -> f StartContactRecording
startContactRecording_contactId = (StartContactRecording -> Text)
-> (StartContactRecording -> Text -> StartContactRecording)
-> Lens StartContactRecording StartContactRecording Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartContactRecording' {Text
contactId :: Text
$sel:contactId:StartContactRecording' :: StartContactRecording -> Text
contactId} -> Text
contactId) (\s :: StartContactRecording
s@StartContactRecording' {} Text
a -> StartContactRecording
s {$sel:contactId:StartContactRecording' :: Text
contactId = Text
a} :: StartContactRecording)
startContactRecording_initialContactId :: Lens.Lens' StartContactRecording Prelude.Text
startContactRecording_initialContactId :: (Text -> f Text)
-> StartContactRecording -> f StartContactRecording
startContactRecording_initialContactId = (StartContactRecording -> Text)
-> (StartContactRecording -> Text -> StartContactRecording)
-> Lens StartContactRecording StartContactRecording Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartContactRecording' {Text
initialContactId :: Text
$sel:initialContactId:StartContactRecording' :: StartContactRecording -> Text
initialContactId} -> Text
initialContactId) (\s :: StartContactRecording
s@StartContactRecording' {} Text
a -> StartContactRecording
s {$sel:initialContactId:StartContactRecording' :: Text
initialContactId = Text
a} :: StartContactRecording)
startContactRecording_voiceRecordingConfiguration :: Lens.Lens' StartContactRecording VoiceRecordingConfiguration
startContactRecording_voiceRecordingConfiguration :: (VoiceRecordingConfiguration -> f VoiceRecordingConfiguration)
-> StartContactRecording -> f StartContactRecording
startContactRecording_voiceRecordingConfiguration = (StartContactRecording -> VoiceRecordingConfiguration)
-> (StartContactRecording
-> VoiceRecordingConfiguration -> StartContactRecording)
-> Lens
StartContactRecording
StartContactRecording
VoiceRecordingConfiguration
VoiceRecordingConfiguration
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartContactRecording' {VoiceRecordingConfiguration
voiceRecordingConfiguration :: VoiceRecordingConfiguration
$sel:voiceRecordingConfiguration:StartContactRecording' :: StartContactRecording -> VoiceRecordingConfiguration
voiceRecordingConfiguration} -> VoiceRecordingConfiguration
voiceRecordingConfiguration) (\s :: StartContactRecording
s@StartContactRecording' {} VoiceRecordingConfiguration
a -> StartContactRecording
s {$sel:voiceRecordingConfiguration:StartContactRecording' :: VoiceRecordingConfiguration
voiceRecordingConfiguration = VoiceRecordingConfiguration
a} :: StartContactRecording)
instance Core.AWSRequest StartContactRecording where
type
AWSResponse StartContactRecording =
StartContactRecordingResponse
request :: StartContactRecording -> Request StartContactRecording
request = Service -> StartContactRecording -> Request StartContactRecording
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy StartContactRecording
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse StartContactRecording)))
response =
(Int
-> ResponseHeaders
-> ()
-> Either String (AWSResponse StartContactRecording))
-> Logger
-> Service
-> Proxy StartContactRecording
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse StartContactRecording)))
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 -> StartContactRecordingResponse
StartContactRecordingResponse'
(Int -> StartContactRecordingResponse)
-> Either String Int -> Either String StartContactRecordingResponse
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 StartContactRecording
instance Prelude.NFData StartContactRecording
instance Core.ToHeaders StartContactRecording where
toHeaders :: StartContactRecording -> ResponseHeaders
toHeaders =
ResponseHeaders -> StartContactRecording -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ 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 StartContactRecording where
toJSON :: StartContactRecording -> Value
toJSON StartContactRecording' {Text
VoiceRecordingConfiguration
voiceRecordingConfiguration :: VoiceRecordingConfiguration
initialContactId :: Text
contactId :: Text
instanceId :: Text
$sel:voiceRecordingConfiguration:StartContactRecording' :: StartContactRecording -> VoiceRecordingConfiguration
$sel:initialContactId:StartContactRecording' :: StartContactRecording -> Text
$sel:contactId:StartContactRecording' :: StartContactRecording -> Text
$sel:instanceId:StartContactRecording' :: StartContactRecording -> 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
"InstanceId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
instanceId),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"ContactId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
contactId),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
(Text
"InitialContactId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
initialContactId),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
( Text
"VoiceRecordingConfiguration"
Text -> VoiceRecordingConfiguration -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= VoiceRecordingConfiguration
voiceRecordingConfiguration
)
]
)
instance Core.ToPath StartContactRecording where
toPath :: StartContactRecording -> ByteString
toPath = ByteString -> StartContactRecording -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/contact/start-recording"
instance Core.ToQuery StartContactRecording where
toQuery :: StartContactRecording -> QueryString
toQuery = QueryString -> StartContactRecording -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data StartContactRecordingResponse = StartContactRecordingResponse'
{
StartContactRecordingResponse -> Int
httpStatus :: Prelude.Int
}
deriving (StartContactRecordingResponse
-> StartContactRecordingResponse -> Bool
(StartContactRecordingResponse
-> StartContactRecordingResponse -> Bool)
-> (StartContactRecordingResponse
-> StartContactRecordingResponse -> Bool)
-> Eq StartContactRecordingResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: StartContactRecordingResponse
-> StartContactRecordingResponse -> Bool
$c/= :: StartContactRecordingResponse
-> StartContactRecordingResponse -> Bool
== :: StartContactRecordingResponse
-> StartContactRecordingResponse -> Bool
$c== :: StartContactRecordingResponse
-> StartContactRecordingResponse -> Bool
Prelude.Eq, ReadPrec [StartContactRecordingResponse]
ReadPrec StartContactRecordingResponse
Int -> ReadS StartContactRecordingResponse
ReadS [StartContactRecordingResponse]
(Int -> ReadS StartContactRecordingResponse)
-> ReadS [StartContactRecordingResponse]
-> ReadPrec StartContactRecordingResponse
-> ReadPrec [StartContactRecordingResponse]
-> Read StartContactRecordingResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [StartContactRecordingResponse]
$creadListPrec :: ReadPrec [StartContactRecordingResponse]
readPrec :: ReadPrec StartContactRecordingResponse
$creadPrec :: ReadPrec StartContactRecordingResponse
readList :: ReadS [StartContactRecordingResponse]
$creadList :: ReadS [StartContactRecordingResponse]
readsPrec :: Int -> ReadS StartContactRecordingResponse
$creadsPrec :: Int -> ReadS StartContactRecordingResponse
Prelude.Read, Int -> StartContactRecordingResponse -> ShowS
[StartContactRecordingResponse] -> ShowS
StartContactRecordingResponse -> String
(Int -> StartContactRecordingResponse -> ShowS)
-> (StartContactRecordingResponse -> String)
-> ([StartContactRecordingResponse] -> ShowS)
-> Show StartContactRecordingResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [StartContactRecordingResponse] -> ShowS
$cshowList :: [StartContactRecordingResponse] -> ShowS
show :: StartContactRecordingResponse -> String
$cshow :: StartContactRecordingResponse -> String
showsPrec :: Int -> StartContactRecordingResponse -> ShowS
$cshowsPrec :: Int -> StartContactRecordingResponse -> ShowS
Prelude.Show, (forall x.
StartContactRecordingResponse
-> Rep StartContactRecordingResponse x)
-> (forall x.
Rep StartContactRecordingResponse x
-> StartContactRecordingResponse)
-> Generic StartContactRecordingResponse
forall x.
Rep StartContactRecordingResponse x
-> StartContactRecordingResponse
forall x.
StartContactRecordingResponse
-> Rep StartContactRecordingResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep StartContactRecordingResponse x
-> StartContactRecordingResponse
$cfrom :: forall x.
StartContactRecordingResponse
-> Rep StartContactRecordingResponse x
Prelude.Generic)
newStartContactRecordingResponse ::
Prelude.Int ->
StartContactRecordingResponse
newStartContactRecordingResponse :: Int -> StartContactRecordingResponse
newStartContactRecordingResponse Int
pHttpStatus_ =
StartContactRecordingResponse' :: Int -> StartContactRecordingResponse
StartContactRecordingResponse'
{ $sel:httpStatus:StartContactRecordingResponse' :: Int
httpStatus =
Int
pHttpStatus_
}
startContactRecordingResponse_httpStatus :: Lens.Lens' StartContactRecordingResponse Prelude.Int
startContactRecordingResponse_httpStatus :: (Int -> f Int)
-> StartContactRecordingResponse -> f StartContactRecordingResponse
startContactRecordingResponse_httpStatus = (StartContactRecordingResponse -> Int)
-> (StartContactRecordingResponse
-> Int -> StartContactRecordingResponse)
-> Lens
StartContactRecordingResponse StartContactRecordingResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartContactRecordingResponse' {Int
httpStatus :: Int
$sel:httpStatus:StartContactRecordingResponse' :: StartContactRecordingResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: StartContactRecordingResponse
s@StartContactRecordingResponse' {} Int
a -> StartContactRecordingResponse
s {$sel:httpStatus:StartContactRecordingResponse' :: Int
httpStatus = Int
a} :: StartContactRecordingResponse)
instance Prelude.NFData StartContactRecordingResponse