{-# 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 AccountFutureRequirements module StripeAPI.Types.AccountFutureRequirements 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.Foldable import qualified Data.Functor import qualified Data.Maybe 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.AccountRequirementsAlternative import {-# SOURCE #-} StripeAPI.Types.AccountRequirementsError import qualified Prelude as GHC.Integer.Type import qualified Prelude as GHC.Maybe -- | Defines the object schema located at @components.schemas.account_future_requirements@ in the specification. data AccountFutureRequirements = AccountFutureRequirements { -- | alternatives: Fields that are due and can be satisfied by providing the corresponding alternative fields instead. accountFutureRequirementsAlternatives :: (GHC.Maybe.Maybe (StripeAPI.Common.Nullable ([AccountRequirementsAlternative]))), -- | current_deadline: Date on which \`future_requirements\` merges with the main \`requirements\` hash and \`future_requirements\` becomes empty. After the transition, \`currently_due\` requirements may immediately become \`past_due\`, but the account may also be given a grace period depending on its enablement state prior to transitioning. accountFutureRequirementsCurrentDeadline :: (GHC.Maybe.Maybe (StripeAPI.Common.Nullable GHC.Types.Int)), -- | currently_due: Fields that need to be collected to keep the account enabled. If not collected by \`future_requirements[current_deadline]\`, these fields will transition to the main \`requirements\` hash. accountFutureRequirementsCurrentlyDue :: (GHC.Maybe.Maybe (StripeAPI.Common.Nullable ([Data.Text.Internal.Text]))), -- | disabled_reason: This is typed as a string for consistency with \`requirements.disabled_reason\`, but it safe to assume \`future_requirements.disabled_reason\` is empty because fields in \`future_requirements\` will never disable the account. -- -- Constraints: -- -- * Maximum length of 5000 accountFutureRequirementsDisabledReason :: (GHC.Maybe.Maybe (StripeAPI.Common.Nullable Data.Text.Internal.Text)), -- | errors: Fields that are \`currently_due\` and need to be collected again because validation or verification failed. accountFutureRequirementsErrors :: (GHC.Maybe.Maybe (StripeAPI.Common.Nullable ([AccountRequirementsError]))), -- | eventually_due: Fields that need to be collected assuming all volume thresholds are reached. As they become required, they appear in \`currently_due\` as well. accountFutureRequirementsEventuallyDue :: (GHC.Maybe.Maybe (StripeAPI.Common.Nullable ([Data.Text.Internal.Text]))), -- | past_due: Fields that weren\'t collected by \`requirements.current_deadline\`. These fields need to be collected to enable the capability on the account. New fields will never appear here; \`future_requirements.past_due\` will always be a subset of \`requirements.past_due\`. accountFutureRequirementsPastDue :: (GHC.Maybe.Maybe (StripeAPI.Common.Nullable ([Data.Text.Internal.Text]))), -- | pending_verification: Fields that may become required depending on the results of verification or review. Will be an empty array unless an asynchronous verification is pending. If verification fails, these fields move to \`eventually_due\` or \`currently_due\`. accountFutureRequirementsPendingVerification :: (GHC.Maybe.Maybe (StripeAPI.Common.Nullable ([Data.Text.Internal.Text]))) } deriving ( GHC.Show.Show, GHC.Classes.Eq ) instance Data.Aeson.Types.ToJSON.ToJSON AccountFutureRequirements where toJSON obj = Data.Aeson.Types.Internal.object (Data.Foldable.concat (Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("alternatives" Data.Aeson.Types.ToJSON..=)) (accountFutureRequirementsAlternatives obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("current_deadline" Data.Aeson.Types.ToJSON..=)) (accountFutureRequirementsCurrentDeadline obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("currently_due" Data.Aeson.Types.ToJSON..=)) (accountFutureRequirementsCurrentlyDue obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("disabled_reason" Data.Aeson.Types.ToJSON..=)) (accountFutureRequirementsDisabledReason obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("errors" Data.Aeson.Types.ToJSON..=)) (accountFutureRequirementsErrors obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("eventually_due" Data.Aeson.Types.ToJSON..=)) (accountFutureRequirementsEventuallyDue obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("past_due" Data.Aeson.Types.ToJSON..=)) (accountFutureRequirementsPastDue obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("pending_verification" Data.Aeson.Types.ToJSON..=)) (accountFutureRequirementsPendingVerification obj) : GHC.Base.mempty)) toEncoding obj = Data.Aeson.Encoding.Internal.pairs (GHC.Base.mconcat (Data.Foldable.concat (Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("alternatives" Data.Aeson.Types.ToJSON..=)) (accountFutureRequirementsAlternatives obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("current_deadline" Data.Aeson.Types.ToJSON..=)) (accountFutureRequirementsCurrentDeadline obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("currently_due" Data.Aeson.Types.ToJSON..=)) (accountFutureRequirementsCurrentlyDue obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("disabled_reason" Data.Aeson.Types.ToJSON..=)) (accountFutureRequirementsDisabledReason obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("errors" Data.Aeson.Types.ToJSON..=)) (accountFutureRequirementsErrors obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("eventually_due" Data.Aeson.Types.ToJSON..=)) (accountFutureRequirementsEventuallyDue obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("past_due" Data.Aeson.Types.ToJSON..=)) (accountFutureRequirementsPastDue obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("pending_verification" Data.Aeson.Types.ToJSON..=)) (accountFutureRequirementsPendingVerification obj) : GHC.Base.mempty))) instance Data.Aeson.Types.FromJSON.FromJSON AccountFutureRequirements where parseJSON = Data.Aeson.Types.FromJSON.withObject "AccountFutureRequirements" (\obj -> (((((((GHC.Base.pure AccountFutureRequirements GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "alternatives")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "current_deadline")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "currently_due")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "disabled_reason")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "errors")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "eventually_due")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "past_due")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "pending_verification")) -- | Create a new 'AccountFutureRequirements' with all required fields. mkAccountFutureRequirements :: AccountFutureRequirements mkAccountFutureRequirements = AccountFutureRequirements { accountFutureRequirementsAlternatives = GHC.Maybe.Nothing, accountFutureRequirementsCurrentDeadline = GHC.Maybe.Nothing, accountFutureRequirementsCurrentlyDue = GHC.Maybe.Nothing, accountFutureRequirementsDisabledReason = GHC.Maybe.Nothing, accountFutureRequirementsErrors = GHC.Maybe.Nothing, accountFutureRequirementsEventuallyDue = GHC.Maybe.Nothing, accountFutureRequirementsPastDue = GHC.Maybe.Nothing, accountFutureRequirementsPendingVerification = GHC.Maybe.Nothing }