module TD.Query.GetBusinessAccountStarAmount
  (GetBusinessAccountStarAmount(..)
  ) 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 amount of Telegram Stars owned by a business account; for bots only. Returns 'TD.Data.StarAmount.StarAmount'
data GetBusinessAccountStarAmount
  = GetBusinessAccountStarAmount
    { GetBusinessAccountStarAmount -> Maybe Text
business_connection_id :: Maybe T.Text -- ^ Unique identifier of business connection
    }
  deriving (GetBusinessAccountStarAmount
-> GetBusinessAccountStarAmount -> Bool
(GetBusinessAccountStarAmount
 -> GetBusinessAccountStarAmount -> Bool)
-> (GetBusinessAccountStarAmount
    -> GetBusinessAccountStarAmount -> Bool)
-> Eq GetBusinessAccountStarAmount
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: GetBusinessAccountStarAmount
-> GetBusinessAccountStarAmount -> Bool
== :: GetBusinessAccountStarAmount
-> GetBusinessAccountStarAmount -> Bool
$c/= :: GetBusinessAccountStarAmount
-> GetBusinessAccountStarAmount -> Bool
/= :: GetBusinessAccountStarAmount
-> GetBusinessAccountStarAmount -> Bool
Eq, Int -> GetBusinessAccountStarAmount -> ShowS
[GetBusinessAccountStarAmount] -> ShowS
GetBusinessAccountStarAmount -> String
(Int -> GetBusinessAccountStarAmount -> ShowS)
-> (GetBusinessAccountStarAmount -> String)
-> ([GetBusinessAccountStarAmount] -> ShowS)
-> Show GetBusinessAccountStarAmount
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> GetBusinessAccountStarAmount -> ShowS
showsPrec :: Int -> GetBusinessAccountStarAmount -> ShowS
$cshow :: GetBusinessAccountStarAmount -> String
show :: GetBusinessAccountStarAmount -> String
$cshowList :: [GetBusinessAccountStarAmount] -> ShowS
showList :: [GetBusinessAccountStarAmount] -> ShowS
Show)

instance I.ShortShow GetBusinessAccountStarAmount where
  shortShow :: GetBusinessAccountStarAmount -> String
shortShow
    GetBusinessAccountStarAmount
      { business_connection_id :: GetBusinessAccountStarAmount -> Maybe Text
business_connection_id = Maybe Text
business_connection_id_
      }
        = String
"GetBusinessAccountStarAmount"
          String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
          [ String
"business_connection_id" String -> Maybe Text -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Text
business_connection_id_
          ]

instance AT.ToJSON GetBusinessAccountStarAmount where
  toJSON :: GetBusinessAccountStarAmount -> Value
toJSON
    GetBusinessAccountStarAmount
      { business_connection_id :: GetBusinessAccountStarAmount -> Maybe Text
business_connection_id = Maybe Text
business_connection_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
"getBusinessAccountStarAmount"
          , Key
"business_connection_id" Key -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Maybe Text
business_connection_id_
          ]