{-# 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.TransferContact
(
TransferContact (..),
newTransferContact,
transferContact_clientToken,
transferContact_queueId,
transferContact_userId,
transferContact_instanceId,
transferContact_contactId,
transferContact_contactFlowId,
TransferContactResponse (..),
newTransferContactResponse,
transferContactResponse_contactArn,
transferContactResponse_contactId,
transferContactResponse_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 TransferContact = TransferContact'
{
TransferContact -> Maybe Text
clientToken :: Prelude.Maybe Prelude.Text,
TransferContact -> Maybe Text
queueId :: Prelude.Maybe Prelude.Text,
TransferContact -> Maybe Text
userId :: Prelude.Maybe Prelude.Text,
TransferContact -> Text
instanceId :: Prelude.Text,
TransferContact -> Text
contactId :: Prelude.Text,
TransferContact -> Text
contactFlowId :: Prelude.Text
}
deriving (TransferContact -> TransferContact -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: TransferContact -> TransferContact -> Bool
$c/= :: TransferContact -> TransferContact -> Bool
== :: TransferContact -> TransferContact -> Bool
$c== :: TransferContact -> TransferContact -> Bool
Prelude.Eq, ReadPrec [TransferContact]
ReadPrec TransferContact
Int -> ReadS TransferContact
ReadS [TransferContact]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [TransferContact]
$creadListPrec :: ReadPrec [TransferContact]
readPrec :: ReadPrec TransferContact
$creadPrec :: ReadPrec TransferContact
readList :: ReadS [TransferContact]
$creadList :: ReadS [TransferContact]
readsPrec :: Int -> ReadS TransferContact
$creadsPrec :: Int -> ReadS TransferContact
Prelude.Read, Int -> TransferContact -> ShowS
[TransferContact] -> ShowS
TransferContact -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [TransferContact] -> ShowS
$cshowList :: [TransferContact] -> ShowS
show :: TransferContact -> String
$cshow :: TransferContact -> String
showsPrec :: Int -> TransferContact -> ShowS
$cshowsPrec :: Int -> TransferContact -> ShowS
Prelude.Show, forall x. Rep TransferContact x -> TransferContact
forall x. TransferContact -> Rep TransferContact x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep TransferContact x -> TransferContact
$cfrom :: forall x. TransferContact -> Rep TransferContact x
Prelude.Generic)
newTransferContact ::
Prelude.Text ->
Prelude.Text ->
Prelude.Text ->
TransferContact
newTransferContact :: Text -> Text -> Text -> TransferContact
newTransferContact
Text
pInstanceId_
Text
pContactId_
Text
pContactFlowId_ =
TransferContact'
{ $sel:clientToken:TransferContact' :: Maybe Text
clientToken = forall a. Maybe a
Prelude.Nothing,
$sel:queueId:TransferContact' :: Maybe Text
queueId = forall a. Maybe a
Prelude.Nothing,
$sel:userId:TransferContact' :: Maybe Text
userId = forall a. Maybe a
Prelude.Nothing,
$sel:instanceId:TransferContact' :: Text
instanceId = Text
pInstanceId_,
$sel:contactId:TransferContact' :: Text
contactId = Text
pContactId_,
$sel:contactFlowId:TransferContact' :: Text
contactFlowId = Text
pContactFlowId_
}
transferContact_clientToken :: Lens.Lens' TransferContact (Prelude.Maybe Prelude.Text)
transferContact_clientToken :: Lens' TransferContact (Maybe Text)
transferContact_clientToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TransferContact' {Maybe Text
clientToken :: Maybe Text
$sel:clientToken:TransferContact' :: TransferContact -> Maybe Text
clientToken} -> Maybe Text
clientToken) (\s :: TransferContact
s@TransferContact' {} Maybe Text
a -> TransferContact
s {$sel:clientToken:TransferContact' :: Maybe Text
clientToken = Maybe Text
a} :: TransferContact)
transferContact_queueId :: Lens.Lens' TransferContact (Prelude.Maybe Prelude.Text)
transferContact_queueId :: Lens' TransferContact (Maybe Text)
transferContact_queueId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TransferContact' {Maybe Text
queueId :: Maybe Text
$sel:queueId:TransferContact' :: TransferContact -> Maybe Text
queueId} -> Maybe Text
queueId) (\s :: TransferContact
s@TransferContact' {} Maybe Text
a -> TransferContact
s {$sel:queueId:TransferContact' :: Maybe Text
queueId = Maybe Text
a} :: TransferContact)
transferContact_userId :: Lens.Lens' TransferContact (Prelude.Maybe Prelude.Text)
transferContact_userId :: Lens' TransferContact (Maybe Text)
transferContact_userId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TransferContact' {Maybe Text
userId :: Maybe Text
$sel:userId:TransferContact' :: TransferContact -> Maybe Text
userId} -> Maybe Text
userId) (\s :: TransferContact
s@TransferContact' {} Maybe Text
a -> TransferContact
s {$sel:userId:TransferContact' :: Maybe Text
userId = Maybe Text
a} :: TransferContact)
transferContact_instanceId :: Lens.Lens' TransferContact Prelude.Text
transferContact_instanceId :: Lens' TransferContact Text
transferContact_instanceId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TransferContact' {Text
instanceId :: Text
$sel:instanceId:TransferContact' :: TransferContact -> Text
instanceId} -> Text
instanceId) (\s :: TransferContact
s@TransferContact' {} Text
a -> TransferContact
s {$sel:instanceId:TransferContact' :: Text
instanceId = Text
a} :: TransferContact)
transferContact_contactId :: Lens.Lens' TransferContact Prelude.Text
transferContact_contactId :: Lens' TransferContact Text
transferContact_contactId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TransferContact' {Text
contactId :: Text
$sel:contactId:TransferContact' :: TransferContact -> Text
contactId} -> Text
contactId) (\s :: TransferContact
s@TransferContact' {} Text
a -> TransferContact
s {$sel:contactId:TransferContact' :: Text
contactId = Text
a} :: TransferContact)
transferContact_contactFlowId :: Lens.Lens' TransferContact Prelude.Text
transferContact_contactFlowId :: Lens' TransferContact Text
transferContact_contactFlowId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TransferContact' {Text
contactFlowId :: Text
$sel:contactFlowId:TransferContact' :: TransferContact -> Text
contactFlowId} -> Text
contactFlowId) (\s :: TransferContact
s@TransferContact' {} Text
a -> TransferContact
s {$sel:contactFlowId:TransferContact' :: Text
contactFlowId = Text
a} :: TransferContact)
instance Core.AWSRequest TransferContact where
type
AWSResponse TransferContact =
TransferContactResponse
request :: (Service -> Service) -> TransferContact -> Request TransferContact
request Service -> Service
overrides =
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON (Service -> Service
overrides Service
defaultService)
response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy TransferContact
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse TransferContact)))
response =
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
( \Int
s ResponseHeaders
h Object
x ->
Maybe Text -> Maybe Text -> Int -> TransferContactResponse
TransferContactResponse'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"ContactArn")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"ContactId")
forall (f :: * -> *) a b. Applicative f => 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 TransferContact where
hashWithSalt :: Int -> TransferContact -> Int
hashWithSalt Int
_salt TransferContact' {Maybe Text
Text
contactFlowId :: Text
contactId :: Text
instanceId :: Text
userId :: Maybe Text
queueId :: Maybe Text
clientToken :: Maybe Text
$sel:contactFlowId:TransferContact' :: TransferContact -> Text
$sel:contactId:TransferContact' :: TransferContact -> Text
$sel:instanceId:TransferContact' :: TransferContact -> Text
$sel:userId:TransferContact' :: TransferContact -> Maybe Text
$sel:queueId:TransferContact' :: TransferContact -> Maybe Text
$sel:clientToken:TransferContact' :: TransferContact -> Maybe Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
clientToken
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
queueId
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
userId
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` Text
contactFlowId
instance Prelude.NFData TransferContact where
rnf :: TransferContact -> ()
rnf TransferContact' {Maybe Text
Text
contactFlowId :: Text
contactId :: Text
instanceId :: Text
userId :: Maybe Text
queueId :: Maybe Text
clientToken :: Maybe Text
$sel:contactFlowId:TransferContact' :: TransferContact -> Text
$sel:contactId:TransferContact' :: TransferContact -> Text
$sel:instanceId:TransferContact' :: TransferContact -> Text
$sel:userId:TransferContact' :: TransferContact -> Maybe Text
$sel:queueId:TransferContact' :: TransferContact -> Maybe Text
$sel:clientToken:TransferContact' :: TransferContact -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
clientToken
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
queueId
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
userId
seq :: forall a b. a -> b -> b
`Prelude.seq` 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 Text
contactFlowId
instance Data.ToHeaders TransferContact where
toHeaders :: TransferContact -> 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 TransferContact where
toJSON :: TransferContact -> Value
toJSON TransferContact' {Maybe Text
Text
contactFlowId :: Text
contactId :: Text
instanceId :: Text
userId :: Maybe Text
queueId :: Maybe Text
clientToken :: Maybe Text
$sel:contactFlowId:TransferContact' :: TransferContact -> Text
$sel:contactId:TransferContact' :: TransferContact -> Text
$sel:instanceId:TransferContact' :: TransferContact -> Text
$sel:userId:TransferContact' :: TransferContact -> Maybe Text
$sel:queueId:TransferContact' :: TransferContact -> Maybe Text
$sel:clientToken:TransferContact' :: TransferContact -> Maybe Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"ClientToken" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
clientToken,
(Key
"QueueId" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
queueId,
(Key
"UserId" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
userId,
forall a. a -> Maybe a
Prelude.Just (Key
"InstanceId" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
instanceId),
forall a. a -> Maybe a
Prelude.Just (Key
"ContactId" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
contactId),
forall a. a -> Maybe a
Prelude.Just
(Key
"ContactFlowId" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
contactFlowId)
]
)
instance Data.ToPath TransferContact where
toPath :: TransferContact -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/contact/transfer"
instance Data.ToQuery TransferContact where
toQuery :: TransferContact -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data TransferContactResponse = TransferContactResponse'
{
TransferContactResponse -> Maybe Text
contactArn :: Prelude.Maybe Prelude.Text,
TransferContactResponse -> Maybe Text
contactId :: Prelude.Maybe Prelude.Text,
TransferContactResponse -> Int
httpStatus :: Prelude.Int
}
deriving (TransferContactResponse -> TransferContactResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: TransferContactResponse -> TransferContactResponse -> Bool
$c/= :: TransferContactResponse -> TransferContactResponse -> Bool
== :: TransferContactResponse -> TransferContactResponse -> Bool
$c== :: TransferContactResponse -> TransferContactResponse -> Bool
Prelude.Eq, ReadPrec [TransferContactResponse]
ReadPrec TransferContactResponse
Int -> ReadS TransferContactResponse
ReadS [TransferContactResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [TransferContactResponse]
$creadListPrec :: ReadPrec [TransferContactResponse]
readPrec :: ReadPrec TransferContactResponse
$creadPrec :: ReadPrec TransferContactResponse
readList :: ReadS [TransferContactResponse]
$creadList :: ReadS [TransferContactResponse]
readsPrec :: Int -> ReadS TransferContactResponse
$creadsPrec :: Int -> ReadS TransferContactResponse
Prelude.Read, Int -> TransferContactResponse -> ShowS
[TransferContactResponse] -> ShowS
TransferContactResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [TransferContactResponse] -> ShowS
$cshowList :: [TransferContactResponse] -> ShowS
show :: TransferContactResponse -> String
$cshow :: TransferContactResponse -> String
showsPrec :: Int -> TransferContactResponse -> ShowS
$cshowsPrec :: Int -> TransferContactResponse -> ShowS
Prelude.Show, forall x. Rep TransferContactResponse x -> TransferContactResponse
forall x. TransferContactResponse -> Rep TransferContactResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep TransferContactResponse x -> TransferContactResponse
$cfrom :: forall x. TransferContactResponse -> Rep TransferContactResponse x
Prelude.Generic)
newTransferContactResponse ::
Prelude.Int ->
TransferContactResponse
newTransferContactResponse :: Int -> TransferContactResponse
newTransferContactResponse Int
pHttpStatus_ =
TransferContactResponse'
{ $sel:contactArn:TransferContactResponse' :: Maybe Text
contactArn =
forall a. Maybe a
Prelude.Nothing,
$sel:contactId:TransferContactResponse' :: Maybe Text
contactId = forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:TransferContactResponse' :: Int
httpStatus = Int
pHttpStatus_
}
transferContactResponse_contactArn :: Lens.Lens' TransferContactResponse (Prelude.Maybe Prelude.Text)
transferContactResponse_contactArn :: Lens' TransferContactResponse (Maybe Text)
transferContactResponse_contactArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TransferContactResponse' {Maybe Text
contactArn :: Maybe Text
$sel:contactArn:TransferContactResponse' :: TransferContactResponse -> Maybe Text
contactArn} -> Maybe Text
contactArn) (\s :: TransferContactResponse
s@TransferContactResponse' {} Maybe Text
a -> TransferContactResponse
s {$sel:contactArn:TransferContactResponse' :: Maybe Text
contactArn = Maybe Text
a} :: TransferContactResponse)
transferContactResponse_contactId :: Lens.Lens' TransferContactResponse (Prelude.Maybe Prelude.Text)
transferContactResponse_contactId :: Lens' TransferContactResponse (Maybe Text)
transferContactResponse_contactId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TransferContactResponse' {Maybe Text
contactId :: Maybe Text
$sel:contactId:TransferContactResponse' :: TransferContactResponse -> Maybe Text
contactId} -> Maybe Text
contactId) (\s :: TransferContactResponse
s@TransferContactResponse' {} Maybe Text
a -> TransferContactResponse
s {$sel:contactId:TransferContactResponse' :: Maybe Text
contactId = Maybe Text
a} :: TransferContactResponse)
transferContactResponse_httpStatus :: Lens.Lens' TransferContactResponse Prelude.Int
transferContactResponse_httpStatus :: Lens' TransferContactResponse Int
transferContactResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TransferContactResponse' {Int
httpStatus :: Int
$sel:httpStatus:TransferContactResponse' :: TransferContactResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: TransferContactResponse
s@TransferContactResponse' {} Int
a -> TransferContactResponse
s {$sel:httpStatus:TransferContactResponse' :: Int
httpStatus = Int
a} :: TransferContactResponse)
instance Prelude.NFData TransferContactResponse where
rnf :: TransferContactResponse -> ()
rnf TransferContactResponse' {Int
Maybe Text
httpStatus :: Int
contactId :: Maybe Text
contactArn :: Maybe Text
$sel:httpStatus:TransferContactResponse' :: TransferContactResponse -> Int
$sel:contactId:TransferContactResponse' :: TransferContactResponse -> Maybe Text
$sel:contactArn:TransferContactResponse' :: TransferContactResponse -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
contactArn
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
contactId
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus