{-# LANGUAGE MultiWayIf #-}
{-# LANGUAGE OverloadedStrings #-}
module StripeAPI.Types.SourceCodeVerificationFlow 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
data SourceCodeVerificationFlow = SourceCodeVerificationFlow
{
SourceCodeVerificationFlow -> Int
sourceCodeVerificationFlowAttemptsRemaining :: GHC.Types.Int,
SourceCodeVerificationFlow -> Text
sourceCodeVerificationFlowStatus :: Data.Text.Internal.Text
}
deriving
( Int -> SourceCodeVerificationFlow -> ShowS
[SourceCodeVerificationFlow] -> ShowS
SourceCodeVerificationFlow -> String
(Int -> SourceCodeVerificationFlow -> ShowS)
-> (SourceCodeVerificationFlow -> String)
-> ([SourceCodeVerificationFlow] -> ShowS)
-> Show SourceCodeVerificationFlow
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SourceCodeVerificationFlow] -> ShowS
$cshowList :: [SourceCodeVerificationFlow] -> ShowS
show :: SourceCodeVerificationFlow -> String
$cshow :: SourceCodeVerificationFlow -> String
showsPrec :: Int -> SourceCodeVerificationFlow -> ShowS
$cshowsPrec :: Int -> SourceCodeVerificationFlow -> ShowS
GHC.Show.Show,
SourceCodeVerificationFlow -> SourceCodeVerificationFlow -> Bool
(SourceCodeVerificationFlow -> SourceCodeVerificationFlow -> Bool)
-> (SourceCodeVerificationFlow
-> SourceCodeVerificationFlow -> Bool)
-> Eq SourceCodeVerificationFlow
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SourceCodeVerificationFlow -> SourceCodeVerificationFlow -> Bool
$c/= :: SourceCodeVerificationFlow -> SourceCodeVerificationFlow -> Bool
== :: SourceCodeVerificationFlow -> SourceCodeVerificationFlow -> Bool
$c== :: SourceCodeVerificationFlow -> SourceCodeVerificationFlow -> Bool
GHC.Classes.Eq
)
instance Data.Aeson.Types.ToJSON.ToJSON SourceCodeVerificationFlow where
toJSON :: SourceCodeVerificationFlow -> Value
toJSON SourceCodeVerificationFlow
obj = [Pair] -> Value
Data.Aeson.Types.Internal.object (Text
"attempts_remaining" Text -> Int -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= SourceCodeVerificationFlow -> Int
sourceCodeVerificationFlowAttemptsRemaining SourceCodeVerificationFlow
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"status" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= SourceCodeVerificationFlow -> Text
sourceCodeVerificationFlowStatus SourceCodeVerificationFlow
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: [Pair]
forall a. Monoid a => a
GHC.Base.mempty)
toEncoding :: SourceCodeVerificationFlow -> Encoding
toEncoding SourceCodeVerificationFlow
obj = Series -> Encoding
Data.Aeson.Encoding.Internal.pairs ((Text
"attempts_remaining" Text -> Int -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= SourceCodeVerificationFlow -> Int
sourceCodeVerificationFlowAttemptsRemaining SourceCodeVerificationFlow
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> (Text
"status" Text -> Text -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= SourceCodeVerificationFlow -> Text
sourceCodeVerificationFlowStatus SourceCodeVerificationFlow
obj))
instance Data.Aeson.Types.FromJSON.FromJSON SourceCodeVerificationFlow where
parseJSON :: Value -> Parser SourceCodeVerificationFlow
parseJSON = String
-> (Object -> Parser SourceCodeVerificationFlow)
-> Value
-> Parser SourceCodeVerificationFlow
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.Aeson.Types.FromJSON.withObject String
"SourceCodeVerificationFlow" (\Object
obj -> ((Int -> Text -> SourceCodeVerificationFlow)
-> Parser (Int -> Text -> SourceCodeVerificationFlow)
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure Int -> Text -> SourceCodeVerificationFlow
SourceCodeVerificationFlow Parser (Int -> Text -> SourceCodeVerificationFlow)
-> Parser Int -> Parser (Text -> SourceCodeVerificationFlow)
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
"attempts_remaining")) Parser (Text -> SourceCodeVerificationFlow)
-> Parser Text -> Parser SourceCodeVerificationFlow
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
"status"))
mkSourceCodeVerificationFlow ::
GHC.Types.Int ->
Data.Text.Internal.Text ->
SourceCodeVerificationFlow
mkSourceCodeVerificationFlow :: Int -> Text -> SourceCodeVerificationFlow
mkSourceCodeVerificationFlow Int
sourceCodeVerificationFlowAttemptsRemaining Text
sourceCodeVerificationFlowStatus =
SourceCodeVerificationFlow :: Int -> Text -> SourceCodeVerificationFlow
SourceCodeVerificationFlow
{ sourceCodeVerificationFlowAttemptsRemaining :: Int
sourceCodeVerificationFlowAttemptsRemaining = Int
sourceCodeVerificationFlowAttemptsRemaining,
sourceCodeVerificationFlowStatus :: Text
sourceCodeVerificationFlowStatus = Text
sourceCodeVerificationFlowStatus
}