module Stratosphere.Resources.UserToGroupAddition where
import Control.Lens
import Data.Aeson
import Data.Aeson.Types
import Data.Text
import GHC.Generics
import Stratosphere.Values
data UserToGroupAddition =
UserToGroupAddition
{ _userToGroupAdditionGroupName :: Val Text
, _userToGroupAdditionUsers :: [Val Text]
} deriving (Show, Generic)
instance ToJSON UserToGroupAddition where
toJSON = genericToJSON defaultOptions { fieldLabelModifier = Prelude.drop 20, omitNothingFields = True }
instance FromJSON UserToGroupAddition where
parseJSON = genericParseJSON defaultOptions { fieldLabelModifier = Prelude.drop 20, omitNothingFields = True }
userToGroupAddition
:: Val Text
-> [Val Text]
-> UserToGroupAddition
userToGroupAddition groupNamearg usersarg =
UserToGroupAddition
{ _userToGroupAdditionGroupName = groupNamearg
, _userToGroupAdditionUsers = usersarg
}
utgaGroupName :: Lens' UserToGroupAddition (Val Text)
utgaGroupName = lens _userToGroupAdditionGroupName (\s a -> s { _userToGroupAdditionGroupName = a })
utgaUsers :: Lens' UserToGroupAddition [Val Text]
utgaUsers = lens _userToGroupAdditionUsers (\s a -> s { _userToGroupAdditionUsers = a })