{-# 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 SourceReceiverFlow module StripeAPI.Types.SourceReceiverFlow 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 qualified Prelude as GHC.Integer.Type import qualified Prelude as GHC.Maybe -- | Defines the object schema located at @components.schemas.source_receiver_flow@ in the specification. data SourceReceiverFlow = SourceReceiverFlow { -- | address: The address of the receiver source. This is the value that should be communicated to the customer to send their funds to. -- -- Constraints: -- -- * Maximum length of 5000 sourceReceiverFlowAddress :: (GHC.Maybe.Maybe Data.Text.Internal.Text), -- | amount_charged: The total amount that was moved to your balance. This is almost always equal to the amount charged. In rare cases when customers deposit excess funds and we are unable to refund those, those funds get moved to your balance and show up in amount_charged as well. The amount charged is expressed in the source\'s currency. sourceReceiverFlowAmountCharged :: GHC.Types.Int, -- | amount_received: The total amount received by the receiver source. \`amount_received = amount_returned + amount_charged\` should be true for consumed sources unless customers deposit excess funds. The amount received is expressed in the source\'s currency. sourceReceiverFlowAmountReceived :: GHC.Types.Int, -- | amount_returned: The total amount that was returned to the customer. The amount returned is expressed in the source\'s currency. sourceReceiverFlowAmountReturned :: GHC.Types.Int, -- | refund_attributes_method: Type of refund attribute method, one of \`email\`, \`manual\`, or \`none\`. -- -- Constraints: -- -- * Maximum length of 5000 sourceReceiverFlowRefundAttributesMethod :: Data.Text.Internal.Text, -- | refund_attributes_status: Type of refund attribute status, one of \`missing\`, \`requested\`, or \`available\`. -- -- Constraints: -- -- * Maximum length of 5000 sourceReceiverFlowRefundAttributesStatus :: Data.Text.Internal.Text } deriving ( GHC.Show.Show, GHC.Classes.Eq ) instance Data.Aeson.Types.ToJSON.ToJSON SourceReceiverFlow where toJSON obj = Data.Aeson.Types.Internal.object ("address" Data.Aeson.Types.ToJSON..= sourceReceiverFlowAddress obj : "amount_charged" Data.Aeson.Types.ToJSON..= sourceReceiverFlowAmountCharged obj : "amount_received" Data.Aeson.Types.ToJSON..= sourceReceiverFlowAmountReceived obj : "amount_returned" Data.Aeson.Types.ToJSON..= sourceReceiverFlowAmountReturned obj : "refund_attributes_method" Data.Aeson.Types.ToJSON..= sourceReceiverFlowRefundAttributesMethod obj : "refund_attributes_status" Data.Aeson.Types.ToJSON..= sourceReceiverFlowRefundAttributesStatus obj : GHC.Base.mempty) toEncoding obj = Data.Aeson.Encoding.Internal.pairs (("address" Data.Aeson.Types.ToJSON..= sourceReceiverFlowAddress obj) GHC.Base.<> (("amount_charged" Data.Aeson.Types.ToJSON..= sourceReceiverFlowAmountCharged obj) GHC.Base.<> (("amount_received" Data.Aeson.Types.ToJSON..= sourceReceiverFlowAmountReceived obj) GHC.Base.<> (("amount_returned" Data.Aeson.Types.ToJSON..= sourceReceiverFlowAmountReturned obj) GHC.Base.<> (("refund_attributes_method" Data.Aeson.Types.ToJSON..= sourceReceiverFlowRefundAttributesMethod obj) GHC.Base.<> ("refund_attributes_status" Data.Aeson.Types.ToJSON..= sourceReceiverFlowRefundAttributesStatus obj)))))) instance Data.Aeson.Types.FromJSON.FromJSON SourceReceiverFlow where parseJSON = Data.Aeson.Types.FromJSON.withObject "SourceReceiverFlow" (\obj -> (((((GHC.Base.pure SourceReceiverFlow GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:? "address")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..: "amount_charged")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..: "amount_received")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..: "amount_returned")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..: "refund_attributes_method")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..: "refund_attributes_status")) -- | Create a new 'SourceReceiverFlow' with all required fields. mkSourceReceiverFlow :: -- | 'sourceReceiverFlowAmountCharged' GHC.Types.Int -> -- | 'sourceReceiverFlowAmountReceived' GHC.Types.Int -> -- | 'sourceReceiverFlowAmountReturned' GHC.Types.Int -> -- | 'sourceReceiverFlowRefundAttributesMethod' Data.Text.Internal.Text -> -- | 'sourceReceiverFlowRefundAttributesStatus' Data.Text.Internal.Text -> SourceReceiverFlow mkSourceReceiverFlow sourceReceiverFlowAmountCharged sourceReceiverFlowAmountReceived sourceReceiverFlowAmountReturned sourceReceiverFlowRefundAttributesMethod sourceReceiverFlowRefundAttributesStatus = SourceReceiverFlow { sourceReceiverFlowAddress = GHC.Maybe.Nothing, sourceReceiverFlowAmountCharged = sourceReceiverFlowAmountCharged, sourceReceiverFlowAmountReceived = sourceReceiverFlowAmountReceived, sourceReceiverFlowAmountReturned = sourceReceiverFlowAmountReturned, sourceReceiverFlowRefundAttributesMethod = sourceReceiverFlowRefundAttributesMethod, sourceReceiverFlowRefundAttributesStatus = sourceReceiverFlowRefundAttributesStatus }