{-# 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 Recipient
module StripeAPI.Types.Recipient 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.Account
import {-# SOURCE #-} StripeAPI.Types.BankAccount
import {-# SOURCE #-} StripeAPI.Types.Card
import {-# SOURCE #-} StripeAPI.Types.Customer
import {-# SOURCE #-} StripeAPI.Types.DeletedCustomer
import qualified Prelude as GHC.Integer.Type
import qualified Prelude as GHC.Maybe

-- | Defines the object schema located at @components.schemas.recipient@ in the specification.
--
-- With \`Recipient\` objects, you can transfer money from your Stripe account to a
-- third-party bank account or debit card. The API allows you to create, delete,
-- and update your recipients. You can retrieve individual recipients as well as
-- a list of all your recipients.
--
-- **\`Recipient\` objects have been deprecated in favor of
-- [Connect](https:\/\/stripe.com\/docs\/connect), specifically Connect\'s much more powerful
-- [Account objects](https:\/\/stripe.com\/docs\/api\#account). Stripe accounts that don\'t already use
-- recipients can no longer begin doing so. Please use \`Account\` objects
-- instead.**
data Recipient = Recipient
  { -- | active_account: Hash describing the current account on the recipient, if there is one.
    Recipient -> Maybe RecipientActiveAccount'
recipientActiveAccount :: (GHC.Maybe.Maybe RecipientActiveAccount'),
    -- | cards:
    Recipient -> Maybe RecipientCards'
recipientCards :: (GHC.Maybe.Maybe RecipientCards'),
    -- | created: Time at which the object was created. Measured in seconds since the Unix epoch.
    Recipient -> Int
recipientCreated :: GHC.Types.Int,
    -- | default_card: The default card to use for creating transfers to this recipient.
    Recipient -> Maybe RecipientDefaultCard'Variants
recipientDefaultCard :: (GHC.Maybe.Maybe RecipientDefaultCard'Variants),
    -- | description: An arbitrary string attached to the object. Often useful for displaying to users.
    --
    -- Constraints:
    --
    -- * Maximum length of 5000
    Recipient -> Maybe Text
recipientDescription :: (GHC.Maybe.Maybe Data.Text.Internal.Text),
    -- | email
    --
    -- Constraints:
    --
    -- * Maximum length of 5000
    Recipient -> Maybe Text
recipientEmail :: (GHC.Maybe.Maybe Data.Text.Internal.Text),
    -- | id: Unique identifier for the object.
    --
    -- Constraints:
    --
    -- * Maximum length of 5000
    Recipient -> Text
recipientId :: 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.
    Recipient -> Bool
recipientLivemode :: 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.
    Recipient -> Object
recipientMetadata :: Data.Aeson.Types.Internal.Object,
    -- | migrated_to: The ID of the [Custom account](https:\/\/stripe.com\/docs\/connect\/custom-accounts) this recipient was migrated to. If set, the recipient can no longer be updated, nor can transfers be made to it: use the Custom account instead.
    Recipient -> Maybe RecipientMigratedTo'Variants
recipientMigratedTo :: (GHC.Maybe.Maybe RecipientMigratedTo'Variants),
    -- | name: Full, legal name of the recipient.
    --
    -- Constraints:
    --
    -- * Maximum length of 5000
    Recipient -> Maybe Text
recipientName :: (GHC.Maybe.Maybe Data.Text.Internal.Text),
    -- | rolled_back_from
    Recipient -> Maybe RecipientRolledBackFrom'Variants
recipientRolledBackFrom :: (GHC.Maybe.Maybe RecipientRolledBackFrom'Variants),
    -- | type: Type of the recipient, one of \`individual\` or \`corporation\`.
    --
    -- Constraints:
    --
    -- * Maximum length of 5000
    Recipient -> Text
recipientType :: Data.Text.Internal.Text
  }
  deriving
    ( Int -> Recipient -> ShowS
[Recipient] -> ShowS
Recipient -> String
(Int -> Recipient -> ShowS)
-> (Recipient -> String)
-> ([Recipient] -> ShowS)
-> Show Recipient
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Recipient] -> ShowS
$cshowList :: [Recipient] -> ShowS
show :: Recipient -> String
$cshow :: Recipient -> String
showsPrec :: Int -> Recipient -> ShowS
$cshowsPrec :: Int -> Recipient -> ShowS
GHC.Show.Show,
      Recipient -> Recipient -> Bool
(Recipient -> Recipient -> Bool)
-> (Recipient -> Recipient -> Bool) -> Eq Recipient
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Recipient -> Recipient -> Bool
$c/= :: Recipient -> Recipient -> Bool
== :: Recipient -> Recipient -> Bool
$c== :: Recipient -> Recipient -> Bool
GHC.Classes.Eq
    )

instance Data.Aeson.Types.ToJSON.ToJSON Recipient where
  toJSON :: Recipient -> Value
toJSON Recipient
obj = [Pair] -> Value
Data.Aeson.Types.Internal.object (Text
"active_account" Text -> Maybe RecipientActiveAccount' -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= Recipient -> Maybe RecipientActiveAccount'
recipientActiveAccount Recipient
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"cards" Text -> Maybe RecipientCards' -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= Recipient -> Maybe RecipientCards'
recipientCards Recipient
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..= Recipient -> Int
recipientCreated Recipient
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"default_card" Text -> Maybe RecipientDefaultCard'Variants -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= Recipient -> Maybe RecipientDefaultCard'Variants
recipientDefaultCard Recipient
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..= Recipient -> Maybe Text
recipientDescription Recipient
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"email" Text -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= Recipient -> Maybe Text
recipientEmail Recipient
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..= Recipient -> Text
recipientId Recipient
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..= Recipient -> Bool
recipientLivemode Recipient
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"metadata" Text -> Object -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= Recipient -> Object
recipientMetadata Recipient
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"migrated_to" Text -> Maybe RecipientMigratedTo'Variants -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= Recipient -> Maybe RecipientMigratedTo'Variants
recipientMigratedTo Recipient
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"name" Text -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= Recipient -> Maybe Text
recipientName Recipient
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"rolled_back_from" Text -> Maybe RecipientRolledBackFrom'Variants -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= Recipient -> Maybe RecipientRolledBackFrom'Variants
recipientRolledBackFrom Recipient
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"type" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= Recipient -> Text
recipientType Recipient
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
"recipient" Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: [Pair]
forall a. Monoid a => a
GHC.Base.mempty)
  toEncoding :: Recipient -> Encoding
toEncoding Recipient
obj = Series -> Encoding
Data.Aeson.Encoding.Internal.pairs ((Text
"active_account" Text -> Maybe RecipientActiveAccount' -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= Recipient -> Maybe RecipientActiveAccount'
recipientActiveAccount Recipient
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"cards" Text -> Maybe RecipientCards' -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= Recipient -> Maybe RecipientCards'
recipientCards Recipient
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..= Recipient -> Int
recipientCreated Recipient
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"default_card" Text -> Maybe RecipientDefaultCard'Variants -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= Recipient -> Maybe RecipientDefaultCard'Variants
recipientDefaultCard Recipient
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..= Recipient -> Maybe Text
recipientDescription Recipient
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"email" Text -> Maybe Text -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= Recipient -> Maybe Text
recipientEmail Recipient
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..= Recipient -> Text
recipientId Recipient
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..= Recipient -> Bool
recipientLivemode Recipient
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"metadata" Text -> Object -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= Recipient -> Object
recipientMetadata Recipient
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"migrated_to" Text -> Maybe RecipientMigratedTo'Variants -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= Recipient -> Maybe RecipientMigratedTo'Variants
recipientMigratedTo Recipient
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"name" Text -> Maybe Text -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= Recipient -> Maybe Text
recipientName Recipient
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"rolled_back_from" Text -> Maybe RecipientRolledBackFrom'Variants -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= Recipient -> Maybe RecipientRolledBackFrom'Variants
recipientRolledBackFrom Recipient
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"type" Text -> Text -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= Recipient -> Text
recipientType Recipient
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
"recipient"))))))))))))))

instance Data.Aeson.Types.FromJSON.FromJSON Recipient where
  parseJSON :: Value -> Parser Recipient
parseJSON = String -> (Object -> Parser Recipient) -> Value -> Parser Recipient
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.Aeson.Types.FromJSON.withObject String
"Recipient" (\Object
obj -> (((((((((((((Maybe RecipientActiveAccount'
 -> Maybe RecipientCards'
 -> Int
 -> Maybe RecipientDefaultCard'Variants
 -> Maybe Text
 -> Maybe Text
 -> Text
 -> Bool
 -> Object
 -> Maybe RecipientMigratedTo'Variants
 -> Maybe Text
 -> Maybe RecipientRolledBackFrom'Variants
 -> Text
 -> Recipient)
-> Parser
     (Maybe RecipientActiveAccount'
      -> Maybe RecipientCards'
      -> Int
      -> Maybe RecipientDefaultCard'Variants
      -> Maybe Text
      -> Maybe Text
      -> Text
      -> Bool
      -> Object
      -> Maybe RecipientMigratedTo'Variants
      -> Maybe Text
      -> Maybe RecipientRolledBackFrom'Variants
      -> Text
      -> Recipient)
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure Maybe RecipientActiveAccount'
-> Maybe RecipientCards'
-> Int
-> Maybe RecipientDefaultCard'Variants
-> Maybe Text
-> Maybe Text
-> Text
-> Bool
-> Object
-> Maybe RecipientMigratedTo'Variants
-> Maybe Text
-> Maybe RecipientRolledBackFrom'Variants
-> Text
-> Recipient
Recipient Parser
  (Maybe RecipientActiveAccount'
   -> Maybe RecipientCards'
   -> Int
   -> Maybe RecipientDefaultCard'Variants
   -> Maybe Text
   -> Maybe Text
   -> Text
   -> Bool
   -> Object
   -> Maybe RecipientMigratedTo'Variants
   -> Maybe Text
   -> Maybe RecipientRolledBackFrom'Variants
   -> Text
   -> Recipient)
-> Parser (Maybe RecipientActiveAccount')
-> Parser
     (Maybe RecipientCards'
      -> Int
      -> Maybe RecipientDefaultCard'Variants
      -> Maybe Text
      -> Maybe Text
      -> Text
      -> Bool
      -> Object
      -> Maybe RecipientMigratedTo'Variants
      -> Maybe Text
      -> Maybe RecipientRolledBackFrom'Variants
      -> Text
      -> Recipient)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Text -> Parser (Maybe RecipientActiveAccount')
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Text
"active_account")) Parser
  (Maybe RecipientCards'
   -> Int
   -> Maybe RecipientDefaultCard'Variants
   -> Maybe Text
   -> Maybe Text
   -> Text
   -> Bool
   -> Object
   -> Maybe RecipientMigratedTo'Variants
   -> Maybe Text
   -> Maybe RecipientRolledBackFrom'Variants
   -> Text
   -> Recipient)
-> Parser (Maybe RecipientCards')
-> Parser
     (Int
      -> Maybe RecipientDefaultCard'Variants
      -> Maybe Text
      -> Maybe Text
      -> Text
      -> Bool
      -> Object
      -> Maybe RecipientMigratedTo'Variants
      -> Maybe Text
      -> Maybe RecipientRolledBackFrom'Variants
      -> Text
      -> Recipient)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Text -> Parser (Maybe RecipientCards')
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Text
"cards")) Parser
  (Int
   -> Maybe RecipientDefaultCard'Variants
   -> Maybe Text
   -> Maybe Text
   -> Text
   -> Bool
   -> Object
   -> Maybe RecipientMigratedTo'Variants
   -> Maybe Text
   -> Maybe RecipientRolledBackFrom'Variants
   -> Text
   -> Recipient)
-> Parser Int
-> Parser
     (Maybe RecipientDefaultCard'Variants
      -> Maybe Text
      -> Maybe Text
      -> Text
      -> Bool
      -> Object
      -> Maybe RecipientMigratedTo'Variants
      -> Maybe Text
      -> Maybe RecipientRolledBackFrom'Variants
      -> Text
      -> Recipient)
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
  (Maybe RecipientDefaultCard'Variants
   -> Maybe Text
   -> Maybe Text
   -> Text
   -> Bool
   -> Object
   -> Maybe RecipientMigratedTo'Variants
   -> Maybe Text
   -> Maybe RecipientRolledBackFrom'Variants
   -> Text
   -> Recipient)
-> Parser (Maybe RecipientDefaultCard'Variants)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Text
      -> Bool
      -> Object
      -> Maybe RecipientMigratedTo'Variants
      -> Maybe Text
      -> Maybe RecipientRolledBackFrom'Variants
      -> Text
      -> Recipient)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Text -> Parser (Maybe RecipientDefaultCard'Variants)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Text
"default_card")) Parser
  (Maybe Text
   -> Maybe Text
   -> Text
   -> Bool
   -> Object
   -> Maybe RecipientMigratedTo'Variants
   -> Maybe Text
   -> Maybe RecipientRolledBackFrom'Variants
   -> Text
   -> Recipient)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Text
      -> Bool
      -> Object
      -> Maybe RecipientMigratedTo'Variants
      -> Maybe Text
      -> Maybe RecipientRolledBackFrom'Variants
      -> Text
      -> Recipient)
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 Text
   -> Text
   -> Bool
   -> Object
   -> Maybe RecipientMigratedTo'Variants
   -> Maybe Text
   -> Maybe RecipientRolledBackFrom'Variants
   -> Text
   -> Recipient)
-> Parser (Maybe Text)
-> Parser
     (Text
      -> Bool
      -> Object
      -> Maybe RecipientMigratedTo'Variants
      -> Maybe Text
      -> Maybe RecipientRolledBackFrom'Variants
      -> Text
      -> Recipient)
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
"email")) Parser
  (Text
   -> Bool
   -> Object
   -> Maybe RecipientMigratedTo'Variants
   -> Maybe Text
   -> Maybe RecipientRolledBackFrom'Variants
   -> Text
   -> Recipient)
-> Parser Text
-> Parser
     (Bool
      -> Object
      -> Maybe RecipientMigratedTo'Variants
      -> Maybe Text
      -> Maybe RecipientRolledBackFrom'Variants
      -> Text
      -> Recipient)
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
   -> Object
   -> Maybe RecipientMigratedTo'Variants
   -> Maybe Text
   -> Maybe RecipientRolledBackFrom'Variants
   -> Text
   -> Recipient)
-> Parser Bool
-> Parser
     (Object
      -> Maybe RecipientMigratedTo'Variants
      -> Maybe Text
      -> Maybe RecipientRolledBackFrom'Variants
      -> Text
      -> Recipient)
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
  (Object
   -> Maybe RecipientMigratedTo'Variants
   -> Maybe Text
   -> Maybe RecipientRolledBackFrom'Variants
   -> Text
   -> Recipient)
-> Parser Object
-> Parser
     (Maybe RecipientMigratedTo'Variants
      -> Maybe Text
      -> Maybe RecipientRolledBackFrom'Variants
      -> Text
      -> Recipient)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Text -> Parser Object
forall a. FromJSON a => Object -> Text -> Parser a
Data.Aeson.Types.FromJSON..: Text
"metadata")) Parser
  (Maybe RecipientMigratedTo'Variants
   -> Maybe Text
   -> Maybe RecipientRolledBackFrom'Variants
   -> Text
   -> Recipient)
-> Parser (Maybe RecipientMigratedTo'Variants)
-> Parser
     (Maybe Text
      -> Maybe RecipientRolledBackFrom'Variants -> Text -> Recipient)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Text -> Parser (Maybe RecipientMigratedTo'Variants)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Text
"migrated_to")) Parser
  (Maybe Text
   -> Maybe RecipientRolledBackFrom'Variants -> Text -> Recipient)
-> Parser (Maybe Text)
-> Parser
     (Maybe RecipientRolledBackFrom'Variants -> Text -> Recipient)
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
"name")) Parser
  (Maybe RecipientRolledBackFrom'Variants -> Text -> Recipient)
-> Parser (Maybe RecipientRolledBackFrom'Variants)
-> Parser (Text -> Recipient)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Text -> Parser (Maybe RecipientRolledBackFrom'Variants)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Text
"rolled_back_from")) Parser (Text -> Recipient) -> Parser Text -> Parser Recipient
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
"type"))

-- | Create a new 'Recipient' with all required fields.
mkRecipient ::
  -- | 'recipientCreated'
  GHC.Types.Int ->
  -- | 'recipientId'
  Data.Text.Internal.Text ->
  -- | 'recipientLivemode'
  GHC.Types.Bool ->
  -- | 'recipientMetadata'
  Data.Aeson.Types.Internal.Object ->
  -- | 'recipientType'
  Data.Text.Internal.Text ->
  Recipient
mkRecipient :: Int -> Text -> Bool -> Object -> Text -> Recipient
mkRecipient Int
recipientCreated Text
recipientId Bool
recipientLivemode Object
recipientMetadata Text
recipientType =
  Recipient :: Maybe RecipientActiveAccount'
-> Maybe RecipientCards'
-> Int
-> Maybe RecipientDefaultCard'Variants
-> Maybe Text
-> Maybe Text
-> Text
-> Bool
-> Object
-> Maybe RecipientMigratedTo'Variants
-> Maybe Text
-> Maybe RecipientRolledBackFrom'Variants
-> Text
-> Recipient
Recipient
    { recipientActiveAccount :: Maybe RecipientActiveAccount'
recipientActiveAccount = Maybe RecipientActiveAccount'
forall a. Maybe a
GHC.Maybe.Nothing,
      recipientCards :: Maybe RecipientCards'
recipientCards = Maybe RecipientCards'
forall a. Maybe a
GHC.Maybe.Nothing,
      recipientCreated :: Int
recipientCreated = Int
recipientCreated,
      recipientDefaultCard :: Maybe RecipientDefaultCard'Variants
recipientDefaultCard = Maybe RecipientDefaultCard'Variants
forall a. Maybe a
GHC.Maybe.Nothing,
      recipientDescription :: Maybe Text
recipientDescription = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing,
      recipientEmail :: Maybe Text
recipientEmail = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing,
      recipientId :: Text
recipientId = Text
recipientId,
      recipientLivemode :: Bool
recipientLivemode = Bool
recipientLivemode,
      recipientMetadata :: Object
recipientMetadata = Object
recipientMetadata,
      recipientMigratedTo :: Maybe RecipientMigratedTo'Variants
recipientMigratedTo = Maybe RecipientMigratedTo'Variants
forall a. Maybe a
GHC.Maybe.Nothing,
      recipientName :: Maybe Text
recipientName = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing,
      recipientRolledBackFrom :: Maybe RecipientRolledBackFrom'Variants
recipientRolledBackFrom = Maybe RecipientRolledBackFrom'Variants
forall a. Maybe a
GHC.Maybe.Nothing,
      recipientType :: Text
recipientType = Text
recipientType
    }

-- | Defines the object schema located at @components.schemas.recipient.properties.active_account.anyOf@ in the specification.
--
-- Hash describing the current account on the recipient, if there is one.
data RecipientActiveAccount' = RecipientActiveAccount'
  { -- | account: The ID of the account that the bank account is associated with.
    RecipientActiveAccount'
-> Maybe RecipientActiveAccount'Account'Variants
recipientActiveAccount'Account :: (GHC.Maybe.Maybe RecipientActiveAccount'Account'Variants),
    -- | account_holder_name: The name of the person or business that owns the bank account.
    --
    -- Constraints:
    --
    -- * Maximum length of 5000
    RecipientActiveAccount' -> Maybe Text
recipientActiveAccount'AccountHolderName :: (GHC.Maybe.Maybe Data.Text.Internal.Text),
    -- | account_holder_type: The type of entity that holds the account. This can be either \`individual\` or \`company\`.
    --
    -- Constraints:
    --
    -- * Maximum length of 5000
    RecipientActiveAccount' -> Maybe Text
recipientActiveAccount'AccountHolderType :: (GHC.Maybe.Maybe Data.Text.Internal.Text),
    -- | available_payout_methods: A set of available payout methods for this bank account. Only values from this set should be passed as the \`method\` when creating a payout.
    RecipientActiveAccount'
-> Maybe [RecipientActiveAccount'AvailablePayoutMethods']
recipientActiveAccount'AvailablePayoutMethods :: (GHC.Maybe.Maybe ([RecipientActiveAccount'AvailablePayoutMethods'])),
    -- | bank_name: Name of the bank associated with the routing number (e.g., \`WELLS FARGO\`).
    --
    -- Constraints:
    --
    -- * Maximum length of 5000
    RecipientActiveAccount' -> Maybe Text
recipientActiveAccount'BankName :: (GHC.Maybe.Maybe Data.Text.Internal.Text),
    -- | country: Two-letter ISO code representing the country the bank account is located in.
    --
    -- Constraints:
    --
    -- * Maximum length of 5000
    RecipientActiveAccount' -> Maybe Text
recipientActiveAccount'Country :: (GHC.Maybe.Maybe Data.Text.Internal.Text),
    -- | currency: Three-letter [ISO code for the currency](https:\/\/stripe.com\/docs\/payouts) paid out to the bank account.
    RecipientActiveAccount' -> Maybe Text
recipientActiveAccount'Currency :: (GHC.Maybe.Maybe Data.Text.Internal.Text),
    -- | customer: The ID of the customer that the bank account is associated with.
    RecipientActiveAccount'
-> Maybe RecipientActiveAccount'Customer'Variants
recipientActiveAccount'Customer :: (GHC.Maybe.Maybe RecipientActiveAccount'Customer'Variants),
    -- | default_for_currency: Whether this bank account is the default external account for its currency.
    RecipientActiveAccount' -> Maybe Bool
recipientActiveAccount'DefaultForCurrency :: (GHC.Maybe.Maybe GHC.Types.Bool),
    -- | fingerprint: Uniquely identifies this particular bank account. You can use this attribute to check whether two bank accounts are the same.
    --
    -- Constraints:
    --
    -- * Maximum length of 5000
    RecipientActiveAccount' -> Maybe Text
recipientActiveAccount'Fingerprint :: (GHC.Maybe.Maybe Data.Text.Internal.Text),
    -- | id: Unique identifier for the object.
    --
    -- Constraints:
    --
    -- * Maximum length of 5000
    RecipientActiveAccount' -> Maybe Text
recipientActiveAccount'Id :: (GHC.Maybe.Maybe Data.Text.Internal.Text),
    -- | last4: The last four digits of the bank account number.
    --
    -- Constraints:
    --
    -- * Maximum length of 5000
    RecipientActiveAccount' -> Maybe Text
recipientActiveAccount'Last4 :: (GHC.Maybe.Maybe Data.Text.Internal.Text),
    -- | 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.
    RecipientActiveAccount' -> Maybe Object
recipientActiveAccount'Metadata :: (GHC.Maybe.Maybe Data.Aeson.Types.Internal.Object),
    -- | object: String representing the object\'s type. Objects of the same type share the same value.
    RecipientActiveAccount' -> Maybe RecipientActiveAccount'Object'
recipientActiveAccount'Object :: (GHC.Maybe.Maybe RecipientActiveAccount'Object'),
    -- | routing_number: The routing transit number for the bank account.
    --
    -- Constraints:
    --
    -- * Maximum length of 5000
    RecipientActiveAccount' -> Maybe Text
recipientActiveAccount'RoutingNumber :: (GHC.Maybe.Maybe Data.Text.Internal.Text),
    -- | status: For bank accounts, possible values are \`new\`, \`validated\`, \`verified\`, \`verification_failed\`, or \`errored\`. A bank account that hasn\'t had any activity or validation performed is \`new\`. If Stripe can determine that the bank account exists, its status will be \`validated\`. Note that there often isn’t enough information to know (e.g., for smaller credit unions), and the validation is not always run. If customer bank account verification has succeeded, the bank account status will be \`verified\`. If the verification failed for any reason, such as microdeposit failure, the status will be \`verification_failed\`. If a transfer sent to this bank account fails, we\'ll set the status to \`errored\` and will not continue to send transfers until the bank details are updated.
    --
    -- For external accounts, possible values are \`new\` and \`errored\`. Validations aren\'t run against external accounts because they\'re only used for payouts. This means the other statuses don\'t apply. If a transfer fails, the status is set to \`errored\` and transfers are stopped until account details are updated.
    --
    -- Constraints:
    --
    -- * Maximum length of 5000
    RecipientActiveAccount' -> Maybe Text
recipientActiveAccount'Status :: (GHC.Maybe.Maybe Data.Text.Internal.Text)
  }
  deriving
    ( Int -> RecipientActiveAccount' -> ShowS
[RecipientActiveAccount'] -> ShowS
RecipientActiveAccount' -> String
(Int -> RecipientActiveAccount' -> ShowS)
-> (RecipientActiveAccount' -> String)
-> ([RecipientActiveAccount'] -> ShowS)
-> Show RecipientActiveAccount'
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [RecipientActiveAccount'] -> ShowS
$cshowList :: [RecipientActiveAccount'] -> ShowS
show :: RecipientActiveAccount' -> String
$cshow :: RecipientActiveAccount' -> String
showsPrec :: Int -> RecipientActiveAccount' -> ShowS
$cshowsPrec :: Int -> RecipientActiveAccount' -> ShowS
GHC.Show.Show,
      RecipientActiveAccount' -> RecipientActiveAccount' -> Bool
(RecipientActiveAccount' -> RecipientActiveAccount' -> Bool)
-> (RecipientActiveAccount' -> RecipientActiveAccount' -> Bool)
-> Eq RecipientActiveAccount'
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: RecipientActiveAccount' -> RecipientActiveAccount' -> Bool
$c/= :: RecipientActiveAccount' -> RecipientActiveAccount' -> Bool
== :: RecipientActiveAccount' -> RecipientActiveAccount' -> Bool
$c== :: RecipientActiveAccount' -> RecipientActiveAccount' -> Bool
GHC.Classes.Eq
    )

instance Data.Aeson.Types.ToJSON.ToJSON RecipientActiveAccount' where
  toJSON :: RecipientActiveAccount' -> Value
toJSON RecipientActiveAccount'
obj = [Pair] -> Value
Data.Aeson.Types.Internal.object (Text
"account" Text -> Maybe RecipientActiveAccount'Account'Variants -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= RecipientActiveAccount'
-> Maybe RecipientActiveAccount'Account'Variants
recipientActiveAccount'Account RecipientActiveAccount'
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"account_holder_name" Text -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= RecipientActiveAccount' -> Maybe Text
recipientActiveAccount'AccountHolderName RecipientActiveAccount'
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"account_holder_type" Text -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= RecipientActiveAccount' -> Maybe Text
recipientActiveAccount'AccountHolderType RecipientActiveAccount'
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"available_payout_methods" Text
-> Maybe [RecipientActiveAccount'AvailablePayoutMethods'] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= RecipientActiveAccount'
-> Maybe [RecipientActiveAccount'AvailablePayoutMethods']
recipientActiveAccount'AvailablePayoutMethods RecipientActiveAccount'
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"bank_name" Text -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= RecipientActiveAccount' -> Maybe Text
recipientActiveAccount'BankName RecipientActiveAccount'
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"country" Text -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= RecipientActiveAccount' -> Maybe Text
recipientActiveAccount'Country RecipientActiveAccount'
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"currency" Text -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= RecipientActiveAccount' -> Maybe Text
recipientActiveAccount'Currency RecipientActiveAccount'
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"customer" Text -> Maybe RecipientActiveAccount'Customer'Variants -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= RecipientActiveAccount'
-> Maybe RecipientActiveAccount'Customer'Variants
recipientActiveAccount'Customer RecipientActiveAccount'
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"default_for_currency" Text -> Maybe Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= RecipientActiveAccount' -> Maybe Bool
recipientActiveAccount'DefaultForCurrency RecipientActiveAccount'
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"fingerprint" Text -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= RecipientActiveAccount' -> Maybe Text
recipientActiveAccount'Fingerprint RecipientActiveAccount'
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"id" Text -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= RecipientActiveAccount' -> Maybe Text
recipientActiveAccount'Id RecipientActiveAccount'
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"last4" Text -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= RecipientActiveAccount' -> Maybe Text
recipientActiveAccount'Last4 RecipientActiveAccount'
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..= RecipientActiveAccount' -> Maybe Object
recipientActiveAccount'Metadata RecipientActiveAccount'
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"object" Text -> Maybe RecipientActiveAccount'Object' -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= RecipientActiveAccount' -> Maybe RecipientActiveAccount'Object'
recipientActiveAccount'Object RecipientActiveAccount'
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"routing_number" Text -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= RecipientActiveAccount' -> Maybe Text
recipientActiveAccount'RoutingNumber RecipientActiveAccount'
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"status" Text -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= RecipientActiveAccount' -> Maybe Text
recipientActiveAccount'Status RecipientActiveAccount'
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: [Pair]
forall a. Monoid a => a
GHC.Base.mempty)
  toEncoding :: RecipientActiveAccount' -> Encoding
toEncoding RecipientActiveAccount'
obj = Series -> Encoding
Data.Aeson.Encoding.Internal.pairs ((Text
"account" Text -> Maybe RecipientActiveAccount'Account'Variants -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= RecipientActiveAccount'
-> Maybe RecipientActiveAccount'Account'Variants
recipientActiveAccount'Account RecipientActiveAccount'
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"account_holder_name" Text -> Maybe Text -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= RecipientActiveAccount' -> Maybe Text
recipientActiveAccount'AccountHolderName RecipientActiveAccount'
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"account_holder_type" Text -> Maybe Text -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= RecipientActiveAccount' -> Maybe Text
recipientActiveAccount'AccountHolderType RecipientActiveAccount'
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"available_payout_methods" Text
-> Maybe [RecipientActiveAccount'AvailablePayoutMethods'] -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= RecipientActiveAccount'
-> Maybe [RecipientActiveAccount'AvailablePayoutMethods']
recipientActiveAccount'AvailablePayoutMethods RecipientActiveAccount'
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"bank_name" Text -> Maybe Text -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= RecipientActiveAccount' -> Maybe Text
recipientActiveAccount'BankName RecipientActiveAccount'
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"country" Text -> Maybe Text -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= RecipientActiveAccount' -> Maybe Text
recipientActiveAccount'Country RecipientActiveAccount'
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"currency" Text -> Maybe Text -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= RecipientActiveAccount' -> Maybe Text
recipientActiveAccount'Currency RecipientActiveAccount'
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"customer" Text -> Maybe RecipientActiveAccount'Customer'Variants -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= RecipientActiveAccount'
-> Maybe RecipientActiveAccount'Customer'Variants
recipientActiveAccount'Customer RecipientActiveAccount'
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"default_for_currency" Text -> Maybe Bool -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= RecipientActiveAccount' -> Maybe Bool
recipientActiveAccount'DefaultForCurrency RecipientActiveAccount'
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"fingerprint" Text -> Maybe Text -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= RecipientActiveAccount' -> Maybe Text
recipientActiveAccount'Fingerprint RecipientActiveAccount'
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"id" Text -> Maybe Text -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= RecipientActiveAccount' -> Maybe Text
recipientActiveAccount'Id RecipientActiveAccount'
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"last4" Text -> Maybe Text -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= RecipientActiveAccount' -> Maybe Text
recipientActiveAccount'Last4 RecipientActiveAccount'
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..= RecipientActiveAccount' -> Maybe Object
recipientActiveAccount'Metadata RecipientActiveAccount'
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"object" Text -> Maybe RecipientActiveAccount'Object' -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= RecipientActiveAccount' -> Maybe RecipientActiveAccount'Object'
recipientActiveAccount'Object RecipientActiveAccount'
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"routing_number" Text -> Maybe Text -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= RecipientActiveAccount' -> Maybe Text
recipientActiveAccount'RoutingNumber RecipientActiveAccount'
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> (Text
"status" Text -> Maybe Text -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= RecipientActiveAccount' -> Maybe Text
recipientActiveAccount'Status RecipientActiveAccount'
obj))))))))))))))))

instance Data.Aeson.Types.FromJSON.FromJSON RecipientActiveAccount' where
  parseJSON :: Value -> Parser RecipientActiveAccount'
parseJSON = String
-> (Object -> Parser RecipientActiveAccount')
-> Value
-> Parser RecipientActiveAccount'
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.Aeson.Types.FromJSON.withObject String
"RecipientActiveAccount'" (\Object
obj -> ((((((((((((((((Maybe RecipientActiveAccount'Account'Variants
 -> Maybe Text
 -> Maybe Text
 -> Maybe [RecipientActiveAccount'AvailablePayoutMethods']
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe RecipientActiveAccount'Customer'Variants
 -> Maybe Bool
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Object
 -> Maybe RecipientActiveAccount'Object'
 -> Maybe Text
 -> Maybe Text
 -> RecipientActiveAccount')
-> Parser
     (Maybe RecipientActiveAccount'Account'Variants
      -> Maybe Text
      -> Maybe Text
      -> Maybe [RecipientActiveAccount'AvailablePayoutMethods']
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe RecipientActiveAccount'Customer'Variants
      -> Maybe Bool
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Object
      -> Maybe RecipientActiveAccount'Object'
      -> Maybe Text
      -> Maybe Text
      -> RecipientActiveAccount')
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure Maybe RecipientActiveAccount'Account'Variants
-> Maybe Text
-> Maybe Text
-> Maybe [RecipientActiveAccount'AvailablePayoutMethods']
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe RecipientActiveAccount'Customer'Variants
-> Maybe Bool
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Object
-> Maybe RecipientActiveAccount'Object'
-> Maybe Text
-> Maybe Text
-> RecipientActiveAccount'
RecipientActiveAccount' Parser
  (Maybe RecipientActiveAccount'Account'Variants
   -> Maybe Text
   -> Maybe Text
   -> Maybe [RecipientActiveAccount'AvailablePayoutMethods']
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe RecipientActiveAccount'Customer'Variants
   -> Maybe Bool
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Object
   -> Maybe RecipientActiveAccount'Object'
   -> Maybe Text
   -> Maybe Text
   -> RecipientActiveAccount')
-> Parser (Maybe RecipientActiveAccount'Account'Variants)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe [RecipientActiveAccount'AvailablePayoutMethods']
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe RecipientActiveAccount'Customer'Variants
      -> Maybe Bool
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Object
      -> Maybe RecipientActiveAccount'Object'
      -> Maybe Text
      -> Maybe Text
      -> RecipientActiveAccount')
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object
-> Text -> Parser (Maybe RecipientActiveAccount'Account'Variants)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Text
"account")) Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe [RecipientActiveAccount'AvailablePayoutMethods']
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe RecipientActiveAccount'Customer'Variants
   -> Maybe Bool
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Object
   -> Maybe RecipientActiveAccount'Object'
   -> Maybe Text
   -> Maybe Text
   -> RecipientActiveAccount')
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe [RecipientActiveAccount'AvailablePayoutMethods']
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe RecipientActiveAccount'Customer'Variants
      -> Maybe Bool
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Object
      -> Maybe RecipientActiveAccount'Object'
      -> Maybe Text
      -> Maybe Text
      -> RecipientActiveAccount')
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
"account_holder_name")) Parser
  (Maybe Text
   -> Maybe [RecipientActiveAccount'AvailablePayoutMethods']
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe RecipientActiveAccount'Customer'Variants
   -> Maybe Bool
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Object
   -> Maybe RecipientActiveAccount'Object'
   -> Maybe Text
   -> Maybe Text
   -> RecipientActiveAccount')
-> Parser (Maybe Text)
-> Parser
     (Maybe [RecipientActiveAccount'AvailablePayoutMethods']
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe RecipientActiveAccount'Customer'Variants
      -> Maybe Bool
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Object
      -> Maybe RecipientActiveAccount'Object'
      -> Maybe Text
      -> Maybe Text
      -> RecipientActiveAccount')
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
"account_holder_type")) Parser
  (Maybe [RecipientActiveAccount'AvailablePayoutMethods']
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe RecipientActiveAccount'Customer'Variants
   -> Maybe Bool
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Object
   -> Maybe RecipientActiveAccount'Object'
   -> Maybe Text
   -> Maybe Text
   -> RecipientActiveAccount')
-> Parser (Maybe [RecipientActiveAccount'AvailablePayoutMethods'])
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe RecipientActiveAccount'Customer'Variants
      -> Maybe Bool
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Object
      -> Maybe RecipientActiveAccount'Object'
      -> Maybe Text
      -> Maybe Text
      -> RecipientActiveAccount')
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object
-> Text
-> Parser (Maybe [RecipientActiveAccount'AvailablePayoutMethods'])
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Text
"available_payout_methods")) Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe RecipientActiveAccount'Customer'Variants
   -> Maybe Bool
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Object
   -> Maybe RecipientActiveAccount'Object'
   -> Maybe Text
   -> Maybe Text
   -> RecipientActiveAccount')
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe RecipientActiveAccount'Customer'Variants
      -> Maybe Bool
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Object
      -> Maybe RecipientActiveAccount'Object'
      -> Maybe Text
      -> Maybe Text
      -> RecipientActiveAccount')
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
"bank_name")) Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe RecipientActiveAccount'Customer'Variants
   -> Maybe Bool
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Object
   -> Maybe RecipientActiveAccount'Object'
   -> Maybe Text
   -> Maybe Text
   -> RecipientActiveAccount')
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe RecipientActiveAccount'Customer'Variants
      -> Maybe Bool
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Object
      -> Maybe RecipientActiveAccount'Object'
      -> Maybe Text
      -> Maybe Text
      -> RecipientActiveAccount')
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
"country")) Parser
  (Maybe Text
   -> Maybe RecipientActiveAccount'Customer'Variants
   -> Maybe Bool
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Object
   -> Maybe RecipientActiveAccount'Object'
   -> Maybe Text
   -> Maybe Text
   -> RecipientActiveAccount')
-> Parser (Maybe Text)
-> Parser
     (Maybe RecipientActiveAccount'Customer'Variants
      -> Maybe Bool
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Object
      -> Maybe RecipientActiveAccount'Object'
      -> Maybe Text
      -> Maybe Text
      -> RecipientActiveAccount')
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
"currency")) Parser
  (Maybe RecipientActiveAccount'Customer'Variants
   -> Maybe Bool
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Object
   -> Maybe RecipientActiveAccount'Object'
   -> Maybe Text
   -> Maybe Text
   -> RecipientActiveAccount')
-> Parser (Maybe RecipientActiveAccount'Customer'Variants)
-> Parser
     (Maybe Bool
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Object
      -> Maybe RecipientActiveAccount'Object'
      -> Maybe Text
      -> Maybe Text
      -> RecipientActiveAccount')
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object
-> Text -> Parser (Maybe RecipientActiveAccount'Customer'Variants)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Text
"customer")) Parser
  (Maybe Bool
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Object
   -> Maybe RecipientActiveAccount'Object'
   -> Maybe Text
   -> Maybe Text
   -> RecipientActiveAccount')
-> Parser (Maybe Bool)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Object
      -> Maybe RecipientActiveAccount'Object'
      -> Maybe Text
      -> Maybe Text
      -> RecipientActiveAccount')
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Text -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Text
"default_for_currency")) Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Object
   -> Maybe RecipientActiveAccount'Object'
   -> Maybe Text
   -> Maybe Text
   -> RecipientActiveAccount')
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Object
      -> Maybe RecipientActiveAccount'Object'
      -> Maybe Text
      -> Maybe Text
      -> RecipientActiveAccount')
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
"fingerprint")) Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Object
   -> Maybe RecipientActiveAccount'Object'
   -> Maybe Text
   -> Maybe Text
   -> RecipientActiveAccount')
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Object
      -> Maybe RecipientActiveAccount'Object'
      -> Maybe Text
      -> Maybe Text
      -> RecipientActiveAccount')
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
"id")) Parser
  (Maybe Text
   -> Maybe Object
   -> Maybe RecipientActiveAccount'Object'
   -> Maybe Text
   -> Maybe Text
   -> RecipientActiveAccount')
-> Parser (Maybe Text)
-> Parser
     (Maybe Object
      -> Maybe RecipientActiveAccount'Object'
      -> Maybe Text
      -> Maybe Text
      -> RecipientActiveAccount')
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
"last4")) Parser
  (Maybe Object
   -> Maybe RecipientActiveAccount'Object'
   -> Maybe Text
   -> Maybe Text
   -> RecipientActiveAccount')
-> Parser (Maybe Object)
-> Parser
     (Maybe RecipientActiveAccount'Object'
      -> Maybe Text -> Maybe Text -> RecipientActiveAccount')
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
  (Maybe RecipientActiveAccount'Object'
   -> Maybe Text -> Maybe Text -> RecipientActiveAccount')
-> Parser (Maybe RecipientActiveAccount'Object')
-> Parser (Maybe Text -> Maybe Text -> RecipientActiveAccount')
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Text -> Parser (Maybe RecipientActiveAccount'Object')
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Text
"object")) Parser (Maybe Text -> Maybe Text -> RecipientActiveAccount')
-> Parser (Maybe Text)
-> Parser (Maybe Text -> RecipientActiveAccount')
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
"routing_number")) Parser (Maybe Text -> RecipientActiveAccount')
-> Parser (Maybe Text) -> Parser RecipientActiveAccount'
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
"status"))

-- | Create a new 'RecipientActiveAccount'' with all required fields.
mkRecipientActiveAccount' :: RecipientActiveAccount'
mkRecipientActiveAccount' :: RecipientActiveAccount'
mkRecipientActiveAccount' =
  RecipientActiveAccount' :: Maybe RecipientActiveAccount'Account'Variants
-> Maybe Text
-> Maybe Text
-> Maybe [RecipientActiveAccount'AvailablePayoutMethods']
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe RecipientActiveAccount'Customer'Variants
-> Maybe Bool
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Object
-> Maybe RecipientActiveAccount'Object'
-> Maybe Text
-> Maybe Text
-> RecipientActiveAccount'
RecipientActiveAccount'
    { recipientActiveAccount'Account :: Maybe RecipientActiveAccount'Account'Variants
recipientActiveAccount'Account = Maybe RecipientActiveAccount'Account'Variants
forall a. Maybe a
GHC.Maybe.Nothing,
      recipientActiveAccount'AccountHolderName :: Maybe Text
recipientActiveAccount'AccountHolderName = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing,
      recipientActiveAccount'AccountHolderType :: Maybe Text
recipientActiveAccount'AccountHolderType = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing,
      recipientActiveAccount'AvailablePayoutMethods :: Maybe [RecipientActiveAccount'AvailablePayoutMethods']
recipientActiveAccount'AvailablePayoutMethods = Maybe [RecipientActiveAccount'AvailablePayoutMethods']
forall a. Maybe a
GHC.Maybe.Nothing,
      recipientActiveAccount'BankName :: Maybe Text
recipientActiveAccount'BankName = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing,
      recipientActiveAccount'Country :: Maybe Text
recipientActiveAccount'Country = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing,
      recipientActiveAccount'Currency :: Maybe Text
recipientActiveAccount'Currency = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing,
      recipientActiveAccount'Customer :: Maybe RecipientActiveAccount'Customer'Variants
recipientActiveAccount'Customer = Maybe RecipientActiveAccount'Customer'Variants
forall a. Maybe a
GHC.Maybe.Nothing,
      recipientActiveAccount'DefaultForCurrency :: Maybe Bool
recipientActiveAccount'DefaultForCurrency = Maybe Bool
forall a. Maybe a
GHC.Maybe.Nothing,
      recipientActiveAccount'Fingerprint :: Maybe Text
recipientActiveAccount'Fingerprint = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing,
      recipientActiveAccount'Id :: Maybe Text
recipientActiveAccount'Id = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing,
      recipientActiveAccount'Last4 :: Maybe Text
recipientActiveAccount'Last4 = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing,
      recipientActiveAccount'Metadata :: Maybe Object
recipientActiveAccount'Metadata = Maybe Object
forall a. Maybe a
GHC.Maybe.Nothing,
      recipientActiveAccount'Object :: Maybe RecipientActiveAccount'Object'
recipientActiveAccount'Object = Maybe RecipientActiveAccount'Object'
forall a. Maybe a
GHC.Maybe.Nothing,
      recipientActiveAccount'RoutingNumber :: Maybe Text
recipientActiveAccount'RoutingNumber = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing,
      recipientActiveAccount'Status :: Maybe Text
recipientActiveAccount'Status = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing
    }

-- | Defines the oneOf schema located at @components.schemas.recipient.properties.active_account.anyOf.properties.account.anyOf@ in the specification.
--
-- The ID of the account that the bank account is associated with.
data RecipientActiveAccount'Account'Variants
  = RecipientActiveAccount'Account'Text Data.Text.Internal.Text
  | RecipientActiveAccount'Account'Account Account
  deriving (Int -> RecipientActiveAccount'Account'Variants -> ShowS
[RecipientActiveAccount'Account'Variants] -> ShowS
RecipientActiveAccount'Account'Variants -> String
(Int -> RecipientActiveAccount'Account'Variants -> ShowS)
-> (RecipientActiveAccount'Account'Variants -> String)
-> ([RecipientActiveAccount'Account'Variants] -> ShowS)
-> Show RecipientActiveAccount'Account'Variants
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [RecipientActiveAccount'Account'Variants] -> ShowS
$cshowList :: [RecipientActiveAccount'Account'Variants] -> ShowS
show :: RecipientActiveAccount'Account'Variants -> String
$cshow :: RecipientActiveAccount'Account'Variants -> String
showsPrec :: Int -> RecipientActiveAccount'Account'Variants -> ShowS
$cshowsPrec :: Int -> RecipientActiveAccount'Account'Variants -> ShowS
GHC.Show.Show, RecipientActiveAccount'Account'Variants
-> RecipientActiveAccount'Account'Variants -> Bool
(RecipientActiveAccount'Account'Variants
 -> RecipientActiveAccount'Account'Variants -> Bool)
-> (RecipientActiveAccount'Account'Variants
    -> RecipientActiveAccount'Account'Variants -> Bool)
-> Eq RecipientActiveAccount'Account'Variants
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: RecipientActiveAccount'Account'Variants
-> RecipientActiveAccount'Account'Variants -> Bool
$c/= :: RecipientActiveAccount'Account'Variants
-> RecipientActiveAccount'Account'Variants -> Bool
== :: RecipientActiveAccount'Account'Variants
-> RecipientActiveAccount'Account'Variants -> Bool
$c== :: RecipientActiveAccount'Account'Variants
-> RecipientActiveAccount'Account'Variants -> Bool
GHC.Classes.Eq)

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

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

-- | Defines the enum schema located at @components.schemas.recipient.properties.active_account.anyOf.properties.available_payout_methods.items@ in the specification.
data RecipientActiveAccount'AvailablePayoutMethods'
  = -- | This case is used if the value encountered during decoding does not match any of the provided cases in the specification.
    RecipientActiveAccount'AvailablePayoutMethods'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.
    RecipientActiveAccount'AvailablePayoutMethods'Typed Data.Text.Internal.Text
  | -- | Represents the JSON value @"instant"@
    RecipientActiveAccount'AvailablePayoutMethods'EnumInstant
  | -- | Represents the JSON value @"standard"@
    RecipientActiveAccount'AvailablePayoutMethods'EnumStandard
  deriving (Int -> RecipientActiveAccount'AvailablePayoutMethods' -> ShowS
[RecipientActiveAccount'AvailablePayoutMethods'] -> ShowS
RecipientActiveAccount'AvailablePayoutMethods' -> String
(Int -> RecipientActiveAccount'AvailablePayoutMethods' -> ShowS)
-> (RecipientActiveAccount'AvailablePayoutMethods' -> String)
-> ([RecipientActiveAccount'AvailablePayoutMethods'] -> ShowS)
-> Show RecipientActiveAccount'AvailablePayoutMethods'
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [RecipientActiveAccount'AvailablePayoutMethods'] -> ShowS
$cshowList :: [RecipientActiveAccount'AvailablePayoutMethods'] -> ShowS
show :: RecipientActiveAccount'AvailablePayoutMethods' -> String
$cshow :: RecipientActiveAccount'AvailablePayoutMethods' -> String
showsPrec :: Int -> RecipientActiveAccount'AvailablePayoutMethods' -> ShowS
$cshowsPrec :: Int -> RecipientActiveAccount'AvailablePayoutMethods' -> ShowS
GHC.Show.Show, RecipientActiveAccount'AvailablePayoutMethods'
-> RecipientActiveAccount'AvailablePayoutMethods' -> Bool
(RecipientActiveAccount'AvailablePayoutMethods'
 -> RecipientActiveAccount'AvailablePayoutMethods' -> Bool)
-> (RecipientActiveAccount'AvailablePayoutMethods'
    -> RecipientActiveAccount'AvailablePayoutMethods' -> Bool)
-> Eq RecipientActiveAccount'AvailablePayoutMethods'
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: RecipientActiveAccount'AvailablePayoutMethods'
-> RecipientActiveAccount'AvailablePayoutMethods' -> Bool
$c/= :: RecipientActiveAccount'AvailablePayoutMethods'
-> RecipientActiveAccount'AvailablePayoutMethods' -> Bool
== :: RecipientActiveAccount'AvailablePayoutMethods'
-> RecipientActiveAccount'AvailablePayoutMethods' -> Bool
$c== :: RecipientActiveAccount'AvailablePayoutMethods'
-> RecipientActiveAccount'AvailablePayoutMethods' -> Bool
GHC.Classes.Eq)

instance Data.Aeson.Types.ToJSON.ToJSON RecipientActiveAccount'AvailablePayoutMethods' where
  toJSON :: RecipientActiveAccount'AvailablePayoutMethods' -> Value
toJSON (RecipientActiveAccount'AvailablePayoutMethods'Other Value
val) = Value
val
  toJSON (RecipientActiveAccount'AvailablePayoutMethods'Typed Text
val) = Text -> Value
forall a. ToJSON a => a -> Value
Data.Aeson.Types.ToJSON.toJSON Text
val
  toJSON (RecipientActiveAccount'AvailablePayoutMethods'
RecipientActiveAccount'AvailablePayoutMethods'EnumInstant) = Value
"instant"
  toJSON (RecipientActiveAccount'AvailablePayoutMethods'
RecipientActiveAccount'AvailablePayoutMethods'EnumStandard) = Value
"standard"

instance Data.Aeson.Types.FromJSON.FromJSON RecipientActiveAccount'AvailablePayoutMethods' where
  parseJSON :: Value -> Parser RecipientActiveAccount'AvailablePayoutMethods'
parseJSON Value
val =
    RecipientActiveAccount'AvailablePayoutMethods'
-> Parser RecipientActiveAccount'AvailablePayoutMethods'
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
"instant" -> RecipientActiveAccount'AvailablePayoutMethods'
RecipientActiveAccount'AvailablePayoutMethods'EnumInstant
            | Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"standard" -> RecipientActiveAccount'AvailablePayoutMethods'
RecipientActiveAccount'AvailablePayoutMethods'EnumStandard
            | Bool
GHC.Base.otherwise -> Value -> RecipientActiveAccount'AvailablePayoutMethods'
RecipientActiveAccount'AvailablePayoutMethods'Other Value
val
      )

-- | Defines the oneOf schema located at @components.schemas.recipient.properties.active_account.anyOf.properties.customer.anyOf@ in the specification.
--
-- The ID of the customer that the bank account is associated with.
data RecipientActiveAccount'Customer'Variants
  = RecipientActiveAccount'Customer'Text Data.Text.Internal.Text
  | RecipientActiveAccount'Customer'Customer Customer
  | RecipientActiveAccount'Customer'DeletedCustomer DeletedCustomer
  deriving (Int -> RecipientActiveAccount'Customer'Variants -> ShowS
[RecipientActiveAccount'Customer'Variants] -> ShowS
RecipientActiveAccount'Customer'Variants -> String
(Int -> RecipientActiveAccount'Customer'Variants -> ShowS)
-> (RecipientActiveAccount'Customer'Variants -> String)
-> ([RecipientActiveAccount'Customer'Variants] -> ShowS)
-> Show RecipientActiveAccount'Customer'Variants
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [RecipientActiveAccount'Customer'Variants] -> ShowS
$cshowList :: [RecipientActiveAccount'Customer'Variants] -> ShowS
show :: RecipientActiveAccount'Customer'Variants -> String
$cshow :: RecipientActiveAccount'Customer'Variants -> String
showsPrec :: Int -> RecipientActiveAccount'Customer'Variants -> ShowS
$cshowsPrec :: Int -> RecipientActiveAccount'Customer'Variants -> ShowS
GHC.Show.Show, RecipientActiveAccount'Customer'Variants
-> RecipientActiveAccount'Customer'Variants -> Bool
(RecipientActiveAccount'Customer'Variants
 -> RecipientActiveAccount'Customer'Variants -> Bool)
-> (RecipientActiveAccount'Customer'Variants
    -> RecipientActiveAccount'Customer'Variants -> Bool)
-> Eq RecipientActiveAccount'Customer'Variants
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: RecipientActiveAccount'Customer'Variants
-> RecipientActiveAccount'Customer'Variants -> Bool
$c/= :: RecipientActiveAccount'Customer'Variants
-> RecipientActiveAccount'Customer'Variants -> Bool
== :: RecipientActiveAccount'Customer'Variants
-> RecipientActiveAccount'Customer'Variants -> Bool
$c== :: RecipientActiveAccount'Customer'Variants
-> RecipientActiveAccount'Customer'Variants -> Bool
GHC.Classes.Eq)

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

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

-- | Defines the enum schema located at @components.schemas.recipient.properties.active_account.anyOf.properties.object@ in the specification.
--
-- String representing the object\'s type. Objects of the same type share the same value.
data RecipientActiveAccount'Object'
  = -- | This case is used if the value encountered during decoding does not match any of the provided cases in the specification.
    RecipientActiveAccount'Object'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.
    RecipientActiveAccount'Object'Typed Data.Text.Internal.Text
  | -- | Represents the JSON value @"bank_account"@
    RecipientActiveAccount'Object'EnumBankAccount
  deriving (Int -> RecipientActiveAccount'Object' -> ShowS
[RecipientActiveAccount'Object'] -> ShowS
RecipientActiveAccount'Object' -> String
(Int -> RecipientActiveAccount'Object' -> ShowS)
-> (RecipientActiveAccount'Object' -> String)
-> ([RecipientActiveAccount'Object'] -> ShowS)
-> Show RecipientActiveAccount'Object'
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [RecipientActiveAccount'Object'] -> ShowS
$cshowList :: [RecipientActiveAccount'Object'] -> ShowS
show :: RecipientActiveAccount'Object' -> String
$cshow :: RecipientActiveAccount'Object' -> String
showsPrec :: Int -> RecipientActiveAccount'Object' -> ShowS
$cshowsPrec :: Int -> RecipientActiveAccount'Object' -> ShowS
GHC.Show.Show, RecipientActiveAccount'Object'
-> RecipientActiveAccount'Object' -> Bool
(RecipientActiveAccount'Object'
 -> RecipientActiveAccount'Object' -> Bool)
-> (RecipientActiveAccount'Object'
    -> RecipientActiveAccount'Object' -> Bool)
-> Eq RecipientActiveAccount'Object'
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: RecipientActiveAccount'Object'
-> RecipientActiveAccount'Object' -> Bool
$c/= :: RecipientActiveAccount'Object'
-> RecipientActiveAccount'Object' -> Bool
== :: RecipientActiveAccount'Object'
-> RecipientActiveAccount'Object' -> Bool
$c== :: RecipientActiveAccount'Object'
-> RecipientActiveAccount'Object' -> Bool
GHC.Classes.Eq)

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

instance Data.Aeson.Types.FromJSON.FromJSON RecipientActiveAccount'Object' where
  parseJSON :: Value -> Parser RecipientActiveAccount'Object'
parseJSON Value
val =
    RecipientActiveAccount'Object'
-> Parser RecipientActiveAccount'Object'
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" -> RecipientActiveAccount'Object'
RecipientActiveAccount'Object'EnumBankAccount
            | Bool
GHC.Base.otherwise -> Value -> RecipientActiveAccount'Object'
RecipientActiveAccount'Object'Other Value
val
      )

-- | Defines the object schema located at @components.schemas.recipient.properties.cards@ in the specification.
data RecipientCards' = RecipientCards'
  { -- | data
    RecipientCards' -> [Card]
recipientCards'Data :: ([Card]),
    -- | has_more: True if this list has another page of items after this one that can be fetched.
    RecipientCards' -> Bool
recipientCards'HasMore :: GHC.Types.Bool,
    -- | url: The URL where this list can be accessed.
    --
    -- Constraints:
    --
    -- * Maximum length of 5000
    RecipientCards' -> Text
recipientCards'Url :: Data.Text.Internal.Text
  }
  deriving
    ( Int -> RecipientCards' -> ShowS
[RecipientCards'] -> ShowS
RecipientCards' -> String
(Int -> RecipientCards' -> ShowS)
-> (RecipientCards' -> String)
-> ([RecipientCards'] -> ShowS)
-> Show RecipientCards'
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [RecipientCards'] -> ShowS
$cshowList :: [RecipientCards'] -> ShowS
show :: RecipientCards' -> String
$cshow :: RecipientCards' -> String
showsPrec :: Int -> RecipientCards' -> ShowS
$cshowsPrec :: Int -> RecipientCards' -> ShowS
GHC.Show.Show,
      RecipientCards' -> RecipientCards' -> Bool
(RecipientCards' -> RecipientCards' -> Bool)
-> (RecipientCards' -> RecipientCards' -> Bool)
-> Eq RecipientCards'
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: RecipientCards' -> RecipientCards' -> Bool
$c/= :: RecipientCards' -> RecipientCards' -> Bool
== :: RecipientCards' -> RecipientCards' -> Bool
$c== :: RecipientCards' -> RecipientCards' -> Bool
GHC.Classes.Eq
    )

instance Data.Aeson.Types.ToJSON.ToJSON RecipientCards' where
  toJSON :: RecipientCards' -> Value
toJSON RecipientCards'
obj = [Pair] -> Value
Data.Aeson.Types.Internal.object (Text
"data" Text -> [Card] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= RecipientCards' -> [Card]
recipientCards'Data RecipientCards'
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"has_more" Text -> Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= RecipientCards' -> Bool
recipientCards'HasMore RecipientCards'
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"url" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= RecipientCards' -> Text
recipientCards'Url RecipientCards'
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
"list" Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: [Pair]
forall a. Monoid a => a
GHC.Base.mempty)
  toEncoding :: RecipientCards' -> Encoding
toEncoding RecipientCards'
obj = Series -> Encoding
Data.Aeson.Encoding.Internal.pairs ((Text
"data" Text -> [Card] -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= RecipientCards' -> [Card]
recipientCards'Data RecipientCards'
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"has_more" Text -> Bool -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= RecipientCards' -> Bool
recipientCards'HasMore RecipientCards'
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"url" Text -> Text -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= RecipientCards' -> Text
recipientCards'Url RecipientCards'
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
"list"))))

instance Data.Aeson.Types.FromJSON.FromJSON RecipientCards' where
  parseJSON :: Value -> Parser RecipientCards'
parseJSON = String
-> (Object -> Parser RecipientCards')
-> Value
-> Parser RecipientCards'
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.Aeson.Types.FromJSON.withObject String
"RecipientCards'" (\Object
obj -> ((([Card] -> Bool -> Text -> RecipientCards')
-> Parser ([Card] -> Bool -> Text -> RecipientCards')
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure [Card] -> Bool -> Text -> RecipientCards'
RecipientCards' Parser ([Card] -> Bool -> Text -> RecipientCards')
-> Parser [Card] -> Parser (Bool -> Text -> RecipientCards')
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Text -> Parser [Card]
forall a. FromJSON a => Object -> Text -> Parser a
Data.Aeson.Types.FromJSON..: Text
"data")) Parser (Bool -> Text -> RecipientCards')
-> Parser Bool -> Parser (Text -> RecipientCards')
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
"has_more")) Parser (Text -> RecipientCards')
-> Parser Text -> Parser RecipientCards'
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
"url"))

-- | Create a new 'RecipientCards'' with all required fields.
mkRecipientCards' ::
  -- | 'recipientCards'Data'
  [Card] ->
  -- | 'recipientCards'HasMore'
  GHC.Types.Bool ->
  -- | 'recipientCards'Url'
  Data.Text.Internal.Text ->
  RecipientCards'
mkRecipientCards' :: [Card] -> Bool -> Text -> RecipientCards'
mkRecipientCards' [Card]
recipientCards'Data Bool
recipientCards'HasMore Text
recipientCards'Url =
  RecipientCards' :: [Card] -> Bool -> Text -> RecipientCards'
RecipientCards'
    { recipientCards'Data :: [Card]
recipientCards'Data = [Card]
recipientCards'Data,
      recipientCards'HasMore :: Bool
recipientCards'HasMore = Bool
recipientCards'HasMore,
      recipientCards'Url :: Text
recipientCards'Url = Text
recipientCards'Url
    }

-- | Defines the oneOf schema located at @components.schemas.recipient.properties.default_card.anyOf@ in the specification.
--
-- The default card to use for creating transfers to this recipient.
data RecipientDefaultCard'Variants
  = RecipientDefaultCard'Text Data.Text.Internal.Text
  | RecipientDefaultCard'Card Card
  deriving (Int -> RecipientDefaultCard'Variants -> ShowS
[RecipientDefaultCard'Variants] -> ShowS
RecipientDefaultCard'Variants -> String
(Int -> RecipientDefaultCard'Variants -> ShowS)
-> (RecipientDefaultCard'Variants -> String)
-> ([RecipientDefaultCard'Variants] -> ShowS)
-> Show RecipientDefaultCard'Variants
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [RecipientDefaultCard'Variants] -> ShowS
$cshowList :: [RecipientDefaultCard'Variants] -> ShowS
show :: RecipientDefaultCard'Variants -> String
$cshow :: RecipientDefaultCard'Variants -> String
showsPrec :: Int -> RecipientDefaultCard'Variants -> ShowS
$cshowsPrec :: Int -> RecipientDefaultCard'Variants -> ShowS
GHC.Show.Show, RecipientDefaultCard'Variants
-> RecipientDefaultCard'Variants -> Bool
(RecipientDefaultCard'Variants
 -> RecipientDefaultCard'Variants -> Bool)
-> (RecipientDefaultCard'Variants
    -> RecipientDefaultCard'Variants -> Bool)
-> Eq RecipientDefaultCard'Variants
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: RecipientDefaultCard'Variants
-> RecipientDefaultCard'Variants -> Bool
$c/= :: RecipientDefaultCard'Variants
-> RecipientDefaultCard'Variants -> Bool
== :: RecipientDefaultCard'Variants
-> RecipientDefaultCard'Variants -> Bool
$c== :: RecipientDefaultCard'Variants
-> RecipientDefaultCard'Variants -> Bool
GHC.Classes.Eq)

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

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

-- | Defines the oneOf schema located at @components.schemas.recipient.properties.migrated_to.anyOf@ in the specification.
--
-- The ID of the [Custom account](https:\/\/stripe.com\/docs\/connect\/custom-accounts) this recipient was migrated to. If set, the recipient can no longer be updated, nor can transfers be made to it: use the Custom account instead.
data RecipientMigratedTo'Variants
  = RecipientMigratedTo'Text Data.Text.Internal.Text
  | RecipientMigratedTo'Account Account
  deriving (Int -> RecipientMigratedTo'Variants -> ShowS
[RecipientMigratedTo'Variants] -> ShowS
RecipientMigratedTo'Variants -> String
(Int -> RecipientMigratedTo'Variants -> ShowS)
-> (RecipientMigratedTo'Variants -> String)
-> ([RecipientMigratedTo'Variants] -> ShowS)
-> Show RecipientMigratedTo'Variants
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [RecipientMigratedTo'Variants] -> ShowS
$cshowList :: [RecipientMigratedTo'Variants] -> ShowS
show :: RecipientMigratedTo'Variants -> String
$cshow :: RecipientMigratedTo'Variants -> String
showsPrec :: Int -> RecipientMigratedTo'Variants -> ShowS
$cshowsPrec :: Int -> RecipientMigratedTo'Variants -> ShowS
GHC.Show.Show, RecipientMigratedTo'Variants
-> RecipientMigratedTo'Variants -> Bool
(RecipientMigratedTo'Variants
 -> RecipientMigratedTo'Variants -> Bool)
-> (RecipientMigratedTo'Variants
    -> RecipientMigratedTo'Variants -> Bool)
-> Eq RecipientMigratedTo'Variants
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: RecipientMigratedTo'Variants
-> RecipientMigratedTo'Variants -> Bool
$c/= :: RecipientMigratedTo'Variants
-> RecipientMigratedTo'Variants -> Bool
== :: RecipientMigratedTo'Variants
-> RecipientMigratedTo'Variants -> Bool
$c== :: RecipientMigratedTo'Variants
-> RecipientMigratedTo'Variants -> Bool
GHC.Classes.Eq)

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

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

-- | Defines the oneOf schema located at @components.schemas.recipient.properties.rolled_back_from.anyOf@ in the specification.
data RecipientRolledBackFrom'Variants
  = RecipientRolledBackFrom'Text Data.Text.Internal.Text
  | RecipientRolledBackFrom'Account Account
  deriving (Int -> RecipientRolledBackFrom'Variants -> ShowS
[RecipientRolledBackFrom'Variants] -> ShowS
RecipientRolledBackFrom'Variants -> String
(Int -> RecipientRolledBackFrom'Variants -> ShowS)
-> (RecipientRolledBackFrom'Variants -> String)
-> ([RecipientRolledBackFrom'Variants] -> ShowS)
-> Show RecipientRolledBackFrom'Variants
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [RecipientRolledBackFrom'Variants] -> ShowS
$cshowList :: [RecipientRolledBackFrom'Variants] -> ShowS
show :: RecipientRolledBackFrom'Variants -> String
$cshow :: RecipientRolledBackFrom'Variants -> String
showsPrec :: Int -> RecipientRolledBackFrom'Variants -> ShowS
$cshowsPrec :: Int -> RecipientRolledBackFrom'Variants -> ShowS
GHC.Show.Show, RecipientRolledBackFrom'Variants
-> RecipientRolledBackFrom'Variants -> Bool
(RecipientRolledBackFrom'Variants
 -> RecipientRolledBackFrom'Variants -> Bool)
-> (RecipientRolledBackFrom'Variants
    -> RecipientRolledBackFrom'Variants -> Bool)
-> Eq RecipientRolledBackFrom'Variants
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: RecipientRolledBackFrom'Variants
-> RecipientRolledBackFrom'Variants -> Bool
$c/= :: RecipientRolledBackFrom'Variants
-> RecipientRolledBackFrom'Variants -> Bool
== :: RecipientRolledBackFrom'Variants
-> RecipientRolledBackFrom'Variants -> Bool
$c== :: RecipientRolledBackFrom'Variants
-> RecipientRolledBackFrom'Variants -> Bool
GHC.Classes.Eq)

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

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