{-# 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 getApplicationFees
module StripeAPI.Operations.GetApplicationFees 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/application_fees
--
-- \<p>Returns a list of application fees you’ve previously collected. The application fees are returned in sorted order, with the most recent fees appearing first.\<\/p>
getApplicationFees ::
  forall m.
  StripeAPI.Common.MonadHTTP m =>
  -- | Contains all available parameters of this operation (query and path parameters)
  GetApplicationFeesParameters ->
  -- | Monadic computation which returns the result of the operation
  StripeAPI.Common.StripeT m (Network.HTTP.Client.Types.Response GetApplicationFeesResponse)
getApplicationFees :: GetApplicationFeesParameters
-> StripeT m (Response GetApplicationFeesResponse)
getApplicationFees GetApplicationFeesParameters
parameters =
  (Response ByteString -> Response GetApplicationFeesResponse)
-> StripeT m (Response ByteString)
-> StripeT m (Response GetApplicationFeesResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
GHC.Base.fmap
    ( \Response ByteString
response_0 ->
        (ByteString -> GetApplicationFeesResponse)
-> Response ByteString -> Response GetApplicationFeesResponse
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
GHC.Base.fmap
          ( (String -> GetApplicationFeesResponse)
-> (GetApplicationFeesResponse -> GetApplicationFeesResponse)
-> Either String GetApplicationFeesResponse
-> GetApplicationFeesResponse
forall a c b. (a -> c) -> (b -> c) -> Either a b -> c
Data.Either.either String -> GetApplicationFeesResponse
GetApplicationFeesResponseError GetApplicationFeesResponse -> GetApplicationFeesResponse
forall a. a -> a
GHC.Base.id
              (Either String GetApplicationFeesResponse
 -> GetApplicationFeesResponse)
-> (ByteString -> Either String GetApplicationFeesResponse)
-> ByteString
-> GetApplicationFeesResponse
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) ->
                                   GetApplicationFeesResponseBody200 -> GetApplicationFeesResponse
GetApplicationFeesResponse200
                                     (GetApplicationFeesResponseBody200 -> GetApplicationFeesResponse)
-> Either String GetApplicationFeesResponseBody200
-> Either String GetApplicationFeesResponse
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Data.Functor.<$> ( ByteString -> Either String GetApplicationFeesResponseBody200
forall a. FromJSON a => ByteString -> Either String a
Data.Aeson.eitherDecodeStrict ByteString
body ::
                                                          Data.Either.Either
                                                            GHC.Base.String
                                                            GetApplicationFeesResponseBody200
                                                      )
                                 | 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 -> GetApplicationFeesResponse
GetApplicationFeesResponseDefault
                                     (Error -> GetApplicationFeesResponse)
-> Either String Error -> Either String GetApplicationFeesResponse
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 GetApplicationFeesResponse
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] -> StripeT m (Response ByteString)
forall (m :: * -> *).
MonadHTTP m =>
Text -> Text -> [QueryParameter] -> StripeT 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/application_fees")
        [ Text -> Maybe Value -> Text -> Bool -> QueryParameter
StripeAPI.Common.QueryParameter (String -> Text
Data.Text.pack String
"charge") (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.<$> GetApplicationFeesParameters -> Maybe Text
getApplicationFeesParametersQueryCharge GetApplicationFeesParameters
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
"created") (GetApplicationFeesParametersQueryCreated'Variants -> Value
forall a. ToJSON a => a -> Value
Data.Aeson.Types.ToJSON.toJSON (GetApplicationFeesParametersQueryCreated'Variants -> Value)
-> Maybe GetApplicationFeesParametersQueryCreated'Variants
-> Maybe Value
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Data.Functor.<$> GetApplicationFeesParameters
-> Maybe GetApplicationFeesParametersQueryCreated'Variants
getApplicationFeesParametersQueryCreated GetApplicationFeesParameters
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.<$> GetApplicationFeesParameters -> Maybe Text
getApplicationFeesParametersQueryEndingBefore GetApplicationFeesParameters
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.<$> GetApplicationFeesParameters -> Maybe [Text]
getApplicationFeesParametersQueryExpand GetApplicationFeesParameters
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.<$> GetApplicationFeesParameters -> Maybe Int
getApplicationFeesParametersQueryLimit GetApplicationFeesParameters
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.<$> GetApplicationFeesParameters -> Maybe Text
getApplicationFeesParametersQueryStartingAfter GetApplicationFeesParameters
parameters) (String -> Text
Data.Text.pack String
"form") Bool
GHC.Types.True
        ]
    )

-- | Defines the object schema located at @paths.\/v1\/application_fees.GET.parameters@ in the specification.
data GetApplicationFeesParameters = GetApplicationFeesParameters
  { -- | queryCharge: Represents the parameter named \'charge\'
    --
    -- Only return application fees for the charge specified by this charge ID.
    --
    -- Constraints:
    --
    -- * Maximum length of 5000
    GetApplicationFeesParameters -> Maybe Text
getApplicationFeesParametersQueryCharge :: (GHC.Maybe.Maybe Data.Text.Internal.Text),
    -- | queryCreated: Represents the parameter named \'created\'
    GetApplicationFeesParameters
-> Maybe GetApplicationFeesParametersQueryCreated'Variants
getApplicationFeesParametersQueryCreated :: (GHC.Maybe.Maybe GetApplicationFeesParametersQueryCreated'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
    GetApplicationFeesParameters -> Maybe Text
getApplicationFeesParametersQueryEndingBefore :: (GHC.Maybe.Maybe Data.Text.Internal.Text),
    -- | queryExpand: Represents the parameter named \'expand\'
    --
    -- Specifies which fields in the response should be expanded.
    GetApplicationFeesParameters -> Maybe [Text]
getApplicationFeesParametersQueryExpand :: (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.
    GetApplicationFeesParameters -> Maybe Int
getApplicationFeesParametersQueryLimit :: (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
    GetApplicationFeesParameters -> Maybe Text
getApplicationFeesParametersQueryStartingAfter :: (GHC.Maybe.Maybe Data.Text.Internal.Text)
  }
  deriving
    ( Int -> GetApplicationFeesParameters -> ShowS
[GetApplicationFeesParameters] -> ShowS
GetApplicationFeesParameters -> String
(Int -> GetApplicationFeesParameters -> ShowS)
-> (GetApplicationFeesParameters -> String)
-> ([GetApplicationFeesParameters] -> ShowS)
-> Show GetApplicationFeesParameters
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetApplicationFeesParameters] -> ShowS
$cshowList :: [GetApplicationFeesParameters] -> ShowS
show :: GetApplicationFeesParameters -> String
$cshow :: GetApplicationFeesParameters -> String
showsPrec :: Int -> GetApplicationFeesParameters -> ShowS
$cshowsPrec :: Int -> GetApplicationFeesParameters -> ShowS
GHC.Show.Show,
      GetApplicationFeesParameters
-> GetApplicationFeesParameters -> Bool
(GetApplicationFeesParameters
 -> GetApplicationFeesParameters -> Bool)
-> (GetApplicationFeesParameters
    -> GetApplicationFeesParameters -> Bool)
-> Eq GetApplicationFeesParameters
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetApplicationFeesParameters
-> GetApplicationFeesParameters -> Bool
$c/= :: GetApplicationFeesParameters
-> GetApplicationFeesParameters -> Bool
== :: GetApplicationFeesParameters
-> GetApplicationFeesParameters -> Bool
$c== :: GetApplicationFeesParameters
-> GetApplicationFeesParameters -> Bool
GHC.Classes.Eq
    )

instance Data.Aeson.Types.ToJSON.ToJSON GetApplicationFeesParameters where
  toJSON :: GetApplicationFeesParameters -> Value
toJSON GetApplicationFeesParameters
obj = [Pair] -> Value
Data.Aeson.Types.Internal.object (Text
"queryCharge" Text -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= GetApplicationFeesParameters -> Maybe Text
getApplicationFeesParametersQueryCharge GetApplicationFeesParameters
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"queryCreated" Text
-> Maybe GetApplicationFeesParametersQueryCreated'Variants -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= GetApplicationFeesParameters
-> Maybe GetApplicationFeesParametersQueryCreated'Variants
getApplicationFeesParametersQueryCreated GetApplicationFeesParameters
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..= GetApplicationFeesParameters -> Maybe Text
getApplicationFeesParametersQueryEndingBefore GetApplicationFeesParameters
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..= GetApplicationFeesParameters -> Maybe [Text]
getApplicationFeesParametersQueryExpand GetApplicationFeesParameters
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..= GetApplicationFeesParameters -> Maybe Int
getApplicationFeesParametersQueryLimit GetApplicationFeesParameters
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..= GetApplicationFeesParameters -> Maybe Text
getApplicationFeesParametersQueryStartingAfter GetApplicationFeesParameters
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: [Pair]
forall a. Monoid a => a
GHC.Base.mempty)
  toEncoding :: GetApplicationFeesParameters -> Encoding
toEncoding GetApplicationFeesParameters
obj = Series -> Encoding
Data.Aeson.Encoding.Internal.pairs ((Text
"queryCharge" Text -> Maybe Text -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= GetApplicationFeesParameters -> Maybe Text
getApplicationFeesParametersQueryCharge GetApplicationFeesParameters
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"queryCreated" Text
-> Maybe GetApplicationFeesParametersQueryCreated'Variants
-> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= GetApplicationFeesParameters
-> Maybe GetApplicationFeesParametersQueryCreated'Variants
getApplicationFeesParametersQueryCreated GetApplicationFeesParameters
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..= GetApplicationFeesParameters -> Maybe Text
getApplicationFeesParametersQueryEndingBefore GetApplicationFeesParameters
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..= GetApplicationFeesParameters -> Maybe [Text]
getApplicationFeesParametersQueryExpand GetApplicationFeesParameters
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..= GetApplicationFeesParameters -> Maybe Int
getApplicationFeesParametersQueryLimit GetApplicationFeesParameters
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..= GetApplicationFeesParameters -> Maybe Text
getApplicationFeesParametersQueryStartingAfter GetApplicationFeesParameters
obj))))))

