module TD.Data.StarTransactionType
(StarTransactionType(..)) 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.Sticker as Sticker
import qualified TD.Data.RevenueWithdrawalState as RevenueWithdrawalState
import qualified TD.Data.PaidMedia as PaidMedia
import qualified Data.Text as T
import qualified TD.Data.AffiliateInfo as AffiliateInfo
import qualified TD.Data.ProductInfo as ProductInfo
import qualified Data.ByteString as BS
import qualified TD.Data.Gift as Gift
import qualified TD.Data.UpgradedGift as UpgradedGift
data StarTransactionType
= StarTransactionTypePremiumBotDeposit
| StarTransactionTypeAppStoreDeposit
| StarTransactionTypeGooglePlayDeposit
| StarTransactionTypeFragmentDeposit
| StarTransactionTypeUserDeposit
{ StarTransactionType -> Maybe Int
user_id :: Maybe Int
, StarTransactionType -> Maybe Sticker
sticker :: Maybe Sticker.Sticker
}
| StarTransactionTypeGiveawayDeposit
{ StarTransactionType -> Maybe Int
chat_id :: Maybe Int
, StarTransactionType -> Maybe Int
giveaway_message_id :: Maybe Int
}
| StarTransactionTypeFragmentWithdrawal
{ StarTransactionType -> Maybe RevenueWithdrawalState
withdrawal_state :: Maybe RevenueWithdrawalState.RevenueWithdrawalState
}
| StarTransactionTypeTelegramAdsWithdrawal
| StarTransactionTypeTelegramApiUsage
{ StarTransactionType -> Maybe Int
request_count :: Maybe Int
}
| StarTransactionTypeBotPaidMediaPurchase
{ user_id :: Maybe Int
, StarTransactionType -> Maybe [PaidMedia]
media :: Maybe [PaidMedia.PaidMedia]
}
| StarTransactionTypeBotPaidMediaSale
{ user_id :: Maybe Int
, media :: Maybe [PaidMedia.PaidMedia]
, StarTransactionType -> Maybe Text
payload :: Maybe T.Text
, StarTransactionType -> Maybe AffiliateInfo
affiliate :: Maybe AffiliateInfo.AffiliateInfo
}
| StarTransactionTypeChannelPaidMediaPurchase
{ chat_id :: Maybe Int
, StarTransactionType -> Maybe Int
message_id :: Maybe Int
, media :: Maybe [PaidMedia.PaidMedia]
}
| StarTransactionTypeChannelPaidMediaSale
{ user_id :: Maybe Int
, message_id :: Maybe Int
, media :: Maybe [PaidMedia.PaidMedia]
}
| StarTransactionTypeBotInvoicePurchase
{ user_id :: Maybe Int
, StarTransactionType -> Maybe ProductInfo
product_info :: Maybe ProductInfo.ProductInfo
}
| StarTransactionTypeBotInvoiceSale
{ user_id :: Maybe Int
, product_info :: Maybe ProductInfo.ProductInfo
, StarTransactionType -> Maybe ByteString
invoice_payload :: Maybe BS.ByteString
, affiliate :: Maybe AffiliateInfo.AffiliateInfo
}
| StarTransactionTypeBotSubscriptionPurchase
{ user_id :: Maybe Int
, StarTransactionType -> Maybe Int
subscription_period :: Maybe Int
, product_info :: Maybe ProductInfo.ProductInfo
}
| StarTransactionTypeBotSubscriptionSale
{ user_id :: Maybe Int
, subscription_period :: Maybe Int
, product_info :: Maybe ProductInfo.ProductInfo
, invoice_payload :: Maybe BS.ByteString
, affiliate :: Maybe AffiliateInfo.AffiliateInfo
}
| StarTransactionTypeChannelSubscriptionPurchase
{ chat_id :: Maybe Int
, subscription_period :: Maybe Int
}
| StarTransactionTypeChannelSubscriptionSale
{ user_id :: Maybe Int
, subscription_period :: Maybe Int
}
| StarTransactionTypeGiftPurchase
{ user_id :: Maybe Int
, StarTransactionType -> Maybe Gift
gift :: Maybe Gift.Gift
}
| StarTransactionTypeGiftTransfer
{ user_id :: Maybe Int
, StarTransactionType -> Maybe UpgradedGift
_gift :: Maybe UpgradedGift.UpgradedGift
}
| StarTransactionTypeGiftSale
{ user_id :: Maybe Int
, gift :: Maybe Gift.Gift
}
| StarTransactionTypeGiftUpgrade
{ _gift :: Maybe UpgradedGift.UpgradedGift
}
| StarTransactionTypeChannelPaidReactionSend
{ chat_id :: Maybe Int
, message_id :: Maybe Int
}
| StarTransactionTypeChannelPaidReactionReceive
{ user_id :: Maybe Int
, message_id :: Maybe Int
}
| StarTransactionTypeAffiliateProgramCommission
{ chat_id :: Maybe Int
, StarTransactionType -> Maybe Int
commission_per_mille :: Maybe Int
}
| StarTransactionTypeUnsupported
deriving (StarTransactionType -> StarTransactionType -> Bool
(StarTransactionType -> StarTransactionType -> Bool)
-> (StarTransactionType -> StarTransactionType -> Bool)
-> Eq StarTransactionType
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: StarTransactionType -> StarTransactionType -> Bool
== :: StarTransactionType -> StarTransactionType -> Bool
$c/= :: StarTransactionType -> StarTransactionType -> Bool
/= :: StarTransactionType -> StarTransactionType -> Bool
Eq, Int -> StarTransactionType -> ShowS
[StarTransactionType] -> ShowS
StarTransactionType -> String
(Int -> StarTransactionType -> ShowS)
-> (StarTransactionType -> String)
-> ([StarTransactionType] -> ShowS)
-> Show StarTransactionType
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> StarTransactionType -> ShowS
showsPrec :: Int -> StarTransactionType -> ShowS
$cshow :: StarTransactionType -> String
show :: StarTransactionType -> String
$cshowList :: [StarTransactionType] -> ShowS
showList :: [StarTransactionType] -> ShowS
Show)
instance I.ShortShow StarTransactionType where
shortShow :: StarTransactionType -> String
shortShow StarTransactionType
StarTransactionTypePremiumBotDeposit
= String
"StarTransactionTypePremiumBotDeposit"
shortShow StarTransactionType
StarTransactionTypeAppStoreDeposit
= String
"StarTransactionTypeAppStoreDeposit"
shortShow StarTransactionType
StarTransactionTypeGooglePlayDeposit
= String
"StarTransactionTypeGooglePlayDeposit"
shortShow StarTransactionType
StarTransactionTypeFragmentDeposit
= String
"StarTransactionTypeFragmentDeposit"
shortShow StarTransactionTypeUserDeposit
{ user_id :: StarTransactionType -> Maybe Int
user_id = Maybe Int
user_id_
, sticker :: StarTransactionType -> Maybe Sticker
sticker = Maybe Sticker
sticker_
}
= String
"StarTransactionTypeUserDeposit"
String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
[ String
"user_id" String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
user_id_
, String
"sticker" String -> Maybe Sticker -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Sticker
sticker_
]
shortShow StarTransactionTypeGiveawayDeposit
{ chat_id :: StarTransactionType -> Maybe Int
chat_id = Maybe Int
chat_id_
, giveaway_message_id :: StarTransactionType -> Maybe Int
giveaway_message_id = Maybe Int
giveaway_message_id_
}
= String
"StarTransactionTypeGiveawayDeposit"
String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
[ String
"chat_id" String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
chat_id_
, String
"giveaway_message_id" String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
giveaway_message_id_
]
shortShow StarTransactionTypeFragmentWithdrawal
{ withdrawal_state :: StarTransactionType -> Maybe RevenueWithdrawalState
withdrawal_state = Maybe RevenueWithdrawalState
withdrawal_state_
}
= String
"StarTransactionTypeFragmentWithdrawal"
String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
[ String
"withdrawal_state" String -> Maybe RevenueWithdrawalState -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe RevenueWithdrawalState
withdrawal_state_
]
shortShow StarTransactionType
StarTransactionTypeTelegramAdsWithdrawal
= String
"StarTransactionTypeTelegramAdsWithdrawal"
shortShow StarTransactionTypeTelegramApiUsage
{ request_count :: StarTransactionType -> Maybe Int
request_count = Maybe Int
request_count_
}
= String
"StarTransactionTypeTelegramApiUsage"
String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
[ String
"request_count" String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
request_count_
]
shortShow StarTransactionTypeBotPaidMediaPurchase
{ user_id :: StarTransactionType -> Maybe Int
user_id = Maybe Int
user_id_
, media :: StarTransactionType -> Maybe [PaidMedia]
media = Maybe [PaidMedia]
media_
}
= String
"StarTransactionTypeBotPaidMediaPurchase"
String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
[ String
"user_id" String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
user_id_
, String
"media" String -> Maybe [PaidMedia] -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe [PaidMedia]
media_
]
shortShow StarTransactionTypeBotPaidMediaSale
{ user_id :: StarTransactionType -> Maybe Int
user_id = Maybe Int
user_id_
, media :: StarTransactionType -> Maybe [PaidMedia]
media = Maybe [PaidMedia]
media_
, payload :: StarTransactionType -> Maybe Text
payload = Maybe Text
payload_
, affiliate :: StarTransactionType -> Maybe AffiliateInfo
affiliate = Maybe AffiliateInfo
affiliate_
}
= String
"StarTransactionTypeBotPaidMediaSale"
String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
[ String
"user_id" String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
user_id_
, String
"media" String -> Maybe [PaidMedia] -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe [PaidMedia]
media_
, String
"payload" String -> Maybe Text -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Text
payload_
, String
"affiliate" String -> Maybe AffiliateInfo -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe AffiliateInfo
affiliate_
]
shortShow StarTransactionTypeChannelPaidMediaPurchase
{ chat_id :: StarTransactionType -> Maybe Int
chat_id = Maybe Int
chat_id_
, message_id :: StarTransactionType -> Maybe Int
message_id = Maybe Int
message_id_
, media :: StarTransactionType -> Maybe [PaidMedia]
media = Maybe [PaidMedia]
media_
}
= String
"StarTransactionTypeChannelPaidMediaPurchase"
String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
[ String
"chat_id" String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
chat_id_
, String
"message_id" String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
message_id_
, String
"media" String -> Maybe [PaidMedia] -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe [PaidMedia]
media_
]
shortShow StarTransactionTypeChannelPaidMediaSale
{ user_id :: StarTransactionType -> Maybe Int
user_id = Maybe Int
user_id_
, message_id :: StarTransactionType -> Maybe Int
message_id = Maybe Int
message_id_
, media :: StarTransactionType -> Maybe [PaidMedia]
media = Maybe [PaidMedia]
media_
}
= String
"StarTransactionTypeChannelPaidMediaSale"
String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
[ String
"user_id" String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
user_id_
, String
"message_id" String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
message_id_
, String
"media" String -> Maybe [PaidMedia] -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe [PaidMedia]
media_
]
shortShow StarTransactionTypeBotInvoicePurchase
{ user_id :: StarTransactionType -> Maybe Int
user_id = Maybe Int
user_id_
, product_info :: StarTransactionType -> Maybe ProductInfo
product_info = Maybe ProductInfo
product_info_
}
= String
"StarTransactionTypeBotInvoicePurchase"
String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
[ String
"user_id" String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
user_id_
, String
"product_info" String -> Maybe ProductInfo -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe ProductInfo
product_info_
]
shortShow StarTransactionTypeBotInvoiceSale
{ user_id :: StarTransactionType -> Maybe Int
user_id = Maybe Int
user_id_
, product_info :: StarTransactionType -> Maybe ProductInfo
product_info = Maybe ProductInfo
product_info_
, invoice_payload :: StarTransactionType -> Maybe ByteString
invoice_payload = Maybe ByteString
invoice_payload_
, affiliate :: StarTransactionType -> Maybe AffiliateInfo
affiliate = Maybe AffiliateInfo
affiliate_
}
= String
"StarTransactionTypeBotInvoiceSale"
String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
[ String
"user_id" String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
user_id_
, String
"product_info" String -> Maybe ProductInfo -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe ProductInfo
product_info_
, String
"invoice_payload" String -> Maybe ByteString -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe ByteString
invoice_payload_
, String
"affiliate" String -> Maybe AffiliateInfo -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe AffiliateInfo
affiliate_
]
shortShow StarTransactionTypeBotSubscriptionPurchase
{ user_id :: StarTransactionType -> Maybe Int
user_id = Maybe Int
user_id_
, subscription_period :: StarTransactionType -> Maybe Int
subscription_period = Maybe Int
subscription_period_
, product_info :: StarTransactionType -> Maybe ProductInfo
product_info = Maybe ProductInfo
product_info_
}
= String
"StarTransactionTypeBotSubscriptionPurchase"
String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
[ String
"user_id" String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
user_id_
, String
"subscription_period" String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
subscription_period_
, String
"product_info" String -> Maybe ProductInfo -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe ProductInfo
product_info_
]
shortShow StarTransactionTypeBotSubscriptionSale
{ user_id :: StarTransactionType -> Maybe Int
user_id = Maybe Int
user_id_
, subscription_period :: StarTransactionType -> Maybe Int
subscription_period = Maybe Int
subscription_period_
, product_info :: StarTransactionType -> Maybe ProductInfo
product_info = Maybe ProductInfo
product_info_
, invoice_payload :: StarTransactionType -> Maybe ByteString
invoice_payload = Maybe ByteString
invoice_payload_
, affiliate :: StarTransactionType -> Maybe AffiliateInfo
affiliate = Maybe AffiliateInfo
affiliate_
}
= String
"StarTransactionTypeBotSubscriptionSale"
String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
[ String
"user_id" String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
user_id_
, String
"subscription_period" String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
subscription_period_
, String
"product_info" String -> Maybe ProductInfo -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe ProductInfo
product_info_
, String
"invoice_payload" String -> Maybe ByteString -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe ByteString
invoice_payload_
, String
"affiliate" String -> Maybe AffiliateInfo -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe AffiliateInfo
affiliate_
]
shortShow StarTransactionTypeChannelSubscriptionPurchase
{ chat_id :: StarTransactionType -> Maybe Int
chat_id = Maybe Int
chat_id_
, subscription_period :: StarTransactionType -> Maybe Int
subscription_period = Maybe Int
subscription_period_
}
= String
"StarTransactionTypeChannelSubscriptionPurchase"
String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
[ String
"chat_id" String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
chat_id_
, String
"subscription_period" String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
subscription_period_
]
shortShow StarTransactionTypeChannelSubscriptionSale
{ user_id :: StarTransactionType -> Maybe Int
user_id = Maybe Int
user_id_
, subscription_period :: StarTransactionType -> Maybe Int
subscription_period = Maybe Int
subscription_period_
}
= String
"StarTransactionTypeChannelSubscriptionSale"
String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
[ String
"user_id" String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
user_id_
, String
"subscription_period" String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
subscription_period_
]
shortShow StarTransactionTypeGiftPurchase
{ user_id :: StarTransactionType -> Maybe Int
user_id = Maybe Int
user_id_
, gift :: StarTransactionType -> Maybe Gift
gift = Maybe Gift
gift_
}
= String
"StarTransactionTypeGiftPurchase"
String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
[ String
"user_id" String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
user_id_
, String
"gift" String -> Maybe Gift -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Gift
gift_
]
shortShow StarTransactionTypeGiftTransfer
{ user_id :: StarTransactionType -> Maybe Int
user_id = Maybe Int
user_id_
, _gift :: StarTransactionType -> Maybe UpgradedGift
_gift = Maybe UpgradedGift
_gift_
}
= String
"StarTransactionTypeGiftTransfer"
String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
[ String
"user_id" String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
user_id_
, String
"_gift" String -> Maybe UpgradedGift -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe UpgradedGift
_gift_
]
shortShow StarTransactionTypeGiftSale
{ user_id :: StarTransactionType -> Maybe Int
user_id = Maybe Int
user_id_
, gift :: StarTransactionType -> Maybe Gift
gift = Maybe Gift
gift_
}
= String
"StarTransactionTypeGiftSale"
String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
[ String
"user_id" String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
user_id_
, String
"gift" String -> Maybe Gift -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Gift
gift_
]
shortShow StarTransactionTypeGiftUpgrade
{ _gift :: StarTransactionType -> Maybe UpgradedGift
_gift = Maybe UpgradedGift
_gift_
}
= String
"StarTransactionTypeGiftUpgrade"
String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
[ String
"_gift" String -> Maybe UpgradedGift -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe UpgradedGift
_gift_
]
shortShow StarTransactionTypeChannelPaidReactionSend
{ chat_id :: StarTransactionType -> Maybe Int
chat_id = Maybe Int
chat_id_
, message_id :: StarTransactionType -> Maybe Int
message_id = Maybe Int
message_id_
}
= String
"StarTransactionTypeChannelPaidReactionSend"
String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
[ String
"chat_id" String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
chat_id_
, String
"message_id" String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
message_id_
]
shortShow StarTransactionTypeChannelPaidReactionReceive
{ user_id :: StarTransactionType -> Maybe Int
user_id = Maybe Int
user_id_
, message_id :: StarTransactionType -> Maybe Int
message_id = Maybe Int
message_id_
}
= String
"StarTransactionTypeChannelPaidReactionReceive"
String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
[ String
"user_id" String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
user_id_
, String
"message_id" String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
message_id_
]
shortShow StarTransactionTypeAffiliateProgramCommission
{ chat_id :: StarTransactionType -> Maybe Int
chat_id = Maybe Int
chat_id_
, commission_per_mille :: StarTransactionType -> Maybe Int
commission_per_mille = Maybe Int
commission_per_mille_
}
= String
"StarTransactionTypeAffiliateProgramCommission"
String -> ShowS
forall a. [a] -> [a] -> [a]
++ [String] -> String
I.cc
[ String
"chat_id" String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
chat_id_
, String
"commission_per_mille" String -> Maybe Int -> String
forall a. ShortShow a => String -> Maybe a -> String
`I.p` Maybe Int
commission_per_mille_
]
shortShow StarTransactionType
StarTransactionTypeUnsupported
= String
"StarTransactionTypeUnsupported"
instance AT.FromJSON StarTransactionType where
parseJSON :: Value -> Parser StarTransactionType
parseJSON v :: Value
v@(AT.Object Object
obj) = do
String
t <- Object
obj Object -> Key -> Parser String
forall a. FromJSON a => Object -> Key -> Parser a
A..: Key
"@type" :: AT.Parser String
case String
t of
String
"starTransactionTypePremiumBotDeposit" -> StarTransactionType -> Parser StarTransactionType
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure StarTransactionType
StarTransactionTypePremiumBotDeposit
String
"starTransactionTypeAppStoreDeposit" -> StarTransactionType -> Parser StarTransactionType
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure StarTransactionType
StarTransactionTypeAppStoreDeposit
String
"starTransactionTypeGooglePlayDeposit" -> StarTransactionType -> Parser StarTransactionType
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure StarTransactionType
StarTransactionTypeGooglePlayDeposit
String
"starTransactionTypeFragmentDeposit" -> StarTransactionType -> Parser StarTransactionType
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure StarTransactionType
StarTransactionTypeFragmentDeposit
String
"starTransactionTypeUserDeposit" -> Value -> Parser StarTransactionType
parseStarTransactionTypeUserDeposit Value
v
String
"starTransactionTypeGiveawayDeposit" -> Value -> Parser StarTransactionType
parseStarTransactionTypeGiveawayDeposit Value
v
String
"starTransactionTypeFragmentWithdrawal" -> Value -> Parser StarTransactionType
parseStarTransactionTypeFragmentWithdrawal Value
v
String
"starTransactionTypeTelegramAdsWithdrawal" -> StarTransactionType -> Parser StarTransactionType
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure StarTransactionType
StarTransactionTypeTelegramAdsWithdrawal
String
"starTransactionTypeTelegramApiUsage" -> Value -> Parser StarTransactionType
parseStarTransactionTypeTelegramApiUsage Value
v
String
"starTransactionTypeBotPaidMediaPurchase" -> Value -> Parser StarTransactionType
parseStarTransactionTypeBotPaidMediaPurchase Value
v
String
"starTransactionTypeBotPaidMediaSale" -> Value -> Parser StarTransactionType
parseStarTransactionTypeBotPaidMediaSale Value
v
String
"starTransactionTypeChannelPaidMediaPurchase" -> Value -> Parser StarTransactionType
parseStarTransactionTypeChannelPaidMediaPurchase Value
v
String
"starTransactionTypeChannelPaidMediaSale" -> Value -> Parser StarTransactionType
parseStarTransactionTypeChannelPaidMediaSale Value
v
String
"starTransactionTypeBotInvoicePurchase" -> Value -> Parser StarTransactionType
parseStarTransactionTypeBotInvoicePurchase Value
v
String
"starTransactionTypeBotInvoiceSale" -> Value -> Parser StarTransactionType
parseStarTransactionTypeBotInvoiceSale Value
v
String
"starTransactionTypeBotSubscriptionPurchase" -> Value -> Parser StarTransactionType
parseStarTransactionTypeBotSubscriptionPurchase Value
v
String
"starTransactionTypeBotSubscriptionSale" -> Value -> Parser StarTransactionType
parseStarTransactionTypeBotSubscriptionSale Value
v
String
"starTransactionTypeChannelSubscriptionPurchase" -> Value -> Parser StarTransactionType
parseStarTransactionTypeChannelSubscriptionPurchase Value
v
String
"starTransactionTypeChannelSubscriptionSale" -> Value -> Parser StarTransactionType
parseStarTransactionTypeChannelSubscriptionSale Value
v
String
"starTransactionTypeGiftPurchase" -> Value -> Parser StarTransactionType
parseStarTransactionTypeGiftPurchase Value
v
String
"starTransactionTypeGiftTransfer" -> Value -> Parser StarTransactionType
parseStarTransactionTypeGiftTransfer Value
v
String
"starTransactionTypeGiftSale" -> Value -> Parser StarTransactionType
parseStarTransactionTypeGiftSale Value
v
String
"starTransactionTypeGiftUpgrade" -> Value -> Parser StarTransactionType
parseStarTransactionTypeGiftUpgrade Value
v
String
"starTransactionTypeChannelPaidReactionSend" -> Value -> Parser StarTransactionType
parseStarTransactionTypeChannelPaidReactionSend Value
v
String
"starTransactionTypeChannelPaidReactionReceive" -> Value -> Parser StarTransactionType
parseStarTransactionTypeChannelPaidReactionReceive Value
v
String
"starTransactionTypeAffiliateProgramCommission" -> Value -> Parser StarTransactionType
parseStarTransactionTypeAffiliateProgramCommission Value
v
String
"starTransactionTypeUnsupported" -> StarTransactionType -> Parser StarTransactionType
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure StarTransactionType
StarTransactionTypeUnsupported
String
_ -> Parser StarTransactionType
forall a. Monoid a => a
mempty
where
parseStarTransactionTypeUserDeposit :: A.Value -> AT.Parser StarTransactionType
parseStarTransactionTypeUserDeposit :: Value -> Parser StarTransactionType
parseStarTransactionTypeUserDeposit = String
-> (Object -> Parser StarTransactionType)
-> Value
-> Parser StarTransactionType
forall a. String -> (Object -> Parser a) -> Value -> Parser a
A.withObject String
"StarTransactionTypeUserDeposit" ((Object -> Parser StarTransactionType)
-> Value -> Parser StarTransactionType)
-> (Object -> Parser StarTransactionType)
-> Value
-> Parser StarTransactionType
forall a b. (a -> b) -> a -> b
$ \Object
o -> do
Maybe Int
user_id_ <- Object
o Object -> Key -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"user_id"
Maybe Sticker
sticker_ <- Object
o Object -> Key -> Parser (Maybe Sticker)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"sticker"
StarTransactionType -> Parser StarTransactionType
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (StarTransactionType -> Parser StarTransactionType)
-> StarTransactionType -> Parser StarTransactionType
forall a b. (a -> b) -> a -> b
$ StarTransactionTypeUserDeposit
{ user_id :: Maybe Int
user_id = Maybe Int
user_id_
, sticker :: Maybe Sticker
sticker = Maybe Sticker
sticker_
}
parseStarTransactionTypeGiveawayDeposit :: A.Value -> AT.Parser StarTransactionType
parseStarTransactionTypeGiveawayDeposit :: Value -> Parser StarTransactionType
parseStarTransactionTypeGiveawayDeposit = String
-> (Object -> Parser StarTransactionType)
-> Value
-> Parser StarTransactionType
forall a. String -> (Object -> Parser a) -> Value -> Parser a
A.withObject String
"StarTransactionTypeGiveawayDeposit" ((Object -> Parser StarTransactionType)
-> Value -> Parser StarTransactionType)
-> (Object -> Parser StarTransactionType)
-> Value
-> Parser StarTransactionType
forall a b. (a -> b) -> a -> b
$ \Object
o -> do
Maybe Int
chat_id_ <- Object
o Object -> Key -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"chat_id"
Maybe Int
giveaway_message_id_ <- Object
o Object -> Key -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"giveaway_message_id"
StarTransactionType -> Parser StarTransactionType
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (StarTransactionType -> Parser StarTransactionType)
-> StarTransactionType -> Parser StarTransactionType
forall a b. (a -> b) -> a -> b
$ StarTransactionTypeGiveawayDeposit
{ chat_id :: Maybe Int
chat_id = Maybe Int
chat_id_
, giveaway_message_id :: Maybe Int
giveaway_message_id = Maybe Int
giveaway_message_id_
}
parseStarTransactionTypeFragmentWithdrawal :: A.Value -> AT.Parser StarTransactionType
parseStarTransactionTypeFragmentWithdrawal :: Value -> Parser StarTransactionType
parseStarTransactionTypeFragmentWithdrawal = String
-> (Object -> Parser StarTransactionType)
-> Value
-> Parser StarTransactionType
forall a. String -> (Object -> Parser a) -> Value -> Parser a
A.withObject String
"StarTransactionTypeFragmentWithdrawal" ((Object -> Parser StarTransactionType)
-> Value -> Parser StarTransactionType)
-> (Object -> Parser StarTransactionType)
-> Value
-> Parser StarTransactionType
forall a b. (a -> b) -> a -> b
$ \Object
o -> do
Maybe RevenueWithdrawalState
withdrawal_state_ <- Object
o Object -> Key -> Parser (Maybe RevenueWithdrawalState)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"withdrawal_state"
StarTransactionType -> Parser StarTransactionType
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (StarTransactionType -> Parser StarTransactionType)
-> StarTransactionType -> Parser StarTransactionType
forall a b. (a -> b) -> a -> b
$ StarTransactionTypeFragmentWithdrawal
{ withdrawal_state :: Maybe RevenueWithdrawalState
withdrawal_state = Maybe RevenueWithdrawalState
withdrawal_state_
}
parseStarTransactionTypeTelegramApiUsage :: A.Value -> AT.Parser StarTransactionType
parseStarTransactionTypeTelegramApiUsage :: Value -> Parser StarTransactionType
parseStarTransactionTypeTelegramApiUsage = String
-> (Object -> Parser StarTransactionType)
-> Value
-> Parser StarTransactionType
forall a. String -> (Object -> Parser a) -> Value -> Parser a
A.withObject String
"StarTransactionTypeTelegramApiUsage" ((Object -> Parser StarTransactionType)
-> Value -> Parser StarTransactionType)
-> (Object -> Parser StarTransactionType)
-> Value
-> Parser StarTransactionType
forall a b. (a -> b) -> a -> b
$ \Object
o -> do
Maybe Int
request_count_ <- Object
o Object -> Key -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"request_count"
StarTransactionType -> Parser StarTransactionType
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (StarTransactionType -> Parser StarTransactionType)
-> StarTransactionType -> Parser StarTransactionType
forall a b. (a -> b) -> a -> b
$ StarTransactionTypeTelegramApiUsage
{ request_count :: Maybe Int
request_count = Maybe Int
request_count_
}
parseStarTransactionTypeBotPaidMediaPurchase :: A.Value -> AT.Parser StarTransactionType
parseStarTransactionTypeBotPaidMediaPurchase :: Value -> Parser StarTransactionType
parseStarTransactionTypeBotPaidMediaPurchase = String
-> (Object -> Parser StarTransactionType)
-> Value
-> Parser StarTransactionType
forall a. String -> (Object -> Parser a) -> Value -> Parser a
A.withObject String
"StarTransactionTypeBotPaidMediaPurchase" ((Object -> Parser StarTransactionType)
-> Value -> Parser StarTransactionType)
-> (Object -> Parser StarTransactionType)
-> Value
-> Parser StarTransactionType
forall a b. (a -> b) -> a -> b
$ \Object
o -> do
Maybe Int
user_id_ <- Object
o Object -> Key -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"user_id"
Maybe [PaidMedia]
media_ <- Object
o Object -> Key -> Parser (Maybe [PaidMedia])
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"media"
StarTransactionType -> Parser StarTransactionType
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (StarTransactionType -> Parser StarTransactionType)
-> StarTransactionType -> Parser StarTransactionType
forall a b. (a -> b) -> a -> b
$ StarTransactionTypeBotPaidMediaPurchase
{ user_id :: Maybe Int
user_id = Maybe Int
user_id_
, media :: Maybe [PaidMedia]
media = Maybe [PaidMedia]
media_
}
parseStarTransactionTypeBotPaidMediaSale :: A.Value -> AT.Parser StarTransactionType
parseStarTransactionTypeBotPaidMediaSale :: Value -> Parser StarTransactionType
parseStarTransactionTypeBotPaidMediaSale = String
-> (Object -> Parser StarTransactionType)
-> Value
-> Parser StarTransactionType
forall a. String -> (Object -> Parser a) -> Value -> Parser a
A.withObject String
"StarTransactionTypeBotPaidMediaSale" ((Object -> Parser StarTransactionType)
-> Value -> Parser StarTransactionType)
-> (Object -> Parser StarTransactionType)
-> Value
-> Parser StarTransactionType
forall a b. (a -> b) -> a -> b
$ \Object
o -> do
Maybe Int
user_id_ <- Object
o Object -> Key -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"user_id"
Maybe [PaidMedia]
media_ <- Object
o Object -> Key -> Parser (Maybe [PaidMedia])
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"media"
Maybe Text
payload_ <- Object
o Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"payload"
Maybe AffiliateInfo
affiliate_ <- Object
o Object -> Key -> Parser (Maybe AffiliateInfo)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"affiliate"
StarTransactionType -> Parser StarTransactionType
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (StarTransactionType -> Parser StarTransactionType)
-> StarTransactionType -> Parser StarTransactionType
forall a b. (a -> b) -> a -> b
$ StarTransactionTypeBotPaidMediaSale
{ user_id :: Maybe Int
user_id = Maybe Int
user_id_
, media :: Maybe [PaidMedia]
media = Maybe [PaidMedia]
media_
, payload :: Maybe Text
payload = Maybe Text
payload_
, affiliate :: Maybe AffiliateInfo
affiliate = Maybe AffiliateInfo
affiliate_
}
parseStarTransactionTypeChannelPaidMediaPurchase :: A.Value -> AT.Parser StarTransactionType
parseStarTransactionTypeChannelPaidMediaPurchase :: Value -> Parser StarTransactionType
parseStarTransactionTypeChannelPaidMediaPurchase = String
-> (Object -> Parser StarTransactionType)
-> Value
-> Parser StarTransactionType
forall a. String -> (Object -> Parser a) -> Value -> Parser a
A.withObject String
"StarTransactionTypeChannelPaidMediaPurchase" ((Object -> Parser StarTransactionType)
-> Value -> Parser StarTransactionType)
-> (Object -> Parser StarTransactionType)
-> Value
-> Parser StarTransactionType
forall a b. (a -> b) -> a -> b
$ \Object
o -> do
Maybe Int
chat_id_ <- Object
o Object -> Key -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"chat_id"
Maybe Int
message_id_ <- Object
o Object -> Key -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"message_id"
Maybe [PaidMedia]
media_ <- Object
o Object -> Key -> Parser (Maybe [PaidMedia])
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"media"
StarTransactionType -> Parser StarTransactionType
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (StarTransactionType -> Parser StarTransactionType)
-> StarTransactionType -> Parser StarTransactionType
forall a b. (a -> b) -> a -> b
$ StarTransactionTypeChannelPaidMediaPurchase
{ chat_id :: Maybe Int
chat_id = Maybe Int
chat_id_
, message_id :: Maybe Int
message_id = Maybe Int
message_id_
, media :: Maybe [PaidMedia]
media = Maybe [PaidMedia]
media_
}
parseStarTransactionTypeChannelPaidMediaSale :: A.Value -> AT.Parser StarTransactionType
parseStarTransactionTypeChannelPaidMediaSale :: Value -> Parser StarTransactionType
parseStarTransactionTypeChannelPaidMediaSale = String
-> (Object -> Parser StarTransactionType)
-> Value
-> Parser StarTransactionType
forall a. String -> (Object -> Parser a) -> Value -> Parser a
A.withObject String
"StarTransactionTypeChannelPaidMediaSale" ((Object -> Parser StarTransactionType)
-> Value -> Parser StarTransactionType)
-> (Object -> Parser StarTransactionType)
-> Value
-> Parser StarTransactionType
forall a b. (a -> b) -> a -> b
$ \Object
o -> do
Maybe Int
user_id_ <- Object
o Object -> Key -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"user_id"
Maybe Int
message_id_ <- Object
o Object -> Key -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"message_id"
Maybe [PaidMedia]
media_ <- Object
o Object -> Key -> Parser (Maybe [PaidMedia])
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"media"
StarTransactionType -> Parser StarTransactionType
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (StarTransactionType -> Parser StarTransactionType)
-> StarTransactionType -> Parser StarTransactionType
forall a b. (a -> b) -> a -> b
$ StarTransactionTypeChannelPaidMediaSale
{ user_id :: Maybe Int
user_id = Maybe Int
user_id_
, message_id :: Maybe Int
message_id = Maybe Int
message_id_
, media :: Maybe [PaidMedia]
media = Maybe [PaidMedia]
media_
}
parseStarTransactionTypeBotInvoicePurchase :: A.Value -> AT.Parser StarTransactionType
parseStarTransactionTypeBotInvoicePurchase :: Value -> Parser StarTransactionType
parseStarTransactionTypeBotInvoicePurchase = String
-> (Object -> Parser StarTransactionType)
-> Value
-> Parser StarTransactionType
forall a. String -> (Object -> Parser a) -> Value -> Parser a
A.withObject String
"StarTransactionTypeBotInvoicePurchase" ((Object -> Parser StarTransactionType)
-> Value -> Parser StarTransactionType)
-> (Object -> Parser StarTransactionType)
-> Value
-> Parser StarTransactionType
forall a b. (a -> b) -> a -> b
$ \Object
o -> do
Maybe Int
user_id_ <- Object
o Object -> Key -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"user_id"
Maybe ProductInfo
product_info_ <- Object
o Object -> Key -> Parser (Maybe ProductInfo)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"product_info"
StarTransactionType -> Parser StarTransactionType
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (StarTransactionType -> Parser StarTransactionType)
-> StarTransactionType -> Parser StarTransactionType
forall a b. (a -> b) -> a -> b
$ StarTransactionTypeBotInvoicePurchase
{ user_id :: Maybe Int
user_id = Maybe Int
user_id_
, product_info :: Maybe ProductInfo
product_info = Maybe ProductInfo
product_info_
}
parseStarTransactionTypeBotInvoiceSale :: A.Value -> AT.Parser StarTransactionType
parseStarTransactionTypeBotInvoiceSale :: Value -> Parser StarTransactionType
parseStarTransactionTypeBotInvoiceSale = String
-> (Object -> Parser StarTransactionType)
-> Value
-> Parser StarTransactionType
forall a. String -> (Object -> Parser a) -> Value -> Parser a
A.withObject String
"StarTransactionTypeBotInvoiceSale" ((Object -> Parser StarTransactionType)
-> Value -> Parser StarTransactionType)
-> (Object -> Parser StarTransactionType)
-> Value
-> Parser StarTransactionType
forall a b. (a -> b) -> a -> b
$ \Object
o -> do
Maybe Int
user_id_ <- Object
o Object -> Key -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"user_id"
Maybe ProductInfo
product_info_ <- Object
o Object -> Key -> Parser (Maybe ProductInfo)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"product_info"
Maybe ByteString
invoice_payload_ <- (String -> ByteString) -> Maybe String -> Maybe ByteString
forall a b. (a -> b) -> Maybe a -> Maybe b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap String -> ByteString
I.readBytes (Maybe String -> Maybe ByteString)
-> Parser (Maybe String) -> Parser (Maybe ByteString)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Object
o Object -> Key -> Parser (Maybe String)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"invoice_payload"
Maybe AffiliateInfo
affiliate_ <- Object
o Object -> Key -> Parser (Maybe AffiliateInfo)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"affiliate"
StarTransactionType -> Parser StarTransactionType
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (StarTransactionType -> Parser StarTransactionType)
-> StarTransactionType -> Parser StarTransactionType
forall a b. (a -> b) -> a -> b
$ StarTransactionTypeBotInvoiceSale
{ user_id :: Maybe Int
user_id = Maybe Int
user_id_
, product_info :: Maybe ProductInfo
product_info = Maybe ProductInfo
product_info_
, invoice_payload :: Maybe ByteString
invoice_payload = Maybe ByteString
invoice_payload_
, affiliate :: Maybe AffiliateInfo
affiliate = Maybe AffiliateInfo
affiliate_
}
parseStarTransactionTypeBotSubscriptionPurchase :: A.Value -> AT.Parser StarTransactionType
parseStarTransactionTypeBotSubscriptionPurchase :: Value -> Parser StarTransactionType
parseStarTransactionTypeBotSubscriptionPurchase = String
-> (Object -> Parser StarTransactionType)
-> Value
-> Parser StarTransactionType
forall a. String -> (Object -> Parser a) -> Value -> Parser a
A.withObject String
"StarTransactionTypeBotSubscriptionPurchase" ((Object -> Parser StarTransactionType)
-> Value -> Parser StarTransactionType)
-> (Object -> Parser StarTransactionType)
-> Value
-> Parser StarTransactionType
forall a b. (a -> b) -> a -> b
$ \Object
o -> do
Maybe Int
user_id_ <- Object
o Object -> Key -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"user_id"
Maybe Int
subscription_period_ <- Object
o Object -> Key -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"subscription_period"
Maybe ProductInfo
product_info_ <- Object
o Object -> Key -> Parser (Maybe ProductInfo)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"product_info"
StarTransactionType -> Parser StarTransactionType
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (StarTransactionType -> Parser StarTransactionType)
-> StarTransactionType -> Parser StarTransactionType
forall a b. (a -> b) -> a -> b
$ StarTransactionTypeBotSubscriptionPurchase
{ user_id :: Maybe Int
user_id = Maybe Int
user_id_
, subscription_period :: Maybe Int
subscription_period = Maybe Int
subscription_period_
, product_info :: Maybe ProductInfo
product_info = Maybe ProductInfo
product_info_
}
parseStarTransactionTypeBotSubscriptionSale :: A.Value -> AT.Parser StarTransactionType
parseStarTransactionTypeBotSubscriptionSale :: Value -> Parser StarTransactionType
parseStarTransactionTypeBotSubscriptionSale = String
-> (Object -> Parser StarTransactionType)
-> Value
-> Parser StarTransactionType
forall a. String -> (Object -> Parser a) -> Value -> Parser a
A.withObject String
"StarTransactionTypeBotSubscriptionSale" ((Object -> Parser StarTransactionType)
-> Value -> Parser StarTransactionType)
-> (Object -> Parser StarTransactionType)
-> Value
-> Parser StarTransactionType
forall a b. (a -> b) -> a -> b
$ \Object
o -> do
Maybe Int
user_id_ <- Object
o Object -> Key -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"user_id"
Maybe Int
subscription_period_ <- Object
o Object -> Key -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"subscription_period"
Maybe ProductInfo
product_info_ <- Object
o Object -> Key -> Parser (Maybe ProductInfo)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"product_info"
Maybe ByteString
invoice_payload_ <- (String -> ByteString) -> Maybe String -> Maybe ByteString
forall a b. (a -> b) -> Maybe a -> Maybe b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap String -> ByteString
I.readBytes (Maybe String -> Maybe ByteString)
-> Parser (Maybe String) -> Parser (Maybe ByteString)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Object
o Object -> Key -> Parser (Maybe String)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"invoice_payload"
Maybe AffiliateInfo
affiliate_ <- Object
o Object -> Key -> Parser (Maybe AffiliateInfo)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"affiliate"
StarTransactionType -> Parser StarTransactionType
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (StarTransactionType -> Parser StarTransactionType)
-> StarTransactionType -> Parser StarTransactionType
forall a b. (a -> b) -> a -> b
$ StarTransactionTypeBotSubscriptionSale
{ user_id :: Maybe Int
user_id = Maybe Int
user_id_
, subscription_period :: Maybe Int
subscription_period = Maybe Int
subscription_period_
, product_info :: Maybe ProductInfo
product_info = Maybe ProductInfo
product_info_
, invoice_payload :: Maybe ByteString
invoice_payload = Maybe ByteString
invoice_payload_
, affiliate :: Maybe AffiliateInfo
affiliate = Maybe AffiliateInfo
affiliate_
}
parseStarTransactionTypeChannelSubscriptionPurchase :: A.Value -> AT.Parser StarTransactionType
parseStarTransactionTypeChannelSubscriptionPurchase :: Value -> Parser StarTransactionType
parseStarTransactionTypeChannelSubscriptionPurchase = String
-> (Object -> Parser StarTransactionType)
-> Value
-> Parser StarTransactionType
forall a. String -> (Object -> Parser a) -> Value -> Parser a
A.withObject String
"StarTransactionTypeChannelSubscriptionPurchase" ((Object -> Parser StarTransactionType)
-> Value -> Parser StarTransactionType)
-> (Object -> Parser StarTransactionType)
-> Value
-> Parser StarTransactionType
forall a b. (a -> b) -> a -> b
$ \Object
o -> do
Maybe Int
chat_id_ <- Object
o Object -> Key -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"chat_id"
Maybe Int
subscription_period_ <- Object
o Object -> Key -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"subscription_period"
StarTransactionType -> Parser StarTransactionType
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (StarTransactionType -> Parser StarTransactionType)
-> StarTransactionType -> Parser StarTransactionType
forall a b. (a -> b) -> a -> b
$ StarTransactionTypeChannelSubscriptionPurchase
{ chat_id :: Maybe Int
chat_id = Maybe Int
chat_id_
, subscription_period :: Maybe Int
subscription_period = Maybe Int
subscription_period_
}
parseStarTransactionTypeChannelSubscriptionSale :: A.Value -> AT.Parser StarTransactionType
parseStarTransactionTypeChannelSubscriptionSale :: Value -> Parser StarTransactionType
parseStarTransactionTypeChannelSubscriptionSale = String
-> (Object -> Parser StarTransactionType)
-> Value
-> Parser StarTransactionType
forall a. String -> (Object -> Parser a) -> Value -> Parser a
A.withObject String
"StarTransactionTypeChannelSubscriptionSale" ((Object -> Parser StarTransactionType)
-> Value -> Parser StarTransactionType)
-> (Object -> Parser StarTransactionType)
-> Value
-> Parser StarTransactionType
forall a b. (a -> b) -> a -> b
$ \Object
o -> do
Maybe Int
user_id_ <- Object
o Object -> Key -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"user_id"
Maybe Int
subscription_period_ <- Object
o Object -> Key -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"subscription_period"
StarTransactionType -> Parser StarTransactionType
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (StarTransactionType -> Parser StarTransactionType)
-> StarTransactionType -> Parser StarTransactionType
forall a b. (a -> b) -> a -> b
$ StarTransactionTypeChannelSubscriptionSale
{ user_id :: Maybe Int
user_id = Maybe Int
user_id_
, subscription_period :: Maybe Int
subscription_period = Maybe Int
subscription_period_
}
parseStarTransactionTypeGiftPurchase :: A.Value -> AT.Parser StarTransactionType
parseStarTransactionTypeGiftPurchase :: Value -> Parser StarTransactionType
parseStarTransactionTypeGiftPurchase = String
-> (Object -> Parser StarTransactionType)
-> Value
-> Parser StarTransactionType
forall a. String -> (Object -> Parser a) -> Value -> Parser a
A.withObject String
"StarTransactionTypeGiftPurchase" ((Object -> Parser StarTransactionType)
-> Value -> Parser StarTransactionType)
-> (Object -> Parser StarTransactionType)
-> Value
-> Parser StarTransactionType
forall a b. (a -> b) -> a -> b
$ \Object
o -> do
Maybe Int
user_id_ <- Object
o Object -> Key -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"user_id"
Maybe Gift
gift_ <- Object
o Object -> Key -> Parser (Maybe Gift)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"gift"
StarTransactionType -> Parser StarTransactionType
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (StarTransactionType -> Parser StarTransactionType)
-> StarTransactionType -> Parser StarTransactionType
forall a b. (a -> b) -> a -> b
$ StarTransactionTypeGiftPurchase
{ user_id :: Maybe Int
user_id = Maybe Int
user_id_
, gift :: Maybe Gift
gift = Maybe Gift
gift_
}
parseStarTransactionTypeGiftTransfer :: A.Value -> AT.Parser StarTransactionType
parseStarTransactionTypeGiftTransfer :: Value -> Parser StarTransactionType
parseStarTransactionTypeGiftTransfer = String
-> (Object -> Parser StarTransactionType)
-> Value
-> Parser StarTransactionType
forall a. String -> (Object -> Parser a) -> Value -> Parser a
A.withObject String
"StarTransactionTypeGiftTransfer" ((Object -> Parser StarTransactionType)
-> Value -> Parser StarTransactionType)
-> (Object -> Parser StarTransactionType)
-> Value
-> Parser StarTransactionType
forall a b. (a -> b) -> a -> b
$ \Object
o -> do
Maybe Int
user_id_ <- Object
o Object -> Key -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"user_id"
Maybe UpgradedGift
_gift_ <- Object
o Object -> Key -> Parser (Maybe UpgradedGift)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"gift"
StarTransactionType -> Parser StarTransactionType
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (StarTransactionType -> Parser StarTransactionType)
-> StarTransactionType -> Parser StarTransactionType
forall a b. (a -> b) -> a -> b
$ StarTransactionTypeGiftTransfer
{ user_id :: Maybe Int
user_id = Maybe Int
user_id_
, _gift :: Maybe UpgradedGift
_gift = Maybe UpgradedGift
_gift_
}
parseStarTransactionTypeGiftSale :: A.Value -> AT.Parser StarTransactionType
parseStarTransactionTypeGiftSale :: Value -> Parser StarTransactionType
parseStarTransactionTypeGiftSale = String
-> (Object -> Parser StarTransactionType)
-> Value
-> Parser StarTransactionType
forall a. String -> (Object -> Parser a) -> Value -> Parser a
A.withObject String
"StarTransactionTypeGiftSale" ((Object -> Parser StarTransactionType)
-> Value -> Parser StarTransactionType)
-> (Object -> Parser StarTransactionType)
-> Value
-> Parser StarTransactionType
forall a b. (a -> b) -> a -> b
$ \Object
o -> do
Maybe Int
user_id_ <- Object
o Object -> Key -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"user_id"
Maybe Gift
gift_ <- Object
o Object -> Key -> Parser (Maybe Gift)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"gift"
StarTransactionType -> Parser StarTransactionType
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (StarTransactionType -> Parser StarTransactionType)
-> StarTransactionType -> Parser StarTransactionType
forall a b. (a -> b) -> a -> b
$ StarTransactionTypeGiftSale
{ user_id :: Maybe Int
user_id = Maybe Int
user_id_
, gift :: Maybe Gift
gift = Maybe Gift
gift_
}
parseStarTransactionTypeGiftUpgrade :: A.Value -> AT.Parser StarTransactionType
parseStarTransactionTypeGiftUpgrade :: Value -> Parser StarTransactionType
parseStarTransactionTypeGiftUpgrade = String
-> (Object -> Parser StarTransactionType)
-> Value
-> Parser StarTransactionType
forall a. String -> (Object -> Parser a) -> Value -> Parser a
A.withObject String
"StarTransactionTypeGiftUpgrade" ((Object -> Parser StarTransactionType)
-> Value -> Parser StarTransactionType)
-> (Object -> Parser StarTransactionType)
-> Value
-> Parser StarTransactionType
forall a b. (a -> b) -> a -> b
$ \Object
o -> do
Maybe UpgradedGift
_gift_ <- Object
o Object -> Key -> Parser (Maybe UpgradedGift)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"gift"
StarTransactionType -> Parser StarTransactionType
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (StarTransactionType -> Parser StarTransactionType)
-> StarTransactionType -> Parser StarTransactionType
forall a b. (a -> b) -> a -> b
$ StarTransactionTypeGiftUpgrade
{ _gift :: Maybe UpgradedGift
_gift = Maybe UpgradedGift
_gift_
}
parseStarTransactionTypeChannelPaidReactionSend :: A.Value -> AT.Parser StarTransactionType
parseStarTransactionTypeChannelPaidReactionSend :: Value -> Parser StarTransactionType
parseStarTransactionTypeChannelPaidReactionSend = String
-> (Object -> Parser StarTransactionType)
-> Value
-> Parser StarTransactionType
forall a. String -> (Object -> Parser a) -> Value -> Parser a
A.withObject String
"StarTransactionTypeChannelPaidReactionSend" ((Object -> Parser StarTransactionType)
-> Value -> Parser StarTransactionType)
-> (Object -> Parser StarTransactionType)
-> Value
-> Parser StarTransactionType
forall a b. (a -> b) -> a -> b
$ \Object
o -> do
Maybe Int
chat_id_ <- Object
o Object -> Key -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"chat_id"
Maybe Int
message_id_ <- Object
o Object -> Key -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"message_id"
StarTransactionType -> Parser StarTransactionType
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (StarTransactionType -> Parser StarTransactionType)
-> StarTransactionType -> Parser StarTransactionType
forall a b. (a -> b) -> a -> b
$ StarTransactionTypeChannelPaidReactionSend
{ chat_id :: Maybe Int
chat_id = Maybe Int
chat_id_
, message_id :: Maybe Int
message_id = Maybe Int
message_id_
}
parseStarTransactionTypeChannelPaidReactionReceive :: A.Value -> AT.Parser StarTransactionType
parseStarTransactionTypeChannelPaidReactionReceive :: Value -> Parser StarTransactionType
parseStarTransactionTypeChannelPaidReactionReceive = String
-> (Object -> Parser StarTransactionType)
-> Value
-> Parser StarTransactionType
forall a. String -> (Object -> Parser a) -> Value -> Parser a
A.withObject String
"StarTransactionTypeChannelPaidReactionReceive" ((Object -> Parser StarTransactionType)
-> Value -> Parser StarTransactionType)
-> (Object -> Parser StarTransactionType)
-> Value
-> Parser StarTransactionType
forall a b. (a -> b) -> a -> b
$ \Object
o -> do
Maybe Int
user_id_ <- Object
o Object -> Key -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"user_id"
Maybe Int
message_id_ <- Object
o Object -> Key -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"message_id"
StarTransactionType -> Parser StarTransactionType
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (StarTransactionType -> Parser StarTransactionType)
-> StarTransactionType -> Parser StarTransactionType
forall a b. (a -> b) -> a -> b
$ StarTransactionTypeChannelPaidReactionReceive
{ user_id :: Maybe Int
user_id = Maybe Int
user_id_
, message_id :: Maybe Int
message_id = Maybe Int
message_id_
}
parseStarTransactionTypeAffiliateProgramCommission :: A.Value -> AT.Parser StarTransactionType
parseStarTransactionTypeAffiliateProgramCommission :: Value -> Parser StarTransactionType
parseStarTransactionTypeAffiliateProgramCommission = String
-> (Object -> Parser StarTransactionType)
-> Value
-> Parser StarTransactionType
forall a. String -> (Object -> Parser a) -> Value -> Parser a
A.withObject String
"StarTransactionTypeAffiliateProgramCommission" ((Object -> Parser StarTransactionType)
-> Value -> Parser StarTransactionType)
-> (Object -> Parser StarTransactionType)
-> Value
-> Parser StarTransactionType
forall a b. (a -> b) -> a -> b
$ \Object
o -> do
Maybe Int
chat_id_ <- Object
o Object -> Key -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"chat_id"
Maybe Int
commission_per_mille_ <- Object
o Object -> Key -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
A..:? Key
"commission_per_mille"
StarTransactionType -> Parser StarTransactionType
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (StarTransactionType -> Parser StarTransactionType)
-> StarTransactionType -> Parser StarTransactionType
forall a b. (a -> b) -> a -> b
$ StarTransactionTypeAffiliateProgramCommission
{ chat_id :: Maybe Int
chat_id = Maybe Int
chat_id_
, commission_per_mille :: Maybe Int
commission_per_mille = Maybe Int
commission_per_mille_
}
parseJSON Value
_ = Parser StarTransactionType
forall a. Monoid a => a
mempty