{-# 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 Payout
module StripeAPI.Types.Payout where

import qualified Control.Monad.Fail
import qualified Data.Aeson
import qualified Data.Aeson as Data.Aeson.Encoding.Internal
import qualified Data.Aeson as Data.Aeson.Types
import qualified Data.Aeson as Data.Aeson.Types.FromJSON
import qualified Data.Aeson as Data.Aeson.Types.Internal
import qualified Data.Aeson as Data.Aeson.Types.ToJSON
import qualified Data.ByteString.Char8
import qualified Data.ByteString.Char8 as Data.ByteString.Internal
import qualified Data.Functor
import qualified Data.Scientific
import qualified Data.Text
import qualified Data.Text.Internal
import qualified Data.Time.Calendar as Data.Time.Calendar.Days
import qualified Data.Time.LocalTime as Data.Time.LocalTime.Internal.ZonedTime
import qualified GHC.Base
import qualified GHC.Classes
import qualified GHC.Int
import qualified GHC.Show
import qualified GHC.Types
import qualified StripeAPI.Common
import StripeAPI.TypeAlias
import {-# SOURCE #-} StripeAPI.Types.BalanceTransaction
import {-# SOURCE #-} StripeAPI.Types.BankAccount
import {-# SOURCE #-} StripeAPI.Types.Card
import {-# SOURCE #-} StripeAPI.Types.DeletedBankAccount
import {-# SOURCE #-} StripeAPI.Types.DeletedCard
import qualified Prelude as GHC.Integer.Type
import qualified Prelude as GHC.Maybe

-- | Defines the object schema located at @components.schemas.payout@ in the specification.
--
-- A \`Payout\` object is created when you receive funds from Stripe, or when you
-- initiate a payout to either a bank account or debit card of a [connected
-- Stripe account](\/docs\/connect\/bank-debit-card-payouts). You can retrieve individual payouts,
-- as well as list all payouts. Payouts are made on [varying
-- schedules](\/docs\/connect\/manage-payout-schedule), depending on your country and
-- industry.
--
-- Related guide: [Receiving Payouts](https:\/\/stripe.com\/docs\/payouts).
data Payout = Payout
  { -- | amount: Amount (in %s) to be transferred to your bank account or debit card.
    Payout -> Int
payoutAmount :: GHC.Types.Int,
    -- | arrival_date: Date the payout is expected to arrive in the bank. This factors in delays like weekends or bank holidays.
    Payout -> Int
payoutArrivalDate :: GHC.Types.Int,
    -- | automatic: Returns \`true\` if the payout was created by an [automated payout schedule](https:\/\/stripe.com\/docs\/payouts\#payout-schedule), and \`false\` if it was [requested manually](https:\/\/stripe.com\/docs\/payouts\#manual-payouts).
    Payout -> Bool
payoutAutomatic :: GHC.Types.Bool,
    -- | balance_transaction: ID of the balance transaction that describes the impact of this payout on your account balance.
    Payout -> Maybe PayoutBalanceTransaction'Variants
payoutBalanceTransaction :: (GHC.Maybe.Maybe PayoutBalanceTransaction'Variants),
    -- | created: Time at which the object was created. Measured in seconds since the Unix epoch.
    Payout -> Int
payoutCreated :: GHC.Types.Int,
    -- | currency: Three-letter [ISO currency code](https:\/\/www.iso.org\/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https:\/\/stripe.com\/docs\/currencies).
    Payout -> Text
payoutCurrency :: Data.Text.Internal.Text,
    -- | description: An arbitrary string attached to the object. Often useful for displaying to users.
    --
    -- Constraints:
    --
    -- * Maximum length of 5000
    Payout -> Maybe Text
payoutDescription :: (GHC.Maybe.Maybe Data.Text.Internal.Text),
    -- | destination: ID of the bank account or card the payout was sent to.
    Payout -> Maybe PayoutDestination'Variants
payoutDestination :: (GHC.Maybe.Maybe PayoutDestination'Variants),
    -- | failure_balance_transaction: If the payout failed or was canceled, this will be the ID of the balance transaction that reversed the initial balance transaction, and puts the funds from the failed payout back in your balance.
    Payout -> Maybe PayoutFailureBalanceTransaction'Variants
payoutFailureBalanceTransaction :: (GHC.Maybe.Maybe PayoutFailureBalanceTransaction'Variants),
    -- | failure_code: Error code explaining reason for payout failure if available. See [Types of payout failures](https:\/\/stripe.com\/docs\/api\#payout_failures) for a list of failure codes.
    --
    -- Constraints:
    --
    -- * Maximum length of 5000
    Payout -> Maybe Text
payoutFailureCode :: (GHC.Maybe.Maybe Data.Text.Internal.Text),
    -- | failure_message: Message to user further explaining reason for payout failure if available.
    --
    -- Constraints:
    --
    -- * Maximum length of 5000
    Payout -> Maybe Text
payoutFailureMessage :: (GHC.Maybe.Maybe Data.Text.Internal.Text),
    -- | id: Unique identifier for the object.
    --
    -- Constraints:
    --
    -- * Maximum length of 5000
    Payout -> Text
payoutId :: Data.Text.Internal.Text,
    -- | livemode: Has the value \`true\` if the object exists in live mode or the value \`false\` if the object exists in test mode.
    Payout -> Bool
payoutLivemode :: GHC.Types.Bool,
    -- | metadata: Set of [key-value pairs](https:\/\/stripe.com\/docs\/api\/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format.
    Payout -> Maybe Object
payoutMetadata :: (GHC.Maybe.Maybe Data.Aeson.Types.Internal.Object),
    -- | method: The method used to send this payout, which can be \`standard\` or \`instant\`. \`instant\` is only supported for payouts to debit cards. (See [Instant payouts for marketplaces](https:\/\/stripe.com\/blog\/instant-payouts-for-marketplaces) for more information.)
    --
    -- Constraints:
    --
    -- * Maximum length of 5000
    Payout -> Text
payoutMethod :: Data.Text.Internal.Text,
    -- | original_payout: If the payout reverses another, this is the ID of the original payout.
    Payout -> Maybe PayoutOriginalPayout'Variants
payoutOriginalPayout :: (GHC.Maybe.Maybe PayoutOriginalPayout'Variants),
    -- | reversed_by: If the payout was reversed, this is the ID of the payout that reverses this payout.
    Payout -> Maybe PayoutReversedBy'Variants
payoutReversedBy :: (GHC.Maybe.Maybe PayoutReversedBy'Variants),
    -- | source_type: The source balance this payout came from. One of \`card\`, \`fpx\`, or \`bank_account\`.
    --
    -- Constraints:
    --
    -- * Maximum length of 5000
    Payout -> Text
payoutSourceType :: Data.Text.Internal.Text,
    -- | statement_descriptor: Extra information about a payout to be displayed on the user\'s bank statement.
    --
    -- Constraints:
    --
    -- * Maximum length of 5000
    Payout -> Maybe Text
payoutStatementDescriptor :: (GHC.Maybe.Maybe Data.Text.Internal.Text),
    -- | status: Current status of the payout: \`paid\`, \`pending\`, \`in_transit\`, \`canceled\` or \`failed\`. A payout is \`pending\` until it is submitted to the bank, when it becomes \`in_transit\`. The status then changes to \`paid\` if the transaction goes through, or to \`failed\` or \`canceled\` (within 5 business days). Some failed payouts may initially show as \`paid\` but then change to \`failed\`.
    --
    -- Constraints:
    --
    -- * Maximum length of 5000
    Payout -> Text
payoutStatus :: Data.Text.Internal.Text,
    -- | type: Can be \`bank_account\` or \`card\`.
    Payout -> PayoutType'
payoutType :: PayoutType'
  }
  deriving
    ( Int -> Payout -> ShowS
[Payout] -> ShowS
Payout -> String
(Int -> Payout -> ShowS)
-> (Payout -> String) -> ([Payout] -> ShowS) -> Show Payout
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Payout] -> ShowS
$cshowList :: [Payout] -> ShowS
show :: Payout -> String
$cshow :: Payout -> String
showsPrec :: Int -> Payout -> ShowS
$cshowsPrec :: Int -> Payout -> ShowS
GHC.Show.Show,
      Payout -> Payout -> Bool
(Payout -> Payout -> Bool)
-> (Payout -> Payout -> Bool) -> Eq Payout
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Payout -> Payout -> Bool
$c/= :: Payout -> Payout -> Bool
== :: Payout -> Payout -> Bool
$c== :: Payout -> Payout -> Bool
GHC.Classes.Eq
    )

instance Data.Aeson.Types.ToJSON.ToJSON Payout where
  toJSON :: Payout -> Value
toJSON Payout
obj = [Pair] -> Value
Data.Aeson.Types.Internal.object (Text
"amount" Text -> Int -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= Payout -> Int
payoutAmount Payout
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"arrival_date" Text -> Int -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= Payout -> Int
payoutArrivalDate Payout
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"automatic" Text -> Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= Payout -> Bool
payoutAutomatic Payout
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"balance_transaction" Text -> Maybe PayoutBalanceTransaction'Variants -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= Payout -> Maybe PayoutBalanceTransaction'Variants
payoutBalanceTransaction Payout
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"created" Text -> Int -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= Payout -> Int
payoutCreated Payout
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"currency" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= Payout -> Text
payoutCurrency Payout
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"description" Text -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= Payout -> Maybe Text
payoutDescription Payout
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"destination" Text -> Maybe PayoutDestination'Variants -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= Payout -> Maybe PayoutDestination'Variants
payoutDestination Payout
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"failure_balance_transaction" Text -> Maybe PayoutFailureBalanceTransaction'Variants -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= Payout -> Maybe PayoutFailureBalanceTransaction'Variants
payoutFailureBalanceTransaction Payout
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"failure_code" Text -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= Payout -> Maybe Text
payoutFailureCode Payout
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"failure_message" Text -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= Payout -> Maybe Text
payoutFailureMessage Payout
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"id" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= Payout -> Text
payoutId Payout
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"livemode" Text -> Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= Payout -> Bool
payoutLivemode Payout
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"metadata" Text -> Maybe Object -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= Payout -> Maybe Object
payoutMetadata Payout
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"method" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= Payout -> Text
payoutMethod Payout
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"original_payout" Text -> Maybe PayoutOriginalPayout'Variants -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= Payout -> Maybe PayoutOriginalPayout'Variants
payoutOriginalPayout Payout
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"reversed_by" Text -> Maybe PayoutReversedBy'Variants -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= Payout -> Maybe PayoutReversedBy'Variants
payoutReversedBy Payout
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"source_type" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= Payout -> Text
payoutSourceType Payout
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"statement_descriptor" Text -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= Payout -> Maybe Text
payoutStatementDescriptor Payout
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"status" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= Payout -> Text
payoutStatus Payout
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"type" Text -> PayoutType' -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= Payout -> PayoutType'
payoutType Payout
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"object" Text -> Value -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= Text -> Value
Data.Aeson.Types.Internal.String Text
"payout" Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: [Pair]
forall a. Monoid a => a
GHC.Base.mempty)
  toEncoding :: Payout -> Encoding
toEncoding Payout
obj = Series -> Encoding
Data.Aeson.Encoding.Internal.pairs ((Text
"amount" Text -> Int -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= Payout -> Int
payoutAmount Payout
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"arrival_date" Text -> Int -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= Payout -> Int
payoutArrivalDate Payout
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"automatic" Text -> Bool -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= Payout -> Bool
payoutAutomatic Payout
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"balance_transaction" Text -> Maybe PayoutBalanceTransaction'Variants -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= Payout -> Maybe PayoutBalanceTransaction'Variants
payoutBalanceTransaction Payout
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"created" Text -> Int -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= Payout -> Int
payoutCreated Payout
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"currency" Text -> Text -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= Payout -> Text
payoutCurrency Payout
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"description" Text -> Maybe Text -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= Payout -> Maybe Text
payoutDescription Payout
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"destination" Text -> Maybe PayoutDestination'Variants -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= Payout -> Maybe PayoutDestination'Variants
payoutDestination Payout
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"failure_balance_transaction" Text -> Maybe PayoutFailureBalanceTransaction'Variants -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= Payout -> Maybe PayoutFailureBalanceTransaction'Variants
payoutFailureBalanceTransaction Payout
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"failure_code" Text -> Maybe Text -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= Payout -> Maybe Text
payoutFailureCode Payout
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"failure_message" Text -> Maybe Text -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= Payout -> Maybe Text
payoutFailureMessage Payout
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"id" Text -> Text -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= Payout -> Text
payoutId Payout
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"livemode" Text -> Bool -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= Payout -> Bool
payoutLivemode Payout
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"metadata" Text -> Maybe Object -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= Payout -> Maybe Object
payoutMetadata Payout
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"method" Text -> Text -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= Payout -> Text
payoutMethod Payout
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"original_payout" Text -> Maybe PayoutOriginalPayout'Variants -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= Payout -> Maybe PayoutOriginalPayout'Variants
payoutOriginalPayout Payout
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"reversed_by" Text -> Maybe PayoutReversedBy'Variants -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= Payout -> Maybe PayoutReversedBy'Variants
payoutReversedBy Payout
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"source_type" Text -> Text -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= Payout -> Text
payoutSourceType Payout
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"statement_descriptor" Text -> Maybe Text -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= Payout -> Maybe Text
payoutStatementDescriptor Payout
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"status" Text -> Text -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= Payout -> Text
payoutStatus Payout
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"type" Text -> PayoutType' -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= Payout -> PayoutType'
payoutType Payout
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> (Text
"object" Text -> Value -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= Text -> Value
Data.Aeson.Types.Internal.String Text
"payout"))))))))))))))))))))))

instance Data.Aeson.Types.FromJSON.FromJSON Payout where
  parseJSON :: Value -> Parser Payout
parseJSON = String -> (Object -> Parser Payout) -> Value -> Parser Payout
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.Aeson.Types.FromJSON.withObject String
"Payout" (\Object
obj -> (((((((((((((((((((((Int
 -> Int
 -> Bool
 -> Maybe PayoutBalanceTransaction'Variants
 -> Int
 -> Text
 -> Maybe Text
 -> Maybe PayoutDestination'Variants
 -> Maybe PayoutFailureBalanceTransaction'Variants
 -> Maybe Text
 -> Maybe Text
 -> Text
 -> Bool
 -> Maybe Object
 -> Text
 -> Maybe PayoutOriginalPayout'Variants
 -> Maybe PayoutReversedBy'Variants
 -> Text
 -> Maybe Text
 -> Text
 -> PayoutType'
 -> Payout)
-> Parser
     (Int
      -> Int
      -> Bool
      -> Maybe PayoutBalanceTransaction'Variants
      -> Int
      -> Text
      -> Maybe Text
      -> Maybe PayoutDestination'Variants
      -> Maybe PayoutFailureBalanceTransaction'Variants
      -> Maybe Text
      -> Maybe Text
      -> Text
      -> Bool
      -> Maybe Object
      -> Text
      -> Maybe PayoutOriginalPayout'Variants
      -> Maybe PayoutReversedBy'Variants
      -> Text
      -> Maybe Text
      -> Text
      -> PayoutType'
      -> Payout)
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure Int
-> Int
-> Bool
-> Maybe PayoutBalanceTransaction'Variants
-> Int
-> Text
-> Maybe Text
-> Maybe PayoutDestination'Variants
-> Maybe PayoutFailureBalanceTransaction'Variants
-> Maybe Text
-> Maybe Text
-> Text
-> Bool
-> Maybe Object
-> Text
-> Maybe PayoutOriginalPayout'Variants
-> Maybe PayoutReversedBy'Variants
-> Text
-> Maybe Text
-> Text
-> PayoutType'
-> Payout
Payout Parser
  (Int
   -> Int
   -> Bool
   -> Maybe PayoutBalanceTransaction'Variants
   -> Int
   -> Text
   -> Maybe Text
   -> Maybe PayoutDestination'Variants
   -> Maybe PayoutFailureBalanceTransaction'Variants
   -> Maybe Text
   -> Maybe Text
   -> Text
   -> Bool
   -> Maybe Object
   -> Text
   -> Maybe PayoutOriginalPayout'Variants
   -> Maybe PayoutReversedBy'Variants
   -> Text
   -> Maybe Text
   -> Text
   -> PayoutType'
   -> Payout)
-> Parser Int
-> Parser
     (Int
      -> Bool
      -> Maybe PayoutBalanceTransaction'Variants
      -> Int
      -> Text
      -> Maybe Text
      -> Maybe PayoutDestination'Variants
      -> Maybe PayoutFailureBalanceTransaction'Variants
      -> Maybe Text
      -> Maybe Text
      -> Text
      -> Bool
      -> Maybe Object
      -> Text
      -> Maybe PayoutOriginalPayout'Variants
      -> Maybe PayoutReversedBy'Variants
      -> Text
      -> Maybe Text
      -> Text
      -> PayoutType'
      -> Payout)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Text -> Parser Int
forall a. FromJSON a => Object -> Text -> Parser a
Data.Aeson.Types.FromJSON..: Text
"amount")) Parser
  (Int
   -> Bool
   -> Maybe PayoutBalanceTransaction'Variants
   -> Int
   -> Text
   -> Maybe Text
   -> Maybe PayoutDestination'Variants
   -> Maybe PayoutFailureBalanceTransaction'Variants
   -> Maybe Text
   -> Maybe Text
   -> Text
   -> Bool
   -> Maybe Object
   -> Text
   -> Maybe PayoutOriginalPayout'Variants
   -> Maybe PayoutReversedBy'Variants
   -> Text
   -> Maybe Text
   -> Text
   -> PayoutType'
   -> Payout)
-> Parser Int
-> Parser
     (Bool
      -> Maybe PayoutBalanceTransaction'Variants
      -> Int
      -> Text
      -> Maybe Text
      -> Maybe PayoutDestination'Variants
      -> Maybe PayoutFailureBalanceTransaction'Variants
      -> Maybe Text
      -> Maybe Text
      -> Text
      -> Bool
      -> Maybe Object
      -> Text
      -> Maybe PayoutOriginalPayout'Variants
      -> Maybe PayoutReversedBy'Variants
      -> Text
      -> Maybe Text
      -> Text
      -> PayoutType'
      -> Payout)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Text -> Parser Int
forall a. FromJSON a => Object -> Text -> Parser a
Data.Aeson.Types.FromJSON..: Text
"arrival_date")) Parser
  (Bool
   -> Maybe PayoutBalanceTransaction'Variants
   -> Int
   -> Text
   -> Maybe Text
   -> Maybe PayoutDestination'Variants
   -> Maybe PayoutFailureBalanceTransaction'Variants
   -> Maybe Text
   -> Maybe Text
   -> Text
   -> Bool
   -> Maybe Object
   -> Text
   -> Maybe PayoutOriginalPayout'Variants
   -> Maybe PayoutReversedBy'Variants
   -> Text
   -> Maybe Text
   -> Text
   -> PayoutType'
   -> Payout)
-> Parser Bool
-> Parser
     (Maybe PayoutBalanceTransaction'Variants
      -> Int
      -> Text
      -> Maybe Text
      -> Maybe PayoutDestination'Variants
      -> Maybe PayoutFailureBalanceTransaction'Variants
      -> Maybe Text
      -> Maybe Text
      -> Text
      -> Bool
      -> Maybe Object
      -> Text
      -> Maybe PayoutOriginalPayout'Variants
      -> Maybe PayoutReversedBy'Variants
      -> Text
      -> Maybe Text
      -> Text
      -> PayoutType'
      -> Payout)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Text -> Parser Bool
forall a. FromJSON a => Object -> Text -> Parser a
Data.Aeson.Types.FromJSON..: Text
"automatic")) Parser
  (Maybe PayoutBalanceTransaction'Variants
   -> Int
   -> Text
   -> Maybe Text
   -> Maybe PayoutDestination'Variants
   -> Maybe PayoutFailureBalanceTransaction'Variants
   -> Maybe Text
   -> Maybe Text
   -> Text
   -> Bool
   -> Maybe Object
   -> Text
   -> Maybe PayoutOriginalPayout'Variants
   -> Maybe PayoutReversedBy'Variants
   -> Text
   -> Maybe Text
   -> Text
   -> PayoutType'
   -> Payout)
-> Parser (Maybe PayoutBalanceTransaction'Variants)
-> Parser
     (Int
      -> Text
      -> Maybe Text
      -> Maybe PayoutDestination'Variants
      -> Maybe PayoutFailureBalanceTransaction'Variants
      -> Maybe Text
      -> Maybe Text
      -> Text
      -> Bool
      -> Maybe Object
      -> Text
      -> Maybe PayoutOriginalPayout'Variants
      -> Maybe PayoutReversedBy'Variants
      -> Text
      -> Maybe Text
      -> Text
      -> PayoutType'
      -> Payout)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Text -> Parser (Maybe PayoutBalanceTransaction'Variants)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Text
"balance_transaction")) Parser
  (Int
   -> Text
   -> Maybe Text
   -> Maybe PayoutDestination'Variants
   -> Maybe PayoutFailureBalanceTransaction'Variants
   -> Maybe Text
   -> Maybe Text
   -> Text
   -> Bool
   -> Maybe Object
   -> Text
   -> Maybe PayoutOriginalPayout'Variants
   -> Maybe PayoutReversedBy'Variants
   -> Text
   -> Maybe Text
   -> Text
   -> PayoutType'
   -> Payout)
-> Parser Int
-> Parser
     (Text
      -> Maybe Text
      -> Maybe PayoutDestination'Variants
      -> Maybe PayoutFailureBalanceTransaction'Variants
      -> Maybe Text
      -> Maybe Text
      -> Text
      -> Bool
      -> Maybe Object
      -> Text
      -> Maybe PayoutOriginalPayout'Variants
      -> Maybe PayoutReversedBy'Variants
      -> Text
      -> Maybe Text
      -> Text
      -> PayoutType'
      -> Payout)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Text -> Parser Int
forall a. FromJSON a => Object -> Text -> Parser a
Data.Aeson.Types.FromJSON..: Text
"created")) Parser
  (Text
   -> Maybe Text
   -> Maybe PayoutDestination'Variants
   -> Maybe PayoutFailureBalanceTransaction'Variants
   -> Maybe Text
   -> Maybe Text
   -> Text
   -> Bool
   -> Maybe Object
   -> Text
   -> Maybe PayoutOriginalPayout'Variants
   -> Maybe PayoutReversedBy'Variants
   -> Text
   -> Maybe Text
   -> Text
   -> PayoutType'
   -> Payout)
-> Parser Text
-> Parser
     (Maybe Text
      -> Maybe PayoutDestination'Variants
      -> Maybe PayoutFailureBalanceTransaction'Variants
      -> Maybe Text
      -> Maybe Text
      -> Text
      -> Bool
      -> Maybe Object
      -> Text
      -> Maybe PayoutOriginalPayout'Variants
      -> Maybe PayoutReversedBy'Variants
      -> Text
      -> Maybe Text
      -> Text
      -> PayoutType'
      -> Payout)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Data.Aeson.Types.FromJSON..: Text
"currency")) Parser
  (Maybe Text
   -> Maybe PayoutDestination'Variants
   -> Maybe PayoutFailureBalanceTransaction'Variants
   -> Maybe Text
   -> Maybe Text
   -> Text
   -> Bool
   -> Maybe Object
   -> Text
   -> Maybe PayoutOriginalPayout'Variants
   -> Maybe PayoutReversedBy'Variants
   -> Text
   -> Maybe Text
   -> Text
   -> PayoutType'
   -> Payout)
-> Parser (Maybe Text)
-> Parser
     (Maybe PayoutDestination'Variants
      -> Maybe PayoutFailureBalanceTransaction'Variants
      -> Maybe Text
      -> Maybe Text
      -> Text
      -> Bool
      -> Maybe Object
      -> Text
      -> Maybe PayoutOriginalPayout'Variants
      -> Maybe PayoutReversedBy'Variants
      -> Text
      -> Maybe Text
      -> Text
      -> PayoutType'
      -> Payout)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Text
"description")) Parser
  (Maybe PayoutDestination'Variants
   -> Maybe PayoutFailureBalanceTransaction'Variants
   -> Maybe Text
   -> Maybe Text
   -> Text
   -> Bool
   -> Maybe Object
   -> Text
   -> Maybe PayoutOriginalPayout'Variants
   -> Maybe PayoutReversedBy'Variants
   -> Text
   -> Maybe Text
   -> Text
   -> PayoutType'
   -> Payout)
-> Parser (Maybe PayoutDestination'Variants)
-> Parser
     (Maybe PayoutFailureBalanceTransaction'Variants
      -> Maybe Text
      -> Maybe Text
      -> Text
      -> Bool
      -> Maybe Object
      -> Text
      -> Maybe PayoutOriginalPayout'Variants
      -> Maybe PayoutReversedBy'Variants
      -> Text
      -> Maybe Text
      -> Text
      -> PayoutType'
      -> Payout)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Text -> Parser (Maybe PayoutDestination'Variants)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Text
"destination")) Parser
  (Maybe PayoutFailureBalanceTransaction'Variants
   -> Maybe Text
   -> Maybe Text
   -> Text
   -> Bool
   -> Maybe Object
   -> Text
   -> Maybe PayoutOriginalPayout'Variants
   -> Maybe PayoutReversedBy'Variants
   -> Text
   -> Maybe Text
   -> Text
   -> PayoutType'
   -> Payout)
-> Parser (Maybe PayoutFailureBalanceTransaction'Variants)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Text
      -> Bool
      -> Maybe Object
      -> Text
      -> Maybe PayoutOriginalPayout'Variants
      -> Maybe PayoutReversedBy'Variants
      -> Text
      -> Maybe Text
      -> Text
      -> PayoutType'
      -> Payout)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object
-> Text -> Parser (Maybe PayoutFailureBalanceTransaction'Variants)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Text
"failure_balance_transaction")) Parser
  (Maybe Text
   -> Maybe Text
   -> Text
   -> Bool
   -> Maybe Object
   -> Text
   -> Maybe PayoutOriginalPayout'Variants
   -> Maybe PayoutReversedBy'Variants
   -> Text
   -> Maybe Text
   -> Text
   -> PayoutType'
   -> Payout)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Text
      -> Bool
      -> Maybe Object
      -> Text
      -> Maybe PayoutOriginalPayout'Variants
      -> Maybe PayoutReversedBy'Variants
      -> Text
      -> Maybe Text
      -> Text
      -> PayoutType'
      -> Payout)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Text
"failure_code")) Parser
  (Maybe Text
   -> Text
   -> Bool
   -> Maybe Object
   -> Text
   -> Maybe PayoutOriginalPayout'Variants
   -> Maybe PayoutReversedBy'Variants
   -> Text
   -> Maybe Text
   -> Text
   -> PayoutType'
   -> Payout)
-> Parser (Maybe Text)
-> Parser
     (Text
      -> Bool
      -> Maybe Object
      -> Text
      -> Maybe PayoutOriginalPayout'Variants
      -> Maybe PayoutReversedBy'Variants
      -> Text
      -> Maybe Text
      -> Text
      -> PayoutType'
      -> Payout)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Text
"failure_message")) Parser
  (Text
   -> Bool
   -> Maybe Object
   -> Text
   -> Maybe PayoutOriginalPayout'Variants
   -> Maybe PayoutReversedBy'Variants
   -> Text
   -> Maybe Text
   -> Text
   -> PayoutType'
   -> Payout)
-> Parser Text
-> Parser
     (Bool
      -> Maybe Object
      -> Text
      -> Maybe PayoutOriginalPayout'Variants
      -> Maybe PayoutReversedBy'Variants
      -> Text
      -> Maybe Text
      -> Text
      -> PayoutType'
      -> Payout)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Data.Aeson.Types.FromJSON..: Text
"id")) Parser
  (Bool
   -> Maybe Object
   -> Text
   -> Maybe PayoutOriginalPayout'Variants
   -> Maybe PayoutReversedBy'Variants
   -> Text
   -> Maybe Text
   -> Text
   -> PayoutType'
   -> Payout)
-> Parser Bool
-> Parser
     (Maybe Object
      -> Text
      -> Maybe PayoutOriginalPayout'Variants
      -> Maybe PayoutReversedBy'Variants
      -> Text
      -> Maybe Text
      -> Text
      -> PayoutType'
      -> Payout)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Text -> Parser Bool
forall a. FromJSON a => Object -> Text -> Parser a
Data.Aeson.Types.FromJSON..: Text
"livemode")) Parser
  (Maybe Object
   -> Text
   -> Maybe PayoutOriginalPayout'Variants
   -> Maybe PayoutReversedBy'Variants
   -> Text
   -> Maybe Text
   -> Text
   -> PayoutType'
   -> Payout)
-> Parser (Maybe Object)
-> Parser
     (Text
      -> Maybe PayoutOriginalPayout'Variants
      -> Maybe PayoutReversedBy'Variants
      -> Text
      -> Maybe Text
      -> Text
      -> PayoutType'
      -> Payout)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Text -> Parser (Maybe Object)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Text
"metadata")) Parser
  (Text
   -> Maybe PayoutOriginalPayout'Variants
   -> Maybe PayoutReversedBy'Variants
   -> Text
   -> Maybe Text
   -> Text
   -> PayoutType'
   -> Payout)
-> Parser Text
-> Parser
     (Maybe PayoutOriginalPayout'Variants
      -> Maybe PayoutReversedBy'Variants
      -> Text
      -> Maybe Text
      -> Text
      -> PayoutType'
      -> Payout)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Data.Aeson.Types.FromJSON..: Text
"method")) Parser
  (Maybe PayoutOriginalPayout'Variants
   -> Maybe PayoutReversedBy'Variants
   -> Text
   -> Maybe Text
   -> Text
   -> PayoutType'
   -> Payout)
-> Parser (Maybe PayoutOriginalPayout'Variants)
-> Parser
     (Maybe PayoutReversedBy'Variants
      -> Text -> Maybe Text -> Text -> PayoutType' -> Payout)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Text -> Parser (Maybe PayoutOriginalPayout'Variants)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Text
"original_payout")) Parser
  (Maybe PayoutReversedBy'Variants
   -> Text -> Maybe Text -> Text -> PayoutType' -> Payout)
-> Parser (Maybe PayoutReversedBy'Variants)
-> Parser (Text -> Maybe Text -> Text -> PayoutType' -> Payout)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Text -> Parser (Maybe PayoutReversedBy'Variants)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Text
"reversed_by")) Parser (Text -> Maybe Text -> Text -> PayoutType' -> Payout)
-> Parser Text
-> Parser (Maybe Text -> Text -> PayoutType' -> Payout)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Data.Aeson.Types.FromJSON..: Text
"source_type")) Parser (Maybe Text -> Text -> PayoutType' -> Payout)
-> Parser (Maybe Text) -> Parser (Text -> PayoutType' -> Payout)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Text
"statement_descriptor")) Parser (Text -> PayoutType' -> Payout)
-> Parser Text -> Parser (PayoutType' -> Payout)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Data.Aeson.Types.FromJSON..: Text
"status")) Parser (PayoutType' -> Payout)
-> Parser PayoutType' -> Parser Payout
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Text -> Parser PayoutType'
forall a. FromJSON a => Object -> Text -> Parser a
Data.Aeson.Types.FromJSON..: Text
"type"))

-- | Create a new 'Payout' with all required fields.
mkPayout ::
  -- | 'payoutAmount'
  GHC.Types.Int ->
  -- | 'payoutArrivalDate'
  GHC.Types.Int ->
  -- | 'payoutAutomatic'
  GHC.Types.Bool ->
  -- | 'payoutCreated'
  GHC.Types.Int ->
  -- | 'payoutCurrency'
  Data.Text.Internal.Text ->
  -- | 'payoutId'
  Data.Text.Internal.Text ->
  -- | 'payoutLivemode'
  GHC.Types.Bool ->
  -- | 'payoutMethod'
  Data.Text.Internal.Text ->
  -- | 'payoutSourceType'
  Data.Text.Internal.Text ->
  -- | 'payoutStatus'
  Data.Text.Internal.Text ->
  -- | 'payoutType'
  PayoutType' ->
  Payout
mkPayout :: Int
-> Int
-> Bool
-> Int
-> Text
-> Text
-> Bool
-> Text
-> Text
-> Text
-> PayoutType'
-> Payout
mkPayout Int
payoutAmount Int
payoutArrivalDate Bool
payoutAutomatic Int
payoutCreated Text
payoutCurrency Text
payoutId Bool
payoutLivemode Text
payoutMethod Text
payoutSourceType Text
payoutStatus PayoutType'
payoutType =
  Payout :: Int
-> Int
-> Bool
-> Maybe PayoutBalanceTransaction'Variants
-> Int
-> Text
-> Maybe Text
-> Maybe PayoutDestination'Variants
-> Maybe PayoutFailureBalanceTransaction'Variants
-> Maybe Text
-> Maybe Text
-> Text
-> Bool
-> Maybe Object
-> Text
-> Maybe PayoutOriginalPayout'Variants
-> Maybe PayoutReversedBy'Variants
-> Text
-> Maybe Text
-> Text
-> PayoutType'
-> Payout
Payout
    { payoutAmount :: Int
payoutAmount = Int
payoutAmount,
      payoutArrivalDate :: Int
payoutArrivalDate = Int
payoutArrivalDate,
      payoutAutomatic :: Bool
payoutAutomatic = Bool
payoutAutomatic,
      payoutBalanceTransaction :: Maybe PayoutBalanceTransaction'Variants
payoutBalanceTransaction = Maybe PayoutBalanceTransaction'Variants
forall a. Maybe a
GHC.Maybe.Nothing,
      payoutCreated :: Int
payoutCreated = Int
payoutCreated,
      payoutCurrency :: Text
payoutCurrency = Text
payoutCurrency,
      payoutDescription :: Maybe Text
payoutDescription = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing,
      payoutDestination :: Maybe PayoutDestination'Variants
payoutDestination = Maybe PayoutDestination'Variants
forall a. Maybe a
GHC.Maybe.Nothing,
      payoutFailureBalanceTransaction :: Maybe PayoutFailureBalanceTransaction'Variants
payoutFailureBalanceTransaction = Maybe PayoutFailureBalanceTransaction'Variants
forall a. Maybe a
GHC.Maybe.Nothing,
      payoutFailureCode :: Maybe Text
payoutFailureCode = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing,
      payoutFailureMessage :: Maybe Text
payoutFailureMessage = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing,
      payoutId :: Text
payoutId = Text
payoutId,
      payoutLivemode :: Bool
payoutLivemode = Bool
payoutLivemode,
      payoutMetadata :: Maybe Object
payoutMetadata = Maybe Object
forall a. Maybe a
GHC.Maybe.Nothing,
      payoutMethod :: Text
payoutMethod = Text
payoutMethod,
      payoutOriginalPayout :: Maybe PayoutOriginalPayout'Variants
payoutOriginalPayout = Maybe PayoutOriginalPayout'Variants
forall a. Maybe a
GHC.Maybe.Nothing,
      payoutReversedBy :: Maybe PayoutReversedBy'Variants
payoutReversedBy = Maybe PayoutReversedBy'Variants
forall a. Maybe a
GHC.Maybe.Nothing,
      payoutSourceType :: Text
payoutSourceType = Text
payoutSourceType,
      payoutStatementDescriptor :: Maybe Text
payoutStatementDescriptor = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing,
      payoutStatus :: Text
payoutStatus = Text
payoutStatus,
      payoutType :: PayoutType'
payoutType = PayoutType'
payoutType
    }

-- | Defines the oneOf schema located at @components.schemas.payout.properties.balance_transaction.anyOf@ in the specification.
--
-- ID of the balance transaction that describes the impact of this payout on your account balance.
data PayoutBalanceTransaction'Variants
  = PayoutBalanceTransaction'Text Data.Text.Internal.Text
  | PayoutBalanceTransaction'BalanceTransaction BalanceTransaction
  deriving (Int -> PayoutBalanceTransaction'Variants -> ShowS
[PayoutBalanceTransaction'Variants] -> ShowS
PayoutBalanceTransaction'Variants -> String
(Int -> PayoutBalanceTransaction'Variants -> ShowS)
-> (PayoutBalanceTransaction'Variants -> String)
-> ([PayoutBalanceTransaction'Variants] -> ShowS)
-> Show PayoutBalanceTransaction'Variants
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PayoutBalanceTransaction'Variants] -> ShowS
$cshowList :: [PayoutBalanceTransaction'Variants] -> ShowS
show :: PayoutBalanceTransaction'Variants -> String
$cshow :: PayoutBalanceTransaction'Variants -> String
showsPrec :: Int -> PayoutBalanceTransaction'Variants -> ShowS
$cshowsPrec :: Int -> PayoutBalanceTransaction'Variants -> ShowS
GHC.Show.Show, PayoutBalanceTransaction'Variants
-> PayoutBalanceTransaction'Variants -> Bool
(PayoutBalanceTransaction'Variants
 -> PayoutBalanceTransaction'Variants -> Bool)
-> (PayoutBalanceTransaction'Variants
    -> PayoutBalanceTransaction'Variants -> Bool)
-> Eq PayoutBalanceTransaction'Variants
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PayoutBalanceTransaction'Variants
-> PayoutBalanceTransaction'Variants -> Bool
$c/= :: PayoutBalanceTransaction'Variants
-> PayoutBalanceTransaction'Variants -> Bool
== :: PayoutBalanceTransaction'Variants
-> PayoutBalanceTransaction'Variants -> Bool
$c== :: PayoutBalanceTransaction'Variants
-> PayoutBalanceTransaction'Variants -> Bool
GHC.Classes.Eq)

instance Data.Aeson.Types.ToJSON.ToJSON PayoutBalanceTransaction'Variants where
  toJSON :: PayoutBalanceTransaction'Variants -> Value
toJSON (PayoutBalanceTransaction'Text Text
a) = Text -> Value
forall a. ToJSON a => a -> Value
Data.Aeson.Types.ToJSON.toJSON Text
a
  toJSON (PayoutBalanceTransaction'BalanceTransaction BalanceTransaction
a) = BalanceTransaction -> Value
forall a. ToJSON a => a -> Value
Data.Aeson.Types.ToJSON.toJSON BalanceTransaction
a

instance Data.Aeson.Types.FromJSON.FromJSON PayoutBalanceTransaction'Variants where
  parseJSON :: Value -> Parser PayoutBalanceTransaction'Variants
parseJSON Value
val = case (Text -> PayoutBalanceTransaction'Variants
PayoutBalanceTransaction'Text (Text -> PayoutBalanceTransaction'Variants)
-> Result Text -> Result PayoutBalanceTransaction'Variants
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Data.Functor.<$> Value -> Result Text
forall a. FromJSON a => Value -> Result a
Data.Aeson.Types.FromJSON.fromJSON Value
val) Result PayoutBalanceTransaction'Variants
-> Result PayoutBalanceTransaction'Variants
-> Result PayoutBalanceTransaction'Variants
forall (f :: * -> *) a. Alternative f => f a -> f a -> f a
GHC.Base.<|> ((BalanceTransaction -> PayoutBalanceTransaction'Variants
PayoutBalanceTransaction'BalanceTransaction (BalanceTransaction -> PayoutBalanceTransaction'Variants)
-> Result BalanceTransaction
-> Result PayoutBalanceTransaction'Variants
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Data.Functor.<$> Value -> Result BalanceTransaction
forall a. FromJSON a => Value -> Result a
Data.Aeson.Types.FromJSON.fromJSON Value
val) Result PayoutBalanceTransaction'Variants
-> Result PayoutBalanceTransaction'Variants
-> Result PayoutBalanceTransaction'Variants
forall (f :: * -> *) a. Alternative f => f a -> f a -> f a
GHC.Base.<|> String -> Result PayoutBalanceTransaction'Variants
forall a. String -> Result a
Data.Aeson.Types.Internal.Error String
"No variant matched") of
    Data.Aeson.Types.Internal.Success PayoutBalanceTransaction'Variants
a -> PayoutBalanceTransaction'Variants
-> Parser PayoutBalanceTransaction'Variants
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure PayoutBalanceTransaction'Variants
a
    Data.Aeson.Types.Internal.Error String
a -> String -> Parser PayoutBalanceTransaction'Variants
forall (m :: * -> *) a. MonadFail m => String -> m a
Control.Monad.Fail.fail String
a

-- | Defines the oneOf schema located at @components.schemas.payout.properties.destination.anyOf@ in the specification.
--
-- ID of the bank account or card the payout was sent to.
data PayoutDestination'Variants
  = PayoutDestination'Text Data.Text.Internal.Text
  | PayoutDestination'BankAccount BankAccount
  | PayoutDestination'Card Card
  | PayoutDestination'DeletedBankAccount DeletedBankAccount
  | PayoutDestination'DeletedCard DeletedCard
  deriving (Int -> PayoutDestination'Variants -> ShowS
[PayoutDestination'Variants] -> ShowS
PayoutDestination'Variants -> String
(Int -> PayoutDestination'Variants -> ShowS)
-> (PayoutDestination'Variants -> String)
-> ([PayoutDestination'Variants] -> ShowS)
-> Show PayoutDestination'Variants
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PayoutDestination'Variants] -> ShowS
$cshowList :: [PayoutDestination'Variants] -> ShowS
show :: PayoutDestination'Variants -> String
$cshow :: PayoutDestination'Variants -> String
showsPrec :: Int -> PayoutDestination'Variants -> ShowS
$cshowsPrec :: Int -> PayoutDestination'Variants -> ShowS
GHC.Show.Show, PayoutDestination'Variants -> PayoutDestination'Variants -> Bool
(PayoutDestination'Variants -> PayoutDestination'Variants -> Bool)
-> (PayoutDestination'Variants
    -> PayoutDestination'Variants -> Bool)
-> Eq PayoutDestination'Variants
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PayoutDestination'Variants -> PayoutDestination'Variants -> Bool
$c/= :: PayoutDestination'Variants -> PayoutDestination'Variants -> Bool
== :: PayoutDestination'Variants -> PayoutDestination'Variants -> Bool
$c== :: PayoutDestination'Variants -> PayoutDestination'Variants -> Bool
GHC.Classes.Eq)

instance Data.Aeson.Types.ToJSON.ToJSON PayoutDestination'Variants where
  toJSON :: PayoutDestination'Variants -> Value
toJSON (PayoutDestination'Text Text
a) = Text -> Value
forall a. ToJSON a => a -> Value
Data.Aeson.Types.ToJSON.toJSON Text
a
  toJSON (PayoutDestination'BankAccount BankAccount
a) = BankAccount -> Value
forall a. ToJSON a => a -> Value
Data.Aeson.Types.ToJSON.toJSON BankAccount
a
  toJSON (PayoutDestination'Card Card
a) = Card -> Value
forall a. ToJSON a => a -> Value
Data.Aeson.Types.ToJSON.toJSON Card
a
  toJSON (PayoutDestination'DeletedBankAccount DeletedBankAccount
a) = DeletedBankAccount -> Value
forall a. ToJSON a => a -> Value
Data.Aeson.Types.ToJSON.toJSON DeletedBankAccount
a
  toJSON (PayoutDestination'DeletedCard DeletedCard
a) = DeletedCard -> Value
forall a. ToJSON a => a -> Value
Data.Aeson.Types.ToJSON.toJSON DeletedCard
a

instance Data.Aeson.Types.FromJSON.FromJSON PayoutDestination'Variants where
  parseJSON :: Value -> Parser PayoutDestination'Variants
parseJSON Value
val = case (Text -> PayoutDestination'Variants
PayoutDestination'Text (Text -> PayoutDestination'Variants)
-> Result Text -> Result PayoutDestination'Variants
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Data.Functor.<$> Value -> Result Text
forall a. FromJSON a => Value -> Result a
Data.Aeson.Types.FromJSON.fromJSON Value
val) Result PayoutDestination'Variants
-> Result PayoutDestination'Variants
-> Result PayoutDestination'Variants
forall (f :: * -> *) a. Alternative f => f a -> f a -> f a
GHC.Base.<|> ((BankAccount -> PayoutDestination'Variants
PayoutDestination'BankAccount (BankAccount -> PayoutDestination'Variants)
-> Result BankAccount -> Result PayoutDestination'Variants
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Data.Functor.<$> Value -> Result BankAccount
forall a. FromJSON a => Value -> Result a
Data.Aeson.Types.FromJSON.fromJSON Value
val) Result PayoutDestination'Variants
-> Result PayoutDestination'Variants
-> Result PayoutDestination'Variants
forall (f :: * -> *) a. Alternative f => f a -> f a -> f a
GHC.Base.<|> ((Card -> PayoutDestination'Variants
PayoutDestination'Card (Card -> PayoutDestination'Variants)
-> Result Card -> Result PayoutDestination'Variants
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Data.Functor.<$> Value -> Result Card
forall a. FromJSON a => Value -> Result a
Data.Aeson.Types.FromJSON.fromJSON Value
val) Result PayoutDestination'Variants
-> Result PayoutDestination'Variants
-> Result PayoutDestination'Variants
forall (f :: * -> *) a. Alternative f => f a -> f a -> f a
GHC.Base.<|> ((DeletedBankAccount -> PayoutDestination'Variants
PayoutDestination'DeletedBankAccount (DeletedBankAccount -> PayoutDestination'Variants)
-> Result DeletedBankAccount -> Result PayoutDestination'Variants
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Data.Functor.<$> Value -> Result DeletedBankAccount
forall a. FromJSON a => Value -> Result a
Data.Aeson.Types.FromJSON.fromJSON Value
val) Result PayoutDestination'Variants
-> Result PayoutDestination'Variants
-> Result PayoutDestination'Variants
forall (f :: * -> *) a. Alternative f => f a -> f a -> f a
GHC.Base.<|> ((DeletedCard -> PayoutDestination'Variants
PayoutDestination'DeletedCard (DeletedCard -> PayoutDestination'Variants)
-> Result DeletedCard -> Result PayoutDestination'Variants
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Data.Functor.<$> Value -> Result DeletedCard
forall a. FromJSON a => Value -> Result a
Data.Aeson.Types.FromJSON.fromJSON Value
val) Result PayoutDestination'Variants
-> Result PayoutDestination'Variants
-> Result PayoutDestination'Variants
forall (f :: * -> *) a. Alternative f => f a -> f a -> f a
GHC.Base.<|> String -> Result PayoutDestination'Variants
forall a. String -> Result a
Data.Aeson.Types.Internal.Error String
"No variant matched")))) of
    Data.Aeson.Types.Internal.Success PayoutDestination'Variants
a -> PayoutDestination'Variants -> Parser PayoutDestination'Variants
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure PayoutDestination'Variants
a
    Data.Aeson.Types.Internal.Error String
a -> String -> Parser PayoutDestination'Variants
forall (m :: * -> *) a. MonadFail m => String -> m a
Control.Monad.Fail.fail String
a

-- | Defines the oneOf schema located at @components.schemas.payout.properties.failure_balance_transaction.anyOf@ in the specification.
--
-- If the payout failed or was canceled, this will be the ID of the balance transaction that reversed the initial balance transaction, and puts the funds from the failed payout back in your balance.
data PayoutFailureBalanceTransaction'Variants
  = PayoutFailureBalanceTransaction'Text Data.Text.Internal.Text
  | PayoutFailureBalanceTransaction'BalanceTransaction BalanceTransaction
  deriving (Int -> PayoutFailureBalanceTransaction'Variants -> ShowS
[PayoutFailureBalanceTransaction'Variants] -> ShowS
PayoutFailureBalanceTransaction'Variants -> String
(Int -> PayoutFailureBalanceTransaction'Variants -> ShowS)
-> (PayoutFailureBalanceTransaction'Variants -> String)
-> ([PayoutFailureBalanceTransaction'Variants] -> ShowS)
-> Show PayoutFailureBalanceTransaction'Variants
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PayoutFailureBalanceTransaction'Variants] -> ShowS
$cshowList :: [PayoutFailureBalanceTransaction'Variants] -> ShowS
show :: PayoutFailureBalanceTransaction'Variants -> String
$cshow :: PayoutFailureBalanceTransaction'Variants -> String
showsPrec :: Int -> PayoutFailureBalanceTransaction'Variants -> ShowS
$cshowsPrec :: Int -> PayoutFailureBalanceTransaction'Variants -> ShowS
GHC.Show.Show, PayoutFailureBalanceTransaction'Variants
-> PayoutFailureBalanceTransaction'Variants -> Bool
(PayoutFailureBalanceTransaction'Variants
 -> PayoutFailureBalanceTransaction'Variants -> Bool)
-> (PayoutFailureBalanceTransaction'Variants
    -> PayoutFailureBalanceTransaction'Variants -> Bool)
-> Eq PayoutFailureBalanceTransaction'Variants
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PayoutFailureBalanceTransaction'Variants
-> PayoutFailureBalanceTransaction'Variants -> Bool
$c/= :: PayoutFailureBalanceTransaction'Variants
-> PayoutFailureBalanceTransaction'Variants -> Bool
== :: PayoutFailureBalanceTransaction'Variants
-> PayoutFailureBalanceTransaction'Variants -> Bool
$c== :: PayoutFailureBalanceTransaction'Variants
-> PayoutFailureBalanceTransaction'Variants -> Bool
GHC.Classes.Eq)

instance Data.Aeson.Types.ToJSON.ToJSON PayoutFailureBalanceTransaction'Variants where
  toJSON :: PayoutFailureBalanceTransaction'Variants -> Value
toJSON (PayoutFailureBalanceTransaction'Text Text
a) = Text -> Value
forall a. ToJSON a => a -> Value
Data.Aeson.Types.ToJSON.toJSON Text
a
  toJSON (PayoutFailureBalanceTransaction'BalanceTransaction BalanceTransaction
a) = BalanceTransaction -> Value
forall a. ToJSON a => a -> Value
Data.Aeson.Types.ToJSON.toJSON BalanceTransaction
a

instance Data.Aeson.Types.FromJSON.FromJSON PayoutFailureBalanceTransaction'Variants where
  parseJSON :: Value -> Parser PayoutFailureBalanceTransaction'Variants
parseJSON Value
val = case (Text -> PayoutFailureBalanceTransaction'Variants
PayoutFailureBalanceTransaction'Text (Text -> PayoutFailureBalanceTransaction'Variants)
-> Result Text -> Result PayoutFailureBalanceTransaction'Variants
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Data.Functor.<$> Value -> Result Text
forall a. FromJSON a => Value -> Result a
Data.Aeson.Types.FromJSON.fromJSON Value
val) Result PayoutFailureBalanceTransaction'Variants
-> Result PayoutFailureBalanceTransaction'Variants
-> Result PayoutFailureBalanceTransaction'Variants
forall (f :: * -> *) a. Alternative f => f a -> f a -> f a
GHC.Base.<|> ((BalanceTransaction -> PayoutFailureBalanceTransaction'Variants
PayoutFailureBalanceTransaction'BalanceTransaction (BalanceTransaction -> PayoutFailureBalanceTransaction'Variants)
-> Result BalanceTransaction
-> Result PayoutFailureBalanceTransaction'Variants
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Data.Functor.<$> Value -> Result BalanceTransaction
forall a. FromJSON a => Value -> Result a
Data.Aeson.Types.FromJSON.fromJSON Value
val) Result PayoutFailureBalanceTransaction'Variants
-> Result PayoutFailureBalanceTransaction'Variants
-> Result PayoutFailureBalanceTransaction'Variants
forall (f :: * -> *) a. Alternative f => f a -> f a -> f a
GHC.Base.<|> String -> Result PayoutFailureBalanceTransaction'Variants
forall a. String -> Result a
Data.Aeson.Types.Internal.Error String
"No variant matched") of
    Data.Aeson.Types.Internal.Success PayoutFailureBalanceTransaction'Variants
a -> PayoutFailureBalanceTransaction'Variants
-> Parser PayoutFailureBalanceTransaction'Variants
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure PayoutFailureBalanceTransaction'Variants
a
    Data.Aeson.Types.Internal.Error String
a -> String -> Parser PayoutFailureBalanceTransaction'Variants
forall (m :: * -> *) a. MonadFail m => String -> m a
Control.Monad.Fail.fail String
a

-- | Defines the oneOf schema located at @components.schemas.payout.properties.original_payout.anyOf@ in the specification.
--
-- If the payout reverses another, this is the ID of the original payout.
data PayoutOriginalPayout'Variants
  = PayoutOriginalPayout'Text Data.Text.Internal.Text
  | PayoutOriginalPayout'Payout Payout
  deriving (Int -> PayoutOriginalPayout'Variants -> ShowS
[PayoutOriginalPayout'Variants] -> ShowS
PayoutOriginalPayout'Variants -> String
(Int -> PayoutOriginalPayout'Variants -> ShowS)
-> (PayoutOriginalPayout'Variants -> String)
-> ([PayoutOriginalPayout'Variants] -> ShowS)
-> Show PayoutOriginalPayout'Variants
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PayoutOriginalPayout'Variants] -> ShowS
$cshowList :: [PayoutOriginalPayout'Variants] -> ShowS
show :: PayoutOriginalPayout'Variants -> String
$cshow :: PayoutOriginalPayout'Variants -> String
showsPrec :: Int -> PayoutOriginalPayout'Variants -> ShowS
$cshowsPrec :: Int -> PayoutOriginalPayout'Variants -> ShowS
GHC.Show.Show, PayoutOriginalPayout'Variants
-> PayoutOriginalPayout'Variants -> Bool
(PayoutOriginalPayout'Variants
 -> PayoutOriginalPayout'Variants -> Bool)
-> (PayoutOriginalPayout'Variants
    -> PayoutOriginalPayout'Variants -> Bool)
-> Eq PayoutOriginalPayout'Variants
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PayoutOriginalPayout'Variants
-> PayoutOriginalPayout'Variants -> Bool
$c/= :: PayoutOriginalPayout'Variants
-> PayoutOriginalPayout'Variants -> Bool
== :: PayoutOriginalPayout'Variants
-> PayoutOriginalPayout'Variants -> Bool
$c== :: PayoutOriginalPayout'Variants
-> PayoutOriginalPayout'Variants -> Bool
GHC.Classes.Eq)

instance Data.Aeson.Types.ToJSON.ToJSON PayoutOriginalPayout'Variants where
  toJSON :: PayoutOriginalPayout'Variants -> Value
toJSON (PayoutOriginalPayout'Text Text
a) = Text -> Value
forall a. ToJSON a => a -> Value
Data.Aeson.Types.ToJSON.toJSON Text
a
  toJSON (PayoutOriginalPayout'Payout Payout
a) = Payout -> Value
forall a. ToJSON a => a -> Value
Data.Aeson.Types.ToJSON.toJSON Payout
a

instance Data.Aeson.Types.FromJSON.FromJSON PayoutOriginalPayout'Variants where
  parseJSON :: Value -> Parser PayoutOriginalPayout'Variants
parseJSON Value
val = case (Text -> PayoutOriginalPayout'Variants
PayoutOriginalPayout'Text (Text -> PayoutOriginalPayout'Variants)
-> Result Text -> Result PayoutOriginalPayout'Variants
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Data.Functor.<$> Value -> Result Text
forall a. FromJSON a => Value -> Result a
Data.Aeson.Types.FromJSON.fromJSON Value
val) Result PayoutOriginalPayout'Variants
-> Result PayoutOriginalPayout'Variants
-> Result PayoutOriginalPayout'Variants
forall (f :: * -> *) a. Alternative f => f a -> f a -> f a
GHC.Base.<|> ((Payout -> PayoutOriginalPayout'Variants
PayoutOriginalPayout'Payout (Payout -> PayoutOriginalPayout'Variants)
-> Result Payout -> Result PayoutOriginalPayout'Variants
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Data.Functor.<$> Value -> Result Payout
forall a. FromJSON a => Value -> Result a
Data.Aeson.Types.FromJSON.fromJSON Value
val) Result PayoutOriginalPayout'Variants
-> Result PayoutOriginalPayout'Variants
-> Result PayoutOriginalPayout'Variants
forall (f :: * -> *) a. Alternative f => f a -> f a -> f a
GHC.Base.<|> String -> Result PayoutOriginalPayout'Variants
forall a. String -> Result a
Data.Aeson.Types.Internal.Error String
"No variant matched") of
    Data.Aeson.Types.Internal.Success PayoutOriginalPayout'Variants
a -> PayoutOriginalPayout'Variants
-> Parser PayoutOriginalPayout'Variants
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure PayoutOriginalPayout'Variants
a
    Data.Aeson.Types.Internal.Error String
a -> String -> Parser PayoutOriginalPayout'Variants
forall (m :: * -> *) a. MonadFail m => String -> m a
Control.Monad.Fail.fail String
a

-- | Defines the oneOf schema located at @components.schemas.payout.properties.reversed_by.anyOf@ in the specification.
--
-- If the payout was reversed, this is the ID of the payout that reverses this payout.
data PayoutReversedBy'Variants
  = PayoutReversedBy'Text Data.Text.Internal.Text
  | PayoutReversedBy'Payout Payout
  deriving (Int -> PayoutReversedBy'Variants -> ShowS
[PayoutReversedBy'Variants] -> ShowS
PayoutReversedBy'Variants -> String
(Int -> PayoutReversedBy'Variants -> ShowS)
-> (PayoutReversedBy'Variants -> String)
-> ([PayoutReversedBy'Variants] -> ShowS)
-> Show PayoutReversedBy'Variants
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PayoutReversedBy'Variants] -> ShowS
$cshowList :: [PayoutReversedBy'Variants] -> ShowS
show :: PayoutReversedBy'Variants -> String
$cshow :: PayoutReversedBy'Variants -> String
showsPrec :: Int -> PayoutReversedBy'Variants -> ShowS
$cshowsPrec :: Int -> PayoutReversedBy'Variants -> ShowS
GHC.Show.Show, PayoutReversedBy'Variants -> PayoutReversedBy'Variants -> Bool
(PayoutReversedBy'Variants -> PayoutReversedBy'Variants -> Bool)
-> (PayoutReversedBy'Variants -> PayoutReversedBy'Variants -> Bool)
-> Eq PayoutReversedBy'Variants
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PayoutReversedBy'Variants -> PayoutReversedBy'Variants -> Bool
$c/= :: PayoutReversedBy'Variants -> PayoutReversedBy'Variants -> Bool
== :: PayoutReversedBy'Variants -> PayoutReversedBy'Variants -> Bool
$c== :: PayoutReversedBy'Variants -> PayoutReversedBy'Variants -> Bool
GHC.Classes.Eq)

instance Data.Aeson.Types.ToJSON.ToJSON PayoutReversedBy'Variants where
  toJSON :: PayoutReversedBy'Variants -> Value
toJSON (PayoutReversedBy'Text Text
a) = Text -> Value
forall a. ToJSON a => a -> Value
Data.Aeson.Types.ToJSON.toJSON Text
a
  toJSON (PayoutReversedBy'Payout Payout
a) = Payout -> Value
forall a. ToJSON a => a -> Value
Data.Aeson.Types.ToJSON.toJSON Payout
a

instance Data.Aeson.Types.FromJSON.FromJSON PayoutReversedBy'Variants where
  parseJSON :: Value -> Parser PayoutReversedBy'Variants
parseJSON Value
val = case (Text -> PayoutReversedBy'Variants
PayoutReversedBy'Text (Text -> PayoutReversedBy'Variants)
-> Result Text -> Result PayoutReversedBy'Variants
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Data.Functor.<$> Value -> Result Text
forall a. FromJSON a => Value -> Result a
Data.Aeson.Types.FromJSON.fromJSON Value
val) Result PayoutReversedBy'Variants
-> Result PayoutReversedBy'Variants
-> Result PayoutReversedBy'Variants
forall (f :: * -> *) a. Alternative f => f a -> f a -> f a
GHC.Base.<|> ((Payout -> PayoutReversedBy'Variants
PayoutReversedBy'Payout (Payout -> PayoutReversedBy'Variants)
-> Result Payout -> Result PayoutReversedBy'Variants
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Data.Functor.<$> Value -> Result Payout
forall a. FromJSON a => Value -> Result a
Data.Aeson.Types.FromJSON.fromJSON Value
val) Result PayoutReversedBy'Variants
-> Result PayoutReversedBy'Variants
-> Result PayoutReversedBy'Variants
forall (f :: * -> *) a. Alternative f => f a -> f a -> f a
GHC.Base.<|> String -> Result PayoutReversedBy'Variants
forall a. String -> Result a
Data.Aeson.Types.Internal.Error String
"No variant matched") of
    Data.Aeson.Types.Internal.Success PayoutReversedBy'Variants
a -> PayoutReversedBy'Variants -> Parser PayoutReversedBy'Variants
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure PayoutReversedBy'Variants
a
    Data.Aeson.Types.Internal.Error String
a -> String -> Parser PayoutReversedBy'Variants
forall (m :: * -> *) a. MonadFail m => String -> m a
Control.Monad.Fail.fail String
a

-- | Defines the enum schema located at @components.schemas.payout.properties.type@ in the specification.
--
-- Can be \`bank_account\` or \`card\`.
data PayoutType'
  = -- | This case is used if the value encountered during decoding does not match any of the provided cases in the specification.
    PayoutType'Other Data.Aeson.Types.Internal.Value
  | -- | This constructor can be used to send values to the server which are not present in the specification yet.
    PayoutType'Typed Data.Text.Internal.Text
  | -- | Represents the JSON value @"bank_account"@
    PayoutType'EnumBankAccount
  | -- | Represents the JSON value @"card"@
    PayoutType'EnumCard
  deriving (Int -> PayoutType' -> ShowS
[PayoutType'] -> ShowS
PayoutType' -> String
(Int -> PayoutType' -> ShowS)
-> (PayoutType' -> String)
-> ([PayoutType'] -> ShowS)
-> Show PayoutType'
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PayoutType'] -> ShowS
$cshowList :: [PayoutType'] -> ShowS
show :: PayoutType' -> String
$cshow :: PayoutType' -> String
showsPrec :: Int -> PayoutType' -> ShowS
$cshowsPrec :: Int -> PayoutType' -> ShowS
GHC.Show.Show, PayoutType' -> PayoutType' -> Bool
(PayoutType' -> PayoutType' -> Bool)
-> (PayoutType' -> PayoutType' -> Bool) -> Eq PayoutType'
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PayoutType' -> PayoutType' -> Bool
$c/= :: PayoutType' -> PayoutType' -> Bool
== :: PayoutType' -> PayoutType' -> Bool
$c== :: PayoutType' -> PayoutType' -> Bool
GHC.Classes.Eq)

instance Data.Aeson.Types.ToJSON.ToJSON PayoutType' where
  toJSON :: PayoutType' -> Value
toJSON (PayoutType'Other Value
val) = Value
val
  toJSON (PayoutType'Typed Text
val) = Text -> Value
forall a. ToJSON a => a -> Value
Data.Aeson.Types.ToJSON.toJSON Text
val
  toJSON (PayoutType'
PayoutType'EnumBankAccount) = Value
"bank_account"
  toJSON (PayoutType'
PayoutType'EnumCard) = Value
"card"

instance Data.Aeson.Types.FromJSON.FromJSON PayoutType' where
  parseJSON :: Value -> Parser PayoutType'
parseJSON Value
val =
    PayoutType' -> Parser PayoutType'
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
"bank_account" -> PayoutType'
PayoutType'EnumBankAccount
            | Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"card" -> PayoutType'
PayoutType'EnumCard
            | Bool
GHC.Base.otherwise -> Value -> PayoutType'
PayoutType'Other Value
val
      )