module TD.Query.GetChatNotificationSettingsExceptions
  (GetChatNotificationSettingsExceptions(..)
  , defaultGetChatNotificationSettingsExceptions
  ) 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.NotificationSettingsScope as NotificationSettingsScope

-- | Returns the list of chats with non-default notification settings for new messages. Returns 'TD.Data.Chats.Chats'
data GetChatNotificationSettingsExceptions
  = GetChatNotificationSettingsExceptions
    { GetChatNotificationSettingsExceptions
-> Maybe NotificationSettingsScope
scope         :: Maybe NotificationSettingsScope.NotificationSettingsScope -- ^ If specified, only chats from the scope will be returned; pass null to return chats from all scopes
    , GetChatNotificationSettingsExceptions -> Maybe Bool
compare_sound :: Maybe Bool                                                -- ^ Pass true to include in the response chats with only non-default sound
    }
  deriving (GetChatNotificationSettingsExceptions
-> GetChatNotificationSettingsExceptions -> Bool
(GetChatNotificationSettingsExceptions
 -> GetChatNotificationSettingsExceptions -> Bool)
-> (GetChatNotificationSettingsExceptions
    -> GetChatNotificationSettingsExceptions -> Bool)
-> Eq GetChatNotificationSettingsExceptions
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: GetChatNotificationSettingsExceptions
-> GetChatNotificationSettingsExceptions -> Bool
== :: GetChatNotificationSettingsExceptions
-> GetChatNotificationSettingsExceptions -> Bool
$c/= :: GetChatNotificationSettingsExceptions
-> GetChatNotificationSettingsExceptions -> Bool
/= :: GetChatNotificationSettingsExceptions
-> GetChatNotificationSettingsExceptions -> Bool
Eq, Int -> GetChatNotificationSettingsExceptions -> ShowS
[GetChatNotificationSettingsExceptions] -> ShowS
GetChatNotificationSettingsExceptions -> String
(Int -> GetChatNotificationSettingsExceptions -> ShowS)
-> (GetChatNotificationSettingsExceptions -> String)
-> ([GetChatNotificationSettingsExceptions] -> ShowS)
-> Show GetChatNotificationSettingsExceptions
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> GetChatNotificationSettingsExceptions -> ShowS
showsPrec :: Int -> GetChatNotificationSettingsExceptions -> ShowS
$cshow :: GetChatNotificationSettingsExceptions -> String
show :: GetChatNotificationSettingsExceptions -> String
$cshowList :: [GetChatNotificationSettingsExceptions] -> ShowS
showList :: [GetChatNotificationSettingsExceptions] -> ShowS
Show)

instance I.ShortShow GetChatNotificationSettingsExceptions where
  shortShow :: GetChatNotificationSettingsExceptions -> String
shortShow
    GetChatNotificationSettingsExceptions
      { scope :: GetChatNotificationSettingsExceptions
-> Maybe NotificationSettingsScope
scope         = Maybe NotificationSettingsScope
scope_
      , compare_sound :: GetChatNotificationSettingsExceptions -> Maybe Bool
compare_sound = Maybe Bool
compare_sound_
      }
        = String
"GetChatNotificationSettingsExceptions"
          String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
          [ String
"scope"         String -> Maybe NotificationSettingsScope -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe NotificationSettingsScope
scope_
          , String
"compare_sound" String -> Maybe Bool -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Bool
compare_sound_
          ]

instance AT.ToJSON GetChatNotificationSettingsExceptions where
  toJSON :: GetChatNotificationSettingsExceptions -> Value
toJSON
    GetChatNotificationSettingsExceptions
      { scope :: GetChatNotificationSettingsExceptions
-> Maybe NotificationSettingsScope
scope         = Maybe NotificationSettingsScope
scope_
      , compare_sound :: GetChatNotificationSettingsExceptions -> Maybe Bool
compare_sound = Maybe Bool
compare_sound_
      }
        = [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
"getChatNotificationSettingsExceptions"
          , Key
"scope"         Key -> Maybe NotificationSettingsScope -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe NotificationSettingsScope
scope_
          , Key
"compare_sound" Key -> Maybe Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe Bool
compare_sound_
          ]

defaultGetChatNotificationSettingsExceptions :: GetChatNotificationSettingsExceptions
defaultGetChatNotificationSettingsExceptions :: GetChatNotificationSettingsExceptions
defaultGetChatNotificationSettingsExceptions =
  GetChatNotificationSettingsExceptions
    { scope :: Maybe NotificationSettingsScope
scope         = Maybe NotificationSettingsScope
forall a. Maybe a
Nothing
    , compare_sound :: Maybe Bool
compare_sound = Maybe Bool
forall a. Maybe a
Nothing
    }