{-# 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 Invoice
module RecurlyClient.Types.Invoice 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 {-# SOURCE #-} RecurlyClient.Types.AccountMini
import {-# SOURCE #-} RecurlyClient.Types.CreditPayment
import {-# SOURCE #-} RecurlyClient.Types.InvoiceAddress
import {-# SOURCE #-} RecurlyClient.Types.LineItem
import {-# SOURCE #-} RecurlyClient.Types.ShippingAddress
import {-# SOURCE #-} RecurlyClient.Types.TaxInfo
import {-# SOURCE #-} RecurlyClient.Types.Transaction
import qualified Prelude as GHC.Integer.Type
import qualified Prelude as GHC.Maybe

-- | Defines the object schema located at @components.schemas.Invoice@ in the specification.
data Invoice = Invoice
    { Invoice -> Maybe AccountMini
invoiceAccount :: (GHC.Maybe.Maybe AccountMini)
    -- ^ account
    , Invoice -> Maybe InvoiceAddress
invoiceAddress :: (GHC.Maybe.Maybe InvoiceAddress)
    -- ^ address
    , Invoice -> Maybe Float
invoiceBalance :: (GHC.Maybe.Maybe GHC.Types.Float)
    -- ^ balance: The outstanding balance remaining on this invoice.
    , Invoice -> Maybe Text
invoiceBilling_info_id :: (GHC.Maybe.Maybe Data.Text.Internal.Text)
    -- ^ billing_info_id: The \`billing_info_id\` is the value that represents a specific billing info for an end customer. When \`billing_info_id\` is used to assign billing info to the subscription, all future billing events for the subscription will bill to the specified billing info. \`billing_info_id\` can ONLY be used for sites utilizing the Wallet feature.
    , Invoice -> Maybe Text
invoiceBusiness_entity_id :: (GHC.Maybe.Maybe Data.Text.Internal.Text)
    -- ^ business_entity_id: Unique ID to identify the business entity assigned to the invoice. Available when the \`Multiple Business Entities\` feature is enabled.
    , Invoice -> Maybe JsonDateTime
invoiceClosed_at :: (GHC.Maybe.Maybe RecurlyClient.Common.JsonDateTime)
    -- ^ closed_at: Date invoice was marked paid or failed.
    , Invoice -> Maybe InvoiceCollection_method
invoiceCollection_method :: (GHC.Maybe.Maybe InvoiceCollection_method)
    -- ^ collection_method: An automatic invoice means a corresponding transaction is run using the account\'s billing information at the same time the invoice is created. Manual invoices are created without a corresponding transaction. The merchant must enter a manual payment transaction or have the customer pay the invoice with an automatic method, like credit card, PayPal, Amazon, or ACH bank payment.
    , Invoice -> Maybe JsonDateTime
invoiceCreated_at :: (GHC.Maybe.Maybe RecurlyClient.Common.JsonDateTime)
    -- ^ created_at
    , Invoice -> Maybe [CreditPayment]
invoiceCredit_payments :: (GHC.Maybe.Maybe [CreditPayment])
    -- ^ credit_payments
    , Invoice -> Maybe Text
invoiceCurrency :: (GHC.Maybe.Maybe Data.Text.Internal.Text)
    -- ^ currency: 3-letter ISO 4217 currency code.
    --
    -- Constraints:
    --
    -- * Maximum length of 3
    , Invoice -> Maybe Text
invoiceCustomer_notes :: (GHC.Maybe.Maybe Data.Text.Internal.Text)
    -- ^ customer_notes: This will default to the Customer Notes text specified on the Invoice Settings. Specify custom notes to add or override Customer Notes.
    , Invoice -> Maybe Float
invoiceDiscount :: (GHC.Maybe.Maybe GHC.Types.Float)
    -- ^ discount: Total discounts applied to this invoice.
    , Invoice -> Maybe JsonDateTime
invoiceDue_at :: (GHC.Maybe.Maybe RecurlyClient.Common.JsonDateTime)
    -- ^ due_at: Date invoice is due. This is the date the net terms are reached.
    , Invoice -> Maybe Text
invoiceDunning_campaign_id :: (GHC.Maybe.Maybe Data.Text.Internal.Text)
    -- ^ dunning_campaign_id: Unique ID to identify the dunning campaign used when dunning the invoice. For sites without multiple dunning campaigns enabled, this will always be the default dunning campaign.
    , Invoice -> Maybe Int
invoiceDunning_events_sent :: (GHC.Maybe.Maybe GHC.Types.Int)
    -- ^ dunning_events_sent: Number of times the event was sent.
    , Invoice -> Maybe Bool
invoiceFinal_dunning_event :: (GHC.Maybe.Maybe GHC.Types.Bool)
    -- ^ final_dunning_event: Last communication attempt.
    , Invoice -> Maybe Bool
invoiceHas_more_line_items :: (GHC.Maybe.Maybe GHC.Types.Bool)
    -- ^ has_more_line_items: Identifies if the invoice has more line items than are returned in \`line_items\`. If \`has_more_line_items\` is \`true\`, then a request needs to be made to the \`list_invoice_line_items\` endpoint.
    , Invoice -> Maybe Text
invoiceId :: (GHC.Maybe.Maybe Data.Text.Internal.Text)
    -- ^ id
    , Invoice -> Maybe [LineItem]
invoiceLine_items :: (GHC.Maybe.Maybe [LineItem])
    -- ^ line_items
    , Invoice -> Maybe Int
invoiceNet_terms :: (GHC.Maybe.Maybe GHC.Types.Int)
    -- ^ net_terms: Integer paired with \`Net Terms Type\` and representing the number
    -- of days past the current date (for \`net\` Net Terms Type) or days after
    -- the last day of the current month (for \`eom\` Net Terms Type) that the
    -- invoice will become past due. For \`manual\` collection method, an additional 24 hours is
    -- added to ensure the customer has the entire last day to make payment before
    -- becoming past due. For example:
    --
    -- If an invoice is due \`net 0\`, it is due \'On Receipt\' and will become past due 24 hours after it\'s created.
    -- If an invoice is due \`net 30\`, it will become past due at 31 days exactly.
    -- If an invoice is due \`eom 30\`, it will become past due 31 days from the last day of the current month.
    --
    -- For \`automatic\` collection method, the additional 24 hours is not added. For example, On-Receipt is due immediately, and \`net 30\` will become due exactly 30 days from invoice generation, at which point Recurly will attempt collection.
    -- When \`eom\` Net Terms Type is passed, the value for \`Net Terms\` is restricted to \`0, 15, 30, 45, 60, or 90\`.
    --
    -- For more information on how net terms work with \`manual\` collection visit our docs page (https:\/\/docs.recurly.com\/docs\/manual-payments\#section-collection-terms)
    -- or visit (https:\/\/docs.recurly.com\/docs\/automatic-invoicing-terms\#section-collection-terms) for information about net terms using \`automatic\` collection.
    --
    -- Constraints:
    --
    -- * Minimum  of 0.0
    , Invoice -> Maybe InvoiceNet_terms_type
invoiceNet_terms_type :: (GHC.Maybe.Maybe InvoiceNet_terms_type)
    -- ^ net_terms_type: Optionally supplied string that may be either \`net\` or \`eom\` (end-of-month).
    -- When \`net\`, an invoice becomes past due the specified number of \`Net Terms\` days from the current date.
    -- When \`eom\` an invoice becomes past due the specified number of \`Net Terms\` days from the last day of the current month.
    , Invoice -> Maybe Text
invoiceNumber :: (GHC.Maybe.Maybe Data.Text.Internal.Text)
    -- ^ number: If VAT taxation and the Country Invoice Sequencing feature are enabled, invoices will have country-specific invoice numbers for invoices billed to EU countries (ex: FR1001). Non-EU invoices will continue to use the site-level invoice number sequence.
    , Invoice -> Maybe Text
invoiceObject :: (GHC.Maybe.Maybe Data.Text.Internal.Text)
    -- ^ object
    , Invoice -> Maybe InvoiceOrigin
invoiceOrigin :: (GHC.Maybe.Maybe InvoiceOrigin)
    -- ^ origin: The event that created the invoice.
    , Invoice -> Maybe Float
invoicePaid :: (GHC.Maybe.Maybe GHC.Types.Float)
    -- ^ paid: The total amount of successful payments transaction on this invoice.
    , Invoice -> Maybe Text
invoicePo_number :: (GHC.Maybe.Maybe Data.Text.Internal.Text)
    -- ^ po_number: For manual invoicing, this identifies the PO number associated with the subscription.
    --
    -- Constraints:
    --
    -- * Maximum length of 50
    , Invoice -> Maybe Text
invoicePrevious_invoice_id :: (GHC.Maybe.Maybe Data.Text.Internal.Text)
    -- ^ previous_invoice_id: On refund invoices, this value will exist and show the invoice ID of the purchase invoice the refund was created from. This field is only populated for sites without the [Only Bill What Changed](https:\/\/docs.recurly.com\/docs\/only-bill-what-changed) feature enabled. Sites with Only Bill What Changed enabled should use the [related_invoices endpoint](https:\/\/recurly.com\/developers\/api\/v2021-02-25\/index.html\#operation\/list_related_invoices) to see purchase invoices refunded by this invoice.
    --
    -- Constraints:
    --
    -- * Maximum length of 13
    , Invoice -> Maybe Float
invoiceRefundable_amount :: (GHC.Maybe.Maybe GHC.Types.Float)
    -- ^ refundable_amount: The refundable amount on a charge invoice. It will be null for all other invoices.
    , Invoice -> Maybe ShippingAddress
invoiceShipping_address :: (GHC.Maybe.Maybe ShippingAddress)
    -- ^ shipping_address
    , Invoice -> Maybe InvoiceState
invoiceState :: (GHC.Maybe.Maybe InvoiceState)
    -- ^ state
    , Invoice -> Maybe [Text]
invoiceSubscription_ids :: (GHC.Maybe.Maybe [Data.Text.Internal.Text])
    -- ^ subscription_ids: If the invoice is charging or refunding for one or more subscriptions, these are their IDs.
    , Invoice -> Maybe Float
invoiceSubtotal :: (GHC.Maybe.Maybe GHC.Types.Float)
    -- ^ subtotal: The summation of charges and credits, before discounts and taxes.
    , Invoice -> Maybe Float
invoiceTax :: (GHC.Maybe.Maybe GHC.Types.Float)
    -- ^ tax: The total tax on this invoice.
    , Invoice -> Maybe TaxInfo
invoiceTax_info :: (GHC.Maybe.Maybe TaxInfo)
    -- ^ tax_info: Only for merchants using Recurly\'s In-The-Box taxes.
    , Invoice -> Maybe Text
invoiceTerms_and_conditions :: (GHC.Maybe.Maybe Data.Text.Internal.Text)
    -- ^ terms_and_conditions: This will default to the Terms and Conditions text specified on the Invoice Settings page in your Recurly admin. Specify custom notes to add or override Terms and Conditions.
    , Invoice -> Maybe Float
invoiceTotal :: (GHC.Maybe.Maybe GHC.Types.Float)
    -- ^ total: The final total on this invoice. The summation of invoice charges, discounts, credits, and tax.
    , Invoice -> Maybe [Transaction]
invoiceTransactions :: (GHC.Maybe.Maybe [Transaction])
    -- ^ transactions
    , Invoice -> Maybe InvoiceType
invoiceType :: (GHC.Maybe.Maybe InvoiceType)
    -- ^ type: Invoices are either charge, credit, or legacy invoices.
    , Invoice -> Maybe JsonDateTime
invoiceUpdated_at :: (GHC.Maybe.Maybe RecurlyClient.Common.JsonDateTime)
    -- ^ updated_at
    , Invoice -> Maybe Bool
invoiceUsed_tax_service :: (GHC.Maybe.Maybe GHC.Types.Bool)
    -- ^ used_tax_service: Will be \`true\` when the invoice had a successful response from the tax service and \`false\` when the invoice was not sent to tax service due to a lack of address or enabled jurisdiction or was processed without tax due to a non-blocking error returned from the tax service.
    , Invoice -> Maybe Text
invoiceUuid :: (GHC.Maybe.Maybe Data.Text.Internal.Text)
    -- ^ uuid
    , Invoice -> Maybe Text
invoiceVat_number :: (GHC.Maybe.Maybe Data.Text.Internal.Text)
    -- ^ vat_number: VAT registration number for the customer on this invoice. This will come from the VAT Number field in the Billing Info or the Account Info depending on your tax settings and the invoice collection method.
    --
    -- Constraints:
    --
    -- * Maximum length of 20
    , Invoice -> Maybe Text
invoiceVat_reverse_charge_notes :: (GHC.Maybe.Maybe Data.Text.Internal.Text)
    -- ^ vat_reverse_charge_notes: VAT Reverse Charge Notes only appear if you have EU VAT enabled or are using your own Avalara AvaTax account and the customer is in the EU, has a VAT number, and is in a different country than your own. This will default to the VAT Reverse Charge Notes text specified on the Tax Settings page in your Recurly admin, unless custom notes were created with the original subscription.
    }
    deriving
        ( Int -> Invoice -> ShowS
[Invoice] -> ShowS
Invoice -> String
(Int -> Invoice -> ShowS)
-> (Invoice -> String) -> ([Invoice] -> ShowS) -> Show Invoice
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> Invoice -> ShowS
showsPrec :: Int -> Invoice -> ShowS
$cshow :: Invoice -> String
show :: Invoice -> String
$cshowList :: [Invoice] -> ShowS
showList :: [Invoice] -> ShowS
GHC.Show.Show
        , Invoice -> Invoice -> Bool
(Invoice -> Invoice -> Bool)
-> (Invoice -> Invoice -> Bool) -> Eq Invoice
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: Invoice -> Invoice -> Bool
== :: Invoice -> Invoice -> Bool
$c/= :: Invoice -> Invoice -> Bool
/= :: Invoice -> Invoice -> Bool
GHC.Classes.Eq
        )

instance Data.Aeson.Types.ToJSON.ToJSON Invoice where
    toJSON :: Invoice -> Value
toJSON Invoice
obj = [Pair] -> Value
Data.Aeson.Types.Internal.object ([[Pair]] -> [Pair]
forall (t :: * -> *) a. Foldable t => t [a] -> [a]
Data.Foldable.concat ([Pair] -> (AccountMini -> [Pair]) -> Maybe AccountMini -> [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]) -> (AccountMini -> Pair) -> AccountMini -> [Pair]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"account" Key -> AccountMini -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..=)) (Invoice -> Maybe AccountMini
invoiceAccount Invoice
obj) [Pair] -> [[Pair]] -> [[Pair]]
forall a. a -> [a] -> [a]
: [Pair]
-> (InvoiceAddress -> [Pair]) -> Maybe InvoiceAddress -> [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])
-> (InvoiceAddress -> Pair) -> InvoiceAddress -> [Pair]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"address" Key -> InvoiceAddress -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..=)) (Invoice -> Maybe InvoiceAddress
invoiceAddress Invoice
obj) [Pair] -> [[Pair]] -> [[Pair]]
forall a. a -> [a] -> [a]
: [Pair] -> (Float -> [Pair]) -> Maybe Float -> [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]) -> (Float -> Pair) -> Float -> [Pair]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"balance" Key -> Float -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..=)) (Invoice -> Maybe Float
invoiceBalance Invoice
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
"billing_info_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..=)) (Invoice -> Maybe Text
invoiceBilling_info_id Invoice
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
"business_entity_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..=)) (Invoice -> Maybe Text
invoiceBusiness_entity_id Invoice
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
"closed_at" Key -> JsonDateTime -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..=)) (Invoice -> Maybe JsonDateTime
invoiceClosed_at Invoice
obj) [Pair] -> [[Pair]] -> [[Pair]]
forall a. a -> [a] -> [a]
: [Pair]
-> (InvoiceCollection_method -> [Pair])
-> Maybe InvoiceCollection_method
-> [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])
-> (InvoiceCollection_method -> Pair)
-> InvoiceCollection_method
-> [Pair]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"collection_method" Key -> InvoiceCollection_method -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..=)) (Invoice -> Maybe InvoiceCollection_method
invoiceCollection_method Invoice
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
"created_at" Key -> JsonDateTime -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..=)) (Invoice -> Maybe JsonDateTime
invoiceCreated_at Invoice
obj) [Pair] -> [[Pair]] -> [[Pair]]
forall a. a -> [a] -> [a]
: [Pair]
-> ([CreditPayment] -> [Pair]) -> Maybe [CreditPayment] -> [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])
-> ([CreditPayment] -> Pair) -> [CreditPayment] -> [Pair]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"credit_payments" Key -> [CreditPayment] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..=)) (Invoice -> Maybe [CreditPayment]
invoiceCredit_payments Invoice
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
"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..=)) (Invoice -> Maybe Text
invoiceCurrency Invoice
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
"customer_notes" Key -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..=)) (Invoice -> Maybe Text
invoiceCustomer_notes Invoice
obj) [Pair] -> [[Pair]] -> [[Pair]]
forall a. a -> [a] -> [a]
: [Pair] -> (Float -> [Pair]) -> Maybe Float -> [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]) -> (Float -> Pair) -> Float -> [Pair]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"discount" Key -> Float -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..=)) (Invoice -> Maybe Float
invoiceDiscount Invoice
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
"due_at" Key -> JsonDateTime -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..=)) (Invoice -> Maybe JsonDateTime
invoiceDue_at Invoice
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
"dunning_campaign_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..=)) (Invoice -> Maybe Text
invoiceDunning_campaign_id Invoice
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
"dunning_events_sent" Key -> Int -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..=)) (Invoice -> Maybe Int
invoiceDunning_events_sent Invoice
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
"final_dunning_event" Key -> Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..=)) (Invoice -> Maybe Bool
invoiceFinal_dunning_event Invoice
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
"has_more_line_items" Key -> Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..=)) (Invoice -> Maybe Bool
invoiceHas_more_line_items Invoice
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
"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..=)) (Invoice -> Maybe Text
invoiceId Invoice
obj) [Pair] -> [[Pair]] -> [[Pair]]
forall a. a -> [a] -> [a]
: [Pair] -> ([LineItem] -> [Pair]) -> Maybe [LineItem] -> [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]) -> ([LineItem] -> Pair) -> [LineItem] -> [Pair]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"line_items" Key -> [LineItem] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..=)) (Invoice -> Maybe [LineItem]
invoiceLine_items Invoice
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
"net_terms" Key -> Int -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..=)) (Invoice -> Maybe Int
invoiceNet_terms Invoice
obj) [Pair] -> [[Pair]] -> [[Pair]]
forall a. a -> [a] -> [a]
: [Pair]
-> (InvoiceNet_terms_type -> [Pair])
-> Maybe InvoiceNet_terms_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])
-> (InvoiceNet_terms_type -> Pair)
-> InvoiceNet_terms_type
-> [Pair]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"net_terms_type" Key -> InvoiceNet_terms_type -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..=)) (Invoice -> Maybe InvoiceNet_terms_type
invoiceNet_terms_type Invoice
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
"number" Key -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..=)) (Invoice -> Maybe Text
invoiceNumber Invoice
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
"object" Key -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..=)) (Invoice -> Maybe Text
invoiceObject Invoice
obj) [Pair] -> [[Pair]] -> [[Pair]]
forall a. a -> [a] -> [a]
: [Pair]
-> (InvoiceOrigin -> [Pair]) -> Maybe InvoiceOrigin -> [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])
-> (InvoiceOrigin -> Pair) -> InvoiceOrigin -> [Pair]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"origin" Key -> InvoiceOrigin -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..=)) (Invoice -> Maybe InvoiceOrigin
invoiceOrigin Invoice
obj) [Pair] -> [[Pair]] -> [[Pair]]
forall a. a -> [a] -> [a]
: [Pair] -> (Float -> [Pair]) -> Maybe Float -> [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]) -> (Float -> Pair) -> Float -> [Pair]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"paid" Key -> Float -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..=)) (Invoice -> Maybe Float
invoicePaid Invoice
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
"po_number" Key -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..=)) (Invoice -> Maybe Text
invoicePo_number Invoice
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
"previous_invoice_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..=)) (Invoice -> Maybe Text
invoicePrevious_invoice_id Invoice
obj) [Pair] -> [[Pair]] -> [[Pair]]
forall a. a -> [a] -> [a]
: [Pair] -> (Float -> [Pair]) -> Maybe Float -> [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]) -> (Float -> Pair) -> Float -> [Pair]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"refundable_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..=)) (Invoice -> Maybe Float
invoiceRefundable_amount Invoice
obj) [Pair] -> [[Pair]] -> [[Pair]]
forall a. a -> [a] -> [a]
: [Pair]
-> (ShippingAddress -> [Pair]) -> Maybe ShippingAddress -> [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])
-> (ShippingAddress -> Pair) -> ShippingAddress -> [Pair]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"shipping_address" Key -> ShippingAddress -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..=)) (Invoice -> Maybe ShippingAddress
invoiceShipping_address Invoice
obj) [Pair] -> [[Pair]] -> [[Pair]]
forall a. a -> [a] -> [a]
: [Pair] -> (InvoiceState -> [Pair]) -> Maybe InvoiceState -> [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])
-> (InvoiceState -> Pair) -> InvoiceState -> [Pair]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"state" Key -> InvoiceState -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..=)) (Invoice -> Maybe InvoiceState
invoiceState Invoice
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
"subscription_ids" Key -> [Text] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..=)) (Invoice -> Maybe [Text]
invoiceSubscription_ids Invoice
obj) [Pair] -> [[Pair]] -> [[Pair]]
forall a. a -> [a] -> [a]
: [Pair] -> (Float -> [Pair]) -> Maybe Float -> [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]) -> (Float -> Pair) -> Float -> [Pair]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"subtotal" Key -> Float -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..=)) (Invoice -> Maybe Float
invoiceSubtotal Invoice
obj) [Pair] -> [[Pair]] -> [[Pair]]
forall a. a -> [a] -> [a]
: [Pair] -> (Float -> [Pair]) -> Maybe Float -> [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]) -> (Float -> Pair) -> Float -> [Pair]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"tax" Key -> Float -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..=)) (Invoice -> Maybe Float
invoiceTax Invoice
obj) [Pair] -> [[Pair]] -> [[Pair]]
forall a. a -> [a] -> [a]
: [Pair] -> (TaxInfo -> [Pair]) -> Maybe TaxInfo -> [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]) -> (TaxInfo -> Pair) -> TaxInfo -> [Pair]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"tax_info" Key -> TaxInfo -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..=)) (Invoice -> Maybe TaxInfo
invoiceTax_info Invoice
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
"terms_and_conditions" Key -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..=)) (Invoice -> Maybe Text
invoiceTerms_and_conditions Invoice
obj) [Pair] -> [[Pair]] -> [[Pair]]
forall a. a -> [a] -> [a]
: [Pair] -> (Float -> [Pair]) -> Maybe Float -> [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]) -> (Float -> Pair) -> Float -> [Pair]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"total" Key -> Float -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..=)) (Invoice -> Maybe Float
invoiceTotal Invoice
obj) [Pair] -> [[Pair]] -> [[Pair]]
forall a. a -> [a] -> [a]
: [Pair]
-> ([Transaction] -> [Pair]) -> Maybe [Transaction] -> [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])
-> ([Transaction] -> Pair) -> [Transaction] -> [Pair]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"transactions" Key -> [Transaction] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..=)) (Invoice -> Maybe [Transaction]
invoiceTransactions Invoice
obj) [Pair] -> [[Pair]] -> [[Pair]]
forall a. a -> [a] -> [a]
: [Pair] -> (InvoiceType -> [Pair]) -> Maybe InvoiceType -> [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]) -> (InvoiceType -> Pair) -> InvoiceType -> [Pair]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"type" Key -> InvoiceType -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..=)) (Invoice -> Maybe InvoiceType
invoiceType Invoice
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
"updated_at" Key -> JsonDateTime -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..=)) (Invoice -> Maybe JsonDateTime
invoiceUpdated_at Invoice
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
"used_tax_service" Key -> Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..=)) (Invoice -> Maybe Bool
invoiceUsed_tax_service Invoice
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
"uuid" Key -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..=)) (Invoice -> Maybe Text
invoiceUuid Invoice
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
"vat_number" Key -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..=)) (Invoice -> Maybe Text
invoiceVat_number Invoice
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
"vat_reverse_charge_notes" Key -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..=)) (Invoice -> Maybe Text
invoiceVat_reverse_charge_notes Invoice
obj) [Pair] -> [[Pair]] -> [[Pair]]
forall a. a -> [a] -> [a]
: [[Pair]]
forall a. Monoid a => a
GHC.Base.mempty))
    toEncoding :: Invoice -> Encoding
toEncoding Invoice
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]
-> (AccountMini -> [Series]) -> Maybe AccountMini -> [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])
-> (AccountMini -> Series) -> AccountMini -> [Series]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"account" Key -> AccountMini -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..=)) (Invoice -> Maybe AccountMini
invoiceAccount Invoice
obj) [Series] -> [[Series]] -> [[Series]]
forall a. a -> [a] -> [a]
: [Series]
-> (InvoiceAddress -> [Series]) -> Maybe InvoiceAddress -> [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])
-> (InvoiceAddress -> Series) -> InvoiceAddress -> [Series]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"address" Key -> InvoiceAddress -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..=)) (Invoice -> Maybe InvoiceAddress
invoiceAddress Invoice
obj) [Series] -> [[Series]] -> [[Series]]
forall a. a -> [a] -> [a]
: [Series] -> (Float -> [Series]) -> Maybe Float -> [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]) -> (Float -> Series) -> Float -> [Series]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"balance" Key -> Float -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..=)) (Invoice -> Maybe Float
invoiceBalance Invoice
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
"billing_info_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..=)) (Invoice -> Maybe Text
invoiceBilling_info_id Invoice
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
"business_entity_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..=)) (Invoice -> Maybe Text
invoiceBusiness_entity_id Invoice
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
"closed_at" Key -> JsonDateTime -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..=)) (Invoice -> Maybe JsonDateTime
invoiceClosed_at Invoice
obj) [Series] -> [[Series]] -> [[Series]]
forall a. a -> [a] -> [a]
: [Series]
-> (InvoiceCollection_method -> [Series])
-> Maybe InvoiceCollection_method
-> [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])
-> (InvoiceCollection_method -> Series)
-> InvoiceCollection_method
-> [Series]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"collection_method" Key -> InvoiceCollection_method -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..=)) (Invoice -> Maybe InvoiceCollection_method
invoiceCollection_method Invoice
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
"created_at" Key -> JsonDateTime -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..=)) (Invoice -> Maybe JsonDateTime
invoiceCreated_at Invoice
obj) [Series] -> [[Series]] -> [[Series]]
forall a. a -> [a] -> [a]
: [Series]
-> ([CreditPayment] -> [Series])
-> Maybe [CreditPayment]
-> [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])
-> ([CreditPayment] -> Series) -> [CreditPayment] -> [Series]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"credit_payments" Key -> [CreditPayment] -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..=)) (Invoice -> Maybe [CreditPayment]
invoiceCredit_payments Invoice
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
"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..=)) (Invoice -> Maybe Text
invoiceCurrency Invoice
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
"customer_notes" Key -> Text -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..=)) (Invoice -> Maybe Text
invoiceCustomer_notes Invoice
obj) [Series] -> [[Series]] -> [[Series]]
forall a. a -> [a] -> [a]
: [Series] -> (Float -> [Series]) -> Maybe Float -> [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]) -> (Float -> Series) -> Float -> [Series]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"discount" Key -> Float -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..=)) (Invoice -> Maybe Float
invoiceDiscount Invoice
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
"due_at" Key -> JsonDateTime -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..=)) (Invoice -> Maybe JsonDateTime
invoiceDue_at Invoice
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
"dunning_campaign_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..=)) (Invoice -> Maybe Text
invoiceDunning_campaign_id Invoice
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
"dunning_events_sent" Key -> Int -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..=)) (Invoice -> Maybe Int
invoiceDunning_events_sent Invoice
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
"final_dunning_event" Key -> Bool -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..=)) (Invoice -> Maybe Bool
invoiceFinal_dunning_event Invoice
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
"has_more_line_items" Key -> Bool -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..=)) (Invoice -> Maybe Bool
invoiceHas_more_line_items Invoice
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
"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..=)) (Invoice -> Maybe Text
invoiceId Invoice
obj) [Series] -> [[Series]] -> [[Series]]
forall a. a -> [a] -> [a]
: [Series]
-> ([LineItem] -> [Series]) -> Maybe [LineItem] -> [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])
-> ([LineItem] -> Series) -> [LineItem] -> [Series]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"line_items" Key -> [LineItem] -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..=)) (Invoice -> Maybe [LineItem]
invoiceLine_items Invoice
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
"net_terms" Key -> Int -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..=)) (Invoice -> Maybe Int
invoiceNet_terms Invoice
obj) [Series] -> [[Series]] -> [[Series]]
forall a. a -> [a] -> [a]
: [Series]
-> (InvoiceNet_terms_type -> [Series])
-> Maybe InvoiceNet_terms_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])
-> (InvoiceNet_terms_type -> Series)
-> InvoiceNet_terms_type
-> [Series]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"net_terms_type" Key -> InvoiceNet_terms_type -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..=)) (Invoice -> Maybe InvoiceNet_terms_type
invoiceNet_terms_type Invoice
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
"number" Key -> Text -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..=)) (Invoice -> Maybe Text
invoiceNumber Invoice
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
"object" Key -> Text -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..=)) (Invoice -> Maybe Text
invoiceObject Invoice
obj) [Series] -> [[Series]] -> [[Series]]
forall a. a -> [a] -> [a]
: [Series]
-> (InvoiceOrigin -> [Series]) -> Maybe InvoiceOrigin -> [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])
-> (InvoiceOrigin -> Series) -> InvoiceOrigin -> [Series]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"origin" Key -> InvoiceOrigin -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..=)) (Invoice -> Maybe InvoiceOrigin
invoiceOrigin Invoice
obj) [Series] -> [[Series]] -> [[Series]]
forall a. a -> [a] -> [a]
: [Series] -> (Float -> [Series]) -> Maybe Float -> [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]) -> (Float -> Series) -> Float -> [Series]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"paid" Key -> Float -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..=)) (Invoice -> Maybe Float
invoicePaid Invoice
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
"po_number" Key -> Text -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..=)) (Invoice -> Maybe Text
invoicePo_number Invoice
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
"previous_invoice_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..=)) (Invoice -> Maybe Text
invoicePrevious_invoice_id Invoice
obj) [Series] -> [[Series]] -> [[Series]]
forall a. a -> [a] -> [a]
: [Series] -> (Float -> [Series]) -> Maybe Float -> [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]) -> (Float -> Series) -> Float -> [Series]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"refundable_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..=)) (Invoice -> Maybe Float
invoiceRefundable_amount Invoice
obj) [Series] -> [[Series]] -> [[Series]]
forall a. a -> [a] -> [a]
: [Series]
-> (ShippingAddress -> [Series])
-> Maybe ShippingAddress
-> [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])
-> (ShippingAddress -> Series) -> ShippingAddress -> [Series]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"shipping_address" Key -> ShippingAddress -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..=)) (Invoice -> Maybe ShippingAddress
invoiceShipping_address Invoice
obj) [Series] -> [[Series]] -> [[Series]]
forall a. a -> [a] -> [a]
: [Series]
-> (InvoiceState -> [Series]) -> Maybe InvoiceState -> [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])
-> (InvoiceState -> Series) -> InvoiceState -> [Series]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"state" Key -> InvoiceState -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..=)) (Invoice -> Maybe InvoiceState
invoiceState Invoice
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
"subscription_ids" Key -> [Text] -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..=)) (Invoice -> Maybe [Text]
invoiceSubscription_ids Invoice
obj) [Series] -> [[Series]] -> [[Series]]
forall a. a -> [a] -> [a]
: [Series] -> (Float -> [Series]) -> Maybe Float -> [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]) -> (Float -> Series) -> Float -> [Series]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"subtotal" Key -> Float -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..=)) (Invoice -> Maybe Float
invoiceSubtotal Invoice
obj) [Series] -> [[Series]] -> [[Series]]
forall a. a -> [a] -> [a]
: [Series] -> (Float -> [Series]) -> Maybe Float -> [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]) -> (Float -> Series) -> Float -> [Series]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"tax" Key -> Float -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..=)) (Invoice -> Maybe Float
invoiceTax Invoice
obj) [Series] -> [[Series]] -> [[Series]]
forall a. a -> [a] -> [a]
: [Series] -> (TaxInfo -> [Series]) -> Maybe TaxInfo -> [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]) -> (TaxInfo -> Series) -> TaxInfo -> [Series]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"tax_info" Key -> TaxInfo -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..=)) (Invoice -> Maybe TaxInfo
invoiceTax_info Invoice
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
"terms_and_conditions" Key -> Text -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..=)) (Invoice -> Maybe Text
invoiceTerms_and_conditions Invoice
obj) [Series] -> [[Series]] -> [[Series]]
forall a. a -> [a] -> [a]
: [Series] -> (Float -> [Series]) -> Maybe Float -> [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]) -> (Float -> Series) -> Float -> [Series]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"total" Key -> Float -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..=)) (Invoice -> Maybe Float
invoiceTotal Invoice
obj) [Series] -> [[Series]] -> [[Series]]
forall a. a -> [a] -> [a]
: [Series]
-> ([Transaction] -> [Series]) -> Maybe [Transaction] -> [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])
-> ([Transaction] -> Series) -> [Transaction] -> [Series]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"transactions" Key -> [Transaction] -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..=)) (Invoice -> Maybe [Transaction]
invoiceTransactions Invoice
obj) [Series] -> [[Series]] -> [[Series]]
forall a. a -> [a] -> [a]
: [Series]
-> (InvoiceType -> [Series]) -> Maybe InvoiceType -> [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])
-> (InvoiceType -> Series) -> InvoiceType -> [Series]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"type" Key -> InvoiceType -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..=)) (Invoice -> Maybe InvoiceType
invoiceType Invoice
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
"updated_at" Key -> JsonDateTime -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..=)) (Invoice -> Maybe JsonDateTime
invoiceUpdated_at Invoice
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
"used_tax_service" Key -> Bool -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..=)) (Invoice -> Maybe Bool
invoiceUsed_tax_service Invoice
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
"uuid" Key -> Text -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..=)) (Invoice -> Maybe Text
invoiceUuid Invoice
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
"vat_number" Key -> Text -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..=)) (Invoice -> Maybe Text
invoiceVat_number Invoice
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
"vat_reverse_charge_notes" Key -> Text -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..=)) (Invoice -> Maybe Text
invoiceVat_reverse_charge_notes Invoice
obj) [Series] -> [[Series]] -> [[Series]]
forall a. a -> [a] -> [a]
: [[Series]]
forall a. Monoid a => a
GHC.Base.mempty)))
instance Data.Aeson.Types.FromJSON.FromJSON Invoice where
    parseJSON :: Value -> Parser Invoice
parseJSON = String -> (Object -> Parser Invoice) -> Value -> Parser Invoice
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.Aeson.Types.FromJSON.withObject String
"Invoice" (\Object
obj -> (((((((((((((((((((((((((((((((((((((((((((Maybe AccountMini
 -> Maybe InvoiceAddress
 -> Maybe Float
 -> Maybe Text
 -> Maybe Text
 -> Maybe JsonDateTime
 -> Maybe InvoiceCollection_method
 -> Maybe JsonDateTime
 -> Maybe [CreditPayment]
 -> Maybe Text
 -> Maybe Text
 -> Maybe Float
 -> Maybe JsonDateTime
 -> Maybe Text
 -> Maybe Int
 -> Maybe Bool
 -> Maybe Bool
 -> Maybe Text
 -> Maybe [LineItem]
 -> Maybe Int
 -> Maybe InvoiceNet_terms_type
 -> Maybe Text
 -> Maybe Text
 -> Maybe InvoiceOrigin
 -> Maybe Float
 -> Maybe Text
 -> Maybe Text
 -> Maybe Float
 -> Maybe ShippingAddress
 -> Maybe InvoiceState
 -> Maybe [Text]
 -> Maybe Float
 -> Maybe Float
 -> Maybe TaxInfo
 -> Maybe Text
 -> Maybe Float
 -> Maybe [Transaction]
 -> Maybe InvoiceType
 -> Maybe JsonDateTime
 -> Maybe Bool
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Invoice)
-> Parser
     (Maybe AccountMini
      -> Maybe InvoiceAddress
      -> Maybe Float
      -> Maybe Text
      -> Maybe Text
      -> Maybe JsonDateTime
      -> Maybe InvoiceCollection_method
      -> Maybe JsonDateTime
      -> Maybe [CreditPayment]
      -> Maybe Text
      -> Maybe Text
      -> Maybe Float
      -> Maybe JsonDateTime
      -> Maybe Text
      -> Maybe Int
      -> Maybe Bool
      -> Maybe Bool
      -> Maybe Text
      -> Maybe [LineItem]
      -> Maybe Int
      -> Maybe InvoiceNet_terms_type
      -> Maybe Text
      -> Maybe Text
      -> Maybe InvoiceOrigin
      -> Maybe Float
      -> Maybe Text
      -> Maybe Text
      -> Maybe Float
      -> Maybe ShippingAddress
      -> Maybe InvoiceState
      -> Maybe [Text]
      -> Maybe Float
      -> Maybe Float
      -> Maybe TaxInfo
      -> Maybe Text
      -> Maybe Float
      -> Maybe [Transaction]
      -> Maybe InvoiceType
      -> Maybe JsonDateTime
      -> Maybe Bool
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Invoice)
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure Maybe AccountMini
-> Maybe InvoiceAddress
-> Maybe Float
-> Maybe Text
-> Maybe Text
-> Maybe JsonDateTime
-> Maybe InvoiceCollection_method
-> Maybe JsonDateTime
-> Maybe [CreditPayment]
-> Maybe Text
-> Maybe Text
-> Maybe Float
-> Maybe JsonDateTime
-> Maybe Text
-> Maybe Int
-> Maybe Bool
-> Maybe Bool
-> Maybe Text
-> Maybe [LineItem]
-> Maybe Int
-> Maybe InvoiceNet_terms_type
-> Maybe Text
-> Maybe Text
-> Maybe InvoiceOrigin
-> Maybe Float
-> Maybe Text
-> Maybe Text
-> Maybe Float
-> Maybe ShippingAddress
-> Maybe InvoiceState
-> Maybe [Text]
-> Maybe Float
-> Maybe Float
-> Maybe TaxInfo
-> Maybe Text
-> Maybe Float
-> Maybe [Transaction]
-> Maybe InvoiceType
-> Maybe JsonDateTime
-> Maybe Bool
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Invoice
Invoice Parser
  (Maybe AccountMini
   -> Maybe InvoiceAddress
   -> Maybe Float
   -> Maybe Text
   -> Maybe Text
   -> Maybe JsonDateTime
   -> Maybe InvoiceCollection_method
   -> Maybe JsonDateTime
   -> Maybe [CreditPayment]
   -> Maybe Text
   -> Maybe Text
   -> Maybe Float
   -> Maybe JsonDateTime
   -> Maybe Text
   -> Maybe Int
   -> Maybe Bool
   -> Maybe Bool
   -> Maybe Text
   -> Maybe [LineItem]
   -> Maybe Int
   -> Maybe InvoiceNet_terms_type
   -> Maybe Text
   -> Maybe Text
   -> Maybe InvoiceOrigin
   -> Maybe Float
   -> Maybe Text
   -> Maybe Text
   -> Maybe Float
   -> Maybe ShippingAddress
   -> Maybe InvoiceState
   -> Maybe [Text]
   -> Maybe Float
   -> Maybe Float
   -> Maybe TaxInfo
   -> Maybe Text
   -> Maybe Float
   -> Maybe [Transaction]
   -> Maybe InvoiceType
   -> Maybe JsonDateTime
   -> Maybe Bool
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Invoice)
-> Parser (Maybe AccountMini)
-> Parser
     (Maybe InvoiceAddress
      -> Maybe Float
      -> Maybe Text
      -> Maybe Text
      -> Maybe JsonDateTime
      -> Maybe InvoiceCollection_method
      -> Maybe JsonDateTime
      -> Maybe [CreditPayment]
      -> Maybe Text
      -> Maybe Text
      -> Maybe Float
      -> Maybe JsonDateTime
      -> Maybe Text
      -> Maybe Int
      -> Maybe Bool
      -> Maybe Bool
      -> Maybe Text
      -> Maybe [LineItem]
      -> Maybe Int
      -> Maybe InvoiceNet_terms_type
      -> Maybe Text
      -> Maybe Text
      -> Maybe InvoiceOrigin
      -> Maybe Float
      -> Maybe Text
      -> Maybe Text
      -> Maybe Float
      -> Maybe ShippingAddress
      -> Maybe InvoiceState
      -> Maybe [Text]
      -> Maybe Float
      -> Maybe Float
      -> Maybe TaxInfo
      -> Maybe Text
      -> Maybe Float
      -> Maybe [Transaction]
      -> Maybe InvoiceType
      -> Maybe JsonDateTime
      -> Maybe Bool
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Invoice)
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 AccountMini)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Key
"account")) Parser
  (Maybe InvoiceAddress
   -> Maybe Float
   -> Maybe Text
   -> Maybe Text
   -> Maybe JsonDateTime
   -> Maybe InvoiceCollection_method
   -> Maybe JsonDateTime
   -> Maybe [CreditPayment]
   -> Maybe Text
   -> Maybe Text
   -> Maybe Float
   -> Maybe JsonDateTime
   -> Maybe Text
   -> Maybe Int
   -> Maybe Bool
   -> Maybe Bool
   -> Maybe Text
   -> Maybe [LineItem]
   -> Maybe Int
   -> Maybe InvoiceNet_terms_type
   -> Maybe Text
   -> Maybe Text
   -> Maybe InvoiceOrigin
   -> Maybe Float
   -> Maybe Text
   -> Maybe Text
   -> Maybe Float
   -> Maybe ShippingAddress
   -> Maybe InvoiceState
   -> Maybe [Text]
   -> Maybe Float
   -> Maybe Float
   -> Maybe TaxInfo
   -> Maybe Text
   -> Maybe Float
   -> Maybe [Transaction]
   -> Maybe InvoiceType
   -> Maybe JsonDateTime
   -> Maybe Bool
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Invoice)
-> Parser (Maybe InvoiceAddress)
-> Parser
     (Maybe Float
      -> Maybe Text
      -> Maybe Text
      -> Maybe JsonDateTime
      -> Maybe InvoiceCollection_method
      -> Maybe JsonDateTime
      -> Maybe [CreditPayment]
      -> Maybe Text
      -> Maybe Text
      -> Maybe Float
      -> Maybe JsonDateTime
      -> Maybe Text
      -> Maybe Int
      -> Maybe Bool
      -> Maybe Bool
      -> Maybe Text
      -> Maybe [LineItem]
      -> Maybe Int
      -> Maybe InvoiceNet_terms_type
      -> Maybe Text
      -> Maybe Text
      -> Maybe InvoiceOrigin
      -> Maybe Float
      -> Maybe Text
      -> Maybe Text
      -> Maybe Float
      -> Maybe ShippingAddress
      -> Maybe InvoiceState
      -> Maybe [Text]
      -> Maybe Float
      -> Maybe Float
      -> Maybe TaxInfo
      -> Maybe Text
      -> Maybe Float
      -> Maybe [Transaction]
      -> Maybe InvoiceType
      -> Maybe JsonDateTime
      -> Maybe Bool
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Invoice)
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 InvoiceAddress)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Key
"address")) Parser
  (Maybe Float
   -> Maybe Text
   -> Maybe Text
   -> Maybe JsonDateTime
   -> Maybe InvoiceCollection_method
   -> Maybe JsonDateTime
   -> Maybe [CreditPayment]
   -> Maybe Text
   -> Maybe Text
   -> Maybe Float
   -> Maybe JsonDateTime
   -> Maybe Text
   -> Maybe Int
   -> Maybe Bool
   -> Maybe Bool
   -> Maybe Text
   -> Maybe [LineItem]
   -> Maybe Int
   -> Maybe InvoiceNet_terms_type
   -> Maybe Text
   -> Maybe Text
   -> Maybe InvoiceOrigin
   -> Maybe Float
   -> Maybe Text
   -> Maybe Text
   -> Maybe Float
   -> Maybe ShippingAddress
   -> Maybe InvoiceState
   -> Maybe [Text]
   -> Maybe Float
   -> Maybe Float
   -> Maybe TaxInfo
   -> Maybe Text
   -> Maybe Float
   -> Maybe [Transaction]
   -> Maybe InvoiceType
   -> Maybe JsonDateTime
   -> Maybe Bool
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Invoice)
-> Parser (Maybe Float)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe JsonDateTime
      -> Maybe InvoiceCollection_method
      -> Maybe JsonDateTime
      -> Maybe [CreditPayment]
      -> Maybe Text
      -> Maybe Text
      -> Maybe Float
      -> Maybe JsonDateTime
      -> Maybe Text
      -> Maybe Int
      -> Maybe Bool
      -> Maybe Bool
      -> Maybe Text
      -> Maybe [LineItem]
      -> Maybe Int
      -> Maybe InvoiceNet_terms_type
      -> Maybe Text
      -> Maybe Text
      -> Maybe InvoiceOrigin
      -> Maybe Float
      -> Maybe Text
      -> Maybe Text
      -> Maybe Float
      -> Maybe ShippingAddress
      -> Maybe InvoiceState
      -> Maybe [Text]
      -> Maybe Float
      -> Maybe Float
      -> Maybe TaxInfo
      -> Maybe Text
      -> Maybe Float
      -> Maybe [Transaction]
      -> Maybe InvoiceType
      -> Maybe JsonDateTime
      -> Maybe Bool
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Invoice)
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 Float)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Key
"balance")) Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe JsonDateTime
   -> Maybe InvoiceCollection_method
   -> Maybe JsonDateTime
   -> Maybe [CreditPayment]
   -> Maybe Text
   -> Maybe Text
   -> Maybe Float
   -> Maybe JsonDateTime
   -> Maybe Text
   -> Maybe Int
   -> Maybe Bool
   -> Maybe Bool
   -> Maybe Text
   -> Maybe [LineItem]
   -> Maybe Int
   -> Maybe InvoiceNet_terms_type
   -> Maybe Text
   -> Maybe Text
   -> Maybe InvoiceOrigin
   -> Maybe Float
   -> Maybe Text
   -> Maybe Text
   -> Maybe Float
   -> Maybe ShippingAddress
   -> Maybe InvoiceState
   -> Maybe [Text]
   -> Maybe Float
   -> Maybe Float
   -> Maybe TaxInfo
   -> Maybe Text
   -> Maybe Float
   -> Maybe [Transaction]
   -> Maybe InvoiceType
   -> Maybe JsonDateTime
   -> Maybe Bool
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Invoice)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe JsonDateTime
      -> Maybe InvoiceCollection_method
      -> Maybe JsonDateTime
      -> Maybe [CreditPayment]
      -> Maybe Text
      -> Maybe Text
      -> Maybe Float
      -> Maybe JsonDateTime
      -> Maybe Text
      -> Maybe Int
      -> Maybe Bool
      -> Maybe Bool
      -> Maybe Text
      -> Maybe [LineItem]
      -> Maybe Int
      -> Maybe InvoiceNet_terms_type
      -> Maybe Text
      -> Maybe Text
      -> Maybe InvoiceOrigin
      -> Maybe Float
      -> Maybe Text
      -> Maybe Text
      -> Maybe Float
      -> Maybe ShippingAddress
      -> Maybe InvoiceState
      -> Maybe [Text]
      -> Maybe Float
      -> Maybe Float
      -> Maybe TaxInfo
      -> Maybe Text
      -> Maybe Float
      -> Maybe [Transaction]
      -> Maybe InvoiceType
      -> Maybe JsonDateTime
      -> Maybe Bool
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Invoice)
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
"billing_info_id")) Parser
  (Maybe Text
   -> Maybe JsonDateTime
   -> Maybe InvoiceCollection_method
   -> Maybe JsonDateTime
   -> Maybe [CreditPayment]
   -> Maybe Text
   -> Maybe Text
   -> Maybe Float
   -> Maybe JsonDateTime
   -> Maybe Text
   -> Maybe Int
   -> Maybe Bool
   -> Maybe Bool
   -> Maybe Text
   -> Maybe [LineItem]
   -> Maybe Int
   -> Maybe InvoiceNet_terms_type
   -> Maybe Text
   -> Maybe Text
   -> Maybe InvoiceOrigin
   -> Maybe Float
   -> Maybe Text
   -> Maybe Text
   -> Maybe Float
   -> Maybe ShippingAddress
   -> Maybe InvoiceState
   -> Maybe [Text]
   -> Maybe Float
   -> Maybe Float
   -> Maybe TaxInfo
   -> Maybe Text
   -> Maybe Float
   -> Maybe [Transaction]
   -> Maybe InvoiceType
   -> Maybe JsonDateTime
   -> Maybe Bool
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Invoice)
-> Parser (Maybe Text)
-> Parser
     (Maybe JsonDateTime
      -> Maybe InvoiceCollection_method
      -> Maybe JsonDateTime
      -> Maybe [CreditPayment]
      -> Maybe Text
      -> Maybe Text
      -> Maybe Float
      -> Maybe JsonDateTime
      -> Maybe Text
      -> Maybe Int
      -> Maybe Bool
      -> Maybe Bool
      -> Maybe Text
      -> Maybe [LineItem]
      -> Maybe Int
      -> Maybe InvoiceNet_terms_type
      -> Maybe Text
      -> Maybe Text
      -> Maybe InvoiceOrigin
      -> Maybe Float
      -> Maybe Text
      -> Maybe Text
      -> Maybe Float
      -> Maybe ShippingAddress
      -> Maybe InvoiceState
      -> Maybe [Text]
      -> Maybe Float
      -> Maybe Float
      -> Maybe TaxInfo
      -> Maybe Text
      -> Maybe Float
      -> Maybe [Transaction]
      -> Maybe InvoiceType
      -> Maybe JsonDateTime
      -> Maybe Bool
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Invoice)
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
"business_entity_id")) Parser
  (Maybe JsonDateTime
   -> Maybe InvoiceCollection_method
   -> Maybe JsonDateTime
   -> Maybe [CreditPayment]
   -> Maybe Text
   -> Maybe Text
   -> Maybe Float
   -> Maybe JsonDateTime
   -> Maybe Text
   -> Maybe Int
   -> Maybe Bool
   -> Maybe Bool
   -> Maybe Text
   -> Maybe [LineItem]
   -> Maybe Int
   -> Maybe InvoiceNet_terms_type
   -> Maybe Text
   -> Maybe Text
   -> Maybe InvoiceOrigin
   -> Maybe Float
   -> Maybe Text
   -> Maybe Text
   -> Maybe Float
   -> Maybe ShippingAddress
   -> Maybe InvoiceState
   -> Maybe [Text]
   -> Maybe Float
   -> Maybe Float
   -> Maybe TaxInfo
   -> Maybe Text
   -> Maybe Float
   -> Maybe [Transaction]
   -> Maybe InvoiceType
   -> Maybe JsonDateTime
   -> Maybe Bool
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Invoice)
-> Parser (Maybe JsonDateTime)
-> Parser
     (Maybe InvoiceCollection_method
      -> Maybe JsonDateTime
      -> Maybe [CreditPayment]
      -> Maybe Text
      -> Maybe Text
      -> Maybe Float
      -> Maybe JsonDateTime
      -> Maybe Text
      -> Maybe Int
      -> Maybe Bool
      -> Maybe Bool
      -> Maybe Text
      -> Maybe [LineItem]
      -> Maybe Int
      -> Maybe InvoiceNet_terms_type
      -> Maybe Text
      -> Maybe Text
      -> Maybe InvoiceOrigin
      -> Maybe Float
      -> Maybe Text
      -> Maybe Text
      -> Maybe Float
      -> Maybe ShippingAddress
      -> Maybe InvoiceState
      -> Maybe [Text]
      -> Maybe Float
      -> Maybe Float
      -> Maybe TaxInfo
      -> Maybe Text
      -> Maybe Float
      -> Maybe [Transaction]
      -> Maybe InvoiceType
      -> Maybe JsonDateTime
      -> Maybe Bool
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Invoice)
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
"closed_at")) Parser
  (Maybe InvoiceCollection_method
   -> Maybe JsonDateTime
   -> Maybe [CreditPayment]
   -> Maybe Text
   -> Maybe Text
   -> Maybe Float
   -> Maybe JsonDateTime
   -> Maybe Text
   -> Maybe Int
   -> Maybe Bool
   -> Maybe Bool
   -> Maybe Text
   -> Maybe [LineItem]
   -> Maybe Int
   -> Maybe InvoiceNet_terms_type
   -> Maybe Text
   -> Maybe Text
   -> Maybe InvoiceOrigin
   -> Maybe Float
   -> Maybe Text
   -> Maybe Text
   -> Maybe Float
   -> Maybe ShippingAddress
   -> Maybe InvoiceState
   -> Maybe [Text]
   -> Maybe Float
   -> Maybe Float
   -> Maybe TaxInfo
   -> Maybe Text
   -> Maybe Float
   -> Maybe [Transaction]
   -> Maybe InvoiceType
   -> Maybe JsonDateTime
   -> Maybe Bool
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Invoice)
-> Parser (Maybe InvoiceCollection_method)
-> Parser
     (Maybe JsonDateTime
      -> Maybe [CreditPayment]
      -> Maybe Text
      -> Maybe Text
      -> Maybe Float
      -> Maybe JsonDateTime
      -> Maybe Text
      -> Maybe Int
      -> Maybe Bool
      -> Maybe Bool
      -> Maybe Text
      -> Maybe [LineItem]
      -> Maybe Int
      -> Maybe InvoiceNet_terms_type
      -> Maybe Text
      -> Maybe Text
      -> Maybe InvoiceOrigin
      -> Maybe Float
      -> Maybe Text
      -> Maybe Text
      -> Maybe Float
      -> Maybe ShippingAddress
      -> Maybe InvoiceState
      -> Maybe [Text]
      -> Maybe Float
      -> Maybe Float
      -> Maybe TaxInfo
      -> Maybe Text
      -> Maybe Float
      -> Maybe [Transaction]
      -> Maybe InvoiceType
      -> Maybe JsonDateTime
      -> Maybe Bool
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Invoice)
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 InvoiceCollection_method)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Key
"collection_method")) Parser
  (Maybe JsonDateTime
   -> Maybe [CreditPayment]
   -> Maybe Text
   -> Maybe Text
   -> Maybe Float
   -> Maybe JsonDateTime
   -> Maybe Text
   -> Maybe Int
   -> Maybe Bool
   -> Maybe Bool
   -> Maybe Text
   -> Maybe [LineItem]
   -> Maybe Int
   -> Maybe InvoiceNet_terms_type
   -> Maybe Text
   -> Maybe Text
   -> Maybe InvoiceOrigin
   -> Maybe Float
   -> Maybe Text
   -> Maybe Text
   -> Maybe Float
   -> Maybe ShippingAddress
   -> Maybe InvoiceState
   -> Maybe [Text]
   -> Maybe Float
   -> Maybe Float
   -> Maybe TaxInfo
   -> Maybe Text
   -> Maybe Float
   -> Maybe [Transaction]
   -> Maybe InvoiceType
   -> Maybe JsonDateTime
   -> Maybe Bool
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Invoice)
-> Parser (Maybe JsonDateTime)
-> Parser
     (Maybe [CreditPayment]
      -> Maybe Text
      -> Maybe Text
      -> Maybe Float
      -> Maybe JsonDateTime
      -> Maybe Text
      -> Maybe Int
      -> Maybe Bool
      -> Maybe Bool
      -> Maybe Text
      -> Maybe [LineItem]
      -> Maybe Int
      -> Maybe InvoiceNet_terms_type
      -> Maybe Text
      -> Maybe Text
      -> Maybe InvoiceOrigin
      -> Maybe Float
      -> Maybe Text
      -> Maybe Text
      -> Maybe Float
      -> Maybe ShippingAddress
      -> Maybe InvoiceState
      -> Maybe [Text]
      -> Maybe Float
      -> Maybe Float
      -> Maybe TaxInfo
      -> Maybe Text
      -> Maybe Float
      -> Maybe [Transaction]
      -> Maybe InvoiceType
      -> Maybe JsonDateTime
      -> Maybe Bool
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Invoice)
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
"created_at")) Parser
  (Maybe [CreditPayment]
   -> Maybe Text
   -> Maybe Text
   -> Maybe Float
   -> Maybe JsonDateTime
   -> Maybe Text
   -> Maybe Int
   -> Maybe Bool
   -> Maybe Bool
   -> Maybe Text
   -> Maybe [LineItem]
   -> Maybe Int
   -> Maybe InvoiceNet_terms_type
   -> Maybe Text
   -> Maybe Text
   -> Maybe InvoiceOrigin
   -> Maybe Float
   -> Maybe Text
   -> Maybe Text
   -> Maybe Float
   -> Maybe ShippingAddress
   -> Maybe InvoiceState
   -> Maybe [Text]
   -> Maybe Float
   -> Maybe Float
   -> Maybe TaxInfo
   -> Maybe Text
   -> Maybe Float
   -> Maybe [Transaction]
   -> Maybe InvoiceType
   -> Maybe JsonDateTime
   -> Maybe Bool
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Invoice)
-> Parser (Maybe [CreditPayment])
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Float
      -> Maybe JsonDateTime
      -> Maybe Text
      -> Maybe Int
      -> Maybe Bool
      -> Maybe Bool
      -> Maybe Text
      -> Maybe [LineItem]
      -> Maybe Int
      -> Maybe InvoiceNet_terms_type
      -> Maybe Text
      -> Maybe Text
      -> Maybe InvoiceOrigin
      -> Maybe Float
      -> Maybe Text
      -> Maybe Text
      -> Maybe Float
      -> Maybe ShippingAddress
      -> Maybe InvoiceState
      -> Maybe [Text]
      -> Maybe Float
      -> Maybe Float
      -> Maybe TaxInfo
      -> Maybe Text
      -> Maybe Float
      -> Maybe [Transaction]
      -> Maybe InvoiceType
      -> Maybe JsonDateTime
      -> Maybe Bool
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Invoice)
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 [CreditPayment])
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Key
"credit_payments")) Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Float
   -> Maybe JsonDateTime
   -> Maybe Text
   -> Maybe Int
   -> Maybe Bool
   -> Maybe Bool
   -> Maybe Text
   -> Maybe [LineItem]
   -> Maybe Int
   -> Maybe InvoiceNet_terms_type
   -> Maybe Text
   -> Maybe Text
   -> Maybe InvoiceOrigin
   -> Maybe Float
   -> Maybe Text
   -> Maybe Text
   -> Maybe Float
   -> Maybe ShippingAddress
   -> Maybe InvoiceState
   -> Maybe [Text]
   -> Maybe Float
   -> Maybe Float
   -> Maybe TaxInfo
   -> Maybe Text
   -> Maybe Float
   -> Maybe [Transaction]
   -> Maybe InvoiceType
   -> Maybe JsonDateTime
   -> Maybe Bool
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Invoice)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Float
      -> Maybe JsonDateTime
      -> Maybe Text
      -> Maybe Int
      -> Maybe Bool
      -> Maybe Bool
      -> Maybe Text
      -> Maybe [LineItem]
      -> Maybe Int
      -> Maybe InvoiceNet_terms_type
      -> Maybe Text
      -> Maybe Text
      -> Maybe InvoiceOrigin
      -> Maybe Float
      -> Maybe Text
      -> Maybe Text
      -> Maybe Float
      -> Maybe ShippingAddress
      -> Maybe InvoiceState
      -> Maybe [Text]
      -> Maybe Float
      -> Maybe Float
      -> Maybe TaxInfo
      -> Maybe Text
      -> Maybe Float
      -> Maybe [Transaction]
      -> Maybe InvoiceType
      -> Maybe JsonDateTime
      -> Maybe Bool
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Invoice)
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
"currency")) Parser
  (Maybe Text
   -> Maybe Float
   -> Maybe JsonDateTime
   -> Maybe Text
   -> Maybe Int
   -> Maybe Bool
   -> Maybe Bool
   -> Maybe Text
   -> Maybe [LineItem]
   -> Maybe Int
   -> Maybe InvoiceNet_terms_type
   -> Maybe Text
   -> Maybe Text
   -> Maybe InvoiceOrigin
   -> Maybe Float
   -> Maybe Text
   -> Maybe Text
   -> Maybe Float
   -> Maybe ShippingAddress
   -> Maybe InvoiceState
   -> Maybe [Text]
   -> Maybe Float
   -> Maybe Float
   -> Maybe TaxInfo
   -> Maybe Text
   -> Maybe Float
   -> Maybe [Transaction]
   -> Maybe InvoiceType
   -> Maybe JsonDateTime
   -> Maybe Bool
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Invoice)
-> Parser (Maybe Text)
-> Parser
     (Maybe Float
      -> Maybe JsonDateTime
      -> Maybe Text
      -> Maybe Int
      -> Maybe Bool
      -> Maybe Bool
      -> Maybe Text
      -> Maybe [LineItem]
      -> Maybe Int
      -> Maybe InvoiceNet_terms_type
      -> Maybe Text
      -> Maybe Text
      -> Maybe InvoiceOrigin
      -> Maybe Float
      -> Maybe Text
      -> Maybe Text
      -> Maybe Float
      -> Maybe ShippingAddress
      -> Maybe InvoiceState
      -> Maybe [Text]
      -> Maybe Float
      -> Maybe Float
      -> Maybe TaxInfo
      -> Maybe Text
      -> Maybe Float
      -> Maybe [Transaction]
      -> Maybe InvoiceType
      -> Maybe JsonDateTime
      -> Maybe Bool
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Invoice)
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
"customer_notes")) Parser
  (Maybe Float
   -> Maybe JsonDateTime
   -> Maybe Text
   -> Maybe Int
   -> Maybe Bool
   -> Maybe Bool
   -> Maybe Text
   -> Maybe [LineItem]
   -> Maybe Int
   -> Maybe InvoiceNet_terms_type
   -> Maybe Text
   -> Maybe Text
   -> Maybe InvoiceOrigin
   -> Maybe Float
   -> Maybe Text
   -> Maybe Text
   -> Maybe Float
   -> Maybe ShippingAddress
   -> Maybe InvoiceState
   -> Maybe [Text]
   -> Maybe Float
   -> Maybe Float
   -> Maybe TaxInfo
   -> Maybe Text
   -> Maybe Float
   -> Maybe [Transaction]
   -> Maybe InvoiceType
   -> Maybe JsonDateTime
   -> Maybe Bool
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Invoice)
-> Parser (Maybe Float)
-> Parser
     (Maybe JsonDateTime
      -> Maybe Text
      -> Maybe Int
      -> Maybe Bool
      -> Maybe Bool
      -> Maybe Text
      -> Maybe [LineItem]
      -> Maybe Int
      -> Maybe InvoiceNet_terms_type
      -> Maybe Text
      -> Maybe Text
      -> Maybe InvoiceOrigin
      -> Maybe Float
      -> Maybe Text
      -> Maybe Text
      -> Maybe Float
      -> Maybe ShippingAddress
      -> Maybe InvoiceState
      -> Maybe [Text]
      -> Maybe Float
      -> Maybe Float
      -> Maybe TaxInfo
      -> Maybe Text
      -> Maybe Float
      -> Maybe [Transaction]
      -> Maybe InvoiceType
      -> Maybe JsonDateTime
      -> Maybe Bool
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Invoice)
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 Float)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Key
"discount")) Parser
  (Maybe JsonDateTime
   -> Maybe Text
   -> Maybe Int
   -> Maybe Bool
   -> Maybe Bool
   -> Maybe Text
   -> Maybe [LineItem]
   -> Maybe Int
   -> Maybe InvoiceNet_terms_type
   -> Maybe Text
   -> Maybe Text
   -> Maybe InvoiceOrigin
   -> Maybe Float
   -> Maybe Text
   -> Maybe Text
   -> Maybe Float
   -> Maybe ShippingAddress
   -> Maybe InvoiceState
   -> Maybe [Text]
   -> Maybe Float
   -> Maybe Float
   -> Maybe TaxInfo
   -> Maybe Text
   -> Maybe Float
   -> Maybe [Transaction]
   -> Maybe InvoiceType
   -> Maybe JsonDateTime
   -> Maybe Bool
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Invoice)
-> Parser (Maybe JsonDateTime)
-> Parser
     (Maybe Text
      -> Maybe Int
      -> Maybe Bool
      -> Maybe Bool
      -> Maybe Text
      -> Maybe [LineItem]
      -> Maybe Int
      -> Maybe InvoiceNet_terms_type
      -> Maybe Text
      -> Maybe Text
      -> Maybe InvoiceOrigin
      -> Maybe Float
      -> Maybe Text
      -> Maybe Text
      -> Maybe Float
      -> Maybe ShippingAddress
      -> Maybe InvoiceState
      -> Maybe [Text]
      -> Maybe Float
      -> Maybe Float
      -> Maybe TaxInfo
      -> Maybe Text
      -> Maybe Float
      -> Maybe [Transaction]
      -> Maybe InvoiceType
      -> Maybe JsonDateTime
      -> Maybe Bool
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Invoice)
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
"due_at")) Parser
  (Maybe Text
   -> Maybe Int
   -> Maybe Bool
   -> Maybe Bool
   -> Maybe Text
   -> Maybe [LineItem]
   -> Maybe Int
   -> Maybe InvoiceNet_terms_type
   -> Maybe Text
   -> Maybe Text
   -> Maybe InvoiceOrigin
   -> Maybe Float
   -> Maybe Text
   -> Maybe Text
   -> Maybe Float
   -> Maybe ShippingAddress
   -> Maybe InvoiceState
   -> Maybe [Text]
   -> Maybe Float
   -> Maybe Float
   -> Maybe TaxInfo
   -> Maybe Text
   -> Maybe Float
   -> Maybe [Transaction]
   -> Maybe InvoiceType
   -> Maybe JsonDateTime
   -> Maybe Bool
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Invoice)
-> Parser (Maybe Text)
-> Parser
     (Maybe Int
      -> Maybe Bool
      -> Maybe Bool
      -> Maybe Text
      -> Maybe [LineItem]
      -> Maybe Int
      -> Maybe InvoiceNet_terms_type
      -> Maybe Text
      -> Maybe Text
      -> Maybe InvoiceOrigin
      -> Maybe Float
      -> Maybe Text
      -> Maybe Text
      -> Maybe Float
      -> Maybe ShippingAddress
      -> Maybe InvoiceState
      -> Maybe [Text]
      -> Maybe Float
      -> Maybe Float
      -> Maybe TaxInfo
      -> Maybe Text
      -> Maybe Float
      -> Maybe [Transaction]
      -> Maybe InvoiceType
      -> Maybe JsonDateTime
      -> Maybe Bool
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Invoice)
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
"dunning_campaign_id")) Parser
  (Maybe Int
   -> Maybe Bool
   -> Maybe Bool
   -> Maybe Text
   -> Maybe [LineItem]
   -> Maybe Int
   -> Maybe InvoiceNet_terms_type
   -> Maybe Text
   -> Maybe Text
   -> Maybe InvoiceOrigin
   -> Maybe Float
   -> Maybe Text
   -> Maybe Text
   -> Maybe Float
   -> Maybe ShippingAddress
   -> Maybe InvoiceState
   -> Maybe [Text]
   -> Maybe Float
   -> Maybe Float
   -> Maybe TaxInfo
   -> Maybe Text
   -> Maybe Float
   -> Maybe [Transaction]
   -> Maybe InvoiceType
   -> Maybe JsonDateTime
   -> Maybe Bool
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Invoice)
-> Parser (Maybe Int)
-> Parser
     (Maybe Bool
      -> Maybe Bool
      -> Maybe Text
      -> Maybe [LineItem]
      -> Maybe Int
      -> Maybe InvoiceNet_terms_type
      -> Maybe Text
      -> Maybe Text
      -> Maybe InvoiceOrigin
      -> Maybe Float
      -> Maybe Text
      -> Maybe Text
      -> Maybe Float
      -> Maybe ShippingAddress
      -> Maybe InvoiceState
      -> Maybe [Text]
      -> Maybe Float
      -> Maybe Float
      -> Maybe TaxInfo
      -> Maybe Text
      -> Maybe Float
      -> Maybe [Transaction]
      -> Maybe InvoiceType
      -> Maybe JsonDateTime
      -> Maybe Bool
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Invoice)
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
"dunning_events_sent")) Parser
  (Maybe Bool
   -> Maybe Bool
   -> Maybe Text
   -> Maybe [LineItem]
   -> Maybe Int
   -> Maybe InvoiceNet_terms_type
   -> Maybe Text
   -> Maybe Text
   -> Maybe InvoiceOrigin
   -> Maybe Float
   -> Maybe Text
   -> Maybe Text
   -> Maybe Float
   -> Maybe ShippingAddress
   -> Maybe InvoiceState
   -> Maybe [Text]
   -> Maybe Float
   -> Maybe Float
   -> Maybe TaxInfo
   -> Maybe Text
   -> Maybe Float
   -> Maybe [Transaction]
   -> Maybe InvoiceType
   -> Maybe JsonDateTime
   -> Maybe Bool
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Invoice)
-> Parser (Maybe Bool)
-> Parser
     (Maybe Bool
      -> Maybe Text
      -> Maybe [LineItem]
      -> Maybe Int
      -> Maybe InvoiceNet_terms_type
      -> Maybe Text
      -> Maybe Text
      -> Maybe InvoiceOrigin
      -> Maybe Float
      -> Maybe Text
      -> Maybe Text
      -> Maybe Float
      -> Maybe ShippingAddress
      -> Maybe InvoiceState
      -> Maybe [Text]
      -> Maybe Float
      -> Maybe Float
      -> Maybe TaxInfo
      -> Maybe Text
      -> Maybe Float
      -> Maybe [Transaction]
      -> Maybe InvoiceType
      -> Maybe JsonDateTime
      -> Maybe Bool
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Invoice)
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
"final_dunning_event")) Parser
  (Maybe Bool
   -> Maybe Text
   -> Maybe [LineItem]
   -> Maybe Int
   -> Maybe InvoiceNet_terms_type
   -> Maybe Text
   -> Maybe Text
   -> Maybe InvoiceOrigin
   -> Maybe Float
   -> Maybe Text
   -> Maybe Text
   -> Maybe Float
   -> Maybe ShippingAddress
   -> Maybe InvoiceState
   -> Maybe [Text]
   -> Maybe Float
   -> Maybe Float
   -> Maybe TaxInfo
   -> Maybe Text
   -> Maybe Float
   -> Maybe [Transaction]
   -> Maybe InvoiceType
   -> Maybe JsonDateTime
   -> Maybe Bool
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Invoice)
-> Parser (Maybe Bool)
-> Parser
     (Maybe Text
      -> Maybe [LineItem]
      -> Maybe Int
      -> Maybe InvoiceNet_terms_type
      -> Maybe Text
      -> Maybe Text
      -> Maybe InvoiceOrigin
      -> Maybe Float
      -> Maybe Text
      -> Maybe Text
      -> Maybe Float
      -> Maybe ShippingAddress
      -> Maybe InvoiceState
      -> Maybe [Text]
      -> Maybe Float
      -> Maybe Float
      -> Maybe TaxInfo
      -> Maybe Text
      -> Maybe Float
      -> Maybe [Transaction]
      -> Maybe InvoiceType
      -> Maybe JsonDateTime
      -> Maybe Bool
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Invoice)
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
"has_more_line_items")) Parser
  (Maybe Text
   -> Maybe [LineItem]
   -> Maybe Int
   -> Maybe InvoiceNet_terms_type
   -> Maybe Text
   -> Maybe Text
   -> Maybe InvoiceOrigin
   -> Maybe Float
   -> Maybe Text
   -> Maybe Text
   -> Maybe Float
   -> Maybe ShippingAddress
   -> Maybe InvoiceState
   -> Maybe [Text]
   -> Maybe Float
   -> Maybe Float
   -> Maybe TaxInfo
   -> Maybe Text
   -> Maybe Float
   -> Maybe [Transaction]
   -> Maybe InvoiceType
   -> Maybe JsonDateTime
   -> Maybe Bool
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Invoice)
-> Parser (Maybe Text)
-> Parser
     (Maybe [LineItem]
      -> Maybe Int
      -> Maybe InvoiceNet_terms_type
      -> Maybe Text
      -> Maybe Text
      -> Maybe InvoiceOrigin
      -> Maybe Float
      -> Maybe Text
      -> Maybe Text
      -> Maybe Float
      -> Maybe ShippingAddress
      -> Maybe InvoiceState
      -> Maybe [Text]
      -> Maybe Float
      -> Maybe Float
      -> Maybe TaxInfo
      -> Maybe Text
      -> Maybe Float
      -> Maybe [Transaction]
      -> Maybe InvoiceType
      -> Maybe JsonDateTime
      -> Maybe Bool
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Invoice)
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
"id")) Parser
  (Maybe [LineItem]
   -> Maybe Int
   -> Maybe InvoiceNet_terms_type
   -> Maybe Text
   -> Maybe Text
   -> Maybe InvoiceOrigin
   -> Maybe Float
   -> Maybe Text
   -> Maybe Text
   -> Maybe Float
   -> Maybe ShippingAddress
   -> Maybe InvoiceState
   -> Maybe [Text]
   -> Maybe Float
   -> Maybe Float
   -> Maybe TaxInfo
   -> Maybe Text
   -> Maybe Float
   -> Maybe [Transaction]
   -> Maybe InvoiceType
   -> Maybe JsonDateTime
   -> Maybe Bool
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Invoice)
-> Parser (Maybe [LineItem])
-> Parser
     (Maybe Int
      -> Maybe InvoiceNet_terms_type
      -> Maybe Text
      -> Maybe Text
      -> Maybe InvoiceOrigin
      -> Maybe Float
      -> Maybe Text
      -> Maybe Text
      -> Maybe Float
      -> Maybe ShippingAddress
      -> Maybe InvoiceState
      -> Maybe [Text]
      -> Maybe Float
      -> Maybe Float
      -> Maybe TaxInfo
      -> Maybe Text
      -> Maybe Float
      -> Maybe [Transaction]
      -> Maybe InvoiceType
      -> Maybe JsonDateTime
      -> Maybe Bool
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Invoice)
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 [LineItem])
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Key
"line_items")) Parser
  (Maybe Int
   -> Maybe InvoiceNet_terms_type
   -> Maybe Text
   -> Maybe Text
   -> Maybe InvoiceOrigin
   -> Maybe Float
   -> Maybe Text
   -> Maybe Text
   -> Maybe Float
   -> Maybe ShippingAddress
   -> Maybe InvoiceState
   -> Maybe [Text]
   -> Maybe Float
   -> Maybe Float
   -> Maybe TaxInfo
   -> Maybe Text
   -> Maybe Float
   -> Maybe [Transaction]
   -> Maybe InvoiceType
   -> Maybe JsonDateTime
   -> Maybe Bool
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Invoice)
-> Parser (Maybe Int)
-> Parser
     (Maybe InvoiceNet_terms_type
      -> Maybe Text
      -> Maybe Text
      -> Maybe InvoiceOrigin
      -> Maybe Float
      -> Maybe Text
      -> Maybe Text
      -> Maybe Float
      -> Maybe ShippingAddress
      -> Maybe InvoiceState
      -> Maybe [Text]
      -> Maybe Float
      -> Maybe Float
      -> Maybe TaxInfo
      -> Maybe Text
      -> Maybe Float
      -> Maybe [Transaction]
      -> Maybe InvoiceType
      -> Maybe JsonDateTime
      -> Maybe Bool
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Invoice)
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
"net_terms")) Parser
  (Maybe InvoiceNet_terms_type
   -> Maybe Text
   -> Maybe Text
   -> Maybe InvoiceOrigin
   -> Maybe Float
   -> Maybe Text
   -> Maybe Text
   -> Maybe Float
   -> Maybe ShippingAddress
   -> Maybe InvoiceState
   -> Maybe [Text]
   -> Maybe Float
   -> Maybe Float
   -> Maybe TaxInfo
   -> Maybe Text
   -> Maybe Float
   -> Maybe [Transaction]
   -> Maybe InvoiceType
   -> Maybe JsonDateTime
   -> Maybe Bool
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Invoice)
-> Parser (Maybe InvoiceNet_terms_type)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe InvoiceOrigin
      -> Maybe Float
      -> Maybe Text
      -> Maybe Text
      -> Maybe Float
      -> Maybe ShippingAddress
      -> Maybe InvoiceState
      -> Maybe [Text]
      -> Maybe Float
      -> Maybe Float
      -> Maybe TaxInfo
      -> Maybe Text
      -> Maybe Float
      -> Maybe [Transaction]
      -> Maybe InvoiceType
      -> Maybe JsonDateTime
      -> Maybe Bool
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Invoice)
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 InvoiceNet_terms_type)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Key
"net_terms_type")) Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe InvoiceOrigin
   -> Maybe Float
   -> Maybe Text
   -> Maybe Text
   -> Maybe Float
   -> Maybe ShippingAddress
   -> Maybe InvoiceState
   -> Maybe [Text]
   -> Maybe Float
   -> Maybe Float
   -> Maybe TaxInfo
   -> Maybe Text
   -> Maybe Float
   -> Maybe [Transaction]
   -> Maybe InvoiceType
   -> Maybe JsonDateTime
   -> Maybe Bool
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Invoice)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe InvoiceOrigin
      -> Maybe Float
      -> Maybe Text
      -> Maybe Text
      -> Maybe Float
      -> Maybe ShippingAddress
      -> Maybe InvoiceState
      -> Maybe [Text]
      -> Maybe Float
      -> Maybe Float
      -> Maybe TaxInfo
      -> Maybe Text
      -> Maybe Float
      -> Maybe [Transaction]
      -> Maybe InvoiceType
      -> Maybe JsonDateTime
      -> Maybe Bool
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Invoice)
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
"number")) Parser
  (Maybe Text
   -> Maybe InvoiceOrigin
   -> Maybe Float
   -> Maybe Text
   -> Maybe Text
   -> Maybe Float
   -> Maybe ShippingAddress
   -> Maybe InvoiceState
   -> Maybe [Text]
   -> Maybe Float
   -> Maybe Float
   -> Maybe TaxInfo
   -> Maybe Text
   -> Maybe Float
   -> Maybe [Transaction]
   -> Maybe InvoiceType
   -> Maybe JsonDateTime
   -> Maybe Bool
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Invoice)
-> Parser (Maybe Text)
-> Parser
     (Maybe InvoiceOrigin
      -> Maybe Float
      -> Maybe Text
      -> Maybe Text
      -> Maybe Float
      -> Maybe ShippingAddress
      -> Maybe InvoiceState
      -> Maybe [Text]
      -> Maybe Float
      -> Maybe Float
      -> Maybe TaxInfo
      -> Maybe Text
      -> Maybe Float
      -> Maybe [Transaction]
      -> Maybe InvoiceType
      -> Maybe JsonDateTime
      -> Maybe Bool
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Invoice)
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
"object")) Parser
  (Maybe InvoiceOrigin
   -> Maybe Float
   -> Maybe Text
   -> Maybe Text
   -> Maybe Float
   -> Maybe ShippingAddress
   -> Maybe InvoiceState
   -> Maybe [Text]
   -> Maybe Float
   -> Maybe Float
   -> Maybe TaxInfo
   -> Maybe Text
   -> Maybe Float
   -> Maybe [Transaction]
   -> Maybe InvoiceType
   -> Maybe JsonDateTime
   -> Maybe Bool
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Invoice)
-> Parser (Maybe InvoiceOrigin)
-> Parser
     (Maybe Float
      -> Maybe Text
      -> Maybe Text
      -> Maybe Float
      -> Maybe ShippingAddress
      -> Maybe InvoiceState
      -> Maybe [Text]
      -> Maybe Float
      -> Maybe Float
      -> Maybe TaxInfo
      -> Maybe Text
      -> Maybe Float
      -> Maybe [Transaction]
      -> Maybe InvoiceType
      -> Maybe JsonDateTime
      -> Maybe Bool
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Invoice)
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 InvoiceOrigin)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Key
"origin")) Parser
  (Maybe Float
   -> Maybe Text
   -> Maybe Text
   -> Maybe Float
   -> Maybe ShippingAddress
   -> Maybe InvoiceState
   -> Maybe [Text]
   -> Maybe Float
   -> Maybe Float
   -> Maybe TaxInfo
   -> Maybe Text
   -> Maybe Float
   -> Maybe [Transaction]
   -> Maybe InvoiceType
   -> Maybe JsonDateTime
   -> Maybe Bool
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Invoice)
-> Parser (Maybe Float)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Float
      -> Maybe ShippingAddress
      -> Maybe InvoiceState
      -> Maybe [Text]
      -> Maybe Float
      -> Maybe Float
      -> Maybe TaxInfo
      -> Maybe Text
      -> Maybe Float
      -> Maybe [Transaction]
      -> Maybe InvoiceType
      -> Maybe JsonDateTime
      -> Maybe Bool
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Invoice)
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 Float)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Key
"paid")) Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Float
   -> Maybe ShippingAddress
   -> Maybe InvoiceState
   -> Maybe [Text]
   -> Maybe Float
   -> Maybe Float
   -> Maybe TaxInfo
   -> Maybe Text
   -> Maybe Float
   -> Maybe [Transaction]
   -> Maybe InvoiceType
   -> Maybe JsonDateTime
   -> Maybe Bool
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Invoice)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Float
      -> Maybe ShippingAddress
      -> Maybe InvoiceState
      -> Maybe [Text]
      -> Maybe Float
      -> Maybe Float
      -> Maybe TaxInfo
      -> Maybe Text
      -> Maybe Float
      -> Maybe [Transaction]
      -> Maybe InvoiceType
      -> Maybe JsonDateTime
      -> Maybe Bool
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Invoice)
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
"po_number")) Parser
  (Maybe Text
   -> Maybe Float
   -> Maybe ShippingAddress
   -> Maybe InvoiceState
   -> Maybe [Text]
   -> Maybe Float
   -> Maybe Float
   -> Maybe TaxInfo
   -> Maybe Text
   -> Maybe Float
   -> Maybe [Transaction]
   -> Maybe InvoiceType
   -> Maybe JsonDateTime
   -> Maybe Bool
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Invoice)
-> Parser (Maybe Text)
-> Parser
     (Maybe Float
      -> Maybe ShippingAddress
      -> Maybe InvoiceState
      -> Maybe [Text]
      -> Maybe Float
      -> Maybe Float
      -> Maybe TaxInfo
      -> Maybe Text
      -> Maybe Float
      -> Maybe [Transaction]
      -> Maybe InvoiceType
      -> Maybe JsonDateTime
      -> Maybe Bool
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Invoice)
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
"previous_invoice_id")) Parser
  (Maybe Float
   -> Maybe ShippingAddress
   -> Maybe InvoiceState
   -> Maybe [Text]
   -> Maybe Float
   -> Maybe Float
   -> Maybe TaxInfo
   -> Maybe Text
   -> Maybe Float
   -> Maybe [Transaction]
   -> Maybe InvoiceType
   -> Maybe JsonDateTime
   -> Maybe Bool
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Invoice)
-> Parser (Maybe Float)
-> Parser
     (Maybe ShippingAddress
      -> Maybe InvoiceState
      -> Maybe [Text]
      -> Maybe Float
      -> Maybe Float
      -> Maybe TaxInfo
      -> Maybe Text
      -> Maybe Float
      -> Maybe [Transaction]
      -> Maybe InvoiceType
      -> Maybe JsonDateTime
      -> Maybe Bool
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Invoice)
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 Float)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Key
"refundable_amount")) Parser
  (Maybe ShippingAddress
   -> Maybe InvoiceState
   -> Maybe [Text]
   -> Maybe Float
   -> Maybe Float
   -> Maybe TaxInfo
   -> Maybe Text
   -> Maybe Float
   -> Maybe [Transaction]
   -> Maybe InvoiceType
   -> Maybe JsonDateTime
   -> Maybe Bool
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Invoice)
-> Parser (Maybe ShippingAddress)
-> Parser
     (Maybe InvoiceState
      -> Maybe [Text]
      -> Maybe Float
      -> Maybe Float
      -> Maybe TaxInfo
      -> Maybe Text
      -> Maybe Float
      -> Maybe [Transaction]
      -> Maybe InvoiceType
      -> Maybe JsonDateTime
      -> Maybe Bool
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Invoice)
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 ShippingAddress)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Key
"shipping_address")) Parser
  (Maybe InvoiceState
   -> Maybe [Text]
   -> Maybe Float
   -> Maybe Float
   -> Maybe TaxInfo
   -> Maybe Text
   -> Maybe Float
   -> Maybe [Transaction]
   -> Maybe InvoiceType
   -> Maybe JsonDateTime
   -> Maybe Bool
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Invoice)
-> Parser (Maybe InvoiceState)
-> Parser
     (Maybe [Text]
      -> Maybe Float
      -> Maybe Float
      -> Maybe TaxInfo
      -> Maybe Text
      -> Maybe Float
      -> Maybe [Transaction]
      -> Maybe InvoiceType
      -> Maybe JsonDateTime
      -> Maybe Bool
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Invoice)
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 InvoiceState)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Key
"state")) Parser
  (Maybe [Text]
   -> Maybe Float
   -> Maybe Float
   -> Maybe TaxInfo
   -> Maybe Text
   -> Maybe Float
   -> Maybe [Transaction]
   -> Maybe InvoiceType
   -> Maybe JsonDateTime
   -> Maybe Bool
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Invoice)
-> Parser (Maybe [Text])
-> Parser
     (Maybe Float
      -> Maybe Float
      -> Maybe TaxInfo
      -> Maybe Text
      -> Maybe Float
      -> Maybe [Transaction]
      -> Maybe InvoiceType
      -> Maybe JsonDateTime
      -> Maybe Bool
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Invoice)
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
"subscription_ids")) Parser
  (Maybe Float
   -> Maybe Float
   -> Maybe TaxInfo
   -> Maybe Text
   -> Maybe Float
   -> Maybe [Transaction]
   -> Maybe InvoiceType
   -> Maybe JsonDateTime
   -> Maybe Bool
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Invoice)
-> Parser (Maybe Float)
-> Parser
     (Maybe Float
      -> Maybe TaxInfo
      -> Maybe Text
      -> Maybe Float
      -> Maybe [Transaction]
      -> Maybe InvoiceType
      -> Maybe JsonDateTime
      -> Maybe Bool
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Invoice)
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 Float)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Key
"subtotal")) Parser
  (Maybe Float
   -> Maybe TaxInfo
   -> Maybe Text
   -> Maybe Float
   -> Maybe [Transaction]
   -> Maybe InvoiceType
   -> Maybe JsonDateTime
   -> Maybe Bool
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Invoice)
-> Parser (Maybe Float)
-> Parser
     (Maybe TaxInfo
      -> Maybe Text
      -> Maybe Float
      -> Maybe [Transaction]
      -> Maybe InvoiceType
      -> Maybe JsonDateTime
      -> Maybe Bool
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Invoice)
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 Float)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Key
"tax")) Parser
  (Maybe TaxInfo
   -> Maybe Text
   -> Maybe Float
   -> Maybe [Transaction]
   -> Maybe InvoiceType
   -> Maybe JsonDateTime
   -> Maybe Bool
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Invoice)
-> Parser (Maybe TaxInfo)
-> Parser
     (Maybe Text
      -> Maybe Float
      -> Maybe [Transaction]
      -> Maybe InvoiceType
      -> Maybe JsonDateTime
      -> Maybe Bool
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Invoice)
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 TaxInfo)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Key
"tax_info")) Parser
  (Maybe Text
   -> Maybe Float
   -> Maybe [Transaction]
   -> Maybe InvoiceType
   -> Maybe JsonDateTime
   -> Maybe Bool
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Invoice)
-> Parser (Maybe Text)
-> Parser
     (Maybe Float
      -> Maybe [Transaction]
      -> Maybe InvoiceType
      -> Maybe JsonDateTime
      -> Maybe Bool
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Invoice)
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
"terms_and_conditions")) Parser
  (Maybe Float
   -> Maybe [Transaction]
   -> Maybe InvoiceType
   -> Maybe JsonDateTime
   -> Maybe Bool
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Invoice)
-> Parser (Maybe Float)
-> Parser
     (Maybe [Transaction]
      -> Maybe InvoiceType
      -> Maybe JsonDateTime
      -> Maybe Bool
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Invoice)
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 Float)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Key
"total")) Parser
  (Maybe [Transaction]
   -> Maybe InvoiceType
   -> Maybe JsonDateTime
   -> Maybe Bool
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Invoice)
-> Parser (Maybe [Transaction])
-> Parser
     (Maybe InvoiceType
      -> Maybe JsonDateTime
      -> Maybe Bool
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Invoice)
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 [Transaction])
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Key
"transactions")) Parser
  (Maybe InvoiceType
   -> Maybe JsonDateTime
   -> Maybe Bool
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Invoice)
-> Parser (Maybe InvoiceType)
-> Parser
     (Maybe JsonDateTime
      -> Maybe Bool -> Maybe Text -> Maybe Text -> Maybe Text -> Invoice)
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 InvoiceType)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Key
"type")) Parser
  (Maybe JsonDateTime
   -> Maybe Bool -> Maybe Text -> Maybe Text -> Maybe Text -> Invoice)
-> Parser (Maybe JsonDateTime)
-> Parser
     (Maybe Bool -> Maybe Text -> Maybe Text -> Maybe Text -> Invoice)
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
"updated_at")) Parser
  (Maybe Bool -> Maybe Text -> Maybe Text -> Maybe Text -> Invoice)
-> Parser (Maybe Bool)
-> Parser (Maybe Text -> Maybe Text -> Maybe Text -> Invoice)
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
"used_tax_service")) Parser (Maybe Text -> Maybe Text -> Maybe Text -> Invoice)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Maybe Text -> Invoice)
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
"uuid")) Parser (Maybe Text -> Maybe Text -> Invoice)
-> Parser (Maybe Text) -> Parser (Maybe Text -> Invoice)
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
"vat_number")) Parser (Maybe Text -> Invoice)
-> Parser (Maybe Text) -> Parser Invoice
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
"vat_reverse_charge_notes"))

-- | Create a new 'Invoice' with all required fields.
mkInvoice :: Invoice
mkInvoice :: Invoice
mkInvoice =
    Invoice
        { invoiceAccount :: Maybe AccountMini
invoiceAccount = Maybe AccountMini
forall a. Maybe a
GHC.Maybe.Nothing
        , invoiceAddress :: Maybe InvoiceAddress
invoiceAddress = Maybe InvoiceAddress
forall a. Maybe a
GHC.Maybe.Nothing
        , invoiceBalance :: Maybe Float
invoiceBalance = Maybe Float
forall a. Maybe a
GHC.Maybe.Nothing
        , invoiceBilling_info_id :: Maybe Text
invoiceBilling_info_id = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing
        , invoiceBusiness_entity_id :: Maybe Text
invoiceBusiness_entity_id = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing
        , invoiceClosed_at :: Maybe JsonDateTime
invoiceClosed_at = Maybe JsonDateTime
forall a. Maybe a
GHC.Maybe.Nothing
        , invoiceCollection_method :: Maybe InvoiceCollection_method
invoiceCollection_method = Maybe InvoiceCollection_method
forall a. Maybe a
GHC.Maybe.Nothing
        , invoiceCreated_at :: Maybe JsonDateTime
invoiceCreated_at = Maybe JsonDateTime
forall a. Maybe a
GHC.Maybe.Nothing
        , invoiceCredit_payments :: Maybe [CreditPayment]
invoiceCredit_payments = Maybe [CreditPayment]
forall a. Maybe a
GHC.Maybe.Nothing
        , invoiceCurrency :: Maybe Text
invoiceCurrency = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing
        , invoiceCustomer_notes :: Maybe Text
invoiceCustomer_notes = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing
        , invoiceDiscount :: Maybe Float
invoiceDiscount = Maybe Float
forall a. Maybe a
GHC.Maybe.Nothing
        , invoiceDue_at :: Maybe JsonDateTime
invoiceDue_at = Maybe JsonDateTime
forall a. Maybe a
GHC.Maybe.Nothing
        , invoiceDunning_campaign_id :: Maybe Text
invoiceDunning_campaign_id = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing
        , invoiceDunning_events_sent :: Maybe Int
invoiceDunning_events_sent = Maybe Int
forall a. Maybe a
GHC.Maybe.Nothing
        , invoiceFinal_dunning_event :: Maybe Bool
invoiceFinal_dunning_event = Maybe Bool
forall a. Maybe a
GHC.Maybe.Nothing
        , invoiceHas_more_line_items :: Maybe Bool
invoiceHas_more_line_items = Maybe Bool
forall a. Maybe a
GHC.Maybe.Nothing
        , invoiceId :: Maybe Text
invoiceId = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing
        , invoiceLine_items :: Maybe [LineItem]
invoiceLine_items = Maybe [LineItem]
forall a. Maybe a
GHC.Maybe.Nothing
        , invoiceNet_terms :: Maybe Int
invoiceNet_terms = Maybe Int
forall a. Maybe a
GHC.Maybe.Nothing
        , invoiceNet_terms_type :: Maybe InvoiceNet_terms_type
invoiceNet_terms_type = Maybe InvoiceNet_terms_type
forall a. Maybe a
GHC.Maybe.Nothing
        , invoiceNumber :: Maybe Text
invoiceNumber = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing
        , invoiceObject :: Maybe Text
invoiceObject = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing
        , invoiceOrigin :: Maybe InvoiceOrigin
invoiceOrigin = Maybe InvoiceOrigin
forall a. Maybe a
GHC.Maybe.Nothing
        , invoicePaid :: Maybe Float
invoicePaid = Maybe Float
forall a. Maybe a
GHC.Maybe.Nothing
        , invoicePo_number :: Maybe Text
invoicePo_number = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing
        , invoicePrevious_invoice_id :: Maybe Text
invoicePrevious_invoice_id = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing
        , invoiceRefundable_amount :: Maybe Float
invoiceRefundable_amount = Maybe Float
forall a. Maybe a
GHC.Maybe.Nothing
        , invoiceShipping_address :: Maybe ShippingAddress
invoiceShipping_address = Maybe ShippingAddress
forall a. Maybe a
GHC.Maybe.Nothing
        , invoiceState :: Maybe InvoiceState
invoiceState = Maybe InvoiceState
forall a. Maybe a
GHC.Maybe.Nothing
        , invoiceSubscription_ids :: Maybe [Text]
invoiceSubscription_ids = Maybe [Text]
forall a. Maybe a
GHC.Maybe.Nothing
        , invoiceSubtotal :: Maybe Float
invoiceSubtotal = Maybe Float
forall a. Maybe a
GHC.Maybe.Nothing
        , invoiceTax :: Maybe Float
invoiceTax = Maybe Float
forall a. Maybe a
GHC.Maybe.Nothing
        , invoiceTax_info :: Maybe TaxInfo
invoiceTax_info = Maybe TaxInfo
forall a. Maybe a
GHC.Maybe.Nothing
        , invoiceTerms_and_conditions :: Maybe Text
invoiceTerms_and_conditions = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing
        , invoiceTotal :: Maybe Float
invoiceTotal = Maybe Float
forall a. Maybe a
GHC.Maybe.Nothing
        , invoiceTransactions :: Maybe [Transaction]
invoiceTransactions = Maybe [Transaction]
forall a. Maybe a
GHC.Maybe.Nothing
        , invoiceType :: Maybe InvoiceType
invoiceType = Maybe InvoiceType
forall a. Maybe a
GHC.Maybe.Nothing
        , invoiceUpdated_at :: Maybe JsonDateTime
invoiceUpdated_at = Maybe JsonDateTime
forall a. Maybe a
GHC.Maybe.Nothing
        , invoiceUsed_tax_service :: Maybe Bool
invoiceUsed_tax_service = Maybe Bool
forall a. Maybe a
GHC.Maybe.Nothing
        , invoiceUuid :: Maybe Text
invoiceUuid = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing
        , invoiceVat_number :: Maybe Text
invoiceVat_number = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing
        , invoiceVat_reverse_charge_notes :: Maybe Text
invoiceVat_reverse_charge_notes = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing
        }

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

An automatic invoice means a corresponding transaction is run using the account\'s billing information at the same time the invoice is created. Manual invoices are created without a corresponding transaction. The merchant must enter a manual payment transaction or have the customer pay the invoice with an automatic method, like credit card, PayPal, Amazon, or ACH bank payment.
-}
data InvoiceCollection_method
    = -- | This case is used if the value encountered during decoding does not match any of the provided cases in the specification.
      InvoiceCollection_methodOther Data.Aeson.Types.Internal.Value
    | -- | This constructor can be used to send values to the server which are not present in the specification yet.
      InvoiceCollection_methodTyped Data.Text.Internal.Text
    | -- | Represents the JSON value @"automatic"@
      InvoiceCollection_methodEnumAutomatic
    | -- | Represents the JSON value @"manual"@
      InvoiceCollection_methodEnumManual
    deriving (Int -> InvoiceCollection_method -> ShowS
[InvoiceCollection_method] -> ShowS
InvoiceCollection_method -> String
(Int -> InvoiceCollection_method -> ShowS)
-> (InvoiceCollection_method -> String)
-> ([InvoiceCollection_method] -> ShowS)
-> Show InvoiceCollection_method
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> InvoiceCollection_method -> ShowS
showsPrec :: Int -> InvoiceCollection_method -> ShowS
$cshow :: InvoiceCollection_method -> String
show :: InvoiceCollection_method -> String
$cshowList :: [InvoiceCollection_method] -> ShowS
showList :: [InvoiceCollection_method] -> ShowS
GHC.Show.Show, InvoiceCollection_method -> InvoiceCollection_method -> Bool
(InvoiceCollection_method -> InvoiceCollection_method -> Bool)
-> (InvoiceCollection_method -> InvoiceCollection_method -> Bool)
-> Eq InvoiceCollection_method
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: InvoiceCollection_method -> InvoiceCollection_method -> Bool
== :: InvoiceCollection_method -> InvoiceCollection_method -> Bool
$c/= :: InvoiceCollection_method -> InvoiceCollection_method -> Bool
/= :: InvoiceCollection_method -> InvoiceCollection_method -> Bool
GHC.Classes.Eq)

instance Data.Aeson.Types.ToJSON.ToJSON InvoiceCollection_method where
    toJSON :: InvoiceCollection_method -> Value
toJSON (InvoiceCollection_methodOther Value
val) = Value
val
    toJSON (InvoiceCollection_methodTyped Text
val) = Text -> Value
forall a. ToJSON a => a -> Value
Data.Aeson.Types.ToJSON.toJSON Text
val
    toJSON (InvoiceCollection_method
InvoiceCollection_methodEnumAutomatic) = Value
"automatic"
    toJSON (InvoiceCollection_method
InvoiceCollection_methodEnumManual) = Value
"manual"
instance Data.Aeson.Types.FromJSON.FromJSON InvoiceCollection_method where
    parseJSON :: Value -> Parser InvoiceCollection_method
parseJSON Value
val =
        InvoiceCollection_method -> Parser InvoiceCollection_method
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
"automatic" -> InvoiceCollection_method
InvoiceCollection_methodEnumAutomatic
                | Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"manual" -> InvoiceCollection_method
InvoiceCollection_methodEnumManual
                | Bool
GHC.Base.otherwise -> Value -> InvoiceCollection_method
InvoiceCollection_methodOther Value
val
            )

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

Optionally supplied string that may be either \`net\` or \`eom\` (end-of-month).
When \`net\`, an invoice becomes past due the specified number of \`Net Terms\` days from the current date.
When \`eom\` an invoice becomes past due the specified number of \`Net Terms\` days from the last day of the current month.
-}
data InvoiceNet_terms_type
    = -- | This case is used if the value encountered during decoding does not match any of the provided cases in the specification.
      InvoiceNet_terms_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.
      InvoiceNet_terms_typeTyped Data.Text.Internal.Text
    | -- | Represents the JSON value @"net"@
      InvoiceNet_terms_typeEnumNet
    | -- | Represents the JSON value @"eom"@
      InvoiceNet_terms_typeEnumEom
    deriving (Int -> InvoiceNet_terms_type -> ShowS
[InvoiceNet_terms_type] -> ShowS
InvoiceNet_terms_type -> String
(Int -> InvoiceNet_terms_type -> ShowS)
-> (InvoiceNet_terms_type -> String)
-> ([InvoiceNet_terms_type] -> ShowS)
-> Show InvoiceNet_terms_type
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> InvoiceNet_terms_type -> ShowS
showsPrec :: Int -> InvoiceNet_terms_type -> ShowS
$cshow :: InvoiceNet_terms_type -> String
show :: InvoiceNet_terms_type -> String
$cshowList :: [InvoiceNet_terms_type] -> ShowS
showList :: [InvoiceNet_terms_type] -> ShowS
GHC.Show.Show, InvoiceNet_terms_type -> InvoiceNet_terms_type -> Bool
(InvoiceNet_terms_type -> InvoiceNet_terms_type -> Bool)
-> (InvoiceNet_terms_type -> InvoiceNet_terms_type -> Bool)
-> Eq InvoiceNet_terms_type
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: InvoiceNet_terms_type -> InvoiceNet_terms_type -> Bool
== :: InvoiceNet_terms_type -> InvoiceNet_terms_type -> Bool
$c/= :: InvoiceNet_terms_type -> InvoiceNet_terms_type -> Bool
/= :: InvoiceNet_terms_type -> InvoiceNet_terms_type -> Bool
GHC.Classes.Eq)

instance Data.Aeson.Types.ToJSON.ToJSON InvoiceNet_terms_type where
    toJSON :: InvoiceNet_terms_type -> Value
toJSON (InvoiceNet_terms_typeOther Value
val) = Value
val
    toJSON (InvoiceNet_terms_typeTyped Text
val) = Text -> Value
forall a. ToJSON a => a -> Value
Data.Aeson.Types.ToJSON.toJSON Text
val
    toJSON (InvoiceNet_terms_type
InvoiceNet_terms_typeEnumNet) = Value
"net"
    toJSON (InvoiceNet_terms_type
InvoiceNet_terms_typeEnumEom) = Value
"eom"
instance Data.Aeson.Types.FromJSON.FromJSON InvoiceNet_terms_type where
    parseJSON :: Value -> Parser InvoiceNet_terms_type
parseJSON Value
val =
        InvoiceNet_terms_type -> Parser InvoiceNet_terms_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
"net" -> InvoiceNet_terms_type
InvoiceNet_terms_typeEnumNet
                | Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"eom" -> InvoiceNet_terms_type
InvoiceNet_terms_typeEnumEom
                | Bool
GHC.Base.otherwise -> Value -> InvoiceNet_terms_type
InvoiceNet_terms_typeOther Value
val
            )

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

The event that created the invoice.
-}
data InvoiceOrigin
    = -- | This case is used if the value encountered during decoding does not match any of the provided cases in the specification.
      InvoiceOriginOther Data.Aeson.Types.Internal.Value
    | -- | This constructor can be used to send values to the server which are not present in the specification yet.
      InvoiceOriginTyped Data.Text.Internal.Text
    | -- | Represents the JSON value @"carryforward_credit"@
      InvoiceOriginEnumCarryforward_credit
    | -- | Represents the JSON value @"carryforward_gift_credit"@
      InvoiceOriginEnumCarryforward_gift_credit
    | -- | Represents the JSON value @"credit"@
      InvoiceOriginEnumCredit
    | -- | Represents the JSON value @"external_refund"@
      InvoiceOriginEnumExternal_refund
    | -- | Represents the JSON value @"gift_card"@
      InvoiceOriginEnumGift_card
    | -- | Represents the JSON value @"immediate_change"@
      InvoiceOriginEnumImmediate_change
    | -- | Represents the JSON value @"import"@
      InvoiceOriginEnumImport
    | -- | Represents the JSON value @"line_item_refund"@
      InvoiceOriginEnumLine_item_refund
    | -- | Represents the JSON value @"open_amount_refund"@
      InvoiceOriginEnumOpen_amount_refund
    | -- | Represents the JSON value @"prepayment"@
      InvoiceOriginEnumPrepayment
    | -- | Represents the JSON value @"purchase"@
      InvoiceOriginEnumPurchase
    | -- | Represents the JSON value @"refund"@
      InvoiceOriginEnumRefund
    | -- | Represents the JSON value @"renewal"@
      InvoiceOriginEnumRenewal
    | -- | Represents the JSON value @"termination"@
      InvoiceOriginEnumTermination
    | -- | Represents the JSON value @"usage_correction"@
      InvoiceOriginEnumUsage_correction
    | -- | Represents the JSON value @"write_off"@
      InvoiceOriginEnumWrite_off
    deriving (Int -> InvoiceOrigin -> ShowS
[InvoiceOrigin] -> ShowS
InvoiceOrigin -> String
(Int -> InvoiceOrigin -> ShowS)
-> (InvoiceOrigin -> String)
-> ([InvoiceOrigin] -> ShowS)
-> Show InvoiceOrigin
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> InvoiceOrigin -> ShowS
showsPrec :: Int -> InvoiceOrigin -> ShowS
$cshow :: InvoiceOrigin -> String
show :: InvoiceOrigin -> String
$cshowList :: [InvoiceOrigin] -> ShowS
showList :: [InvoiceOrigin] -> ShowS
GHC.Show.Show, InvoiceOrigin -> InvoiceOrigin -> Bool
(InvoiceOrigin -> InvoiceOrigin -> Bool)
-> (InvoiceOrigin -> InvoiceOrigin -> Bool) -> Eq InvoiceOrigin
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: InvoiceOrigin -> InvoiceOrigin -> Bool
== :: InvoiceOrigin -> InvoiceOrigin -> Bool
$c/= :: InvoiceOrigin -> InvoiceOrigin -> Bool
/= :: InvoiceOrigin -> InvoiceOrigin -> Bool
GHC.Classes.Eq)

instance Data.Aeson.Types.ToJSON.ToJSON InvoiceOrigin where
    toJSON :: InvoiceOrigin -> Value
toJSON (InvoiceOriginOther Value
val) = Value
val
    toJSON (InvoiceOriginTyped Text
val) = Text -> Value
forall a. ToJSON a => a -> Value
Data.Aeson.Types.ToJSON.toJSON Text
val
    toJSON (InvoiceOrigin
InvoiceOriginEnumCarryforward_credit) = Value
"carryforward_credit"
    toJSON (InvoiceOrigin
InvoiceOriginEnumCarryforward_gift_credit) = Value
"carryforward_gift_credit"
    toJSON (InvoiceOrigin
InvoiceOriginEnumCredit) = Value
"credit"
    toJSON (InvoiceOrigin
InvoiceOriginEnumExternal_refund) = Value
"external_refund"
    toJSON (InvoiceOrigin
InvoiceOriginEnumGift_card) = Value
"gift_card"
    toJSON (InvoiceOrigin
InvoiceOriginEnumImmediate_change) = Value
"immediate_change"
    toJSON (InvoiceOrigin
InvoiceOriginEnumImport) = Value
"import"
    toJSON (InvoiceOrigin
InvoiceOriginEnumLine_item_refund) = Value
"line_item_refund"
    toJSON (InvoiceOrigin
InvoiceOriginEnumOpen_amount_refund) = Value
"open_amount_refund"
    toJSON (InvoiceOrigin
InvoiceOriginEnumPrepayment) = Value
"prepayment"
    toJSON (InvoiceOrigin
InvoiceOriginEnumPurchase) = Value
"purchase"
    toJSON (InvoiceOrigin
InvoiceOriginEnumRefund) = Value
"refund"
    toJSON (InvoiceOrigin
InvoiceOriginEnumRenewal) = Value
"renewal"
    toJSON (InvoiceOrigin
InvoiceOriginEnumTermination) = Value
"termination"
    toJSON (InvoiceOrigin
InvoiceOriginEnumUsage_correction) = Value
"usage_correction"
    toJSON (InvoiceOrigin
InvoiceOriginEnumWrite_off) = Value
"write_off"
instance Data.Aeson.Types.FromJSON.FromJSON InvoiceOrigin where
    parseJSON :: Value -> Parser InvoiceOrigin
parseJSON Value
val =
        InvoiceOrigin -> Parser InvoiceOrigin
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
"carryforward_credit" -> InvoiceOrigin
InvoiceOriginEnumCarryforward_credit
                | Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"carryforward_gift_credit" -> InvoiceOrigin
InvoiceOriginEnumCarryforward_gift_credit
                | Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"credit" -> InvoiceOrigin
InvoiceOriginEnumCredit
                | Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"external_refund" -> InvoiceOrigin
InvoiceOriginEnumExternal_refund
                | Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"gift_card" -> InvoiceOrigin
InvoiceOriginEnumGift_card
                | Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"immediate_change" -> InvoiceOrigin
InvoiceOriginEnumImmediate_change
                | Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"import" -> InvoiceOrigin
InvoiceOriginEnumImport
                | Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"line_item_refund" -> InvoiceOrigin
InvoiceOriginEnumLine_item_refund
                | Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"open_amount_refund" -> InvoiceOrigin
InvoiceOriginEnumOpen_amount_refund
                | Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"prepayment" -> InvoiceOrigin
InvoiceOriginEnumPrepayment
                | Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"purchase" -> InvoiceOrigin
InvoiceOriginEnumPurchase
                | Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"refund" -> InvoiceOrigin
InvoiceOriginEnumRefund
                | Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"renewal" -> InvoiceOrigin
InvoiceOriginEnumRenewal
                | Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"termination" -> InvoiceOrigin
InvoiceOriginEnumTermination
                | Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"usage_correction" -> InvoiceOrigin
InvoiceOriginEnumUsage_correction
                | Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"write_off" -> InvoiceOrigin
InvoiceOriginEnumWrite_off
                | Bool
GHC.Base.otherwise -> Value -> InvoiceOrigin
InvoiceOriginOther Value
val
            )

-- | Defines the enum schema located at @components.schemas.Invoice.properties.state@ in the specification.
data InvoiceState
    = -- | This case is used if the value encountered during decoding does not match any of the provided cases in the specification.
      InvoiceStateOther Data.Aeson.Types.Internal.Value
    | -- | This constructor can be used to send values to the server which are not present in the specification yet.
      InvoiceStateTyped Data.Text.Internal.Text
    | -- | Represents the JSON value @"open"@
      InvoiceStateEnumOpen
    | -- | Represents the JSON value @"pending"@
      InvoiceStateEnumPending
    | -- | Represents the JSON value @"processing"@
      InvoiceStateEnumProcessing
    | -- | Represents the JSON value @"past_due"@
      InvoiceStateEnumPast_due
    | -- | Represents the JSON value @"paid"@
      InvoiceStateEnumPaid
    | -- | Represents the JSON value @"closed"@
      InvoiceStateEnumClosed
    | -- | Represents the JSON value @"failed"@
      InvoiceStateEnumFailed
    | -- | Represents the JSON value @"voided"@
      InvoiceStateEnumVoided
    deriving (Int -> InvoiceState -> ShowS
[InvoiceState] -> ShowS
InvoiceState -> String
(Int -> InvoiceState -> ShowS)
-> (InvoiceState -> String)
-> ([InvoiceState] -> ShowS)
-> Show InvoiceState
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> InvoiceState -> ShowS
showsPrec :: Int -> InvoiceState -> ShowS
$cshow :: InvoiceState -> String
show :: InvoiceState -> String
$cshowList :: [InvoiceState] -> ShowS
showList :: [InvoiceState] -> ShowS
GHC.Show.Show, InvoiceState -> InvoiceState -> Bool
(InvoiceState -> InvoiceState -> Bool)
-> (InvoiceState -> InvoiceState -> Bool) -> Eq InvoiceState
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: InvoiceState -> InvoiceState -> Bool
== :: InvoiceState -> InvoiceState -> Bool
$c/= :: InvoiceState -> InvoiceState -> Bool
/= :: InvoiceState -> InvoiceState -> Bool
GHC.Classes.Eq)

instance Data.Aeson.Types.ToJSON.ToJSON InvoiceState where
    toJSON :: InvoiceState -> Value
toJSON (InvoiceStateOther Value
val) = Value
val
    toJSON (InvoiceStateTyped Text
val) = Text -> Value
forall a. ToJSON a => a -> Value
Data.Aeson.Types.ToJSON.toJSON Text
val
    toJSON (InvoiceState
InvoiceStateEnumOpen) = Value
"open"
    toJSON (InvoiceState
InvoiceStateEnumPending) = Value
"pending"
    toJSON (InvoiceState
InvoiceStateEnumProcessing) = Value
"processing"
    toJSON (InvoiceState
InvoiceStateEnumPast_due) = Value
"past_due"
    toJSON (InvoiceState
InvoiceStateEnumPaid) = Value
"paid"
    toJSON (InvoiceState
InvoiceStateEnumClosed) = Value
"closed"
    toJSON (InvoiceState
InvoiceStateEnumFailed) = Value
"failed"
    toJSON (InvoiceState
InvoiceStateEnumVoided) = Value
"voided"
instance Data.Aeson.Types.FromJSON.FromJSON InvoiceState where
    parseJSON :: Value -> Parser InvoiceState
parseJSON Value
val =
        InvoiceState -> Parser InvoiceState
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
"open" -> InvoiceState
InvoiceStateEnumOpen
                | Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"pending" -> InvoiceState
InvoiceStateEnumPending
                | Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"processing" -> InvoiceState
InvoiceStateEnumProcessing
                | Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"past_due" -> InvoiceState
InvoiceStateEnumPast_due
                | Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"paid" -> InvoiceState
InvoiceStateEnumPaid
                | Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"closed" -> InvoiceState
InvoiceStateEnumClosed
                | Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"failed" -> InvoiceState
InvoiceStateEnumFailed
                | Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"voided" -> InvoiceState
InvoiceStateEnumVoided
                | Bool
GHC.Base.otherwise -> Value -> InvoiceState
InvoiceStateOther Value
val
            )

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

Invoices are either charge, credit, or legacy invoices.
-}
data InvoiceType
    = -- | This case is used if the value encountered during decoding does not match any of the provided cases in the specification.
      InvoiceTypeOther Data.Aeson.Types.Internal.Value
    | -- | This constructor can be used to send values to the server which are not present in the specification yet.
      InvoiceTypeTyped Data.Text.Internal.Text
    | -- | Represents the JSON value @"charge"@
      InvoiceTypeEnumCharge
    | -- | Represents the JSON value @"credit"@
      InvoiceTypeEnumCredit
    | -- | Represents the JSON value @"legacy"@
      InvoiceTypeEnumLegacy
    deriving (Int -> InvoiceType -> ShowS
[InvoiceType] -> ShowS
InvoiceType -> String
(Int -> InvoiceType -> ShowS)
-> (InvoiceType -> String)
-> ([InvoiceType] -> ShowS)
-> Show InvoiceType
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> InvoiceType -> ShowS
showsPrec :: Int -> InvoiceType -> ShowS
$cshow :: InvoiceType -> String
show :: InvoiceType -> String
$cshowList :: [InvoiceType] -> ShowS
showList :: [InvoiceType] -> ShowS
GHC.Show.Show, InvoiceType -> InvoiceType -> Bool
(InvoiceType -> InvoiceType -> Bool)
-> (InvoiceType -> InvoiceType -> Bool) -> Eq InvoiceType
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: InvoiceType -> InvoiceType -> Bool
== :: InvoiceType -> InvoiceType -> Bool
$c/= :: InvoiceType -> InvoiceType -> Bool
/= :: InvoiceType -> InvoiceType -> Bool
GHC.Classes.Eq)

instance Data.Aeson.Types.ToJSON.ToJSON InvoiceType where
    toJSON :: InvoiceType -> Value
toJSON (InvoiceTypeOther Value
val) = Value
val
    toJSON (InvoiceTypeTyped Text
val) = Text -> Value
forall a. ToJSON a => a -> Value
Data.Aeson.Types.ToJSON.toJSON Text
val
    toJSON (InvoiceType
InvoiceTypeEnumCharge) = Value
"charge"
    toJSON (InvoiceType
InvoiceTypeEnumCredit) = Value
"credit"
    toJSON (InvoiceType
InvoiceTypeEnumLegacy) = Value
"legacy"
instance Data.Aeson.Types.FromJSON.FromJSON InvoiceType where
    parseJSON :: Value -> Parser InvoiceType
parseJSON Value
val =
        InvoiceType -> Parser InvoiceType
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" -> InvoiceType
InvoiceTypeEnumCharge
                | Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"credit" -> InvoiceType
InvoiceTypeEnumCredit
                | Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"legacy" -> InvoiceType
InvoiceTypeEnumLegacy
                | Bool
GHC.Base.otherwise -> Value -> InvoiceType
InvoiceTypeOther Value
val
            )