{-# LANGUAGE MultiWayIf #-}
-- CHANGE WITH CAUTION: This is a generated code file generated by https://github.com/Haskell-OpenAPI-Code-Generator/Haskell-OpenAPI-Client-Code-Generator.
{-# LANGUAGE OverloadedStrings #-}

-- | Contains the types generated from the schema LineItemCreate
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

-- | Defines the object schema located at @components.schemas.LineItemCreate@ in the specification.
data LineItemCreate = LineItemCreate
    { LineItemCreate -> Maybe Text
lineItemCreateAccounting_code :: (GHC.Maybe.Maybe Data.Text.Internal.Text)
    -- ^ accounting_code: Accounting Code for the \`LineItem\`. If \`item_code\`\/\`item_id\` is part of the request then \`accounting_code\` must be absent.
    --
    -- Constraints:
    --
    -- * Maximum length of 20
    -- * Must match pattern \'\/^[a-z0-9_+-]+\$\/\'
    , LineItemCreate -> Maybe Int
lineItemCreateAvalara_service_type :: (GHC.Maybe.Maybe GHC.Types.Int)
    -- ^ avalara_service_type: Used by Avalara for Communications taxes. The transaction type in combination with the service type describe how the line item is taxed. Refer to [the documentation](https:\/\/help.avalara.com\/AvaTax_for_Communications\/Tax_Calculation\/AvaTax_for_Communications_Tax_Engine\/Mapping_Resources\/TM_00115_AFC_Modules_Corresponding_Transaction_Types) for more available t\/s types. If an \`Item\` is associated to the \`LineItem\`, then the \`avalara_service_type\` must be absent.
    --
    -- Constraints:
    --
    -- * Minimum  of 0.0
    , LineItemCreate -> Maybe Int
lineItemCreateAvalara_transaction_type :: (GHC.Maybe.Maybe GHC.Types.Int)
    -- ^ avalara_transaction_type: Used by Avalara for Communications taxes. The transaction type in combination with the service type describe how the line item is taxed. Refer to [the documentation](https:\/\/help.avalara.com\/AvaTax_for_Communications\/Tax_Calculation\/AvaTax_for_Communications_Tax_Engine\/Mapping_Resources\/TM_00115_AFC_Modules_Corresponding_Transaction_Types) for more available t\/s types. If an \`Item\` is associated to the \`LineItem\`, then the \`avalara_transaction_type\` must be absent.
    --
    -- Constraints:
    --
    -- * Minimum  of 0.0
    , LineItemCreate -> Maybe LineItemCreateCredit_reason_code
lineItemCreateCredit_reason_code :: (GHC.Maybe.Maybe LineItemCreateCredit_reason_code)
    -- ^ credit_reason_code: The reason the credit was given when line item is \`type=credit\`. When the Credit Invoices feature is enabled, the value can be set and will default to \`general\`. When the Credit Invoices feature is not enabled, the value will always be \`null\`.
    , LineItemCreate -> Text
lineItemCreateCurrency :: Data.Text.Internal.Text
    -- ^ currency: 3-letter ISO 4217 currency code. If \`item_code\`\/\`item_id\` is part of the request then \`currency\` is optional, if the site has a single default currency. \`currency\` is required if \`item_code\`\/\`item_id\` is present, and there are multiple currencies defined on the site. If \`item_code\`\/\`item_id\` is not present \`currency\` is required.
    --
    -- Constraints:
    --
    -- * Maximum length of 3
    , LineItemCreate -> Maybe CustomFields
lineItemCreateCustom_fields :: (GHC.Maybe.Maybe CustomFields)
    -- ^ custom_fields: The custom fields will only be altered when they are included in a request. Sending an empty array will not remove any existing values. To remove a field send the name with a null or empty value.
    , LineItemCreate -> Maybe Text
lineItemCreateDescription :: (GHC.Maybe.Maybe Data.Text.Internal.Text)
    -- ^ description: Description that appears on the invoice. If \`item_code\`\/\`item_id\` is part of the request then \`description\` must be absent.
    --
    -- Constraints:
    --
    -- * Maximum length of 255
    , LineItemCreate
-> Maybe LineItemCreateDestination_tax_address_source
lineItemCreateDestination_tax_address_source :: (GHC.Maybe.Maybe LineItemCreateDestination_tax_address_source)
    -- ^ destination_tax_address_source: The source of the address that will be used as the destinaion in determining taxes. Available only when the site is on an Elite plan. A value of \"destination\" refers to the \"Customer tax address\". A value of \"origin\" refers to the \"Business entity tax address\".
    , LineItemCreate -> Maybe JsonDateTime
lineItemCreateEnd_date :: (GHC.Maybe.Maybe RecurlyClient.Common.JsonDateTime)
    -- ^ end_date: If this date is provided, it indicates the end of a time range.
    , LineItemCreate -> Maybe Text
lineItemCreateItem_code :: (GHC.Maybe.Maybe Data.Text.Internal.Text)
    -- ^ item_code: Unique code to identify an item. Available when the Credit Invoices feature is enabled.
    --
    -- Constraints:
    --
    -- * Maximum length of 50
    -- * Must match pattern \'\/^[a-z0-9_+-]+\$\/\'
    , LineItemCreate -> Maybe Text
lineItemCreateItem_id :: (GHC.Maybe.Maybe Data.Text.Internal.Text)
    -- ^ item_id: System-generated unique identifier for an item. Available when the Credit Invoices feature is enabled.
    --
    -- Constraints:
    --
    -- * Maximum length of 13
    , LineItemCreate -> Maybe Text
lineItemCreateLiability_gl_account_id :: (GHC.Maybe.Maybe Data.Text.Internal.Text)
    -- ^ liability_gl_account_id: The ID of a general ledger account. General ledger accounts are
    -- only accessible as a part of the Recurly RevRec Standard and
    -- Recurly RevRec Advanced features.
    --
    --
    -- Constraints:
    --
    -- * Maximum length of 13
    , LineItemCreate -> Maybe LineItemCreateOrigin
lineItemCreateOrigin :: (GHC.Maybe.Maybe LineItemCreateOrigin)
    -- ^ origin: Origin \`external_gift_card\` is allowed if the Gift Cards feature is enabled on your site and \`type\` is \`credit\`. Set this value in order to track gift card credits from external gift cards (like InComm). It also skips billing information requirements.  Origin \`prepayment\` is only allowed if \`type\` is \`charge\` and \`tax_exempt\` is left blank or set to true.  This origin creates a charge and opposite credit on the account to be used for future invoices.
    , LineItemCreate -> Maybe LineItemCreateOrigin_tax_address_source
lineItemCreateOrigin_tax_address_source :: (GHC.Maybe.Maybe LineItemCreateOrigin_tax_address_source)
    -- ^ origin_tax_address_source: The source of the address that will be used as the origin in determining taxes. Available only when the site is on an Elite plan. A value of \"origin\" refers to the \"Business entity tax address\". A value of \"destination\" refers to the \"Customer tax address\".
    , LineItemCreate -> Maybe Text
lineItemCreatePerformance_obligation_id :: (GHC.Maybe.Maybe Data.Text.Internal.Text)
    -- ^ performance_obligation_id: The ID of a performance obligation. Performance obligations are
    -- only accessible as a part of the Recurly RevRec Standard and
    -- Recurly RevRec Advanced features.
    --
    --
    -- Constraints:
    --
    -- * Maximum length of 13
    , LineItemCreate -> Maybe Text
lineItemCreateProduct_code :: (GHC.Maybe.Maybe Data.Text.Internal.Text)
    -- ^ product_code: Optional field to track a product code or SKU for the line item. This can be used to later reporting on product purchases. For Vertex tax calculations, this field will be used as the Vertex \`product\` field. If \`item_code\`\/\`item_id\` is part of the request then \`product_code\` must be absent.
    --
    -- Constraints:
    --
    -- * Maximum length of 50
    , LineItemCreate -> Maybe Int
lineItemCreateQuantity :: (GHC.Maybe.Maybe GHC.Types.Int)
    -- ^ quantity: This number will be multiplied by the unit amount to compute the subtotal before any discounts or taxes.
    , LineItemCreate -> Maybe Text
lineItemCreateRevenue_gl_account_id :: (GHC.Maybe.Maybe Data.Text.Internal.Text)
    -- ^ revenue_gl_account_id: The ID of a general ledger account. General ledger accounts are
    -- only accessible as a part of the Recurly RevRec Standard and
    -- Recurly RevRec Advanced features.
    --
    --
    -- Constraints:
    --
    -- * Maximum length of 13
    , LineItemCreate -> Maybe LineItemCreateRevenue_schedule_type
lineItemCreateRevenue_schedule_type :: (GHC.Maybe.Maybe LineItemCreateRevenue_schedule_type)
    -- ^ revenue_schedule_type
    , LineItemCreate -> Maybe JsonDateTime
lineItemCreateStart_date :: (GHC.Maybe.Maybe RecurlyClient.Common.JsonDateTime)
    -- ^ start_date: If an end date is present, this is value indicates the beginning of a billing time range. If no end date is present it indicates billing for a specific date. Defaults to the current date-time.
    , LineItemCreate -> Maybe Text
lineItemCreateTax_code :: (GHC.Maybe.Maybe Data.Text.Internal.Text)
    -- ^ tax_code: Optional field used by Avalara, Vertex, and Recurly\'s In-the-Box tax solution to determine taxation rules. You can pass in specific tax codes using any of these tax integrations. For Recurly\'s In-the-Box tax offering you can also choose to instead use simple values of \`unknown\`, \`physical\`, or \`digital\` tax codes.
    --
    -- Constraints:
    --
    -- * Maximum length of 50
    , LineItemCreate -> Maybe Bool
lineItemCreateTax_exempt :: (GHC.Maybe.Maybe GHC.Types.Bool)
    -- ^ tax_exempt: \`true\` exempts tax on charges, \`false\` applies tax on charges. If not defined, then defaults to the Plan and Site settings. This attribute does not work for credits (negative line items). Credits are always applied post-tax. Pre-tax discounts should use the Coupons feature.
    , LineItemCreate -> Maybe Bool
lineItemCreateTax_inclusive :: (GHC.Maybe.Maybe GHC.Types.Bool)
    -- ^ tax_inclusive: Determines whether or not tax is included in the unit amount. The Tax Inclusive Pricing feature (separate from the Mixed Tax Pricing feature) must be enabled to use this flag.
    , LineItemCreate -> LineItemCreateType
lineItemCreateType :: LineItemCreateType
    -- ^ type: Line item type. If \`item_code\`\/\`item_id\` is present then \`type\` should not be present. If \`item_code\`\/\`item_id\` is not present then \`type\` is required.
    , LineItemCreate -> Float
lineItemCreateUnit_amount :: GHC.Types.Float
    -- ^ unit_amount: A positive or negative amount with \`type=charge\` will result in a positive \`unit_amount\`.
    -- A positive or negative amount with \`type=credit\` will result in a negative \`unit_amount\`.
    -- If \`item_code\`\/\`item_id\` is present, \`unit_amount\` can be passed in, to override the
    -- \`Item\`\'s \`unit_amount\`. If \`item_code\`\/\`item_id\` is not present then \`unit_amount\` is required.
    }
    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"))

-- | Create a new 'LineItemCreate' with all required fields.
mkLineItemCreate ::
    -- | 'lineItemCreateCurrency'
    Data.Text.Internal.Text ->
    -- | 'lineItemCreateType'
    LineItemCreateType ->
    -- | 'lineItemCreateUnit_amount'
    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
        }

{- | Defines the enum schema located at @components.schemas.LineItemCreate.properties.credit_reason_code@ in the specification.

The reason the credit was given when line item is \`type=credit\`. When the Credit Invoices feature is enabled, the value can be set and will default to \`general\`. When the Credit Invoices feature is not enabled, the value will always be \`null\`.
-}
data LineItemCreateCredit_reason_code
    = -- | This case is used if the value encountered during decoding does not match any of the provided cases in the specification.
      LineItemCreateCredit_reason_codeOther Data.Aeson.Types.Internal.Value
    | -- | This constructor can be used to send values to the server which are not present in the specification yet.
      LineItemCreateCredit_reason_codeTyped Data.Text.Internal.Text
    | -- | Represents the JSON value @"general"@
      LineItemCreateCredit_reason_codeEnumGeneral
    | -- | Represents the JSON value @"promotional"@
      LineItemCreateCredit_reason_codeEnumPromotional
    | -- | Represents the JSON value @"service"@
      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
            )

{- | Defines the enum schema located at @components.schemas.LineItemCreate.properties.destination_tax_address_source@ in the specification.

The source of the address that will be used as the destinaion in determining taxes. Available only when the site is on an Elite plan. A value of \"destination\" refers to the \"Customer tax address\". A value of \"origin\" refers to the \"Business entity tax address\".
-}
data LineItemCreateDestination_tax_address_source
    = -- | This case is used if the value encountered during decoding does not match any of the provided cases in the specification.
      LineItemCreateDestination_tax_address_sourceOther Data.Aeson.Types.Internal.Value
    | -- | This constructor can be used to send values to the server which are not present in the specification yet.
      LineItemCreateDestination_tax_address_sourceTyped Data.Text.Internal.Text
    | -- | Represents the JSON value @"destination"@
      LineItemCreateDestination_tax_address_sourceEnumDestination
    | -- | Represents the JSON value @"origin"@
      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
            )

{- | Defines the enum schema located at @components.schemas.LineItemCreate.properties.origin@ in the specification.

Origin \`external_gift_card\` is allowed if the Gift Cards feature is enabled on your site and \`type\` is \`credit\`. Set this value in order to track gift card credits from external gift cards (like InComm). It also skips billing information requirements.  Origin \`prepayment\` is only allowed if \`type\` is \`charge\` and \`tax_exempt\` is left blank or set to true.  This origin creates a charge and opposite credit on the account to be used for future invoices.
-}
data LineItemCreateOrigin
    = -- | This case is used if the value encountered during decoding does not match any of the provided cases in the specification.
      LineItemCreateOriginOther Data.Aeson.Types.Internal.Value
    | -- | This constructor can be used to send values to the server which are not present in the specification yet.
      LineItemCreateOriginTyped Data.Text.Internal.Text
    | -- | Represents the JSON value @"external_gift_card"@
      LineItemCreateOriginEnumExternal_gift_card
    | -- | Represents the JSON value @"prepayment"@
      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
            )

{- | Defines the enum schema located at @components.schemas.LineItemCreate.properties.origin_tax_address_source@ in the specification.

The source of the address that will be used as the origin in determining taxes. Available only when the site is on an Elite plan. A value of \"origin\" refers to the \"Business entity tax address\". A value of \"destination\" refers to the \"Customer tax address\".
-}
data LineItemCreateOrigin_tax_address_source
    = -- | This case is used if the value encountered during decoding does not match any of the provided cases in the specification.
      LineItemCreateOrigin_tax_address_sourceOther Data.Aeson.Types.Internal.Value
    | -- | This constructor can be used to send values to the server which are not present in the specification yet.
      LineItemCreateOrigin_tax_address_sourceTyped Data.Text.Internal.Text
    | -- | Represents the JSON value @"origin"@
      LineItemCreateOrigin_tax_address_sourceEnumOrigin
    | -- | Represents the JSON value @"destination"@
      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
            )

-- | Defines the enum schema located at @components.schemas.LineItemCreate.properties.revenue_schedule_type@ in the specification.
data LineItemCreateRevenue_schedule_type
    = -- | This case is used if the value encountered during decoding does not match any of the provided cases in the specification.
      LineItemCreateRevenue_schedule_typeOther Data.Aeson.Types.Internal.Value
    | -- | This constructor can be used to send values to the server which are not present in the specification yet.
      LineItemCreateRevenue_schedule_typeTyped Data.Text.Internal.Text
    | -- | Represents the JSON value @"at_invoice"@
      LineItemCreateRevenue_schedule_typeEnumAt_invoice
    | -- | Represents the JSON value @"at_range_end"@
      LineItemCreateRevenue_schedule_typeEnumAt_range_end
    | -- | Represents the JSON value @"at_range_start"@
      LineItemCreateRevenue_schedule_typeEnumAt_range_start
    | -- | Represents the JSON value @"evenly"@
      LineItemCreateRevenue_schedule_typeEnumEvenly
    | -- | Represents the JSON value @"never"@
      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
            )

{- | Defines the enum schema located at @components.schemas.LineItemCreate.properties.type@ in the specification.

Line item type. If \`item_code\`\/\`item_id\` is present then \`type\` should not be present. If \`item_code\`\/\`item_id\` is not present then \`type\` is required.
-}
data LineItemCreateType
    = -- | This case is used if the value encountered during decoding does not match any of the provided cases in the specification.
      LineItemCreateTypeOther Data.Aeson.Types.Internal.Value
    | -- | This constructor can be used to send values to the server which are not present in the specification yet.
      LineItemCreateTypeTyped Data.Text.Internal.Text
    | -- | Represents the JSON value @"charge"@
      LineItemCreateTypeEnumCharge
    | -- | Represents the JSON value @"credit"@
      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
            )