module Stratosphere.Resources.AccessKey where
import Control.Lens
import Data.Aeson
import Data.Aeson.Types
import Data.Text
import GHC.Generics
import Stratosphere.Values
data AccessKey =
AccessKey
{ _accessKeySerial :: Maybe (Val Integer')
, _accessKeyStatus :: Maybe (Val Text)
, _accessKeyUserName :: Val Text
} deriving (Show, Generic)
instance ToJSON AccessKey where
toJSON = genericToJSON defaultOptions { fieldLabelModifier = Prelude.drop 10, omitNothingFields = True }
instance FromJSON AccessKey where
parseJSON = genericParseJSON defaultOptions { fieldLabelModifier = Prelude.drop 10, omitNothingFields = True }
accessKey
:: Val Text
-> AccessKey
accessKey userNamearg =
AccessKey
{ _accessKeySerial = Nothing
, _accessKeyStatus = Nothing
, _accessKeyUserName = userNamearg
}
akSerial :: Lens' AccessKey (Maybe (Val Integer'))
akSerial = lens _accessKeySerial (\s a -> s { _accessKeySerial = a })
akStatus :: Lens' AccessKey (Maybe (Val Text))
akStatus = lens _accessKeyStatus (\s a -> s { _accessKeyStatus = a })
akUserName :: Lens' AccessKey (Val Text)
akUserName = lens _accessKeyUserName (\s a -> s { _accessKeyUserName = a })