instance Data.Aeson.Types.FromJSON.FromJSON GetApplicationFeesParameters where
  parseJSON :: Value -> Parser GetApplicationFeesParameters
parseJSON = String
-> (Object -> Parser GetApplicationFeesParameters)
-> Value
-> Parser GetApplicationFeesParameters
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.Aeson.Types.FromJSON.withObject String
"GetApplicationFeesParameters" (\Object
obj -> ((((((Maybe Text
 -> Maybe GetApplicationFeesParametersQueryCreated'Variants
 -> Maybe Text
 -> Maybe [Text]
 -> Maybe Int
 -> Maybe Text
 -> GetApplicationFeesParameters)
-> Parser
     (Maybe Text
      -> Maybe GetApplicationFeesParametersQueryCreated'Variants
      -> Maybe Text
      -> Maybe [Text]
      -> Maybe Int
      -> Maybe Text
      -> GetApplicationFeesParameters)
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure Maybe Text
-> Maybe GetApplicationFeesParametersQueryCreated'Variants
-> Maybe Text
-> Maybe [Text]
-> Maybe Int
-> Maybe Text
-> GetApplicationFeesParameters
GetApplicationFeesParameters Parser
  (Maybe Text
   -> Maybe GetApplicationFeesParametersQueryCreated'Variants
   -> Maybe Text
   -> Maybe [Text]
   -> Maybe Int
   -> Maybe Text
   -> GetApplicationFeesParameters)
-> Parser (Maybe Text)
-> Parser
     (Maybe GetApplicationFeesParametersQueryCreated'Variants
      -> Maybe Text
      -> Maybe [Text]
      -> Maybe Int
      -> Maybe Text
      -> GetApplicationFeesParameters)
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
"queryCharge")) Parser
  (Maybe GetApplicationFeesParametersQueryCreated'Variants
   -> Maybe Text
   -> Maybe [Text]
   -> Maybe Int
   -> Maybe Text
   -> GetApplicationFeesParameters)
-> Parser (Maybe GetApplicationFeesParametersQueryCreated'Variants)
-> Parser
     (Maybe Text
      -> Maybe [Text]
      -> Maybe Int
      -> Maybe Text
      -> GetApplicationFeesParameters)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object
-> Text
-> Parser (Maybe GetApplicationFeesParametersQueryCreated'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
   -> GetApplicationFeesParameters)
-> Parser (Maybe Text)
-> Parser
     (Maybe [Text]
      -> Maybe Int -> Maybe Text -> GetApplicationFeesParameters)
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 -> GetApplicationFeesParameters)
-> Parser (Maybe [Text])
-> Parser (Maybe Int -> Maybe Text -> GetApplicationFeesParameters)
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 -> GetApplicationFeesParameters)
-> Parser (Maybe Int)
-> Parser (Maybe Text -> GetApplicationFeesParameters)
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 -> GetApplicationFeesParameters)
-> Parser (Maybe Text) -> Parser GetApplicationFeesParameters
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"))

-- | Create a new 'GetApplicationFeesParameters' with all required fields.
mkGetApplicationFeesParameters :: GetApplicationFeesParameters
mkGetApplicationFeesParameters :: GetApplicationFeesParameters
mkGetApplicationFeesParameters =
  GetApplicationFeesParameters :: Maybe Text
-> Maybe GetApplicationFeesParametersQueryCreated'Variants
-> Maybe Text
-> Maybe [Text]
-> Maybe Int
-> Maybe Text
-> GetApplicationFeesParameters
GetApplicationFeesParameters
    { getApplicationFeesParametersQueryCharge :: Maybe Text
getApplicationFeesParametersQueryCharge = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing,
      getApplicationFeesParametersQueryCreated :: Maybe GetApplicationFeesParametersQueryCreated'Variants
getApplicationFeesParametersQueryCreated = Maybe GetApplicationFeesParametersQueryCreated'Variants
forall a. Maybe a
GHC.Maybe.Nothing,
      getApplicationFeesParametersQueryEndingBefore :: Maybe Text
getApplicationFeesParametersQueryEndingBefore = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing,
      getApplicationFeesParametersQueryExpand :: Maybe [Text]
getApplicationFeesParametersQueryExpand = Maybe [Text]
forall a. Maybe a
GHC.Maybe.Nothing,
      getApplicationFeesParametersQueryLimit :: Maybe Int
getApplicationFeesParametersQueryLimit = Maybe Int
forall a. Maybe a
GHC.Maybe.Nothing,
      getApplicationFeesParametersQueryStartingAfter :: Maybe Text
getApplicationFeesParametersQueryStartingAfter = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing
    }

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

instance Data.Aeson.Types.ToJSON.ToJSON GetApplicationFeesParametersQueryCreated'OneOf1 where
  toJSON :: GetApplicationFeesParametersQueryCreated'OneOf1 -> Value
toJSON GetApplicationFeesParametersQueryCreated'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..= GetApplicationFeesParametersQueryCreated'OneOf1 -> Maybe Int
getApplicationFeesParametersQueryCreated'OneOf1Gt GetApplicationFeesParametersQueryCreated'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..= GetApplicationFeesParametersQueryCreated'OneOf1 -> Maybe Int
getApplicationFeesParametersQueryCreated'OneOf1Gte GetApplicationFeesParametersQueryCreated'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..= GetApplicationFeesParametersQueryCreated'OneOf1 -> Maybe Int
getApplicationFeesParametersQueryCreated'OneOf1Lt GetApplicationFeesParametersQueryCreated'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..= GetApplicationFeesParametersQueryCreated'OneOf1 -> Maybe Int
getApplicationFeesParametersQueryCreated'OneOf1Lte GetApplicationFeesParametersQueryCreated'OneOf1
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: [Pair]
forall a. Monoid a => a
GHC.Base.mempty)
  toEncoding :: GetApplicationFeesParametersQueryCreated'OneOf1 -> Encoding
toEncoding GetApplicationFeesParametersQueryCreated'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..= GetApplicationFeesParametersQueryCreated'OneOf1 -> Maybe Int
getApplicationFeesParametersQueryCreated'OneOf1Gt GetApplicationFeesParametersQueryCreated'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..= GetApplicationFeesParametersQueryCreated'OneOf1 -> Maybe Int
getApplicationFeesParametersQueryCreated'OneOf1Gte GetApplicationFeesParametersQueryCreated'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..= GetApplicationFeesParametersQueryCreated'OneOf1 -> Maybe Int
getApplicationFeesParametersQueryCreated'OneOf1Lt GetApplicationFeesParametersQueryCreated'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..= GetApplicationFeesParametersQueryCreated'OneOf1 -> Maybe Int
getApplicationFeesParametersQueryCreated'OneOf1Lte GetApplicationFeesParametersQueryCreated'OneOf1
obj))))

