module TD.Query.GetChatBoostFeatures
  (GetChatBoostFeatures(..)
  ) 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 for different chat boost levels; this is an offline request. Returns 'TD.Data.ChatBoostFeatures.ChatBoostFeatures'
data GetChatBoostFeatures
  = GetChatBoostFeatures
    { GetChatBoostFeatures -> 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
    }
  deriving (GetChatBoostFeatures -> GetChatBoostFeatures -> Bool
(GetChatBoostFeatures -> GetChatBoostFeatures -> Bool)
-> (GetChatBoostFeatures -> GetChatBoostFeatures -> Bool)
-> Eq GetChatBoostFeatures
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: GetChatBoostFeatures -> GetChatBoostFeatures -> Bool
== :: GetChatBoostFeatures -> GetChatBoostFeatures -> Bool
$c/= :: GetChatBoostFeatures -> GetChatBoostFeatures -> Bool
/= :: GetChatBoostFeatures -> GetChatBoostFeatures -> Bool
Eq, Int -> GetChatBoostFeatures -> ShowS
[GetChatBoostFeatures] -> ShowS
GetChatBoostFeatures -> String
(Int -> GetChatBoostFeatures -> ShowS)
-> (GetChatBoostFeatures -> String)
-> ([GetChatBoostFeatures] -> ShowS)
-> Show GetChatBoostFeatures
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> GetChatBoostFeatures -> ShowS
showsPrec :: Int -> GetChatBoostFeatures -> ShowS
$cshow :: GetChatBoostFeatures -> String
show :: GetChatBoostFeatures -> String
$cshowList :: [GetChatBoostFeatures] -> ShowS
showList :: [GetChatBoostFeatures] -> ShowS
Show)

instance I.ShortShow GetChatBoostFeatures where
  shortShow :: GetChatBoostFeatures -> String
shortShow
    GetChatBoostFeatures
      { is_channel :: GetChatBoostFeatures -> Maybe Bool
is_channel = Maybe Bool
is_channel_
      }
        = String
"GetChatBoostFeatures"
          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_
          ]

instance AT.ToJSON GetChatBoostFeatures where
  toJSON :: GetChatBoostFeatures -> Value
toJSON
    GetChatBoostFeatures
      { is_channel :: GetChatBoostFeatures -> Maybe Bool
is_channel = Maybe Bool
is_channel_
      }
        = [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
"getChatBoostFeatures"
          , 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_
          ]