{-# 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.StopContactRecording
(
StopContactRecording (..),
newStopContactRecording,
stopContactRecording_instanceId,
stopContactRecording_contactId,
stopContactRecording_initialContactId,
StopContactRecordingResponse (..),
newStopContactRecordingResponse,
stopContactRecordingResponse_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 StopContactRecording = StopContactRecording'
{
StopContactRecording -> Text
instanceId :: Prelude.Text,
StopContactRecording -> Text
contactId :: Prelude.Text,
StopContactRecording -> Text
initialContactId :: Prelude.Text
}
deriving (StopContactRecording -> StopContactRecording -> Bool
(StopContactRecording -> StopContactRecording -> Bool)
-> (StopContactRecording -> StopContactRecording -> Bool)
-> Eq StopContactRecording
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: StopContactRecording -> StopContactRecording -> Bool
$c/= :: StopContactRecording -> StopContactRecording -> Bool
== :: StopContactRecording -> StopContactRecording -> Bool
$c== :: StopContactRecording -> StopContactRecording -> Bool
Prelude.Eq, ReadPrec [StopContactRecording]
ReadPrec StopContactRecording
Int -> ReadS StopContactRecording
ReadS [StopContactRecording]
(Int -> ReadS StopContactRecording)
-> ReadS [StopContactRecording]
-> ReadPrec StopContactRecording
-> ReadPrec [StopContactRecording]
-> Read StopContactRecording
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [StopContactRecording]
$creadListPrec :: ReadPrec [StopContactRecording]
readPrec :: ReadPrec StopContactRecording
$creadPrec :: ReadPrec StopContactRecording
readList :: ReadS [StopContactRecording]
$creadList :: ReadS [StopContactRecording]
readsPrec :: Int -> ReadS StopContactRecording
$creadsPrec :: Int -> ReadS StopContactRecording
Prelude.Read, Int -> StopContactRecording -> ShowS
[StopContactRecording] -> ShowS
StopContactRecording -> String
(Int -> StopContactRecording -> ShowS)
-> (StopContactRecording -> String)
-> ([StopContactRecording] -> ShowS)
-> Show StopContactRecording
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [StopContactRecording] -> ShowS
$cshowList :: [StopContactRecording] -> ShowS
show :: StopContactRecording -> String
$cshow :: StopContactRecording -> String
showsPrec :: Int -> StopContactRecording -> ShowS
$cshowsPrec :: Int -> StopContactRecording -> ShowS
Prelude.Show, (forall x. StopContactRecording -> Rep StopContactRecording x)
-> (forall x. Rep StopContactRecording x -> StopContactRecording)
-> Generic StopContactRecording
forall x. Rep StopContactRecording x -> StopContactRecording
forall x. StopContactRecording -> Rep StopContactRecording x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep StopContactRecording x -> StopContactRecording
$cfrom :: forall x. StopContactRecording -> Rep StopContactRecording x
Prelude.Generic)
newStopContactRecording ::
Prelude.Text ->
Prelude.Text ->
Prelude.Text ->
StopContactRecording
newStopContactRecording :: Text -> Text -> Text -> StopContactRecording
newStopContactRecording
Text
pInstanceId_
Text
pContactId_
Text
pInitialContactId_ =
StopContactRecording' :: Text -> Text -> Text -> StopContactRecording
StopContactRecording'
{ $sel:instanceId:StopContactRecording' :: Text
instanceId = Text
pInstanceId_,
$sel:contactId:StopContactRecording' :: Text
contactId = Text
pContactId_,
$sel:initialContactId:StopContactRecording' :: Text
initialContactId = Text
pInitialContactId_
}
stopContactRecording_instanceId :: Lens.Lens' StopContactRecording Prelude.Text
stopContactRecording_instanceId :: (Text -> f Text) -> StopContactRecording -> f StopContactRecording
stopContactRecording_instanceId = (StopContactRecording -> Text)
-> (StopContactRecording -> Text -> StopContactRecording)
-> Lens StopContactRecording StopContactRecording Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StopContactRecording' {Text
instanceId :: Text
$sel:instanceId:StopContactRecording' :: StopContactRecording -> Text
instanceId} -> Text
instanceId) (\s :: StopContactRecording
s@StopContactRecording' {} Text
a -> StopContactRecording
s {$sel:instanceId:StopContactRecording' :: Text
instanceId = Text
a} :: StopContactRecording)
stopContactRecording_contactId :: Lens.Lens' StopContactRecording Prelude.Text
stopContactRecording_contactId :: (Text -> f Text) -> StopContactRecording -> f StopContactRecording
stopContactRecording_contactId = (StopContactRecording -> Text)
-> (StopContactRecording -> Text -> StopContactRecording)
-> Lens StopContactRecording StopContactRecording Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StopContactRecording' {Text
contactId :: Text
$sel:contactId:StopContactRecording' :: StopContactRecording -> Text
contactId} -> Text
contactId) (\s :: StopContactRecording
s@StopContactRecording' {} Text
a -> StopContactRecording
s {$sel:contactId:StopContactRecording' :: Text
contactId = Text
a} :: StopContactRecording)
stopContactRecording_initialContactId :: Lens.Lens' StopContactRecording Prelude.Text
stopContactRecording_initialContactId :: (Text -> f Text) -> StopContactRecording -> f StopContactRecording
stopContactRecording_initialContactId = (StopContactRecording -> Text)
-> (StopContactRecording -> Text -> StopContactRecording)
-> Lens StopContactRecording StopContactRecording Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StopContactRecording' {Text
initialContactId :: Text
$sel:initialContactId:StopContactRecording' :: StopContactRecording -> Text
initialContactId} -> Text
initialContactId) (\s :: StopContactRecording
s@StopContactRecording' {} Text
a -> StopContactRecording
s {$sel:initialContactId:StopContactRecording' :: Text
initialContactId = Text
a} :: StopContactRecording)
instance Core.AWSRequest StopContactRecording where
type
AWSResponse StopContactRecording =
StopContactRecordingResponse
request :: StopContactRecording -> Request StopContactRecording
request = Service -> StopContactRecording -> Request StopContactRecording
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy StopContactRecording
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse StopContactRecording)))
response =
(Int
-> ResponseHeaders
-> ()
-> Either String (AWSResponse StopContactRecording))
-> Logger
-> Service
-> Proxy StopContactRecording
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse StopContactRecording)))
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 -> StopContactRecordingResponse
StopContactRecordingResponse'
(Int -> StopContactRecordingResponse)
-> Either String Int -> Either String StopContactRecordingResponse
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 StopContactRecording
instance Prelude.NFData StopContactRecording
instance Core.ToHeaders StopContactRecording where
toHeaders :: StopContactRecording -> ResponseHeaders
toHeaders =
ResponseHeaders -> StopContactRecording -> 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 StopContactRecording where
toJSON :: StopContactRecording -> Value
toJSON StopContactRecording' {Text
initialContactId :: Text
contactId :: Text
instanceId :: Text
$sel:initialContactId:StopContactRecording' :: StopContactRecording -> Text
$sel:contactId:StopContactRecording' :: StopContactRecording -> Text
$sel:instanceId:StopContactRecording' :: StopContactRecording -> 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)
]
)
instance Core.ToPath StopContactRecording where
toPath :: StopContactRecording -> ByteString
toPath = ByteString -> StopContactRecording -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/contact/stop-recording"
instance Core.ToQuery StopContactRecording where
toQuery :: StopContactRecording -> QueryString
toQuery = QueryString -> StopContactRecording -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data StopContactRecordingResponse = StopContactRecordingResponse'
{
StopContactRecordingResponse -> Int
httpStatus :: Prelude.Int
}
deriving (StopContactRecordingResponse
-> StopContactRecordingResponse -> Bool
(StopContactRecordingResponse
-> StopContactRecordingResponse -> Bool)
-> (StopContactRecordingResponse
-> StopContactRecordingResponse -> Bool)
-> Eq StopContactRecordingResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: StopContactRecordingResponse
-> StopContactRecordingResponse -> Bool
$c/= :: StopContactRecordingResponse
-> StopContactRecordingResponse -> Bool
== :: StopContactRecordingResponse
-> StopContactRecordingResponse -> Bool
$c== :: StopContactRecordingResponse
-> StopContactRecordingResponse -> Bool
Prelude.Eq, ReadPrec [StopContactRecordingResponse]
ReadPrec StopContactRecordingResponse
Int -> ReadS StopContactRecordingResponse
ReadS [StopContactRecordingResponse]
(Int -> ReadS StopContactRecordingResponse)
-> ReadS [StopContactRecordingResponse]
-> ReadPrec StopContactRecordingResponse
-> ReadPrec [StopContactRecordingResponse]
-> Read StopContactRecordingResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [StopContactRecordingResponse]
$creadListPrec :: ReadPrec [StopContactRecordingResponse]
readPrec :: ReadPrec StopContactRecordingResponse
$creadPrec :: ReadPrec StopContactRecordingResponse
readList :: ReadS [StopContactRecordingResponse]
$creadList :: ReadS [StopContactRecordingResponse]
readsPrec :: Int -> ReadS StopContactRecordingResponse
$creadsPrec :: Int -> ReadS StopContactRecordingResponse
Prelude.Read, Int -> StopContactRecordingResponse -> ShowS
[StopContactRecordingResponse] -> ShowS
StopContactRecordingResponse -> String
(Int -> StopContactRecordingResponse -> ShowS)
-> (StopContactRecordingResponse -> String)
-> ([StopContactRecordingResponse] -> ShowS)
-> Show StopContactRecordingResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [StopContactRecordingResponse] -> ShowS
$cshowList :: [StopContactRecordingResponse] -> ShowS
show :: StopContactRecordingResponse -> String
$cshow :: StopContactRecordingResponse -> String
showsPrec :: Int -> StopContactRecordingResponse -> ShowS
$cshowsPrec :: Int -> StopContactRecordingResponse -> ShowS
Prelude.Show, (forall x.
StopContactRecordingResponse -> Rep StopContactRecordingResponse x)
-> (forall x.
Rep StopContactRecordingResponse x -> StopContactRecordingResponse)
-> Generic StopContactRecordingResponse
forall x.
Rep StopContactRecordingResponse x -> StopContactRecordingResponse
forall x.
StopContactRecordingResponse -> Rep StopContactRecordingResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep StopContactRecordingResponse x -> StopContactRecordingResponse
$cfrom :: forall x.
StopContactRecordingResponse -> Rep StopContactRecordingResponse x
Prelude.Generic)
newStopContactRecordingResponse ::
Prelude.Int ->
StopContactRecordingResponse
newStopContactRecordingResponse :: Int -> StopContactRecordingResponse
newStopContactRecordingResponse Int
pHttpStatus_ =
StopContactRecordingResponse' :: Int -> StopContactRecordingResponse
StopContactRecordingResponse'
{ $sel:httpStatus:StopContactRecordingResponse' :: Int
httpStatus =
Int
pHttpStatus_
}
stopContactRecordingResponse_httpStatus :: Lens.Lens' StopContactRecordingResponse Prelude.Int
stopContactRecordingResponse_httpStatus :: (Int -> f Int)
-> StopContactRecordingResponse -> f StopContactRecordingResponse
stopContactRecordingResponse_httpStatus = (StopContactRecordingResponse -> Int)
-> (StopContactRecordingResponse
-> Int -> StopContactRecordingResponse)
-> Lens
StopContactRecordingResponse StopContactRecordingResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StopContactRecordingResponse' {Int
httpStatus :: Int
$sel:httpStatus:StopContactRecordingResponse' :: StopContactRecordingResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: StopContactRecordingResponse
s@StopContactRecordingResponse' {} Int
a -> StopContactRecordingResponse
s {$sel:httpStatus:StopContactRecordingResponse' :: Int
httpStatus = Int
a} :: StopContactRecordingResponse)
instance Prelude.NFData StopContactRecordingResponse