module TD.Query.GetGramRevenueStatistics
  (GetGramRevenueStatistics(..)
  ) where

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

-- | Returns detailed TON Gram revenue statistics of the current user. Returns 'TD.Data.GramRevenueStatistics.GramRevenueStatistics'
data GetGramRevenueStatistics
  = GetGramRevenueStatistics
    { GetGramRevenueStatistics -> Maybe Bool
is_dark :: Maybe Bool -- ^ Pass true if a dark theme is used by the application
    }
  deriving (GetGramRevenueStatistics -> GetGramRevenueStatistics -> Bool
(GetGramRevenueStatistics -> GetGramRevenueStatistics -> Bool)
-> (GetGramRevenueStatistics -> GetGramRevenueStatistics -> Bool)
-> Eq GetGramRevenueStatistics
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: GetGramRevenueStatistics -> GetGramRevenueStatistics -> Bool
== :: GetGramRevenueStatistics -> GetGramRevenueStatistics -> Bool
$c/= :: GetGramRevenueStatistics -> GetGramRevenueStatistics -> Bool
/= :: GetGramRevenueStatistics -> GetGramRevenueStatistics -> Bool
Eq, Int -> GetGramRevenueStatistics -> ShowS
[GetGramRevenueStatistics] -> ShowS
GetGramRevenueStatistics -> String
(Int -> GetGramRevenueStatistics -> ShowS)
-> (GetGramRevenueStatistics -> String)
-> ([GetGramRevenueStatistics] -> ShowS)
-> Show GetGramRevenueStatistics
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> GetGramRevenueStatistics -> ShowS
showsPrec :: Int -> GetGramRevenueStatistics -> ShowS
$cshow :: GetGramRevenueStatistics -> String
show :: GetGramRevenueStatistics -> String
$cshowList :: [GetGramRevenueStatistics] -> ShowS
showList :: [GetGramRevenueStatistics] -> ShowS
Show)

instance I.ShortShow GetGramRevenueStatistics where
  shortShow :: GetGramRevenueStatistics -> String
shortShow
    GetGramRevenueStatistics
      { is_dark :: GetGramRevenueStatistics -> Maybe Bool
is_dark = Maybe Bool
is_dark_
      }
        = String
"GetGramRevenueStatistics"
          String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
          [ String
"is_dark" String -> Maybe Bool -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Bool
is_dark_
          ]

instance AT.ToJSON GetGramRevenueStatistics where
  toJSON :: GetGramRevenueStatistics -> Value
toJSON
    GetGramRevenueStatistics
      { is_dark :: GetGramRevenueStatistics -> Maybe Bool
is_dark = Maybe Bool
is_dark_
      }
        = [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
"getGramRevenueStatistics"
          , Key
"is_dark" 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_dark_
          ]