module TD.Query.SetBusinessAwayMessageSettings
(SetBusinessAwayMessageSettings(..)
) 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.BusinessAwayMessageSettings as BusinessAwayMessageSettings
data SetBusinessAwayMessageSettings
= SetBusinessAwayMessageSettings
{ SetBusinessAwayMessageSettings -> Maybe BusinessAwayMessageSettings
away_message_settings :: Maybe BusinessAwayMessageSettings.BusinessAwayMessageSettings
}
deriving (SetBusinessAwayMessageSettings
-> SetBusinessAwayMessageSettings -> Bool
(SetBusinessAwayMessageSettings
-> SetBusinessAwayMessageSettings -> Bool)
-> (SetBusinessAwayMessageSettings
-> SetBusinessAwayMessageSettings -> Bool)
-> Eq SetBusinessAwayMessageSettings
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: SetBusinessAwayMessageSettings
-> SetBusinessAwayMessageSettings -> Bool
== :: SetBusinessAwayMessageSettings
-> SetBusinessAwayMessageSettings -> Bool
$c/= :: SetBusinessAwayMessageSettings
-> SetBusinessAwayMessageSettings -> Bool
/= :: SetBusinessAwayMessageSettings
-> SetBusinessAwayMessageSettings -> Bool
Eq, Int -> SetBusinessAwayMessageSettings -> ShowS
[SetBusinessAwayMessageSettings] -> ShowS
SetBusinessAwayMessageSettings -> String
(Int -> SetBusinessAwayMessageSettings -> ShowS)
-> (SetBusinessAwayMessageSettings -> String)
-> ([SetBusinessAwayMessageSettings] -> ShowS)
-> Show SetBusinessAwayMessageSettings
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> SetBusinessAwayMessageSettings -> ShowS
showsPrec :: Int -> SetBusinessAwayMessageSettings -> ShowS
$cshow :: SetBusinessAwayMessageSettings -> String
show :: SetBusinessAwayMessageSettings -> String
$cshowList :: [SetBusinessAwayMessageSettings] -> ShowS
showList :: [SetBusinessAwayMessageSettings] -> ShowS
Show)
instance I.ShortShow SetBusinessAwayMessageSettings where
shortShow :: SetBusinessAwayMessageSettings -> String
shortShow
SetBusinessAwayMessageSettings
{ away_message_settings :: SetBusinessAwayMessageSettings -> Maybe BusinessAwayMessageSettings
away_message_settings = Maybe BusinessAwayMessageSettings
away_message_settings_
}
= String
"SetBusinessAwayMessageSettings"
String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
[ String
"away_message_settings" String -> Maybe BusinessAwayMessageSettings -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe BusinessAwayMessageSettings
away_message_settings_
]
instance AT.ToJSON SetBusinessAwayMessageSettings where
toJSON :: SetBusinessAwayMessageSettings -> Value
toJSON
SetBusinessAwayMessageSettings
{ away_message_settings :: SetBusinessAwayMessageSettings -> Maybe BusinessAwayMessageSettings
away_message_settings = Maybe BusinessAwayMessageSettings
away_message_settings_
}
= [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
"setBusinessAwayMessageSettings"
, Key
"away_message_settings" Key -> Maybe BusinessAwayMessageSettings -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe BusinessAwayMessageSettings
away_message_settings_
]