module TD.Query.ToggleChatDefaultDisableNotification
  (ToggleChatDefaultDisableNotification(..)
  , defaultToggleChatDefaultDisableNotification
  ) where

import qualified Data.Aeson as A
import qualified Data.Aeson.Types as AT
import qualified TD.Lib.Internal as I

-- | Changes the value of the default disable_notification parameter, used when a message is sent to a chat. Returns 'TD.Data.Ok.Ok'
data ToggleChatDefaultDisableNotification
  = ToggleChatDefaultDisableNotification
    { ToggleChatDefaultDisableNotification -> Maybe Int
chat_id                      :: Maybe Int  -- ^ Chat identifier
    , ToggleChatDefaultDisableNotification -> Maybe Bool
default_disable_notification :: Maybe Bool -- ^ New value of default_disable_notification
    }
  deriving (ToggleChatDefaultDisableNotification
-> ToggleChatDefaultDisableNotification -> Bool
(ToggleChatDefaultDisableNotification
 -> ToggleChatDefaultDisableNotification -> Bool)
-> (ToggleChatDefaultDisableNotification
    -> ToggleChatDefaultDisableNotification -> Bool)
-> Eq ToggleChatDefaultDisableNotification
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: ToggleChatDefaultDisableNotification
-> ToggleChatDefaultDisableNotification -> Bool
== :: ToggleChatDefaultDisableNotification
-> ToggleChatDefaultDisableNotification -> Bool
$c/= :: ToggleChatDefaultDisableNotification
-> ToggleChatDefaultDisableNotification -> Bool
/= :: ToggleChatDefaultDisableNotification
-> ToggleChatDefaultDisableNotification -> Bool
Eq, Int -> ToggleChatDefaultDisableNotification -> ShowS
[ToggleChatDefaultDisableNotification] -> ShowS
ToggleChatDefaultDisableNotification -> String
(Int -> ToggleChatDefaultDisableNotification -> ShowS)
-> (ToggleChatDefaultDisableNotification -> String)
-> ([ToggleChatDefaultDisableNotification] -> ShowS)
-> Show ToggleChatDefaultDisableNotification
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> ToggleChatDefaultDisableNotification -> ShowS
showsPrec :: Int -> ToggleChatDefaultDisableNotification -> ShowS
$cshow :: ToggleChatDefaultDisableNotification -> String
show :: ToggleChatDefaultDisableNotification -> String
$cshowList :: [ToggleChatDefaultDisableNotification] -> ShowS
showList :: [ToggleChatDefaultDisableNotification] -> ShowS
Show)

instance I.ShortShow ToggleChatDefaultDisableNotification where
  shortShow :: ToggleChatDefaultDisableNotification -> String
shortShow
    ToggleChatDefaultDisableNotification
      { chat_id :: ToggleChatDefaultDisableNotification -> Maybe Int
chat_id                      = Maybe Int
chat_id_
      , default_disable_notification :: ToggleChatDefaultDisableNotification -> Maybe Bool
default_disable_notification = Maybe Bool
default_disable_notification_
      }
        = String
"ToggleChatDefaultDisableNotification"
          String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
          [ String
"chat_id"                      String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
chat_id_
          , String
"default_disable_notification" String -> Maybe Bool -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Bool
default_disable_notification_
          ]

instance AT.ToJSON ToggleChatDefaultDisableNotification where
  toJSON :: ToggleChatDefaultDisableNotification -> Value
toJSON
    ToggleChatDefaultDisableNotification
      { chat_id :: ToggleChatDefaultDisableNotification -> Maybe Int
chat_id                      = Maybe Int
chat_id_
      , default_disable_notification :: ToggleChatDefaultDisableNotification -> Maybe Bool
default_disable_notification = Maybe Bool
default_disable_notification_
      }
        = [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
"toggleChatDefaultDisableNotification"
          , Key
"chat_id"                      Key -> Maybe Int -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe Int
chat_id_
          , Key
"default_disable_notification" Key -> Maybe Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe Bool
default_disable_notification_
          ]

defaultToggleChatDefaultDisableNotification :: ToggleChatDefaultDisableNotification
defaultToggleChatDefaultDisableNotification :: ToggleChatDefaultDisableNotification
defaultToggleChatDefaultDisableNotification =
  ToggleChatDefaultDisableNotification
    { chat_id :: Maybe Int
chat_id                      = Maybe Int
forall a. Maybe a
Nothing
    , default_disable_notification :: Maybe Bool
default_disable_notification = Maybe Bool
forall a. Maybe a
Nothing
    }