module Network.AWS.CloudDirectory.UpdateObjectAttributes
(
updateObjectAttributes
, UpdateObjectAttributes
, uoaDirectoryARN
, uoaObjectReference
, uoaAttributeUpdates
, updateObjectAttributesResponse
, UpdateObjectAttributesResponse
, uoarsObjectIdentifier
, uoarsResponseStatus
) where
import Network.AWS.CloudDirectory.Types
import Network.AWS.CloudDirectory.Types.Product
import Network.AWS.Lens
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
data UpdateObjectAttributes = UpdateObjectAttributes'
{ _uoaDirectoryARN :: !Text
, _uoaObjectReference :: !ObjectReference
, _uoaAttributeUpdates :: ![ObjectAttributeUpdate]
} deriving (Eq, Read, Show, Data, Typeable, Generic)
updateObjectAttributes
:: Text
-> ObjectReference
-> UpdateObjectAttributes
updateObjectAttributes pDirectoryARN_ pObjectReference_ =
UpdateObjectAttributes'
{ _uoaDirectoryARN = pDirectoryARN_
, _uoaObjectReference = pObjectReference_
, _uoaAttributeUpdates = mempty
}
uoaDirectoryARN :: Lens' UpdateObjectAttributes Text
uoaDirectoryARN = lens _uoaDirectoryARN (\ s a -> s{_uoaDirectoryARN = a});
uoaObjectReference :: Lens' UpdateObjectAttributes ObjectReference
uoaObjectReference = lens _uoaObjectReference (\ s a -> s{_uoaObjectReference = a});
uoaAttributeUpdates :: Lens' UpdateObjectAttributes [ObjectAttributeUpdate]
uoaAttributeUpdates = lens _uoaAttributeUpdates (\ s a -> s{_uoaAttributeUpdates = a}) . _Coerce;
instance AWSRequest UpdateObjectAttributes where
type Rs UpdateObjectAttributes =
UpdateObjectAttributesResponse
request = putJSON cloudDirectory
response
= receiveJSON
(\ s h x ->
UpdateObjectAttributesResponse' <$>
(x .?> "ObjectIdentifier") <*> (pure (fromEnum s)))
instance Hashable UpdateObjectAttributes where
instance NFData UpdateObjectAttributes where
instance ToHeaders UpdateObjectAttributes where
toHeaders UpdateObjectAttributes'{..}
= mconcat
["x-amz-data-partition" =# _uoaDirectoryARN]
instance ToJSON UpdateObjectAttributes where
toJSON UpdateObjectAttributes'{..}
= object
(catMaybes
[Just ("ObjectReference" .= _uoaObjectReference),
Just ("AttributeUpdates" .= _uoaAttributeUpdates)])
instance ToPath UpdateObjectAttributes where
toPath
= const
"/amazonclouddirectory/2017-01-11/object/update"
instance ToQuery UpdateObjectAttributes where
toQuery = const mempty
data UpdateObjectAttributesResponse = UpdateObjectAttributesResponse'
{ _uoarsObjectIdentifier :: !(Maybe Text)
, _uoarsResponseStatus :: !Int
} deriving (Eq, Read, Show, Data, Typeable, Generic)
updateObjectAttributesResponse
:: Int
-> UpdateObjectAttributesResponse
updateObjectAttributesResponse pResponseStatus_ =
UpdateObjectAttributesResponse'
{_uoarsObjectIdentifier = Nothing, _uoarsResponseStatus = pResponseStatus_}
uoarsObjectIdentifier :: Lens' UpdateObjectAttributesResponse (Maybe Text)
uoarsObjectIdentifier = lens _uoarsObjectIdentifier (\ s a -> s{_uoarsObjectIdentifier = a});
uoarsResponseStatus :: Lens' UpdateObjectAttributesResponse Int
uoarsResponseStatus = lens _uoarsResponseStatus (\ s a -> s{_uoarsResponseStatus = a});
instance NFData UpdateObjectAttributesResponse where