{-# 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 getBalanceTransactions
module StripeAPI.Operations.GetBalanceTransactions 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/balance_transactions
--
-- \<p>Returns a list of transactions that have contributed to the Stripe account balance (e.g., charges, transfers, and so forth). The transactions are returned in sorted order, with the most recent transactions appearing first.\<\/p>
--
-- \<p>Note that this endpoint was previously called “Balance history” and used the path \<code>\/v1\/balance\/history\<\/code>.\<\/p>
getBalanceTransactions ::
  forall m.
  StripeAPI.Common.MonadHTTP m =>
  -- | Contains all available parameters of this operation (query and path parameters)
  GetBalanceTransactionsParameters ->
  -- | Monadic computation which returns the result of the operation
  StripeAPI.Common.ClientT m (Network.HTTP.Client.Types.Response GetBalanceTransactionsResponse)
getBalanceTransactions :: GetBalanceTransactionsParameters
-> ClientT m (Response GetBalanceTransactionsResponse)
getBalanceTransactions GetBalanceTransactionsParameters
parameters =
  (Response ByteString -> Response GetBalanceTransactionsResponse)
-> ClientT m (Response ByteString)
-> ClientT m (Response GetBalanceTransactionsResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
GHC.Base.fmap
    ( \Response ByteString
response_0 ->
        (ByteString -> GetBalanceTransactionsResponse)
-> Response ByteString -> Response GetBalanceTransactionsResponse
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
GHC.Base.fmap
          ( (String -> GetBalanceTransactionsResponse)
-> (GetBalanceTransactionsResponse
    -> GetBalanceTransactionsResponse)
-> Either String GetBalanceTransactionsResponse
-> GetBalanceTransactionsResponse
forall a c b. (a -> c) -> (b -> c) -> Either a b -> c
Data.Either.either String -> GetBalanceTransactionsResponse
GetBalanceTransactionsResponseError GetBalanceTransactionsResponse -> GetBalanceTransactionsResponse
forall a. a -> a
GHC.Base.id
              (Either String GetBalanceTransactionsResponse
 -> GetBalanceTransactionsResponse)
-> (ByteString -> Either String GetBalanceTransactionsResponse)
-> ByteString
-> GetBalanceTransactionsResponse
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) ->
                                   GetBalanceTransactionsResponseBody200
-> GetBalanceTransactionsResponse
GetBalanceTransactionsResponse200
                                     (GetBalanceTransactionsResponseBody200
 -> GetBalanceTransactionsResponse)
-> Either String GetBalanceTransactionsResponseBody200
-> Either String GetBalanceTransactionsResponse
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Data.Functor.<$> ( ByteString -> Either String GetBalanceTransactionsResponseBody200
forall a. FromJSON a => ByteString -> Either String a
Data.Aeson.eitherDecodeStrict ByteString
body ::
                                                          Data.Either.Either
                                                            GHC.Base.String
                                                            GetBalanceTransactionsResponseBody200
                                                      )
                                 | 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 -> GetBalanceTransactionsResponse
GetBalanceTransactionsResponseDefault
                                     (Error -> GetBalanceTransactionsResponse)
-> Either String Error
-> Either String GetBalanceTransactionsResponse
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 GetBalanceTransactionsResponse
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/balance_transactions")
        [ Text -> Maybe Value -> Text -> Bool -> QueryParameter
StripeAPI.Common.QueryParameter (String -> Text
Data.Text.pack String
"available_on") (GetBalanceTransactionsParametersQueryAvailableOn'Variants -> Value
forall a. ToJSON a => a -> Value
Data.Aeson.Types.ToJSON.toJSON (GetBalanceTransactionsParametersQueryAvailableOn'Variants
 -> Value)
-> Maybe GetBalanceTransactionsParametersQueryAvailableOn'Variants
-> Maybe Value
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Data.Functor.<$> GetBalanceTransactionsParameters
-> Maybe GetBalanceTransactionsParametersQueryAvailableOn'Variants
getBalanceTransactionsParametersQueryAvailableOn GetBalanceTransactionsParameters
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") (GetBalanceTransactionsParametersQueryCreated'Variants -> Value
forall a. ToJSON a => a -> Value
Data.Aeson.Types.ToJSON.toJSON (GetBalanceTransactionsParametersQueryCreated'Variants -> Value)
-> Maybe GetBalanceTransactionsParametersQueryCreated'Variants
-> Maybe Value
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Data.Functor.<$> GetBalanceTransactionsParameters
-> Maybe GetBalanceTransactionsParametersQueryCreated'Variants
getBalanceTransactionsParametersQueryCreated GetBalanceTransactionsParameters
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
"currency") (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.<$> GetBalanceTransactionsParameters -> Maybe Text
getBalanceTransactionsParametersQueryCurrency GetBalanceTransactionsParameters
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
"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.<$> GetBalanceTransactionsParameters -> Maybe Text
getBalanceTransactionsParametersQueryEndingBefore GetBalanceTransactionsParameters
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.<$> GetBalanceTransactionsParameters -> Maybe [Text]
getBalanceTransactionsParametersQueryExpand GetBalanceTransactionsParameters
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.<$> GetBalanceTransactionsParameters -> Maybe Int
getBalanceTransactionsParametersQueryLimit GetBalanceTransactionsParameters
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
"payout") (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.<$> GetBalanceTransactionsParameters -> Maybe Text
getBalanceTransactionsParametersQueryPayout GetBalanceTransactionsParameters
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
"source") (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.<$> GetBalanceTransactionsParameters -> Maybe Text
getBalanceTransactionsParametersQuerySource GetBalanceTransactionsParameters
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.<$> GetBalanceTransactionsParameters -> Maybe Text
getBalanceTransactionsParametersQueryStartingAfter GetBalanceTransactionsParameters
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
"type") (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.<$> GetBalanceTransactionsParameters -> Maybe Text
getBalanceTransactionsParametersQueryType GetBalanceTransactionsParameters
parameters) (String -> Text
Data.Text.pack String
"form") Bool
GHC.Types.True
        ]
    )

-- | Defines the object schema located at @paths.\/v1\/balance_transactions.GET.parameters@ in the specification.
data GetBalanceTransactionsParameters = GetBalanceTransactionsParameters
  { -- | queryAvailable_on: Represents the parameter named \'available_on\'
    GetBalanceTransactionsParameters
-> Maybe GetBalanceTransactionsParametersQueryAvailableOn'Variants
getBalanceTransactionsParametersQueryAvailableOn :: (GHC.Maybe.Maybe GetBalanceTransactionsParametersQueryAvailableOn'Variants),
    -- | queryCreated: Represents the parameter named \'created\'
    GetBalanceTransactionsParameters
-> Maybe GetBalanceTransactionsParametersQueryCreated'Variants
getBalanceTransactionsParametersQueryCreated :: (GHC.Maybe.Maybe GetBalanceTransactionsParametersQueryCreated'Variants),
    -- | queryCurrency: Represents the parameter named \'currency\'
    --
    -- Only return transactions in a certain currency. Three-letter [ISO currency code](https:\/\/www.iso.org\/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https:\/\/stripe.com\/docs\/currencies).
    GetBalanceTransactionsParameters -> Maybe Text
getBalanceTransactionsParametersQueryCurrency :: (GHC.Maybe.Maybe Data.Text.Internal.Text),
    -- | 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
    GetBalanceTransactionsParameters -> Maybe Text
getBalanceTransactionsParametersQueryEndingBefore :: (GHC.Maybe.Maybe Data.Text.Internal.Text),
    -- | queryExpand: Represents the parameter named \'expand\'
    --
    -- Specifies which fields in the response should be expanded.
    GetBalanceTransactionsParameters -> Maybe [Text]
getBalanceTransactionsParametersQueryExpand :: (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.
    GetBalanceTransactionsParameters -> Maybe Int
getBalanceTransactionsParametersQueryLimit :: (GHC.Maybe.Maybe GHC.Types.Int),
    -- | queryPayout: Represents the parameter named \'payout\'
    --
    -- For automatic Stripe payouts only, only returns transactions that were paid out on the specified payout ID.
    --
    -- Constraints:
    --
    -- * Maximum length of 5000
    GetBalanceTransactionsParameters -> Maybe Text
getBalanceTransactionsParametersQueryPayout :: (GHC.Maybe.Maybe Data.Text.Internal.Text),
    -- | querySource: Represents the parameter named \'source\'
    --
    -- Only returns the original transaction.
    --
    -- Constraints:
    --
    -- * Maximum length of 5000
    GetBalanceTransactionsParameters -> Maybe Text
getBalanceTransactionsParametersQuerySource :: (GHC.Maybe.Maybe Data.Text.Internal.Text),
    -- | 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
    GetBalanceTransactionsParameters -> Maybe Text
getBalanceTransactionsParametersQueryStartingAfter :: (GHC.Maybe.Maybe Data.Text.Internal.Text),
    -- | queryType: Represents the parameter named \'type\'
    --
    -- Only returns transactions of the given type. One of: \`adjustment\`, \`advance\`, \`advance_funding\`, \`anticipation_repayment\`, \`application_fee\`, \`application_fee_refund\`, \`charge\`, \`connect_collection_transfer\`, \`contribution\`, \`issuing_authorization_hold\`, \`issuing_authorization_release\`, \`issuing_dispute\`, \`issuing_transaction\`, \`payment\`, \`payment_failure_refund\`, \`payment_refund\`, \`payout\`, \`payout_cancel\`, \`payout_failure\`, \`refund\`, \`refund_failure\`, \`reserve_transaction\`, \`reserved_funds\`, \`stripe_fee\`, \`stripe_fx_fee\`, \`tax_fee\`, \`topup\`, \`topup_reversal\`, \`transfer\`, \`transfer_cancel\`, \`transfer_failure\`, or \`transfer_refund\`.
    --
    -- Constraints:
    --
    -- * Maximum length of 5000
    GetBalanceTransactionsParameters -> Maybe Text
getBalanceTransactionsParametersQueryType :: (GHC.Maybe.Maybe Data.Text.Internal.Text)
  }
  deriving
    ( Int -> GetBalanceTransactionsParameters -> ShowS
[GetBalanceTransactionsParameters] -> ShowS
GetBalanceTransactionsParameters -> String
(Int -> GetBalanceTransactionsParameters -> ShowS)
-> (GetBalanceTransactionsParameters -> String)
-> ([GetBalanceTransactionsParameters] -> ShowS)
-> Show GetBalanceTransactionsParameters
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetBalanceTransactionsParameters] -> ShowS
$cshowList :: [GetBalanceTransactionsParameters] -> ShowS
show :: GetBalanceTransactionsParameters -> String
$cshow :: GetBalanceTransactionsParameters -> String
showsPrec :: Int -> GetBalanceTransactionsParameters -> ShowS
$cshowsPrec :: Int -> GetBalanceTransactionsParameters -> ShowS
GHC.Show.Show,
      GetBalanceTransactionsParameters
-> GetBalanceTransactionsParameters -> Bool
(GetBalanceTransactionsParameters
 -> GetBalanceTransactionsParameters -> Bool)
-> (GetBalanceTransactionsParameters
    -> GetBalanceTransactionsParameters -> Bool)
-> Eq GetBalanceTransactionsParameters
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetBalanceTransactionsParameters
-> GetBalanceTransactionsParameters -> Bool
$c/= :: GetBalanceTransactionsParameters
-> GetBalanceTransactionsParameters -> Bool
== :: GetBalanceTransactionsParameters
-> GetBalanceTransactionsParameters -> Bool
$c== :: GetBalanceTransactionsParameters
-> GetBalanceTransactionsParameters -> Bool
GHC.Classes.Eq
    )

instance Data.Aeson.Types.ToJSON.ToJSON GetBalanceTransactionsParameters where
  toJSON :: GetBalanceTransactionsParameters -> Value
toJSON GetBalanceTransactionsParameters
obj = [Pair] -> Value
Data.Aeson.Types.Internal.object (Text
"queryAvailable_on" Text
-> Maybe GetBalanceTransactionsParametersQueryAvailableOn'Variants
-> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= GetBalanceTransactionsParameters
-> Maybe GetBalanceTransactionsParametersQueryAvailableOn'Variants
getBalanceTransactionsParametersQueryAvailableOn GetBalanceTransactionsParameters
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"queryCreated" Text
-> Maybe GetBalanceTransactionsParametersQueryCreated'Variants
-> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= GetBalanceTransactionsParameters
-> Maybe GetBalanceTransactionsParametersQueryCreated'Variants
getBalanceTransactionsParametersQueryCreated GetBalanceTransactionsParameters
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"queryCurrency" Text -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= GetBalanceTransactionsParameters -> Maybe Text
getBalanceTransactionsParametersQueryCurrency GetBalanceTransactionsParameters
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..= GetBalanceTransactionsParameters -> Maybe Text
getBalanceTransactionsParametersQueryEndingBefore GetBalanceTransactionsParameters
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..= GetBalanceTransactionsParameters -> Maybe [Text]
getBalanceTransactionsParametersQueryExpand GetBalanceTransactionsParameters
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..= GetBalanceTransactionsParameters -> Maybe Int
getBalanceTransactionsParametersQueryLimit GetBalanceTransactionsParameters
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"queryPayout" Text -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= GetBalanceTransactionsParameters -> Maybe Text
getBalanceTransactionsParametersQueryPayout GetBalanceTransactionsParameters
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"querySource" Text -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= GetBalanceTransactionsParameters -> Maybe Text
getBalanceTransactionsParametersQuerySource GetBalanceTransactionsParameters
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..= GetBalanceTransactionsParameters -> Maybe Text
getBalanceTransactionsParametersQueryStartingAfter GetBalanceTransactionsParameters
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"queryType" Text -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= GetBalanceTransactionsParameters -> Maybe Text
getBalanceTransactionsParametersQueryType GetBalanceTransactionsParameters
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: [Pair]
forall a. Monoid a => a
GHC.Base.mempty)
  toEncoding :: GetBalanceTransactionsParameters -> Encoding
toEncoding GetBalanceTransactionsParameters
obj = Series -> Encoding
Data.Aeson.Encoding.Internal.pairs ((Text
"queryAvailable_on" Text
-> Maybe GetBalanceTransactionsParametersQueryAvailableOn'Variants
-> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= GetBalanceTransactionsParameters
-> Maybe GetBalanceTransactionsParametersQueryAvailableOn'Variants
getBalanceTransactionsParametersQueryAvailableOn GetBalanceTransactionsParameters
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"queryCreated" Text
-> Maybe GetBalanceTransactionsParametersQueryCreated'Variants
-> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= GetBalanceTransactionsParameters
-> Maybe GetBalanceTransactionsParametersQueryCreated'Variants
getBalanceTransactionsParametersQueryCreated GetBalanceTransactionsParameters
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"queryCurrency" Text -> Maybe Text -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= GetBalanceTransactionsParameters -> Maybe Text
getBalanceTransactionsParametersQueryCurrency GetBalanceTransactionsParameters
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..= GetBalanceTransactionsParameters -> Maybe Text
getBalanceTransactionsParametersQueryEndingBefore GetBalanceTransactionsParameters
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..= GetBalanceTransactionsParameters -> Maybe [Text]
getBalanceTransactionsParametersQueryExpand GetBalanceTransactionsParameters
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..= GetBalanceTransactionsParameters -> Maybe Int
getBalanceTransactionsParametersQueryLimit GetBalanceTransactionsParameters
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"queryPayout" Text -> Maybe Text -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= GetBalanceTransactionsParameters -> Maybe Text
getBalanceTransactionsParametersQueryPayout GetBalanceTransactionsParameters
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"querySource" Text -> Maybe Text -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= GetBalanceTransactionsParameters -> Maybe Text
getBalanceTransactionsParametersQuerySource GetBalanceTransactionsParameters
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..= GetBalanceTransactionsParameters -> Maybe Text
getBalanceTransactionsParametersQueryStartingAfter GetBalanceTransactionsParameters
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> (Text
"queryType" Text -> Maybe Text -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= GetBalanceTransactionsParameters -> Maybe Text
getBalanceTransactionsParametersQueryType GetBalanceTransactionsParameters
obj))))))))))

instance Data.Aeson.Types.FromJSON.FromJSON GetBalanceTransactionsParameters where
  parseJSON :: Value -> Parser GetBalanceTransactionsParameters
parseJSON = String
-> (Object -> Parser GetBalanceTransactionsParameters)
-> Value
-> Parser GetBalanceTransactionsParameters
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.Aeson.Types.FromJSON.withObject String
"GetBalanceTransactionsParameters" (\Object
obj -> ((((((((((Maybe GetBalanceTransactionsParametersQueryAvailableOn'Variants
 -> Maybe GetBalanceTransactionsParametersQueryCreated'Variants
 -> Maybe Text
 -> Maybe Text
 -> Maybe [Text]
 -> Maybe Int
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> GetBalanceTransactionsParameters)
-> Parser
     (Maybe GetBalanceTransactionsParametersQueryAvailableOn'Variants
      -> Maybe GetBalanceTransactionsParametersQueryCreated'Variants
      -> Maybe Text
      -> Maybe Text
      -> Maybe [Text]
      -> Maybe Int
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> GetBalanceTransactionsParameters)
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure Maybe GetBalanceTransactionsParametersQueryAvailableOn'Variants
-> Maybe GetBalanceTransactionsParametersQueryCreated'Variants
-> Maybe Text
-> Maybe Text
-> Maybe [Text]
-> Maybe Int
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> GetBalanceTransactionsParameters
GetBalanceTransactionsParameters Parser
  (Maybe GetBalanceTransactionsParametersQueryAvailableOn'Variants
   -> Maybe GetBalanceTransactionsParametersQueryCreated'Variants
   -> Maybe Text
   -> Maybe Text
   -> Maybe [Text]
   -> Maybe Int
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> GetBalanceTransactionsParameters)
-> Parser
     (Maybe GetBalanceTransactionsParametersQueryAvailableOn'Variants)
-> Parser
     (Maybe GetBalanceTransactionsParametersQueryCreated'Variants
      -> Maybe Text
      -> Maybe Text
      -> Maybe [Text]
      -> Maybe Int
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> GetBalanceTransactionsParameters)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object
-> Text
-> Parser
     (Maybe GetBalanceTransactionsParametersQueryAvailableOn'Variants)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Text
"queryAvailable_on")) Parser
  (Maybe GetBalanceTransactionsParametersQueryCreated'Variants
   -> Maybe Text
   -> Maybe Text
   -> Maybe [Text]
   -> Maybe Int
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> GetBalanceTransactionsParameters)
-> Parser
     (Maybe GetBalanceTransactionsParametersQueryCreated'Variants)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe [Text]
      -> Maybe Int
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> GetBalanceTransactionsParameters)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object
-> Text
-> Parser
     (Maybe GetBalanceTransactionsParametersQueryCreated'Variants)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Text
"queryCreated")) Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe [Text]
   -> Maybe Int
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> GetBalanceTransactionsParameters)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe [Text]
      -> Maybe Int
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> GetBalanceTransactionsParameters)
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
"queryCurrency")) Parser
  (Maybe Text
   -> Maybe [Text]
   -> Maybe Int
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> GetBalanceTransactionsParameters)
-> Parser (Maybe Text)
-> Parser
     (Maybe [Text]
      -> Maybe Int
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> GetBalanceTransactionsParameters)
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 Text
   -> Maybe Text
   -> Maybe Text
   -> GetBalanceTransactionsParameters)
-> Parser (Maybe [Text])
-> Parser
     (Maybe Int
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> GetBalanceTransactionsParameters)
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 Text
   -> Maybe Text
   -> Maybe Text
   -> GetBalanceTransactionsParameters)
-> Parser (Maybe Int)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> GetBalanceTransactionsParameters)
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 Text
   -> Maybe Text
   -> Maybe Text
   -> GetBalanceTransactionsParameters)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text -> Maybe Text -> GetBalanceTransactionsParameters)
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
"queryPayout")) Parser
  (Maybe Text
   -> Maybe Text -> Maybe Text -> GetBalanceTransactionsParameters)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text -> Maybe Text -> GetBalanceTransactionsParameters)
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
"querySource")) Parser
  (Maybe Text -> Maybe Text -> GetBalanceTransactionsParameters)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> GetBalanceTransactionsParameters)
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 Text -> GetBalanceTransactionsParameters)
-> Parser (Maybe Text) -> Parser GetBalanceTransactionsParameters
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
"queryType"))

-- | Create a new 'GetBalanceTransactionsParameters' with all required fields.
mkGetBalanceTransactionsParameters :: GetBalanceTransactionsParameters
mkGetBalanceTransactionsParameters :: GetBalanceTransactionsParameters
mkGetBalanceTransactionsParameters =
  GetBalanceTransactionsParameters :: Maybe GetBalanceTransactionsParametersQueryAvailableOn'Variants
-> Maybe GetBalanceTransactionsParametersQueryCreated'Variants
-> Maybe Text
-> Maybe Text
-> Maybe [Text]
-> Maybe Int
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> GetBalanceTransactionsParameters
GetBalanceTransactionsParameters
    { getBalanceTransactionsParametersQueryAvailableOn :: Maybe GetBalanceTransactionsParametersQueryAvailableOn'Variants
getBalanceTransactionsParametersQueryAvailableOn = Maybe GetBalanceTransactionsParametersQueryAvailableOn'Variants
forall a. Maybe a
GHC.Maybe.Nothing,
      getBalanceTransactionsParametersQueryCreated :: Maybe GetBalanceTransactionsParametersQueryCreated'Variants
getBalanceTransactionsParametersQueryCreated = Maybe GetBalanceTransactionsParametersQueryCreated'Variants
forall a. Maybe a
GHC.Maybe.Nothing,
      getBalanceTransactionsParametersQueryCurrency :: Maybe Text
getBalanceTransactionsParametersQueryCurrency = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing,
      getBalanceTransactionsParametersQueryEndingBefore :: Maybe Text
getBalanceTransactionsParametersQueryEndingBefore = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing,
      getBalanceTransactionsParametersQueryExpand :: Maybe [Text]
getBalanceTransactionsParametersQueryExpand = Maybe [Text]
forall a. Maybe a
GHC.Maybe.Nothing,
      getBalanceTransactionsParametersQueryLimit :: Maybe Int
getBalanceTransactionsParametersQueryLimit = Maybe Int
forall a. Maybe a
GHC.Maybe.Nothing,
      getBalanceTransactionsParametersQueryPayout :: Maybe Text
getBalanceTransactionsParametersQueryPayout = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing,
      getBalanceTransactionsParametersQuerySource :: Maybe Text
getBalanceTransactionsParametersQuerySource = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing,
      getBalanceTransactionsParametersQueryStartingAfter :: Maybe Text
getBalanceTransactionsParametersQueryStartingAfter = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing,
      getBalanceTransactionsParametersQueryType :: Maybe Text
getBalanceTransactionsParametersQueryType = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing
    }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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