module TD.Query.GetLiveStoryTopDonors
  (GetLiveStoryTopDonors(..)
  ) 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 top live story donors. Returns 'TD.Data.LiveStoryDonors.LiveStoryDonors'
data GetLiveStoryTopDonors
  = GetLiveStoryTopDonors
    { GetLiveStoryTopDonors -> Maybe Int
group_call_id :: Maybe Int -- ^ Group call identifier of the live story
    }
  deriving (GetLiveStoryTopDonors -> GetLiveStoryTopDonors -> Bool
(GetLiveStoryTopDonors -> GetLiveStoryTopDonors -> Bool)
-> (GetLiveStoryTopDonors -> GetLiveStoryTopDonors -> Bool)
-> Eq GetLiveStoryTopDonors
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: GetLiveStoryTopDonors -> GetLiveStoryTopDonors -> Bool
== :: GetLiveStoryTopDonors -> GetLiveStoryTopDonors -> Bool
$c/= :: GetLiveStoryTopDonors -> GetLiveStoryTopDonors -> Bool
/= :: GetLiveStoryTopDonors -> GetLiveStoryTopDonors -> Bool
Eq, Int -> GetLiveStoryTopDonors -> ShowS
[GetLiveStoryTopDonors] -> ShowS
GetLiveStoryTopDonors -> String
(Int -> GetLiveStoryTopDonors -> ShowS)
-> (GetLiveStoryTopDonors -> String)
-> ([GetLiveStoryTopDonors] -> ShowS)
-> Show GetLiveStoryTopDonors
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> GetLiveStoryTopDonors -> ShowS
showsPrec :: Int -> GetLiveStoryTopDonors -> ShowS
$cshow :: GetLiveStoryTopDonors -> String
show :: GetLiveStoryTopDonors -> String
$cshowList :: [GetLiveStoryTopDonors] -> ShowS
showList :: [GetLiveStoryTopDonors] -> ShowS
Show)

instance I.ShortShow GetLiveStoryTopDonors where
  shortShow :: GetLiveStoryTopDonors -> String
shortShow
    GetLiveStoryTopDonors
      { group_call_id :: GetLiveStoryTopDonors -> Maybe Int
group_call_id = Maybe Int
group_call_id_
      }
        = String
"GetLiveStoryTopDonors"
          String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
          [ String
"group_call_id" String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
group_call_id_
          ]

instance AT.ToJSON GetLiveStoryTopDonors where
  toJSON :: GetLiveStoryTopDonors -> Value
toJSON
    GetLiveStoryTopDonors
      { group_call_id :: GetLiveStoryTopDonors -> Maybe Int
group_call_id = Maybe Int
group_call_id_
      }
        = [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
"getLiveStoryTopDonors"
          , Key
"group_call_id" Key -> Maybe Int -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe Int
group_call_id_
          ]