{-# LANGUAGE MultiWayIf #-}
{-# LANGUAGE OverloadedStrings #-}
module StripeAPI.Types.BitcoinTransaction where
import qualified Control.Monad.Fail
import qualified Data.Aeson
import qualified Data.Aeson as Data.Aeson.Encoding.Internal
import qualified Data.Aeson as Data.Aeson.Types
import qualified Data.Aeson as Data.Aeson.Types.FromJSON
import qualified Data.Aeson as Data.Aeson.Types.Internal
import qualified Data.Aeson as Data.Aeson.Types.ToJSON
import qualified Data.ByteString.Char8
import qualified Data.ByteString.Char8 as Data.ByteString.Internal
import qualified Data.Functor
import qualified Data.Scientific
import qualified Data.Text
import qualified Data.Text.Internal
import qualified Data.Time.Calendar as Data.Time.Calendar.Days
import qualified Data.Time.LocalTime as Data.Time.LocalTime.Internal.ZonedTime
import qualified GHC.Base
import qualified GHC.Classes
import qualified GHC.Int
import qualified GHC.Show
import qualified GHC.Types
import qualified StripeAPI.Common
import StripeAPI.TypeAlias
import qualified Prelude as GHC.Integer.Type
import qualified Prelude as GHC.Maybe
data BitcoinTransaction = BitcoinTransaction
{
BitcoinTransaction -> Int
bitcoinTransactionAmount :: GHC.Types.Int,
BitcoinTransaction -> Int
bitcoinTransactionBitcoinAmount :: GHC.Types.Int,
BitcoinTransaction -> Int
bitcoinTransactionCreated :: GHC.Types.Int,
BitcoinTransaction -> Text
bitcoinTransactionCurrency :: Data.Text.Internal.Text,
BitcoinTransaction -> Text
bitcoinTransactionId :: Data.Text.Internal.Text,
BitcoinTransaction -> Text
bitcoinTransactionReceiver :: Data.Text.Internal.Text
}
deriving
( Int -> BitcoinTransaction -> ShowS
[BitcoinTransaction] -> ShowS
BitcoinTransaction -> String
(Int -> BitcoinTransaction -> ShowS)
-> (BitcoinTransaction -> String)
-> ([BitcoinTransaction] -> ShowS)
-> Show BitcoinTransaction
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [BitcoinTransaction] -> ShowS
$cshowList :: [BitcoinTransaction] -> ShowS
show :: BitcoinTransaction -> String
$cshow :: BitcoinTransaction -> String
showsPrec :: Int -> BitcoinTransaction -> ShowS
$cshowsPrec :: Int -> BitcoinTransaction -> ShowS
GHC.Show.Show,
BitcoinTransaction -> BitcoinTransaction -> Bool
(BitcoinTransaction -> BitcoinTransaction -> Bool)
-> (BitcoinTransaction -> BitcoinTransaction -> Bool)
-> Eq BitcoinTransaction
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: BitcoinTransaction -> BitcoinTransaction -> Bool
$c/= :: BitcoinTransaction -> BitcoinTransaction -> Bool
== :: BitcoinTransaction -> BitcoinTransaction -> Bool
$c== :: BitcoinTransaction -> BitcoinTransaction -> Bool
GHC.Classes.Eq
)
instance Data.Aeson.Types.ToJSON.ToJSON BitcoinTransaction where
toJSON :: BitcoinTransaction -> Value
toJSON BitcoinTransaction
obj = [Pair] -> Value
Data.Aeson.Types.Internal.object (Text
"amount" Text -> Int -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= BitcoinTransaction -> Int
bitcoinTransactionAmount BitcoinTransaction
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"bitcoin_amount" Text -> Int -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= BitcoinTransaction -> Int
bitcoinTransactionBitcoinAmount BitcoinTransaction
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"created" Text -> Int -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= BitcoinTransaction -> Int
bitcoinTransactionCreated BitcoinTransaction
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"currency" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= BitcoinTransaction -> Text
bitcoinTransactionCurrency BitcoinTransaction
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"id" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= BitcoinTransaction -> Text
bitcoinTransactionId BitcoinTransaction
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"receiver" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= BitcoinTransaction -> Text
bitcoinTransactionReceiver BitcoinTransaction
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"object" Text -> Value -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= Text -> Value
Data.Aeson.Types.Internal.String Text
"bitcoin_transaction" Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: [Pair]
forall a. Monoid a => a
GHC.Base.mempty)
toEncoding :: BitcoinTransaction -> Encoding
toEncoding BitcoinTransaction
obj = Series -> Encoding
Data.Aeson.Encoding.Internal.pairs ((Text
"amount" Text -> Int -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= BitcoinTransaction -> Int
bitcoinTransactionAmount BitcoinTransaction
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"bitcoin_amount" Text -> Int -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= BitcoinTransaction -> Int
bitcoinTransactionBitcoinAmount BitcoinTransaction
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"created" Text -> Int -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= BitcoinTransaction -> Int
bitcoinTransactionCreated BitcoinTransaction
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"currency" Text -> Text -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= BitcoinTransaction -> Text
bitcoinTransactionCurrency BitcoinTransaction
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"id" Text -> Text -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= BitcoinTransaction -> Text
bitcoinTransactionId BitcoinTransaction
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"receiver" Text -> Text -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= BitcoinTransaction -> Text
bitcoinTransactionReceiver BitcoinTransaction
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> (Text
"object" Text -> Value -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= Text -> Value
Data.Aeson.Types.Internal.String Text
"bitcoin_transaction")))))))
instance Data.Aeson.Types.FromJSON.FromJSON BitcoinTransaction where
parseJSON :: Value -> Parser BitcoinTransaction
parseJSON = String
-> (Object -> Parser BitcoinTransaction)
-> Value
-> Parser BitcoinTransaction
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.Aeson.Types.FromJSON.withObject String
"BitcoinTransaction" (\Object
obj -> ((((((Int -> Int -> Int -> Text -> Text -> Text -> BitcoinTransaction)
-> Parser
(Int -> Int -> Int -> Text -> Text -> Text -> BitcoinTransaction)
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure Int -> Int -> Int -> Text -> Text -> Text -> BitcoinTransaction
BitcoinTransaction Parser
(Int -> Int -> Int -> Text -> Text -> Text -> BitcoinTransaction)
-> Parser Int
-> Parser
(Int -> Int -> Text -> Text -> Text -> BitcoinTransaction)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Text -> Parser Int
forall a. FromJSON a => Object -> Text -> Parser a
Data.Aeson.Types.FromJSON..: Text
"amount")) Parser (Int -> Int -> Text -> Text -> Text -> BitcoinTransaction)
-> Parser Int
-> Parser (Int -> Text -> Text -> Text -> BitcoinTransaction)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Text -> Parser Int
forall a. FromJSON a => Object -> Text -> Parser a
Data.Aeson.Types.FromJSON..: Text
"bitcoin_amount")) Parser (Int -> Text -> Text -> Text -> BitcoinTransaction)
-> Parser Int
-> Parser (Text -> Text -> Text -> BitcoinTransaction)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Text -> Parser Int
forall a. FromJSON a => Object -> Text -> Parser a
Data.Aeson.Types.FromJSON..: Text
"created")) Parser (Text -> Text -> Text -> BitcoinTransaction)
-> Parser Text -> Parser (Text -> Text -> BitcoinTransaction)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Data.Aeson.Types.FromJSON..: Text
"currency")) Parser (Text -> Text -> BitcoinTransaction)
-> Parser Text -> Parser (Text -> BitcoinTransaction)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Data.Aeson.Types.FromJSON..: Text
"id")) Parser (Text -> BitcoinTransaction)
-> Parser Text -> Parser BitcoinTransaction
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Data.Aeson.Types.FromJSON..: Text
"receiver"))
mkBitcoinTransaction ::
GHC.Types.Int ->
GHC.Types.Int ->
GHC.Types.Int ->
Data.Text.Internal.Text ->
Data.Text.Internal.Text ->
Data.Text.Internal.Text ->
BitcoinTransaction
mkBitcoinTransaction :: Int -> Int -> Int -> Text -> Text -> Text -> BitcoinTransaction
mkBitcoinTransaction Int
bitcoinTransactionAmount Int
bitcoinTransactionBitcoinAmount Int
bitcoinTransactionCreated Text
bitcoinTransactionCurrency Text
bitcoinTransactionId Text
bitcoinTransactionReceiver =
BitcoinTransaction :: Int -> Int -> Int -> Text -> Text -> Text -> BitcoinTransaction
BitcoinTransaction
{ bitcoinTransactionAmount :: Int
bitcoinTransactionAmount = Int
bitcoinTransactionAmount,
bitcoinTransactionBitcoinAmount :: Int
bitcoinTransactionBitcoinAmount = Int
bitcoinTransactionBitcoinAmount,
bitcoinTransactionCreated :: Int
bitcoinTransactionCreated = Int
bitcoinTransactionCreated,
bitcoinTransactionCurrency :: Text
bitcoinTransactionCurrency = Text
bitcoinTransactionCurrency,
bitcoinTransactionId :: Text
bitcoinTransactionId = Text
bitcoinTransactionId,
bitcoinTransactionReceiver :: Text
bitcoinTransactionReceiver = Text
bitcoinTransactionReceiver
}