{-# LANGUAGE MultiWayIf #-}
{-# LANGUAGE OverloadedStrings #-}
module StripeAPI.Types.TaxRate 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 TaxRate = TaxRate
{
TaxRate -> Bool
taxRateActive :: GHC.Types.Bool,
TaxRate -> Maybe Text
taxRateCountry :: (GHC.Maybe.Maybe Data.Text.Internal.Text),
TaxRate -> Int
taxRateCreated :: GHC.Types.Int,
TaxRate -> Maybe Text
taxRateDescription :: (GHC.Maybe.Maybe Data.Text.Internal.Text),
TaxRate -> Text
taxRateDisplayName :: Data.Text.Internal.Text,
TaxRate -> Text
taxRateId :: Data.Text.Internal.Text,
TaxRate -> Bool
taxRateInclusive :: GHC.Types.Bool,
TaxRate -> Maybe Text
taxRateJurisdiction :: (GHC.Maybe.Maybe Data.Text.Internal.Text),
TaxRate -> Bool
taxRateLivemode :: GHC.Types.Bool,
TaxRate -> Maybe Object
taxRateMetadata :: (GHC.Maybe.Maybe Data.Aeson.Types.Internal.Object),
TaxRate -> Double
taxRatePercentage :: GHC.Types.Double,
TaxRate -> Maybe Text
taxRateState :: (GHC.Maybe.Maybe Data.Text.Internal.Text),
TaxRate -> Maybe TaxRateTaxType'
taxRateTaxType :: (GHC.Maybe.Maybe TaxRateTaxType')
}
deriving
( Int -> TaxRate -> ShowS
[TaxRate] -> ShowS
TaxRate -> String
(Int -> TaxRate -> ShowS)
-> (TaxRate -> String) -> ([TaxRate] -> ShowS) -> Show TaxRate
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [TaxRate] -> ShowS
$cshowList :: [TaxRate] -> ShowS
show :: TaxRate -> String
$cshow :: TaxRate -> String
showsPrec :: Int -> TaxRate -> ShowS
$cshowsPrec :: Int -> TaxRate -> ShowS
GHC.Show.Show,
TaxRate -> TaxRate -> Bool
(TaxRate -> TaxRate -> Bool)
-> (TaxRate -> TaxRate -> Bool) -> Eq TaxRate
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: TaxRate -> TaxRate -> Bool
$c/= :: TaxRate -> TaxRate -> Bool
== :: TaxRate -> TaxRate -> Bool
$c== :: TaxRate -> TaxRate -> Bool
GHC.Classes.Eq
)
instance Data.Aeson.Types.ToJSON.ToJSON TaxRate where
toJSON :: TaxRate -> Value
toJSON TaxRate
obj = [Pair] -> Value
Data.Aeson.Types.Internal.object (Text
"active" Text -> Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= TaxRate -> Bool
taxRateActive TaxRate
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"country" Text -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= TaxRate -> Maybe Text
taxRateCountry TaxRate
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..= TaxRate -> Int
taxRateCreated TaxRate
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"description" Text -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= TaxRate -> Maybe Text
taxRateDescription TaxRate
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"display_name" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= TaxRate -> Text
taxRateDisplayName TaxRate
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..= TaxRate -> Text
taxRateId TaxRate
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"inclusive" Text -> Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= TaxRate -> Bool
taxRateInclusive TaxRate
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"jurisdiction" Text -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= TaxRate -> Maybe Text
taxRateJurisdiction TaxRate
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"livemode" Text -> Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= TaxRate -> Bool
taxRateLivemode TaxRate
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"metadata" Text -> Maybe Object -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= TaxRate -> Maybe Object
taxRateMetadata TaxRate
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"percentage" Text -> Double -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= TaxRate -> Double
taxRatePercentage TaxRate
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"state" Text -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= TaxRate -> Maybe Text
taxRateState TaxRate
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"tax_type" Text -> Maybe TaxRateTaxType' -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= TaxRate -> Maybe TaxRateTaxType'
taxRateTaxType TaxRate
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
"tax_rate" Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: [Pair]
forall a. Monoid a => a
GHC.Base.mempty)
toEncoding :: TaxRate -> Encoding
toEncoding TaxRate
obj = Series -> Encoding
Data.Aeson.Encoding.Internal.pairs ((Text
"active" Text -> Bool -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= TaxRate -> Bool
taxRateActive TaxRate
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"country" Text -> Maybe Text -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= TaxRate -> Maybe Text
taxRateCountry TaxRate
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..= TaxRate -> Int
taxRateCreated TaxRate
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"description" Text -> Maybe Text -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= TaxRate -> Maybe Text
taxRateDescription TaxRate
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"display_name" Text -> Text -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= TaxRate -> Text
taxRateDisplayName TaxRate
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..= TaxRate -> Text
taxRateId TaxRate
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"inclusive" Text -> Bool -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= TaxRate -> Bool
taxRateInclusive TaxRate
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"jurisdiction" Text -> Maybe Text -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= TaxRate -> Maybe Text
taxRateJurisdiction TaxRate
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"livemode" Text -> Bool -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= TaxRate -> Bool
taxRateLivemode TaxRate
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"metadata" Text -> Maybe Object -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= TaxRate -> Maybe Object
taxRateMetadata TaxRate
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"percentage" Text -> Double -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= TaxRate -> Double
taxRatePercentage TaxRate
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"state" Text -> Maybe Text -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= TaxRate -> Maybe Text
taxRateState TaxRate
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"tax_type" Text -> Maybe TaxRateTaxType' -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= TaxRate -> Maybe TaxRateTaxType'
taxRateTaxType TaxRate
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
"tax_rate"))))))))))))))
instance Data.Aeson.Types.FromJSON.FromJSON TaxRate where
parseJSON :: Value -> Parser TaxRate
parseJSON = String -> (Object -> Parser TaxRate) -> Value -> Parser TaxRate
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.Aeson.Types.FromJSON.withObject String
"TaxRate" (\Object
obj -> (((((((((((((Bool
-> Maybe Text
-> Int
-> Maybe Text
-> Text
-> Text
-> Bool
-> Maybe Text
-> Bool
-> Maybe Object
-> Double
-> Maybe Text
-> Maybe TaxRateTaxType'
-> TaxRate)
-> Parser
(Bool
-> Maybe Text
-> Int
-> Maybe Text
-> Text
-> Text
-> Bool
-> Maybe Text
-> Bool
-> Maybe Object
-> Double
-> Maybe Text
-> Maybe TaxRateTaxType'
-> TaxRate)
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure Bool
-> Maybe Text
-> Int
-> Maybe Text
-> Text
-> Text
-> Bool
-> Maybe Text
-> Bool
-> Maybe Object
-> Double
-> Maybe Text
-> Maybe TaxRateTaxType'
-> TaxRate
TaxRate Parser
(Bool
-> Maybe Text
-> Int
-> Maybe Text
-> Text
-> Text
-> Bool
-> Maybe Text
-> Bool
-> Maybe Object
-> Double
-> Maybe Text
-> Maybe TaxRateTaxType'
-> TaxRate)
-> Parser Bool
-> Parser
(Maybe Text
-> Int
-> Maybe Text
-> Text
-> Text
-> Bool
-> Maybe Text
-> Bool
-> Maybe Object
-> Double
-> Maybe Text
-> Maybe TaxRateTaxType'
-> TaxRate)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Text -> Parser Bool
forall a. FromJSON a => Object -> Text -> Parser a
Data.Aeson.Types.FromJSON..: Text
"active")) Parser
(Maybe Text
-> Int
-> Maybe Text
-> Text
-> Text
-> Bool
-> Maybe Text
-> Bool
-> Maybe Object
-> Double
-> Maybe Text
-> Maybe TaxRateTaxType'
-> TaxRate)
-> Parser (Maybe Text)
-> Parser
(Int
-> Maybe Text
-> Text
-> Text
-> Bool
-> Maybe Text
-> Bool
-> Maybe Object
-> Double
-> Maybe Text
-> Maybe TaxRateTaxType'
-> TaxRate)
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
"country")) Parser
(Int
-> Maybe Text
-> Text
-> Text
-> Bool
-> Maybe Text
-> Bool
-> Maybe Object
-> Double
-> Maybe Text
-> Maybe TaxRateTaxType'
-> TaxRate)
-> Parser Int
-> Parser
(Maybe Text
-> Text
-> Text
-> Bool
-> Maybe Text
-> Bool
-> Maybe Object
-> Double
-> Maybe Text
-> Maybe TaxRateTaxType'
-> TaxRate)
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
(Maybe Text
-> Text
-> Text
-> Bool
-> Maybe Text
-> Bool
-> Maybe Object
-> Double
-> Maybe Text
-> Maybe TaxRateTaxType'
-> TaxRate)
-> Parser (Maybe Text)
-> Parser
(Text
-> Text
-> Bool
-> Maybe Text
-> Bool
-> Maybe Object
-> Double
-> Maybe Text
-> Maybe TaxRateTaxType'
-> TaxRate)
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
"description")) Parser
(Text
-> Text
-> Bool
-> Maybe Text
-> Bool
-> Maybe Object
-> Double
-> Maybe Text
-> Maybe TaxRateTaxType'
-> TaxRate)
-> Parser Text
-> Parser
(Text
-> Bool
-> Maybe Text
-> Bool
-> Maybe Object
-> Double
-> Maybe Text
-> Maybe TaxRateTaxType'
-> TaxRate)
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
"display_name")) Parser
(Text
-> Bool
-> Maybe Text
-> Bool
-> Maybe Object
-> Double
-> Maybe Text
-> Maybe TaxRateTaxType'
-> TaxRate)
-> Parser Text
-> Parser
(Bool
-> Maybe Text
-> Bool
-> Maybe Object
-> Double
-> Maybe Text
-> Maybe TaxRateTaxType'
-> TaxRate)
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
(Bool
-> Maybe Text
-> Bool
-> Maybe Object
-> Double
-> Maybe Text
-> Maybe TaxRateTaxType'
-> TaxRate)
-> Parser Bool
-> Parser
(Maybe Text
-> Bool
-> Maybe Object
-> Double
-> Maybe Text
-> Maybe TaxRateTaxType'
-> TaxRate)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Text -> Parser Bool
forall a. FromJSON a => Object -> Text -> Parser a
Data.Aeson.Types.FromJSON..: Text
"inclusive")) Parser
(Maybe Text
-> Bool
-> Maybe Object
-> Double
-> Maybe Text
-> Maybe TaxRateTaxType'
-> TaxRate)
-> Parser (Maybe Text)
-> Parser
(Bool
-> Maybe Object
-> Double
-> Maybe Text
-> Maybe TaxRateTaxType'
-> TaxRate)
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
"jurisdiction")) Parser
(Bool
-> Maybe Object
-> Double
-> Maybe Text
-> Maybe TaxRateTaxType'
-> TaxRate)
-> Parser Bool
-> Parser
(Maybe Object
-> Double -> Maybe Text -> Maybe TaxRateTaxType' -> TaxRate)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Text -> Parser Bool
forall a. FromJSON a => Object -> Text -> Parser a
Data.Aeson.Types.FromJSON..: Text
"livemode")) Parser
(Maybe Object
-> Double -> Maybe Text -> Maybe TaxRateTaxType' -> TaxRate)
-> Parser (Maybe Object)
-> Parser
(Double -> Maybe Text -> Maybe TaxRateTaxType' -> TaxRate)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Text -> Parser (Maybe Object)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Text
"metadata")) Parser (Double -> Maybe Text -> Maybe TaxRateTaxType' -> TaxRate)
-> Parser Double
-> Parser (Maybe Text -> Maybe TaxRateTaxType' -> TaxRate)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Text -> Parser Double
forall a. FromJSON a => Object -> Text -> Parser a
Data.Aeson.Types.FromJSON..: Text
"percentage")) Parser (Maybe Text -> Maybe TaxRateTaxType' -> TaxRate)
-> Parser (Maybe Text) -> Parser (Maybe TaxRateTaxType' -> TaxRate)
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
"state")) Parser (Maybe TaxRateTaxType' -> TaxRate)
-> Parser (Maybe TaxRateTaxType') -> Parser TaxRate
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Text -> Parser (Maybe TaxRateTaxType')
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Text
"tax_type"))
mkTaxRate ::
GHC.Types.Bool ->
GHC.Types.Int ->
Data.Text.Internal.Text ->
Data.Text.Internal.Text ->
GHC.Types.Bool ->
GHC.Types.Bool ->
GHC.Types.Double ->
TaxRate
mkTaxRate :: Bool -> Int -> Text -> Text -> Bool -> Bool -> Double -> TaxRate
mkTaxRate Bool
taxRateActive Int
taxRateCreated Text
taxRateDisplayName Text
taxRateId Bool
taxRateInclusive Bool
taxRateLivemode Double
taxRatePercentage =
TaxRate :: Bool
-> Maybe Text
-> Int
-> Maybe Text
-> Text
-> Text
-> Bool
-> Maybe Text
-> Bool
-> Maybe Object
-> Double
-> Maybe Text
-> Maybe TaxRateTaxType'
-> TaxRate
TaxRate
{ taxRateActive :: Bool
taxRateActive = Bool
taxRateActive,
taxRateCountry :: Maybe Text
taxRateCountry = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing,
taxRateCreated :: Int
taxRateCreated = Int
taxRateCreated,
taxRateDescription :: Maybe Text
taxRateDescription = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing,
taxRateDisplayName :: Text
taxRateDisplayName = Text
taxRateDisplayName,
taxRateId :: Text
taxRateId = Text
taxRateId,
taxRateInclusive :: Bool
taxRateInclusive = Bool
taxRateInclusive,
taxRateJurisdiction :: Maybe Text
taxRateJurisdiction = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing,
taxRateLivemode :: Bool
taxRateLivemode = Bool
taxRateLivemode,
taxRateMetadata :: Maybe Object
taxRateMetadata = Maybe Object
forall a. Maybe a
GHC.Maybe.Nothing,
taxRatePercentage :: Double
taxRatePercentage = Double
taxRatePercentage,
taxRateState :: Maybe Text
taxRateState = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing,
taxRateTaxType :: Maybe TaxRateTaxType'
taxRateTaxType = Maybe TaxRateTaxType'
forall a. Maybe a
GHC.Maybe.Nothing
}
data TaxRateTaxType'
=
TaxRateTaxType'Other Data.Aeson.Types.Internal.Value
|
TaxRateTaxType'Typed Data.Text.Internal.Text
|
TaxRateTaxType'EnumGst
|
TaxRateTaxType'EnumHst
|
TaxRateTaxType'EnumPst
|
TaxRateTaxType'EnumQst
|
TaxRateTaxType'EnumSalesTax
|
TaxRateTaxType'EnumVat
deriving (Int -> TaxRateTaxType' -> ShowS
[TaxRateTaxType'] -> ShowS
TaxRateTaxType' -> String
(Int -> TaxRateTaxType' -> ShowS)
-> (TaxRateTaxType' -> String)
-> ([TaxRateTaxType'] -> ShowS)
-> Show TaxRateTaxType'
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [TaxRateTaxType'] -> ShowS
$cshowList :: [TaxRateTaxType'] -> ShowS
show :: TaxRateTaxType' -> String
$cshow :: TaxRateTaxType' -> String
showsPrec :: Int -> TaxRateTaxType' -> ShowS
$cshowsPrec :: Int -> TaxRateTaxType' -> ShowS
GHC.Show.Show, TaxRateTaxType' -> TaxRateTaxType' -> Bool
(TaxRateTaxType' -> TaxRateTaxType' -> Bool)
-> (TaxRateTaxType' -> TaxRateTaxType' -> Bool)
-> Eq TaxRateTaxType'
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: TaxRateTaxType' -> TaxRateTaxType' -> Bool
$c/= :: TaxRateTaxType' -> TaxRateTaxType' -> Bool
== :: TaxRateTaxType' -> TaxRateTaxType' -> Bool
$c== :: TaxRateTaxType' -> TaxRateTaxType' -> Bool
GHC.Classes.Eq)
instance Data.Aeson.Types.ToJSON.ToJSON TaxRateTaxType' where
toJSON :: TaxRateTaxType' -> Value
toJSON (TaxRateTaxType'Other Value
val) = Value
val
toJSON (TaxRateTaxType'Typed Text
val) = Text -> Value
forall a. ToJSON a => a -> Value
Data.Aeson.Types.ToJSON.toJSON Text
val
toJSON (TaxRateTaxType'
TaxRateTaxType'EnumGst) = Value
"gst"
toJSON (TaxRateTaxType'
TaxRateTaxType'EnumHst) = Value
"hst"
toJSON (TaxRateTaxType'
TaxRateTaxType'EnumPst) = Value
"pst"
toJSON (TaxRateTaxType'
TaxRateTaxType'EnumQst) = Value
"qst"
toJSON (TaxRateTaxType'
TaxRateTaxType'EnumSalesTax) = Value
"sales_tax"
toJSON (TaxRateTaxType'
TaxRateTaxType'EnumVat) = Value
"vat"
instance Data.Aeson.Types.FromJSON.FromJSON TaxRateTaxType' where
parseJSON :: Value -> Parser TaxRateTaxType'
parseJSON Value
val =
TaxRateTaxType' -> Parser TaxRateTaxType'
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure
( if
| Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"gst" -> TaxRateTaxType'
TaxRateTaxType'EnumGst
| Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"hst" -> TaxRateTaxType'
TaxRateTaxType'EnumHst
| Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"pst" -> TaxRateTaxType'
TaxRateTaxType'EnumPst
| Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"qst" -> TaxRateTaxType'
TaxRateTaxType'EnumQst
| Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"sales_tax" -> TaxRateTaxType'
TaxRateTaxType'EnumSalesTax
| Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"vat" -> TaxRateTaxType'
TaxRateTaxType'EnumVat
| Bool
GHC.Base.otherwise -> Value -> TaxRateTaxType'
TaxRateTaxType'Other Value
val
)