module Web.Scim.Schema.User.Address where
import Data.Aeson
import Data.Text hiding (dropWhile)
import GHC.Generics (Generic)
import Web.Scim.Schema.Common
data Address = Address
{ Address -> Maybe Text
formatted :: Maybe Text,
Address -> Maybe Text
streetAddress :: Maybe Text,
Address -> Maybe Text
locality :: Maybe Text,
Address -> Maybe Text
region :: Maybe Text,
Address -> Maybe Text
postalCode :: Maybe Text,
Address -> Maybe Text
country :: Maybe Text,
Address -> Maybe Text
typ :: Maybe Text,
Address -> Maybe ScimBool
primary :: Maybe ScimBool
}
deriving (Int -> Address -> ShowS
[Address] -> ShowS
Address -> String
(Int -> Address -> ShowS)
-> (Address -> String) -> ([Address] -> ShowS) -> Show Address
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Address] -> ShowS
$cshowList :: [Address] -> ShowS
show :: Address -> String
$cshow :: Address -> String
showsPrec :: Int -> Address -> ShowS
$cshowsPrec :: Int -> Address -> ShowS
Show, Address -> Address -> Bool
(Address -> Address -> Bool)
-> (Address -> Address -> Bool) -> Eq Address
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Address -> Address -> Bool
$c/= :: Address -> Address -> Bool
== :: Address -> Address -> Bool
$c== :: Address -> Address -> Bool
Eq, (forall x. Address -> Rep Address x)
-> (forall x. Rep Address x -> Address) -> Generic Address
forall x. Rep Address x -> Address
forall x. Address -> Rep Address x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Address x -> Address
$cfrom :: forall x. Address -> Rep Address x
Generic)
instance FromJSON Address where
parseJSON :: Value -> Parser Address
parseJSON = Options -> Value -> Parser Address
forall a.
(Generic a, GFromJSON Zero (Rep a)) =>
Options -> Value -> Parser a
genericParseJSON Options
parseOptions (Value -> Parser Address)
-> (Value -> Value) -> Value -> Parser Address
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Value -> Value
jsonLower
instance ToJSON Address where
toJSON :: Address -> Value
toJSON = Options -> Address -> Value
forall a.
(Generic a, GToJSON Value Zero (Rep a)) =>
Options -> a -> Value
genericToJSON Options
serializeOptions