module TD.Query.SetBusinessOpeningHours
(SetBusinessOpeningHours(..)
) where
import qualified Data.Aeson as A
import qualified Data.Aeson.Types as AT
import qualified TD.Lib.Internal as I
import qualified TD.Data.BusinessOpeningHours as BusinessOpeningHours
data SetBusinessOpeningHours
= SetBusinessOpeningHours
{ SetBusinessOpeningHours -> Maybe BusinessOpeningHours
opening_hours :: Maybe BusinessOpeningHours.BusinessOpeningHours
}
deriving (SetBusinessOpeningHours -> SetBusinessOpeningHours -> Bool
(SetBusinessOpeningHours -> SetBusinessOpeningHours -> Bool)
-> (SetBusinessOpeningHours -> SetBusinessOpeningHours -> Bool)
-> Eq SetBusinessOpeningHours
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: SetBusinessOpeningHours -> SetBusinessOpeningHours -> Bool
== :: SetBusinessOpeningHours -> SetBusinessOpeningHours -> Bool
$c/= :: SetBusinessOpeningHours -> SetBusinessOpeningHours -> Bool
/= :: SetBusinessOpeningHours -> SetBusinessOpeningHours -> Bool
Eq, Int -> SetBusinessOpeningHours -> ShowS
[SetBusinessOpeningHours] -> ShowS
SetBusinessOpeningHours -> String
(Int -> SetBusinessOpeningHours -> ShowS)
-> (SetBusinessOpeningHours -> String)
-> ([SetBusinessOpeningHours] -> ShowS)
-> Show SetBusinessOpeningHours
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> SetBusinessOpeningHours -> ShowS
showsPrec :: Int -> SetBusinessOpeningHours -> ShowS
$cshow :: SetBusinessOpeningHours -> String
show :: SetBusinessOpeningHours -> String
$cshowList :: [SetBusinessOpeningHours] -> ShowS
showList :: [SetBusinessOpeningHours] -> ShowS
Show)
instance I.ShortShow SetBusinessOpeningHours where
shortShow :: SetBusinessOpeningHours -> String
shortShow
SetBusinessOpeningHours
{ opening_hours :: SetBusinessOpeningHours -> Maybe BusinessOpeningHours
opening_hours = Maybe BusinessOpeningHours
opening_hours_
}
= String
"SetBusinessOpeningHours"
String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
[ String
"opening_hours" String -> Maybe BusinessOpeningHours -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe BusinessOpeningHours
opening_hours_
]
instance AT.ToJSON SetBusinessOpeningHours where
toJSON :: SetBusinessOpeningHours -> Value
toJSON
SetBusinessOpeningHours
{ opening_hours :: SetBusinessOpeningHours -> Maybe BusinessOpeningHours
opening_hours = Maybe BusinessOpeningHours
opening_hours_
}
= [Pair] -> Value
A.object
[ Key
"@type" Key -> Value -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Text -> Value
AT.String Text
"setBusinessOpeningHours"
, Key
"opening_hours" Key -> Maybe BusinessOpeningHours -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe BusinessOpeningHours
opening_hours_
]