{-# 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.StartOutboundVoiceContact
(
StartOutboundVoiceContact (..),
newStartOutboundVoiceContact,
startOutboundVoiceContact_answerMachineDetectionConfig,
startOutboundVoiceContact_clientToken,
startOutboundVoiceContact_trafficType,
startOutboundVoiceContact_campaignId,
startOutboundVoiceContact_queueId,
startOutboundVoiceContact_attributes,
startOutboundVoiceContact_sourcePhoneNumber,
startOutboundVoiceContact_destinationPhoneNumber,
startOutboundVoiceContact_contactFlowId,
startOutboundVoiceContact_instanceId,
StartOutboundVoiceContactResponse (..),
newStartOutboundVoiceContactResponse,
startOutboundVoiceContactResponse_contactId,
startOutboundVoiceContactResponse_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 StartOutboundVoiceContact = StartOutboundVoiceContact'
{
StartOutboundVoiceContact -> Maybe AnswerMachineDetectionConfig
answerMachineDetectionConfig :: Prelude.Maybe AnswerMachineDetectionConfig,
StartOutboundVoiceContact -> Maybe Text
clientToken :: Prelude.Maybe Prelude.Text,
StartOutboundVoiceContact -> Maybe TrafficType
trafficType :: Prelude.Maybe TrafficType,
StartOutboundVoiceContact -> Maybe Text
campaignId :: Prelude.Maybe Prelude.Text,
StartOutboundVoiceContact -> Maybe Text
queueId :: Prelude.Maybe Prelude.Text,
StartOutboundVoiceContact -> Maybe (HashMap Text Text)
attributes :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
StartOutboundVoiceContact -> Maybe Text
sourcePhoneNumber :: Prelude.Maybe Prelude.Text,
StartOutboundVoiceContact -> Text
destinationPhoneNumber :: Prelude.Text,
StartOutboundVoiceContact -> Text
contactFlowId :: Prelude.Text,
StartOutboundVoiceContact -> Text
instanceId :: Prelude.Text
}
deriving (StartOutboundVoiceContact -> StartOutboundVoiceContact -> Bool
(StartOutboundVoiceContact -> StartOutboundVoiceContact -> Bool)
-> (StartOutboundVoiceContact -> StartOutboundVoiceContact -> Bool)
-> Eq StartOutboundVoiceContact
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: StartOutboundVoiceContact -> StartOutboundVoiceContact -> Bool
$c/= :: StartOutboundVoiceContact -> StartOutboundVoiceContact -> Bool
== :: StartOutboundVoiceContact -> StartOutboundVoiceContact -> Bool
$c== :: StartOutboundVoiceContact -> StartOutboundVoiceContact -> Bool
Prelude.Eq, ReadPrec [StartOutboundVoiceContact]
ReadPrec StartOutboundVoiceContact
Int -> ReadS StartOutboundVoiceContact
ReadS [StartOutboundVoiceContact]
(Int -> ReadS StartOutboundVoiceContact)
-> ReadS [StartOutboundVoiceContact]
-> ReadPrec StartOutboundVoiceContact
-> ReadPrec [StartOutboundVoiceContact]
-> Read StartOutboundVoiceContact
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [StartOutboundVoiceContact]
$creadListPrec :: ReadPrec [StartOutboundVoiceContact]
readPrec :: ReadPrec StartOutboundVoiceContact
$creadPrec :: ReadPrec StartOutboundVoiceContact
readList :: ReadS [StartOutboundVoiceContact]
$creadList :: ReadS [StartOutboundVoiceContact]
readsPrec :: Int -> ReadS StartOutboundVoiceContact
$creadsPrec :: Int -> ReadS StartOutboundVoiceContact
Prelude.Read, Int -> StartOutboundVoiceContact -> ShowS
[StartOutboundVoiceContact] -> ShowS
StartOutboundVoiceContact -> String
(Int -> StartOutboundVoiceContact -> ShowS)
-> (StartOutboundVoiceContact -> String)
-> ([StartOutboundVoiceContact] -> ShowS)
-> Show StartOutboundVoiceContact
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [StartOutboundVoiceContact] -> ShowS
$cshowList :: [StartOutboundVoiceContact] -> ShowS
show :: StartOutboundVoiceContact -> String
$cshow :: StartOutboundVoiceContact -> String
showsPrec :: Int -> StartOutboundVoiceContact -> ShowS
$cshowsPrec :: Int -> StartOutboundVoiceContact -> ShowS
Prelude.Show, (forall x.
StartOutboundVoiceContact -> Rep StartOutboundVoiceContact x)
-> (forall x.
Rep StartOutboundVoiceContact x -> StartOutboundVoiceContact)
-> Generic StartOutboundVoiceContact
forall x.
Rep StartOutboundVoiceContact x -> StartOutboundVoiceContact
forall x.
StartOutboundVoiceContact -> Rep StartOutboundVoiceContact x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep StartOutboundVoiceContact x -> StartOutboundVoiceContact
$cfrom :: forall x.
StartOutboundVoiceContact -> Rep StartOutboundVoiceContact x
Prelude.Generic)
newStartOutboundVoiceContact ::
Prelude.Text ->
Prelude.Text ->
Prelude.Text ->
StartOutboundVoiceContact
newStartOutboundVoiceContact :: Text -> Text -> Text -> StartOutboundVoiceContact
newStartOutboundVoiceContact
Text
pDestinationPhoneNumber_
Text
pContactFlowId_
Text
pInstanceId_ =
StartOutboundVoiceContact' :: Maybe AnswerMachineDetectionConfig
-> Maybe Text
-> Maybe TrafficType
-> Maybe Text
-> Maybe Text
-> Maybe (HashMap Text Text)
-> Maybe Text
-> Text
-> Text
-> Text
-> StartOutboundVoiceContact
StartOutboundVoiceContact'
{ $sel:answerMachineDetectionConfig:StartOutboundVoiceContact' :: Maybe AnswerMachineDetectionConfig
answerMachineDetectionConfig =
Maybe AnswerMachineDetectionConfig
forall a. Maybe a
Prelude.Nothing,
$sel:clientToken:StartOutboundVoiceContact' :: Maybe Text
clientToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:trafficType:StartOutboundVoiceContact' :: Maybe TrafficType
trafficType = Maybe TrafficType
forall a. Maybe a
Prelude.Nothing,
$sel:campaignId:StartOutboundVoiceContact' :: Maybe Text
campaignId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:queueId:StartOutboundVoiceContact' :: Maybe Text
queueId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:attributes:StartOutboundVoiceContact' :: Maybe (HashMap Text Text)
attributes = Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing,
$sel:sourcePhoneNumber:StartOutboundVoiceContact' :: Maybe Text
sourcePhoneNumber = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:destinationPhoneNumber:StartOutboundVoiceContact' :: Text
destinationPhoneNumber =
Text
pDestinationPhoneNumber_,
$sel:contactFlowId:StartOutboundVoiceContact' :: Text
contactFlowId = Text
pContactFlowId_,
$sel:instanceId:StartOutboundVoiceContact' :: Text
instanceId = Text
pInstanceId_
}
startOutboundVoiceContact_answerMachineDetectionConfig :: Lens.Lens' StartOutboundVoiceContact (Prelude.Maybe AnswerMachineDetectionConfig)
startOutboundVoiceContact_answerMachineDetectionConfig :: (Maybe AnswerMachineDetectionConfig
-> f (Maybe AnswerMachineDetectionConfig))
-> StartOutboundVoiceContact -> f StartOutboundVoiceContact
startOutboundVoiceContact_answerMachineDetectionConfig = (StartOutboundVoiceContact -> Maybe AnswerMachineDetectionConfig)
-> (StartOutboundVoiceContact
-> Maybe AnswerMachineDetectionConfig -> StartOutboundVoiceContact)
-> Lens
StartOutboundVoiceContact
StartOutboundVoiceContact
(Maybe AnswerMachineDetectionConfig)
(Maybe AnswerMachineDetectionConfig)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartOutboundVoiceContact' {Maybe AnswerMachineDetectionConfig
answerMachineDetectionConfig :: Maybe AnswerMachineDetectionConfig
$sel:answerMachineDetectionConfig:StartOutboundVoiceContact' :: StartOutboundVoiceContact -> Maybe AnswerMachineDetectionConfig
answerMachineDetectionConfig} -> Maybe AnswerMachineDetectionConfig
answerMachineDetectionConfig) (\s :: StartOutboundVoiceContact
s@StartOutboundVoiceContact' {} Maybe AnswerMachineDetectionConfig
a -> StartOutboundVoiceContact
s {$sel:answerMachineDetectionConfig:StartOutboundVoiceContact' :: Maybe AnswerMachineDetectionConfig
answerMachineDetectionConfig = Maybe AnswerMachineDetectionConfig
a} :: StartOutboundVoiceContact)
startOutboundVoiceContact_clientToken :: Lens.Lens' StartOutboundVoiceContact (Prelude.Maybe Prelude.Text)
startOutboundVoiceContact_clientToken :: (Maybe Text -> f (Maybe Text))
-> StartOutboundVoiceContact -> f StartOutboundVoiceContact
startOutboundVoiceContact_clientToken = (StartOutboundVoiceContact -> Maybe Text)
-> (StartOutboundVoiceContact
-> Maybe Text -> StartOutboundVoiceContact)
-> Lens
StartOutboundVoiceContact
StartOutboundVoiceContact
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartOutboundVoiceContact' {Maybe Text
clientToken :: Maybe Text
$sel:clientToken:StartOutboundVoiceContact' :: StartOutboundVoiceContact -> Maybe Text
clientToken} -> Maybe Text
clientToken) (\s :: StartOutboundVoiceContact
s@StartOutboundVoiceContact' {} Maybe Text
a -> StartOutboundVoiceContact
s {$sel:clientToken:StartOutboundVoiceContact' :: Maybe Text
clientToken = Maybe Text
a} :: StartOutboundVoiceContact)
startOutboundVoiceContact_trafficType :: Lens.Lens' StartOutboundVoiceContact (Prelude.Maybe TrafficType)
startOutboundVoiceContact_trafficType :: (Maybe TrafficType -> f (Maybe TrafficType))
-> StartOutboundVoiceContact -> f StartOutboundVoiceContact
startOutboundVoiceContact_trafficType = (StartOutboundVoiceContact -> Maybe TrafficType)
-> (StartOutboundVoiceContact
-> Maybe TrafficType -> StartOutboundVoiceContact)
-> Lens
StartOutboundVoiceContact
StartOutboundVoiceContact
(Maybe TrafficType)
(Maybe TrafficType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartOutboundVoiceContact' {Maybe TrafficType
trafficType :: Maybe TrafficType
$sel:trafficType:StartOutboundVoiceContact' :: StartOutboundVoiceContact -> Maybe TrafficType
trafficType} -> Maybe TrafficType
trafficType) (\s :: StartOutboundVoiceContact
s@StartOutboundVoiceContact' {} Maybe TrafficType
a -> StartOutboundVoiceContact
s {$sel:trafficType:StartOutboundVoiceContact' :: Maybe TrafficType
trafficType = Maybe TrafficType
a} :: StartOutboundVoiceContact)
startOutboundVoiceContact_campaignId :: Lens.Lens' StartOutboundVoiceContact (Prelude.Maybe Prelude.Text)
startOutboundVoiceContact_campaignId :: (Maybe Text -> f (Maybe Text))
-> StartOutboundVoiceContact -> f StartOutboundVoiceContact
startOutboundVoiceContact_campaignId = (StartOutboundVoiceContact -> Maybe Text)
-> (StartOutboundVoiceContact
-> Maybe Text -> StartOutboundVoiceContact)
-> Lens
StartOutboundVoiceContact
StartOutboundVoiceContact
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartOutboundVoiceContact' {Maybe Text
campaignId :: Maybe Text
$sel:campaignId:StartOutboundVoiceContact' :: StartOutboundVoiceContact -> Maybe Text
campaignId} -> Maybe Text
campaignId) (\s :: StartOutboundVoiceContact
s@StartOutboundVoiceContact' {} Maybe Text
a -> StartOutboundVoiceContact
s {$sel:campaignId:StartOutboundVoiceContact' :: Maybe Text
campaignId = Maybe Text
a} :: StartOutboundVoiceContact)
startOutboundVoiceContact_queueId :: Lens.Lens' StartOutboundVoiceContact (Prelude.Maybe Prelude.Text)
startOutboundVoiceContact_queueId :: (Maybe Text -> f (Maybe Text))
-> StartOutboundVoiceContact -> f StartOutboundVoiceContact
startOutboundVoiceContact_queueId = (StartOutboundVoiceContact -> Maybe Text)
-> (StartOutboundVoiceContact
-> Maybe Text -> StartOutboundVoiceContact)
-> Lens
StartOutboundVoiceContact
StartOutboundVoiceContact
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartOutboundVoiceContact' {Maybe Text
queueId :: Maybe Text
$sel:queueId:StartOutboundVoiceContact' :: StartOutboundVoiceContact -> Maybe Text
queueId} -> Maybe Text
queueId) (\s :: StartOutboundVoiceContact
s@StartOutboundVoiceContact' {} Maybe Text
a -> StartOutboundVoiceContact
s {$sel:queueId:StartOutboundVoiceContact' :: Maybe Text
queueId = Maybe Text
a} :: StartOutboundVoiceContact)
startOutboundVoiceContact_attributes :: Lens.Lens' StartOutboundVoiceContact (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
startOutboundVoiceContact_attributes :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> StartOutboundVoiceContact -> f StartOutboundVoiceContact
startOutboundVoiceContact_attributes = (StartOutboundVoiceContact -> Maybe (HashMap Text Text))
-> (StartOutboundVoiceContact
-> Maybe (HashMap Text Text) -> StartOutboundVoiceContact)
-> Lens
StartOutboundVoiceContact
StartOutboundVoiceContact
(Maybe (HashMap Text Text))
(Maybe (HashMap Text Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartOutboundVoiceContact' {Maybe (HashMap Text Text)
attributes :: Maybe (HashMap Text Text)
$sel:attributes:StartOutboundVoiceContact' :: StartOutboundVoiceContact -> Maybe (HashMap Text Text)
attributes} -> Maybe (HashMap Text Text)
attributes) (\s :: StartOutboundVoiceContact
s@StartOutboundVoiceContact' {} Maybe (HashMap Text Text)
a -> StartOutboundVoiceContact
s {$sel:attributes:StartOutboundVoiceContact' :: Maybe (HashMap Text Text)
attributes = Maybe (HashMap Text Text)
a} :: StartOutboundVoiceContact) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> StartOutboundVoiceContact -> f StartOutboundVoiceContact)
-> ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> StartOutboundVoiceContact
-> f StartOutboundVoiceContact
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
(HashMap Text Text)
(HashMap Text Text)
(HashMap Text Text)
(HashMap Text Text)
-> Iso
(Maybe (HashMap Text Text))
(Maybe (HashMap Text Text))
(Maybe (HashMap Text Text))
(Maybe (HashMap Text Text))
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso
(HashMap Text Text)
(HashMap Text Text)
(HashMap Text Text)
(HashMap Text Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
startOutboundVoiceContact_sourcePhoneNumber :: Lens.Lens' StartOutboundVoiceContact (Prelude.Maybe Prelude.Text)
startOutboundVoiceContact_sourcePhoneNumber :: (Maybe Text -> f (Maybe Text))
-> StartOutboundVoiceContact -> f StartOutboundVoiceContact
startOutboundVoiceContact_sourcePhoneNumber = (StartOutboundVoiceContact -> Maybe Text)
-> (StartOutboundVoiceContact
-> Maybe Text -> StartOutboundVoiceContact)
-> Lens
StartOutboundVoiceContact
StartOutboundVoiceContact
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartOutboundVoiceContact' {Maybe Text
sourcePhoneNumber :: Maybe Text
$sel:sourcePhoneNumber:StartOutboundVoiceContact' :: StartOutboundVoiceContact -> Maybe Text
sourcePhoneNumber} -> Maybe Text
sourcePhoneNumber) (\s :: StartOutboundVoiceContact
s@StartOutboundVoiceContact' {} Maybe Text
a -> StartOutboundVoiceContact
s {$sel:sourcePhoneNumber:StartOutboundVoiceContact' :: Maybe Text
sourcePhoneNumber = Maybe Text
a} :: StartOutboundVoiceContact)
startOutboundVoiceContact_destinationPhoneNumber :: Lens.Lens' StartOutboundVoiceContact Prelude.Text
startOutboundVoiceContact_destinationPhoneNumber :: (Text -> f Text)
-> StartOutboundVoiceContact -> f StartOutboundVoiceContact
startOutboundVoiceContact_destinationPhoneNumber = (StartOutboundVoiceContact -> Text)
-> (StartOutboundVoiceContact -> Text -> StartOutboundVoiceContact)
-> Lens
StartOutboundVoiceContact StartOutboundVoiceContact Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartOutboundVoiceContact' {Text
destinationPhoneNumber :: Text
$sel:destinationPhoneNumber:StartOutboundVoiceContact' :: StartOutboundVoiceContact -> Text
destinationPhoneNumber} -> Text
destinationPhoneNumber) (\s :: StartOutboundVoiceContact
s@StartOutboundVoiceContact' {} Text
a -> StartOutboundVoiceContact
s {$sel:destinationPhoneNumber:StartOutboundVoiceContact' :: Text
destinationPhoneNumber = Text
a} :: StartOutboundVoiceContact)
startOutboundVoiceContact_contactFlowId :: Lens.Lens' StartOutboundVoiceContact Prelude.Text
startOutboundVoiceContact_contactFlowId :: (Text -> f Text)
-> StartOutboundVoiceContact -> f StartOutboundVoiceContact
startOutboundVoiceContact_contactFlowId = (StartOutboundVoiceContact -> Text)
-> (StartOutboundVoiceContact -> Text -> StartOutboundVoiceContact)
-> Lens
StartOutboundVoiceContact StartOutboundVoiceContact Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartOutboundVoiceContact' {Text
contactFlowId :: Text
$sel:contactFlowId:StartOutboundVoiceContact' :: StartOutboundVoiceContact -> Text
contactFlowId} -> Text
contactFlowId) (\s :: StartOutboundVoiceContact
s@StartOutboundVoiceContact' {} Text
a -> StartOutboundVoiceContact
s {$sel:contactFlowId:StartOutboundVoiceContact' :: Text
contactFlowId = Text
a} :: StartOutboundVoiceContact)
startOutboundVoiceContact_instanceId :: Lens.Lens' StartOutboundVoiceContact Prelude.Text
startOutboundVoiceContact_instanceId :: (Text -> f Text)
-> StartOutboundVoiceContact -> f StartOutboundVoiceContact
startOutboundVoiceContact_instanceId = (StartOutboundVoiceContact -> Text)
-> (StartOutboundVoiceContact -> Text -> StartOutboundVoiceContact)
-> Lens
StartOutboundVoiceContact StartOutboundVoiceContact Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartOutboundVoiceContact' {Text
instanceId :: Text
$sel:instanceId:StartOutboundVoiceContact' :: StartOutboundVoiceContact -> Text
instanceId} -> Text
instanceId) (\s :: StartOutboundVoiceContact
s@StartOutboundVoiceContact' {} Text
a -> StartOutboundVoiceContact
s {$sel:instanceId:StartOutboundVoiceContact' :: Text
instanceId = Text
a} :: StartOutboundVoiceContact)
instance Core.AWSRequest StartOutboundVoiceContact where
type
AWSResponse StartOutboundVoiceContact =
StartOutboundVoiceContactResponse
request :: StartOutboundVoiceContact -> Request StartOutboundVoiceContact
request = Service
-> StartOutboundVoiceContact -> Request StartOutboundVoiceContact
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.putJSON Service
defaultService
response :: Logger
-> Service
-> Proxy StartOutboundVoiceContact
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse StartOutboundVoiceContact)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse StartOutboundVoiceContact))
-> Logger
-> Service
-> Proxy StartOutboundVoiceContact
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse StartOutboundVoiceContact)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
( \Int
s ResponseHeaders
h Object
x ->
Maybe Text -> Int -> StartOutboundVoiceContactResponse
StartOutboundVoiceContactResponse'
(Maybe Text -> Int -> StartOutboundVoiceContactResponse)
-> Either String (Maybe Text)
-> Either String (Int -> StartOutboundVoiceContactResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"ContactId")
Either String (Int -> StartOutboundVoiceContactResponse)
-> Either String Int
-> Either String StartOutboundVoiceContactResponse
forall (f :: * -> *) a b. Applicative f => 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 StartOutboundVoiceContact
instance Prelude.NFData StartOutboundVoiceContact
instance Core.ToHeaders StartOutboundVoiceContact where
toHeaders :: StartOutboundVoiceContact -> ResponseHeaders
toHeaders =
ResponseHeaders -> StartOutboundVoiceContact -> 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 StartOutboundVoiceContact where
toJSON :: StartOutboundVoiceContact -> Value
toJSON StartOutboundVoiceContact' {Maybe Text
Maybe (HashMap Text Text)
Maybe AnswerMachineDetectionConfig
Maybe TrafficType
Text
instanceId :: Text
contactFlowId :: Text
destinationPhoneNumber :: Text
sourcePhoneNumber :: Maybe Text
attributes :: Maybe (HashMap Text Text)
queueId :: Maybe Text
campaignId :: Maybe Text
trafficType :: Maybe TrafficType
clientToken :: Maybe Text
answerMachineDetectionConfig :: Maybe AnswerMachineDetectionConfig
$sel:instanceId:StartOutboundVoiceContact' :: StartOutboundVoiceContact -> Text
$sel:contactFlowId:StartOutboundVoiceContact' :: StartOutboundVoiceContact -> Text
$sel:destinationPhoneNumber:StartOutboundVoiceContact' :: StartOutboundVoiceContact -> Text
$sel:sourcePhoneNumber:StartOutboundVoiceContact' :: StartOutboundVoiceContact -> Maybe Text
$sel:attributes:StartOutboundVoiceContact' :: StartOutboundVoiceContact -> Maybe (HashMap Text Text)
$sel:queueId:StartOutboundVoiceContact' :: StartOutboundVoiceContact -> Maybe Text
$sel:campaignId:StartOutboundVoiceContact' :: StartOutboundVoiceContact -> Maybe Text
$sel:trafficType:StartOutboundVoiceContact' :: StartOutboundVoiceContact -> Maybe TrafficType
$sel:clientToken:StartOutboundVoiceContact' :: StartOutboundVoiceContact -> Maybe Text
$sel:answerMachineDetectionConfig:StartOutboundVoiceContact' :: StartOutboundVoiceContact -> Maybe AnswerMachineDetectionConfig
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"AnswerMachineDetectionConfig" Text -> AnswerMachineDetectionConfig -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(AnswerMachineDetectionConfig -> Pair)
-> Maybe AnswerMachineDetectionConfig -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe AnswerMachineDetectionConfig
answerMachineDetectionConfig,
(Text
"ClientToken" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
clientToken,
(Text
"TrafficType" Text -> TrafficType -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (TrafficType -> Pair) -> Maybe TrafficType -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe TrafficType
trafficType,
(Text
"CampaignId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
campaignId,
(Text
"QueueId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
queueId,
(Text
"Attributes" Text -> HashMap Text Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (HashMap Text Text -> Pair)
-> Maybe (HashMap Text Text) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (HashMap Text Text)
attributes,
(Text
"SourcePhoneNumber" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
sourcePhoneNumber,
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
( Text
"DestinationPhoneNumber"
Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
destinationPhoneNumber
),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"ContactFlowId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
contactFlowId),
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)
]
)
instance Core.ToPath StartOutboundVoiceContact where
toPath :: StartOutboundVoiceContact -> ByteString
toPath = ByteString -> StartOutboundVoiceContact -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/contact/outbound-voice"
instance Core.ToQuery StartOutboundVoiceContact where
toQuery :: StartOutboundVoiceContact -> QueryString
toQuery = QueryString -> StartOutboundVoiceContact -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data StartOutboundVoiceContactResponse = StartOutboundVoiceContactResponse'
{
StartOutboundVoiceContactResponse -> Maybe Text
contactId :: Prelude.Maybe Prelude.Text,
StartOutboundVoiceContactResponse -> Int
httpStatus :: Prelude.Int
}
deriving (StartOutboundVoiceContactResponse
-> StartOutboundVoiceContactResponse -> Bool
(StartOutboundVoiceContactResponse
-> StartOutboundVoiceContactResponse -> Bool)
-> (StartOutboundVoiceContactResponse
-> StartOutboundVoiceContactResponse -> Bool)
-> Eq StartOutboundVoiceContactResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: StartOutboundVoiceContactResponse
-> StartOutboundVoiceContactResponse -> Bool
$c/= :: StartOutboundVoiceContactResponse
-> StartOutboundVoiceContactResponse -> Bool
== :: StartOutboundVoiceContactResponse
-> StartOutboundVoiceContactResponse -> Bool
$c== :: StartOutboundVoiceContactResponse
-> StartOutboundVoiceContactResponse -> Bool
Prelude.Eq, ReadPrec [StartOutboundVoiceContactResponse]
ReadPrec StartOutboundVoiceContactResponse
Int -> ReadS StartOutboundVoiceContactResponse
ReadS [StartOutboundVoiceContactResponse]
(Int -> ReadS StartOutboundVoiceContactResponse)
-> ReadS [StartOutboundVoiceContactResponse]
-> ReadPrec StartOutboundVoiceContactResponse
-> ReadPrec [StartOutboundVoiceContactResponse]
-> Read StartOutboundVoiceContactResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [StartOutboundVoiceContactResponse]
$creadListPrec :: ReadPrec [StartOutboundVoiceContactResponse]
readPrec :: ReadPrec StartOutboundVoiceContactResponse
$creadPrec :: ReadPrec StartOutboundVoiceContactResponse
readList :: ReadS [StartOutboundVoiceContactResponse]
$creadList :: ReadS [StartOutboundVoiceContactResponse]
readsPrec :: Int -> ReadS StartOutboundVoiceContactResponse
$creadsPrec :: Int -> ReadS StartOutboundVoiceContactResponse
Prelude.Read, Int -> StartOutboundVoiceContactResponse -> ShowS
[StartOutboundVoiceContactResponse] -> ShowS
StartOutboundVoiceContactResponse -> String
(Int -> StartOutboundVoiceContactResponse -> ShowS)
-> (StartOutboundVoiceContactResponse -> String)
-> ([StartOutboundVoiceContactResponse] -> ShowS)
-> Show StartOutboundVoiceContactResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [StartOutboundVoiceContactResponse] -> ShowS
$cshowList :: [StartOutboundVoiceContactResponse] -> ShowS
show :: StartOutboundVoiceContactResponse -> String
$cshow :: StartOutboundVoiceContactResponse -> String
showsPrec :: Int -> StartOutboundVoiceContactResponse -> ShowS
$cshowsPrec :: Int -> StartOutboundVoiceContactResponse -> ShowS
Prelude.Show, (forall x.
StartOutboundVoiceContactResponse
-> Rep StartOutboundVoiceContactResponse x)
-> (forall x.
Rep StartOutboundVoiceContactResponse x
-> StartOutboundVoiceContactResponse)
-> Generic StartOutboundVoiceContactResponse
forall x.
Rep StartOutboundVoiceContactResponse x
-> StartOutboundVoiceContactResponse
forall x.
StartOutboundVoiceContactResponse
-> Rep StartOutboundVoiceContactResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep StartOutboundVoiceContactResponse x
-> StartOutboundVoiceContactResponse
$cfrom :: forall x.
StartOutboundVoiceContactResponse
-> Rep StartOutboundVoiceContactResponse x
Prelude.Generic)
newStartOutboundVoiceContactResponse ::
Prelude.Int ->
StartOutboundVoiceContactResponse
newStartOutboundVoiceContactResponse :: Int -> StartOutboundVoiceContactResponse
newStartOutboundVoiceContactResponse Int
pHttpStatus_ =
StartOutboundVoiceContactResponse' :: Maybe Text -> Int -> StartOutboundVoiceContactResponse
StartOutboundVoiceContactResponse'
{ $sel:contactId:StartOutboundVoiceContactResponse' :: Maybe Text
contactId =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:StartOutboundVoiceContactResponse' :: Int
httpStatus = Int
pHttpStatus_
}
startOutboundVoiceContactResponse_contactId :: Lens.Lens' StartOutboundVoiceContactResponse (Prelude.Maybe Prelude.Text)
startOutboundVoiceContactResponse_contactId :: (Maybe Text -> f (Maybe Text))
-> StartOutboundVoiceContactResponse
-> f StartOutboundVoiceContactResponse
startOutboundVoiceContactResponse_contactId = (StartOutboundVoiceContactResponse -> Maybe Text)
-> (StartOutboundVoiceContactResponse
-> Maybe Text -> StartOutboundVoiceContactResponse)
-> Lens
StartOutboundVoiceContactResponse
StartOutboundVoiceContactResponse
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartOutboundVoiceContactResponse' {Maybe Text
contactId :: Maybe Text
$sel:contactId:StartOutboundVoiceContactResponse' :: StartOutboundVoiceContactResponse -> Maybe Text
contactId} -> Maybe Text
contactId) (\s :: StartOutboundVoiceContactResponse
s@StartOutboundVoiceContactResponse' {} Maybe Text
a -> StartOutboundVoiceContactResponse
s {$sel:contactId:StartOutboundVoiceContactResponse' :: Maybe Text
contactId = Maybe Text
a} :: StartOutboundVoiceContactResponse)
startOutboundVoiceContactResponse_httpStatus :: Lens.Lens' StartOutboundVoiceContactResponse Prelude.Int
startOutboundVoiceContactResponse_httpStatus :: (Int -> f Int)
-> StartOutboundVoiceContactResponse
-> f StartOutboundVoiceContactResponse
startOutboundVoiceContactResponse_httpStatus = (StartOutboundVoiceContactResponse -> Int)
-> (StartOutboundVoiceContactResponse
-> Int -> StartOutboundVoiceContactResponse)
-> Lens
StartOutboundVoiceContactResponse
StartOutboundVoiceContactResponse
Int
Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartOutboundVoiceContactResponse' {Int
httpStatus :: Int
$sel:httpStatus:StartOutboundVoiceContactResponse' :: StartOutboundVoiceContactResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: StartOutboundVoiceContactResponse
s@StartOutboundVoiceContactResponse' {} Int
a -> StartOutboundVoiceContactResponse
s {$sel:httpStatus:StartOutboundVoiceContactResponse' :: Int
httpStatus = Int
a} :: StartOutboundVoiceContactResponse)
instance
Prelude.NFData
StartOutboundVoiceContactResponse