module Stratosphere.Resources.ManagedPolicy where
import Control.Lens
import Data.Aeson
import Data.Aeson.Types
import Data.Text
import GHC.Generics
import Stratosphere.Values
data ManagedPolicy =
ManagedPolicy
{ _managedPolicyDescription :: Maybe (Val Text)
, _managedPolicyGroups :: Maybe [Val Text]
, _managedPolicyPath :: Maybe (Val Text)
, _managedPolicyPolicyDocument :: Object
, _managedPolicyRoles :: Maybe [Val Text]
, _managedPolicyUsers :: Maybe [Val Text]
} deriving (Show, Generic)
instance ToJSON ManagedPolicy where
toJSON = genericToJSON defaultOptions { fieldLabelModifier = Prelude.drop 14, omitNothingFields = True }
instance FromJSON ManagedPolicy where
parseJSON = genericParseJSON defaultOptions { fieldLabelModifier = Prelude.drop 14, omitNothingFields = True }
managedPolicy
:: Object
-> ManagedPolicy
managedPolicy policyDocumentarg =
ManagedPolicy
{ _managedPolicyDescription = Nothing
, _managedPolicyGroups = Nothing
, _managedPolicyPath = Nothing
, _managedPolicyPolicyDocument = policyDocumentarg
, _managedPolicyRoles = Nothing
, _managedPolicyUsers = Nothing
}
mpDescription :: Lens' ManagedPolicy (Maybe (Val Text))
mpDescription = lens _managedPolicyDescription (\s a -> s { _managedPolicyDescription = a })
mpGroups :: Lens' ManagedPolicy (Maybe [Val Text])
mpGroups = lens _managedPolicyGroups (\s a -> s { _managedPolicyGroups = a })
mpPath :: Lens' ManagedPolicy (Maybe (Val Text))
mpPath = lens _managedPolicyPath (\s a -> s { _managedPolicyPath = a })
mpPolicyDocument :: Lens' ManagedPolicy Object
mpPolicyDocument = lens _managedPolicyPolicyDocument (\s a -> s { _managedPolicyPolicyDocument = a })
mpRoles :: Lens' ManagedPolicy (Maybe [Val Text])
mpRoles = lens _managedPolicyRoles (\s a -> s { _managedPolicyRoles = a })
mpUsers :: Lens' ManagedPolicy (Maybe [Val Text])
mpUsers = lens _managedPolicyUsers (\s a -> s { _managedPolicyUsers = a })