module TD.Query.GetGrossingWebAppBots
  (GetGrossingWebAppBots(..)
  , defaultGetGrossingWebAppBots
  ) where

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

-- | Returns the most grossing Web App bots. Returns 'TD.Data.FoundUsers.FoundUsers'
data GetGrossingWebAppBots
  = GetGrossingWebAppBots
    { GetGrossingWebAppBots -> Maybe Text
offset :: Maybe T.Text -- ^ Offset of the first entry to return as received from the previous request; use empty string to get the first chunk of results
    , GetGrossingWebAppBots -> Maybe Int
limit  :: Maybe Int    -- ^ The maximum number of bots to be returned; up to 100
    }
  deriving (GetGrossingWebAppBots -> GetGrossingWebAppBots -> Bool
(GetGrossingWebAppBots -> GetGrossingWebAppBots -> Bool)
-> (GetGrossingWebAppBots -> GetGrossingWebAppBots -> Bool)
-> Eq GetGrossingWebAppBots
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: GetGrossingWebAppBots -> GetGrossingWebAppBots -> Bool
== :: GetGrossingWebAppBots -> GetGrossingWebAppBots -> Bool
$c/= :: GetGrossingWebAppBots -> GetGrossingWebAppBots -> Bool
/= :: GetGrossingWebAppBots -> GetGrossingWebAppBots -> Bool
Eq, Int -> GetGrossingWebAppBots -> ShowS
[GetGrossingWebAppBots] -> ShowS
GetGrossingWebAppBots -> String
(Int -> GetGrossingWebAppBots -> ShowS)
-> (GetGrossingWebAppBots -> String)
-> ([GetGrossingWebAppBots] -> ShowS)
-> Show GetGrossingWebAppBots
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> GetGrossingWebAppBots -> ShowS
showsPrec :: Int -> GetGrossingWebAppBots -> ShowS
$cshow :: GetGrossingWebAppBots -> String
show :: GetGrossingWebAppBots -> String
$cshowList :: [GetGrossingWebAppBots] -> ShowS
showList :: [GetGrossingWebAppBots] -> ShowS
Show)

instance I.ShortShow GetGrossingWebAppBots where
  shortShow :: GetGrossingWebAppBots -> String
shortShow
    GetGrossingWebAppBots
      { offset :: GetGrossingWebAppBots -> Maybe Text
offset = Maybe Text
offset_
      , limit :: GetGrossingWebAppBots -> Maybe Int
limit  = Maybe Int
limit_
      }
        = String
"GetGrossingWebAppBots"
          String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
          [ String
"offset" String -> Maybe Text -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Text
offset_
          , String
"limit"  String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
limit_
          ]

instance AT.ToJSON GetGrossingWebAppBots where
  toJSON :: GetGrossingWebAppBots -> Value
toJSON
    GetGrossingWebAppBots
      { offset :: GetGrossingWebAppBots -> Maybe Text
offset = Maybe Text
offset_
      , limit :: GetGrossingWebAppBots -> Maybe Int
limit  = Maybe Int
limit_
      }
        = [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
"getGrossingWebAppBots"
          , Key
"offset" Key -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe Text
offset_
          , Key
"limit"  Key -> Maybe Int -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe Int
limit_
          ]

defaultGetGrossingWebAppBots :: GetGrossingWebAppBots
defaultGetGrossingWebAppBots :: GetGrossingWebAppBots
defaultGetGrossingWebAppBots =
  GetGrossingWebAppBots
    { offset :: Maybe Text
offset = Maybe Text
forall a. Maybe a
Nothing
    , limit :: Maybe Int
limit  = Maybe Int
forall a. Maybe a
Nothing
    }