module TD.Query.GetStarRevenueStatistics
  (GetStarRevenueStatistics(..)
  , defaultGetStarRevenueStatistics
  ) 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.MessageSender as MessageSender

-- | Returns detailed Telegram Star revenue statistics. Returns 'TD.Data.StarRevenueStatistics.StarRevenueStatistics'
data GetStarRevenueStatistics
  = GetStarRevenueStatistics
    { GetStarRevenueStatistics -> Maybe MessageSender
owner_id :: Maybe MessageSender.MessageSender -- ^ Identifier of the owner of the Telegram Stars; can be identifier of an owned bot, or identifier of a channel chat with supergroupFullInfo.can_get_star_revenue_statistics == true
    , GetStarRevenueStatistics -> Maybe Bool
is_dark  :: Maybe Bool                        -- ^ Pass true if a dark theme is used by the application
    }
  deriving (GetStarRevenueStatistics -> GetStarRevenueStatistics -> Bool
(GetStarRevenueStatistics -> GetStarRevenueStatistics -> Bool)
-> (GetStarRevenueStatistics -> GetStarRevenueStatistics -> Bool)
-> Eq GetStarRevenueStatistics
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: GetStarRevenueStatistics -> GetStarRevenueStatistics -> Bool
== :: GetStarRevenueStatistics -> GetStarRevenueStatistics -> Bool
$c/= :: GetStarRevenueStatistics -> GetStarRevenueStatistics -> Bool
/= :: GetStarRevenueStatistics -> GetStarRevenueStatistics -> Bool
Eq, Int -> GetStarRevenueStatistics -> ShowS
[GetStarRevenueStatistics] -> ShowS
GetStarRevenueStatistics -> String
(Int -> GetStarRevenueStatistics -> ShowS)
-> (GetStarRevenueStatistics -> String)
-> ([GetStarRevenueStatistics] -> ShowS)
-> Show GetStarRevenueStatistics
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> GetStarRevenueStatistics -> ShowS
showsPrec :: Int -> GetStarRevenueStatistics -> ShowS
$cshow :: GetStarRevenueStatistics -> String
show :: GetStarRevenueStatistics -> String
$cshowList :: [GetStarRevenueStatistics] -> ShowS
showList :: [GetStarRevenueStatistics] -> ShowS
Show)

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

instance AT.ToJSON GetStarRevenueStatistics where
  toJSON :: GetStarRevenueStatistics -> Value
toJSON
    GetStarRevenueStatistics
      { owner_id :: GetStarRevenueStatistics -> Maybe MessageSender
owner_id = Maybe MessageSender
owner_id_
      , is_dark :: GetStarRevenueStatistics -> 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
"getStarRevenueStatistics"
          , Key
"owner_id" Key -> Maybe MessageSender -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe MessageSender
owner_id_
          , 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_
          ]

defaultGetStarRevenueStatistics :: GetStarRevenueStatistics
defaultGetStarRevenueStatistics :: GetStarRevenueStatistics
defaultGetStarRevenueStatistics =
  GetStarRevenueStatistics
    { owner_id :: Maybe MessageSender
owner_id = Maybe MessageSender
forall a. Maybe a
Nothing
    , is_dark :: Maybe Bool
is_dark  = Maybe Bool
forall a. Maybe a
Nothing
    }