module Network.AWS.CloudHSM.AddTagsToResource
(
addTagsToResource
, AddTagsToResource
, attrResourceARN
, attrTagList
, addTagsToResourceResponse
, AddTagsToResourceResponse
, attrrsResponseStatus
, attrrsStatus
) where
import Network.AWS.CloudHSM.Types
import Network.AWS.CloudHSM.Types.Product
import Network.AWS.Lens
import Network.AWS.Prelude
import Network.AWS.Request
import Network.AWS.Response
data AddTagsToResource = AddTagsToResource'
{ _attrResourceARN :: !Text
, _attrTagList :: ![Tag]
} deriving (Eq,Read,Show,Data,Typeable,Generic)
addTagsToResource
:: Text
-> AddTagsToResource
addTagsToResource pResourceARN_ =
AddTagsToResource'
{ _attrResourceARN = pResourceARN_
, _attrTagList = mempty
}
attrResourceARN :: Lens' AddTagsToResource Text
attrResourceARN = lens _attrResourceARN (\ s a -> s{_attrResourceARN = a});
attrTagList :: Lens' AddTagsToResource [Tag]
attrTagList = lens _attrTagList (\ s a -> s{_attrTagList = a}) . _Coerce;
instance AWSRequest AddTagsToResource where
type Rs AddTagsToResource = AddTagsToResourceResponse
request = postJSON cloudHSM
response
= receiveJSON
(\ s h x ->
AddTagsToResourceResponse' <$>
(pure (fromEnum s)) <*> (x .:> "Status"))
instance Hashable AddTagsToResource
instance NFData AddTagsToResource
instance ToHeaders AddTagsToResource where
toHeaders
= const
(mconcat
["X-Amz-Target" =#
("CloudHsmFrontendService.AddTagsToResource" ::
ByteString),
"Content-Type" =#
("application/x-amz-json-1.1" :: ByteString)])
instance ToJSON AddTagsToResource where
toJSON AddTagsToResource'{..}
= object
(catMaybes
[Just ("ResourceArn" .= _attrResourceARN),
Just ("TagList" .= _attrTagList)])
instance ToPath AddTagsToResource where
toPath = const "/"
instance ToQuery AddTagsToResource where
toQuery = const mempty
data AddTagsToResourceResponse = AddTagsToResourceResponse'
{ _attrrsResponseStatus :: !Int
, _attrrsStatus :: !Text
} deriving (Eq,Read,Show,Data,Typeable,Generic)
addTagsToResourceResponse
:: Int
-> Text
-> AddTagsToResourceResponse
addTagsToResourceResponse pResponseStatus_ pStatus_ =
AddTagsToResourceResponse'
{ _attrrsResponseStatus = pResponseStatus_
, _attrrsStatus = pStatus_
}
attrrsResponseStatus :: Lens' AddTagsToResourceResponse Int
attrrsResponseStatus = lens _attrrsResponseStatus (\ s a -> s{_attrrsResponseStatus = a});
attrrsStatus :: Lens' AddTagsToResourceResponse Text
attrrsStatus = lens _attrrsStatus (\ s a -> s{_attrrsStatus = a});
instance NFData AddTagsToResourceResponse