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