instance Data.Aeson.Types.FromJSON.FromJSON GetApplicationFeesParametersQueryCreated'OneOf1 where
  parseJSON :: Value -> Parser GetApplicationFeesParametersQueryCreated'OneOf1
parseJSON = String
-> (Object
    -> Parser GetApplicationFeesParametersQueryCreated'OneOf1)
-> Value
-> Parser GetApplicationFeesParametersQueryCreated'OneOf1
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.Aeson.Types.FromJSON.withObject String
"GetApplicationFeesParametersQueryCreated'OneOf1" (\Object
obj -> ((((Maybe Int
 -> Maybe Int
 -> Maybe Int
 -> Maybe Int
 -> GetApplicationFeesParametersQueryCreated'OneOf1)
-> Parser
     (Maybe Int
      -> Maybe Int
      -> Maybe Int
      -> Maybe Int
      -> GetApplicationFeesParametersQueryCreated'OneOf1)
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure Maybe Int
-> Maybe Int
-> Maybe Int
-> Maybe Int
-> GetApplicationFeesParametersQueryCreated'OneOf1
GetApplicationFeesParametersQueryCreated'OneOf1 Parser
  (Maybe Int
   -> Maybe Int
   -> Maybe Int
   -> Maybe Int
   -> GetApplicationFeesParametersQueryCreated'OneOf1)
-> Parser (Maybe Int)
-> Parser
     (Maybe Int
      -> Maybe Int
      -> Maybe Int
      -> GetApplicationFeesParametersQueryCreated'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
   -> GetApplicationFeesParametersQueryCreated'OneOf1)
-> Parser (Maybe Int)
-> Parser
     (Maybe Int
      -> Maybe Int -> GetApplicationFeesParametersQueryCreated'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 -> GetApplicationFeesParametersQueryCreated'OneOf1)
-> Parser (Maybe Int)
-> Parser
     (Maybe Int -> GetApplicationFeesParametersQueryCreated'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 -> GetApplicationFeesParametersQueryCreated'OneOf1)
-> Parser (Maybe Int)
-> Parser GetApplicationFeesParametersQueryCreated'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 'GetApplicationFeesParametersQueryCreated'OneOf1' with all required fields.
mkGetApplicationFeesParametersQueryCreated'OneOf1 :: GetApplicationFeesParametersQueryCreated'OneOf1
mkGetApplicationFeesParametersQueryCreated'OneOf1 :: GetApplicationFeesParametersQueryCreated'OneOf1
mkGetApplicationFeesParametersQueryCreated'OneOf1 =
  GetApplicationFeesParametersQueryCreated'OneOf1 :: Maybe Int
-> Maybe Int
-> Maybe Int
-> Maybe Int
-> GetApplicationFeesParametersQueryCreated'OneOf1
GetApplicationFeesParametersQueryCreated'OneOf1
    { getApplicationFeesParametersQueryCreated'OneOf1Gt :: Maybe Int
getApplicationFeesParametersQueryCreated'OneOf1Gt = Maybe Int
forall a. Maybe a
GHC.Maybe.Nothing,
      getApplicationFeesParametersQueryCreated'OneOf1Gte :: Maybe Int
getApplicationFeesParametersQueryCreated'OneOf1Gte = Maybe Int
forall a. Maybe a
GHC.Maybe.Nothing,
      getApplicationFeesParametersQueryCreated'OneOf1Lt :: Maybe Int
getApplicationFeesParametersQueryCreated'OneOf1Lt = Maybe Int
forall a. Maybe a
GHC.Maybe.Nothing,
      getApplicationFeesParametersQueryCreated'OneOf1Lte :: Maybe Int
getApplicationFeesParametersQueryCreated'OneOf1Lte = Maybe Int
forall a. Maybe a
GHC.Maybe.Nothing
    }

-- | Defines the oneOf schema located at @paths.\/v1\/application_fees.GET.parameters.properties.queryCreated.anyOf@ in the specification.
--
-- Represents the parameter named \'created\'
data GetApplicationFeesParametersQueryCreated'Variants
  = GetApplicationFeesParametersQueryCreated'GetApplicationFeesParametersQueryCreated'OneOf1 GetApplicationFeesParametersQueryCreated'OneOf1
  | GetApplicationFeesParametersQueryCreated'Int GHC.Types.Int
  deriving (Int -> GetApplicationFeesParametersQueryCreated'Variants -> ShowS
[GetApplicationFeesParametersQueryCreated'Variants] -> ShowS
GetApplicationFeesParametersQueryCreated'Variants -> String
(Int -> GetApplicationFeesParametersQueryCreated'Variants -> ShowS)
-> (GetApplicationFeesParametersQueryCreated'Variants -> String)
-> ([GetApplicationFeesParametersQueryCreated'Variants] -> ShowS)
-> Show GetApplicationFeesParametersQueryCreated'Variants
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetApplicationFeesParametersQueryCreated'Variants] -> ShowS
$cshowList :: [GetApplicationFeesParametersQueryCreated'Variants] -> ShowS
show :: GetApplicationFeesParametersQueryCreated'Variants -> String
$cshow :: GetApplicationFeesParametersQueryCreated'Variants -> String
showsPrec :: Int -> GetApplicationFeesParametersQueryCreated'Variants -> ShowS
$cshowsPrec :: Int -> GetApplicationFeesParametersQueryCreated'Variants -> ShowS
GHC.Show.Show, GetApplicationFeesParametersQueryCreated'Variants
-> GetApplicationFeesParametersQueryCreated'Variants -> Bool
(GetApplicationFeesParametersQueryCreated'Variants
 -> GetApplicationFeesParametersQueryCreated'Variants -> Bool)
-> (GetApplicationFeesParametersQueryCreated'Variants
    -> GetApplicationFeesParametersQueryCreated'Variants -> Bool)
-> Eq GetApplicationFeesParametersQueryCreated'Variants
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetApplicationFeesParametersQueryCreated'Variants
-> GetApplicationFeesParametersQueryCreated'Variants -> Bool
$c/= :: GetApplicationFeesParametersQueryCreated'Variants
-> GetApplicationFeesParametersQueryCreated'Variants -> Bool
== :: GetApplicationFeesParametersQueryCreated'Variants
-> GetApplicationFeesParametersQueryCreated'Variants -> Bool
$c== :: GetApplicationFeesParametersQueryCreated'Variants
-> GetApplicationFeesParametersQueryCreated'Variants -> Bool
GHC.Classes.Eq)

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

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

-- | Represents a response of the operation 'getApplicationFees'.
--
-- 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), 'GetApplicationFeesResponseError' is used.
data GetApplicationFeesResponse
  = -- | Means either no matching case available or a parse error
    GetApplicationFeesResponseError GHC.Base.String
  | -- | Successful response.
    GetApplicationFeesResponse200 GetApplicationFeesResponseBody200
  | -- | Error response.
    GetApplicationFeesResponseDefault Error
  deriving (Int -> GetApplicationFeesResponse -> ShowS
[GetApplicationFeesResponse] -> ShowS
GetApplicationFeesResponse -> String
(Int -> GetApplicationFeesResponse -> ShowS)
-> (GetApplicationFeesResponse -> String)
-> ([GetApplicationFeesResponse] -> ShowS)
-> Show GetApplicationFeesResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetApplicationFeesResponse] -> ShowS
$cshowList :: [GetApplicationFeesResponse] -> ShowS
show :: GetApplicationFeesResponse -> String
$cshow :: GetApplicationFeesResponse -> String
showsPrec :: Int -> GetApplicationFeesResponse -> ShowS
$cshowsPrec :: Int -> GetApplicationFeesResponse -> ShowS
GHC.Show.Show, GetApplicationFeesResponse -> GetApplicationFeesResponse -> Bool
(GetApplicationFeesResponse -> GetApplicationFeesResponse -> Bool)
-> (GetApplicationFeesResponse
    -> GetApplicationFeesResponse -> Bool)
-> Eq GetApplicationFeesResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetApplicationFeesResponse -> GetApplicationFeesResponse -> Bool
$c/= :: GetApplicationFeesResponse -> GetApplicationFeesResponse -> Bool
== :: GetApplicationFeesResponse -> GetApplicationFeesResponse -> Bool
$c== :: GetApplicationFeesResponse -> GetApplicationFeesResponse -> Bool
GHC.Classes.Eq)

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

instance Data.Aeson.Types.ToJSON.ToJSON GetApplicationFeesResponseBody200 where
  toJSON :: GetApplicationFeesResponseBody200 -> Value
toJSON GetApplicationFeesResponseBody200
obj = [Pair] -> Value
Data.Aeson.Types.Internal.object (Text
"data" Text -> [ApplicationFee] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= GetApplicationFeesResponseBody200 -> [ApplicationFee]
getApplicationFeesResponseBody200Data GetApplicationFeesResponseBody200
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..= GetApplicationFeesResponseBody200 -> Bool
getApplicationFeesResponseBody200HasMore GetApplicationFeesResponseBody200
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..= GetApplicationFeesResponseBody200 -> Text
getApplicationFeesResponseBody200Url GetApplicationFeesResponseBody200
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 :: GetApplicationFeesResponseBody200 -> Encoding
toEncoding GetApplicationFeesResponseBody200
obj = Series -> Encoding
Data.Aeson.Encoding.Internal.pairs ((Text
"data" Text -> [ApplicationFee] -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= GetApplicationFeesResponseBody200 -> [ApplicationFee]
getApplicationFeesResponseBody200Data GetApplicationFeesResponseBody200
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..= GetApplicationFeesResponseBody200 -> Bool
getApplicationFeesResponseBody200HasMore GetApplicationFeesResponseBody200
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..= GetApplicationFeesResponseBody200 -> Text
getApplicationFeesResponseBody200Url GetApplicationFeesResponseBody200
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 GetApplicationFeesResponseBody200 where
  parseJSON :: Value -> Parser GetApplicationFeesResponseBody200
parseJSON = String
-> (Object -> Parser GetApplicationFeesResponseBody200)
-> Value
-> Parser GetApplicationFeesResponseBody200
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.Aeson.Types.FromJSON.withObject String
"GetApplicationFeesResponseBody200" (\Object
obj -> ((([ApplicationFee]
 -> Bool -> Text -> GetApplicationFeesResponseBody200)
-> Parser
     ([ApplicationFee]
      -> Bool -> Text -> GetApplicationFeesResponseBody200)
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure [ApplicationFee]
-> Bool -> Text -> GetApplicationFeesResponseBody200
GetApplicationFeesResponseBody200 Parser
  ([ApplicationFee]
   -> Bool -> Text -> GetApplicationFeesResponseBody200)
-> Parser [ApplicationFee]
-> Parser (Bool -> Text -> GetApplicationFeesResponseBody200)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Text -> Parser [ApplicationFee]
forall a. FromJSON a => Object -> Text -> Parser a
Data.Aeson.Types.FromJSON..: Text
"data")) Parser (Bool -> Text -> GetApplicationFeesResponseBody200)
-> Parser Bool
-> Parser (Text -> GetApplicationFeesResponseBody200)
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 -> GetApplicationFeesResponseBody200)
-> Parser Text -> Parser GetApplicationFeesResponseBody200
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 'GetApplicationFeesResponseBody200' with all required fields.
mkGetApplicationFeesResponseBody200 ::
  -- | 'getApplicationFeesResponseBody200Data'
  [ApplicationFee] ->
  -- | 'getApplicationFeesResponseBody200HasMore'
  GHC.Types.Bool ->
  -- | 'getApplicationFeesResponseBody200Url'
  Data.Text.Internal.Text ->
  GetApplicationFeesResponseBody200
mkGetApplicationFeesResponseBody200 :: [ApplicationFee]
-> Bool -> Text -> GetApplicationFeesResponseBody200
mkGetApplicationFeesResponseBody200 [ApplicationFee]
getApplicationFeesResponseBody200Data Bool
getApplicationFeesResponseBody200HasMore Text
getApplicationFeesResponseBody200Url =
  GetApplicationFeesResponseBody200 :: [ApplicationFee]
-> Bool -> Text -> GetApplicationFeesResponseBody200
GetApplicationFeesResponseBody200
    { getApplicationFeesResponseBody200Data :: [ApplicationFee]
getApplicationFeesResponseBody200Data = [ApplicationFee]
getApplicationFeesResponseBody200Data,
      getApplicationFeesResponseBody200HasMore :: Bool
getApplicationFeesResponseBody200HasMore = Bool
getApplicationFeesResponseBody200HasMore,
      getApplicationFeesResponseBody200Url :: Text
getApplicationFeesResponseBody200Url = Text
getApplicationFeesResponseBody200Url
    }