module Stratosphere.Resources.User where
import Control.Lens
import Data.Aeson
import Data.Aeson.Types
import Data.Text
import GHC.Generics
import Stratosphere.Values
import Stratosphere.ResourceProperties.IAMPolicies
import Stratosphere.ResourceProperties.UserLoginProfile
data User =
  User
  { _userGroups :: Maybe [Val Text]
  , _userLoginProfile :: Maybe UserLoginProfile
  , _userManagedPolicyArns :: Maybe [Val Text]
  , _userPath :: Maybe (Val Text)
  , _userPolicies :: Maybe [IAMPolicies]
  } deriving (Show, Generic)
instance ToJSON User where
  toJSON = genericToJSON defaultOptions { fieldLabelModifier = Prelude.drop 5, omitNothingFields = True }
instance FromJSON User where
  parseJSON = genericParseJSON defaultOptions { fieldLabelModifier = Prelude.drop 5, omitNothingFields = True }
user
  :: User
user  =
  User
  { _userGroups = Nothing
  , _userLoginProfile = Nothing
  , _userManagedPolicyArns = Nothing
  , _userPath = Nothing
  , _userPolicies = Nothing
  }
uGroups :: Lens' User (Maybe [Val Text])
uGroups = lens _userGroups (\s a -> s { _userGroups = a })
uLoginProfile :: Lens' User (Maybe UserLoginProfile)
uLoginProfile = lens _userLoginProfile (\s a -> s { _userLoginProfile = a })
uManagedPolicyArns :: Lens' User (Maybe [Val Text])
uManagedPolicyArns = lens _userManagedPolicyArns (\s a -> s { _userManagedPolicyArns = a })
uPath :: Lens' User (Maybe (Val Text))
uPath = lens _userPath (\s a -> s { _userPath = a })
uPolicies :: Lens' User (Maybe [IAMPolicies])
uPolicies = lens _userPolicies (\s a -> s { _userPolicies = a })