{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE TypeFamilies #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}
module Network.AWS.AlexaBusiness.UpdateContact
(
updateContact
, UpdateContact
, ucLastName
, ucPhoneNumber
, ucFirstName
, ucDisplayName
, ucContactARN
, updateContactResponse
, UpdateContactResponse
, ucrsResponseStatus
) where
import Network.AWS.AlexaBusiness.Types
import Network.AWS.AlexaBusiness.Types.Product
import Network.AWS.Lens
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
data UpdateContact = UpdateContact'
{ _ucLastName :: !(Maybe Text)
, _ucPhoneNumber :: !(Maybe Text)
, _ucFirstName :: !(Maybe Text)
, _ucDisplayName :: !(Maybe Text)
, _ucContactARN :: !Text
} deriving (Eq, Read, Show, Data, Typeable, Generic)
updateContact
:: Text
-> UpdateContact
updateContact pContactARN_ =
UpdateContact'
{ _ucLastName = Nothing
, _ucPhoneNumber = Nothing
, _ucFirstName = Nothing
, _ucDisplayName = Nothing
, _ucContactARN = pContactARN_
}
ucLastName :: Lens' UpdateContact (Maybe Text)
ucLastName = lens _ucLastName (\ s a -> s{_ucLastName = a})
ucPhoneNumber :: Lens' UpdateContact (Maybe Text)
ucPhoneNumber = lens _ucPhoneNumber (\ s a -> s{_ucPhoneNumber = a})
ucFirstName :: Lens' UpdateContact (Maybe Text)
ucFirstName = lens _ucFirstName (\ s a -> s{_ucFirstName = a})
ucDisplayName :: Lens' UpdateContact (Maybe Text)
ucDisplayName = lens _ucDisplayName (\ s a -> s{_ucDisplayName = a})
ucContactARN :: Lens' UpdateContact Text
ucContactARN = lens _ucContactARN (\ s a -> s{_ucContactARN = a})
instance AWSRequest UpdateContact where
type Rs UpdateContact = UpdateContactResponse
request = postJSON alexaBusiness
response
= receiveEmpty
(\ s h x ->
UpdateContactResponse' <$> (pure (fromEnum s)))
instance Hashable UpdateContact where
instance NFData UpdateContact where
instance ToHeaders UpdateContact where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("AlexaForBusiness.UpdateContact" :: ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON UpdateContact where
toJSON UpdateContact'{..}
= object
(catMaybes
[("LastName" .=) <$> _ucLastName,
("PhoneNumber" .=) <$> _ucPhoneNumber,
("FirstName" .=) <$> _ucFirstName,
("DisplayName" .=) <$> _ucDisplayName,
Just ("ContactArn" .= _ucContactARN)])
instance ToPath UpdateContact where
toPath = const "/"
instance ToQuery UpdateContact where
toQuery = const mempty
newtype UpdateContactResponse = UpdateContactResponse'
{ _ucrsResponseStatus :: Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
updateContactResponse
:: Int
-> UpdateContactResponse
updateContactResponse pResponseStatus_ =
UpdateContactResponse' {_ucrsResponseStatus = pResponseStatus_}
ucrsResponseStatus :: Lens' UpdateContactResponse Int
ucrsResponseStatus = lens _ucrsResponseStatus (\ s a -> s{_ucrsResponseStatus = a})
instance NFData UpdateContactResponse where