{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
module Network.AWS.CloudHSM.Types.Product where
import Network.AWS.CloudHSM.Types.Sum
import Network.AWS.Lens
import Network.AWS.Prelude
data Tag = Tag'
{ _tagKey :: !Text
, _tagValue :: !Text
} deriving (Eq,Read,Show,Data,Typeable,Generic)
tag
:: Text
-> Text
-> Tag
tag pKey_ pValue_ =
Tag'
{ _tagKey = pKey_
, _tagValue = pValue_
}
tagKey :: Lens' Tag Text
tagKey = lens _tagKey (\ s a -> s{_tagKey = a});
tagValue :: Lens' Tag Text
tagValue = lens _tagValue (\ s a -> s{_tagValue = a});
instance FromJSON Tag where
parseJSON
= withObject "Tag"
(\ x -> Tag' <$> (x .: "Key") <*> (x .: "Value"))
instance Hashable Tag
instance NFData Tag
instance ToJSON Tag where
toJSON Tag'{..}
= object
(catMaybes
[Just ("Key" .= _tagKey),
Just ("Value" .= _tagValue)])