{-# LANGUAGE MultiWayIf #-}
{-# LANGUAGE OverloadedStrings #-}
module StripeAPI.Types.SourceReceiverFlow 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 SourceReceiverFlow = SourceReceiverFlow
{
SourceReceiverFlow -> Maybe Text
sourceReceiverFlowAddress :: (GHC.Maybe.Maybe Data.Text.Internal.Text),
SourceReceiverFlow -> Int
sourceReceiverFlowAmountCharged :: GHC.Types.Int,
SourceReceiverFlow -> Int
sourceReceiverFlowAmountReceived :: GHC.Types.Int,
SourceReceiverFlow -> Int
sourceReceiverFlowAmountReturned :: GHC.Types.Int,
SourceReceiverFlow -> Text
sourceReceiverFlowRefundAttributesMethod :: Data.Text.Internal.Text,
SourceReceiverFlow -> Text
sourceReceiverFlowRefundAttributesStatus :: Data.Text.Internal.Text
}
deriving
( Int -> SourceReceiverFlow -> ShowS
[SourceReceiverFlow] -> ShowS
SourceReceiverFlow -> String
(Int -> SourceReceiverFlow -> ShowS)
-> (SourceReceiverFlow -> String)
-> ([SourceReceiverFlow] -> ShowS)
-> Show SourceReceiverFlow
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SourceReceiverFlow] -> ShowS
$cshowList :: [SourceReceiverFlow] -> ShowS
show :: SourceReceiverFlow -> String
$cshow :: SourceReceiverFlow -> String
showsPrec :: Int -> SourceReceiverFlow -> ShowS
$cshowsPrec :: Int -> SourceReceiverFlow -> ShowS
GHC.Show.Show,
SourceReceiverFlow -> SourceReceiverFlow -> Bool
(SourceReceiverFlow -> SourceReceiverFlow -> Bool)
-> (SourceReceiverFlow -> SourceReceiverFlow -> Bool)
-> Eq SourceReceiverFlow
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SourceReceiverFlow -> SourceReceiverFlow -> Bool
$c/= :: SourceReceiverFlow -> SourceReceiverFlow -> Bool
== :: SourceReceiverFlow -> SourceReceiverFlow -> Bool
$c== :: SourceReceiverFlow -> SourceReceiverFlow -> Bool
GHC.Classes.Eq
)
instance Data.Aeson.Types.ToJSON.ToJSON SourceReceiverFlow where
toJSON :: SourceReceiverFlow -> Value
toJSON SourceReceiverFlow
obj = [Pair] -> Value
Data.Aeson.Types.Internal.object (Text
"address" Text -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= SourceReceiverFlow -> Maybe Text
sourceReceiverFlowAddress SourceReceiverFlow
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"amount_charged" Text -> Int -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= SourceReceiverFlow -> Int
sourceReceiverFlowAmountCharged SourceReceiverFlow
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"amount_received" Text -> Int -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= SourceReceiverFlow -> Int
sourceReceiverFlowAmountReceived SourceReceiverFlow
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"amount_returned" Text -> Int -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= SourceReceiverFlow -> Int
sourceReceiverFlowAmountReturned SourceReceiverFlow
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"refund_attributes_method" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= SourceReceiverFlow -> Text
sourceReceiverFlowRefundAttributesMethod SourceReceiverFlow
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"refund_attributes_status" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= SourceReceiverFlow -> Text
sourceReceiverFlowRefundAttributesStatus SourceReceiverFlow
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: [Pair]
forall a. Monoid a => a
GHC.Base.mempty)
toEncoding :: SourceReceiverFlow -> Encoding
toEncoding SourceReceiverFlow
obj = Series -> Encoding
Data.Aeson.Encoding.Internal.pairs ((Text
"address" Text -> Maybe Text -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= SourceReceiverFlow -> Maybe Text
sourceReceiverFlowAddress SourceReceiverFlow
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"amount_charged" Text -> Int -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= SourceReceiverFlow -> Int
sourceReceiverFlowAmountCharged SourceReceiverFlow
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"amount_received" Text -> Int -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= SourceReceiverFlow -> Int
sourceReceiverFlowAmountReceived SourceReceiverFlow
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"amount_returned" Text -> Int -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= SourceReceiverFlow -> Int
sourceReceiverFlowAmountReturned SourceReceiverFlow
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"refund_attributes_method" Text -> Text -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= SourceReceiverFlow -> Text
sourceReceiverFlowRefundAttributesMethod SourceReceiverFlow
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> (Text
"refund_attributes_status" Text -> Text -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= SourceReceiverFlow -> Text
sourceReceiverFlowRefundAttributesStatus SourceReceiverFlow
obj))))))
instance Data.Aeson.Types.FromJSON.FromJSON SourceReceiverFlow where
parseJSON :: Value -> Parser SourceReceiverFlow
parseJSON = String
-> (Object -> Parser SourceReceiverFlow)
-> Value
-> Parser SourceReceiverFlow
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.Aeson.Types.FromJSON.withObject String
"SourceReceiverFlow" (\Object
obj -> ((((((Maybe Text
-> Int -> Int -> Int -> Text -> Text -> SourceReceiverFlow)
-> Parser
(Maybe Text
-> Int -> Int -> Int -> Text -> Text -> SourceReceiverFlow)
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure Maybe Text
-> Int -> Int -> Int -> Text -> Text -> SourceReceiverFlow
SourceReceiverFlow Parser
(Maybe Text
-> Int -> Int -> Int -> Text -> Text -> SourceReceiverFlow)
-> Parser (Maybe Text)
-> Parser (Int -> Int -> Int -> Text -> Text -> SourceReceiverFlow)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Text
"address")) Parser (Int -> Int -> Int -> Text -> Text -> SourceReceiverFlow)
-> Parser Int
-> Parser (Int -> Int -> Text -> Text -> SourceReceiverFlow)
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_charged")) Parser (Int -> Int -> Text -> Text -> SourceReceiverFlow)
-> Parser Int -> Parser (Int -> Text -> Text -> SourceReceiverFlow)
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_received")) Parser (Int -> Text -> Text -> SourceReceiverFlow)
-> Parser Int -> Parser (Text -> Text -> SourceReceiverFlow)
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_returned")) Parser (Text -> Text -> SourceReceiverFlow)
-> Parser Text -> Parser (Text -> SourceReceiverFlow)
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
"refund_attributes_method")) Parser (Text -> SourceReceiverFlow)
-> Parser Text -> Parser SourceReceiverFlow
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
"refund_attributes_status"))
mkSourceReceiverFlow ::
GHC.Types.Int ->
GHC.Types.Int ->
GHC.Types.Int ->
Data.Text.Internal.Text ->
Data.Text.Internal.Text ->
SourceReceiverFlow
mkSourceReceiverFlow :: Int -> Int -> Int -> Text -> Text -> SourceReceiverFlow
mkSourceReceiverFlow Int
sourceReceiverFlowAmountCharged Int
sourceReceiverFlowAmountReceived Int
sourceReceiverFlowAmountReturned Text
sourceReceiverFlowRefundAttributesMethod Text
sourceReceiverFlowRefundAttributesStatus =
SourceReceiverFlow :: Maybe Text
-> Int -> Int -> Int -> Text -> Text -> SourceReceiverFlow
SourceReceiverFlow
{ sourceReceiverFlowAddress :: Maybe Text
sourceReceiverFlowAddress = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing,
sourceReceiverFlowAmountCharged :: Int
sourceReceiverFlowAmountCharged = Int
sourceReceiverFlowAmountCharged,
sourceReceiverFlowAmountReceived :: Int
sourceReceiverFlowAmountReceived = Int
sourceReceiverFlowAmountReceived,
sourceReceiverFlowAmountReturned :: Int
sourceReceiverFlowAmountReturned = Int
sourceReceiverFlowAmountReturned,
sourceReceiverFlowRefundAttributesMethod :: Text
sourceReceiverFlowRefundAttributesMethod = Text
sourceReceiverFlowRefundAttributesMethod,
sourceReceiverFlowRefundAttributesStatus :: Text
sourceReceiverFlowRefundAttributesStatus = Text
sourceReceiverFlowRefundAttributesStatus
}