module Stratosphere.Resources.InstanceProfile where
import Control.Lens
import Data.Aeson
import Data.Aeson.Types
import Data.Text
import GHC.Generics
import Stratosphere.Values
data InstanceProfile =
InstanceProfile
{ _instanceProfilePath :: Val Text
, _instanceProfileRoles :: [Val Text]
} deriving (Show, Generic)
instance ToJSON InstanceProfile where
toJSON = genericToJSON defaultOptions { fieldLabelModifier = Prelude.drop 16, omitNothingFields = True }
instance FromJSON InstanceProfile where
parseJSON = genericParseJSON defaultOptions { fieldLabelModifier = Prelude.drop 16, omitNothingFields = True }
instanceProfile
:: Val Text
-> [Val Text]
-> InstanceProfile
instanceProfile patharg rolesarg =
InstanceProfile
{ _instanceProfilePath = patharg
, _instanceProfileRoles = rolesarg
}
ipPath :: Lens' InstanceProfile (Val Text)
ipPath = lens _instanceProfilePath (\s a -> s { _instanceProfilePath = a })
ipRoles :: Lens' InstanceProfile [Val Text]
ipRoles = lens _instanceProfileRoles (\s a -> s { _instanceProfileRoles = a })