module Test.Marionette.Cookie where

import Data.Aeson.Types
import Data.Text (Text)
import GHC.Generics (Generic)
import Prelude

data Cookie = Cookie
    { Cookie -> Text
name :: Text
    , Cookie -> Text
value :: Text
    , Cookie -> Maybe Text
path :: Maybe Text
    , Cookie -> Maybe Text
domain :: Maybe Text
    , Cookie -> Maybe Bool
secure :: Maybe Bool
    , Cookie -> Maybe Bool
httpOnly :: Maybe Bool
    , Cookie -> Maybe Int
expiry :: Maybe Int
    }
    deriving stock ((forall x. Cookie -> Rep Cookie x)
-> (forall x. Rep Cookie x -> Cookie) -> Generic Cookie
forall x. Rep Cookie x -> Cookie
forall x. Cookie -> Rep Cookie x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. Cookie -> Rep Cookie x
from :: forall x. Cookie -> Rep Cookie x
$cto :: forall x. Rep Cookie x -> Cookie
to :: forall x. Rep Cookie x -> Cookie
Generic, Int -> Cookie -> ShowS
[Cookie] -> ShowS
Cookie -> String
(Int -> Cookie -> ShowS)
-> (Cookie -> String) -> ([Cookie] -> ShowS) -> Show Cookie
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> Cookie -> ShowS
showsPrec :: Int -> Cookie -> ShowS
$cshow :: Cookie -> String
show :: Cookie -> String
$cshowList :: [Cookie] -> ShowS
showList :: [Cookie] -> ShowS
Show, Cookie -> Cookie -> Bool
(Cookie -> Cookie -> Bool)
-> (Cookie -> Cookie -> Bool) -> Eq Cookie
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: Cookie -> Cookie -> Bool
== :: Cookie -> Cookie -> Bool
$c/= :: Cookie -> Cookie -> Bool
/= :: Cookie -> Cookie -> Bool
Eq)
    deriving anyclass (Maybe Cookie
Value -> Parser [Cookie]
Value -> Parser Cookie
(Value -> Parser Cookie)
-> (Value -> Parser [Cookie]) -> Maybe Cookie -> FromJSON Cookie
forall a.
(Value -> Parser a)
-> (Value -> Parser [a]) -> Maybe a -> FromJSON a
$cparseJSON :: Value -> Parser Cookie
parseJSON :: Value -> Parser Cookie
$cparseJSONList :: Value -> Parser [Cookie]
parseJSONList :: Value -> Parser [Cookie]
$comittedField :: Maybe Cookie
omittedField :: Maybe Cookie
FromJSON)

instance ToJSON Cookie where
    toJSON :: Cookie -> Value
toJSON = Options -> Cookie -> Value
forall a.
(Generic a, GToJSON' Value Zero (Rep a)) =>
Options -> a -> Value
genericToJSON Options
defaultOptions{omitNothingFields = True}