module TD.Query.GetChatBoostLevelFeatures
  (GetChatBoostLevelFeatures(..)
  , defaultGetChatBoostLevelFeatures
  ) where

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

-- | Returns the list of features available on the specific chat boost level; this is an offline request. Returns 'TD.Data.ChatBoostLevelFeatures.ChatBoostLevelFeatures'
data GetChatBoostLevelFeatures
  = GetChatBoostLevelFeatures
    { GetChatBoostLevelFeatures -> Maybe Bool
is_channel :: Maybe Bool -- ^ Pass true to get the list of features for channels; pass false to get the list of features for supergroups
    , GetChatBoostLevelFeatures -> Maybe Int
level      :: Maybe Int  -- ^ Chat boost level
    }
  deriving (GetChatBoostLevelFeatures -> GetChatBoostLevelFeatures -> Bool
(GetChatBoostLevelFeatures -> GetChatBoostLevelFeatures -> Bool)
-> (GetChatBoostLevelFeatures -> GetChatBoostLevelFeatures -> Bool)
-> Eq GetChatBoostLevelFeatures
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: GetChatBoostLevelFeatures -> GetChatBoostLevelFeatures -> Bool
== :: GetChatBoostLevelFeatures -> GetChatBoostLevelFeatures -> Bool
$c/= :: GetChatBoostLevelFeatures -> GetChatBoostLevelFeatures -> Bool
/= :: GetChatBoostLevelFeatures -> GetChatBoostLevelFeatures -> Bool
Eq, Int -> GetChatBoostLevelFeatures -> ShowS
[GetChatBoostLevelFeatures] -> ShowS
GetChatBoostLevelFeatures -> String
(Int -> GetChatBoostLevelFeatures -> ShowS)
-> (GetChatBoostLevelFeatures -> String)
-> ([GetChatBoostLevelFeatures] -> ShowS)
-> Show GetChatBoostLevelFeatures
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> GetChatBoostLevelFeatures -> ShowS
showsPrec :: Int -> GetChatBoostLevelFeatures -> ShowS
$cshow :: GetChatBoostLevelFeatures -> String
show :: GetChatBoostLevelFeatures -> String
$cshowList :: [GetChatBoostLevelFeatures] -> ShowS
showList :: [GetChatBoostLevelFeatures] -> ShowS
Show)

instance I.ShortShow GetChatBoostLevelFeatures where
  shortShow :: GetChatBoostLevelFeatures -> String
shortShow
    GetChatBoostLevelFeatures
      { is_channel :: GetChatBoostLevelFeatures -> Maybe Bool
is_channel = Maybe Bool
is_channel_
      , level :: GetChatBoostLevelFeatures -> Maybe Int
level      = Maybe Int
level_
      }
        = String
"GetChatBoostLevelFeatures"
          String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
          [ String
"is_channel" String -> Maybe Bool -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Bool
is_channel_
          , String
"level"      String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
level_
          ]

instance AT.ToJSON GetChatBoostLevelFeatures where
  toJSON :: GetChatBoostLevelFeatures -> Value
toJSON
    GetChatBoostLevelFeatures
      { is_channel :: GetChatBoostLevelFeatures -> Maybe Bool
is_channel = Maybe Bool
is_channel_
      , level :: GetChatBoostLevelFeatures -> Maybe Int
level      = Maybe Int
level_
      }
        = [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
"getChatBoostLevelFeatures"
          , Key
"is_channel" Key -> Maybe Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe Bool
is_channel_
          , Key
"level"      Key -> Maybe Int -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe Int
level_
          ]

defaultGetChatBoostLevelFeatures :: GetChatBoostLevelFeatures
defaultGetChatBoostLevelFeatures :: GetChatBoostLevelFeatures
defaultGetChatBoostLevelFeatures =
  GetChatBoostLevelFeatures
    { is_channel :: Maybe Bool
is_channel = Maybe Bool
forall a. Maybe a
Nothing
    , level :: Maybe Int
level      = Maybe Int
forall a. Maybe a
Nothing
    }