{-# LANGUAGE MultiWayIf #-}
{-# LANGUAGE OverloadedStrings #-}
module StripeAPI.Types.Reporting_ReportType 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 Reporting'reportType = Reporting'reportType
{
Reporting'reportType -> Int
reporting'reportTypeDataAvailableEnd :: GHC.Types.Int,
Reporting'reportType -> Int
reporting'reportTypeDataAvailableStart :: GHC.Types.Int,
Reporting'reportType -> Maybe [Text]
reporting'reportTypeDefaultColumns :: (GHC.Maybe.Maybe ([Data.Text.Internal.Text])),
Reporting'reportType -> Text
reporting'reportTypeId :: Data.Text.Internal.Text,
Reporting'reportType -> Text
reporting'reportTypeName :: Data.Text.Internal.Text,
Reporting'reportType -> Int
reporting'reportTypeUpdated :: GHC.Types.Int,
Reporting'reportType -> Int
reporting'reportTypeVersion :: GHC.Types.Int
}
deriving
( Int -> Reporting'reportType -> ShowS
[Reporting'reportType] -> ShowS
Reporting'reportType -> String
(Int -> Reporting'reportType -> ShowS)
-> (Reporting'reportType -> String)
-> ([Reporting'reportType] -> ShowS)
-> Show Reporting'reportType
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Reporting'reportType] -> ShowS
$cshowList :: [Reporting'reportType] -> ShowS
show :: Reporting'reportType -> String
$cshow :: Reporting'reportType -> String
showsPrec :: Int -> Reporting'reportType -> ShowS
$cshowsPrec :: Int -> Reporting'reportType -> ShowS
GHC.Show.Show,
Reporting'reportType -> Reporting'reportType -> Bool
(Reporting'reportType -> Reporting'reportType -> Bool)
-> (Reporting'reportType -> Reporting'reportType -> Bool)
-> Eq Reporting'reportType
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Reporting'reportType -> Reporting'reportType -> Bool
$c/= :: Reporting'reportType -> Reporting'reportType -> Bool
== :: Reporting'reportType -> Reporting'reportType -> Bool
$c== :: Reporting'reportType -> Reporting'reportType -> Bool
GHC.Classes.Eq
)
instance Data.Aeson.Types.ToJSON.ToJSON Reporting'reportType where
toJSON :: Reporting'reportType -> Value
toJSON Reporting'reportType
obj = [Pair] -> Value
Data.Aeson.Types.Internal.object (Text
"data_available_end" Text -> Int -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= Reporting'reportType -> Int
reporting'reportTypeDataAvailableEnd Reporting'reportType
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"data_available_start" Text -> Int -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= Reporting'reportType -> Int
reporting'reportTypeDataAvailableStart Reporting'reportType
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"default_columns" Text -> Maybe [Text] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= Reporting'reportType -> Maybe [Text]
reporting'reportTypeDefaultColumns Reporting'reportType
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"id" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= Reporting'reportType -> Text
reporting'reportTypeId Reporting'reportType
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"name" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= Reporting'reportType -> Text
reporting'reportTypeName Reporting'reportType
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"updated" Text -> Int -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= Reporting'reportType -> Int
reporting'reportTypeUpdated Reporting'reportType
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"version" Text -> Int -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= Reporting'reportType -> Int
reporting'reportTypeVersion Reporting'reportType
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"object" Text -> Value -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= Text -> Value
Data.Aeson.Types.Internal.String Text
"reporting.report_type" Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: [Pair]
forall a. Monoid a => a
GHC.Base.mempty)
toEncoding :: Reporting'reportType -> Encoding
toEncoding Reporting'reportType
obj = Series -> Encoding
Data.Aeson.Encoding.Internal.pairs ((Text
"data_available_end" Text -> Int -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= Reporting'reportType -> Int
reporting'reportTypeDataAvailableEnd Reporting'reportType
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"data_available_start" Text -> Int -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= Reporting'reportType -> Int
reporting'reportTypeDataAvailableStart Reporting'reportType
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"default_columns" Text -> Maybe [Text] -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= Reporting'reportType -> Maybe [Text]
reporting'reportTypeDefaultColumns Reporting'reportType
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"id" Text -> Text -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= Reporting'reportType -> Text
reporting'reportTypeId Reporting'reportType
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"name" Text -> Text -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= Reporting'reportType -> Text
reporting'reportTypeName Reporting'reportType
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"updated" Text -> Int -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= Reporting'reportType -> Int
reporting'reportTypeUpdated Reporting'reportType
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"version" Text -> Int -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= Reporting'reportType -> Int
reporting'reportTypeVersion Reporting'reportType
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> (Text
"object" Text -> Value -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= Text -> Value
Data.Aeson.Types.Internal.String Text
"reporting.report_type"))))))))
instance Data.Aeson.Types.FromJSON.FromJSON Reporting'reportType where
parseJSON :: Value -> Parser Reporting'reportType
parseJSON = String
-> (Object -> Parser Reporting'reportType)
-> Value
-> Parser Reporting'reportType
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.Aeson.Types.FromJSON.withObject String
"Reporting'reportType" (\Object
obj -> (((((((Int
-> Int
-> Maybe [Text]
-> Text
-> Text
-> Int
-> Int
-> Reporting'reportType)
-> Parser
(Int
-> Int
-> Maybe [Text]
-> Text
-> Text
-> Int
-> Int
-> Reporting'reportType)
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure Int
-> Int
-> Maybe [Text]
-> Text
-> Text
-> Int
-> Int
-> Reporting'reportType
Reporting'reportType Parser
(Int
-> Int
-> Maybe [Text]
-> Text
-> Text
-> Int
-> Int
-> Reporting'reportType)
-> Parser Int
-> Parser
(Int
-> Maybe [Text]
-> Text
-> Text
-> Int
-> Int
-> Reporting'reportType)
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
"data_available_end")) Parser
(Int
-> Maybe [Text]
-> Text
-> Text
-> Int
-> Int
-> Reporting'reportType)
-> Parser Int
-> Parser
(Maybe [Text]
-> Text -> Text -> Int -> Int -> Reporting'reportType)
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
"data_available_start")) Parser
(Maybe [Text]
-> Text -> Text -> Int -> Int -> Reporting'reportType)
-> Parser (Maybe [Text])
-> Parser (Text -> Text -> Int -> Int -> Reporting'reportType)
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
"default_columns")) Parser (Text -> Text -> Int -> Int -> Reporting'reportType)
-> Parser Text
-> Parser (Text -> Int -> Int -> Reporting'reportType)
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
"id")) Parser (Text -> Int -> Int -> Reporting'reportType)
-> Parser Text -> Parser (Int -> Int -> Reporting'reportType)
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
"name")) Parser (Int -> Int -> Reporting'reportType)
-> Parser Int -> Parser (Int -> Reporting'reportType)
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
"updated")) Parser (Int -> Reporting'reportType)
-> Parser Int -> Parser Reporting'reportType
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
"version"))
mkReporting'reportType ::
GHC.Types.Int ->
GHC.Types.Int ->
Data.Text.Internal.Text ->
Data.Text.Internal.Text ->
GHC.Types.Int ->
GHC.Types.Int ->
Reporting'reportType
mkReporting'reportType :: Int -> Int -> Text -> Text -> Int -> Int -> Reporting'reportType
mkReporting'reportType Int
reporting'reportTypeDataAvailableEnd Int
reporting'reportTypeDataAvailableStart Text
reporting'reportTypeId Text
reporting'reportTypeName Int
reporting'reportTypeUpdated Int
reporting'reportTypeVersion =
Reporting'reportType :: Int
-> Int
-> Maybe [Text]
-> Text
-> Text
-> Int
-> Int
-> Reporting'reportType
Reporting'reportType
{ reporting'reportTypeDataAvailableEnd :: Int
reporting'reportTypeDataAvailableEnd = Int
reporting'reportTypeDataAvailableEnd,
reporting'reportTypeDataAvailableStart :: Int
reporting'reportTypeDataAvailableStart = Int
reporting'reportTypeDataAvailableStart,
reporting'reportTypeDefaultColumns :: Maybe [Text]
reporting'reportTypeDefaultColumns = Maybe [Text]
forall a. Maybe a
GHC.Maybe.Nothing,
reporting'reportTypeId :: Text
reporting'reportTypeId = Text
reporting'reportTypeId,
reporting'reportTypeName :: Text
reporting'reportTypeName = Text
reporting'reportTypeName,
reporting'reportTypeUpdated :: Int
reporting'reportTypeUpdated = Int
reporting'reportTypeUpdated,
reporting'reportTypeVersion :: Int
reporting'reportTypeVersion = Int
reporting'reportTypeVersion
}