{-# LANGUAGE MultiWayIf #-}
{-# LANGUAGE OverloadedStrings #-}
module StripeAPI.Types.Price 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 {-# SOURCE #-} StripeAPI.Types.DeletedProduct
import {-# SOURCE #-} StripeAPI.Types.PriceTier
import {-# SOURCE #-} StripeAPI.Types.Product
import {-# SOURCE #-} StripeAPI.Types.Recurring
import {-# SOURCE #-} StripeAPI.Types.TransformQuantity
import qualified Prelude as GHC.Integer.Type
import qualified Prelude as GHC.Maybe
data Price = Price
{
Price -> Bool
priceActive :: GHC.Types.Bool,
Price -> PriceBillingScheme'
priceBillingScheme :: PriceBillingScheme',
Price -> Int
priceCreated :: GHC.Types.Int,
Price -> Text
priceCurrency :: Data.Text.Internal.Text,
Price -> Text
priceId :: Data.Text.Internal.Text,
Price -> Bool
priceLivemode :: GHC.Types.Bool,
Price -> Maybe Text
priceLookupKey :: (GHC.Maybe.Maybe Data.Text.Internal.Text),
Price -> Object
priceMetadata :: Data.Aeson.Types.Internal.Object,
Price -> Maybe Text
priceNickname :: (GHC.Maybe.Maybe Data.Text.Internal.Text),
Price -> PriceProduct'Variants
priceProduct :: PriceProduct'Variants,
Price -> Maybe PriceRecurring'
priceRecurring :: (GHC.Maybe.Maybe PriceRecurring'),
Price -> Maybe PriceTaxBehavior'
priceTaxBehavior :: (GHC.Maybe.Maybe PriceTaxBehavior'),
Price -> Maybe [PriceTier]
priceTiers :: (GHC.Maybe.Maybe ([PriceTier])),
Price -> Maybe PriceTiersMode'
priceTiersMode :: (GHC.Maybe.Maybe PriceTiersMode'),
Price -> Maybe PriceTransformQuantity'
priceTransformQuantity :: (GHC.Maybe.Maybe PriceTransformQuantity'),
Price -> PriceType'
priceType :: PriceType',
Price -> Maybe Int
priceUnitAmount :: (GHC.Maybe.Maybe GHC.Types.Int),
Price -> Maybe Text
priceUnitAmountDecimal :: (GHC.Maybe.Maybe Data.Text.Internal.Text)
}
deriving
( Int -> Price -> ShowS
[Price] -> ShowS
Price -> String
(Int -> Price -> ShowS)
-> (Price -> String) -> ([Price] -> ShowS) -> Show Price
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Price] -> ShowS
$cshowList :: [Price] -> ShowS
show :: Price -> String
$cshow :: Price -> String
showsPrec :: Int -> Price -> ShowS
$cshowsPrec :: Int -> Price -> ShowS
GHC.Show.Show,
Price -> Price -> Bool
(Price -> Price -> Bool) -> (Price -> Price -> Bool) -> Eq Price
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Price -> Price -> Bool
$c/= :: Price -> Price -> Bool
== :: Price -> Price -> Bool
$c== :: Price -> Price -> Bool
GHC.Classes.Eq
)
instance Data.Aeson.Types.ToJSON.ToJSON Price where
toJSON :: Price -> Value
toJSON Price
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..= Price -> Bool
priceActive Price
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"billing_scheme" Text -> PriceBillingScheme' -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= Price -> PriceBillingScheme'
priceBillingScheme Price
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..= Price -> Int
priceCreated Price
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..= Price -> Text
priceCurrency Price
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..= Price -> Text
priceId Price
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..= Price -> Bool
priceLivemode Price
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"lookup_key" Text -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= Price -> Maybe Text
priceLookupKey Price
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"metadata" Text -> Object -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= Price -> Object
priceMetadata Price
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"nickname" Text -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= Price -> Maybe Text
priceNickname Price
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"product" Text -> PriceProduct'Variants -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= Price -> PriceProduct'Variants
priceProduct Price
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"recurring" Text -> Maybe PriceRecurring' -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= Price -> Maybe PriceRecurring'
priceRecurring Price
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"tax_behavior" Text -> Maybe PriceTaxBehavior' -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= Price -> Maybe PriceTaxBehavior'
priceTaxBehavior Price
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"tiers" Text -> Maybe [PriceTier] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= Price -> Maybe [PriceTier]
priceTiers Price
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"tiers_mode" Text -> Maybe PriceTiersMode' -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= Price -> Maybe PriceTiersMode'
priceTiersMode Price
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"transform_quantity" Text -> Maybe PriceTransformQuantity' -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= Price -> Maybe PriceTransformQuantity'
priceTransformQuantity Price
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"type" Text -> PriceType' -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= Price -> PriceType'
priceType Price
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"unit_amount" Text -> Maybe Int -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= Price -> Maybe Int
priceUnitAmount Price
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"unit_amount_decimal" Text -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= Price -> Maybe Text
priceUnitAmountDecimal Price
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
"price" Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: [Pair]
forall a. Monoid a => a
GHC.Base.mempty)
toEncoding :: Price -> Encoding
toEncoding Price
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..= Price -> Bool
priceActive Price
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"billing_scheme" Text -> PriceBillingScheme' -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= Price -> PriceBillingScheme'
priceBillingScheme Price
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..= Price -> Int
priceCreated Price
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..= Price -> Text
priceCurrency Price
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..= Price -> Text
priceId Price
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..= Price -> Bool
priceLivemode Price
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"lookup_key" Text -> Maybe Text -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= Price -> Maybe Text
priceLookupKey Price
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"metadata" Text -> Object -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= Price -> Object
priceMetadata Price
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"nickname" Text -> Maybe Text -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= Price -> Maybe Text
priceNickname Price
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"product" Text -> PriceProduct'Variants -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= Price -> PriceProduct'Variants
priceProduct Price
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"recurring" Text -> Maybe PriceRecurring' -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= Price -> Maybe PriceRecurring'
priceRecurring Price
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"tax_behavior" Text -> Maybe PriceTaxBehavior' -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= Price -> Maybe PriceTaxBehavior'
priceTaxBehavior Price
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"tiers" Text -> Maybe [PriceTier] -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= Price -> Maybe [PriceTier]
priceTiers Price
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"tiers_mode" Text -> Maybe PriceTiersMode' -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= Price -> Maybe PriceTiersMode'
priceTiersMode Price
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"transform_quantity" Text -> Maybe PriceTransformQuantity' -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= Price -> Maybe PriceTransformQuantity'
priceTransformQuantity Price
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"type" Text -> PriceType' -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= Price -> PriceType'
priceType Price
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"unit_amount" Text -> Maybe Int -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= Price -> Maybe Int
priceUnitAmount Price
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"unit_amount_decimal" Text -> Maybe Text -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= Price -> Maybe Text
priceUnitAmountDecimal Price
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
"price")))))))))))))))))))
instance Data.Aeson.Types.FromJSON.FromJSON Price where
parseJSON :: Value -> Parser Price
parseJSON = String -> (Object -> Parser Price) -> Value -> Parser Price
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.Aeson.Types.FromJSON.withObject String
"Price" (\Object
obj -> ((((((((((((((((((Bool
-> PriceBillingScheme'
-> Int
-> Text
-> Text
-> Bool
-> Maybe Text
-> Object
-> Maybe Text
-> PriceProduct'Variants
-> Maybe PriceRecurring'
-> Maybe PriceTaxBehavior'
-> Maybe [PriceTier]
-> Maybe PriceTiersMode'
-> Maybe PriceTransformQuantity'
-> PriceType'
-> Maybe Int
-> Maybe Text
-> Price)
-> Parser
(Bool
-> PriceBillingScheme'
-> Int
-> Text
-> Text
-> Bool
-> Maybe Text
-> Object
-> Maybe Text
-> PriceProduct'Variants
-> Maybe PriceRecurring'
-> Maybe PriceTaxBehavior'
-> Maybe [PriceTier]
-> Maybe PriceTiersMode'
-> Maybe PriceTransformQuantity'
-> PriceType'
-> Maybe Int
-> Maybe Text
-> Price)
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure Bool
-> PriceBillingScheme'
-> Int
-> Text
-> Text
-> Bool
-> Maybe Text
-> Object
-> Maybe Text
-> PriceProduct'Variants
-> Maybe PriceRecurring'
-> Maybe PriceTaxBehavior'
-> Maybe [PriceTier]
-> Maybe PriceTiersMode'
-> Maybe PriceTransformQuantity'
-> PriceType'
-> Maybe Int
-> Maybe Text
-> Price
Price Parser
(Bool
-> PriceBillingScheme'
-> Int
-> Text
-> Text
-> Bool
-> Maybe Text
-> Object
-> Maybe Text
-> PriceProduct'Variants
-> Maybe PriceRecurring'
-> Maybe PriceTaxBehavior'
-> Maybe [PriceTier]
-> Maybe PriceTiersMode'
-> Maybe PriceTransformQuantity'
-> PriceType'
-> Maybe Int
-> Maybe Text
-> Price)
-> Parser Bool
-> Parser
(PriceBillingScheme'
-> Int
-> Text
-> Text
-> Bool
-> Maybe Text
-> Object
-> Maybe Text
-> PriceProduct'Variants
-> Maybe PriceRecurring'
-> Maybe PriceTaxBehavior'
-> Maybe [PriceTier]
-> Maybe PriceTiersMode'
-> Maybe PriceTransformQuantity'
-> PriceType'
-> Maybe Int
-> Maybe Text
-> Price)
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
(PriceBillingScheme'
-> Int
-> Text
-> Text
-> Bool
-> Maybe Text
-> Object
-> Maybe Text
-> PriceProduct'Variants
-> Maybe PriceRecurring'
-> Maybe PriceTaxBehavior'
-> Maybe [PriceTier]
-> Maybe PriceTiersMode'
-> Maybe PriceTransformQuantity'
-> PriceType'
-> Maybe Int
-> Maybe Text
-> Price)
-> Parser PriceBillingScheme'
-> Parser
(Int
-> Text
-> Text
-> Bool
-> Maybe Text
-> Object
-> Maybe Text
-> PriceProduct'Variants
-> Maybe PriceRecurring'
-> Maybe PriceTaxBehavior'
-> Maybe [PriceTier]
-> Maybe PriceTiersMode'
-> Maybe PriceTransformQuantity'
-> PriceType'
-> Maybe Int
-> Maybe Text
-> Price)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Text -> Parser PriceBillingScheme'
forall a. FromJSON a => Object -> Text -> Parser a
Data.Aeson.Types.FromJSON..: Text
"billing_scheme")) Parser
(Int
-> Text
-> Text
-> Bool
-> Maybe Text
-> Object
-> Maybe Text
-> PriceProduct'Variants
-> Maybe PriceRecurring'
-> Maybe PriceTaxBehavior'
-> Maybe [PriceTier]
-> Maybe PriceTiersMode'
-> Maybe PriceTransformQuantity'
-> PriceType'
-> Maybe Int
-> Maybe Text
-> Price)
-> Parser Int
-> Parser
(Text
-> Text
-> Bool
-> Maybe Text
-> Object
-> Maybe Text
-> PriceProduct'Variants
-> Maybe PriceRecurring'
-> Maybe PriceTaxBehavior'
-> Maybe [PriceTier]
-> Maybe PriceTiersMode'
-> Maybe PriceTransformQuantity'
-> PriceType'
-> Maybe Int
-> Maybe Text
-> Price)
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
-> Bool
-> Maybe Text
-> Object
-> Maybe Text
-> PriceProduct'Variants
-> Maybe PriceRecurring'
-> Maybe PriceTaxBehavior'
-> Maybe [PriceTier]
-> Maybe PriceTiersMode'
-> Maybe PriceTransformQuantity'
-> PriceType'
-> Maybe Int
-> Maybe Text
-> Price)
-> Parser Text
-> Parser
(Text
-> Bool
-> Maybe Text
-> Object
-> Maybe Text
-> PriceProduct'Variants
-> Maybe PriceRecurring'
-> Maybe PriceTaxBehavior'
-> Maybe [PriceTier]
-> Maybe PriceTiersMode'
-> Maybe PriceTransformQuantity'
-> PriceType'
-> Maybe Int
-> Maybe Text
-> Price)
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
-> Bool
-> Maybe Text
-> Object
-> Maybe Text
-> PriceProduct'Variants
-> Maybe PriceRecurring'
-> Maybe PriceTaxBehavior'
-> Maybe [PriceTier]
-> Maybe PriceTiersMode'
-> Maybe PriceTransformQuantity'
-> PriceType'
-> Maybe Int
-> Maybe Text
-> Price)
-> Parser Text
-> Parser
(Bool
-> Maybe Text
-> Object
-> Maybe Text
-> PriceProduct'Variants
-> Maybe PriceRecurring'
-> Maybe PriceTaxBehavior'
-> Maybe [PriceTier]
-> Maybe PriceTiersMode'
-> Maybe PriceTransformQuantity'
-> PriceType'
-> Maybe Int
-> Maybe Text
-> Price)
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
-> Object
-> Maybe Text
-> PriceProduct'Variants
-> Maybe PriceRecurring'
-> Maybe PriceTaxBehavior'
-> Maybe [PriceTier]
-> Maybe PriceTiersMode'
-> Maybe PriceTransformQuantity'
-> PriceType'
-> Maybe Int
-> Maybe Text
-> Price)
-> Parser Bool
-> Parser
(Maybe Text
-> Object
-> Maybe Text
-> PriceProduct'Variants
-> Maybe PriceRecurring'
-> Maybe PriceTaxBehavior'
-> Maybe [PriceTier]
-> Maybe PriceTiersMode'
-> Maybe PriceTransformQuantity'
-> PriceType'
-> Maybe Int
-> Maybe Text
-> Price)
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 Text
-> Object
-> Maybe Text
-> PriceProduct'Variants
-> Maybe PriceRecurring'
-> Maybe PriceTaxBehavior'
-> Maybe [PriceTier]
-> Maybe PriceTiersMode'
-> Maybe PriceTransformQuantity'
-> PriceType'
-> Maybe Int
-> Maybe Text
-> Price)
-> Parser (Maybe Text)
-> Parser
(Object
-> Maybe Text
-> PriceProduct'Variants
-> Maybe PriceRecurring'
-> Maybe PriceTaxBehavior'
-> Maybe [PriceTier]
-> Maybe PriceTiersMode'
-> Maybe PriceTransformQuantity'
-> PriceType'
-> Maybe Int
-> Maybe Text
-> Price)
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
"lookup_key")) Parser
(Object
-> Maybe Text
-> PriceProduct'Variants
-> Maybe PriceRecurring'
-> Maybe PriceTaxBehavior'
-> Maybe [PriceTier]
-> Maybe PriceTiersMode'
-> Maybe PriceTransformQuantity'
-> PriceType'
-> Maybe Int
-> Maybe Text
-> Price)
-> Parser Object
-> Parser
(Maybe Text
-> PriceProduct'Variants
-> Maybe PriceRecurring'
-> Maybe PriceTaxBehavior'
-> Maybe [PriceTier]
-> Maybe PriceTiersMode'
-> Maybe PriceTransformQuantity'
-> PriceType'
-> Maybe Int
-> Maybe Text
-> Price)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Text -> Parser Object
forall a. FromJSON a => Object -> Text -> Parser a
Data.Aeson.Types.FromJSON..: Text
"metadata")) Parser
(Maybe Text
-> PriceProduct'Variants
-> Maybe PriceRecurring'
-> Maybe PriceTaxBehavior'
-> Maybe [PriceTier]
-> Maybe PriceTiersMode'
-> Maybe PriceTransformQuantity'
-> PriceType'
-> Maybe Int
-> Maybe Text
-> Price)
-> Parser (Maybe Text)
-> Parser
(PriceProduct'Variants
-> Maybe PriceRecurring'
-> Maybe PriceTaxBehavior'
-> Maybe [PriceTier]
-> Maybe PriceTiersMode'
-> Maybe PriceTransformQuantity'
-> PriceType'
-> Maybe Int
-> Maybe Text
-> Price)
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
"nickname")) Parser
(PriceProduct'Variants
-> Maybe PriceRecurring'
-> Maybe PriceTaxBehavior'
-> Maybe [PriceTier]
-> Maybe PriceTiersMode'
-> Maybe PriceTransformQuantity'
-> PriceType'
-> Maybe Int
-> Maybe Text
-> Price)
-> Parser PriceProduct'Variants
-> Parser
(Maybe PriceRecurring'
-> Maybe PriceTaxBehavior'
-> Maybe [PriceTier]
-> Maybe PriceTiersMode'
-> Maybe PriceTransformQuantity'
-> PriceType'
-> Maybe Int
-> Maybe Text
-> Price)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Text -> Parser PriceProduct'Variants
forall a. FromJSON a => Object -> Text -> Parser a
Data.Aeson.Types.FromJSON..: Text
"product")) Parser
(Maybe PriceRecurring'
-> Maybe PriceTaxBehavior'
-> Maybe [PriceTier]
-> Maybe PriceTiersMode'
-> Maybe PriceTransformQuantity'
-> PriceType'
-> Maybe Int
-> Maybe Text
-> Price)
-> Parser (Maybe PriceRecurring')
-> Parser
(Maybe PriceTaxBehavior'
-> Maybe [PriceTier]
-> Maybe PriceTiersMode'
-> Maybe PriceTransformQuantity'
-> PriceType'
-> Maybe Int
-> Maybe Text
-> Price)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Text -> Parser (Maybe PriceRecurring')
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Text
"recurring")) Parser
(Maybe PriceTaxBehavior'
-> Maybe [PriceTier]
-> Maybe PriceTiersMode'
-> Maybe PriceTransformQuantity'
-> PriceType'
-> Maybe Int
-> Maybe Text
-> Price)
-> Parser (Maybe PriceTaxBehavior')
-> Parser
(Maybe [PriceTier]
-> Maybe PriceTiersMode'
-> Maybe PriceTransformQuantity'
-> PriceType'
-> Maybe Int
-> Maybe Text
-> Price)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Text -> Parser (Maybe PriceTaxBehavior')
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Text
"tax_behavior")) Parser
(Maybe [PriceTier]
-> Maybe PriceTiersMode'
-> Maybe PriceTransformQuantity'
-> PriceType'
-> Maybe Int
-> Maybe Text
-> Price)
-> Parser (Maybe [PriceTier])
-> Parser
(Maybe PriceTiersMode'
-> Maybe PriceTransformQuantity'
-> PriceType'
-> Maybe Int
-> Maybe Text
-> Price)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Text -> Parser (Maybe [PriceTier])
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Text
"tiers")) Parser
(Maybe PriceTiersMode'
-> Maybe PriceTransformQuantity'
-> PriceType'
-> Maybe Int
-> Maybe Text
-> Price)
-> Parser (Maybe PriceTiersMode')
-> Parser
(Maybe PriceTransformQuantity'
-> PriceType' -> Maybe Int -> Maybe Text -> Price)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Text -> Parser (Maybe PriceTiersMode')
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Text
"tiers_mode")) Parser
(Maybe PriceTransformQuantity'
-> PriceType' -> Maybe Int -> Maybe Text -> Price)
-> Parser (Maybe PriceTransformQuantity')
-> Parser (PriceType' -> Maybe Int -> Maybe Text -> Price)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Text -> Parser (Maybe PriceTransformQuantity')
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Text
"transform_quantity")) Parser (PriceType' -> Maybe Int -> Maybe Text -> Price)
-> Parser PriceType' -> Parser (Maybe Int -> Maybe Text -> Price)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Text -> Parser PriceType'
forall a. FromJSON a => Object -> Text -> Parser a
Data.Aeson.Types.FromJSON..: Text
"type")) Parser (Maybe Int -> Maybe Text -> Price)
-> Parser (Maybe Int) -> Parser (Maybe Text -> Price)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Text -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Text
"unit_amount")) Parser (Maybe Text -> Price) -> Parser (Maybe Text) -> Parser Price
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
"unit_amount_decimal"))
mkPrice ::
GHC.Types.Bool ->
PriceBillingScheme' ->
GHC.Types.Int ->
Data.Text.Internal.Text ->
Data.Text.Internal.Text ->
GHC.Types.Bool ->
Data.Aeson.Types.Internal.Object ->
PriceProduct'Variants ->
PriceType' ->
Price
mkPrice :: Bool
-> PriceBillingScheme'
-> Int
-> Text
-> Text
-> Bool
-> Object
-> PriceProduct'Variants
-> PriceType'
-> Price
mkPrice Bool
priceActive PriceBillingScheme'
priceBillingScheme Int
priceCreated Text
priceCurrency Text
priceId Bool
priceLivemode Object
priceMetadata PriceProduct'Variants
priceProduct PriceType'
priceType =
Price :: Bool
-> PriceBillingScheme'
-> Int
-> Text
-> Text
-> Bool
-> Maybe Text
-> Object
-> Maybe Text
-> PriceProduct'Variants
-> Maybe PriceRecurring'
-> Maybe PriceTaxBehavior'
-> Maybe [PriceTier]
-> Maybe PriceTiersMode'
-> Maybe PriceTransformQuantity'
-> PriceType'
-> Maybe Int
-> Maybe Text
-> Price
Price
{ priceActive :: Bool
priceActive = Bool
priceActive,
priceBillingScheme :: PriceBillingScheme'
priceBillingScheme = PriceBillingScheme'
priceBillingScheme,
priceCreated :: Int
priceCreated = Int
priceCreated,
priceCurrency :: Text
priceCurrency = Text
priceCurrency,
priceId :: Text
priceId = Text
priceId,
priceLivemode :: Bool
priceLivemode = Bool
priceLivemode,
priceLookupKey :: Maybe Text
priceLookupKey = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing,
priceMetadata :: Object
priceMetadata = Object
priceMetadata,
priceNickname :: Maybe Text
priceNickname = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing,
priceProduct :: PriceProduct'Variants
priceProduct = PriceProduct'Variants
priceProduct,
priceRecurring :: Maybe PriceRecurring'
priceRecurring = Maybe PriceRecurring'
forall a. Maybe a
GHC.Maybe.Nothing,
priceTaxBehavior :: Maybe PriceTaxBehavior'
priceTaxBehavior = Maybe PriceTaxBehavior'
forall a. Maybe a
GHC.Maybe.Nothing,
priceTiers :: Maybe [PriceTier]
priceTiers = Maybe [PriceTier]
forall a. Maybe a
GHC.Maybe.Nothing,
priceTiersMode :: Maybe PriceTiersMode'
priceTiersMode = Maybe PriceTiersMode'
forall a. Maybe a
GHC.Maybe.Nothing,
priceTransformQuantity :: Maybe PriceTransformQuantity'
priceTransformQuantity = Maybe PriceTransformQuantity'
forall a. Maybe a
GHC.Maybe.Nothing,
priceType :: PriceType'
priceType = PriceType'
priceType,
priceUnitAmount :: Maybe Int
priceUnitAmount = Maybe Int
forall a. Maybe a
GHC.Maybe.Nothing,
priceUnitAmountDecimal :: Maybe Text
priceUnitAmountDecimal = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing
}
data PriceBillingScheme'
=
PriceBillingScheme'Other Data.Aeson.Types.Internal.Value
|
PriceBillingScheme'Typed Data.Text.Internal.Text
|
PriceBillingScheme'EnumPerUnit
|
PriceBillingScheme'EnumTiered
deriving (Int -> PriceBillingScheme' -> ShowS
[PriceBillingScheme'] -> ShowS
PriceBillingScheme' -> String
(Int -> PriceBillingScheme' -> ShowS)
-> (PriceBillingScheme' -> String)
-> ([PriceBillingScheme'] -> ShowS)
-> Show PriceBillingScheme'
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PriceBillingScheme'] -> ShowS
$cshowList :: [PriceBillingScheme'] -> ShowS
show :: PriceBillingScheme' -> String
$cshow :: PriceBillingScheme' -> String
showsPrec :: Int -> PriceBillingScheme' -> ShowS
$cshowsPrec :: Int -> PriceBillingScheme' -> ShowS
GHC.Show.Show, PriceBillingScheme' -> PriceBillingScheme' -> Bool
(PriceBillingScheme' -> PriceBillingScheme' -> Bool)
-> (PriceBillingScheme' -> PriceBillingScheme' -> Bool)
-> Eq PriceBillingScheme'
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PriceBillingScheme' -> PriceBillingScheme' -> Bool
$c/= :: PriceBillingScheme' -> PriceBillingScheme' -> Bool
== :: PriceBillingScheme' -> PriceBillingScheme' -> Bool
$c== :: PriceBillingScheme' -> PriceBillingScheme' -> Bool
GHC.Classes.Eq)
instance Data.Aeson.Types.ToJSON.ToJSON PriceBillingScheme' where
toJSON :: PriceBillingScheme' -> Value
toJSON (PriceBillingScheme'Other Value
val) = Value
val
toJSON (PriceBillingScheme'Typed Text
val) = Text -> Value
forall a. ToJSON a => a -> Value
Data.Aeson.Types.ToJSON.toJSON Text
val
toJSON (PriceBillingScheme'
PriceBillingScheme'EnumPerUnit) = Value
"per_unit"
toJSON (PriceBillingScheme'
PriceBillingScheme'EnumTiered) = Value
"tiered"
instance Data.Aeson.Types.FromJSON.FromJSON PriceBillingScheme' where
parseJSON :: Value -> Parser PriceBillingScheme'
parseJSON Value
val =
PriceBillingScheme' -> Parser PriceBillingScheme'
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
"per_unit" -> PriceBillingScheme'
PriceBillingScheme'EnumPerUnit
| Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"tiered" -> PriceBillingScheme'
PriceBillingScheme'EnumTiered
| Bool
GHC.Base.otherwise -> Value -> PriceBillingScheme'
PriceBillingScheme'Other Value
val
)
data PriceProduct'Variants
= PriceProduct'Text Data.Text.Internal.Text
| PriceProduct'Product Product
| PriceProduct'DeletedProduct DeletedProduct
deriving (Int -> PriceProduct'Variants -> ShowS
[PriceProduct'Variants] -> ShowS
PriceProduct'Variants -> String
(Int -> PriceProduct'Variants -> ShowS)
-> (PriceProduct'Variants -> String)
-> ([PriceProduct'Variants] -> ShowS)
-> Show PriceProduct'Variants
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PriceProduct'Variants] -> ShowS
$cshowList :: [PriceProduct'Variants] -> ShowS
show :: PriceProduct'Variants -> String
$cshow :: PriceProduct'Variants -> String
showsPrec :: Int -> PriceProduct'Variants -> ShowS
$cshowsPrec :: Int -> PriceProduct'Variants -> ShowS
GHC.Show.Show, PriceProduct'Variants -> PriceProduct'Variants -> Bool
(PriceProduct'Variants -> PriceProduct'Variants -> Bool)
-> (PriceProduct'Variants -> PriceProduct'Variants -> Bool)
-> Eq PriceProduct'Variants
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PriceProduct'Variants -> PriceProduct'Variants -> Bool
$c/= :: PriceProduct'Variants -> PriceProduct'Variants -> Bool
== :: PriceProduct'Variants -> PriceProduct'Variants -> Bool
$c== :: PriceProduct'Variants -> PriceProduct'Variants -> Bool
GHC.Classes.Eq)
instance Data.Aeson.Types.ToJSON.ToJSON PriceProduct'Variants where
toJSON :: PriceProduct'Variants -> Value
toJSON (PriceProduct'Text Text
a) = Text -> Value
forall a. ToJSON a => a -> Value
Data.Aeson.Types.ToJSON.toJSON Text
a
toJSON (PriceProduct'Product Product
a) = Product -> Value
forall a. ToJSON a => a -> Value
Data.Aeson.Types.ToJSON.toJSON Product
a
toJSON (PriceProduct'DeletedProduct DeletedProduct
a) = DeletedProduct -> Value
forall a. ToJSON a => a -> Value
Data.Aeson.Types.ToJSON.toJSON DeletedProduct
a
instance Data.Aeson.Types.FromJSON.FromJSON PriceProduct'Variants where
parseJSON :: Value -> Parser PriceProduct'Variants
parseJSON Value
val = case (Text -> PriceProduct'Variants
PriceProduct'Text (Text -> PriceProduct'Variants)
-> Result Text -> Result PriceProduct'Variants
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Data.Functor.<$> Value -> Result Text
forall a. FromJSON a => Value -> Result a
Data.Aeson.Types.FromJSON.fromJSON Value
val) Result PriceProduct'Variants
-> Result PriceProduct'Variants -> Result PriceProduct'Variants
forall (f :: * -> *) a. Alternative f => f a -> f a -> f a
GHC.Base.<|> ((Product -> PriceProduct'Variants
PriceProduct'Product (Product -> PriceProduct'Variants)
-> Result Product -> Result PriceProduct'Variants
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Data.Functor.<$> Value -> Result Product
forall a. FromJSON a => Value -> Result a
Data.Aeson.Types.FromJSON.fromJSON Value
val) Result PriceProduct'Variants
-> Result PriceProduct'Variants -> Result PriceProduct'Variants
forall (f :: * -> *) a. Alternative f => f a -> f a -> f a
GHC.Base.<|> ((DeletedProduct -> PriceProduct'Variants
PriceProduct'DeletedProduct (DeletedProduct -> PriceProduct'Variants)
-> Result DeletedProduct -> Result PriceProduct'Variants
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Data.Functor.<$> Value -> Result DeletedProduct
forall a. FromJSON a => Value -> Result a
Data.Aeson.Types.FromJSON.fromJSON Value
val) Result PriceProduct'Variants
-> Result PriceProduct'Variants -> Result PriceProduct'Variants
forall (f :: * -> *) a. Alternative f => f a -> f a -> f a
GHC.Base.<|> String -> Result PriceProduct'Variants
forall a. String -> Result a
Data.Aeson.Types.Internal.Error String
"No variant matched")) of
Data.Aeson.Types.Internal.Success PriceProduct'Variants
a -> PriceProduct'Variants -> Parser PriceProduct'Variants
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure PriceProduct'Variants
a
Data.Aeson.Types.Internal.Error String
a -> String -> Parser PriceProduct'Variants
forall (m :: * -> *) a. MonadFail m => String -> m a
Control.Monad.Fail.fail String
a
data PriceRecurring' = PriceRecurring'
{
PriceRecurring' -> Maybe PriceRecurring'AggregateUsage'
priceRecurring'AggregateUsage :: (GHC.Maybe.Maybe PriceRecurring'AggregateUsage'),
PriceRecurring' -> Maybe PriceRecurring'Interval'
priceRecurring'Interval :: (GHC.Maybe.Maybe PriceRecurring'Interval'),
PriceRecurring' -> Maybe Int
priceRecurring'IntervalCount :: (GHC.Maybe.Maybe GHC.Types.Int),
PriceRecurring' -> Maybe PriceRecurring'UsageType'
priceRecurring'UsageType :: (GHC.Maybe.Maybe PriceRecurring'UsageType')
}
deriving
( Int -> PriceRecurring' -> ShowS
[PriceRecurring'] -> ShowS
PriceRecurring' -> String
(Int -> PriceRecurring' -> ShowS)
-> (PriceRecurring' -> String)
-> ([PriceRecurring'] -> ShowS)
-> Show PriceRecurring'
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PriceRecurring'] -> ShowS
$cshowList :: [PriceRecurring'] -> ShowS
show :: PriceRecurring' -> String
$cshow :: PriceRecurring' -> String
showsPrec :: Int -> PriceRecurring' -> ShowS
$cshowsPrec :: Int -> PriceRecurring' -> ShowS
GHC.Show.Show,
PriceRecurring' -> PriceRecurring' -> Bool
(PriceRecurring' -> PriceRecurring' -> Bool)
-> (PriceRecurring' -> PriceRecurring' -> Bool)
-> Eq PriceRecurring'
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PriceRecurring' -> PriceRecurring' -> Bool
$c/= :: PriceRecurring' -> PriceRecurring' -> Bool
== :: PriceRecurring' -> PriceRecurring' -> Bool
$c== :: PriceRecurring' -> PriceRecurring' -> Bool
GHC.Classes.Eq
)
instance Data.Aeson.Types.ToJSON.ToJSON PriceRecurring' where
toJSON :: PriceRecurring' -> Value
toJSON PriceRecurring'
obj = [Pair] -> Value
Data.Aeson.Types.Internal.object (Text
"aggregate_usage" Text -> Maybe PriceRecurring'AggregateUsage' -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= PriceRecurring' -> Maybe PriceRecurring'AggregateUsage'
priceRecurring'AggregateUsage PriceRecurring'
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"interval" Text -> Maybe PriceRecurring'Interval' -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= PriceRecurring' -> Maybe PriceRecurring'Interval'
priceRecurring'Interval PriceRecurring'
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"interval_count" Text -> Maybe Int -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= PriceRecurring' -> Maybe Int
priceRecurring'IntervalCount PriceRecurring'
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"usage_type" Text -> Maybe PriceRecurring'UsageType' -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= PriceRecurring' -> Maybe PriceRecurring'UsageType'
priceRecurring'UsageType PriceRecurring'
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: [Pair]
forall a. Monoid a => a
GHC.Base.mempty)
toEncoding :: PriceRecurring' -> Encoding
toEncoding PriceRecurring'
obj = Series -> Encoding
Data.Aeson.Encoding.Internal.pairs ((Text
"aggregate_usage" Text -> Maybe PriceRecurring'AggregateUsage' -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= PriceRecurring' -> Maybe PriceRecurring'AggregateUsage'
priceRecurring'AggregateUsage PriceRecurring'
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"interval" Text -> Maybe PriceRecurring'Interval' -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= PriceRecurring' -> Maybe PriceRecurring'Interval'
priceRecurring'Interval PriceRecurring'
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"interval_count" Text -> Maybe Int -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= PriceRecurring' -> Maybe Int
priceRecurring'IntervalCount PriceRecurring'
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> (Text
"usage_type" Text -> Maybe PriceRecurring'UsageType' -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= PriceRecurring' -> Maybe PriceRecurring'UsageType'
priceRecurring'UsageType PriceRecurring'
obj))))
instance Data.Aeson.Types.FromJSON.FromJSON PriceRecurring' where
parseJSON :: Value -> Parser PriceRecurring'
parseJSON = String
-> (Object -> Parser PriceRecurring')
-> Value
-> Parser PriceRecurring'
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.Aeson.Types.FromJSON.withObject String
"PriceRecurring'" (\Object
obj -> ((((Maybe PriceRecurring'AggregateUsage'
-> Maybe PriceRecurring'Interval'
-> Maybe Int
-> Maybe PriceRecurring'UsageType'
-> PriceRecurring')
-> Parser
(Maybe PriceRecurring'AggregateUsage'
-> Maybe PriceRecurring'Interval'
-> Maybe Int
-> Maybe PriceRecurring'UsageType'
-> PriceRecurring')
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure Maybe PriceRecurring'AggregateUsage'
-> Maybe PriceRecurring'Interval'
-> Maybe Int
-> Maybe PriceRecurring'UsageType'
-> PriceRecurring'
PriceRecurring' Parser
(Maybe PriceRecurring'AggregateUsage'
-> Maybe PriceRecurring'Interval'
-> Maybe Int
-> Maybe PriceRecurring'UsageType'
-> PriceRecurring')
-> Parser (Maybe PriceRecurring'AggregateUsage')
-> Parser
(Maybe PriceRecurring'Interval'
-> Maybe Int -> Maybe PriceRecurring'UsageType' -> PriceRecurring')
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Text -> Parser (Maybe PriceRecurring'AggregateUsage')
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Text
"aggregate_usage")) Parser
(Maybe PriceRecurring'Interval'
-> Maybe Int -> Maybe PriceRecurring'UsageType' -> PriceRecurring')
-> Parser (Maybe PriceRecurring'Interval')
-> Parser
(Maybe Int -> Maybe PriceRecurring'UsageType' -> PriceRecurring')
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Text -> Parser (Maybe PriceRecurring'Interval')
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Text
"interval")) Parser
(Maybe Int -> Maybe PriceRecurring'UsageType' -> PriceRecurring')
-> Parser (Maybe Int)
-> Parser (Maybe PriceRecurring'UsageType' -> PriceRecurring')
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Text -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Text
"interval_count")) Parser (Maybe PriceRecurring'UsageType' -> PriceRecurring')
-> Parser (Maybe PriceRecurring'UsageType')
-> Parser PriceRecurring'
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Text -> Parser (Maybe PriceRecurring'UsageType')
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Text
"usage_type"))
mkPriceRecurring' :: PriceRecurring'
mkPriceRecurring' :: PriceRecurring'
mkPriceRecurring' =
PriceRecurring' :: Maybe PriceRecurring'AggregateUsage'
-> Maybe PriceRecurring'Interval'
-> Maybe Int
-> Maybe PriceRecurring'UsageType'
-> PriceRecurring'
PriceRecurring'
{ priceRecurring'AggregateUsage :: Maybe PriceRecurring'AggregateUsage'
priceRecurring'AggregateUsage = Maybe PriceRecurring'AggregateUsage'
forall a. Maybe a
GHC.Maybe.Nothing,
priceRecurring'Interval :: Maybe PriceRecurring'Interval'
priceRecurring'Interval = Maybe PriceRecurring'Interval'
forall a. Maybe a
GHC.Maybe.Nothing,
priceRecurring'IntervalCount :: Maybe Int
priceRecurring'IntervalCount = Maybe Int
forall a. Maybe a
GHC.Maybe.Nothing,
priceRecurring'UsageType :: Maybe PriceRecurring'UsageType'
priceRecurring'UsageType = Maybe PriceRecurring'UsageType'
forall a. Maybe a
GHC.Maybe.Nothing
}
data PriceRecurring'AggregateUsage'
=
PriceRecurring'AggregateUsage'Other Data.Aeson.Types.Internal.Value
|
PriceRecurring'AggregateUsage'Typed Data.Text.Internal.Text
|
PriceRecurring'AggregateUsage'EnumLastDuringPeriod
|
PriceRecurring'AggregateUsage'EnumLastEver
|
PriceRecurring'AggregateUsage'EnumMax
|
PriceRecurring'AggregateUsage'EnumSum
deriving (Int -> PriceRecurring'AggregateUsage' -> ShowS
[PriceRecurring'AggregateUsage'] -> ShowS
PriceRecurring'AggregateUsage' -> String
(Int -> PriceRecurring'AggregateUsage' -> ShowS)
-> (PriceRecurring'AggregateUsage' -> String)
-> ([PriceRecurring'AggregateUsage'] -> ShowS)
-> Show PriceRecurring'AggregateUsage'
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PriceRecurring'AggregateUsage'] -> ShowS
$cshowList :: [PriceRecurring'AggregateUsage'] -> ShowS
show :: PriceRecurring'AggregateUsage' -> String
$cshow :: PriceRecurring'AggregateUsage' -> String
showsPrec :: Int -> PriceRecurring'AggregateUsage' -> ShowS
$cshowsPrec :: Int -> PriceRecurring'AggregateUsage' -> ShowS
GHC.Show.Show, PriceRecurring'AggregateUsage'
-> PriceRecurring'AggregateUsage' -> Bool
(PriceRecurring'AggregateUsage'
-> PriceRecurring'AggregateUsage' -> Bool)
-> (PriceRecurring'AggregateUsage'
-> PriceRecurring'AggregateUsage' -> Bool)
-> Eq PriceRecurring'AggregateUsage'
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PriceRecurring'AggregateUsage'
-> PriceRecurring'AggregateUsage' -> Bool
$c/= :: PriceRecurring'AggregateUsage'
-> PriceRecurring'AggregateUsage' -> Bool
== :: PriceRecurring'AggregateUsage'
-> PriceRecurring'AggregateUsage' -> Bool
$c== :: PriceRecurring'AggregateUsage'
-> PriceRecurring'AggregateUsage' -> Bool
GHC.Classes.Eq)
instance Data.Aeson.Types.ToJSON.ToJSON PriceRecurring'AggregateUsage' where
toJSON :: PriceRecurring'AggregateUsage' -> Value
toJSON (PriceRecurring'AggregateUsage'Other Value
val) = Value
val
toJSON (PriceRecurring'AggregateUsage'Typed Text
val) = Text -> Value
forall a. ToJSON a => a -> Value
Data.Aeson.Types.ToJSON.toJSON Text
val
toJSON (PriceRecurring'AggregateUsage'
PriceRecurring'AggregateUsage'EnumLastDuringPeriod) = Value
"last_during_period"
toJSON (PriceRecurring'AggregateUsage'
PriceRecurring'AggregateUsage'EnumLastEver) = Value
"last_ever"
toJSON (PriceRecurring'AggregateUsage'
PriceRecurring'AggregateUsage'EnumMax) = Value
"max"
toJSON (PriceRecurring'AggregateUsage'
PriceRecurring'AggregateUsage'EnumSum) = Value
"sum"
instance Data.Aeson.Types.FromJSON.FromJSON PriceRecurring'AggregateUsage' where
parseJSON :: Value -> Parser PriceRecurring'AggregateUsage'
parseJSON Value
val =
PriceRecurring'AggregateUsage'
-> Parser PriceRecurring'AggregateUsage'
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
"last_during_period" -> PriceRecurring'AggregateUsage'
PriceRecurring'AggregateUsage'EnumLastDuringPeriod
| Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"last_ever" -> PriceRecurring'AggregateUsage'
PriceRecurring'AggregateUsage'EnumLastEver
| Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"max" -> PriceRecurring'AggregateUsage'
PriceRecurring'AggregateUsage'EnumMax
| Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"sum" -> PriceRecurring'AggregateUsage'
PriceRecurring'AggregateUsage'EnumSum
| Bool
GHC.Base.otherwise -> Value -> PriceRecurring'AggregateUsage'
PriceRecurring'AggregateUsage'Other Value
val
)
data PriceRecurring'Interval'
=
PriceRecurring'Interval'Other Data.Aeson.Types.Internal.Value
|
PriceRecurring'Interval'Typed Data.Text.Internal.Text
|
PriceRecurring'Interval'EnumDay
|
PriceRecurring'Interval'EnumMonth
|
PriceRecurring'Interval'EnumWeek
|
PriceRecurring'Interval'EnumYear
deriving (Int -> PriceRecurring'Interval' -> ShowS
[PriceRecurring'Interval'] -> ShowS
PriceRecurring'Interval' -> String
(Int -> PriceRecurring'Interval' -> ShowS)
-> (PriceRecurring'Interval' -> String)
-> ([PriceRecurring'Interval'] -> ShowS)
-> Show PriceRecurring'Interval'
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PriceRecurring'Interval'] -> ShowS
$cshowList :: [PriceRecurring'Interval'] -> ShowS
show :: PriceRecurring'Interval' -> String
$cshow :: PriceRecurring'Interval' -> String
showsPrec :: Int -> PriceRecurring'Interval' -> ShowS
$cshowsPrec :: Int -> PriceRecurring'Interval' -> ShowS
GHC.Show.Show, PriceRecurring'Interval' -> PriceRecurring'Interval' -> Bool
(PriceRecurring'Interval' -> PriceRecurring'Interval' -> Bool)
-> (PriceRecurring'Interval' -> PriceRecurring'Interval' -> Bool)
-> Eq PriceRecurring'Interval'
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PriceRecurring'Interval' -> PriceRecurring'Interval' -> Bool
$c/= :: PriceRecurring'Interval' -> PriceRecurring'Interval' -> Bool
== :: PriceRecurring'Interval' -> PriceRecurring'Interval' -> Bool
$c== :: PriceRecurring'Interval' -> PriceRecurring'Interval' -> Bool
GHC.Classes.Eq)
instance Data.Aeson.Types.ToJSON.ToJSON PriceRecurring'Interval' where
toJSON :: PriceRecurring'Interval' -> Value
toJSON (PriceRecurring'Interval'Other Value
val) = Value
val
toJSON (PriceRecurring'Interval'Typed Text
val) = Text -> Value
forall a. ToJSON a => a -> Value
Data.Aeson.Types.ToJSON.toJSON Text
val
toJSON (PriceRecurring'Interval'
PriceRecurring'Interval'EnumDay) = Value
"day"
toJSON (PriceRecurring'Interval'
PriceRecurring'Interval'EnumMonth) = Value
"month"
toJSON (PriceRecurring'Interval'
PriceRecurring'Interval'EnumWeek) = Value
"week"
toJSON (PriceRecurring'Interval'
PriceRecurring'Interval'EnumYear) = Value
"year"
instance Data.Aeson.Types.FromJSON.FromJSON PriceRecurring'Interval' where
parseJSON :: Value -> Parser PriceRecurring'Interval'
parseJSON Value
val =
PriceRecurring'Interval' -> Parser PriceRecurring'Interval'
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
"day" -> PriceRecurring'Interval'
PriceRecurring'Interval'EnumDay
| Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"month" -> PriceRecurring'Interval'
PriceRecurring'Interval'EnumMonth
| Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"week" -> PriceRecurring'Interval'
PriceRecurring'Interval'EnumWeek
| Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"year" -> PriceRecurring'Interval'
PriceRecurring'Interval'EnumYear
| Bool
GHC.Base.otherwise -> Value -> PriceRecurring'Interval'
PriceRecurring'Interval'Other Value
val
)
data PriceRecurring'UsageType'
=
PriceRecurring'UsageType'Other Data.Aeson.Types.Internal.Value
|
PriceRecurring'UsageType'Typed Data.Text.Internal.Text
|
PriceRecurring'UsageType'EnumLicensed
|
PriceRecurring'UsageType'EnumMetered
deriving (Int -> PriceRecurring'UsageType' -> ShowS
[PriceRecurring'UsageType'] -> ShowS
PriceRecurring'UsageType' -> String
(Int -> PriceRecurring'UsageType' -> ShowS)
-> (PriceRecurring'UsageType' -> String)
-> ([PriceRecurring'UsageType'] -> ShowS)
-> Show PriceRecurring'UsageType'
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PriceRecurring'UsageType'] -> ShowS
$cshowList :: [PriceRecurring'UsageType'] -> ShowS
show :: PriceRecurring'UsageType' -> String
$cshow :: PriceRecurring'UsageType' -> String
showsPrec :: Int -> PriceRecurring'UsageType' -> ShowS
$cshowsPrec :: Int -> PriceRecurring'UsageType' -> ShowS
GHC.Show.Show, PriceRecurring'UsageType' -> PriceRecurring'UsageType' -> Bool
(PriceRecurring'UsageType' -> PriceRecurring'UsageType' -> Bool)
-> (PriceRecurring'UsageType' -> PriceRecurring'UsageType' -> Bool)
-> Eq PriceRecurring'UsageType'
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PriceRecurring'UsageType' -> PriceRecurring'UsageType' -> Bool
$c/= :: PriceRecurring'UsageType' -> PriceRecurring'UsageType' -> Bool
== :: PriceRecurring'UsageType' -> PriceRecurring'UsageType' -> Bool
$c== :: PriceRecurring'UsageType' -> PriceRecurring'UsageType' -> Bool
GHC.Classes.Eq)
instance Data.Aeson.Types.ToJSON.ToJSON PriceRecurring'UsageType' where
toJSON :: PriceRecurring'UsageType' -> Value
toJSON (PriceRecurring'UsageType'Other Value
val) = Value
val
toJSON (PriceRecurring'UsageType'Typed Text
val) = Text -> Value
forall a. ToJSON a => a -> Value
Data.Aeson.Types.ToJSON.toJSON Text
val
toJSON (PriceRecurring'UsageType'
PriceRecurring'UsageType'EnumLicensed) = Value
"licensed"
toJSON (PriceRecurring'UsageType'
PriceRecurring'UsageType'EnumMetered) = Value
"metered"
instance Data.Aeson.Types.FromJSON.FromJSON PriceRecurring'UsageType' where
parseJSON :: Value -> Parser PriceRecurring'UsageType'
parseJSON Value
val =
PriceRecurring'UsageType' -> Parser PriceRecurring'UsageType'
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
"licensed" -> PriceRecurring'UsageType'
PriceRecurring'UsageType'EnumLicensed
| Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"metered" -> PriceRecurring'UsageType'
PriceRecurring'UsageType'EnumMetered
| Bool
GHC.Base.otherwise -> Value -> PriceRecurring'UsageType'
PriceRecurring'UsageType'Other Value
val
)
data PriceTaxBehavior'
=
PriceTaxBehavior'Other Data.Aeson.Types.Internal.Value
|
PriceTaxBehavior'Typed Data.Text.Internal.Text
|
PriceTaxBehavior'EnumExclusive
|
PriceTaxBehavior'EnumInclusive
|
PriceTaxBehavior'EnumUnspecified
deriving (Int -> PriceTaxBehavior' -> ShowS
[PriceTaxBehavior'] -> ShowS
PriceTaxBehavior' -> String
(Int -> PriceTaxBehavior' -> ShowS)
-> (PriceTaxBehavior' -> String)
-> ([PriceTaxBehavior'] -> ShowS)
-> Show PriceTaxBehavior'
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PriceTaxBehavior'] -> ShowS
$cshowList :: [PriceTaxBehavior'] -> ShowS
show :: PriceTaxBehavior' -> String
$cshow :: PriceTaxBehavior' -> String
showsPrec :: Int -> PriceTaxBehavior' -> ShowS
$cshowsPrec :: Int -> PriceTaxBehavior' -> ShowS
GHC.Show.Show, PriceTaxBehavior' -> PriceTaxBehavior' -> Bool
(PriceTaxBehavior' -> PriceTaxBehavior' -> Bool)
-> (PriceTaxBehavior' -> PriceTaxBehavior' -> Bool)
-> Eq PriceTaxBehavior'
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PriceTaxBehavior' -> PriceTaxBehavior' -> Bool
$c/= :: PriceTaxBehavior' -> PriceTaxBehavior' -> Bool
== :: PriceTaxBehavior' -> PriceTaxBehavior' -> Bool
$c== :: PriceTaxBehavior' -> PriceTaxBehavior' -> Bool
GHC.Classes.Eq)
instance Data.Aeson.Types.ToJSON.ToJSON PriceTaxBehavior' where
toJSON :: PriceTaxBehavior' -> Value
toJSON (PriceTaxBehavior'Other Value
val) = Value
val
toJSON (PriceTaxBehavior'Typed Text
val) = Text -> Value
forall a. ToJSON a => a -> Value
Data.Aeson.Types.ToJSON.toJSON Text
val
toJSON (PriceTaxBehavior'
PriceTaxBehavior'EnumExclusive) = Value
"exclusive"
toJSON (PriceTaxBehavior'
PriceTaxBehavior'EnumInclusive) = Value
"inclusive"
toJSON (PriceTaxBehavior'
PriceTaxBehavior'EnumUnspecified) = Value
"unspecified"
instance Data.Aeson.Types.FromJSON.FromJSON PriceTaxBehavior' where
parseJSON :: Value -> Parser PriceTaxBehavior'
parseJSON Value
val =
PriceTaxBehavior' -> Parser PriceTaxBehavior'
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
"exclusive" -> PriceTaxBehavior'
PriceTaxBehavior'EnumExclusive
| Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"inclusive" -> PriceTaxBehavior'
PriceTaxBehavior'EnumInclusive
| Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"unspecified" -> PriceTaxBehavior'
PriceTaxBehavior'EnumUnspecified
| Bool
GHC.Base.otherwise -> Value -> PriceTaxBehavior'
PriceTaxBehavior'Other Value
val
)
data PriceTiersMode'
=
PriceTiersMode'Other Data.Aeson.Types.Internal.Value
|
PriceTiersMode'Typed Data.Text.Internal.Text
|
PriceTiersMode'EnumGraduated
|
PriceTiersMode'EnumVolume
deriving (Int -> PriceTiersMode' -> ShowS
[PriceTiersMode'] -> ShowS
PriceTiersMode' -> String
(Int -> PriceTiersMode' -> ShowS)
-> (PriceTiersMode' -> String)
-> ([PriceTiersMode'] -> ShowS)
-> Show PriceTiersMode'
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PriceTiersMode'] -> ShowS
$cshowList :: [PriceTiersMode'] -> ShowS
show :: PriceTiersMode' -> String
$cshow :: PriceTiersMode' -> String
showsPrec :: Int -> PriceTiersMode' -> ShowS
$cshowsPrec :: Int -> PriceTiersMode' -> ShowS
GHC.Show.Show, PriceTiersMode' -> PriceTiersMode' -> Bool
(PriceTiersMode' -> PriceTiersMode' -> Bool)
-> (PriceTiersMode' -> PriceTiersMode' -> Bool)
-> Eq PriceTiersMode'
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PriceTiersMode' -> PriceTiersMode' -> Bool
$c/= :: PriceTiersMode' -> PriceTiersMode' -> Bool
== :: PriceTiersMode' -> PriceTiersMode' -> Bool
$c== :: PriceTiersMode' -> PriceTiersMode' -> Bool
GHC.Classes.Eq)
instance Data.Aeson.Types.ToJSON.ToJSON PriceTiersMode' where
toJSON :: PriceTiersMode' -> Value
toJSON (PriceTiersMode'Other Value
val) = Value
val
toJSON (PriceTiersMode'Typed Text
val) = Text -> Value
forall a. ToJSON a => a -> Value
Data.Aeson.Types.ToJSON.toJSON Text
val
toJSON (PriceTiersMode'
PriceTiersMode'EnumGraduated) = Value
"graduated"
toJSON (PriceTiersMode'
PriceTiersMode'EnumVolume) = Value
"volume"
instance Data.Aeson.Types.FromJSON.FromJSON PriceTiersMode' where
parseJSON :: Value -> Parser PriceTiersMode'
parseJSON Value
val =
PriceTiersMode' -> Parser PriceTiersMode'
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
"graduated" -> PriceTiersMode'
PriceTiersMode'EnumGraduated
| Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"volume" -> PriceTiersMode'
PriceTiersMode'EnumVolume
| Bool
GHC.Base.otherwise -> Value -> PriceTiersMode'
PriceTiersMode'Other Value
val
)
data PriceTransformQuantity' = PriceTransformQuantity'
{
PriceTransformQuantity' -> Maybe Int
priceTransformQuantity'DivideBy :: (GHC.Maybe.Maybe GHC.Types.Int),
PriceTransformQuantity' -> Maybe PriceTransformQuantity'Round'
priceTransformQuantity'Round :: (GHC.Maybe.Maybe PriceTransformQuantity'Round')
}
deriving
( Int -> PriceTransformQuantity' -> ShowS
[PriceTransformQuantity'] -> ShowS
PriceTransformQuantity' -> String
(Int -> PriceTransformQuantity' -> ShowS)
-> (PriceTransformQuantity' -> String)
-> ([PriceTransformQuantity'] -> ShowS)
-> Show PriceTransformQuantity'
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PriceTransformQuantity'] -> ShowS
$cshowList :: [PriceTransformQuantity'] -> ShowS
show :: PriceTransformQuantity' -> String
$cshow :: PriceTransformQuantity' -> String
showsPrec :: Int -> PriceTransformQuantity' -> ShowS
$cshowsPrec :: Int -> PriceTransformQuantity' -> ShowS
GHC.Show.Show,
PriceTransformQuantity' -> PriceTransformQuantity' -> Bool
(PriceTransformQuantity' -> PriceTransformQuantity' -> Bool)
-> (PriceTransformQuantity' -> PriceTransformQuantity' -> Bool)
-> Eq PriceTransformQuantity'
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PriceTransformQuantity' -> PriceTransformQuantity' -> Bool
$c/= :: PriceTransformQuantity' -> PriceTransformQuantity' -> Bool
== :: PriceTransformQuantity' -> PriceTransformQuantity' -> Bool
$c== :: PriceTransformQuantity' -> PriceTransformQuantity' -> Bool
GHC.Classes.Eq
)
instance Data.Aeson.Types.ToJSON.ToJSON PriceTransformQuantity' where
toJSON :: PriceTransformQuantity' -> Value
toJSON PriceTransformQuantity'
obj = [Pair] -> Value
Data.Aeson.Types.Internal.object (Text
"divide_by" Text -> Maybe Int -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= PriceTransformQuantity' -> Maybe Int
priceTransformQuantity'DivideBy PriceTransformQuantity'
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"round" Text -> Maybe PriceTransformQuantity'Round' -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= PriceTransformQuantity' -> Maybe PriceTransformQuantity'Round'
priceTransformQuantity'Round PriceTransformQuantity'
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: [Pair]
forall a. Monoid a => a
GHC.Base.mempty)
toEncoding :: PriceTransformQuantity' -> Encoding
toEncoding PriceTransformQuantity'
obj = Series -> Encoding
Data.Aeson.Encoding.Internal.pairs ((Text
"divide_by" Text -> Maybe Int -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= PriceTransformQuantity' -> Maybe Int
priceTransformQuantity'DivideBy PriceTransformQuantity'
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> (Text
"round" Text -> Maybe PriceTransformQuantity'Round' -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= PriceTransformQuantity' -> Maybe PriceTransformQuantity'Round'
priceTransformQuantity'Round PriceTransformQuantity'
obj))
instance Data.Aeson.Types.FromJSON.FromJSON PriceTransformQuantity' where
parseJSON :: Value -> Parser PriceTransformQuantity'
parseJSON = String
-> (Object -> Parser PriceTransformQuantity')
-> Value
-> Parser PriceTransformQuantity'
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.Aeson.Types.FromJSON.withObject String
"PriceTransformQuantity'" (\Object
obj -> ((Maybe Int
-> Maybe PriceTransformQuantity'Round' -> PriceTransformQuantity')
-> Parser
(Maybe Int
-> Maybe PriceTransformQuantity'Round' -> PriceTransformQuantity')
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure Maybe Int
-> Maybe PriceTransformQuantity'Round' -> PriceTransformQuantity'
PriceTransformQuantity' Parser
(Maybe Int
-> Maybe PriceTransformQuantity'Round' -> PriceTransformQuantity')
-> Parser (Maybe Int)
-> Parser
(Maybe PriceTransformQuantity'Round' -> PriceTransformQuantity')
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Text -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Text
"divide_by")) Parser
(Maybe PriceTransformQuantity'Round' -> PriceTransformQuantity')
-> Parser (Maybe PriceTransformQuantity'Round')
-> Parser PriceTransformQuantity'
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Text -> Parser (Maybe PriceTransformQuantity'Round')
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Text
"round"))
mkPriceTransformQuantity' :: PriceTransformQuantity'
mkPriceTransformQuantity' :: PriceTransformQuantity'
mkPriceTransformQuantity' =
PriceTransformQuantity' :: Maybe Int
-> Maybe PriceTransformQuantity'Round' -> PriceTransformQuantity'
PriceTransformQuantity'
{ priceTransformQuantity'DivideBy :: Maybe Int
priceTransformQuantity'DivideBy = Maybe Int
forall a. Maybe a
GHC.Maybe.Nothing,
priceTransformQuantity'Round :: Maybe PriceTransformQuantity'Round'
priceTransformQuantity'Round = Maybe PriceTransformQuantity'Round'
forall a. Maybe a
GHC.Maybe.Nothing
}
data PriceTransformQuantity'Round'
=
PriceTransformQuantity'Round'Other Data.Aeson.Types.Internal.Value
|
PriceTransformQuantity'Round'Typed Data.Text.Internal.Text
|
PriceTransformQuantity'Round'EnumDown
|
PriceTransformQuantity'Round'EnumUp
deriving (Int -> PriceTransformQuantity'Round' -> ShowS
[PriceTransformQuantity'Round'] -> ShowS
PriceTransformQuantity'Round' -> String
(Int -> PriceTransformQuantity'Round' -> ShowS)
-> (PriceTransformQuantity'Round' -> String)
-> ([PriceTransformQuantity'Round'] -> ShowS)
-> Show PriceTransformQuantity'Round'
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PriceTransformQuantity'Round'] -> ShowS
$cshowList :: [PriceTransformQuantity'Round'] -> ShowS
show :: PriceTransformQuantity'Round' -> String
$cshow :: PriceTransformQuantity'Round' -> String
showsPrec :: Int -> PriceTransformQuantity'Round' -> ShowS
$cshowsPrec :: Int -> PriceTransformQuantity'Round' -> ShowS
GHC.Show.Show, PriceTransformQuantity'Round'
-> PriceTransformQuantity'Round' -> Bool
(PriceTransformQuantity'Round'
-> PriceTransformQuantity'Round' -> Bool)
-> (PriceTransformQuantity'Round'
-> PriceTransformQuantity'Round' -> Bool)
-> Eq PriceTransformQuantity'Round'
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PriceTransformQuantity'Round'
-> PriceTransformQuantity'Round' -> Bool
$c/= :: PriceTransformQuantity'Round'
-> PriceTransformQuantity'Round' -> Bool
== :: PriceTransformQuantity'Round'
-> PriceTransformQuantity'Round' -> Bool
$c== :: PriceTransformQuantity'Round'
-> PriceTransformQuantity'Round' -> Bool
GHC.Classes.Eq)
instance Data.Aeson.Types.ToJSON.ToJSON PriceTransformQuantity'Round' where
toJSON :: PriceTransformQuantity'Round' -> Value
toJSON (PriceTransformQuantity'Round'Other Value
val) = Value
val
toJSON (PriceTransformQuantity'Round'Typed Text
val) = Text -> Value
forall a. ToJSON a => a -> Value
Data.Aeson.Types.ToJSON.toJSON Text
val
toJSON (PriceTransformQuantity'Round'
PriceTransformQuantity'Round'EnumDown) = Value
"down"
toJSON (PriceTransformQuantity'Round'
PriceTransformQuantity'Round'EnumUp) = Value
"up"
instance Data.Aeson.Types.FromJSON.FromJSON PriceTransformQuantity'Round' where
parseJSON :: Value -> Parser PriceTransformQuantity'Round'
parseJSON Value
val =
PriceTransformQuantity'Round'
-> Parser PriceTransformQuantity'Round'
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
"down" -> PriceTransformQuantity'Round'
PriceTransformQuantity'Round'EnumDown
| Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"up" -> PriceTransformQuantity'Round'
PriceTransformQuantity'Round'EnumUp
| Bool
GHC.Base.otherwise -> Value -> PriceTransformQuantity'Round'
PriceTransformQuantity'Round'Other Value
val
)
data PriceType'
=
PriceType'Other Data.Aeson.Types.Internal.Value
|
PriceType'Typed Data.Text.Internal.Text
|
PriceType'EnumOneTime
|
PriceType'EnumRecurring
deriving (Int -> PriceType' -> ShowS
[PriceType'] -> ShowS
PriceType' -> String
(Int -> PriceType' -> ShowS)
-> (PriceType' -> String)
-> ([PriceType'] -> ShowS)
-> Show PriceType'
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PriceType'] -> ShowS
$cshowList :: [PriceType'] -> ShowS
show :: PriceType' -> String
$cshow :: PriceType' -> String
showsPrec :: Int -> PriceType' -> ShowS
$cshowsPrec :: Int -> PriceType' -> ShowS
GHC.Show.Show, PriceType' -> PriceType' -> Bool
(PriceType' -> PriceType' -> Bool)
-> (PriceType' -> PriceType' -> Bool) -> Eq PriceType'
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PriceType' -> PriceType' -> Bool
$c/= :: PriceType' -> PriceType' -> Bool
== :: PriceType' -> PriceType' -> Bool
$c== :: PriceType' -> PriceType' -> Bool
GHC.Classes.Eq)
instance Data.Aeson.Types.ToJSON.ToJSON PriceType' where
toJSON :: PriceType' -> Value
toJSON (PriceType'Other Value
val) = Value
val
toJSON (PriceType'Typed Text
val) = Text -> Value
forall a. ToJSON a => a -> Value
Data.Aeson.Types.ToJSON.toJSON Text
val
toJSON (PriceType'
PriceType'EnumOneTime) = Value
"one_time"
toJSON (PriceType'
PriceType'EnumRecurring) = Value
"recurring"
instance Data.Aeson.Types.FromJSON.FromJSON PriceType' where
parseJSON :: Value -> Parser PriceType'
parseJSON Value
val =
PriceType' -> Parser PriceType'
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
"one_time" -> PriceType'
PriceType'EnumOneTime
| Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"recurring" -> PriceType'
PriceType'EnumRecurring
| Bool
GHC.Base.otherwise -> Value -> PriceType'
PriceType'Other Value
val
)