{-# 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.AlexaBusiness.UpdateContact
(
UpdateContact (..),
newUpdateContact,
updateContact_displayName,
updateContact_firstName,
updateContact_lastName,
updateContact_phoneNumber,
updateContact_phoneNumbers,
updateContact_sipAddresses,
updateContact_contactArn,
UpdateContactResponse (..),
newUpdateContactResponse,
updateContactResponse_httpStatus,
)
where
import Amazonka.AlexaBusiness.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 UpdateContact = UpdateContact'
{
UpdateContact -> Maybe Text
displayName :: Prelude.Maybe Prelude.Text,
UpdateContact -> Maybe Text
firstName :: Prelude.Maybe Prelude.Text,
UpdateContact -> Maybe Text
lastName :: Prelude.Maybe Prelude.Text,
UpdateContact -> Maybe (Sensitive Text)
phoneNumber :: Prelude.Maybe (Data.Sensitive Prelude.Text),
UpdateContact -> Maybe [PhoneNumber]
phoneNumbers :: Prelude.Maybe [PhoneNumber],
UpdateContact -> Maybe [SipAddress]
sipAddresses :: Prelude.Maybe [SipAddress],
UpdateContact -> Text
contactArn :: Prelude.Text
}
deriving (UpdateContact -> UpdateContact -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateContact -> UpdateContact -> Bool
$c/= :: UpdateContact -> UpdateContact -> Bool
== :: UpdateContact -> UpdateContact -> Bool
$c== :: UpdateContact -> UpdateContact -> Bool
Prelude.Eq, Int -> UpdateContact -> ShowS
[UpdateContact] -> ShowS
UpdateContact -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateContact] -> ShowS
$cshowList :: [UpdateContact] -> ShowS
show :: UpdateContact -> String
$cshow :: UpdateContact -> String
showsPrec :: Int -> UpdateContact -> ShowS
$cshowsPrec :: Int -> UpdateContact -> ShowS
Prelude.Show, forall x. Rep UpdateContact x -> UpdateContact
forall x. UpdateContact -> Rep UpdateContact x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdateContact x -> UpdateContact
$cfrom :: forall x. UpdateContact -> Rep UpdateContact x
Prelude.Generic)
newUpdateContact ::
Prelude.Text ->
UpdateContact
newUpdateContact :: Text -> UpdateContact
newUpdateContact Text
pContactArn_ =
UpdateContact'
{ $sel:displayName:UpdateContact' :: Maybe Text
displayName = forall a. Maybe a
Prelude.Nothing,
$sel:firstName:UpdateContact' :: Maybe Text
firstName = forall a. Maybe a
Prelude.Nothing,
$sel:lastName:UpdateContact' :: Maybe Text
lastName = forall a. Maybe a
Prelude.Nothing,
$sel:phoneNumber:UpdateContact' :: Maybe (Sensitive Text)
phoneNumber = forall a. Maybe a
Prelude.Nothing,
$sel:phoneNumbers:UpdateContact' :: Maybe [PhoneNumber]
phoneNumbers = forall a. Maybe a
Prelude.Nothing,
$sel:sipAddresses:UpdateContact' :: Maybe [SipAddress]
sipAddresses = forall a. Maybe a
Prelude.Nothing,
$sel:contactArn:UpdateContact' :: Text
contactArn = Text
pContactArn_
}
updateContact_displayName :: Lens.Lens' UpdateContact (Prelude.Maybe Prelude.Text)
updateContact_displayName :: Lens' UpdateContact (Maybe Text)
updateContact_displayName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateContact' {Maybe Text
displayName :: Maybe Text
$sel:displayName:UpdateContact' :: UpdateContact -> Maybe Text
displayName} -> Maybe Text
displayName) (\s :: UpdateContact
s@UpdateContact' {} Maybe Text
a -> UpdateContact
s {$sel:displayName:UpdateContact' :: Maybe Text
displayName = Maybe Text
a} :: UpdateContact)
updateContact_firstName :: Lens.Lens' UpdateContact (Prelude.Maybe Prelude.Text)
updateContact_firstName :: Lens' UpdateContact (Maybe Text)
updateContact_firstName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateContact' {Maybe Text
firstName :: Maybe Text
$sel:firstName:UpdateContact' :: UpdateContact -> Maybe Text
firstName} -> Maybe Text
firstName) (\s :: UpdateContact
s@UpdateContact' {} Maybe Text
a -> UpdateContact
s {$sel:firstName:UpdateContact' :: Maybe Text
firstName = Maybe Text
a} :: UpdateContact)
updateContact_lastName :: Lens.Lens' UpdateContact (Prelude.Maybe Prelude.Text)
updateContact_lastName :: Lens' UpdateContact (Maybe Text)
updateContact_lastName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateContact' {Maybe Text
lastName :: Maybe Text
$sel:lastName:UpdateContact' :: UpdateContact -> Maybe Text
lastName} -> Maybe Text
lastName) (\s :: UpdateContact
s@UpdateContact' {} Maybe Text
a -> UpdateContact
s {$sel:lastName:UpdateContact' :: Maybe Text
lastName = Maybe Text
a} :: UpdateContact)
updateContact_phoneNumber :: Lens.Lens' UpdateContact (Prelude.Maybe Prelude.Text)
updateContact_phoneNumber :: Lens' UpdateContact (Maybe Text)
updateContact_phoneNumber = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateContact' {Maybe (Sensitive Text)
phoneNumber :: Maybe (Sensitive Text)
$sel:phoneNumber:UpdateContact' :: UpdateContact -> Maybe (Sensitive Text)
phoneNumber} -> Maybe (Sensitive Text)
phoneNumber) (\s :: UpdateContact
s@UpdateContact' {} Maybe (Sensitive Text)
a -> UpdateContact
s {$sel:phoneNumber:UpdateContact' :: Maybe (Sensitive Text)
phoneNumber = Maybe (Sensitive Text)
a} :: UpdateContact) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall a. Iso' (Sensitive a) a
Data._Sensitive
updateContact_phoneNumbers :: Lens.Lens' UpdateContact (Prelude.Maybe [PhoneNumber])
updateContact_phoneNumbers :: Lens' UpdateContact (Maybe [PhoneNumber])
updateContact_phoneNumbers = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateContact' {Maybe [PhoneNumber]
phoneNumbers :: Maybe [PhoneNumber]
$sel:phoneNumbers:UpdateContact' :: UpdateContact -> Maybe [PhoneNumber]
phoneNumbers} -> Maybe [PhoneNumber]
phoneNumbers) (\s :: UpdateContact
s@UpdateContact' {} Maybe [PhoneNumber]
a -> UpdateContact
s {$sel:phoneNumbers:UpdateContact' :: Maybe [PhoneNumber]
phoneNumbers = Maybe [PhoneNumber]
a} :: UpdateContact) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
updateContact_sipAddresses :: Lens.Lens' UpdateContact (Prelude.Maybe [SipAddress])
updateContact_sipAddresses :: Lens' UpdateContact (Maybe [SipAddress])
updateContact_sipAddresses = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateContact' {Maybe [SipAddress]
sipAddresses :: Maybe [SipAddress]
$sel:sipAddresses:UpdateContact' :: UpdateContact -> Maybe [SipAddress]
sipAddresses} -> Maybe [SipAddress]
sipAddresses) (\s :: UpdateContact
s@UpdateContact' {} Maybe [SipAddress]
a -> UpdateContact
s {$sel:sipAddresses:UpdateContact' :: Maybe [SipAddress]
sipAddresses = Maybe [SipAddress]
a} :: UpdateContact) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
updateContact_contactArn :: Lens.Lens' UpdateContact Prelude.Text
updateContact_contactArn :: Lens' UpdateContact Text
updateContact_contactArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateContact' {Text
contactArn :: Text
$sel:contactArn:UpdateContact' :: UpdateContact -> Text
contactArn} -> Text
contactArn) (\s :: UpdateContact
s@UpdateContact' {} Text
a -> UpdateContact
s {$sel:contactArn:UpdateContact' :: Text
contactArn = Text
a} :: UpdateContact)
instance Core.AWSRequest UpdateContact where
type
AWSResponse UpdateContact =
UpdateContactResponse
request :: (Service -> Service) -> UpdateContact -> Request UpdateContact
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 UpdateContact
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse UpdateContact)))
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 -> UpdateContactResponse
UpdateContactResponse'
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 UpdateContact where
hashWithSalt :: Int -> UpdateContact -> Int
hashWithSalt Int
_salt UpdateContact' {Maybe [PhoneNumber]
Maybe [SipAddress]
Maybe Text
Maybe (Sensitive Text)
Text
contactArn :: Text
sipAddresses :: Maybe [SipAddress]
phoneNumbers :: Maybe [PhoneNumber]
phoneNumber :: Maybe (Sensitive Text)
lastName :: Maybe Text
firstName :: Maybe Text
displayName :: Maybe Text
$sel:contactArn:UpdateContact' :: UpdateContact -> Text
$sel:sipAddresses:UpdateContact' :: UpdateContact -> Maybe [SipAddress]
$sel:phoneNumbers:UpdateContact' :: UpdateContact -> Maybe [PhoneNumber]
$sel:phoneNumber:UpdateContact' :: UpdateContact -> Maybe (Sensitive Text)
$sel:lastName:UpdateContact' :: UpdateContact -> Maybe Text
$sel:firstName:UpdateContact' :: UpdateContact -> Maybe Text
$sel:displayName:UpdateContact' :: UpdateContact -> Maybe Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
displayName
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
firstName
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
lastName
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (Sensitive Text)
phoneNumber
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [PhoneNumber]
phoneNumbers
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [SipAddress]
sipAddresses
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
contactArn
instance Prelude.NFData UpdateContact where
rnf :: UpdateContact -> ()
rnf UpdateContact' {Maybe [PhoneNumber]
Maybe [SipAddress]
Maybe Text
Maybe (Sensitive Text)
Text
contactArn :: Text
sipAddresses :: Maybe [SipAddress]
phoneNumbers :: Maybe [PhoneNumber]
phoneNumber :: Maybe (Sensitive Text)
lastName :: Maybe Text
firstName :: Maybe Text
displayName :: Maybe Text
$sel:contactArn:UpdateContact' :: UpdateContact -> Text
$sel:sipAddresses:UpdateContact' :: UpdateContact -> Maybe [SipAddress]
$sel:phoneNumbers:UpdateContact' :: UpdateContact -> Maybe [PhoneNumber]
$sel:phoneNumber:UpdateContact' :: UpdateContact -> Maybe (Sensitive Text)
$sel:lastName:UpdateContact' :: UpdateContact -> Maybe Text
$sel:firstName:UpdateContact' :: UpdateContact -> Maybe Text
$sel:displayName:UpdateContact' :: UpdateContact -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
displayName
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
firstName
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
lastName
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe (Sensitive Text)
phoneNumber
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [PhoneNumber]
phoneNumbers
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [SipAddress]
sipAddresses
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
contactArn
instance Data.ToHeaders UpdateContact where
toHeaders :: UpdateContact -> ResponseHeaders
toHeaders =
forall a b. a -> b -> a
Prelude.const
( forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"X-Amz-Target"
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"AlexaForBusiness.UpdateContact" ::
Prelude.ByteString
),
HeaderName
"Content-Type"
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Data.ToJSON UpdateContact where
toJSON :: UpdateContact -> Value
toJSON UpdateContact' {Maybe [PhoneNumber]
Maybe [SipAddress]
Maybe Text
Maybe (Sensitive Text)
Text
contactArn :: Text
sipAddresses :: Maybe [SipAddress]
phoneNumbers :: Maybe [PhoneNumber]
phoneNumber :: Maybe (Sensitive Text)
lastName :: Maybe Text
firstName :: Maybe Text
displayName :: Maybe Text
$sel:contactArn:UpdateContact' :: UpdateContact -> Text
$sel:sipAddresses:UpdateContact' :: UpdateContact -> Maybe [SipAddress]
$sel:phoneNumbers:UpdateContact' :: UpdateContact -> Maybe [PhoneNumber]
$sel:phoneNumber:UpdateContact' :: UpdateContact -> Maybe (Sensitive Text)
$sel:lastName:UpdateContact' :: UpdateContact -> Maybe Text
$sel:firstName:UpdateContact' :: UpdateContact -> Maybe Text
$sel:displayName:UpdateContact' :: UpdateContact -> Maybe Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"DisplayName" 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
displayName,
(Key
"FirstName" 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
firstName,
(Key
"LastName" 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
lastName,
(Key
"PhoneNumber" 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 (Sensitive Text)
phoneNumber,
(Key
"PhoneNumbers" 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 [PhoneNumber]
phoneNumbers,
(Key
"SipAddresses" 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 [SipAddress]
sipAddresses,
forall a. a -> Maybe a
Prelude.Just (Key
"ContactArn" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
contactArn)
]
)
instance Data.ToPath UpdateContact where
toPath :: UpdateContact -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Data.ToQuery UpdateContact where
toQuery :: UpdateContact -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data UpdateContactResponse = UpdateContactResponse'
{
UpdateContactResponse -> Int
httpStatus :: Prelude.Int
}
deriving (UpdateContactResponse -> UpdateContactResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateContactResponse -> UpdateContactResponse -> Bool
$c/= :: UpdateContactResponse -> UpdateContactResponse -> Bool
== :: UpdateContactResponse -> UpdateContactResponse -> Bool
$c== :: UpdateContactResponse -> UpdateContactResponse -> Bool
Prelude.Eq, ReadPrec [UpdateContactResponse]
ReadPrec UpdateContactResponse
Int -> ReadS UpdateContactResponse
ReadS [UpdateContactResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateContactResponse]
$creadListPrec :: ReadPrec [UpdateContactResponse]
readPrec :: ReadPrec UpdateContactResponse
$creadPrec :: ReadPrec UpdateContactResponse
readList :: ReadS [UpdateContactResponse]
$creadList :: ReadS [UpdateContactResponse]
readsPrec :: Int -> ReadS UpdateContactResponse
$creadsPrec :: Int -> ReadS UpdateContactResponse
Prelude.Read, Int -> UpdateContactResponse -> ShowS
[UpdateContactResponse] -> ShowS
UpdateContactResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateContactResponse] -> ShowS
$cshowList :: [UpdateContactResponse] -> ShowS
show :: UpdateContactResponse -> String
$cshow :: UpdateContactResponse -> String
showsPrec :: Int -> UpdateContactResponse -> ShowS
$cshowsPrec :: Int -> UpdateContactResponse -> ShowS
Prelude.Show, forall x. Rep UpdateContactResponse x -> UpdateContactResponse
forall x. UpdateContactResponse -> Rep UpdateContactResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdateContactResponse x -> UpdateContactResponse
$cfrom :: forall x. UpdateContactResponse -> Rep UpdateContactResponse x
Prelude.Generic)
newUpdateContactResponse ::
Prelude.Int ->
UpdateContactResponse
newUpdateContactResponse :: Int -> UpdateContactResponse
newUpdateContactResponse Int
pHttpStatus_ =
UpdateContactResponse' {$sel:httpStatus:UpdateContactResponse' :: Int
httpStatus = Int
pHttpStatus_}
updateContactResponse_httpStatus :: Lens.Lens' UpdateContactResponse Prelude.Int
updateContactResponse_httpStatus :: Lens' UpdateContactResponse Int
updateContactResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateContactResponse' {Int
httpStatus :: Int
$sel:httpStatus:UpdateContactResponse' :: UpdateContactResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: UpdateContactResponse
s@UpdateContactResponse' {} Int
a -> UpdateContactResponse
s {$sel:httpStatus:UpdateContactResponse' :: Int
httpStatus = Int
a} :: UpdateContactResponse)
instance Prelude.NFData UpdateContactResponse where
rnf :: UpdateContactResponse -> ()
rnf UpdateContactResponse' {Int
httpStatus :: Int
$sel:httpStatus:UpdateContactResponse' :: UpdateContactResponse -> Int
..} =
forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus