module TD.Query.GetTonRevenueStatistics
  (GetTonRevenueStatistics(..)
  ) where

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

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

instance I.ShortShow GetTonRevenueStatistics where
  shortShow :: GetTonRevenueStatistics -> String
shortShow
    GetTonRevenueStatistics
      { is_dark :: GetTonRevenueStatistics -> Maybe Bool
is_dark = Maybe Bool
is_dark_
      }
        = String
"GetTonRevenueStatistics"
          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 GetTonRevenueStatistics where
  toJSON :: GetTonRevenueStatistics -> Value
toJSON
    GetTonRevenueStatistics
      { is_dark :: GetTonRevenueStatistics -> 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
"getTonRevenueStatistics"
          , 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_
          ]