{-# LANGUAGE MultiWayIf #-}
{-# LANGUAGE OverloadedStrings #-}
module StripeAPI.Types.AccountRequirements 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.AccountRequirementsError
import qualified Prelude as GHC.Integer.Type
import qualified Prelude as GHC.Maybe
data AccountRequirements = AccountRequirements
{
AccountRequirements -> Maybe Int
accountRequirementsCurrentDeadline :: (GHC.Maybe.Maybe GHC.Types.Int),
AccountRequirements -> Maybe [Text]
accountRequirementsCurrentlyDue :: (GHC.Maybe.Maybe ([Data.Text.Internal.Text])),
AccountRequirements -> Maybe Text
accountRequirementsDisabledReason :: (GHC.Maybe.Maybe Data.Text.Internal.Text),
AccountRequirements -> Maybe [AccountRequirementsError]
accountRequirementsErrors :: (GHC.Maybe.Maybe ([AccountRequirementsError])),
AccountRequirements -> Maybe [Text]
accountRequirementsEventuallyDue :: (GHC.Maybe.Maybe ([Data.Text.Internal.Text])),
AccountRequirements -> Maybe [Text]
accountRequirementsPastDue :: (GHC.Maybe.Maybe ([Data.Text.Internal.Text])),
AccountRequirements -> Maybe [Text]
accountRequirementsPendingVerification :: (GHC.Maybe.Maybe ([Data.Text.Internal.Text]))
}
deriving
( Int -> AccountRequirements -> ShowS
[AccountRequirements] -> ShowS
AccountRequirements -> String
(Int -> AccountRequirements -> ShowS)
-> (AccountRequirements -> String)
-> ([AccountRequirements] -> ShowS)
-> Show AccountRequirements
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AccountRequirements] -> ShowS
$cshowList :: [AccountRequirements] -> ShowS
show :: AccountRequirements -> String
$cshow :: AccountRequirements -> String
showsPrec :: Int -> AccountRequirements -> ShowS
$cshowsPrec :: Int -> AccountRequirements -> ShowS
GHC.Show.Show,
AccountRequirements -> AccountRequirements -> Bool
(AccountRequirements -> AccountRequirements -> Bool)
-> (AccountRequirements -> AccountRequirements -> Bool)
-> Eq AccountRequirements
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AccountRequirements -> AccountRequirements -> Bool
$c/= :: AccountRequirements -> AccountRequirements -> Bool
== :: AccountRequirements -> AccountRequirements -> Bool
$c== :: AccountRequirements -> AccountRequirements -> Bool
GHC.Classes.Eq
)
instance Data.Aeson.Types.ToJSON.ToJSON AccountRequirements where
toJSON :: AccountRequirements -> Value
toJSON AccountRequirements
obj = [Pair] -> Value
Data.Aeson.Types.Internal.object (Text
"current_deadline" Text -> Maybe Int -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= AccountRequirements -> Maybe Int
accountRequirementsCurrentDeadline AccountRequirements
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"currently_due" Text -> Maybe [Text] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= AccountRequirements -> Maybe [Text]
accountRequirementsCurrentlyDue AccountRequirements
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"disabled_reason" Text -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= AccountRequirements -> Maybe Text
accountRequirementsDisabledReason AccountRequirements
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"errors" Text -> Maybe [AccountRequirementsError] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= AccountRequirements -> Maybe [AccountRequirementsError]
accountRequirementsErrors AccountRequirements
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"eventually_due" Text -> Maybe [Text] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= AccountRequirements -> Maybe [Text]
accountRequirementsEventuallyDue AccountRequirements
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"past_due" Text -> Maybe [Text] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= AccountRequirements -> Maybe [Text]
accountRequirementsPastDue AccountRequirements
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"pending_verification" Text -> Maybe [Text] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= AccountRequirements -> Maybe [Text]
accountRequirementsPendingVerification AccountRequirements
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: [Pair]
forall a. Monoid a => a
GHC.Base.mempty)
toEncoding :: AccountRequirements -> Encoding
toEncoding AccountRequirements
obj = Series -> Encoding
Data.Aeson.Encoding.Internal.pairs ((Text
"current_deadline" Text -> Maybe Int -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= AccountRequirements -> Maybe Int
accountRequirementsCurrentDeadline AccountRequirements
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"currently_due" Text -> Maybe [Text] -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= AccountRequirements -> Maybe [Text]
accountRequirementsCurrentlyDue AccountRequirements
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"disabled_reason" Text -> Maybe Text -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= AccountRequirements -> Maybe Text
accountRequirementsDisabledReason AccountRequirements
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"errors" Text -> Maybe [AccountRequirementsError] -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= AccountRequirements -> Maybe [AccountRequirementsError]
accountRequirementsErrors AccountRequirements
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"eventually_due" Text -> Maybe [Text] -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= AccountRequirements -> Maybe [Text]
accountRequirementsEventuallyDue AccountRequirements
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"past_due" Text -> Maybe [Text] -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= AccountRequirements -> Maybe [Text]
accountRequirementsPastDue AccountRequirements
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> (Text
"pending_verification" Text -> Maybe [Text] -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= AccountRequirements -> Maybe [Text]
accountRequirementsPendingVerification AccountRequirements
obj)))))))
instance Data.Aeson.Types.FromJSON.FromJSON AccountRequirements where
parseJSON :: Value -> Parser AccountRequirements
parseJSON = String
-> (Object -> Parser AccountRequirements)
-> Value
-> Parser AccountRequirements
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.Aeson.Types.FromJSON.withObject String
"AccountRequirements" (\Object
obj -> (((((((Maybe Int
-> Maybe [Text]
-> Maybe Text
-> Maybe [AccountRequirementsError]
-> Maybe [Text]
-> Maybe [Text]
-> Maybe [Text]
-> AccountRequirements)
-> Parser
(Maybe Int
-> Maybe [Text]
-> Maybe Text
-> Maybe [AccountRequirementsError]
-> Maybe [Text]
-> Maybe [Text]
-> Maybe [Text]
-> AccountRequirements)
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure Maybe Int
-> Maybe [Text]
-> Maybe Text
-> Maybe [AccountRequirementsError]
-> Maybe [Text]
-> Maybe [Text]
-> Maybe [Text]
-> AccountRequirements
AccountRequirements Parser
(Maybe Int
-> Maybe [Text]
-> Maybe Text
-> Maybe [AccountRequirementsError]
-> Maybe [Text]
-> Maybe [Text]
-> Maybe [Text]
-> AccountRequirements)
-> Parser (Maybe Int)
-> Parser
(Maybe [Text]
-> Maybe Text
-> Maybe [AccountRequirementsError]
-> Maybe [Text]
-> Maybe [Text]
-> Maybe [Text]
-> AccountRequirements)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Text -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Text
"current_deadline")) Parser
(Maybe [Text]
-> Maybe Text
-> Maybe [AccountRequirementsError]
-> Maybe [Text]
-> Maybe [Text]
-> Maybe [Text]
-> AccountRequirements)
-> Parser (Maybe [Text])
-> Parser
(Maybe Text
-> Maybe [AccountRequirementsError]
-> Maybe [Text]
-> Maybe [Text]
-> Maybe [Text]
-> AccountRequirements)
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
"currently_due")) Parser
(Maybe Text
-> Maybe [AccountRequirementsError]
-> Maybe [Text]
-> Maybe [Text]
-> Maybe [Text]
-> AccountRequirements)
-> Parser (Maybe Text)
-> Parser
(Maybe [AccountRequirementsError]
-> Maybe [Text]
-> Maybe [Text]
-> Maybe [Text]
-> AccountRequirements)
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
"disabled_reason")) Parser
(Maybe [AccountRequirementsError]
-> Maybe [Text]
-> Maybe [Text]
-> Maybe [Text]
-> AccountRequirements)
-> Parser (Maybe [AccountRequirementsError])
-> Parser
(Maybe [Text]
-> Maybe [Text] -> Maybe [Text] -> AccountRequirements)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Text -> Parser (Maybe [AccountRequirementsError])
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Text
"errors")) Parser
(Maybe [Text]
-> Maybe [Text] -> Maybe [Text] -> AccountRequirements)
-> Parser (Maybe [Text])
-> Parser (Maybe [Text] -> Maybe [Text] -> AccountRequirements)
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
"eventually_due")) Parser (Maybe [Text] -> Maybe [Text] -> AccountRequirements)
-> Parser (Maybe [Text])
-> Parser (Maybe [Text] -> AccountRequirements)
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
"past_due")) Parser (Maybe [Text] -> AccountRequirements)
-> Parser (Maybe [Text]) -> Parser AccountRequirements
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
"pending_verification"))
mkAccountRequirements :: AccountRequirements
mkAccountRequirements :: AccountRequirements
mkAccountRequirements =
AccountRequirements :: Maybe Int
-> Maybe [Text]
-> Maybe Text
-> Maybe [AccountRequirementsError]
-> Maybe [Text]
-> Maybe [Text]
-> Maybe [Text]
-> AccountRequirements
AccountRequirements
{ accountRequirementsCurrentDeadline :: Maybe Int
accountRequirementsCurrentDeadline = Maybe Int
forall a. Maybe a
GHC.Maybe.Nothing,
accountRequirementsCurrentlyDue :: Maybe [Text]
accountRequirementsCurrentlyDue = Maybe [Text]
forall a. Maybe a
GHC.Maybe.Nothing,
accountRequirementsDisabledReason :: Maybe Text
accountRequirementsDisabledReason = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing,
accountRequirementsErrors :: Maybe [AccountRequirementsError]
accountRequirementsErrors = Maybe [AccountRequirementsError]
forall a. Maybe a
GHC.Maybe.Nothing,
accountRequirementsEventuallyDue :: Maybe [Text]
accountRequirementsEventuallyDue = Maybe [Text]
forall a. Maybe a
GHC.Maybe.Nothing,
accountRequirementsPastDue :: Maybe [Text]
accountRequirementsPastDue = Maybe [Text]
forall a. Maybe a
GHC.Maybe.Nothing,
accountRequirementsPendingVerification :: Maybe [Text]
accountRequirementsPendingVerification = Maybe [Text]
forall a. Maybe a
GHC.Maybe.Nothing
}