{-# LANGUAGE ExplicitForAll #-}
{-# 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 different functions to run the operation getTopups
module StripeAPI.Operations.GetTopups where

import qualified Control.Monad.Fail
import qualified Control.Monad.Trans.Reader
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.Either
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 Data.Vector
import qualified GHC.Base
import qualified GHC.Classes
import qualified GHC.Int
import qualified GHC.Show
import qualified GHC.Types
import qualified Network.HTTP.Client
import qualified Network.HTTP.Client as Network.HTTP.Client.Request
import qualified Network.HTTP.Client as Network.HTTP.Client.Types
import qualified Network.HTTP.Simple
import qualified Network.HTTP.Types
import qualified Network.HTTP.Types as Network.HTTP.Types.Status
import qualified Network.HTTP.Types as Network.HTTP.Types.URI
import qualified StripeAPI.Common
import StripeAPI.Types
import qualified Prelude as GHC.Integer.Type
import qualified Prelude as GHC.Maybe

-- | > GET /v1/topups
--
-- \<p>Returns a list of top-ups.\<\/p>
getTopups ::
  forall m.
  StripeAPI.Common.MonadHTTP m =>
  -- | Contains all available parameters of this operation (query and path parameters)
  GetTopupsParameters ->
  -- | Monadic computation which returns the result of the operation
  StripeAPI.Common.ClientT m (Network.HTTP.Client.Types.Response GetTopupsResponse)
getTopups :: GetTopupsParameters -> ClientT m (Response GetTopupsResponse)
getTopups GetTopupsParameters
parameters =
  (Response ByteString -> Response GetTopupsResponse)
-> ClientT m (Response ByteString)
-> ClientT m (Response GetTopupsResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
GHC.Base.fmap
    ( \Response ByteString
response_0 ->
        (ByteString -> GetTopupsResponse)
-> Response ByteString -> Response GetTopupsResponse
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
GHC.Base.fmap
          ( (String -> GetTopupsResponse)
-> (GetTopupsResponse -> GetTopupsResponse)
-> Either String GetTopupsResponse
-> GetTopupsResponse
forall a c b. (a -> c) -> (b -> c) -> Either a b -> c
Data.Either.either String -> GetTopupsResponse
GetTopupsResponseError GetTopupsResponse -> GetTopupsResponse
forall a. a -> a
GHC.Base.id
              (Either String GetTopupsResponse -> GetTopupsResponse)
-> (ByteString -> Either String GetTopupsResponse)
-> ByteString
-> GetTopupsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. ( \Response ByteString
response ByteString
body ->
                             if
                                 | (\Status
status_1 -> Status -> Int
Network.HTTP.Types.Status.statusCode Status
status_1 Int -> Int -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Int
200) (Response ByteString -> Status
forall body. Response body -> Status
Network.HTTP.Client.Types.responseStatus Response ByteString
response) ->
                                   GetTopupsResponseBody200 -> GetTopupsResponse
GetTopupsResponse200
                                     (GetTopupsResponseBody200 -> GetTopupsResponse)
-> Either String GetTopupsResponseBody200
-> Either String GetTopupsResponse
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Data.Functor.<$> ( ByteString -> Either String GetTopupsResponseBody200
forall a. FromJSON a => ByteString -> Either String a
Data.Aeson.eitherDecodeStrict ByteString
body ::
                                                          Data.Either.Either
                                                            GHC.Base.String
                                                            GetTopupsResponseBody200
                                                      )
                                 | Bool -> Status -> Bool
forall a b. a -> b -> a
GHC.Base.const Bool
GHC.Types.True (Response ByteString -> Status
forall body. Response body -> Status
Network.HTTP.Client.Types.responseStatus Response ByteString
response) ->
                                   Error -> GetTopupsResponse
GetTopupsResponseDefault
                                     (Error -> GetTopupsResponse)
-> Either String Error -> Either String GetTopupsResponse
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Data.Functor.<$> ( ByteString -> Either String Error
forall a. FromJSON a => ByteString -> Either String a
Data.Aeson.eitherDecodeStrict ByteString
body ::
                                                          Data.Either.Either
                                                            GHC.Base.String
                                                            Error
                                                      )
                                 | Bool
GHC.Base.otherwise -> String -> Either String GetTopupsResponse
forall a b. a -> Either a b
Data.Either.Left String
"Missing default response type"
                         )
                Response ByteString
response_0
          )
          Response ByteString
response_0
    )
    ( Text -> Text -> [QueryParameter] -> ClientT m (Response ByteString)
forall (m :: * -> *).
MonadHTTP m =>
Text -> Text -> [QueryParameter] -> ClientT m (Response ByteString)
StripeAPI.Common.doCallWithConfigurationM
        (Text -> Text
Data.Text.toUpper (Text -> Text) -> Text -> Text
forall a b. (a -> b) -> a -> b
GHC.Base.$ String -> Text
Data.Text.pack String
"GET")
        (String -> Text
Data.Text.pack String
"/v1/topups")
        [ Text -> Maybe Value -> Text -> Bool -> QueryParameter
StripeAPI.Common.QueryParameter (String -> Text
Data.Text.pack String
"amount") (GetTopupsParametersQueryAmount'Variants -> Value
forall a. ToJSON a => a -> Value
Data.Aeson.Types.ToJSON.toJSON (GetTopupsParametersQueryAmount'Variants -> Value)
-> Maybe GetTopupsParametersQueryAmount'Variants -> Maybe Value
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Data.Functor.<$> GetTopupsParameters
-> Maybe GetTopupsParametersQueryAmount'Variants
getTopupsParametersQueryAmount GetTopupsParameters
parameters) (String -> Text
Data.Text.pack String
"deepObject") Bool
GHC.Types.True,
          Text -> Maybe Value -> Text -> Bool -> QueryParameter
StripeAPI.Common.QueryParameter (String -> Text
Data.Text.pack String
"created") (GetTopupsParametersQueryCreated'Variants -> Value
forall a. ToJSON a => a -> Value
Data.Aeson.Types.ToJSON.toJSON (GetTopupsParametersQueryCreated'Variants -> Value)
-> Maybe GetTopupsParametersQueryCreated'Variants -> Maybe Value
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Data.Functor.<$> GetTopupsParameters
-> Maybe GetTopupsParametersQueryCreated'Variants
getTopupsParametersQueryCreated GetTopupsParameters
parameters) (String -> Text
Data.Text.pack String
"deepObject") Bool
GHC.Types.True,
          Text -> Maybe Value -> Text -> Bool -> QueryParameter
StripeAPI.Common.QueryParameter (String -> Text
Data.Text.pack String
"ending_before") (Text -> Value
forall a. ToJSON a => a -> Value
Data.Aeson.Types.ToJSON.toJSON (Text -> Value) -> Maybe Text -> Maybe Value
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Data.Functor.<$> GetTopupsParameters -> Maybe Text
getTopupsParametersQueryEndingBefore GetTopupsParameters
parameters) (String -> Text
Data.Text.pack String
"form") Bool
GHC.Types.True,
          Text -> Maybe Value -> Text -> Bool -> QueryParameter
StripeAPI.Common.QueryParameter (String -> Text
Data.Text.pack String
"expand") ([Text] -> Value
forall a. ToJSON a => a -> Value
Data.Aeson.Types.ToJSON.toJSON ([Text] -> Value) -> Maybe [Text] -> Maybe Value
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Data.Functor.<$> GetTopupsParameters -> Maybe [Text]
getTopupsParametersQueryExpand GetTopupsParameters
parameters) (String -> Text
Data.Text.pack String
"deepObject") Bool
GHC.Types.True,
          Text -> Maybe Value -> Text -> Bool -> QueryParameter
StripeAPI.Common.QueryParameter (String -> Text
Data.Text.pack String
"limit") (Int -> Value
forall a. ToJSON a => a -> Value
Data.Aeson.Types.ToJSON.toJSON (Int -> Value) -> Maybe Int -> Maybe Value
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Data.Functor.<$> GetTopupsParameters -> Maybe Int
getTopupsParametersQueryLimit GetTopupsParameters
parameters) (String -> Text
Data.Text.pack String
"form") Bool
GHC.Types.True,
          Text -> Maybe Value -> Text -> Bool -> QueryParameter
StripeAPI.Common.QueryParameter (String -> Text
Data.Text.pack String
"starting_after") (Text -> Value
forall a. ToJSON a => a -> Value
Data.Aeson.Types.ToJSON.toJSON (Text -> Value) -> Maybe Text -> Maybe Value
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Data.Functor.<$> GetTopupsParameters -> Maybe Text
getTopupsParametersQueryStartingAfter GetTopupsParameters
parameters) (String -> Text
Data.Text.pack String
"form") Bool
GHC.Types.True,
          Text -> Maybe Value -> Text -> Bool -> QueryParameter
StripeAPI.Common.QueryParameter (String -> Text
Data.Text.pack String
"status") (GetTopupsParametersQueryStatus' -> Value
forall a. ToJSON a => a -> Value
Data.Aeson.Types.ToJSON.toJSON (GetTopupsParametersQueryStatus' -> Value)
-> Maybe GetTopupsParametersQueryStatus' -> Maybe Value
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Data.Functor.<$> GetTopupsParameters -> Maybe GetTopupsParametersQueryStatus'
getTopupsParametersQueryStatus GetTopupsParameters
parameters) (String -> Text
Data.Text.pack String
"form") Bool
GHC.Types.True
        ]
    )

-- | Defines the object schema located at @paths.\/v1\/topups.GET.parameters@ in the specification.
data GetTopupsParameters = GetTopupsParameters
  { -- | queryAmount: Represents the parameter named \'amount\'
    --
    -- A positive integer representing how much to transfer.
    GetTopupsParameters
-> Maybe GetTopupsParametersQueryAmount'Variants
getTopupsParametersQueryAmount :: (GHC.Maybe.Maybe GetTopupsParametersQueryAmount'Variants),
    -- | queryCreated: Represents the parameter named \'created\'
    --
    -- A filter on the list, based on the object \`created\` field. The value can be a string with an integer Unix timestamp, or it can be a dictionary with a number of different query options.
    GetTopupsParameters
-> Maybe GetTopupsParametersQueryCreated'Variants
getTopupsParametersQueryCreated :: (GHC.Maybe.Maybe GetTopupsParametersQueryCreated'Variants),
    -- | queryEnding_before: Represents the parameter named \'ending_before\'
    --
    -- A cursor for use in pagination. \`ending_before\` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with \`obj_bar\`, your subsequent call can include \`ending_before=obj_bar\` in order to fetch the previous page of the list.
    --
    -- Constraints:
    --
    -- * Maximum length of 5000
    GetTopupsParameters -> Maybe Text
getTopupsParametersQueryEndingBefore :: (GHC.Maybe.Maybe Data.Text.Internal.Text),
    -- | queryExpand: Represents the parameter named \'expand\'
    --
    -- Specifies which fields in the response should be expanded.
    GetTopupsParameters -> Maybe [Text]
getTopupsParametersQueryExpand :: (GHC.Maybe.Maybe ([Data.Text.Internal.Text])),
    -- | queryLimit: Represents the parameter named \'limit\'
    --
    -- A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10.
    GetTopupsParameters -> Maybe Int
getTopupsParametersQueryLimit :: (GHC.Maybe.Maybe GHC.Types.Int),
    -- | queryStarting_after: Represents the parameter named \'starting_after\'
    --
    -- A cursor for use in pagination. \`starting_after\` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with \`obj_foo\`, your subsequent call can include \`starting_after=obj_foo\` in order to fetch the next page of the list.
    --
    -- Constraints:
    --
    -- * Maximum length of 5000
    GetTopupsParameters -> Maybe Text
getTopupsParametersQueryStartingAfter :: (GHC.Maybe.Maybe Data.Text.Internal.Text),
    -- | queryStatus: Represents the parameter named \'status\'
    --
    -- Only return top-ups that have the given status. One of \`canceled\`, \`failed\`, \`pending\` or \`succeeded\`.
    --
    -- Constraints:
    --
    -- * Maximum length of 5000
    GetTopupsParameters -> Maybe GetTopupsParametersQueryStatus'
getTopupsParametersQueryStatus :: (GHC.Maybe.Maybe GetTopupsParametersQueryStatus')
  }
  deriving
    ( Int -> GetTopupsParameters -> ShowS
[GetTopupsParameters] -> ShowS
GetTopupsParameters -> String
(Int -> GetTopupsParameters -> ShowS)
-> (GetTopupsParameters -> String)
-> ([GetTopupsParameters] -> ShowS)
-> Show GetTopupsParameters
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetTopupsParameters] -> ShowS
$cshowList :: [GetTopupsParameters] -> ShowS
show :: GetTopupsParameters -> String
$cshow :: GetTopupsParameters -> String
showsPrec :: Int -> GetTopupsParameters -> ShowS
$cshowsPrec :: Int -> GetTopupsParameters -> ShowS
GHC.Show.Show,
      GetTopupsParameters -> GetTopupsParameters -> Bool
(GetTopupsParameters -> GetTopupsParameters -> Bool)
-> (GetTopupsParameters -> GetTopupsParameters -> Bool)
-> Eq GetTopupsParameters
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetTopupsParameters -> GetTopupsParameters -> Bool
$c/= :: GetTopupsParameters -> GetTopupsParameters -> Bool
== :: GetTopupsParameters -> GetTopupsParameters -> Bool
$c== :: GetTopupsParameters -> GetTopupsParameters -> Bool
GHC.Classes.Eq
    )

instance Data.Aeson.Types.ToJSON.ToJSON GetTopupsParameters where
  toJSON :: GetTopupsParameters -> Value
toJSON GetTopupsParameters
obj = [Pair] -> Value
Data.Aeson.Types.Internal.object (Text
"queryAmount" Text -> Maybe GetTopupsParametersQueryAmount'Variants -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= GetTopupsParameters
-> Maybe GetTopupsParametersQueryAmount'Variants
getTopupsParametersQueryAmount GetTopupsParameters
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"queryCreated" Text -> Maybe GetTopupsParametersQueryCreated'Variants -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= GetTopupsParameters
-> Maybe GetTopupsParametersQueryCreated'Variants
getTopupsParametersQueryCreated GetTopupsParameters
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"queryEnding_before" Text -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= GetTopupsParameters -> Maybe Text
getTopupsParametersQueryEndingBefore GetTopupsParameters
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"queryExpand" Text -> Maybe [Text] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= GetTopupsParameters -> Maybe [Text]
getTopupsParametersQueryExpand GetTopupsParameters
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"queryLimit" Text -> Maybe Int -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= GetTopupsParameters -> Maybe Int
getTopupsParametersQueryLimit GetTopupsParameters
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"queryStarting_after" Text -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= GetTopupsParameters -> Maybe Text
getTopupsParametersQueryStartingAfter GetTopupsParameters
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"queryStatus" Text -> Maybe GetTopupsParametersQueryStatus' -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= GetTopupsParameters -> Maybe GetTopupsParametersQueryStatus'
getTopupsParametersQueryStatus GetTopupsParameters
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: [Pair]
forall a. Monoid a => a
GHC.Base.mempty)
  toEncoding :: GetTopupsParameters -> Encoding
toEncoding GetTopupsParameters
obj = Series -> Encoding
Data.Aeson.Encoding.Internal.pairs ((Text
"queryAmount" Text -> Maybe GetTopupsParametersQueryAmount'Variants -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= GetTopupsParameters
-> Maybe GetTopupsParametersQueryAmount'Variants
getTopupsParametersQueryAmount GetTopupsParameters
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"queryCreated" Text -> Maybe GetTopupsParametersQueryCreated'Variants -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= GetTopupsParameters
-> Maybe GetTopupsParametersQueryCreated'Variants
getTopupsParametersQueryCreated GetTopupsParameters
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"queryEnding_before" Text -> Maybe Text -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= GetTopupsParameters -> Maybe Text
getTopupsParametersQueryEndingBefore GetTopupsParameters
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"queryExpand" Text -> Maybe [Text] -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= GetTopupsParameters -> Maybe [Text]
getTopupsParametersQueryExpand GetTopupsParameters
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"queryLimit" Text -> Maybe Int -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= GetTopupsParameters -> Maybe Int
getTopupsParametersQueryLimit GetTopupsParameters
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"queryStarting_after" Text -> Maybe Text -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= GetTopupsParameters -> Maybe Text
getTopupsParametersQueryStartingAfter GetTopupsParameters
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> (Text
"queryStatus" Text -> Maybe GetTopupsParametersQueryStatus' -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= GetTopupsParameters -> Maybe GetTopupsParametersQueryStatus'
getTopupsParametersQueryStatus GetTopupsParameters
obj)))))))

instance Data.Aeson.Types.FromJSON.FromJSON GetTopupsParameters where
  parseJSON :: Value -> Parser GetTopupsParameters
parseJSON = String
-> (Object -> Parser GetTopupsParameters)
-> Value
-> Parser GetTopupsParameters
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.Aeson.Types.FromJSON.withObject String
"GetTopupsParameters" (\Object
obj -> (((((((Maybe GetTopupsParametersQueryAmount'Variants
 -> Maybe GetTopupsParametersQueryCreated'Variants
 -> Maybe Text
 -> Maybe [Text]
 -> Maybe Int
 -> Maybe Text
 -> Maybe GetTopupsParametersQueryStatus'
 -> GetTopupsParameters)
-> Parser
     (Maybe GetTopupsParametersQueryAmount'Variants
      -> Maybe GetTopupsParametersQueryCreated'Variants
      -> Maybe Text
      -> Maybe [Text]
      -> Maybe Int
      -> Maybe Text
      -> Maybe GetTopupsParametersQueryStatus'
      -> GetTopupsParameters)
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure Maybe GetTopupsParametersQueryAmount'Variants
-> Maybe GetTopupsParametersQueryCreated'Variants
-> Maybe Text
-> Maybe [Text]
-> Maybe Int
-> Maybe Text
-> Maybe GetTopupsParametersQueryStatus'
-> GetTopupsParameters
GetTopupsParameters Parser
  (Maybe GetTopupsParametersQueryAmount'Variants
   -> Maybe GetTopupsParametersQueryCreated'Variants
   -> Maybe Text
   -> Maybe [Text]
   -> Maybe Int
   -> Maybe Text
   -> Maybe GetTopupsParametersQueryStatus'
   -> GetTopupsParameters)
-> Parser (Maybe GetTopupsParametersQueryAmount'Variants)
-> Parser
     (Maybe GetTopupsParametersQueryCreated'Variants
      -> Maybe Text
      -> Maybe [Text]
      -> Maybe Int
      -> Maybe Text
      -> Maybe GetTopupsParametersQueryStatus'
      -> GetTopupsParameters)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object
-> Text -> Parser (Maybe GetTopupsParametersQueryAmount'Variants)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Text
"queryAmount")) Parser
  (Maybe GetTopupsParametersQueryCreated'Variants
   -> Maybe Text
   -> Maybe [Text]
   -> Maybe Int
   -> Maybe Text
   -> Maybe GetTopupsParametersQueryStatus'
   -> GetTopupsParameters)
-> Parser (Maybe GetTopupsParametersQueryCreated'Variants)
-> Parser
     (Maybe Text
      -> Maybe [Text]
      -> Maybe Int
      -> Maybe Text
      -> Maybe GetTopupsParametersQueryStatus'
      -> GetTopupsParameters)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object
-> Text -> Parser (Maybe GetTopupsParametersQueryCreated'Variants)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Text
"queryCreated")) Parser
  (Maybe Text
   -> Maybe [Text]
   -> Maybe Int
   -> Maybe Text
   -> Maybe GetTopupsParametersQueryStatus'
   -> GetTopupsParameters)
-> Parser (Maybe Text)
-> Parser
     (Maybe [Text]
      -> Maybe Int
      -> Maybe Text
      -> Maybe GetTopupsParametersQueryStatus'
      -> GetTopupsParameters)
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
"queryEnding_before")) Parser
  (Maybe [Text]
   -> Maybe Int
   -> Maybe Text
   -> Maybe GetTopupsParametersQueryStatus'
   -> GetTopupsParameters)
-> Parser (Maybe [Text])
-> Parser
     (Maybe Int
      -> Maybe Text
      -> Maybe GetTopupsParametersQueryStatus'
      -> GetTopupsParameters)
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
"queryExpand")) Parser
  (Maybe Int
   -> Maybe Text
   -> Maybe GetTopupsParametersQueryStatus'
   -> GetTopupsParameters)
-> Parser (Maybe Int)
-> Parser
     (Maybe Text
      -> Maybe GetTopupsParametersQueryStatus' -> GetTopupsParameters)
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
"queryLimit")) Parser
  (Maybe Text
   -> Maybe GetTopupsParametersQueryStatus' -> GetTopupsParameters)
-> Parser (Maybe Text)
-> Parser
     (Maybe GetTopupsParametersQueryStatus' -> GetTopupsParameters)
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
"queryStarting_after")) Parser
  (Maybe GetTopupsParametersQueryStatus' -> GetTopupsParameters)
-> Parser (Maybe GetTopupsParametersQueryStatus')
-> Parser GetTopupsParameters
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Text -> Parser (Maybe GetTopupsParametersQueryStatus')
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Text
"queryStatus"))

-- | Create a new 'GetTopupsParameters' with all required fields.
mkGetTopupsParameters :: GetTopupsParameters
mkGetTopupsParameters :: GetTopupsParameters
mkGetTopupsParameters =
  GetTopupsParameters :: Maybe GetTopupsParametersQueryAmount'Variants
-> Maybe GetTopupsParametersQueryCreated'Variants
-> Maybe Text
-> Maybe [Text]
-> Maybe Int
-> Maybe Text
-> Maybe GetTopupsParametersQueryStatus'
-> GetTopupsParameters
GetTopupsParameters
    { getTopupsParametersQueryAmount :: Maybe GetTopupsParametersQueryAmount'Variants
getTopupsParametersQueryAmount = Maybe GetTopupsParametersQueryAmount'Variants
forall a. Maybe a
GHC.Maybe.Nothing,
      getTopupsParametersQueryCreated :: Maybe GetTopupsParametersQueryCreated'Variants
getTopupsParametersQueryCreated = Maybe GetTopupsParametersQueryCreated'Variants
forall a. Maybe a
GHC.Maybe.Nothing,
      getTopupsParametersQueryEndingBefore :: Maybe Text
getTopupsParametersQueryEndingBefore = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing,
      getTopupsParametersQueryExpand :: Maybe [Text]
getTopupsParametersQueryExpand = Maybe [Text]
forall a. Maybe a
GHC.Maybe.Nothing,
      getTopupsParametersQueryLimit :: Maybe Int
getTopupsParametersQueryLimit = Maybe Int
forall a. Maybe a
GHC.Maybe.Nothing,
      getTopupsParametersQueryStartingAfter :: Maybe Text
getTopupsParametersQueryStartingAfter = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing,
      getTopupsParametersQueryStatus :: Maybe GetTopupsParametersQueryStatus'
getTopupsParametersQueryStatus = Maybe GetTopupsParametersQueryStatus'
forall a. Maybe a
GHC.Maybe.Nothing
    }

-- | Defines the object schema located at @paths.\/v1\/topups.GET.parameters.properties.queryAmount.anyOf@ in the specification.
data GetTopupsParametersQueryAmount'OneOf1 = GetTopupsParametersQueryAmount'OneOf1
  { -- | gt
    GetTopupsParametersQueryAmount'OneOf1 -> Maybe Int
getTopupsParametersQueryAmount'OneOf1Gt :: (GHC.Maybe.Maybe GHC.Types.Int),
    -- | gte
    GetTopupsParametersQueryAmount'OneOf1 -> Maybe Int
getTopupsParametersQueryAmount'OneOf1Gte :: (GHC.Maybe.Maybe GHC.Types.Int),
    -- | lt
    GetTopupsParametersQueryAmount'OneOf1 -> Maybe Int
getTopupsParametersQueryAmount'OneOf1Lt :: (GHC.Maybe.Maybe GHC.Types.Int),
    -- | lte
    GetTopupsParametersQueryAmount'OneOf1 -> Maybe Int
getTopupsParametersQueryAmount'OneOf1Lte :: (GHC.Maybe.Maybe GHC.Types.Int)
  }
  deriving
    ( Int -> GetTopupsParametersQueryAmount'OneOf1 -> ShowS
[GetTopupsParametersQueryAmount'OneOf1] -> ShowS
GetTopupsParametersQueryAmount'OneOf1 -> String
(Int -> GetTopupsParametersQueryAmount'OneOf1 -> ShowS)
-> (GetTopupsParametersQueryAmount'OneOf1 -> String)
-> ([GetTopupsParametersQueryAmount'OneOf1] -> ShowS)
-> Show GetTopupsParametersQueryAmount'OneOf1
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetTopupsParametersQueryAmount'OneOf1] -> ShowS
$cshowList :: [GetTopupsParametersQueryAmount'OneOf1] -> ShowS
show :: GetTopupsParametersQueryAmount'OneOf1 -> String
$cshow :: GetTopupsParametersQueryAmount'OneOf1 -> String
showsPrec :: Int -> GetTopupsParametersQueryAmount'OneOf1 -> ShowS
$cshowsPrec :: Int -> GetTopupsParametersQueryAmount'OneOf1 -> ShowS
GHC.Show.Show,
      GetTopupsParametersQueryAmount'OneOf1
-> GetTopupsParametersQueryAmount'OneOf1 -> Bool
(GetTopupsParametersQueryAmount'OneOf1
 -> GetTopupsParametersQueryAmount'OneOf1 -> Bool)
-> (GetTopupsParametersQueryAmount'OneOf1
    -> GetTopupsParametersQueryAmount'OneOf1 -> Bool)
-> Eq GetTopupsParametersQueryAmount'OneOf1
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetTopupsParametersQueryAmount'OneOf1
-> GetTopupsParametersQueryAmount'OneOf1 -> Bool
$c/= :: GetTopupsParametersQueryAmount'OneOf1
-> GetTopupsParametersQueryAmount'OneOf1 -> Bool
== :: GetTopupsParametersQueryAmount'OneOf1
-> GetTopupsParametersQueryAmount'OneOf1 -> Bool
$c== :: GetTopupsParametersQueryAmount'OneOf1
-> GetTopupsParametersQueryAmount'OneOf1 -> Bool
GHC.Classes.Eq
    )

instance Data.Aeson.Types.ToJSON.ToJSON GetTopupsParametersQueryAmount'OneOf1 where
  toJSON :: GetTopupsParametersQueryAmount'OneOf1 -> Value
toJSON GetTopupsParametersQueryAmount'OneOf1
obj = [Pair] -> Value
Data.Aeson.Types.Internal.object (Text
"gt" Text -> Maybe Int -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= GetTopupsParametersQueryAmount'OneOf1 -> Maybe Int
getTopupsParametersQueryAmount'OneOf1Gt GetTopupsParametersQueryAmount'OneOf1
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"gte" Text -> Maybe Int -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= GetTopupsParametersQueryAmount'OneOf1 -> Maybe Int
getTopupsParametersQueryAmount'OneOf1Gte GetTopupsParametersQueryAmount'OneOf1
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"lt" Text -> Maybe Int -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= GetTopupsParametersQueryAmount'OneOf1 -> Maybe Int
getTopupsParametersQueryAmount'OneOf1Lt GetTopupsParametersQueryAmount'OneOf1
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"lte" Text -> Maybe Int -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= GetTopupsParametersQueryAmount'OneOf1 -> Maybe Int
getTopupsParametersQueryAmount'OneOf1Lte GetTopupsParametersQueryAmount'OneOf1
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: [Pair]
forall a. Monoid a => a
GHC.Base.mempty)
  toEncoding :: GetTopupsParametersQueryAmount'OneOf1 -> Encoding
toEncoding GetTopupsParametersQueryAmount'OneOf1
obj = Series -> Encoding
Data.Aeson.Encoding.Internal.pairs ((Text
"gt" Text -> Maybe Int -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= GetTopupsParametersQueryAmount'OneOf1 -> Maybe Int
getTopupsParametersQueryAmount'OneOf1Gt GetTopupsParametersQueryAmount'OneOf1
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"gte" Text -> Maybe Int -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= GetTopupsParametersQueryAmount'OneOf1 -> Maybe Int
getTopupsParametersQueryAmount'OneOf1Gte GetTopupsParametersQueryAmount'OneOf1
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"lt" Text -> Maybe Int -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= GetTopupsParametersQueryAmount'OneOf1 -> Maybe Int
getTopupsParametersQueryAmount'OneOf1Lt GetTopupsParametersQueryAmount'OneOf1
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> (Text
"lte" Text -> Maybe Int -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= GetTopupsParametersQueryAmount'OneOf1 -> Maybe Int
getTopupsParametersQueryAmount'OneOf1Lte GetTopupsParametersQueryAmount'OneOf1
obj))))

instance Data.Aeson.Types.FromJSON.FromJSON GetTopupsParametersQueryAmount'OneOf1 where
  parseJSON :: Value -> Parser GetTopupsParametersQueryAmount'OneOf1
parseJSON = String
-> (Object -> Parser GetTopupsParametersQueryAmount'OneOf1)
-> Value
-> Parser GetTopupsParametersQueryAmount'OneOf1
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.Aeson.Types.FromJSON.withObject String
"GetTopupsParametersQueryAmount'OneOf1" (\Object
obj -> ((((Maybe Int
 -> Maybe Int
 -> Maybe Int
 -> Maybe Int
 -> GetTopupsParametersQueryAmount'OneOf1)
-> Parser
     (Maybe Int
      -> Maybe Int
      -> Maybe Int
      -> Maybe Int
      -> GetTopupsParametersQueryAmount'OneOf1)
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure Maybe Int
-> Maybe Int
-> Maybe Int
-> Maybe Int
-> GetTopupsParametersQueryAmount'OneOf1
GetTopupsParametersQueryAmount'OneOf1 Parser
  (Maybe Int
   -> Maybe Int
   -> Maybe Int
   -> Maybe Int
   -> GetTopupsParametersQueryAmount'OneOf1)
-> Parser (Maybe Int)
-> Parser
     (Maybe Int
      -> Maybe Int -> Maybe Int -> GetTopupsParametersQueryAmount'OneOf1)
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
"gt")) Parser
  (Maybe Int
   -> Maybe Int -> Maybe Int -> GetTopupsParametersQueryAmount'OneOf1)
-> Parser (Maybe Int)
-> Parser
     (Maybe Int -> Maybe Int -> GetTopupsParametersQueryAmount'OneOf1)
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
"gte")) Parser
  (Maybe Int -> Maybe Int -> GetTopupsParametersQueryAmount'OneOf1)
-> Parser (Maybe Int)
-> Parser (Maybe Int -> GetTopupsParametersQueryAmount'OneOf1)
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
"lt")) Parser (Maybe Int -> GetTopupsParametersQueryAmount'OneOf1)
-> Parser (Maybe Int)
-> Parser GetTopupsParametersQueryAmount'OneOf1
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
"lte"))

-- | Create a new 'GetTopupsParametersQueryAmount'OneOf1' with all required fields.
mkGetTopupsParametersQueryAmount'OneOf1 :: GetTopupsParametersQueryAmount'OneOf1
mkGetTopupsParametersQueryAmount'OneOf1 :: GetTopupsParametersQueryAmount'OneOf1
mkGetTopupsParametersQueryAmount'OneOf1 =
  GetTopupsParametersQueryAmount'OneOf1 :: Maybe Int
-> Maybe Int
-> Maybe Int
-> Maybe Int
-> GetTopupsParametersQueryAmount'OneOf1
GetTopupsParametersQueryAmount'OneOf1
    { getTopupsParametersQueryAmount'OneOf1Gt :: Maybe Int
getTopupsParametersQueryAmount'OneOf1Gt = Maybe Int
forall a. Maybe a
GHC.Maybe.Nothing,
      getTopupsParametersQueryAmount'OneOf1Gte :: Maybe Int
getTopupsParametersQueryAmount'OneOf1Gte = Maybe Int
forall a. Maybe a
GHC.Maybe.Nothing,
      getTopupsParametersQueryAmount'OneOf1Lt :: Maybe Int
getTopupsParametersQueryAmount'OneOf1Lt = Maybe Int
forall a. Maybe a
GHC.Maybe.Nothing,
      getTopupsParametersQueryAmount'OneOf1Lte :: Maybe Int
getTopupsParametersQueryAmount'OneOf1Lte = Maybe Int
forall a. Maybe a
GHC.Maybe.Nothing
    }

-- | Defines the oneOf schema located at @paths.\/v1\/topups.GET.parameters.properties.queryAmount.anyOf@ in the specification.
--
-- Represents the parameter named \'amount\'
--
-- A positive integer representing how much to transfer.
data GetTopupsParametersQueryAmount'Variants
  = GetTopupsParametersQueryAmount'GetTopupsParametersQueryAmount'OneOf1 GetTopupsParametersQueryAmount'OneOf1
  | GetTopupsParametersQueryAmount'Int GHC.Types.Int
  deriving (Int -> GetTopupsParametersQueryAmount'Variants -> ShowS
[GetTopupsParametersQueryAmount'Variants] -> ShowS
GetTopupsParametersQueryAmount'Variants -> String
(Int -> GetTopupsParametersQueryAmount'Variants -> ShowS)
-> (GetTopupsParametersQueryAmount'Variants -> String)
-> ([GetTopupsParametersQueryAmount'Variants] -> ShowS)
-> Show GetTopupsParametersQueryAmount'Variants
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetTopupsParametersQueryAmount'Variants] -> ShowS
$cshowList :: [GetTopupsParametersQueryAmount'Variants] -> ShowS
show :: GetTopupsParametersQueryAmount'Variants -> String
$cshow :: GetTopupsParametersQueryAmount'Variants -> String
showsPrec :: Int -> GetTopupsParametersQueryAmount'Variants -> ShowS
$cshowsPrec :: Int -> GetTopupsParametersQueryAmount'Variants -> ShowS
GHC.Show.Show, GetTopupsParametersQueryAmount'Variants
-> GetTopupsParametersQueryAmount'Variants -> Bool
(GetTopupsParametersQueryAmount'Variants
 -> GetTopupsParametersQueryAmount'Variants -> Bool)
-> (GetTopupsParametersQueryAmount'Variants
    -> GetTopupsParametersQueryAmount'Variants -> Bool)
-> Eq GetTopupsParametersQueryAmount'Variants
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetTopupsParametersQueryAmount'Variants
-> GetTopupsParametersQueryAmount'Variants -> Bool
$c/= :: GetTopupsParametersQueryAmount'Variants
-> GetTopupsParametersQueryAmount'Variants -> Bool
== :: GetTopupsParametersQueryAmount'Variants
-> GetTopupsParametersQueryAmount'Variants -> Bool
$c== :: GetTopupsParametersQueryAmount'Variants
-> GetTopupsParametersQueryAmount'Variants -> Bool
GHC.Classes.Eq)

instance Data.Aeson.Types.ToJSON.ToJSON GetTopupsParametersQueryAmount'Variants where
  toJSON :: GetTopupsParametersQueryAmount'Variants -> Value
toJSON (GetTopupsParametersQueryAmount'GetTopupsParametersQueryAmount'OneOf1 GetTopupsParametersQueryAmount'OneOf1
a) = GetTopupsParametersQueryAmount'OneOf1 -> Value
forall a. ToJSON a => a -> Value
Data.Aeson.Types.ToJSON.toJSON GetTopupsParametersQueryAmount'OneOf1
a
  toJSON (GetTopupsParametersQueryAmount'Int Int
a) = Int -> Value
forall a. ToJSON a => a -> Value
Data.Aeson.Types.ToJSON.toJSON Int
a

instance Data.Aeson.Types.FromJSON.FromJSON GetTopupsParametersQueryAmount'Variants where
  parseJSON :: Value -> Parser GetTopupsParametersQueryAmount'Variants
parseJSON Value
val = case (GetTopupsParametersQueryAmount'OneOf1
-> GetTopupsParametersQueryAmount'Variants
GetTopupsParametersQueryAmount'GetTopupsParametersQueryAmount'OneOf1 (GetTopupsParametersQueryAmount'OneOf1
 -> GetTopupsParametersQueryAmount'Variants)
-> Result GetTopupsParametersQueryAmount'OneOf1
-> Result GetTopupsParametersQueryAmount'Variants
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Data.Functor.<$> Value -> Result GetTopupsParametersQueryAmount'OneOf1
forall a. FromJSON a => Value -> Result a
Data.Aeson.Types.FromJSON.fromJSON Value
val) Result GetTopupsParametersQueryAmount'Variants
-> Result GetTopupsParametersQueryAmount'Variants
-> Result GetTopupsParametersQueryAmount'Variants
forall (f :: * -> *) a. Alternative f => f a -> f a -> f a
GHC.Base.<|> ((Int -> GetTopupsParametersQueryAmount'Variants
GetTopupsParametersQueryAmount'Int (Int -> GetTopupsParametersQueryAmount'Variants)
-> Result Int -> Result GetTopupsParametersQueryAmount'Variants
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Data.Functor.<$> Value -> Result Int
forall a. FromJSON a => Value -> Result a
Data.Aeson.Types.FromJSON.fromJSON Value
val) Result GetTopupsParametersQueryAmount'Variants
-> Result GetTopupsParametersQueryAmount'Variants
-> Result GetTopupsParametersQueryAmount'Variants
forall (f :: * -> *) a. Alternative f => f a -> f a -> f a
GHC.Base.<|> String -> Result GetTopupsParametersQueryAmount'Variants
forall a. String -> Result a
Data.Aeson.Types.Internal.Error String
"No variant matched") of
    Data.Aeson.Types.Internal.Success GetTopupsParametersQueryAmount'Variants
a -> GetTopupsParametersQueryAmount'Variants
-> Parser GetTopupsParametersQueryAmount'Variants
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure GetTopupsParametersQueryAmount'Variants
a
    Data.Aeson.Types.Internal.Error String
a -> String -> Parser GetTopupsParametersQueryAmount'Variants
forall (m :: * -> *) a. MonadFail m => String -> m a
Control.Monad.Fail.fail String
a

-- | Defines the object schema located at @paths.\/v1\/topups.GET.parameters.properties.queryCreated.anyOf@ in the specification.
data GetTopupsParametersQueryCreated'OneOf1 = GetTopupsParametersQueryCreated'OneOf1
  { -- | gt
    GetTopupsParametersQueryCreated'OneOf1 -> Maybe Int
getTopupsParametersQueryCreated'OneOf1Gt :: (GHC.Maybe.Maybe GHC.Types.Int),
    -- | gte
    GetTopupsParametersQueryCreated'OneOf1 -> Maybe Int
getTopupsParametersQueryCreated'OneOf1Gte :: (GHC.Maybe.Maybe GHC.Types.Int),
    -- | lt
    GetTopupsParametersQueryCreated'OneOf1 -> Maybe Int
getTopupsParametersQueryCreated'OneOf1Lt :: (GHC.Maybe.Maybe GHC.Types.Int),
    -- | lte
    GetTopupsParametersQueryCreated'OneOf1 -> Maybe Int
getTopupsParametersQueryCreated'OneOf1Lte :: (GHC.Maybe.Maybe GHC.Types.Int)
  }
  deriving
    ( Int -> GetTopupsParametersQueryCreated'OneOf1 -> ShowS
[GetTopupsParametersQueryCreated'OneOf1] -> ShowS
GetTopupsParametersQueryCreated'OneOf1 -> String
(Int -> GetTopupsParametersQueryCreated'OneOf1 -> ShowS)
-> (GetTopupsParametersQueryCreated'OneOf1 -> String)
-> ([GetTopupsParametersQueryCreated'OneOf1] -> ShowS)
-> Show GetTopupsParametersQueryCreated'OneOf1
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetTopupsParametersQueryCreated'OneOf1] -> ShowS
$cshowList :: [GetTopupsParametersQueryCreated'OneOf1] -> ShowS
show :: GetTopupsParametersQueryCreated'OneOf1 -> String
$cshow :: GetTopupsParametersQueryCreated'OneOf1 -> String
showsPrec :: Int -> GetTopupsParametersQueryCreated'OneOf1 -> ShowS
$cshowsPrec :: Int -> GetTopupsParametersQueryCreated'OneOf1 -> ShowS
GHC.Show.Show,
      GetTopupsParametersQueryCreated'OneOf1
-> GetTopupsParametersQueryCreated'OneOf1 -> Bool
(GetTopupsParametersQueryCreated'OneOf1
 -> GetTopupsParametersQueryCreated'OneOf1 -> Bool)
-> (GetTopupsParametersQueryCreated'OneOf1
    -> GetTopupsParametersQueryCreated'OneOf1 -> Bool)
-> Eq GetTopupsParametersQueryCreated'OneOf1
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetTopupsParametersQueryCreated'OneOf1
-> GetTopupsParametersQueryCreated'OneOf1 -> Bool
$c/= :: GetTopupsParametersQueryCreated'OneOf1
-> GetTopupsParametersQueryCreated'OneOf1 -> Bool
== :: GetTopupsParametersQueryCreated'OneOf1
-> GetTopupsParametersQueryCreated'OneOf1 -> Bool
$c== :: GetTopupsParametersQueryCreated'OneOf1
-> GetTopupsParametersQueryCreated'OneOf1 -> Bool
GHC.Classes.Eq
    )

instance Data.Aeson.Types.ToJSON.ToJSON GetTopupsParametersQueryCreated'OneOf1 where
  toJSON :: GetTopupsParametersQueryCreated'OneOf1 -> Value
toJSON GetTopupsParametersQueryCreated'OneOf1
obj = [Pair] -> Value
Data.Aeson.Types.Internal.object (Text
"gt" Text -> Maybe Int -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= GetTopupsParametersQueryCreated'OneOf1 -> Maybe Int
getTopupsParametersQueryCreated'OneOf1Gt GetTopupsParametersQueryCreated'OneOf1
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"gte" Text -> Maybe Int -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= GetTopupsParametersQueryCreated'OneOf1 -> Maybe Int
getTopupsParametersQueryCreated'OneOf1Gte GetTopupsParametersQueryCreated'OneOf1
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"lt" Text -> Maybe Int -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= GetTopupsParametersQueryCreated'OneOf1 -> Maybe Int
getTopupsParametersQueryCreated'OneOf1Lt GetTopupsParametersQueryCreated'OneOf1
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"lte" Text -> Maybe Int -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= GetTopupsParametersQueryCreated'OneOf1 -> Maybe Int
getTopupsParametersQueryCreated'OneOf1Lte GetTopupsParametersQueryCreated'OneOf1
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: [Pair]
forall a. Monoid a => a
GHC.Base.mempty)
  toEncoding :: GetTopupsParametersQueryCreated'OneOf1 -> Encoding
toEncoding GetTopupsParametersQueryCreated'OneOf1
obj = Series -> Encoding
Data.Aeson.Encoding.Internal.pairs ((Text
"gt" Text -> Maybe Int -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= GetTopupsParametersQueryCreated'OneOf1 -> Maybe Int
getTopupsParametersQueryCreated'OneOf1Gt GetTopupsParametersQueryCreated'OneOf1
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"gte" Text -> Maybe Int -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= GetTopupsParametersQueryCreated'OneOf1 -> Maybe Int
getTopupsParametersQueryCreated'OneOf1Gte GetTopupsParametersQueryCreated'OneOf1
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"lt" Text -> Maybe Int -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= GetTopupsParametersQueryCreated'OneOf1 -> Maybe Int
getTopupsParametersQueryCreated'OneOf1Lt GetTopupsParametersQueryCreated'OneOf1
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> (Text
"lte" Text -> Maybe Int -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= GetTopupsParametersQueryCreated'OneOf1 -> Maybe Int
getTopupsParametersQueryCreated'OneOf1Lte GetTopupsParametersQueryCreated'OneOf1
obj))))

instance Data.Aeson.Types.FromJSON.FromJSON GetTopupsParametersQueryCreated'OneOf1 where
  parseJSON :: Value -> Parser GetTopupsParametersQueryCreated'OneOf1
parseJSON = String
-> (Object -> Parser GetTopupsParametersQueryCreated'OneOf1)
-> Value
-> Parser GetTopupsParametersQueryCreated'OneOf1
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.Aeson.Types.FromJSON.withObject String
"GetTopupsParametersQueryCreated'OneOf1" (\Object
obj -> ((((Maybe Int
 -> Maybe Int
 -> Maybe Int
 -> Maybe Int
 -> GetTopupsParametersQueryCreated'OneOf1)
-> Parser
     (Maybe Int
      -> Maybe Int
      -> Maybe Int
      -> Maybe Int
      -> GetTopupsParametersQueryCreated'OneOf1)
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure Maybe Int
-> Maybe Int
-> Maybe Int
-> Maybe Int
-> GetTopupsParametersQueryCreated'OneOf1
GetTopupsParametersQueryCreated'OneOf1 Parser
  (Maybe Int
   -> Maybe Int
   -> Maybe Int
   -> Maybe Int
   -> GetTopupsParametersQueryCreated'OneOf1)
-> Parser (Maybe Int)
-> Parser
     (Maybe Int
      -> Maybe Int
      -> Maybe Int
      -> GetTopupsParametersQueryCreated'OneOf1)
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
"gt")) Parser
  (Maybe Int
   -> Maybe Int
   -> Maybe Int
   -> GetTopupsParametersQueryCreated'OneOf1)
-> Parser (Maybe Int)
-> Parser
     (Maybe Int -> Maybe Int -> GetTopupsParametersQueryCreated'OneOf1)
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
"gte")) Parser
  (Maybe Int -> Maybe Int -> GetTopupsParametersQueryCreated'OneOf1)
-> Parser (Maybe Int)
-> Parser (Maybe Int -> GetTopupsParametersQueryCreated'OneOf1)
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
"lt")) Parser (Maybe Int -> GetTopupsParametersQueryCreated'OneOf1)
-> Parser (Maybe Int)
-> Parser GetTopupsParametersQueryCreated'OneOf1
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
"lte"))

-- | Create a new 'GetTopupsParametersQueryCreated'OneOf1' with all required fields.
mkGetTopupsParametersQueryCreated'OneOf1 :: GetTopupsParametersQueryCreated'OneOf1
mkGetTopupsParametersQueryCreated'OneOf1 :: GetTopupsParametersQueryCreated'OneOf1
mkGetTopupsParametersQueryCreated'OneOf1 =
  GetTopupsParametersQueryCreated'OneOf1 :: Maybe Int
-> Maybe Int
-> Maybe Int
-> Maybe Int
-> GetTopupsParametersQueryCreated'OneOf1
GetTopupsParametersQueryCreated'OneOf1
    { getTopupsParametersQueryCreated'OneOf1Gt :: Maybe Int
getTopupsParametersQueryCreated'OneOf1Gt = Maybe Int
forall a. Maybe a
GHC.Maybe.Nothing,
      getTopupsParametersQueryCreated'OneOf1Gte :: Maybe Int
getTopupsParametersQueryCreated'OneOf1Gte = Maybe Int
forall a. Maybe a
GHC.Maybe.Nothing,
      getTopupsParametersQueryCreated'OneOf1Lt :: Maybe Int
getTopupsParametersQueryCreated'OneOf1Lt = Maybe Int
forall a. Maybe a
GHC.Maybe.Nothing,
      getTopupsParametersQueryCreated'OneOf1Lte :: Maybe Int
getTopupsParametersQueryCreated'OneOf1Lte = Maybe Int
forall a. Maybe a
GHC.Maybe.Nothing
    }

-- | Defines the oneOf schema located at @paths.\/v1\/topups.GET.parameters.properties.queryCreated.anyOf@ in the specification.
--
-- Represents the parameter named \'created\'
--
-- A filter on the list, based on the object \`created\` field. The value can be a string with an integer Unix timestamp, or it can be a dictionary with a number of different query options.
data GetTopupsParametersQueryCreated'Variants
  = GetTopupsParametersQueryCreated'GetTopupsParametersQueryCreated'OneOf1 GetTopupsParametersQueryCreated'OneOf1
  | GetTopupsParametersQueryCreated'Int GHC.Types.Int
  deriving (Int -> GetTopupsParametersQueryCreated'Variants -> ShowS
[GetTopupsParametersQueryCreated'Variants] -> ShowS
GetTopupsParametersQueryCreated'Variants -> String
(Int -> GetTopupsParametersQueryCreated'Variants -> ShowS)
-> (GetTopupsParametersQueryCreated'Variants -> String)
-> ([GetTopupsParametersQueryCreated'Variants] -> ShowS)
-> Show GetTopupsParametersQueryCreated'Variants
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetTopupsParametersQueryCreated'Variants] -> ShowS
$cshowList :: [GetTopupsParametersQueryCreated'Variants] -> ShowS
show :: GetTopupsParametersQueryCreated'Variants -> String
$cshow :: GetTopupsParametersQueryCreated'Variants -> String
showsPrec :: Int -> GetTopupsParametersQueryCreated'Variants -> ShowS
$cshowsPrec :: Int -> GetTopupsParametersQueryCreated'Variants -> ShowS
GHC.Show.Show, GetTopupsParametersQueryCreated'Variants
-> GetTopupsParametersQueryCreated'Variants -> Bool
(GetTopupsParametersQueryCreated'Variants
 -> GetTopupsParametersQueryCreated'Variants -> Bool)
-> (GetTopupsParametersQueryCreated'Variants
    -> GetTopupsParametersQueryCreated'Variants -> Bool)
-> Eq GetTopupsParametersQueryCreated'Variants
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetTopupsParametersQueryCreated'Variants
-> GetTopupsParametersQueryCreated'Variants -> Bool
$c/= :: GetTopupsParametersQueryCreated'Variants
-> GetTopupsParametersQueryCreated'Variants -> Bool
== :: GetTopupsParametersQueryCreated'Variants
-> GetTopupsParametersQueryCreated'Variants -> Bool
$c== :: GetTopupsParametersQueryCreated'Variants
-> GetTopupsParametersQueryCreated'Variants -> Bool
GHC.Classes.Eq)

instance Data.Aeson.Types.ToJSON.ToJSON GetTopupsParametersQueryCreated'Variants where
  toJSON :: GetTopupsParametersQueryCreated'Variants -> Value
toJSON (GetTopupsParametersQueryCreated'GetTopupsParametersQueryCreated'OneOf1 GetTopupsParametersQueryCreated'OneOf1
a) = GetTopupsParametersQueryCreated'OneOf1 -> Value
forall a. ToJSON a => a -> Value
Data.Aeson.Types.ToJSON.toJSON GetTopupsParametersQueryCreated'OneOf1
a
  toJSON (GetTopupsParametersQueryCreated'Int Int
a) = Int -> Value
forall a. ToJSON a => a -> Value
Data.Aeson.Types.ToJSON.toJSON Int
a

instance Data.Aeson.Types.FromJSON.FromJSON GetTopupsParametersQueryCreated'Variants where
  parseJSON :: Value -> Parser GetTopupsParametersQueryCreated'Variants
parseJSON Value
val = case (GetTopupsParametersQueryCreated'OneOf1
-> GetTopupsParametersQueryCreated'Variants
GetTopupsParametersQueryCreated'GetTopupsParametersQueryCreated'OneOf1 (GetTopupsParametersQueryCreated'OneOf1
 -> GetTopupsParametersQueryCreated'Variants)
-> Result GetTopupsParametersQueryCreated'OneOf1
-> Result GetTopupsParametersQueryCreated'Variants
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Data.Functor.<$> Value -> Result GetTopupsParametersQueryCreated'OneOf1
forall a. FromJSON a => Value -> Result a
Data.Aeson.Types.FromJSON.fromJSON Value
val) Result GetTopupsParametersQueryCreated'Variants
-> Result GetTopupsParametersQueryCreated'Variants
-> Result GetTopupsParametersQueryCreated'Variants
forall (f :: * -> *) a. Alternative f => f a -> f a -> f a
GHC.Base.<|> ((Int -> GetTopupsParametersQueryCreated'Variants
GetTopupsParametersQueryCreated'Int (Int -> GetTopupsParametersQueryCreated'Variants)
-> Result Int -> Result GetTopupsParametersQueryCreated'Variants
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Data.Functor.<$> Value -> Result Int
forall a. FromJSON a => Value -> Result a
Data.Aeson.Types.FromJSON.fromJSON Value
val) Result GetTopupsParametersQueryCreated'Variants
-> Result GetTopupsParametersQueryCreated'Variants
-> Result GetTopupsParametersQueryCreated'Variants
forall (f :: * -> *) a. Alternative f => f a -> f a -> f a
GHC.Base.<|> String -> Result GetTopupsParametersQueryCreated'Variants
forall a. String -> Result a
Data.Aeson.Types.Internal.Error String
"No variant matched") of
    Data.Aeson.Types.Internal.Success GetTopupsParametersQueryCreated'Variants
a -> GetTopupsParametersQueryCreated'Variants
-> Parser GetTopupsParametersQueryCreated'Variants
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure GetTopupsParametersQueryCreated'Variants
a
    Data.Aeson.Types.Internal.Error String
a -> String -> Parser GetTopupsParametersQueryCreated'Variants
forall (m :: * -> *) a. MonadFail m => String -> m a
Control.Monad.Fail.fail String
a

-- | Defines the enum schema located at @paths.\/v1\/topups.GET.parameters.properties.queryStatus@ in the specification.
--
-- Represents the parameter named \'status\'
--
-- Only return top-ups that have the given status. One of \`canceled\`, \`failed\`, \`pending\` or \`succeeded\`.
data GetTopupsParametersQueryStatus'
  = -- | This case is used if the value encountered during decoding does not match any of the provided cases in the specification.
    GetTopupsParametersQueryStatus'Other Data.Aeson.Types.Internal.Value
  | -- | This constructor can be used to send values to the server which are not present in the specification yet.
    GetTopupsParametersQueryStatus'Typed Data.Text.Internal.Text
  | -- | Represents the JSON value @"canceled"@
    GetTopupsParametersQueryStatus'EnumCanceled
  | -- | Represents the JSON value @"failed"@
    GetTopupsParametersQueryStatus'EnumFailed
  | -- | Represents the JSON value @"pending"@
    GetTopupsParametersQueryStatus'EnumPending
  | -- | Represents the JSON value @"succeeded"@
    GetTopupsParametersQueryStatus'EnumSucceeded
  deriving (Int -> GetTopupsParametersQueryStatus' -> ShowS
[GetTopupsParametersQueryStatus'] -> ShowS
GetTopupsParametersQueryStatus' -> String
(Int -> GetTopupsParametersQueryStatus' -> ShowS)
-> (GetTopupsParametersQueryStatus' -> String)
-> ([GetTopupsParametersQueryStatus'] -> ShowS)
-> Show GetTopupsParametersQueryStatus'
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetTopupsParametersQueryStatus'] -> ShowS
$cshowList :: [GetTopupsParametersQueryStatus'] -> ShowS
show :: GetTopupsParametersQueryStatus' -> String
$cshow :: GetTopupsParametersQueryStatus' -> String
showsPrec :: Int -> GetTopupsParametersQueryStatus' -> ShowS
$cshowsPrec :: Int -> GetTopupsParametersQueryStatus' -> ShowS
GHC.Show.Show, GetTopupsParametersQueryStatus'
-> GetTopupsParametersQueryStatus' -> Bool
(GetTopupsParametersQueryStatus'
 -> GetTopupsParametersQueryStatus' -> Bool)
-> (GetTopupsParametersQueryStatus'
    -> GetTopupsParametersQueryStatus' -> Bool)
-> Eq GetTopupsParametersQueryStatus'
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetTopupsParametersQueryStatus'
-> GetTopupsParametersQueryStatus' -> Bool
$c/= :: GetTopupsParametersQueryStatus'
-> GetTopupsParametersQueryStatus' -> Bool
== :: GetTopupsParametersQueryStatus'
-> GetTopupsParametersQueryStatus' -> Bool
$c== :: GetTopupsParametersQueryStatus'
-> GetTopupsParametersQueryStatus' -> Bool
GHC.Classes.Eq)

instance Data.Aeson.Types.ToJSON.ToJSON GetTopupsParametersQueryStatus' where
  toJSON :: GetTopupsParametersQueryStatus' -> Value
toJSON (GetTopupsParametersQueryStatus'Other Value
val) = Value
val
  toJSON (GetTopupsParametersQueryStatus'Typed Text
val) = Text -> Value
forall a. ToJSON a => a -> Value
Data.Aeson.Types.ToJSON.toJSON Text
val
  toJSON (GetTopupsParametersQueryStatus'
GetTopupsParametersQueryStatus'EnumCanceled) = Value
"canceled"
  toJSON (GetTopupsParametersQueryStatus'
GetTopupsParametersQueryStatus'EnumFailed) = Value
"failed"
  toJSON (GetTopupsParametersQueryStatus'
GetTopupsParametersQueryStatus'EnumPending) = Value
"pending"
  toJSON (GetTopupsParametersQueryStatus'
GetTopupsParametersQueryStatus'EnumSucceeded) = Value
"succeeded"

instance Data.Aeson.Types.FromJSON.FromJSON GetTopupsParametersQueryStatus' where
  parseJSON :: Value -> Parser GetTopupsParametersQueryStatus'
parseJSON Value
val =
    GetTopupsParametersQueryStatus'
-> Parser GetTopupsParametersQueryStatus'
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure
      ( if
            | Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"canceled" -> GetTopupsParametersQueryStatus'
GetTopupsParametersQueryStatus'EnumCanceled
            | Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"failed" -> GetTopupsParametersQueryStatus'
GetTopupsParametersQueryStatus'EnumFailed
            | Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"pending" -> GetTopupsParametersQueryStatus'
GetTopupsParametersQueryStatus'EnumPending
            | Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"succeeded" -> GetTopupsParametersQueryStatus'
GetTopupsParametersQueryStatus'EnumSucceeded
            | Bool
GHC.Base.otherwise -> Value -> GetTopupsParametersQueryStatus'
GetTopupsParametersQueryStatus'Other Value
val
      )

-- | Represents a response of the operation 'getTopups'.
--
-- The response constructor is chosen by the status code of the response. If no case matches (no specific case for the response code, no range case, no default case), 'GetTopupsResponseError' is used.
data GetTopupsResponse
  = -- | Means either no matching case available or a parse error
    GetTopupsResponseError GHC.Base.String
  | -- | Successful response.
    GetTopupsResponse200 GetTopupsResponseBody200
  | -- | Error response.
    GetTopupsResponseDefault Error
  deriving (Int -> GetTopupsResponse -> ShowS
[GetTopupsResponse] -> ShowS
GetTopupsResponse -> String
(Int -> GetTopupsResponse -> ShowS)
-> (GetTopupsResponse -> String)
-> ([GetTopupsResponse] -> ShowS)
-> Show GetTopupsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetTopupsResponse] -> ShowS
$cshowList :: [GetTopupsResponse] -> ShowS
show :: GetTopupsResponse -> String
$cshow :: GetTopupsResponse -> String
showsPrec :: Int -> GetTopupsResponse -> ShowS
$cshowsPrec :: Int -> GetTopupsResponse -> ShowS
GHC.Show.Show, GetTopupsResponse -> GetTopupsResponse -> Bool
(GetTopupsResponse -> GetTopupsResponse -> Bool)
-> (GetTopupsResponse -> GetTopupsResponse -> Bool)
-> Eq GetTopupsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetTopupsResponse -> GetTopupsResponse -> Bool
$c/= :: GetTopupsResponse -> GetTopupsResponse -> Bool
== :: GetTopupsResponse -> GetTopupsResponse -> Bool
$c== :: GetTopupsResponse -> GetTopupsResponse -> Bool
GHC.Classes.Eq)

-- | Defines the object schema located at @paths.\/v1\/topups.GET.responses.200.content.application\/json.schema@ in the specification.
data GetTopupsResponseBody200 = GetTopupsResponseBody200
  { -- | data
    GetTopupsResponseBody200 -> [Topup]
getTopupsResponseBody200Data :: ([Topup]),
    -- | has_more: True if this list has another page of items after this one that can be fetched.
    GetTopupsResponseBody200 -> Bool
getTopupsResponseBody200HasMore :: GHC.Types.Bool,
    -- | url: The URL where this list can be accessed.
    --
    -- Constraints:
    --
    -- * Maximum length of 5000
    -- * Must match pattern \'^\/v1\/topups\'
    GetTopupsResponseBody200 -> Text
getTopupsResponseBody200Url :: Data.Text.Internal.Text
  }
  deriving
    ( Int -> GetTopupsResponseBody200 -> ShowS
[GetTopupsResponseBody200] -> ShowS
GetTopupsResponseBody200 -> String
(Int -> GetTopupsResponseBody200 -> ShowS)
-> (GetTopupsResponseBody200 -> String)
-> ([GetTopupsResponseBody200] -> ShowS)
-> Show GetTopupsResponseBody200
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetTopupsResponseBody200] -> ShowS
$cshowList :: [GetTopupsResponseBody200] -> ShowS
show :: GetTopupsResponseBody200 -> String
$cshow :: GetTopupsResponseBody200 -> String
showsPrec :: Int -> GetTopupsResponseBody200 -> ShowS
$cshowsPrec :: Int -> GetTopupsResponseBody200 -> ShowS
GHC.Show.Show,
      GetTopupsResponseBody200 -> GetTopupsResponseBody200 -> Bool
(GetTopupsResponseBody200 -> GetTopupsResponseBody200 -> Bool)
-> (GetTopupsResponseBody200 -> GetTopupsResponseBody200 -> Bool)
-> Eq GetTopupsResponseBody200
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetTopupsResponseBody200 -> GetTopupsResponseBody200 -> Bool
$c/= :: GetTopupsResponseBody200 -> GetTopupsResponseBody200 -> Bool
== :: GetTopupsResponseBody200 -> GetTopupsResponseBody200 -> Bool
$c== :: GetTopupsResponseBody200 -> GetTopupsResponseBody200 -> Bool
GHC.Classes.Eq
    )

instance Data.Aeson.Types.ToJSON.ToJSON GetTopupsResponseBody200 where
  toJSON :: GetTopupsResponseBody200 -> Value
toJSON GetTopupsResponseBody200
obj = [Pair] -> Value
Data.Aeson.Types.Internal.object (Text
"data" Text -> [Topup] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= GetTopupsResponseBody200 -> [Topup]
getTopupsResponseBody200Data GetTopupsResponseBody200
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"has_more" Text -> Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= GetTopupsResponseBody200 -> Bool
getTopupsResponseBody200HasMore GetTopupsResponseBody200
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"url" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= GetTopupsResponseBody200 -> Text
getTopupsResponseBody200Url GetTopupsResponseBody200
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
"list" Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: [Pair]
forall a. Monoid a => a
GHC.Base.mempty)
  toEncoding :: GetTopupsResponseBody200 -> Encoding
toEncoding GetTopupsResponseBody200
obj = Series -> Encoding
Data.Aeson.Encoding.Internal.pairs ((Text
"data" Text -> [Topup] -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= GetTopupsResponseBody200 -> [Topup]
getTopupsResponseBody200Data GetTopupsResponseBody200
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"has_more" Text -> Bool -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= GetTopupsResponseBody200 -> Bool
getTopupsResponseBody200HasMore GetTopupsResponseBody200
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"url" Text -> Text -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= GetTopupsResponseBody200 -> Text
getTopupsResponseBody200Url GetTopupsResponseBody200
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
"list"))))

instance Data.Aeson.Types.FromJSON.FromJSON GetTopupsResponseBody200 where
  parseJSON :: Value -> Parser GetTopupsResponseBody200
parseJSON = String
-> (Object -> Parser GetTopupsResponseBody200)
-> Value
-> Parser GetTopupsResponseBody200
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.Aeson.Types.FromJSON.withObject String
"GetTopupsResponseBody200" (\Object
obj -> ((([Topup] -> Bool -> Text -> GetTopupsResponseBody200)
-> Parser ([Topup] -> Bool -> Text -> GetTopupsResponseBody200)
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure [Topup] -> Bool -> Text -> GetTopupsResponseBody200
GetTopupsResponseBody200 Parser ([Topup] -> Bool -> Text -> GetTopupsResponseBody200)
-> Parser [Topup]
-> Parser (Bool -> Text -> GetTopupsResponseBody200)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Text -> Parser [Topup]
forall a. FromJSON a => Object -> Text -> Parser a
Data.Aeson.Types.FromJSON..: Text
"data")) Parser (Bool -> Text -> GetTopupsResponseBody200)
-> Parser Bool -> Parser (Text -> GetTopupsResponseBody200)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Text -> Parser Bool
forall a. FromJSON a => Object -> Text -> Parser a
Data.Aeson.Types.FromJSON..: Text
"has_more")) Parser (Text -> GetTopupsResponseBody200)
-> Parser Text -> Parser GetTopupsResponseBody200
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
"url"))

-- | Create a new 'GetTopupsResponseBody200' with all required fields.
mkGetTopupsResponseBody200 ::
  -- | 'getTopupsResponseBody200Data'
  [Topup] ->
  -- | 'getTopupsResponseBody200HasMore'
  GHC.Types.Bool ->
  -- | 'getTopupsResponseBody200Url'
  Data.Text.Internal.Text ->
  GetTopupsResponseBody200
mkGetTopupsResponseBody200 :: [Topup] -> Bool -> Text -> GetTopupsResponseBody200
mkGetTopupsResponseBody200 [Topup]
getTopupsResponseBody200Data Bool
getTopupsResponseBody200HasMore Text
getTopupsResponseBody200Url =
  GetTopupsResponseBody200 :: [Topup] -> Bool -> Text -> GetTopupsResponseBody200
GetTopupsResponseBody200
    { getTopupsResponseBody200Data :: [Topup]
getTopupsResponseBody200Data = [Topup]
getTopupsResponseBody200Data,
      getTopupsResponseBody200HasMore :: Bool
getTopupsResponseBody200HasMore = Bool
getTopupsResponseBody200HasMore,
      getTopupsResponseBody200Url :: Text
getTopupsResponseBody200Url = Text
getTopupsResponseBody200Url
    }