{-# LANGUAGE MultiWayIf #-}
{-# LANGUAGE OverloadedStrings #-}
module StripeAPI.Types.PlatformTaxFee 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 PlatformTaxFee = PlatformTaxFee
{
PlatformTaxFee -> Text
platformTaxFeeAccount :: Data.Text.Internal.Text,
PlatformTaxFee -> Text
platformTaxFeeId :: Data.Text.Internal.Text,
PlatformTaxFee -> Text
platformTaxFeeSourceTransaction :: Data.Text.Internal.Text,
PlatformTaxFee -> Text
platformTaxFeeType :: Data.Text.Internal.Text
}
deriving
( Int -> PlatformTaxFee -> ShowS
[PlatformTaxFee] -> ShowS
PlatformTaxFee -> String
(Int -> PlatformTaxFee -> ShowS)
-> (PlatformTaxFee -> String)
-> ([PlatformTaxFee] -> ShowS)
-> Show PlatformTaxFee
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PlatformTaxFee] -> ShowS
$cshowList :: [PlatformTaxFee] -> ShowS
show :: PlatformTaxFee -> String
$cshow :: PlatformTaxFee -> String
showsPrec :: Int -> PlatformTaxFee -> ShowS
$cshowsPrec :: Int -> PlatformTaxFee -> ShowS
GHC.Show.Show,
PlatformTaxFee -> PlatformTaxFee -> Bool
(PlatformTaxFee -> PlatformTaxFee -> Bool)
-> (PlatformTaxFee -> PlatformTaxFee -> Bool) -> Eq PlatformTaxFee
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PlatformTaxFee -> PlatformTaxFee -> Bool
$c/= :: PlatformTaxFee -> PlatformTaxFee -> Bool
== :: PlatformTaxFee -> PlatformTaxFee -> Bool
$c== :: PlatformTaxFee -> PlatformTaxFee -> Bool
GHC.Classes.Eq
)
instance Data.Aeson.Types.ToJSON.ToJSON PlatformTaxFee where
toJSON :: PlatformTaxFee -> Value
toJSON PlatformTaxFee
obj = [Pair] -> Value
Data.Aeson.Types.Internal.object (Text
"account" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= PlatformTaxFee -> Text
platformTaxFeeAccount PlatformTaxFee
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..= PlatformTaxFee -> Text
platformTaxFeeId PlatformTaxFee
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"source_transaction" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= PlatformTaxFee -> Text
platformTaxFeeSourceTransaction PlatformTaxFee
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"type" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= PlatformTaxFee -> Text
platformTaxFeeType PlatformTaxFee
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
"platform_tax_fee" Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: [Pair]
forall a. Monoid a => a
GHC.Base.mempty)
toEncoding :: PlatformTaxFee -> Encoding
toEncoding PlatformTaxFee
obj = Series -> Encoding
Data.Aeson.Encoding.Internal.pairs ((Text
"account" Text -> Text -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= PlatformTaxFee -> Text
platformTaxFeeAccount PlatformTaxFee
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..= PlatformTaxFee -> Text
platformTaxFeeId PlatformTaxFee
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"source_transaction" Text -> Text -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= PlatformTaxFee -> Text
platformTaxFeeSourceTransaction PlatformTaxFee
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"type" Text -> Text -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= PlatformTaxFee -> Text
platformTaxFeeType PlatformTaxFee
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
"platform_tax_fee")))))
instance Data.Aeson.Types.FromJSON.FromJSON PlatformTaxFee where
parseJSON :: Value -> Parser PlatformTaxFee
parseJSON = String
-> (Object -> Parser PlatformTaxFee)
-> Value
-> Parser PlatformTaxFee
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.Aeson.Types.FromJSON.withObject String
"PlatformTaxFee" (\Object
obj -> ((((Text -> Text -> Text -> Text -> PlatformTaxFee)
-> Parser (Text -> Text -> Text -> Text -> PlatformTaxFee)
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure Text -> Text -> Text -> Text -> PlatformTaxFee
PlatformTaxFee Parser (Text -> Text -> Text -> Text -> PlatformTaxFee)
-> Parser Text -> Parser (Text -> Text -> Text -> PlatformTaxFee)
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
"account")) Parser (Text -> Text -> Text -> PlatformTaxFee)
-> Parser Text -> Parser (Text -> Text -> PlatformTaxFee)
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 -> Text -> PlatformTaxFee)
-> Parser Text -> Parser (Text -> PlatformTaxFee)
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
"source_transaction")) Parser (Text -> PlatformTaxFee)
-> Parser Text -> Parser PlatformTaxFee
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
"type"))
mkPlatformTaxFee ::
Data.Text.Internal.Text ->
Data.Text.Internal.Text ->
Data.Text.Internal.Text ->
Data.Text.Internal.Text ->
PlatformTaxFee
mkPlatformTaxFee :: Text -> Text -> Text -> Text -> PlatformTaxFee
mkPlatformTaxFee Text
platformTaxFeeAccount Text
platformTaxFeeId Text
platformTaxFeeSourceTransaction Text
platformTaxFeeType =
PlatformTaxFee :: Text -> Text -> Text -> Text -> PlatformTaxFee
PlatformTaxFee
{ platformTaxFeeAccount :: Text
platformTaxFeeAccount = Text
platformTaxFeeAccount,
platformTaxFeeId :: Text
platformTaxFeeId = Text
platformTaxFeeId,
platformTaxFeeSourceTransaction :: Text
platformTaxFeeSourceTransaction = Text
platformTaxFeeSourceTransaction,
platformTaxFeeType :: Text
platformTaxFeeType = Text
platformTaxFeeType
}