{-# 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.UpdateContactAttributes
(
UpdateContactAttributes (..),
newUpdateContactAttributes,
updateContactAttributes_initialContactId,
updateContactAttributes_instanceId,
updateContactAttributes_attributes,
UpdateContactAttributesResponse (..),
newUpdateContactAttributesResponse,
updateContactAttributesResponse_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 UpdateContactAttributes = UpdateContactAttributes'
{
UpdateContactAttributes -> Text
initialContactId :: Prelude.Text,
UpdateContactAttributes -> Text
instanceId :: Prelude.Text,
UpdateContactAttributes -> HashMap Text Text
attributes :: Prelude.HashMap Prelude.Text Prelude.Text
}
deriving (UpdateContactAttributes -> UpdateContactAttributes -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateContactAttributes -> UpdateContactAttributes -> Bool
$c/= :: UpdateContactAttributes -> UpdateContactAttributes -> Bool
== :: UpdateContactAttributes -> UpdateContactAttributes -> Bool
$c== :: UpdateContactAttributes -> UpdateContactAttributes -> Bool
Prelude.Eq, ReadPrec [UpdateContactAttributes]
ReadPrec UpdateContactAttributes
Int -> ReadS UpdateContactAttributes
ReadS [UpdateContactAttributes]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateContactAttributes]
$creadListPrec :: ReadPrec [UpdateContactAttributes]
readPrec :: ReadPrec UpdateContactAttributes
$creadPrec :: ReadPrec UpdateContactAttributes
readList :: ReadS [UpdateContactAttributes]
$creadList :: ReadS [UpdateContactAttributes]
readsPrec :: Int -> ReadS UpdateContactAttributes
$creadsPrec :: Int -> ReadS UpdateContactAttributes
Prelude.Read, Int -> UpdateContactAttributes -> ShowS
[UpdateContactAttributes] -> ShowS
UpdateContactAttributes -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateContactAttributes] -> ShowS
$cshowList :: [UpdateContactAttributes] -> ShowS
show :: UpdateContactAttributes -> String
$cshow :: UpdateContactAttributes -> String
showsPrec :: Int -> UpdateContactAttributes -> ShowS
$cshowsPrec :: Int -> UpdateContactAttributes -> ShowS
Prelude.Show, forall x. Rep UpdateContactAttributes x -> UpdateContactAttributes
forall x. UpdateContactAttributes -> Rep UpdateContactAttributes x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdateContactAttributes x -> UpdateContactAttributes
$cfrom :: forall x. UpdateContactAttributes -> Rep UpdateContactAttributes x
Prelude.Generic)
newUpdateContactAttributes ::
Prelude.Text ->
Prelude.Text ->
UpdateContactAttributes
newUpdateContactAttributes :: Text -> Text -> UpdateContactAttributes
newUpdateContactAttributes
Text
pInitialContactId_
Text
pInstanceId_ =
UpdateContactAttributes'
{ $sel:initialContactId:UpdateContactAttributes' :: Text
initialContactId =
Text
pInitialContactId_,
$sel:instanceId:UpdateContactAttributes' :: Text
instanceId = Text
pInstanceId_,
$sel:attributes:UpdateContactAttributes' :: HashMap Text Text
attributes = forall a. Monoid a => a
Prelude.mempty
}
updateContactAttributes_initialContactId :: Lens.Lens' UpdateContactAttributes Prelude.Text
updateContactAttributes_initialContactId :: Lens' UpdateContactAttributes Text
updateContactAttributes_initialContactId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateContactAttributes' {Text
initialContactId :: Text
$sel:initialContactId:UpdateContactAttributes' :: UpdateContactAttributes -> Text
initialContactId} -> Text
initialContactId) (\s :: UpdateContactAttributes
s@UpdateContactAttributes' {} Text
a -> UpdateContactAttributes
s {$sel:initialContactId:UpdateContactAttributes' :: Text
initialContactId = Text
a} :: UpdateContactAttributes)
updateContactAttributes_instanceId :: Lens.Lens' UpdateContactAttributes Prelude.Text
updateContactAttributes_instanceId :: Lens' UpdateContactAttributes Text
updateContactAttributes_instanceId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateContactAttributes' {Text
instanceId :: Text
$sel:instanceId:UpdateContactAttributes' :: UpdateContactAttributes -> Text
instanceId} -> Text
instanceId) (\s :: UpdateContactAttributes
s@UpdateContactAttributes' {} Text
a -> UpdateContactAttributes
s {$sel:instanceId:UpdateContactAttributes' :: Text
instanceId = Text
a} :: UpdateContactAttributes)
updateContactAttributes_attributes :: Lens.Lens' UpdateContactAttributes (Prelude.HashMap Prelude.Text Prelude.Text)
updateContactAttributes_attributes :: Lens' UpdateContactAttributes (HashMap Text Text)
updateContactAttributes_attributes = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateContactAttributes' {HashMap Text Text
attributes :: HashMap Text Text
$sel:attributes:UpdateContactAttributes' :: UpdateContactAttributes -> HashMap Text Text
attributes} -> HashMap Text Text
attributes) (\s :: UpdateContactAttributes
s@UpdateContactAttributes' {} HashMap Text Text
a -> UpdateContactAttributes
s {$sel:attributes:UpdateContactAttributes' :: HashMap Text Text
attributes = HashMap Text Text
a} :: UpdateContactAttributes) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
instance Core.AWSRequest UpdateContactAttributes where
type
AWSResponse UpdateContactAttributes =
UpdateContactAttributesResponse
request :: (Service -> Service)
-> UpdateContactAttributes -> Request UpdateContactAttributes
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 UpdateContactAttributes
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse UpdateContactAttributes)))
response =
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> () -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveEmpty
( \Int
s ResponseHeaders
h ()
x ->
Int -> UpdateContactAttributesResponse
UpdateContactAttributesResponse'
forall (f :: * -> *) a b. Functor 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 UpdateContactAttributes where
hashWithSalt :: Int -> UpdateContactAttributes -> Int
hashWithSalt Int
_salt UpdateContactAttributes' {Text
HashMap Text Text
attributes :: HashMap Text Text
instanceId :: Text
initialContactId :: Text
$sel:attributes:UpdateContactAttributes' :: UpdateContactAttributes -> HashMap Text Text
$sel:instanceId:UpdateContactAttributes' :: UpdateContactAttributes -> Text
$sel:initialContactId:UpdateContactAttributes' :: UpdateContactAttributes -> Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
initialContactId
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
instanceId
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` HashMap Text Text
attributes
instance Prelude.NFData UpdateContactAttributes where
rnf :: UpdateContactAttributes -> ()
rnf UpdateContactAttributes' {Text
HashMap Text Text
attributes :: HashMap Text Text
instanceId :: Text
initialContactId :: Text
$sel:attributes:UpdateContactAttributes' :: UpdateContactAttributes -> HashMap Text Text
$sel:instanceId:UpdateContactAttributes' :: UpdateContactAttributes -> Text
$sel:initialContactId:UpdateContactAttributes' :: UpdateContactAttributes -> Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Text
initialContactId
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 HashMap Text Text
attributes
instance Data.ToHeaders UpdateContactAttributes where
toHeaders :: UpdateContactAttributes -> 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 UpdateContactAttributes where
toJSON :: UpdateContactAttributes -> Value
toJSON UpdateContactAttributes' {Text
HashMap Text Text
attributes :: HashMap Text Text
instanceId :: Text
initialContactId :: Text
$sel:attributes:UpdateContactAttributes' :: UpdateContactAttributes -> HashMap Text Text
$sel:instanceId:UpdateContactAttributes' :: UpdateContactAttributes -> Text
$sel:initialContactId:UpdateContactAttributes' :: UpdateContactAttributes -> Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ forall a. a -> Maybe a
Prelude.Just
(Key
"InitialContactId" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
initialContactId),
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
"Attributes" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= HashMap Text Text
attributes)
]
)
instance Data.ToPath UpdateContactAttributes where
toPath :: UpdateContactAttributes -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/contact/attributes"
instance Data.ToQuery UpdateContactAttributes where
toQuery :: UpdateContactAttributes -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data UpdateContactAttributesResponse = UpdateContactAttributesResponse'
{
UpdateContactAttributesResponse -> Int
httpStatus :: Prelude.Int
}
deriving (UpdateContactAttributesResponse
-> UpdateContactAttributesResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateContactAttributesResponse
-> UpdateContactAttributesResponse -> Bool
$c/= :: UpdateContactAttributesResponse
-> UpdateContactAttributesResponse -> Bool
== :: UpdateContactAttributesResponse
-> UpdateContactAttributesResponse -> Bool
$c== :: UpdateContactAttributesResponse
-> UpdateContactAttributesResponse -> Bool
Prelude.Eq, ReadPrec [UpdateContactAttributesResponse]
ReadPrec UpdateContactAttributesResponse
Int -> ReadS UpdateContactAttributesResponse
ReadS [UpdateContactAttributesResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateContactAttributesResponse]
$creadListPrec :: ReadPrec [UpdateContactAttributesResponse]
readPrec :: ReadPrec UpdateContactAttributesResponse
$creadPrec :: ReadPrec UpdateContactAttributesResponse
readList :: ReadS [UpdateContactAttributesResponse]
$creadList :: ReadS [UpdateContactAttributesResponse]
readsPrec :: Int -> ReadS UpdateContactAttributesResponse
$creadsPrec :: Int -> ReadS UpdateContactAttributesResponse
Prelude.Read, Int -> UpdateContactAttributesResponse -> ShowS
[UpdateContactAttributesResponse] -> ShowS
UpdateContactAttributesResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateContactAttributesResponse] -> ShowS
$cshowList :: [UpdateContactAttributesResponse] -> ShowS
show :: UpdateContactAttributesResponse -> String
$cshow :: UpdateContactAttributesResponse -> String
showsPrec :: Int -> UpdateContactAttributesResponse -> ShowS
$cshowsPrec :: Int -> UpdateContactAttributesResponse -> ShowS
Prelude.Show, forall x.
Rep UpdateContactAttributesResponse x
-> UpdateContactAttributesResponse
forall x.
UpdateContactAttributesResponse
-> Rep UpdateContactAttributesResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UpdateContactAttributesResponse x
-> UpdateContactAttributesResponse
$cfrom :: forall x.
UpdateContactAttributesResponse
-> Rep UpdateContactAttributesResponse x
Prelude.Generic)
newUpdateContactAttributesResponse ::
Prelude.Int ->
UpdateContactAttributesResponse
newUpdateContactAttributesResponse :: Int -> UpdateContactAttributesResponse
newUpdateContactAttributesResponse Int
pHttpStatus_ =
UpdateContactAttributesResponse'
{ $sel:httpStatus:UpdateContactAttributesResponse' :: Int
httpStatus =
Int
pHttpStatus_
}
updateContactAttributesResponse_httpStatus :: Lens.Lens' UpdateContactAttributesResponse Prelude.Int
updateContactAttributesResponse_httpStatus :: Lens' UpdateContactAttributesResponse Int
updateContactAttributesResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateContactAttributesResponse' {Int
httpStatus :: Int
$sel:httpStatus:UpdateContactAttributesResponse' :: UpdateContactAttributesResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: UpdateContactAttributesResponse
s@UpdateContactAttributesResponse' {} Int
a -> UpdateContactAttributesResponse
s {$sel:httpStatus:UpdateContactAttributesResponse' :: Int
httpStatus = Int
a} :: UpdateContactAttributesResponse)
instance
Prelude.NFData
UpdateContactAttributesResponse
where
rnf :: UpdateContactAttributesResponse -> ()
rnf UpdateContactAttributesResponse' {Int
httpStatus :: Int
$sel:httpStatus:UpdateContactAttributesResponse' :: UpdateContactAttributesResponse -> Int
..} =
forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus