{-# 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. recipientActiveAccount :: (GHC.Maybe.Maybe RecipientActiveAccount'), -- | cards: recipientCards :: (GHC.Maybe.Maybe RecipientCards'), -- | created: Time at which the object was created. Measured in seconds since the Unix epoch. recipientCreated :: GHC.Types.Int, -- | default_card: The default card to use for creating transfers to this recipient. 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 recipientDescription :: (GHC.Maybe.Maybe Data.Text.Internal.Text), -- | email -- -- Constraints: -- -- * Maximum length of 5000 recipientEmail :: (GHC.Maybe.Maybe Data.Text.Internal.Text), -- | id: Unique identifier for the object. -- -- Constraints: -- -- * Maximum length of 5000 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. 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. 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. recipientMigratedTo :: (GHC.Maybe.Maybe RecipientMigratedTo'Variants), -- | name: Full, legal name of the recipient. -- -- Constraints: -- -- * Maximum length of 5000 recipientName :: (GHC.Maybe.Maybe Data.Text.Internal.Text), -- | rolled_back_from recipientRolledBackFrom :: (GHC.Maybe.Maybe RecipientRolledBackFrom'Variants), -- | type: Type of the recipient, one of \`individual\` or \`corporation\`. -- -- Constraints: -- -- * Maximum length of 5000 recipientType :: Data.Text.Internal.Text } deriving ( GHC.Show.Show, GHC.Classes.Eq ) instance Data.Aeson.Types.ToJSON.ToJSON Recipient where toJSON obj = Data.Aeson.Types.Internal.object ("active_account" Data.Aeson.Types.ToJSON..= recipientActiveAccount obj : "cards" Data.Aeson.Types.ToJSON..= recipientCards obj : "created" Data.Aeson.Types.ToJSON..= recipientCreated obj : "default_card" Data.Aeson.Types.ToJSON..= recipientDefaultCard obj : "description" Data.Aeson.Types.ToJSON..= recipientDescription obj : "email" Data.Aeson.Types.ToJSON..= recipientEmail obj : "id" Data.Aeson.Types.ToJSON..= recipientId obj : "livemode" Data.Aeson.Types.ToJSON..= recipientLivemode obj : "metadata" Data.Aeson.Types.ToJSON..= recipientMetadata obj : "migrated_to" Data.Aeson.Types.ToJSON..= recipientMigratedTo obj : "name" Data.Aeson.Types.ToJSON..= recipientName obj : "rolled_back_from" Data.Aeson.Types.ToJSON..= recipientRolledBackFrom obj : "type" Data.Aeson.Types.ToJSON..= recipientType obj : "object" Data.Aeson.Types.ToJSON..= Data.Aeson.Types.Internal.String "recipient" : GHC.Base.mempty) toEncoding obj = Data.Aeson.Encoding.Internal.pairs (("active_account" Data.Aeson.Types.ToJSON..= recipientActiveAccount obj) GHC.Base.<> (("cards" Data.Aeson.Types.ToJSON..= recipientCards obj) GHC.Base.<> (("created" Data.Aeson.Types.ToJSON..= recipientCreated obj) GHC.Base.<> (("default_card" Data.Aeson.Types.ToJSON..= recipientDefaultCard obj) GHC.Base.<> (("description" Data.Aeson.Types.ToJSON..= recipientDescription obj) GHC.Base.<> (("email" Data.Aeson.Types.ToJSON..= recipientEmail obj) GHC.Base.<> (("id" Data.Aeson.Types.ToJSON..= recipientId obj) GHC.Base.<> (("livemode" Data.Aeson.Types.ToJSON..= recipientLivemode obj) GHC.Base.<> (("metadata" Data.Aeson.Types.ToJSON..= recipientMetadata obj) GHC.Base.<> (("migrated_to" Data.Aeson.Types.ToJSON..= recipientMigratedTo obj) GHC.Base.<> (("name" Data.Aeson.Types.ToJSON..= recipientName obj) GHC.Base.<> (("rolled_back_from" Data.Aeson.Types.ToJSON..= recipientRolledBackFrom obj) GHC.Base.<> (("type" Data.Aeson.Types.ToJSON..= recipientType obj) GHC.Base.<> ("object" Data.Aeson.Types.ToJSON..= Data.Aeson.Types.Internal.String "recipient")))))))))))))) instance Data.Aeson.Types.FromJSON.FromJSON Recipient where parseJSON = Data.Aeson.Types.FromJSON.withObject "Recipient" (\obj -> ((((((((((((GHC.Base.pure Recipient GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "active_account")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "cards")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..: "created")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "default_card")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "description")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "email")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..: "id")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..: "livemode")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..: "metadata")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "migrated_to")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "name")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "rolled_back_from")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..: "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 recipientCreated recipientId recipientLivemode recipientMetadata recipientType = Recipient { recipientActiveAccount = GHC.Maybe.Nothing, recipientCards = GHC.Maybe.Nothing, recipientCreated = recipientCreated, recipientDefaultCard = GHC.Maybe.Nothing, recipientDescription = GHC.Maybe.Nothing, recipientEmail = GHC.Maybe.Nothing, recipientId = recipientId, recipientLivemode = recipientLivemode, recipientMetadata = recipientMetadata, recipientMigratedTo = GHC.Maybe.Nothing, recipientName = GHC.Maybe.Nothing, recipientRolledBackFrom = GHC.Maybe.Nothing, recipientType = 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'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'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'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'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'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'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'Currency :: (GHC.Maybe.Maybe Data.Text.Internal.Text), -- | customer: The ID of the customer that the bank account is associated with. recipientActiveAccount'Customer :: (GHC.Maybe.Maybe RecipientActiveAccount'Customer'Variants), -- | default_for_currency: Whether this bank account is the default external account for its currency. 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'Fingerprint :: (GHC.Maybe.Maybe Data.Text.Internal.Text), -- | id: Unique identifier for the object. -- -- Constraints: -- -- * Maximum length of 5000 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'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'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'Object :: (GHC.Maybe.Maybe RecipientActiveAccount'Object'), -- | routing_number: The routing transit number for the bank account. -- -- Constraints: -- -- * Maximum length of 5000 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'Status :: (GHC.Maybe.Maybe Data.Text.Internal.Text) } deriving ( GHC.Show.Show, GHC.Classes.Eq ) instance Data.Aeson.Types.ToJSON.ToJSON RecipientActiveAccount' where toJSON obj = Data.Aeson.Types.Internal.object ("account" Data.Aeson.Types.ToJSON..= recipientActiveAccount'Account obj : "account_holder_name" Data.Aeson.Types.ToJSON..= recipientActiveAccount'AccountHolderName obj : "account_holder_type" Data.Aeson.Types.ToJSON..= recipientActiveAccount'AccountHolderType obj : "available_payout_methods" Data.Aeson.Types.ToJSON..= recipientActiveAccount'AvailablePayoutMethods obj : "bank_name" Data.Aeson.Types.ToJSON..= recipientActiveAccount'BankName obj : "country" Data.Aeson.Types.ToJSON..= recipientActiveAccount'Country obj : "currency" Data.Aeson.Types.ToJSON..= recipientActiveAccount'Currency obj : "customer" Data.Aeson.Types.ToJSON..= recipientActiveAccount'Customer obj : "default_for_currency" Data.Aeson.Types.ToJSON..= recipientActiveAccount'DefaultForCurrency obj : "fingerprint" Data.Aeson.Types.ToJSON..= recipientActiveAccount'Fingerprint obj : "id" Data.Aeson.Types.ToJSON..= recipientActiveAccount'Id obj : "last4" Data.Aeson.Types.ToJSON..= recipientActiveAccount'Last4 obj : "metadata" Data.Aeson.Types.ToJSON..= recipientActiveAccount'Metadata obj : "object" Data.Aeson.Types.ToJSON..= recipientActiveAccount'Object obj : "routing_number" Data.Aeson.Types.ToJSON..= recipientActiveAccount'RoutingNumber obj : "status" Data.Aeson.Types.ToJSON..= recipientActiveAccount'Status obj : GHC.Base.mempty) toEncoding obj = Data.Aeson.Encoding.Internal.pairs (("account" Data.Aeson.Types.ToJSON..= recipientActiveAccount'Account obj) GHC.Base.<> (("account_holder_name" Data.Aeson.Types.ToJSON..= recipientActiveAccount'AccountHolderName obj) GHC.Base.<> (("account_holder_type" Data.Aeson.Types.ToJSON..= recipientActiveAccount'AccountHolderType obj) GHC.Base.<> (("available_payout_methods" Data.Aeson.Types.ToJSON..= recipientActiveAccount'AvailablePayoutMethods obj) GHC.Base.<> (("bank_name" Data.Aeson.Types.ToJSON..= recipientActiveAccount'BankName obj) GHC.Base.<> (("country" Data.Aeson.Types.ToJSON..= recipientActiveAccount'Country obj) GHC.Base.<> (("currency" Data.Aeson.Types.ToJSON..= recipientActiveAccount'Currency obj) GHC.Base.<> (("customer" Data.Aeson.Types.ToJSON..= recipientActiveAccount'Customer obj) GHC.Base.<> (("default_for_currency" Data.Aeson.Types.ToJSON..= recipientActiveAccount'DefaultForCurrency obj) GHC.Base.<> (("fingerprint" Data.Aeson.Types.ToJSON..= recipientActiveAccount'Fingerprint obj) GHC.Base.<> (("id" Data.Aeson.Types.ToJSON..= recipientActiveAccount'Id obj) GHC.Base.<> (("last4" Data.Aeson.Types.ToJSON..= recipientActiveAccount'Last4 obj) GHC.Base.<> (("metadata" Data.Aeson.Types.ToJSON..= recipientActiveAccount'Metadata obj) GHC.Base.<> (("object" Data.Aeson.Types.ToJSON..= recipientActiveAccount'Object obj) GHC.Base.<> (("routing_number" Data.Aeson.Types.ToJSON..= recipientActiveAccount'RoutingNumber obj) GHC.Base.<> ("status" Data.Aeson.Types.ToJSON..= recipientActiveAccount'Status obj)))))))))))))))) instance Data.Aeson.Types.FromJSON.FromJSON RecipientActiveAccount' where parseJSON = Data.Aeson.Types.FromJSON.withObject "RecipientActiveAccount'" (\obj -> (((((((((((((((GHC.Base.pure RecipientActiveAccount' GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "account")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "account_holder_name")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "account_holder_type")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "available_payout_methods")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "bank_name")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "country")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "currency")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "customer")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "default_for_currency")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "fingerprint")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "id")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "last4")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "metadata")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "object")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "routing_number")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "status")) -- | Create a new 'RecipientActiveAccount'' with all required fields. mkRecipientActiveAccount' :: RecipientActiveAccount' mkRecipientActiveAccount' = RecipientActiveAccount' { recipientActiveAccount'Account = GHC.Maybe.Nothing, recipientActiveAccount'AccountHolderName = GHC.Maybe.Nothing, recipientActiveAccount'AccountHolderType = GHC.Maybe.Nothing, recipientActiveAccount'AvailablePayoutMethods = GHC.Maybe.Nothing, recipientActiveAccount'BankName = GHC.Maybe.Nothing, recipientActiveAccount'Country = GHC.Maybe.Nothing, recipientActiveAccount'Currency = GHC.Maybe.Nothing, recipientActiveAccount'Customer = GHC.Maybe.Nothing, recipientActiveAccount'DefaultForCurrency = GHC.Maybe.Nothing, recipientActiveAccount'Fingerprint = GHC.Maybe.Nothing, recipientActiveAccount'Id = GHC.Maybe.Nothing, recipientActiveAccount'Last4 = GHC.Maybe.Nothing, recipientActiveAccount'Metadata = GHC.Maybe.Nothing, recipientActiveAccount'Object = GHC.Maybe.Nothing, recipientActiveAccount'RoutingNumber = GHC.Maybe.Nothing, recipientActiveAccount'Status = 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 (GHC.Show.Show, GHC.Classes.Eq) instance Data.Aeson.Types.ToJSON.ToJSON RecipientActiveAccount'Account'Variants where toJSON (RecipientActiveAccount'Account'Text a) = Data.Aeson.Types.ToJSON.toJSON a toJSON (RecipientActiveAccount'Account'Account a) = Data.Aeson.Types.ToJSON.toJSON a instance Data.Aeson.Types.FromJSON.FromJSON RecipientActiveAccount'Account'Variants where parseJSON val = case (RecipientActiveAccount'Account'Text Data.Functor.<$> Data.Aeson.Types.FromJSON.fromJSON val) GHC.Base.<|> ((RecipientActiveAccount'Account'Account Data.Functor.<$> Data.Aeson.Types.FromJSON.fromJSON val) GHC.Base.<|> Data.Aeson.Types.Internal.Error "No variant matched") of Data.Aeson.Types.Internal.Success a -> GHC.Base.pure a Data.Aeson.Types.Internal.Error a -> Control.Monad.Fail.fail 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 (GHC.Show.Show, GHC.Classes.Eq) instance Data.Aeson.Types.ToJSON.ToJSON RecipientActiveAccount'AvailablePayoutMethods' where toJSON (RecipientActiveAccount'AvailablePayoutMethods'Other val) = val toJSON (RecipientActiveAccount'AvailablePayoutMethods'Typed val) = Data.Aeson.Types.ToJSON.toJSON val toJSON (RecipientActiveAccount'AvailablePayoutMethods'EnumInstant) = "instant" toJSON (RecipientActiveAccount'AvailablePayoutMethods'EnumStandard) = "standard" instance Data.Aeson.Types.FromJSON.FromJSON RecipientActiveAccount'AvailablePayoutMethods' where parseJSON val = GHC.Base.pure ( if | val GHC.Classes.== "instant" -> RecipientActiveAccount'AvailablePayoutMethods'EnumInstant | val GHC.Classes.== "standard" -> RecipientActiveAccount'AvailablePayoutMethods'EnumStandard | GHC.Base.otherwise -> RecipientActiveAccount'AvailablePayoutMethods'Other 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 (GHC.Show.Show, GHC.Classes.Eq) instance Data.Aeson.Types.ToJSON.ToJSON RecipientActiveAccount'Customer'Variants where toJSON (RecipientActiveAccount'Customer'Text a) = Data.Aeson.Types.ToJSON.toJSON a toJSON (RecipientActiveAccount'Customer'Customer a) = Data.Aeson.Types.ToJSON.toJSON a toJSON (RecipientActiveAccount'Customer'DeletedCustomer a) = Data.Aeson.Types.ToJSON.toJSON a instance Data.Aeson.Types.FromJSON.FromJSON RecipientActiveAccount'Customer'Variants where parseJSON val = case (RecipientActiveAccount'Customer'Text Data.Functor.<$> Data.Aeson.Types.FromJSON.fromJSON val) GHC.Base.<|> ((RecipientActiveAccount'Customer'Customer Data.Functor.<$> Data.Aeson.Types.FromJSON.fromJSON val) GHC.Base.<|> ((RecipientActiveAccount'Customer'DeletedCustomer Data.Functor.<$> Data.Aeson.Types.FromJSON.fromJSON val) GHC.Base.<|> Data.Aeson.Types.Internal.Error "No variant matched")) of Data.Aeson.Types.Internal.Success a -> GHC.Base.pure a Data.Aeson.Types.Internal.Error a -> Control.Monad.Fail.fail 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 (GHC.Show.Show, GHC.Classes.Eq) instance Data.Aeson.Types.ToJSON.ToJSON RecipientActiveAccount'Object' where toJSON (RecipientActiveAccount'Object'Other val) = val toJSON (RecipientActiveAccount'Object'Typed val) = Data.Aeson.Types.ToJSON.toJSON val toJSON (RecipientActiveAccount'Object'EnumBankAccount) = "bank_account" instance Data.Aeson.Types.FromJSON.FromJSON RecipientActiveAccount'Object' where parseJSON val = GHC.Base.pure ( if | val GHC.Classes.== "bank_account" -> RecipientActiveAccount'Object'EnumBankAccount | GHC.Base.otherwise -> RecipientActiveAccount'Object'Other val ) -- | Defines the object schema located at @components.schemas.recipient.properties.cards@ in the specification. data RecipientCards' = RecipientCards' { -- | data recipientCards'Data :: ([Card]), -- | has_more: True if this list has another page of items after this one that can be fetched. recipientCards'HasMore :: GHC.Types.Bool, -- | url: The URL where this list can be accessed. -- -- Constraints: -- -- * Maximum length of 5000 recipientCards'Url :: Data.Text.Internal.Text } deriving ( GHC.Show.Show, GHC.Classes.Eq ) instance Data.Aeson.Types.ToJSON.ToJSON RecipientCards' where toJSON obj = Data.Aeson.Types.Internal.object ("data" Data.Aeson.Types.ToJSON..= recipientCards'Data obj : "has_more" Data.Aeson.Types.ToJSON..= recipientCards'HasMore obj : "url" Data.Aeson.Types.ToJSON..= recipientCards'Url obj : "object" Data.Aeson.Types.ToJSON..= Data.Aeson.Types.Internal.String "list" : GHC.Base.mempty) toEncoding obj = Data.Aeson.Encoding.Internal.pairs (("data" Data.Aeson.Types.ToJSON..= recipientCards'Data obj) GHC.Base.<> (("has_more" Data.Aeson.Types.ToJSON..= recipientCards'HasMore obj) GHC.Base.<> (("url" Data.Aeson.Types.ToJSON..= recipientCards'Url obj) GHC.Base.<> ("object" Data.Aeson.Types.ToJSON..= Data.Aeson.Types.Internal.String "list")))) instance Data.Aeson.Types.FromJSON.FromJSON RecipientCards' where parseJSON = Data.Aeson.Types.FromJSON.withObject "RecipientCards'" (\obj -> ((GHC.Base.pure RecipientCards' GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..: "data")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..: "has_more")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..: "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' recipientCards'Data recipientCards'HasMore recipientCards'Url = RecipientCards' { recipientCards'Data = recipientCards'Data, recipientCards'HasMore = recipientCards'HasMore, recipientCards'Url = 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 (GHC.Show.Show, GHC.Classes.Eq) instance Data.Aeson.Types.ToJSON.ToJSON RecipientDefaultCard'Variants where toJSON (RecipientDefaultCard'Text a) = Data.Aeson.Types.ToJSON.toJSON a toJSON (RecipientDefaultCard'Card a) = Data.Aeson.Types.ToJSON.toJSON a instance Data.Aeson.Types.FromJSON.FromJSON RecipientDefaultCard'Variants where parseJSON val = case (RecipientDefaultCard'Text Data.Functor.<$> Data.Aeson.Types.FromJSON.fromJSON val) GHC.Base.<|> ((RecipientDefaultCard'Card Data.Functor.<$> Data.Aeson.Types.FromJSON.fromJSON val) GHC.Base.<|> Data.Aeson.Types.Internal.Error "No variant matched") of Data.Aeson.Types.Internal.Success a -> GHC.Base.pure a Data.Aeson.Types.Internal.Error a -> Control.Monad.Fail.fail 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 (GHC.Show.Show, GHC.Classes.Eq) instance Data.Aeson.Types.ToJSON.ToJSON RecipientMigratedTo'Variants where toJSON (RecipientMigratedTo'Text a) = Data.Aeson.Types.ToJSON.toJSON a toJSON (RecipientMigratedTo'Account a) = Data.Aeson.Types.ToJSON.toJSON a instance Data.Aeson.Types.FromJSON.FromJSON RecipientMigratedTo'Variants where parseJSON val = case (RecipientMigratedTo'Text Data.Functor.<$> Data.Aeson.Types.FromJSON.fromJSON val) GHC.Base.<|> ((RecipientMigratedTo'Account Data.Functor.<$> Data.Aeson.Types.FromJSON.fromJSON val) GHC.Base.<|> Data.Aeson.Types.Internal.Error "No variant matched") of Data.Aeson.Types.Internal.Success a -> GHC.Base.pure a Data.Aeson.Types.Internal.Error a -> Control.Monad.Fail.fail 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 (GHC.Show.Show, GHC.Classes.Eq) instance Data.Aeson.Types.ToJSON.ToJSON RecipientRolledBackFrom'Variants where toJSON (RecipientRolledBackFrom'Text a) = Data.Aeson.Types.ToJSON.toJSON a toJSON (RecipientRolledBackFrom'Account a) = Data.Aeson.Types.ToJSON.toJSON a instance Data.Aeson.Types.FromJSON.FromJSON RecipientRolledBackFrom'Variants where parseJSON val = case (RecipientRolledBackFrom'Text Data.Functor.<$> Data.Aeson.Types.FromJSON.fromJSON val) GHC.Base.<|> ((RecipientRolledBackFrom'Account Data.Functor.<$> Data.Aeson.Types.FromJSON.fromJSON val) GHC.Base.<|> Data.Aeson.Types.Internal.Error "No variant matched") of Data.Aeson.Types.Internal.Success a -> GHC.Base.pure a Data.Aeson.Types.Internal.Error a -> Control.Monad.Fail.fail a