{-# LANGUAGE MultiWayIf #-}
{-# LANGUAGE OverloadedStrings #-}
module RecurlyClient.Types.LineItemCreate 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
import qualified Data.ByteString as Data.ByteString.Internal
import qualified Data.Foldable
import qualified Data.Functor
import qualified Data.Maybe
import qualified Data.Scientific
import qualified Data.Text
import qualified Data.Text as 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 RecurlyClient.Common
import RecurlyClient.TypeAlias
import qualified Prelude as GHC.Integer.Type
import qualified Prelude as GHC.Maybe
data LineItemCreate = LineItemCreate
{ LineItemCreate -> Maybe Text
lineItemCreateAccounting_code :: (GHC.Maybe.Maybe Data.Text.Internal.Text)
, LineItemCreate -> Maybe Int
lineItemCreateAvalara_service_type :: (GHC.Maybe.Maybe GHC.Types.Int)
, LineItemCreate -> Maybe Int
lineItemCreateAvalara_transaction_type :: (GHC.Maybe.Maybe GHC.Types.Int)
, LineItemCreate -> Maybe LineItemCreateCredit_reason_code
lineItemCreateCredit_reason_code :: (GHC.Maybe.Maybe LineItemCreateCredit_reason_code)
, LineItemCreate -> Text
lineItemCreateCurrency :: Data.Text.Internal.Text
, LineItemCreate -> Maybe CustomFields
lineItemCreateCustom_fields :: (GHC.Maybe.Maybe CustomFields)
, LineItemCreate -> Maybe Text
lineItemCreateDescription :: (GHC.Maybe.Maybe Data.Text.Internal.Text)
, LineItemCreate
-> Maybe LineItemCreateDestination_tax_address_source
lineItemCreateDestination_tax_address_source :: (GHC.Maybe.Maybe LineItemCreateDestination_tax_address_source)
, LineItemCreate -> Maybe JsonDateTime
lineItemCreateEnd_date :: (GHC.Maybe.Maybe RecurlyClient.Common.JsonDateTime)
, LineItemCreate -> Maybe Text
lineItemCreateItem_code :: (GHC.Maybe.Maybe Data.Text.Internal.Text)
, LineItemCreate -> Maybe Text
lineItemCreateItem_id :: (GHC.Maybe.Maybe Data.Text.Internal.Text)
, LineItemCreate -> Maybe Text
lineItemCreateLiability_gl_account_id :: (GHC.Maybe.Maybe Data.Text.Internal.Text)
, LineItemCreate -> Maybe LineItemCreateOrigin
lineItemCreateOrigin :: (GHC.Maybe.Maybe LineItemCreateOrigin)
, LineItemCreate -> Maybe LineItemCreateOrigin_tax_address_source
lineItemCreateOrigin_tax_address_source :: (GHC.Maybe.Maybe LineItemCreateOrigin_tax_address_source)
, LineItemCreate -> Maybe Text
lineItemCreatePerformance_obligation_id :: (GHC.Maybe.Maybe Data.Text.Internal.Text)
, LineItemCreate -> Maybe Text
lineItemCreateProduct_code :: (GHC.Maybe.Maybe Data.Text.Internal.Text)
, LineItemCreate -> Maybe Int
lineItemCreateQuantity :: (GHC.Maybe.Maybe GHC.Types.Int)
, LineItemCreate -> Maybe Text
lineItemCreateRevenue_gl_account_id :: (GHC.Maybe.Maybe Data.Text.Internal.Text)
, LineItemCreate -> Maybe LineItemCreateRevenue_schedule_type
lineItemCreateRevenue_schedule_type :: (GHC.Maybe.Maybe LineItemCreateRevenue_schedule_type)
, LineItemCreate -> Maybe JsonDateTime
lineItemCreateStart_date :: (GHC.Maybe.Maybe RecurlyClient.Common.JsonDateTime)
, LineItemCreate -> Maybe Text
lineItemCreateTax_code :: (GHC.Maybe.Maybe Data.Text.Internal.Text)
, LineItemCreate -> Maybe Bool
lineItemCreateTax_exempt :: (GHC.Maybe.Maybe GHC.Types.Bool)
, LineItemCreate -> Maybe Bool
lineItemCreateTax_inclusive :: (GHC.Maybe.Maybe GHC.Types.Bool)
, LineItemCreate -> LineItemCreateType
lineItemCreateType :: LineItemCreateType
, LineItemCreate -> Float
lineItemCreateUnit_amount :: GHC.Types.Float
}
deriving
( Int -> LineItemCreate -> ShowS
[LineItemCreate] -> ShowS
LineItemCreate -> String
(Int -> LineItemCreate -> ShowS)
-> (LineItemCreate -> String)
-> ([LineItemCreate] -> ShowS)
-> Show LineItemCreate
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> LineItemCreate -> ShowS
showsPrec :: Int -> LineItemCreate -> ShowS
$cshow :: LineItemCreate -> String
show :: LineItemCreate -> String
$cshowList :: [LineItemCreate] -> ShowS
showList :: [LineItemCreate] -> ShowS
GHC.Show.Show
, LineItemCreate -> LineItemCreate -> Bool
(LineItemCreate -> LineItemCreate -> Bool)
-> (LineItemCreate -> LineItemCreate -> Bool) -> Eq LineItemCreate
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: LineItemCreate -> LineItemCreate -> Bool
== :: LineItemCreate -> LineItemCreate -> Bool
$c/= :: LineItemCreate -> LineItemCreate -> Bool
/= :: LineItemCreate -> LineItemCreate -> Bool
GHC.Classes.Eq
)
instance Data.Aeson.Types.ToJSON.ToJSON LineItemCreate where
toJSON :: LineItemCreate -> Value
toJSON LineItemCreate
obj = [Pair] -> Value
Data.Aeson.Types.Internal.object ([[Pair]] -> [Pair]
forall (t :: * -> *) a. Foldable t => t [a] -> [a]
Data.Foldable.concat ([Pair] -> (Text -> [Pair]) -> Maybe Text -> [Pair]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Pair]
forall a. Monoid a => a
GHC.Base.mempty (Pair -> [Pair]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Pair -> [Pair]) -> (Text -> Pair) -> Text -> [Pair]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"accounting_code" Key -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..=)) (LineItemCreate -> Maybe Text
lineItemCreateAccounting_code LineItemCreate
obj) [Pair] -> [[Pair]] -> [[Pair]]
forall a. a -> [a] -> [a]
: [Pair] -> (Int -> [Pair]) -> Maybe Int -> [Pair]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Pair]
forall a. Monoid a => a
GHC.Base.mempty (Pair -> [Pair]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Pair -> [Pair]) -> (Int -> Pair) -> Int -> [Pair]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"avalara_service_type" Key -> Int -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..=)) (LineItemCreate -> Maybe Int
lineItemCreateAvalara_service_type LineItemCreate
obj) [Pair] -> [[Pair]] -> [[Pair]]
forall a. a -> [a] -> [a]
: [Pair] -> (Int -> [Pair]) -> Maybe Int -> [Pair]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Pair]
forall a. Monoid a => a
GHC.Base.mempty (Pair -> [Pair]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Pair -> [Pair]) -> (Int -> Pair) -> Int -> [Pair]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"avalara_transaction_type" Key -> Int -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..=)) (LineItemCreate -> Maybe Int
lineItemCreateAvalara_transaction_type LineItemCreate
obj) [Pair] -> [[Pair]] -> [[Pair]]
forall a. a -> [a] -> [a]
: [Pair]
-> (LineItemCreateCredit_reason_code -> [Pair])
-> Maybe LineItemCreateCredit_reason_code
-> [Pair]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Pair]
forall a. Monoid a => a
GHC.Base.mempty (Pair -> [Pair]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Pair -> [Pair])
-> (LineItemCreateCredit_reason_code -> Pair)
-> LineItemCreateCredit_reason_code
-> [Pair]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"credit_reason_code" Key -> LineItemCreateCredit_reason_code -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..=)) (LineItemCreate -> Maybe LineItemCreateCredit_reason_code
lineItemCreateCredit_reason_code LineItemCreate
obj) [Pair] -> [[Pair]] -> [[Pair]]
forall a. a -> [a] -> [a]
: [Key
"currency" Key -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..= LineItemCreate -> Text
lineItemCreateCurrency LineItemCreate
obj] [Pair] -> [[Pair]] -> [[Pair]]
forall a. a -> [a] -> [a]
: [Pair] -> (CustomFields -> [Pair]) -> Maybe CustomFields -> [Pair]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Pair]
forall a. Monoid a => a
GHC.Base.mempty (Pair -> [Pair]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Pair -> [Pair])
-> (CustomFields -> Pair) -> CustomFields -> [Pair]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"custom_fields" Key -> CustomFields -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..=)) (LineItemCreate -> Maybe CustomFields
lineItemCreateCustom_fields LineItemCreate
obj) [Pair] -> [[Pair]] -> [[Pair]]
forall a. a -> [a] -> [a]
: [Pair] -> (Text -> [Pair]) -> Maybe Text -> [Pair]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Pair]
forall a. Monoid a => a
GHC.Base.mempty (Pair -> [Pair]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Pair -> [Pair]) -> (Text -> Pair) -> Text -> [Pair]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"description" Key -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..=)) (LineItemCreate -> Maybe Text
lineItemCreateDescription LineItemCreate
obj) [Pair] -> [[Pair]] -> [[Pair]]
forall a. a -> [a] -> [a]
: [Pair]
-> (LineItemCreateDestination_tax_address_source -> [Pair])
-> Maybe LineItemCreateDestination_tax_address_source
-> [Pair]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Pair]
forall a. Monoid a => a
GHC.Base.mempty (Pair -> [Pair]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Pair -> [Pair])
-> (LineItemCreateDestination_tax_address_source -> Pair)
-> LineItemCreateDestination_tax_address_source
-> [Pair]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"destination_tax_address_source" Key -> LineItemCreateDestination_tax_address_source -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..=)) (LineItemCreate
-> Maybe LineItemCreateDestination_tax_address_source
lineItemCreateDestination_tax_address_source LineItemCreate
obj) [Pair] -> [[Pair]] -> [[Pair]]
forall a. a -> [a] -> [a]
: [Pair] -> (JsonDateTime -> [Pair]) -> Maybe JsonDateTime -> [Pair]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Pair]
forall a. Monoid a => a
GHC.Base.mempty (Pair -> [Pair]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Pair -> [Pair])
-> (JsonDateTime -> Pair) -> JsonDateTime -> [Pair]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"end_date" Key -> JsonDateTime -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..=)) (LineItemCreate -> Maybe JsonDateTime
lineItemCreateEnd_date LineItemCreate
obj) [Pair] -> [[Pair]] -> [[Pair]]
forall a. a -> [a] -> [a]
: [Pair] -> (Text -> [Pair]) -> Maybe Text -> [Pair]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Pair]
forall a. Monoid a => a
GHC.Base.mempty (Pair -> [Pair]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Pair -> [Pair]) -> (Text -> Pair) -> Text -> [Pair]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"item_code" Key -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..=)) (LineItemCreate -> Maybe Text
lineItemCreateItem_code LineItemCreate
obj) [Pair] -> [[Pair]] -> [[Pair]]
forall a. a -> [a] -> [a]
: [Pair] -> (Text -> [Pair]) -> Maybe Text -> [Pair]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Pair]
forall a. Monoid a => a
GHC.Base.mempty (Pair -> [Pair]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Pair -> [Pair]) -> (Text -> Pair) -> Text -> [Pair]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"item_id" Key -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..=)) (LineItemCreate -> Maybe Text
lineItemCreateItem_id LineItemCreate
obj) [Pair] -> [[Pair]] -> [[Pair]]
forall a. a -> [a] -> [a]
: [Pair] -> (Text -> [Pair]) -> Maybe Text -> [Pair]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Pair]
forall a. Monoid a => a
GHC.Base.mempty (Pair -> [Pair]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Pair -> [Pair]) -> (Text -> Pair) -> Text -> [Pair]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"liability_gl_account_id" Key -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..=)) (LineItemCreate -> Maybe Text
lineItemCreateLiability_gl_account_id LineItemCreate
obj) [Pair] -> [[Pair]] -> [[Pair]]
forall a. a -> [a] -> [a]
: [Pair]
-> (LineItemCreateOrigin -> [Pair])
-> Maybe LineItemCreateOrigin
-> [Pair]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Pair]
forall a. Monoid a => a
GHC.Base.mempty (Pair -> [Pair]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Pair -> [Pair])
-> (LineItemCreateOrigin -> Pair) -> LineItemCreateOrigin -> [Pair]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"origin" Key -> LineItemCreateOrigin -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..=)) (LineItemCreate -> Maybe LineItemCreateOrigin
lineItemCreateOrigin LineItemCreate
obj) [Pair] -> [[Pair]] -> [[Pair]]
forall a. a -> [a] -> [a]
: [Pair]
-> (LineItemCreateOrigin_tax_address_source -> [Pair])
-> Maybe LineItemCreateOrigin_tax_address_source
-> [Pair]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Pair]
forall a. Monoid a => a
GHC.Base.mempty (Pair -> [Pair]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Pair -> [Pair])
-> (LineItemCreateOrigin_tax_address_source -> Pair)
-> LineItemCreateOrigin_tax_address_source
-> [Pair]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"origin_tax_address_source" Key -> LineItemCreateOrigin_tax_address_source -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..=)) (LineItemCreate -> Maybe LineItemCreateOrigin_tax_address_source
lineItemCreateOrigin_tax_address_source LineItemCreate
obj) [Pair] -> [[Pair]] -> [[Pair]]
forall a. a -> [a] -> [a]
: [Pair] -> (Text -> [Pair]) -> Maybe Text -> [Pair]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Pair]
forall a. Monoid a => a
GHC.Base.mempty (Pair -> [Pair]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Pair -> [Pair]) -> (Text -> Pair) -> Text -> [Pair]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"performance_obligation_id" Key -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..=)) (LineItemCreate -> Maybe Text
lineItemCreatePerformance_obligation_id LineItemCreate
obj) [Pair] -> [[Pair]] -> [[Pair]]
forall a. a -> [a] -> [a]
: [Pair] -> (Text -> [Pair]) -> Maybe Text -> [Pair]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Pair]
forall a. Monoid a => a
GHC.Base.mempty (Pair -> [Pair]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Pair -> [Pair]) -> (Text -> Pair) -> Text -> [Pair]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"product_code" Key -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..=)) (LineItemCreate -> Maybe Text
lineItemCreateProduct_code LineItemCreate
obj) [Pair] -> [[Pair]] -> [[Pair]]
forall a. a -> [a] -> [a]
: [Pair] -> (Int -> [Pair]) -> Maybe Int -> [Pair]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Pair]
forall a. Monoid a => a
GHC.Base.mempty (Pair -> [Pair]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Pair -> [Pair]) -> (Int -> Pair) -> Int -> [Pair]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"quantity" Key -> Int -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..=)) (LineItemCreate -> Maybe Int
lineItemCreateQuantity LineItemCreate
obj) [Pair] -> [[Pair]] -> [[Pair]]
forall a. a -> [a] -> [a]
: [Pair] -> (Text -> [Pair]) -> Maybe Text -> [Pair]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Pair]
forall a. Monoid a => a
GHC.Base.mempty (Pair -> [Pair]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Pair -> [Pair]) -> (Text -> Pair) -> Text -> [Pair]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"revenue_gl_account_id" Key -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..=)) (LineItemCreate -> Maybe Text
lineItemCreateRevenue_gl_account_id LineItemCreate
obj) [Pair] -> [[Pair]] -> [[Pair]]
forall a. a -> [a] -> [a]
: [Pair]
-> (LineItemCreateRevenue_schedule_type -> [Pair])
-> Maybe LineItemCreateRevenue_schedule_type
-> [Pair]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Pair]
forall a. Monoid a => a
GHC.Base.mempty (Pair -> [Pair]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Pair -> [Pair])
-> (LineItemCreateRevenue_schedule_type -> Pair)
-> LineItemCreateRevenue_schedule_type
-> [Pair]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"revenue_schedule_type" Key -> LineItemCreateRevenue_schedule_type -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..=)) (LineItemCreate -> Maybe LineItemCreateRevenue_schedule_type
lineItemCreateRevenue_schedule_type LineItemCreate
obj) [Pair] -> [[Pair]] -> [[Pair]]
forall a. a -> [a] -> [a]
: [Pair] -> (JsonDateTime -> [Pair]) -> Maybe JsonDateTime -> [Pair]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Pair]
forall a. Monoid a => a
GHC.Base.mempty (Pair -> [Pair]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Pair -> [Pair])
-> (JsonDateTime -> Pair) -> JsonDateTime -> [Pair]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"start_date" Key -> JsonDateTime -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..=)) (LineItemCreate -> Maybe JsonDateTime
lineItemCreateStart_date LineItemCreate
obj) [Pair] -> [[Pair]] -> [[Pair]]
forall a. a -> [a] -> [a]
: [Pair] -> (Text -> [Pair]) -> Maybe Text -> [Pair]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Pair]
forall a. Monoid a => a
GHC.Base.mempty (Pair -> [Pair]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Pair -> [Pair]) -> (Text -> Pair) -> Text -> [Pair]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"tax_code" Key -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..=)) (LineItemCreate -> Maybe Text
lineItemCreateTax_code LineItemCreate
obj) [Pair] -> [[Pair]] -> [[Pair]]
forall a. a -> [a] -> [a]
: [Pair] -> (Bool -> [Pair]) -> Maybe Bool -> [Pair]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Pair]
forall a. Monoid a => a
GHC.Base.mempty (Pair -> [Pair]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Pair -> [Pair]) -> (Bool -> Pair) -> Bool -> [Pair]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"tax_exempt" Key -> Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..=)) (LineItemCreate -> Maybe Bool
lineItemCreateTax_exempt LineItemCreate
obj) [Pair] -> [[Pair]] -> [[Pair]]
forall a. a -> [a] -> [a]
: [Pair] -> (Bool -> [Pair]) -> Maybe Bool -> [Pair]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Pair]
forall a. Monoid a => a
GHC.Base.mempty (Pair -> [Pair]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Pair -> [Pair]) -> (Bool -> Pair) -> Bool -> [Pair]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"tax_inclusive" Key -> Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..=)) (LineItemCreate -> Maybe Bool
lineItemCreateTax_inclusive LineItemCreate
obj) [Pair] -> [[Pair]] -> [[Pair]]
forall a. a -> [a] -> [a]
: [Key
"type" Key -> LineItemCreateType -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..= LineItemCreate -> LineItemCreateType
lineItemCreateType LineItemCreate
obj] [Pair] -> [[Pair]] -> [[Pair]]
forall a. a -> [a] -> [a]
: [Key
"unit_amount" Key -> Float -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..= LineItemCreate -> Float
lineItemCreateUnit_amount LineItemCreate
obj] [Pair] -> [[Pair]] -> [[Pair]]
forall a. a -> [a] -> [a]
: [[Pair]]
forall a. Monoid a => a
GHC.Base.mempty))
toEncoding :: LineItemCreate -> Encoding
toEncoding LineItemCreate
obj = Series -> Encoding
Data.Aeson.Encoding.Internal.pairs ([Series] -> Series
forall a. Monoid a => [a] -> a
GHC.Base.mconcat ([[Series]] -> [Series]
forall (t :: * -> *) a. Foldable t => t [a] -> [a]
Data.Foldable.concat ([Series] -> (Text -> [Series]) -> Maybe Text -> [Series]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Series]
forall a. Monoid a => a
GHC.Base.mempty (Series -> [Series]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Series -> [Series]) -> (Text -> Series) -> Text -> [Series]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"accounting_code" Key -> Text -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..=)) (LineItemCreate -> Maybe Text
lineItemCreateAccounting_code LineItemCreate
obj) [Series] -> [[Series]] -> [[Series]]
forall a. a -> [a] -> [a]
: [Series] -> (Int -> [Series]) -> Maybe Int -> [Series]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Series]
forall a. Monoid a => a
GHC.Base.mempty (Series -> [Series]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Series -> [Series]) -> (Int -> Series) -> Int -> [Series]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"avalara_service_type" Key -> Int -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..=)) (LineItemCreate -> Maybe Int
lineItemCreateAvalara_service_type LineItemCreate
obj) [Series] -> [[Series]] -> [[Series]]
forall a. a -> [a] -> [a]
: [Series] -> (Int -> [Series]) -> Maybe Int -> [Series]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Series]
forall a. Monoid a => a
GHC.Base.mempty (Series -> [Series]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Series -> [Series]) -> (Int -> Series) -> Int -> [Series]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"avalara_transaction_type" Key -> Int -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..=)) (LineItemCreate -> Maybe Int
lineItemCreateAvalara_transaction_type LineItemCreate
obj) [Series] -> [[Series]] -> [[Series]]
forall a. a -> [a] -> [a]
: [Series]
-> (LineItemCreateCredit_reason_code -> [Series])
-> Maybe LineItemCreateCredit_reason_code
-> [Series]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Series]
forall a. Monoid a => a
GHC.Base.mempty (Series -> [Series]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Series -> [Series])
-> (LineItemCreateCredit_reason_code -> Series)
-> LineItemCreateCredit_reason_code
-> [Series]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"credit_reason_code" Key -> LineItemCreateCredit_reason_code -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..=)) (LineItemCreate -> Maybe LineItemCreateCredit_reason_code
lineItemCreateCredit_reason_code LineItemCreate
obj) [Series] -> [[Series]] -> [[Series]]
forall a. a -> [a] -> [a]
: [Key
"currency" Key -> Text -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..= LineItemCreate -> Text
lineItemCreateCurrency LineItemCreate
obj] [Series] -> [[Series]] -> [[Series]]
forall a. a -> [a] -> [a]
: [Series]
-> (CustomFields -> [Series]) -> Maybe CustomFields -> [Series]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Series]
forall a. Monoid a => a
GHC.Base.mempty (Series -> [Series]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Series -> [Series])
-> (CustomFields -> Series) -> CustomFields -> [Series]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"custom_fields" Key -> CustomFields -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..=)) (LineItemCreate -> Maybe CustomFields
lineItemCreateCustom_fields LineItemCreate
obj) [Series] -> [[Series]] -> [[Series]]
forall a. a -> [a] -> [a]
: [Series] -> (Text -> [Series]) -> Maybe Text -> [Series]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Series]
forall a. Monoid a => a
GHC.Base.mempty (Series -> [Series]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Series -> [Series]) -> (Text -> Series) -> Text -> [Series]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"description" Key -> Text -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..=)) (LineItemCreate -> Maybe Text
lineItemCreateDescription LineItemCreate
obj) [Series] -> [[Series]] -> [[Series]]
forall a. a -> [a] -> [a]
: [Series]
-> (LineItemCreateDestination_tax_address_source -> [Series])
-> Maybe LineItemCreateDestination_tax_address_source
-> [Series]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Series]
forall a. Monoid a => a
GHC.Base.mempty (Series -> [Series]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Series -> [Series])
-> (LineItemCreateDestination_tax_address_source -> Series)
-> LineItemCreateDestination_tax_address_source
-> [Series]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"destination_tax_address_source" Key -> LineItemCreateDestination_tax_address_source -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..=)) (LineItemCreate
-> Maybe LineItemCreateDestination_tax_address_source
lineItemCreateDestination_tax_address_source LineItemCreate
obj) [Series] -> [[Series]] -> [[Series]]
forall a. a -> [a] -> [a]
: [Series]
-> (JsonDateTime -> [Series]) -> Maybe JsonDateTime -> [Series]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Series]
forall a. Monoid a => a
GHC.Base.mempty (Series -> [Series]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Series -> [Series])
-> (JsonDateTime -> Series) -> JsonDateTime -> [Series]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"end_date" Key -> JsonDateTime -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..=)) (LineItemCreate -> Maybe JsonDateTime
lineItemCreateEnd_date LineItemCreate
obj) [Series] -> [[Series]] -> [[Series]]
forall a. a -> [a] -> [a]
: [Series] -> (Text -> [Series]) -> Maybe Text -> [Series]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Series]
forall a. Monoid a => a
GHC.Base.mempty (Series -> [Series]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Series -> [Series]) -> (Text -> Series) -> Text -> [Series]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"item_code" Key -> Text -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..=)) (LineItemCreate -> Maybe Text
lineItemCreateItem_code LineItemCreate
obj) [Series] -> [[Series]] -> [[Series]]
forall a. a -> [a] -> [a]
: [Series] -> (Text -> [Series]) -> Maybe Text -> [Series]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Series]
forall a. Monoid a => a
GHC.Base.mempty (Series -> [Series]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Series -> [Series]) -> (Text -> Series) -> Text -> [Series]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"item_id" Key -> Text -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..=)) (LineItemCreate -> Maybe Text
lineItemCreateItem_id LineItemCreate
obj) [Series] -> [[Series]] -> [[Series]]
forall a. a -> [a] -> [a]
: [Series] -> (Text -> [Series]) -> Maybe Text -> [Series]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Series]
forall a. Monoid a => a
GHC.Base.mempty (Series -> [Series]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Series -> [Series]) -> (Text -> Series) -> Text -> [Series]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"liability_gl_account_id" Key -> Text -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..=)) (LineItemCreate -> Maybe Text
lineItemCreateLiability_gl_account_id LineItemCreate
obj) [Series] -> [[Series]] -> [[Series]]
forall a. a -> [a] -> [a]
: [Series]
-> (LineItemCreateOrigin -> [Series])
-> Maybe LineItemCreateOrigin
-> [Series]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Series]
forall a. Monoid a => a
GHC.Base.mempty (Series -> [Series]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Series -> [Series])
-> (LineItemCreateOrigin -> Series)
-> LineItemCreateOrigin
-> [Series]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"origin" Key -> LineItemCreateOrigin -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..=)) (LineItemCreate -> Maybe LineItemCreateOrigin
lineItemCreateOrigin LineItemCreate
obj) [Series] -> [[Series]] -> [[Series]]
forall a. a -> [a] -> [a]
: [Series]
-> (LineItemCreateOrigin_tax_address_source -> [Series])
-> Maybe LineItemCreateOrigin_tax_address_source
-> [Series]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Series]
forall a. Monoid a => a
GHC.Base.mempty (Series -> [Series]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Series -> [Series])
-> (LineItemCreateOrigin_tax_address_source -> Series)
-> LineItemCreateOrigin_tax_address_source
-> [Series]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"origin_tax_address_source" Key -> LineItemCreateOrigin_tax_address_source -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..=)) (LineItemCreate -> Maybe LineItemCreateOrigin_tax_address_source
lineItemCreateOrigin_tax_address_source LineItemCreate
obj) [Series] -> [[Series]] -> [[Series]]
forall a. a -> [a] -> [a]
: [Series] -> (Text -> [Series]) -> Maybe Text -> [Series]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Series]
forall a. Monoid a => a
GHC.Base.mempty (Series -> [Series]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Series -> [Series]) -> (Text -> Series) -> Text -> [Series]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"performance_obligation_id" Key -> Text -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..=)) (LineItemCreate -> Maybe Text
lineItemCreatePerformance_obligation_id LineItemCreate
obj) [Series] -> [[Series]] -> [[Series]]
forall a. a -> [a] -> [a]
: [Series] -> (Text -> [Series]) -> Maybe Text -> [Series]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Series]
forall a. Monoid a => a
GHC.Base.mempty (Series -> [Series]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Series -> [Series]) -> (Text -> Series) -> Text -> [Series]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"product_code" Key -> Text -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..=)) (LineItemCreate -> Maybe Text
lineItemCreateProduct_code LineItemCreate
obj) [Series] -> [[Series]] -> [[Series]]
forall a. a -> [a] -> [a]
: [Series] -> (Int -> [Series]) -> Maybe Int -> [Series]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Series]
forall a. Monoid a => a
GHC.Base.mempty (Series -> [Series]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Series -> [Series]) -> (Int -> Series) -> Int -> [Series]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"quantity" Key -> Int -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..=)) (LineItemCreate -> Maybe Int
lineItemCreateQuantity LineItemCreate
obj) [Series] -> [[Series]] -> [[Series]]
forall a. a -> [a] -> [a]
: [Series] -> (Text -> [Series]) -> Maybe Text -> [Series]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Series]
forall a. Monoid a => a
GHC.Base.mempty (Series -> [Series]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Series -> [Series]) -> (Text -> Series) -> Text -> [Series]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"revenue_gl_account_id" Key -> Text -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..=)) (LineItemCreate -> Maybe Text
lineItemCreateRevenue_gl_account_id LineItemCreate
obj) [Series] -> [[Series]] -> [[Series]]
forall a. a -> [a] -> [a]
: [Series]
-> (LineItemCreateRevenue_schedule_type -> [Series])
-> Maybe LineItemCreateRevenue_schedule_type
-> [Series]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Series]
forall a. Monoid a => a
GHC.Base.mempty (Series -> [Series]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Series -> [Series])
-> (LineItemCreateRevenue_schedule_type -> Series)
-> LineItemCreateRevenue_schedule_type
-> [Series]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"revenue_schedule_type" Key -> LineItemCreateRevenue_schedule_type -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..=)) (LineItemCreate -> Maybe LineItemCreateRevenue_schedule_type
lineItemCreateRevenue_schedule_type LineItemCreate
obj) [Series] -> [[Series]] -> [[Series]]
forall a. a -> [a] -> [a]
: [Series]
-> (JsonDateTime -> [Series]) -> Maybe JsonDateTime -> [Series]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Series]
forall a. Monoid a => a
GHC.Base.mempty (Series -> [Series]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Series -> [Series])
-> (JsonDateTime -> Series) -> JsonDateTime -> [Series]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"start_date" Key -> JsonDateTime -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..=)) (LineItemCreate -> Maybe JsonDateTime
lineItemCreateStart_date LineItemCreate
obj) [Series] -> [[Series]] -> [[Series]]
forall a. a -> [a] -> [a]
: [Series] -> (Text -> [Series]) -> Maybe Text -> [Series]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Series]
forall a. Monoid a => a
GHC.Base.mempty (Series -> [Series]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Series -> [Series]) -> (Text -> Series) -> Text -> [Series]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"tax_code" Key -> Text -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..=)) (LineItemCreate -> Maybe Text
lineItemCreateTax_code LineItemCreate
obj) [Series] -> [[Series]] -> [[Series]]
forall a. a -> [a] -> [a]
: [Series] -> (Bool -> [Series]) -> Maybe Bool -> [Series]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Series]
forall a. Monoid a => a
GHC.Base.mempty (Series -> [Series]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Series -> [Series]) -> (Bool -> Series) -> Bool -> [Series]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"tax_exempt" Key -> Bool -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..=)) (LineItemCreate -> Maybe Bool
lineItemCreateTax_exempt LineItemCreate
obj) [Series] -> [[Series]] -> [[Series]]
forall a. a -> [a] -> [a]
: [Series] -> (Bool -> [Series]) -> Maybe Bool -> [Series]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Series]
forall a. Monoid a => a
GHC.Base.mempty (Series -> [Series]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Series -> [Series]) -> (Bool -> Series) -> Bool -> [Series]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"tax_inclusive" Key -> Bool -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..=)) (LineItemCreate -> Maybe Bool
lineItemCreateTax_inclusive LineItemCreate
obj) [Series] -> [[Series]] -> [[Series]]
forall a. a -> [a] -> [a]
: [Key
"type" Key -> LineItemCreateType -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..= LineItemCreate -> LineItemCreateType
lineItemCreateType LineItemCreate
obj] [Series] -> [[Series]] -> [[Series]]
forall a. a -> [a] -> [a]
: [Key
"unit_amount" Key -> Float -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..= LineItemCreate -> Float
lineItemCreateUnit_amount LineItemCreate
obj] [Series] -> [[Series]] -> [[Series]]
forall a. a -> [a] -> [a]
: [[Series]]
forall a. Monoid a => a
GHC.Base.mempty)))
instance Data.Aeson.Types.FromJSON.FromJSON LineItemCreate where
parseJSON :: Value -> Parser LineItemCreate
parseJSON = String
-> (Object -> Parser LineItemCreate)
-> Value
-> Parser LineItemCreate
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.Aeson.Types.FromJSON.withObject String
"LineItemCreate" (\Object
obj -> (((((((((((((((((((((((((Maybe Text
-> Maybe Int
-> Maybe Int
-> Maybe LineItemCreateCredit_reason_code
-> Text
-> Maybe CustomFields
-> Maybe Text
-> Maybe LineItemCreateDestination_tax_address_source
-> Maybe JsonDateTime
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe LineItemCreateOrigin
-> Maybe LineItemCreateOrigin_tax_address_source
-> Maybe Text
-> Maybe Text
-> Maybe Int
-> Maybe Text
-> Maybe LineItemCreateRevenue_schedule_type
-> Maybe JsonDateTime
-> Maybe Text
-> Maybe Bool
-> Maybe Bool
-> LineItemCreateType
-> Float
-> LineItemCreate)
-> Parser
(Maybe Text
-> Maybe Int
-> Maybe Int
-> Maybe LineItemCreateCredit_reason_code
-> Text
-> Maybe CustomFields
-> Maybe Text
-> Maybe LineItemCreateDestination_tax_address_source
-> Maybe JsonDateTime
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe LineItemCreateOrigin
-> Maybe LineItemCreateOrigin_tax_address_source
-> Maybe Text
-> Maybe Text
-> Maybe Int
-> Maybe Text
-> Maybe LineItemCreateRevenue_schedule_type
-> Maybe JsonDateTime
-> Maybe Text
-> Maybe Bool
-> Maybe Bool
-> LineItemCreateType
-> Float
-> LineItemCreate)
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure Maybe Text
-> Maybe Int
-> Maybe Int
-> Maybe LineItemCreateCredit_reason_code
-> Text
-> Maybe CustomFields
-> Maybe Text
-> Maybe LineItemCreateDestination_tax_address_source
-> Maybe JsonDateTime
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe LineItemCreateOrigin
-> Maybe LineItemCreateOrigin_tax_address_source
-> Maybe Text
-> Maybe Text
-> Maybe Int
-> Maybe Text
-> Maybe LineItemCreateRevenue_schedule_type
-> Maybe JsonDateTime
-> Maybe Text
-> Maybe Bool
-> Maybe Bool
-> LineItemCreateType
-> Float
-> LineItemCreate
LineItemCreate Parser
(Maybe Text
-> Maybe Int
-> Maybe Int
-> Maybe LineItemCreateCredit_reason_code
-> Text
-> Maybe CustomFields
-> Maybe Text
-> Maybe LineItemCreateDestination_tax_address_source
-> Maybe JsonDateTime
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe LineItemCreateOrigin
-> Maybe LineItemCreateOrigin_tax_address_source
-> Maybe Text
-> Maybe Text
-> Maybe Int
-> Maybe Text
-> Maybe LineItemCreateRevenue_schedule_type
-> Maybe JsonDateTime
-> Maybe Text
-> Maybe Bool
-> Maybe Bool
-> LineItemCreateType
-> Float
-> LineItemCreate)
-> Parser (Maybe Text)
-> Parser
(Maybe Int
-> Maybe Int
-> Maybe LineItemCreateCredit_reason_code
-> Text
-> Maybe CustomFields
-> Maybe Text
-> Maybe LineItemCreateDestination_tax_address_source
-> Maybe JsonDateTime
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe LineItemCreateOrigin
-> Maybe LineItemCreateOrigin_tax_address_source
-> Maybe Text
-> Maybe Text
-> Maybe Int
-> Maybe Text
-> Maybe LineItemCreateRevenue_schedule_type
-> Maybe JsonDateTime
-> Maybe Text
-> Maybe Bool
-> Maybe Bool
-> LineItemCreateType
-> Float
-> LineItemCreate)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Key
"accounting_code")) Parser
(Maybe Int
-> Maybe Int
-> Maybe LineItemCreateCredit_reason_code
-> Text
-> Maybe CustomFields
-> Maybe Text
-> Maybe LineItemCreateDestination_tax_address_source
-> Maybe JsonDateTime
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe LineItemCreateOrigin
-> Maybe LineItemCreateOrigin_tax_address_source
-> Maybe Text
-> Maybe Text
-> Maybe Int
-> Maybe Text
-> Maybe LineItemCreateRevenue_schedule_type
-> Maybe JsonDateTime
-> Maybe Text
-> Maybe Bool
-> Maybe Bool
-> LineItemCreateType
-> Float
-> LineItemCreate)
-> Parser (Maybe Int)
-> Parser
(Maybe Int
-> Maybe LineItemCreateCredit_reason_code
-> Text
-> Maybe CustomFields
-> Maybe Text
-> Maybe LineItemCreateDestination_tax_address_source
-> Maybe JsonDateTime
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe LineItemCreateOrigin
-> Maybe LineItemCreateOrigin_tax_address_source
-> Maybe Text
-> Maybe Text
-> Maybe Int
-> Maybe Text
-> Maybe LineItemCreateRevenue_schedule_type
-> Maybe JsonDateTime
-> Maybe Text
-> Maybe Bool
-> Maybe Bool
-> LineItemCreateType
-> Float
-> LineItemCreate)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Key -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Key
"avalara_service_type")) Parser
(Maybe Int
-> Maybe LineItemCreateCredit_reason_code
-> Text
-> Maybe CustomFields
-> Maybe Text
-> Maybe LineItemCreateDestination_tax_address_source
-> Maybe JsonDateTime
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe LineItemCreateOrigin
-> Maybe LineItemCreateOrigin_tax_address_source
-> Maybe Text
-> Maybe Text
-> Maybe Int
-> Maybe Text
-> Maybe LineItemCreateRevenue_schedule_type
-> Maybe JsonDateTime
-> Maybe Text
-> Maybe Bool
-> Maybe Bool
-> LineItemCreateType
-> Float
-> LineItemCreate)
-> Parser (Maybe Int)
-> Parser
(Maybe LineItemCreateCredit_reason_code
-> Text
-> Maybe CustomFields
-> Maybe Text
-> Maybe LineItemCreateDestination_tax_address_source
-> Maybe JsonDateTime
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe LineItemCreateOrigin
-> Maybe LineItemCreateOrigin_tax_address_source
-> Maybe Text
-> Maybe Text
-> Maybe Int
-> Maybe Text
-> Maybe LineItemCreateRevenue_schedule_type
-> Maybe JsonDateTime
-> Maybe Text
-> Maybe Bool
-> Maybe Bool
-> LineItemCreateType
-> Float
-> LineItemCreate)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Key -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Key
"avalara_transaction_type")) Parser
(Maybe LineItemCreateCredit_reason_code
-> Text
-> Maybe CustomFields
-> Maybe Text
-> Maybe LineItemCreateDestination_tax_address_source
-> Maybe JsonDateTime
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe LineItemCreateOrigin
-> Maybe LineItemCreateOrigin_tax_address_source
-> Maybe Text
-> Maybe Text
-> Maybe Int
-> Maybe Text
-> Maybe LineItemCreateRevenue_schedule_type
-> Maybe JsonDateTime
-> Maybe Text
-> Maybe Bool
-> Maybe Bool
-> LineItemCreateType
-> Float
-> LineItemCreate)
-> Parser (Maybe LineItemCreateCredit_reason_code)
-> Parser
(Text
-> Maybe CustomFields
-> Maybe Text
-> Maybe LineItemCreateDestination_tax_address_source
-> Maybe JsonDateTime
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe LineItemCreateOrigin
-> Maybe LineItemCreateOrigin_tax_address_source
-> Maybe Text
-> Maybe Text
-> Maybe Int
-> Maybe Text
-> Maybe LineItemCreateRevenue_schedule_type
-> Maybe JsonDateTime
-> Maybe Text
-> Maybe Bool
-> Maybe Bool
-> LineItemCreateType
-> Float
-> LineItemCreate)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Key -> Parser (Maybe LineItemCreateCredit_reason_code)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Key
"credit_reason_code")) Parser
(Text
-> Maybe CustomFields
-> Maybe Text
-> Maybe LineItemCreateDestination_tax_address_source
-> Maybe JsonDateTime
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe LineItemCreateOrigin
-> Maybe LineItemCreateOrigin_tax_address_source
-> Maybe Text
-> Maybe Text
-> Maybe Int
-> Maybe Text
-> Maybe LineItemCreateRevenue_schedule_type
-> Maybe JsonDateTime
-> Maybe Text
-> Maybe Bool
-> Maybe Bool
-> LineItemCreateType
-> Float
-> LineItemCreate)
-> Parser Text
-> Parser
(Maybe CustomFields
-> Maybe Text
-> Maybe LineItemCreateDestination_tax_address_source
-> Maybe JsonDateTime
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe LineItemCreateOrigin
-> Maybe LineItemCreateOrigin_tax_address_source
-> Maybe Text
-> Maybe Text
-> Maybe Int
-> Maybe Text
-> Maybe LineItemCreateRevenue_schedule_type
-> Maybe JsonDateTime
-> Maybe Text
-> Maybe Bool
-> Maybe Bool
-> LineItemCreateType
-> Float
-> LineItemCreate)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Key -> Parser Text
forall a. FromJSON a => Object -> Key -> Parser a
Data.Aeson.Types.FromJSON..: Key
"currency")) Parser
(Maybe CustomFields
-> Maybe Text
-> Maybe LineItemCreateDestination_tax_address_source
-> Maybe JsonDateTime
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe LineItemCreateOrigin
-> Maybe LineItemCreateOrigin_tax_address_source
-> Maybe Text
-> Maybe Text
-> Maybe Int
-> Maybe Text
-> Maybe LineItemCreateRevenue_schedule_type
-> Maybe JsonDateTime
-> Maybe Text
-> Maybe Bool
-> Maybe Bool
-> LineItemCreateType
-> Float
-> LineItemCreate)
-> Parser (Maybe CustomFields)
-> Parser
(Maybe Text
-> Maybe LineItemCreateDestination_tax_address_source
-> Maybe JsonDateTime
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe LineItemCreateOrigin
-> Maybe LineItemCreateOrigin_tax_address_source
-> Maybe Text
-> Maybe Text
-> Maybe Int
-> Maybe Text
-> Maybe LineItemCreateRevenue_schedule_type
-> Maybe JsonDateTime
-> Maybe Text
-> Maybe Bool
-> Maybe Bool
-> LineItemCreateType
-> Float
-> LineItemCreate)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Key -> Parser (Maybe CustomFields)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Key
"custom_fields")) Parser
(Maybe Text
-> Maybe LineItemCreateDestination_tax_address_source
-> Maybe JsonDateTime
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe LineItemCreateOrigin
-> Maybe LineItemCreateOrigin_tax_address_source
-> Maybe Text
-> Maybe Text
-> Maybe Int
-> Maybe Text
-> Maybe LineItemCreateRevenue_schedule_type
-> Maybe JsonDateTime
-> Maybe Text
-> Maybe Bool
-> Maybe Bool
-> LineItemCreateType
-> Float
-> LineItemCreate)
-> Parser (Maybe Text)
-> Parser
(Maybe LineItemCreateDestination_tax_address_source
-> Maybe JsonDateTime
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe LineItemCreateOrigin
-> Maybe LineItemCreateOrigin_tax_address_source
-> Maybe Text
-> Maybe Text
-> Maybe Int
-> Maybe Text
-> Maybe LineItemCreateRevenue_schedule_type
-> Maybe JsonDateTime
-> Maybe Text
-> Maybe Bool
-> Maybe Bool
-> LineItemCreateType
-> Float
-> LineItemCreate)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Key
"description")) Parser
(Maybe LineItemCreateDestination_tax_address_source
-> Maybe JsonDateTime
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe LineItemCreateOrigin
-> Maybe LineItemCreateOrigin_tax_address_source
-> Maybe Text
-> Maybe Text
-> Maybe Int
-> Maybe Text
-> Maybe LineItemCreateRevenue_schedule_type
-> Maybe JsonDateTime
-> Maybe Text
-> Maybe Bool
-> Maybe Bool
-> LineItemCreateType
-> Float
-> LineItemCreate)
-> Parser (Maybe LineItemCreateDestination_tax_address_source)
-> Parser
(Maybe JsonDateTime
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe LineItemCreateOrigin
-> Maybe LineItemCreateOrigin_tax_address_source
-> Maybe Text
-> Maybe Text
-> Maybe Int
-> Maybe Text
-> Maybe LineItemCreateRevenue_schedule_type
-> Maybe JsonDateTime
-> Maybe Text
-> Maybe Bool
-> Maybe Bool
-> LineItemCreateType
-> Float
-> LineItemCreate)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object
-> Key
-> Parser (Maybe LineItemCreateDestination_tax_address_source)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Key
"destination_tax_address_source")) Parser
(Maybe JsonDateTime
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe LineItemCreateOrigin
-> Maybe LineItemCreateOrigin_tax_address_source
-> Maybe Text
-> Maybe Text
-> Maybe Int
-> Maybe Text
-> Maybe LineItemCreateRevenue_schedule_type
-> Maybe JsonDateTime
-> Maybe Text
-> Maybe Bool
-> Maybe Bool
-> LineItemCreateType
-> Float
-> LineItemCreate)
-> Parser (Maybe JsonDateTime)
-> Parser
(Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe LineItemCreateOrigin
-> Maybe LineItemCreateOrigin_tax_address_source
-> Maybe Text
-> Maybe Text
-> Maybe Int
-> Maybe Text
-> Maybe LineItemCreateRevenue_schedule_type
-> Maybe JsonDateTime
-> Maybe Text
-> Maybe Bool
-> Maybe Bool
-> LineItemCreateType
-> Float
-> LineItemCreate)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Key -> Parser (Maybe JsonDateTime)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Key
"end_date")) Parser
(Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe LineItemCreateOrigin
-> Maybe LineItemCreateOrigin_tax_address_source
-> Maybe Text
-> Maybe Text
-> Maybe Int
-> Maybe Text
-> Maybe LineItemCreateRevenue_schedule_type
-> Maybe JsonDateTime
-> Maybe Text
-> Maybe Bool
-> Maybe Bool
-> LineItemCreateType
-> Float
-> LineItemCreate)
-> Parser (Maybe Text)
-> Parser
(Maybe Text
-> Maybe Text
-> Maybe LineItemCreateOrigin
-> Maybe LineItemCreateOrigin_tax_address_source
-> Maybe Text
-> Maybe Text
-> Maybe Int
-> Maybe Text
-> Maybe LineItemCreateRevenue_schedule_type
-> Maybe JsonDateTime
-> Maybe Text
-> Maybe Bool
-> Maybe Bool
-> LineItemCreateType
-> Float
-> LineItemCreate)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Key
"item_code")) Parser
(Maybe Text
-> Maybe Text
-> Maybe LineItemCreateOrigin
-> Maybe LineItemCreateOrigin_tax_address_source
-> Maybe Text
-> Maybe Text
-> Maybe Int
-> Maybe Text
-> Maybe LineItemCreateRevenue_schedule_type
-> Maybe JsonDateTime
-> Maybe Text
-> Maybe Bool
-> Maybe Bool
-> LineItemCreateType
-> Float
-> LineItemCreate)
-> Parser (Maybe Text)
-> Parser
(Maybe Text
-> Maybe LineItemCreateOrigin
-> Maybe LineItemCreateOrigin_tax_address_source
-> Maybe Text
-> Maybe Text
-> Maybe Int
-> Maybe Text
-> Maybe LineItemCreateRevenue_schedule_type
-> Maybe JsonDateTime
-> Maybe Text
-> Maybe Bool
-> Maybe Bool
-> LineItemCreateType
-> Float
-> LineItemCreate)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Key
"item_id")) Parser
(Maybe Text
-> Maybe LineItemCreateOrigin
-> Maybe LineItemCreateOrigin_tax_address_source
-> Maybe Text
-> Maybe Text
-> Maybe Int
-> Maybe Text
-> Maybe LineItemCreateRevenue_schedule_type
-> Maybe JsonDateTime
-> Maybe Text
-> Maybe Bool
-> Maybe Bool
-> LineItemCreateType
-> Float
-> LineItemCreate)
-> Parser (Maybe Text)
-> Parser
(Maybe LineItemCreateOrigin
-> Maybe LineItemCreateOrigin_tax_address_source
-> Maybe Text
-> Maybe Text
-> Maybe Int
-> Maybe Text
-> Maybe LineItemCreateRevenue_schedule_type
-> Maybe JsonDateTime
-> Maybe Text
-> Maybe Bool
-> Maybe Bool
-> LineItemCreateType
-> Float
-> LineItemCreate)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Key
"liability_gl_account_id")) Parser
(Maybe LineItemCreateOrigin
-> Maybe LineItemCreateOrigin_tax_address_source
-> Maybe Text
-> Maybe Text
-> Maybe Int
-> Maybe Text
-> Maybe LineItemCreateRevenue_schedule_type
-> Maybe JsonDateTime
-> Maybe Text
-> Maybe Bool
-> Maybe Bool
-> LineItemCreateType
-> Float
-> LineItemCreate)
-> Parser (Maybe LineItemCreateOrigin)
-> Parser
(Maybe LineItemCreateOrigin_tax_address_source
-> Maybe Text
-> Maybe Text
-> Maybe Int
-> Maybe Text
-> Maybe LineItemCreateRevenue_schedule_type
-> Maybe JsonDateTime
-> Maybe Text
-> Maybe Bool
-> Maybe Bool
-> LineItemCreateType
-> Float
-> LineItemCreate)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Key -> Parser (Maybe LineItemCreateOrigin)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Key
"origin")) Parser
(Maybe LineItemCreateOrigin_tax_address_source
-> Maybe Text
-> Maybe Text
-> Maybe Int
-> Maybe Text
-> Maybe LineItemCreateRevenue_schedule_type
-> Maybe JsonDateTime
-> Maybe Text
-> Maybe Bool
-> Maybe Bool
-> LineItemCreateType
-> Float
-> LineItemCreate)
-> Parser (Maybe LineItemCreateOrigin_tax_address_source)
-> Parser
(Maybe Text
-> Maybe Text
-> Maybe Int
-> Maybe Text
-> Maybe LineItemCreateRevenue_schedule_type
-> Maybe JsonDateTime
-> Maybe Text
-> Maybe Bool
-> Maybe Bool
-> LineItemCreateType
-> Float
-> LineItemCreate)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object
-> Key -> Parser (Maybe LineItemCreateOrigin_tax_address_source)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Key
"origin_tax_address_source")) Parser
(Maybe Text
-> Maybe Text
-> Maybe Int
-> Maybe Text
-> Maybe LineItemCreateRevenue_schedule_type
-> Maybe JsonDateTime
-> Maybe Text
-> Maybe Bool
-> Maybe Bool
-> LineItemCreateType
-> Float
-> LineItemCreate)
-> Parser (Maybe Text)
-> Parser
(Maybe Text
-> Maybe Int
-> Maybe Text
-> Maybe LineItemCreateRevenue_schedule_type
-> Maybe JsonDateTime
-> Maybe Text
-> Maybe Bool
-> Maybe Bool
-> LineItemCreateType
-> Float
-> LineItemCreate)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Key
"performance_obligation_id")) Parser
(Maybe Text
-> Maybe Int
-> Maybe Text
-> Maybe LineItemCreateRevenue_schedule_type
-> Maybe JsonDateTime
-> Maybe Text
-> Maybe Bool
-> Maybe Bool
-> LineItemCreateType
-> Float
-> LineItemCreate)
-> Parser (Maybe Text)
-> Parser
(Maybe Int
-> Maybe Text
-> Maybe LineItemCreateRevenue_schedule_type
-> Maybe JsonDateTime
-> Maybe Text
-> Maybe Bool
-> Maybe Bool
-> LineItemCreateType
-> Float
-> LineItemCreate)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Key
"product_code")) Parser
(Maybe Int
-> Maybe Text
-> Maybe LineItemCreateRevenue_schedule_type
-> Maybe JsonDateTime
-> Maybe Text
-> Maybe Bool
-> Maybe Bool
-> LineItemCreateType
-> Float
-> LineItemCreate)
-> Parser (Maybe Int)
-> Parser
(Maybe Text
-> Maybe LineItemCreateRevenue_schedule_type
-> Maybe JsonDateTime
-> Maybe Text
-> Maybe Bool
-> Maybe Bool
-> LineItemCreateType
-> Float
-> LineItemCreate)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Key -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Key
"quantity")) Parser
(Maybe Text
-> Maybe LineItemCreateRevenue_schedule_type
-> Maybe JsonDateTime
-> Maybe Text
-> Maybe Bool
-> Maybe Bool
-> LineItemCreateType
-> Float
-> LineItemCreate)
-> Parser (Maybe Text)
-> Parser
(Maybe LineItemCreateRevenue_schedule_type
-> Maybe JsonDateTime
-> Maybe Text
-> Maybe Bool
-> Maybe Bool
-> LineItemCreateType
-> Float
-> LineItemCreate)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Key
"revenue_gl_account_id")) Parser
(Maybe LineItemCreateRevenue_schedule_type
-> Maybe JsonDateTime
-> Maybe Text
-> Maybe Bool
-> Maybe Bool
-> LineItemCreateType
-> Float
-> LineItemCreate)
-> Parser (Maybe LineItemCreateRevenue_schedule_type)
-> Parser
(Maybe JsonDateTime
-> Maybe Text
-> Maybe Bool
-> Maybe Bool
-> LineItemCreateType
-> Float
-> LineItemCreate)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Key -> Parser (Maybe LineItemCreateRevenue_schedule_type)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Key
"revenue_schedule_type")) Parser
(Maybe JsonDateTime
-> Maybe Text
-> Maybe Bool
-> Maybe Bool
-> LineItemCreateType
-> Float
-> LineItemCreate)
-> Parser (Maybe JsonDateTime)
-> Parser
(Maybe Text
-> Maybe Bool
-> Maybe Bool
-> LineItemCreateType
-> Float
-> LineItemCreate)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Key -> Parser (Maybe JsonDateTime)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Key
"start_date")) Parser
(Maybe Text
-> Maybe Bool
-> Maybe Bool
-> LineItemCreateType
-> Float
-> LineItemCreate)
-> Parser (Maybe Text)
-> Parser
(Maybe Bool
-> Maybe Bool -> LineItemCreateType -> Float -> LineItemCreate)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Key
"tax_code")) Parser
(Maybe Bool
-> Maybe Bool -> LineItemCreateType -> Float -> LineItemCreate)
-> Parser (Maybe Bool)
-> Parser
(Maybe Bool -> LineItemCreateType -> Float -> LineItemCreate)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Key -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Key
"tax_exempt")) Parser
(Maybe Bool -> LineItemCreateType -> Float -> LineItemCreate)
-> Parser (Maybe Bool)
-> Parser (LineItemCreateType -> Float -> LineItemCreate)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Key -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Key
"tax_inclusive")) Parser (LineItemCreateType -> Float -> LineItemCreate)
-> Parser LineItemCreateType -> Parser (Float -> LineItemCreate)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Key -> Parser LineItemCreateType
forall a. FromJSON a => Object -> Key -> Parser a
Data.Aeson.Types.FromJSON..: Key
"type")) Parser (Float -> LineItemCreate)
-> Parser Float -> Parser LineItemCreate
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Key -> Parser Float
forall a. FromJSON a => Object -> Key -> Parser a
Data.Aeson.Types.FromJSON..: Key
"unit_amount"))
mkLineItemCreate ::
Data.Text.Internal.Text ->
LineItemCreateType ->
GHC.Types.Float ->
LineItemCreate
mkLineItemCreate :: Text -> LineItemCreateType -> Float -> LineItemCreate
mkLineItemCreate Text
lineItemCreateCurrency LineItemCreateType
lineItemCreateType Float
lineItemCreateUnit_amount =
LineItemCreate
{ lineItemCreateAccounting_code :: Maybe Text
lineItemCreateAccounting_code = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing
, lineItemCreateAvalara_service_type :: Maybe Int
lineItemCreateAvalara_service_type = Maybe Int
forall a. Maybe a
GHC.Maybe.Nothing
, lineItemCreateAvalara_transaction_type :: Maybe Int
lineItemCreateAvalara_transaction_type = Maybe Int
forall a. Maybe a
GHC.Maybe.Nothing
, lineItemCreateCredit_reason_code :: Maybe LineItemCreateCredit_reason_code
lineItemCreateCredit_reason_code = Maybe LineItemCreateCredit_reason_code
forall a. Maybe a
GHC.Maybe.Nothing
, lineItemCreateCurrency :: Text
lineItemCreateCurrency = Text
lineItemCreateCurrency
, lineItemCreateCustom_fields :: Maybe CustomFields
lineItemCreateCustom_fields = Maybe CustomFields
forall a. Maybe a
GHC.Maybe.Nothing
, lineItemCreateDescription :: Maybe Text
lineItemCreateDescription = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing
, lineItemCreateDestination_tax_address_source :: Maybe LineItemCreateDestination_tax_address_source
lineItemCreateDestination_tax_address_source = Maybe LineItemCreateDestination_tax_address_source
forall a. Maybe a
GHC.Maybe.Nothing
, lineItemCreateEnd_date :: Maybe JsonDateTime
lineItemCreateEnd_date = Maybe JsonDateTime
forall a. Maybe a
GHC.Maybe.Nothing
, lineItemCreateItem_code :: Maybe Text
lineItemCreateItem_code = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing
, lineItemCreateItem_id :: Maybe Text
lineItemCreateItem_id = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing
, lineItemCreateLiability_gl_account_id :: Maybe Text
lineItemCreateLiability_gl_account_id = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing
, lineItemCreateOrigin :: Maybe LineItemCreateOrigin
lineItemCreateOrigin = Maybe LineItemCreateOrigin
forall a. Maybe a
GHC.Maybe.Nothing
, lineItemCreateOrigin_tax_address_source :: Maybe LineItemCreateOrigin_tax_address_source
lineItemCreateOrigin_tax_address_source = Maybe LineItemCreateOrigin_tax_address_source
forall a. Maybe a
GHC.Maybe.Nothing
, lineItemCreatePerformance_obligation_id :: Maybe Text
lineItemCreatePerformance_obligation_id = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing
, lineItemCreateProduct_code :: Maybe Text
lineItemCreateProduct_code = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing
, lineItemCreateQuantity :: Maybe Int
lineItemCreateQuantity = Maybe Int
forall a. Maybe a
GHC.Maybe.Nothing
, lineItemCreateRevenue_gl_account_id :: Maybe Text
lineItemCreateRevenue_gl_account_id = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing
, lineItemCreateRevenue_schedule_type :: Maybe LineItemCreateRevenue_schedule_type
lineItemCreateRevenue_schedule_type = Maybe LineItemCreateRevenue_schedule_type
forall a. Maybe a
GHC.Maybe.Nothing
, lineItemCreateStart_date :: Maybe JsonDateTime
lineItemCreateStart_date = Maybe JsonDateTime
forall a. Maybe a
GHC.Maybe.Nothing
, lineItemCreateTax_code :: Maybe Text
lineItemCreateTax_code = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing
, lineItemCreateTax_exempt :: Maybe Bool
lineItemCreateTax_exempt = Maybe Bool
forall a. Maybe a
GHC.Maybe.Nothing
, lineItemCreateTax_inclusive :: Maybe Bool
lineItemCreateTax_inclusive = Maybe Bool
forall a. Maybe a
GHC.Maybe.Nothing
, lineItemCreateType :: LineItemCreateType
lineItemCreateType = LineItemCreateType
lineItemCreateType
, lineItemCreateUnit_amount :: Float
lineItemCreateUnit_amount = Float
lineItemCreateUnit_amount
}
data LineItemCreateCredit_reason_code
=
LineItemCreateCredit_reason_codeOther Data.Aeson.Types.Internal.Value
|
LineItemCreateCredit_reason_codeTyped Data.Text.Internal.Text
|
LineItemCreateCredit_reason_codeEnumGeneral
|
LineItemCreateCredit_reason_codeEnumPromotional
|
LineItemCreateCredit_reason_codeEnumService
deriving (Int -> LineItemCreateCredit_reason_code -> ShowS
[LineItemCreateCredit_reason_code] -> ShowS
LineItemCreateCredit_reason_code -> String
(Int -> LineItemCreateCredit_reason_code -> ShowS)
-> (LineItemCreateCredit_reason_code -> String)
-> ([LineItemCreateCredit_reason_code] -> ShowS)
-> Show LineItemCreateCredit_reason_code
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> LineItemCreateCredit_reason_code -> ShowS
showsPrec :: Int -> LineItemCreateCredit_reason_code -> ShowS
$cshow :: LineItemCreateCredit_reason_code -> String
show :: LineItemCreateCredit_reason_code -> String
$cshowList :: [LineItemCreateCredit_reason_code] -> ShowS
showList :: [LineItemCreateCredit_reason_code] -> ShowS
GHC.Show.Show, LineItemCreateCredit_reason_code
-> LineItemCreateCredit_reason_code -> Bool
(LineItemCreateCredit_reason_code
-> LineItemCreateCredit_reason_code -> Bool)
-> (LineItemCreateCredit_reason_code
-> LineItemCreateCredit_reason_code -> Bool)
-> Eq LineItemCreateCredit_reason_code
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: LineItemCreateCredit_reason_code
-> LineItemCreateCredit_reason_code -> Bool
== :: LineItemCreateCredit_reason_code
-> LineItemCreateCredit_reason_code -> Bool
$c/= :: LineItemCreateCredit_reason_code
-> LineItemCreateCredit_reason_code -> Bool
/= :: LineItemCreateCredit_reason_code
-> LineItemCreateCredit_reason_code -> Bool
GHC.Classes.Eq)
instance Data.Aeson.Types.ToJSON.ToJSON LineItemCreateCredit_reason_code where
toJSON :: LineItemCreateCredit_reason_code -> Value
toJSON (LineItemCreateCredit_reason_codeOther Value
val) = Value
val
toJSON (LineItemCreateCredit_reason_codeTyped Text
val) = Text -> Value
forall a. ToJSON a => a -> Value
Data.Aeson.Types.ToJSON.toJSON Text
val
toJSON (LineItemCreateCredit_reason_code
LineItemCreateCredit_reason_codeEnumGeneral) = Value
"general"
toJSON (LineItemCreateCredit_reason_code
LineItemCreateCredit_reason_codeEnumPromotional) = Value
"promotional"
toJSON (LineItemCreateCredit_reason_code
LineItemCreateCredit_reason_codeEnumService) = Value
"service"
instance Data.Aeson.Types.FromJSON.FromJSON LineItemCreateCredit_reason_code where
parseJSON :: Value -> Parser LineItemCreateCredit_reason_code
parseJSON Value
val =
LineItemCreateCredit_reason_code
-> Parser LineItemCreateCredit_reason_code
forall a. a -> Parser a
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
"general" -> LineItemCreateCredit_reason_code
LineItemCreateCredit_reason_codeEnumGeneral
| Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"promotional" -> LineItemCreateCredit_reason_code
LineItemCreateCredit_reason_codeEnumPromotional
| Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"service" -> LineItemCreateCredit_reason_code
LineItemCreateCredit_reason_codeEnumService
| Bool
GHC.Base.otherwise -> Value -> LineItemCreateCredit_reason_code
LineItemCreateCredit_reason_codeOther Value
val
)
data LineItemCreateDestination_tax_address_source
=
LineItemCreateDestination_tax_address_sourceOther Data.Aeson.Types.Internal.Value
|
LineItemCreateDestination_tax_address_sourceTyped Data.Text.Internal.Text
|
LineItemCreateDestination_tax_address_sourceEnumDestination
|
LineItemCreateDestination_tax_address_sourceEnumOrigin
deriving (Int -> LineItemCreateDestination_tax_address_source -> ShowS
[LineItemCreateDestination_tax_address_source] -> ShowS
LineItemCreateDestination_tax_address_source -> String
(Int -> LineItemCreateDestination_tax_address_source -> ShowS)
-> (LineItemCreateDestination_tax_address_source -> String)
-> ([LineItemCreateDestination_tax_address_source] -> ShowS)
-> Show LineItemCreateDestination_tax_address_source
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> LineItemCreateDestination_tax_address_source -> ShowS
showsPrec :: Int -> LineItemCreateDestination_tax_address_source -> ShowS
$cshow :: LineItemCreateDestination_tax_address_source -> String
show :: LineItemCreateDestination_tax_address_source -> String
$cshowList :: [LineItemCreateDestination_tax_address_source] -> ShowS
showList :: [LineItemCreateDestination_tax_address_source] -> ShowS
GHC.Show.Show, LineItemCreateDestination_tax_address_source
-> LineItemCreateDestination_tax_address_source -> Bool
(LineItemCreateDestination_tax_address_source
-> LineItemCreateDestination_tax_address_source -> Bool)
-> (LineItemCreateDestination_tax_address_source
-> LineItemCreateDestination_tax_address_source -> Bool)
-> Eq LineItemCreateDestination_tax_address_source
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: LineItemCreateDestination_tax_address_source
-> LineItemCreateDestination_tax_address_source -> Bool
== :: LineItemCreateDestination_tax_address_source
-> LineItemCreateDestination_tax_address_source -> Bool
$c/= :: LineItemCreateDestination_tax_address_source
-> LineItemCreateDestination_tax_address_source -> Bool
/= :: LineItemCreateDestination_tax_address_source
-> LineItemCreateDestination_tax_address_source -> Bool
GHC.Classes.Eq)
instance Data.Aeson.Types.ToJSON.ToJSON LineItemCreateDestination_tax_address_source where
toJSON :: LineItemCreateDestination_tax_address_source -> Value
toJSON (LineItemCreateDestination_tax_address_sourceOther Value
val) = Value
val
toJSON (LineItemCreateDestination_tax_address_sourceTyped Text
val) = Text -> Value
forall a. ToJSON a => a -> Value
Data.Aeson.Types.ToJSON.toJSON Text
val
toJSON (LineItemCreateDestination_tax_address_source
LineItemCreateDestination_tax_address_sourceEnumDestination) = Value
"destination"
toJSON (LineItemCreateDestination_tax_address_source
LineItemCreateDestination_tax_address_sourceEnumOrigin) = Value
"origin"
instance Data.Aeson.Types.FromJSON.FromJSON LineItemCreateDestination_tax_address_source where
parseJSON :: Value -> Parser LineItemCreateDestination_tax_address_source
parseJSON Value
val =
LineItemCreateDestination_tax_address_source
-> Parser LineItemCreateDestination_tax_address_source
forall a. a -> Parser a
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
"destination" -> LineItemCreateDestination_tax_address_source
LineItemCreateDestination_tax_address_sourceEnumDestination
| Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"origin" -> LineItemCreateDestination_tax_address_source
LineItemCreateDestination_tax_address_sourceEnumOrigin
| Bool
GHC.Base.otherwise -> Value -> LineItemCreateDestination_tax_address_source
LineItemCreateDestination_tax_address_sourceOther Value
val
)
data LineItemCreateOrigin
=
LineItemCreateOriginOther Data.Aeson.Types.Internal.Value
|
LineItemCreateOriginTyped Data.Text.Internal.Text
|
LineItemCreateOriginEnumExternal_gift_card
|
LineItemCreateOriginEnumPrepayment
deriving (Int -> LineItemCreateOrigin -> ShowS
[LineItemCreateOrigin] -> ShowS
LineItemCreateOrigin -> String
(Int -> LineItemCreateOrigin -> ShowS)
-> (LineItemCreateOrigin -> String)
-> ([LineItemCreateOrigin] -> ShowS)
-> Show LineItemCreateOrigin
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> LineItemCreateOrigin -> ShowS
showsPrec :: Int -> LineItemCreateOrigin -> ShowS
$cshow :: LineItemCreateOrigin -> String
show :: LineItemCreateOrigin -> String
$cshowList :: [LineItemCreateOrigin] -> ShowS
showList :: [LineItemCreateOrigin] -> ShowS
GHC.Show.Show, LineItemCreateOrigin -> LineItemCreateOrigin -> Bool
(LineItemCreateOrigin -> LineItemCreateOrigin -> Bool)
-> (LineItemCreateOrigin -> LineItemCreateOrigin -> Bool)
-> Eq LineItemCreateOrigin
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: LineItemCreateOrigin -> LineItemCreateOrigin -> Bool
== :: LineItemCreateOrigin -> LineItemCreateOrigin -> Bool
$c/= :: LineItemCreateOrigin -> LineItemCreateOrigin -> Bool
/= :: LineItemCreateOrigin -> LineItemCreateOrigin -> Bool
GHC.Classes.Eq)
instance Data.Aeson.Types.ToJSON.ToJSON LineItemCreateOrigin where
toJSON :: LineItemCreateOrigin -> Value
toJSON (LineItemCreateOriginOther Value
val) = Value
val
toJSON (LineItemCreateOriginTyped Text
val) = Text -> Value
forall a. ToJSON a => a -> Value
Data.Aeson.Types.ToJSON.toJSON Text
val
toJSON (LineItemCreateOrigin
LineItemCreateOriginEnumExternal_gift_card) = Value
"external_gift_card"
toJSON (LineItemCreateOrigin
LineItemCreateOriginEnumPrepayment) = Value
"prepayment"
instance Data.Aeson.Types.FromJSON.FromJSON LineItemCreateOrigin where
parseJSON :: Value -> Parser LineItemCreateOrigin
parseJSON Value
val =
LineItemCreateOrigin -> Parser LineItemCreateOrigin
forall a. a -> Parser a
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
"external_gift_card" -> LineItemCreateOrigin
LineItemCreateOriginEnumExternal_gift_card
| Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"prepayment" -> LineItemCreateOrigin
LineItemCreateOriginEnumPrepayment
| Bool
GHC.Base.otherwise -> Value -> LineItemCreateOrigin
LineItemCreateOriginOther Value
val
)
data LineItemCreateOrigin_tax_address_source
=
LineItemCreateOrigin_tax_address_sourceOther Data.Aeson.Types.Internal.Value
|
LineItemCreateOrigin_tax_address_sourceTyped Data.Text.Internal.Text
|
LineItemCreateOrigin_tax_address_sourceEnumOrigin
|
LineItemCreateOrigin_tax_address_sourceEnumDestination
deriving (Int -> LineItemCreateOrigin_tax_address_source -> ShowS
[LineItemCreateOrigin_tax_address_source] -> ShowS
LineItemCreateOrigin_tax_address_source -> String
(Int -> LineItemCreateOrigin_tax_address_source -> ShowS)
-> (LineItemCreateOrigin_tax_address_source -> String)
-> ([LineItemCreateOrigin_tax_address_source] -> ShowS)
-> Show LineItemCreateOrigin_tax_address_source
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> LineItemCreateOrigin_tax_address_source -> ShowS
showsPrec :: Int -> LineItemCreateOrigin_tax_address_source -> ShowS
$cshow :: LineItemCreateOrigin_tax_address_source -> String
show :: LineItemCreateOrigin_tax_address_source -> String
$cshowList :: [LineItemCreateOrigin_tax_address_source] -> ShowS
showList :: [LineItemCreateOrigin_tax_address_source] -> ShowS
GHC.Show.Show, LineItemCreateOrigin_tax_address_source
-> LineItemCreateOrigin_tax_address_source -> Bool
(LineItemCreateOrigin_tax_address_source
-> LineItemCreateOrigin_tax_address_source -> Bool)
-> (LineItemCreateOrigin_tax_address_source
-> LineItemCreateOrigin_tax_address_source -> Bool)
-> Eq LineItemCreateOrigin_tax_address_source
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: LineItemCreateOrigin_tax_address_source
-> LineItemCreateOrigin_tax_address_source -> Bool
== :: LineItemCreateOrigin_tax_address_source
-> LineItemCreateOrigin_tax_address_source -> Bool
$c/= :: LineItemCreateOrigin_tax_address_source
-> LineItemCreateOrigin_tax_address_source -> Bool
/= :: LineItemCreateOrigin_tax_address_source
-> LineItemCreateOrigin_tax_address_source -> Bool
GHC.Classes.Eq)
instance Data.Aeson.Types.ToJSON.ToJSON LineItemCreateOrigin_tax_address_source where
toJSON :: LineItemCreateOrigin_tax_address_source -> Value
toJSON (LineItemCreateOrigin_tax_address_sourceOther Value
val) = Value
val
toJSON (LineItemCreateOrigin_tax_address_sourceTyped Text
val) = Text -> Value
forall a. ToJSON a => a -> Value
Data.Aeson.Types.ToJSON.toJSON Text
val
toJSON (LineItemCreateOrigin_tax_address_source
LineItemCreateOrigin_tax_address_sourceEnumOrigin) = Value
"origin"
toJSON (LineItemCreateOrigin_tax_address_source
LineItemCreateOrigin_tax_address_sourceEnumDestination) = Value
"destination"
instance Data.Aeson.Types.FromJSON.FromJSON LineItemCreateOrigin_tax_address_source where
parseJSON :: Value -> Parser LineItemCreateOrigin_tax_address_source
parseJSON Value
val =
LineItemCreateOrigin_tax_address_source
-> Parser LineItemCreateOrigin_tax_address_source
forall a. a -> Parser a
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
"origin" -> LineItemCreateOrigin_tax_address_source
LineItemCreateOrigin_tax_address_sourceEnumOrigin
| Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"destination" -> LineItemCreateOrigin_tax_address_source
LineItemCreateOrigin_tax_address_sourceEnumDestination
| Bool
GHC.Base.otherwise -> Value -> LineItemCreateOrigin_tax_address_source
LineItemCreateOrigin_tax_address_sourceOther Value
val
)
data LineItemCreateRevenue_schedule_type
=
LineItemCreateRevenue_schedule_typeOther Data.Aeson.Types.Internal.Value
|
LineItemCreateRevenue_schedule_typeTyped Data.Text.Internal.Text
|
LineItemCreateRevenue_schedule_typeEnumAt_invoice
|
LineItemCreateRevenue_schedule_typeEnumAt_range_end
|
LineItemCreateRevenue_schedule_typeEnumAt_range_start
|
LineItemCreateRevenue_schedule_typeEnumEvenly
|
LineItemCreateRevenue_schedule_typeEnumNever
deriving (Int -> LineItemCreateRevenue_schedule_type -> ShowS
[LineItemCreateRevenue_schedule_type] -> ShowS
LineItemCreateRevenue_schedule_type -> String
(Int -> LineItemCreateRevenue_schedule_type -> ShowS)
-> (LineItemCreateRevenue_schedule_type -> String)
-> ([LineItemCreateRevenue_schedule_type] -> ShowS)
-> Show LineItemCreateRevenue_schedule_type
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> LineItemCreateRevenue_schedule_type -> ShowS
showsPrec :: Int -> LineItemCreateRevenue_schedule_type -> ShowS
$cshow :: LineItemCreateRevenue_schedule_type -> String
show :: LineItemCreateRevenue_schedule_type -> String
$cshowList :: [LineItemCreateRevenue_schedule_type] -> ShowS
showList :: [LineItemCreateRevenue_schedule_type] -> ShowS
GHC.Show.Show, LineItemCreateRevenue_schedule_type
-> LineItemCreateRevenue_schedule_type -> Bool
(LineItemCreateRevenue_schedule_type
-> LineItemCreateRevenue_schedule_type -> Bool)
-> (LineItemCreateRevenue_schedule_type
-> LineItemCreateRevenue_schedule_type -> Bool)
-> Eq LineItemCreateRevenue_schedule_type
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: LineItemCreateRevenue_schedule_type
-> LineItemCreateRevenue_schedule_type -> Bool
== :: LineItemCreateRevenue_schedule_type
-> LineItemCreateRevenue_schedule_type -> Bool
$c/= :: LineItemCreateRevenue_schedule_type
-> LineItemCreateRevenue_schedule_type -> Bool
/= :: LineItemCreateRevenue_schedule_type
-> LineItemCreateRevenue_schedule_type -> Bool
GHC.Classes.Eq)
instance Data.Aeson.Types.ToJSON.ToJSON LineItemCreateRevenue_schedule_type where
toJSON :: LineItemCreateRevenue_schedule_type -> Value
toJSON (LineItemCreateRevenue_schedule_typeOther Value
val) = Value
val
toJSON (LineItemCreateRevenue_schedule_typeTyped Text
val) = Text -> Value
forall a. ToJSON a => a -> Value
Data.Aeson.Types.ToJSON.toJSON Text
val
toJSON (LineItemCreateRevenue_schedule_type
LineItemCreateRevenue_schedule_typeEnumAt_invoice) = Value
"at_invoice"
toJSON (LineItemCreateRevenue_schedule_type
LineItemCreateRevenue_schedule_typeEnumAt_range_end) = Value
"at_range_end"
toJSON (LineItemCreateRevenue_schedule_type
LineItemCreateRevenue_schedule_typeEnumAt_range_start) = Value
"at_range_start"
toJSON (LineItemCreateRevenue_schedule_type
LineItemCreateRevenue_schedule_typeEnumEvenly) = Value
"evenly"
toJSON (LineItemCreateRevenue_schedule_type
LineItemCreateRevenue_schedule_typeEnumNever) = Value
"never"
instance Data.Aeson.Types.FromJSON.FromJSON LineItemCreateRevenue_schedule_type where
parseJSON :: Value -> Parser LineItemCreateRevenue_schedule_type
parseJSON Value
val =
LineItemCreateRevenue_schedule_type
-> Parser LineItemCreateRevenue_schedule_type
forall a. a -> Parser a
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
"at_invoice" -> LineItemCreateRevenue_schedule_type
LineItemCreateRevenue_schedule_typeEnumAt_invoice
| Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"at_range_end" -> LineItemCreateRevenue_schedule_type
LineItemCreateRevenue_schedule_typeEnumAt_range_end
| Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"at_range_start" -> LineItemCreateRevenue_schedule_type
LineItemCreateRevenue_schedule_typeEnumAt_range_start
| Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"evenly" -> LineItemCreateRevenue_schedule_type
LineItemCreateRevenue_schedule_typeEnumEvenly
| Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"never" -> LineItemCreateRevenue_schedule_type
LineItemCreateRevenue_schedule_typeEnumNever
| Bool
GHC.Base.otherwise -> Value -> LineItemCreateRevenue_schedule_type
LineItemCreateRevenue_schedule_typeOther Value
val
)
data LineItemCreateType
=
LineItemCreateTypeOther Data.Aeson.Types.Internal.Value
|
LineItemCreateTypeTyped Data.Text.Internal.Text
|
LineItemCreateTypeEnumCharge
|
LineItemCreateTypeEnumCredit
deriving (Int -> LineItemCreateType -> ShowS
[LineItemCreateType] -> ShowS
LineItemCreateType -> String
(Int -> LineItemCreateType -> ShowS)
-> (LineItemCreateType -> String)
-> ([LineItemCreateType] -> ShowS)
-> Show LineItemCreateType
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> LineItemCreateType -> ShowS
showsPrec :: Int -> LineItemCreateType -> ShowS
$cshow :: LineItemCreateType -> String
show :: LineItemCreateType -> String
$cshowList :: [LineItemCreateType] -> ShowS
showList :: [LineItemCreateType] -> ShowS
GHC.Show.Show, LineItemCreateType -> LineItemCreateType -> Bool
(LineItemCreateType -> LineItemCreateType -> Bool)
-> (LineItemCreateType -> LineItemCreateType -> Bool)
-> Eq LineItemCreateType
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: LineItemCreateType -> LineItemCreateType -> Bool
== :: LineItemCreateType -> LineItemCreateType -> Bool
$c/= :: LineItemCreateType -> LineItemCreateType -> Bool
/= :: LineItemCreateType -> LineItemCreateType -> Bool
GHC.Classes.Eq)
instance Data.Aeson.Types.ToJSON.ToJSON LineItemCreateType where
toJSON :: LineItemCreateType -> Value
toJSON (LineItemCreateTypeOther Value
val) = Value
val
toJSON (LineItemCreateTypeTyped Text
val) = Text -> Value
forall a. ToJSON a => a -> Value
Data.Aeson.Types.ToJSON.toJSON Text
val
toJSON (LineItemCreateType
LineItemCreateTypeEnumCharge) = Value
"charge"
toJSON (LineItemCreateType
LineItemCreateTypeEnumCredit) = Value
"credit"
instance Data.Aeson.Types.FromJSON.FromJSON LineItemCreateType where
parseJSON :: Value -> Parser LineItemCreateType
parseJSON Value
val =
LineItemCreateType -> Parser LineItemCreateType
forall a. a -> Parser a
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
"charge" -> LineItemCreateType
LineItemCreateTypeEnumCharge
| Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"credit" -> LineItemCreateType
LineItemCreateTypeEnumCredit
| Bool
GHC.Base.otherwise -> Value -> LineItemCreateType
LineItemCreateTypeOther Value
val
)