{-# 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.AssociatePhoneNumberContactFlow
(
AssociatePhoneNumberContactFlow (..),
newAssociatePhoneNumberContactFlow,
associatePhoneNumberContactFlow_phoneNumberId,
associatePhoneNumberContactFlow_instanceId,
associatePhoneNumberContactFlow_contactFlowId,
AssociatePhoneNumberContactFlowResponse (..),
newAssociatePhoneNumberContactFlowResponse,
)
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 AssociatePhoneNumberContactFlow = AssociatePhoneNumberContactFlow'
{
AssociatePhoneNumberContactFlow -> Text
phoneNumberId :: Prelude.Text,
AssociatePhoneNumberContactFlow -> Text
instanceId :: Prelude.Text,
AssociatePhoneNumberContactFlow -> Text
contactFlowId :: Prelude.Text
}
deriving (AssociatePhoneNumberContactFlow
-> AssociatePhoneNumberContactFlow -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AssociatePhoneNumberContactFlow
-> AssociatePhoneNumberContactFlow -> Bool
$c/= :: AssociatePhoneNumberContactFlow
-> AssociatePhoneNumberContactFlow -> Bool
== :: AssociatePhoneNumberContactFlow
-> AssociatePhoneNumberContactFlow -> Bool
$c== :: AssociatePhoneNumberContactFlow
-> AssociatePhoneNumberContactFlow -> Bool
Prelude.Eq, ReadPrec [AssociatePhoneNumberContactFlow]
ReadPrec AssociatePhoneNumberContactFlow
Int -> ReadS AssociatePhoneNumberContactFlow
ReadS [AssociatePhoneNumberContactFlow]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AssociatePhoneNumberContactFlow]
$creadListPrec :: ReadPrec [AssociatePhoneNumberContactFlow]
readPrec :: ReadPrec AssociatePhoneNumberContactFlow
$creadPrec :: ReadPrec AssociatePhoneNumberContactFlow
readList :: ReadS [AssociatePhoneNumberContactFlow]
$creadList :: ReadS [AssociatePhoneNumberContactFlow]
readsPrec :: Int -> ReadS AssociatePhoneNumberContactFlow
$creadsPrec :: Int -> ReadS AssociatePhoneNumberContactFlow
Prelude.Read, Int -> AssociatePhoneNumberContactFlow -> ShowS
[AssociatePhoneNumberContactFlow] -> ShowS
AssociatePhoneNumberContactFlow -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AssociatePhoneNumberContactFlow] -> ShowS
$cshowList :: [AssociatePhoneNumberContactFlow] -> ShowS
show :: AssociatePhoneNumberContactFlow -> String
$cshow :: AssociatePhoneNumberContactFlow -> String
showsPrec :: Int -> AssociatePhoneNumberContactFlow -> ShowS
$cshowsPrec :: Int -> AssociatePhoneNumberContactFlow -> ShowS
Prelude.Show, forall x.
Rep AssociatePhoneNumberContactFlow x
-> AssociatePhoneNumberContactFlow
forall x.
AssociatePhoneNumberContactFlow
-> Rep AssociatePhoneNumberContactFlow x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep AssociatePhoneNumberContactFlow x
-> AssociatePhoneNumberContactFlow
$cfrom :: forall x.
AssociatePhoneNumberContactFlow
-> Rep AssociatePhoneNumberContactFlow x
Prelude.Generic)
newAssociatePhoneNumberContactFlow ::
Prelude.Text ->
Prelude.Text ->
Prelude.Text ->
AssociatePhoneNumberContactFlow
newAssociatePhoneNumberContactFlow :: Text -> Text -> Text -> AssociatePhoneNumberContactFlow
newAssociatePhoneNumberContactFlow
Text
pPhoneNumberId_
Text
pInstanceId_
Text
pContactFlowId_ =
AssociatePhoneNumberContactFlow'
{ $sel:phoneNumberId:AssociatePhoneNumberContactFlow' :: Text
phoneNumberId =
Text
pPhoneNumberId_,
$sel:instanceId:AssociatePhoneNumberContactFlow' :: Text
instanceId = Text
pInstanceId_,
$sel:contactFlowId:AssociatePhoneNumberContactFlow' :: Text
contactFlowId = Text
pContactFlowId_
}
associatePhoneNumberContactFlow_phoneNumberId :: Lens.Lens' AssociatePhoneNumberContactFlow Prelude.Text
associatePhoneNumberContactFlow_phoneNumberId :: Lens' AssociatePhoneNumberContactFlow Text
associatePhoneNumberContactFlow_phoneNumberId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssociatePhoneNumberContactFlow' {Text
phoneNumberId :: Text
$sel:phoneNumberId:AssociatePhoneNumberContactFlow' :: AssociatePhoneNumberContactFlow -> Text
phoneNumberId} -> Text
phoneNumberId) (\s :: AssociatePhoneNumberContactFlow
s@AssociatePhoneNumberContactFlow' {} Text
a -> AssociatePhoneNumberContactFlow
s {$sel:phoneNumberId:AssociatePhoneNumberContactFlow' :: Text
phoneNumberId = Text
a} :: AssociatePhoneNumberContactFlow)
associatePhoneNumberContactFlow_instanceId :: Lens.Lens' AssociatePhoneNumberContactFlow Prelude.Text
associatePhoneNumberContactFlow_instanceId :: Lens' AssociatePhoneNumberContactFlow Text
associatePhoneNumberContactFlow_instanceId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssociatePhoneNumberContactFlow' {Text
instanceId :: Text
$sel:instanceId:AssociatePhoneNumberContactFlow' :: AssociatePhoneNumberContactFlow -> Text
instanceId} -> Text
instanceId) (\s :: AssociatePhoneNumberContactFlow
s@AssociatePhoneNumberContactFlow' {} Text
a -> AssociatePhoneNumberContactFlow
s {$sel:instanceId:AssociatePhoneNumberContactFlow' :: Text
instanceId = Text
a} :: AssociatePhoneNumberContactFlow)
associatePhoneNumberContactFlow_contactFlowId :: Lens.Lens' AssociatePhoneNumberContactFlow Prelude.Text
associatePhoneNumberContactFlow_contactFlowId :: Lens' AssociatePhoneNumberContactFlow Text
associatePhoneNumberContactFlow_contactFlowId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssociatePhoneNumberContactFlow' {Text
contactFlowId :: Text
$sel:contactFlowId:AssociatePhoneNumberContactFlow' :: AssociatePhoneNumberContactFlow -> Text
contactFlowId} -> Text
contactFlowId) (\s :: AssociatePhoneNumberContactFlow
s@AssociatePhoneNumberContactFlow' {} Text
a -> AssociatePhoneNumberContactFlow
s {$sel:contactFlowId:AssociatePhoneNumberContactFlow' :: Text
contactFlowId = Text
a} :: AssociatePhoneNumberContactFlow)
instance
Core.AWSRequest
AssociatePhoneNumberContactFlow
where
type
AWSResponse AssociatePhoneNumberContactFlow =
AssociatePhoneNumberContactFlowResponse
request :: (Service -> Service)
-> AssociatePhoneNumberContactFlow
-> Request AssociatePhoneNumberContactFlow
request Service -> Service
overrides =
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.putJSON (Service -> Service
overrides Service
defaultService)
response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy AssociatePhoneNumberContactFlow
-> ClientResponse ClientBody
-> m (Either
Error
(ClientResponse (AWSResponse AssociatePhoneNumberContactFlow)))
response =
forall (m :: * -> *) a.
MonadResource m =>
AWSResponse a
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveNull
AssociatePhoneNumberContactFlowResponse
AssociatePhoneNumberContactFlowResponse'
instance
Prelude.Hashable
AssociatePhoneNumberContactFlow
where
hashWithSalt :: Int -> AssociatePhoneNumberContactFlow -> Int
hashWithSalt
Int
_salt
AssociatePhoneNumberContactFlow' {Text
contactFlowId :: Text
instanceId :: Text
phoneNumberId :: Text
$sel:contactFlowId:AssociatePhoneNumberContactFlow' :: AssociatePhoneNumberContactFlow -> Text
$sel:instanceId:AssociatePhoneNumberContactFlow' :: AssociatePhoneNumberContactFlow -> Text
$sel:phoneNumberId:AssociatePhoneNumberContactFlow' :: AssociatePhoneNumberContactFlow -> Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
phoneNumberId
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
instanceId
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
contactFlowId
instance
Prelude.NFData
AssociatePhoneNumberContactFlow
where
rnf :: AssociatePhoneNumberContactFlow -> ()
rnf AssociatePhoneNumberContactFlow' {Text
contactFlowId :: Text
instanceId :: Text
phoneNumberId :: Text
$sel:contactFlowId:AssociatePhoneNumberContactFlow' :: AssociatePhoneNumberContactFlow -> Text
$sel:instanceId:AssociatePhoneNumberContactFlow' :: AssociatePhoneNumberContactFlow -> Text
$sel:phoneNumberId:AssociatePhoneNumberContactFlow' :: AssociatePhoneNumberContactFlow -> Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Text
phoneNumberId
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
contactFlowId
instance
Data.ToHeaders
AssociatePhoneNumberContactFlow
where
toHeaders :: AssociatePhoneNumberContactFlow -> [Header]
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 -> [Header]
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Data.ToJSON AssociatePhoneNumberContactFlow where
toJSON :: AssociatePhoneNumberContactFlow -> Value
toJSON AssociatePhoneNumberContactFlow' {Text
contactFlowId :: Text
instanceId :: Text
phoneNumberId :: Text
$sel:contactFlowId:AssociatePhoneNumberContactFlow' :: AssociatePhoneNumberContactFlow -> Text
$sel:instanceId:AssociatePhoneNumberContactFlow' :: AssociatePhoneNumberContactFlow -> Text
$sel:phoneNumberId:AssociatePhoneNumberContactFlow' :: AssociatePhoneNumberContactFlow -> Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ 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
"ContactFlowId" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
contactFlowId)
]
)
instance Data.ToPath AssociatePhoneNumberContactFlow where
toPath :: AssociatePhoneNumberContactFlow -> ByteString
toPath AssociatePhoneNumberContactFlow' {Text
contactFlowId :: Text
instanceId :: Text
phoneNumberId :: Text
$sel:contactFlowId:AssociatePhoneNumberContactFlow' :: AssociatePhoneNumberContactFlow -> Text
$sel:instanceId:AssociatePhoneNumberContactFlow' :: AssociatePhoneNumberContactFlow -> Text
$sel:phoneNumberId:AssociatePhoneNumberContactFlow' :: AssociatePhoneNumberContactFlow -> Text
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"/phone-number/",
forall a. ToByteString a => a -> ByteString
Data.toBS Text
phoneNumberId,
ByteString
"/contact-flow"
]
instance Data.ToQuery AssociatePhoneNumberContactFlow where
toQuery :: AssociatePhoneNumberContactFlow -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data AssociatePhoneNumberContactFlowResponse = AssociatePhoneNumberContactFlowResponse'
{
}
deriving (AssociatePhoneNumberContactFlowResponse
-> AssociatePhoneNumberContactFlowResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AssociatePhoneNumberContactFlowResponse
-> AssociatePhoneNumberContactFlowResponse -> Bool
$c/= :: AssociatePhoneNumberContactFlowResponse
-> AssociatePhoneNumberContactFlowResponse -> Bool
== :: AssociatePhoneNumberContactFlowResponse
-> AssociatePhoneNumberContactFlowResponse -> Bool
$c== :: AssociatePhoneNumberContactFlowResponse
-> AssociatePhoneNumberContactFlowResponse -> Bool
Prelude.Eq, ReadPrec [AssociatePhoneNumberContactFlowResponse]
ReadPrec AssociatePhoneNumberContactFlowResponse
Int -> ReadS AssociatePhoneNumberContactFlowResponse
ReadS [AssociatePhoneNumberContactFlowResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AssociatePhoneNumberContactFlowResponse]
$creadListPrec :: ReadPrec [AssociatePhoneNumberContactFlowResponse]
readPrec :: ReadPrec AssociatePhoneNumberContactFlowResponse
$creadPrec :: ReadPrec AssociatePhoneNumberContactFlowResponse
readList :: ReadS [AssociatePhoneNumberContactFlowResponse]
$creadList :: ReadS [AssociatePhoneNumberContactFlowResponse]
readsPrec :: Int -> ReadS AssociatePhoneNumberContactFlowResponse
$creadsPrec :: Int -> ReadS AssociatePhoneNumberContactFlowResponse
Prelude.Read, Int -> AssociatePhoneNumberContactFlowResponse -> ShowS
[AssociatePhoneNumberContactFlowResponse] -> ShowS
AssociatePhoneNumberContactFlowResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AssociatePhoneNumberContactFlowResponse] -> ShowS
$cshowList :: [AssociatePhoneNumberContactFlowResponse] -> ShowS
show :: AssociatePhoneNumberContactFlowResponse -> String
$cshow :: AssociatePhoneNumberContactFlowResponse -> String
showsPrec :: Int -> AssociatePhoneNumberContactFlowResponse -> ShowS
$cshowsPrec :: Int -> AssociatePhoneNumberContactFlowResponse -> ShowS
Prelude.Show, forall x.
Rep AssociatePhoneNumberContactFlowResponse x
-> AssociatePhoneNumberContactFlowResponse
forall x.
AssociatePhoneNumberContactFlowResponse
-> Rep AssociatePhoneNumberContactFlowResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep AssociatePhoneNumberContactFlowResponse x
-> AssociatePhoneNumberContactFlowResponse
$cfrom :: forall x.
AssociatePhoneNumberContactFlowResponse
-> Rep AssociatePhoneNumberContactFlowResponse x
Prelude.Generic)
newAssociatePhoneNumberContactFlowResponse ::
AssociatePhoneNumberContactFlowResponse
newAssociatePhoneNumberContactFlowResponse :: AssociatePhoneNumberContactFlowResponse
newAssociatePhoneNumberContactFlowResponse =
AssociatePhoneNumberContactFlowResponse
AssociatePhoneNumberContactFlowResponse'
instance
Prelude.NFData
AssociatePhoneNumberContactFlowResponse
where
rnf :: AssociatePhoneNumberContactFlowResponse -> ()
rnf AssociatePhoneNumberContactFlowResponse
_ = ()