{-# 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 list_transactions
module RecurlyClient.Operations.List_transactions 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
import qualified Data.ByteString as Data.ByteString.Internal
import qualified Data.ByteString as Data.ByteString.Internal.Type
import qualified Data.Either
import qualified Data.Foldable
import qualified Data.Functor
import qualified Data.Maybe
import qualified Data.Scientific
import qualified Data.Text
import qualified Data.Text as 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 RecurlyClient.Common
import RecurlyClient.Types
import qualified Prelude as GHC.Integer.Type
import qualified Prelude as GHC.Maybe

{- | > GET /transactions

See the [Pagination Guide](\/developers\/guides\/pagination.html) to learn how to use pagination in the API and Client Libraries.
-}
list_transactions ::
    forall m.
    (RecurlyClient.Common.MonadHTTP m) =>
    -- | Contains all available parameters of this operation (query and path parameters)
    List_transactionsParameters ->
    -- | Monadic computation which returns the result of the operation
    RecurlyClient.Common.ClientT m (Network.HTTP.Client.Types.Response List_transactionsResponse)
list_transactions :: forall (m :: * -> *).
MonadHTTP m =>
List_transactionsParameters
-> ClientT m (Response List_transactionsResponse)
list_transactions List_transactionsParameters
parameters =
    (Response ByteString -> Response List_transactionsResponse)
-> ClientT m (Response ByteString)
-> ClientT m (Response List_transactionsResponse)
forall a b. (a -> b) -> ClientT m a -> ClientT m b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
GHC.Base.fmap
        ( \Response ByteString
response_0 ->
            (ByteString -> List_transactionsResponse)
-> Response ByteString -> Response List_transactionsResponse
forall a b. (a -> b) -> Response a -> Response b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
GHC.Base.fmap
                ( (String -> List_transactionsResponse)
-> (List_transactionsResponse -> List_transactionsResponse)
-> Either String List_transactionsResponse
-> List_transactionsResponse
forall a c b. (a -> c) -> (b -> c) -> Either a b -> c
Data.Either.either String -> List_transactionsResponse
List_transactionsResponseError List_transactionsResponse -> List_transactionsResponse
forall a. a -> a
GHC.Base.id
                    (Either String List_transactionsResponse
 -> List_transactionsResponse)
-> (ByteString -> Either String List_transactionsResponse)
-> ByteString
-> List_transactionsResponse
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) ->
                                            TransactionList -> List_transactionsResponse
List_transactionsResponse200
                                                (TransactionList -> List_transactionsResponse)
-> Either String TransactionList
-> Either String List_transactionsResponse
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Data.Functor.<$> ( ByteString -> Either String TransactionList
forall a. FromJSON a => ByteString -> Either String a
Data.Aeson.eitherDecodeStrict ByteString
body ::
                                                                    Data.Either.Either
                                                                        GHC.Base.String
                                                                        TransactionList
                                                                 )
                                        | (\Status
status_2 -> Status -> Int
Network.HTTP.Types.Status.statusCode Status
status_2 Int -> Int -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Int
400) (Response ByteString -> Status
forall body. Response body -> Status
Network.HTTP.Client.Types.responseStatus Response ByteString
response) ->
                                            Error -> List_transactionsResponse
List_transactionsResponse400
                                                (Error -> List_transactionsResponse)
-> Either String Error -> Either String List_transactionsResponse
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
                                                                 )
                                        | (\Status
status_3 -> Status -> Int
Network.HTTP.Types.Status.statusCode Status
status_3 Int -> Int -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Int
404) (Response ByteString -> Status
forall body. Response body -> Status
Network.HTTP.Client.Types.responseStatus Response ByteString
response) ->
                                            Error -> List_transactionsResponse
List_transactionsResponse404
                                                (Error -> List_transactionsResponse)
-> Either String Error -> Either String List_transactionsResponse
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 -> 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 -> List_transactionsResponse
List_transactionsResponseDefault
                                                (Error -> List_transactionsResponse)
-> Either String Error -> Either String List_transactionsResponse
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 List_transactionsResponse
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)
RecurlyClient.Common.doCallWithConfigurationM
            (Text -> Text
Data.Text.toUpper (Text -> Text) -> Text -> Text
forall a b. (a -> b) -> a -> b
GHC.Base.$ String -> Text
Data.Text.Internal.pack String
"GET")
            Text
"/transactions"
            [ Text -> Maybe Value -> Text -> Bool -> QueryParameter
RecurlyClient.Common.QueryParameter (String -> Text
Data.Text.Internal.pack String
"ids") ([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.<$> List_transactionsParameters -> Maybe [Text]
list_transactionsParametersQueryIds List_transactionsParameters
parameters) (String -> Text
Data.Text.Internal.pack String
"form") Bool
GHC.Types.False
            , Text -> Maybe Value -> Text -> Bool -> QueryParameter
RecurlyClient.Common.QueryParameter (String -> Text
Data.Text.Internal.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.<$> List_transactionsParameters -> Maybe Int
list_transactionsParametersQueryLimit List_transactionsParameters
parameters) (String -> Text
Data.Text.Internal.pack String
"form") Bool
GHC.Types.False
            , Text -> Maybe Value -> Text -> Bool -> QueryParameter
RecurlyClient.Common.QueryParameter (String -> Text
Data.Text.Internal.pack String
"order") (List_transactionsParametersQueryOrder -> Value
forall a. ToJSON a => a -> Value
Data.Aeson.Types.ToJSON.toJSON (List_transactionsParametersQueryOrder -> Value)
-> Maybe List_transactionsParametersQueryOrder -> Maybe Value
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Data.Functor.<$> List_transactionsParameters
-> Maybe List_transactionsParametersQueryOrder
list_transactionsParametersQueryOrder List_transactionsParameters
parameters) (String -> Text
Data.Text.Internal.pack String
"form") Bool
GHC.Types.False
            , Text -> Maybe Value -> Text -> Bool -> QueryParameter
RecurlyClient.Common.QueryParameter (String -> Text
Data.Text.Internal.pack String
"sort") (List_transactionsParametersQuerySort -> Value
forall a. ToJSON a => a -> Value
Data.Aeson.Types.ToJSON.toJSON (List_transactionsParametersQuerySort -> Value)
-> Maybe List_transactionsParametersQuerySort -> Maybe Value
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Data.Functor.<$> List_transactionsParameters
-> Maybe List_transactionsParametersQuerySort
list_transactionsParametersQuerySort List_transactionsParameters
parameters) (String -> Text
Data.Text.Internal.pack String
"form") Bool
GHC.Types.False
            , Text -> Maybe Value -> Text -> Bool -> QueryParameter
RecurlyClient.Common.QueryParameter (String -> Text
Data.Text.Internal.pack String
"begin_time") (JsonDateTime -> Value
forall a. ToJSON a => a -> Value
Data.Aeson.Types.ToJSON.toJSON (JsonDateTime -> Value) -> Maybe JsonDateTime -> Maybe Value
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Data.Functor.<$> List_transactionsParameters -> Maybe JsonDateTime
list_transactionsParametersQueryBegin_time List_transactionsParameters
parameters) (String -> Text
Data.Text.Internal.pack String
"form") Bool
GHC.Types.False
            , Text -> Maybe Value -> Text -> Bool -> QueryParameter
RecurlyClient.Common.QueryParameter (String -> Text
Data.Text.Internal.pack String
"end_time") (JsonDateTime -> Value
forall a. ToJSON a => a -> Value
Data.Aeson.Types.ToJSON.toJSON (JsonDateTime -> Value) -> Maybe JsonDateTime -> Maybe Value
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Data.Functor.<$> List_transactionsParameters -> Maybe JsonDateTime
list_transactionsParametersQueryEnd_time List_transactionsParameters
parameters) (String -> Text
Data.Text.Internal.pack String
"form") Bool
GHC.Types.False
            , Text -> Maybe Value -> Text -> Bool -> QueryParameter
RecurlyClient.Common.QueryParameter (String -> Text
Data.Text.Internal.pack String
"type") (List_transactionsParametersQueryType -> Value
forall a. ToJSON a => a -> Value
Data.Aeson.Types.ToJSON.toJSON (List_transactionsParametersQueryType -> Value)
-> Maybe List_transactionsParametersQueryType -> Maybe Value
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Data.Functor.<$> List_transactionsParameters
-> Maybe List_transactionsParametersQueryType
list_transactionsParametersQueryType List_transactionsParameters
parameters) (String -> Text
Data.Text.Internal.pack String
"form") Bool
GHC.Types.False
            , Text -> Maybe Value -> Text -> Bool -> QueryParameter
RecurlyClient.Common.QueryParameter (String -> Text
Data.Text.Internal.pack String
"success") (List_transactionsParametersQuerySuccess -> Value
forall a. ToJSON a => a -> Value
Data.Aeson.Types.ToJSON.toJSON (List_transactionsParametersQuerySuccess -> Value)
-> Maybe List_transactionsParametersQuerySuccess -> Maybe Value
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Data.Functor.<$> List_transactionsParameters
-> Maybe List_transactionsParametersQuerySuccess
list_transactionsParametersQuerySuccess List_transactionsParameters
parameters) (String -> Text
Data.Text.Internal.pack String
"form") Bool
GHC.Types.False
            ]
        )

-- | Defines the object schema located at @paths.\/transactions.GET.parameters@ in the specification.
data List_transactionsParameters = List_transactionsParameters
    { List_transactionsParameters -> Maybe JsonDateTime
list_transactionsParametersQueryBegin_time :: (GHC.Maybe.Maybe RecurlyClient.Common.JsonDateTime)
    -- ^ queryBegin_time: Represents the parameter named \'begin_time\'
    --
    -- Inclusively filter by begin_time when \`sort=created_at\` or \`sort=updated_at\`.
    -- **Note:** this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
    , List_transactionsParameters -> Maybe JsonDateTime
list_transactionsParametersQueryEnd_time :: (GHC.Maybe.Maybe RecurlyClient.Common.JsonDateTime)
    -- ^ queryEnd_time: Represents the parameter named \'end_time\'
    --
    -- Inclusively filter by end_time when \`sort=created_at\` or \`sort=updated_at\`.
    -- **Note:** this value is an ISO8601 timestamp. A partial timestamp that does not include a time zone will default to UTC.
    , List_transactionsParameters -> Maybe [Text]
list_transactionsParametersQueryIds :: (GHC.Maybe.Maybe [Data.Text.Internal.Text])
    -- ^ queryIds: Represents the parameter named \'ids\'
    --
    -- Filter results by their IDs. Up to 200 IDs can be passed at once using
    -- commas as separators, e.g. \`ids=h1at4d57xlmy,gyqgg0d3v9n1,jrsm5b4yefg6\`.
    --
    -- **Important notes:**
    --
    -- * The \`ids\` parameter cannot be used with any other ordering or filtering
    --   parameters (\`limit\`, \`order\`, \`sort\`, \`begin_time\`, \`end_time\`, etc)
    -- * Invalid or unknown IDs will be ignored, so you should check that the
    --   results correspond to your request.
    -- * Records are returned in an arbitrary order. Since results are all
    --   returned at once you can sort the records yourself.
    , List_transactionsParameters -> Maybe Int
list_transactionsParametersQueryLimit :: (GHC.Maybe.Maybe GHC.Types.Int)
    -- ^ queryLimit: Represents the parameter named \'limit\'
    --
    -- Limit number of records 1-200.
    --
    -- Constraints:
    --
    -- * Maxium  of 200.0
    -- * Minimum  of 1.0
    , List_transactionsParameters
-> Maybe List_transactionsParametersQueryOrder
list_transactionsParametersQueryOrder :: (GHC.Maybe.Maybe List_transactionsParametersQueryOrder)
    -- ^ queryOrder: Represents the parameter named \'order\'
    --
    -- Sort order.
    , List_transactionsParameters
-> Maybe List_transactionsParametersQuerySort
list_transactionsParametersQuerySort :: (GHC.Maybe.Maybe List_transactionsParametersQuerySort)
    -- ^ querySort: Represents the parameter named \'sort\'
    --
    -- Sort field. You *really* only want to sort by \`updated_at\` in ascending
    -- order. In descending order updated records will move behind the cursor and could
    -- prevent some records from being returned.
    , List_transactionsParameters
-> Maybe List_transactionsParametersQuerySuccess
list_transactionsParametersQuerySuccess :: (GHC.Maybe.Maybe List_transactionsParametersQuerySuccess)
    -- ^ querySuccess: Represents the parameter named \'success\'
    --
    -- Filter by success field.
    , List_transactionsParameters
-> Maybe List_transactionsParametersQueryType
list_transactionsParametersQueryType :: (GHC.Maybe.Maybe List_transactionsParametersQueryType)
    -- ^ queryType: Represents the parameter named \'type\'
    --
    -- Filter by type field. The value \`payment\` will return both \`purchase\` and \`capture\` transactions.
    }
    deriving
        ( Int -> List_transactionsParameters -> ShowS
[List_transactionsParameters] -> ShowS
List_transactionsParameters -> String
(Int -> List_transactionsParameters -> ShowS)
-> (List_transactionsParameters -> String)
-> ([List_transactionsParameters] -> ShowS)
-> Show List_transactionsParameters
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> List_transactionsParameters -> ShowS
showsPrec :: Int -> List_transactionsParameters -> ShowS
$cshow :: List_transactionsParameters -> String
show :: List_transactionsParameters -> String
$cshowList :: [List_transactionsParameters] -> ShowS
showList :: [List_transactionsParameters] -> ShowS
GHC.Show.Show
        , List_transactionsParameters -> List_transactionsParameters -> Bool
(List_transactionsParameters
 -> List_transactionsParameters -> Bool)
-> (List_transactionsParameters
    -> List_transactionsParameters -> Bool)
-> Eq List_transactionsParameters
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: List_transactionsParameters -> List_transactionsParameters -> Bool
== :: List_transactionsParameters -> List_transactionsParameters -> Bool
$c/= :: List_transactionsParameters -> List_transactionsParameters -> Bool
/= :: List_transactionsParameters -> List_transactionsParameters -> Bool
GHC.Classes.Eq
        )

instance Data.Aeson.Types.ToJSON.ToJSON List_transactionsParameters where
    toJSON :: List_transactionsParameters -> Value
toJSON List_transactionsParameters
obj = [Pair] -> Value
Data.Aeson.Types.Internal.object ([[Pair]] -> [Pair]
forall (t :: * -> *) a. Foldable t => t [a] -> [a]
Data.Foldable.concat ([Pair] -> (JsonDateTime -> [Pair]) -> Maybe JsonDateTime -> [Pair]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Pair]
forall a. Monoid a => a
GHC.Base.mempty (Pair -> [Pair]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Pair -> [Pair])
-> (JsonDateTime -> Pair) -> JsonDateTime -> [Pair]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"queryBegin_time" Key -> JsonDateTime -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..=)) (List_transactionsParameters -> Maybe JsonDateTime
list_transactionsParametersQueryBegin_time List_transactionsParameters
obj) [Pair] -> [[Pair]] -> [[Pair]]
forall a. a -> [a] -> [a]
: [Pair] -> (JsonDateTime -> [Pair]) -> Maybe JsonDateTime -> [Pair]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Pair]
forall a. Monoid a => a
GHC.Base.mempty (Pair -> [Pair]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Pair -> [Pair])
-> (JsonDateTime -> Pair) -> JsonDateTime -> [Pair]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"queryEnd_time" Key -> JsonDateTime -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..=)) (List_transactionsParameters -> Maybe JsonDateTime
list_transactionsParametersQueryEnd_time List_transactionsParameters
obj) [Pair] -> [[Pair]] -> [[Pair]]
forall a. a -> [a] -> [a]
: [Pair] -> ([Text] -> [Pair]) -> Maybe [Text] -> [Pair]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Pair]
forall a. Monoid a => a
GHC.Base.mempty (Pair -> [Pair]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Pair -> [Pair]) -> ([Text] -> Pair) -> [Text] -> [Pair]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"queryIds" Key -> [Text] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..=)) (List_transactionsParameters -> Maybe [Text]
list_transactionsParametersQueryIds List_transactionsParameters
obj) [Pair] -> [[Pair]] -> [[Pair]]
forall a. a -> [a] -> [a]
: [Pair] -> (Int -> [Pair]) -> Maybe Int -> [Pair]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Pair]
forall a. Monoid a => a
GHC.Base.mempty (Pair -> [Pair]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Pair -> [Pair]) -> (Int -> Pair) -> Int -> [Pair]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"queryLimit" Key -> Int -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..=)) (List_transactionsParameters -> Maybe Int
list_transactionsParametersQueryLimit List_transactionsParameters
obj) [Pair] -> [[Pair]] -> [[Pair]]
forall a. a -> [a] -> [a]
: [Pair]
-> (List_transactionsParametersQueryOrder -> [Pair])
-> Maybe List_transactionsParametersQueryOrder
-> [Pair]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Pair]
forall a. Monoid a => a
GHC.Base.mempty (Pair -> [Pair]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Pair -> [Pair])
-> (List_transactionsParametersQueryOrder -> Pair)
-> List_transactionsParametersQueryOrder
-> [Pair]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"queryOrder" Key -> List_transactionsParametersQueryOrder -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..=)) (List_transactionsParameters
-> Maybe List_transactionsParametersQueryOrder
list_transactionsParametersQueryOrder List_transactionsParameters
obj) [Pair] -> [[Pair]] -> [[Pair]]
forall a. a -> [a] -> [a]
: [Pair]
-> (List_transactionsParametersQuerySort -> [Pair])
-> Maybe List_transactionsParametersQuerySort
-> [Pair]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Pair]
forall a. Monoid a => a
GHC.Base.mempty (Pair -> [Pair]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Pair -> [Pair])
-> (List_transactionsParametersQuerySort -> Pair)
-> List_transactionsParametersQuerySort
-> [Pair]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"querySort" Key -> List_transactionsParametersQuerySort -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..=)) (List_transactionsParameters
-> Maybe List_transactionsParametersQuerySort
list_transactionsParametersQuerySort List_transactionsParameters
obj) [Pair] -> [[Pair]] -> [[Pair]]
forall a. a -> [a] -> [a]
: [Pair]
-> (List_transactionsParametersQuerySuccess -> [Pair])
-> Maybe List_transactionsParametersQuerySuccess
-> [Pair]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Pair]
forall a. Monoid a => a
GHC.Base.mempty (Pair -> [Pair]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Pair -> [Pair])
-> (List_transactionsParametersQuerySuccess -> Pair)
-> List_transactionsParametersQuerySuccess
-> [Pair]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"querySuccess" Key -> List_transactionsParametersQuerySuccess -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..=)) (List_transactionsParameters
-> Maybe List_transactionsParametersQuerySuccess
list_transactionsParametersQuerySuccess List_transactionsParameters
obj) [Pair] -> [[Pair]] -> [[Pair]]
forall a. a -> [a] -> [a]
: [Pair]
-> (List_transactionsParametersQueryType -> [Pair])
-> Maybe List_transactionsParametersQueryType
-> [Pair]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Pair]
forall a. Monoid a => a
GHC.Base.mempty (Pair -> [Pair]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Pair -> [Pair])
-> (List_transactionsParametersQueryType -> Pair)
-> List_transactionsParametersQueryType
-> [Pair]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"queryType" Key -> List_transactionsParametersQueryType -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..=)) (List_transactionsParameters
-> Maybe List_transactionsParametersQueryType
list_transactionsParametersQueryType List_transactionsParameters
obj) [Pair] -> [[Pair]] -> [[Pair]]
forall a. a -> [a] -> [a]
: [[Pair]]
forall a. Monoid a => a
GHC.Base.mempty))
    toEncoding :: List_transactionsParameters -> Encoding
toEncoding List_transactionsParameters
obj = Series -> Encoding
Data.Aeson.Encoding.Internal.pairs ([Series] -> Series
forall a. Monoid a => [a] -> a
GHC.Base.mconcat ([[Series]] -> [Series]
forall (t :: * -> *) a. Foldable t => t [a] -> [a]
Data.Foldable.concat ([Series]
-> (JsonDateTime -> [Series]) -> Maybe JsonDateTime -> [Series]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Series]
forall a. Monoid a => a
GHC.Base.mempty (Series -> [Series]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Series -> [Series])
-> (JsonDateTime -> Series) -> JsonDateTime -> [Series]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"queryBegin_time" Key -> JsonDateTime -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..=)) (List_transactionsParameters -> Maybe JsonDateTime
list_transactionsParametersQueryBegin_time List_transactionsParameters
obj) [Series] -> [[Series]] -> [[Series]]
forall a. a -> [a] -> [a]
: [Series]
-> (JsonDateTime -> [Series]) -> Maybe JsonDateTime -> [Series]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Series]
forall a. Monoid a => a
GHC.Base.mempty (Series -> [Series]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Series -> [Series])
-> (JsonDateTime -> Series) -> JsonDateTime -> [Series]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"queryEnd_time" Key -> JsonDateTime -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..=)) (List_transactionsParameters -> Maybe JsonDateTime
list_transactionsParametersQueryEnd_time List_transactionsParameters
obj) [Series] -> [[Series]] -> [[Series]]
forall a. a -> [a] -> [a]
: [Series] -> ([Text] -> [Series]) -> Maybe [Text] -> [Series]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Series]
forall a. Monoid a => a
GHC.Base.mempty (Series -> [Series]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Series -> [Series]) -> ([Text] -> Series) -> [Text] -> [Series]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"queryIds" Key -> [Text] -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..=)) (List_transactionsParameters -> Maybe [Text]
list_transactionsParametersQueryIds List_transactionsParameters
obj) [Series] -> [[Series]] -> [[Series]]
forall a. a -> [a] -> [a]
: [Series] -> (Int -> [Series]) -> Maybe Int -> [Series]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Series]
forall a. Monoid a => a
GHC.Base.mempty (Series -> [Series]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Series -> [Series]) -> (Int -> Series) -> Int -> [Series]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"queryLimit" Key -> Int -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..=)) (List_transactionsParameters -> Maybe Int
list_transactionsParametersQueryLimit List_transactionsParameters
obj) [Series] -> [[Series]] -> [[Series]]
forall a. a -> [a] -> [a]
: [Series]
-> (List_transactionsParametersQueryOrder -> [Series])
-> Maybe List_transactionsParametersQueryOrder
-> [Series]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Series]
forall a. Monoid a => a
GHC.Base.mempty (Series -> [Series]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Series -> [Series])
-> (List_transactionsParametersQueryOrder -> Series)
-> List_transactionsParametersQueryOrder
-> [Series]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"queryOrder" Key -> List_transactionsParametersQueryOrder -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..=)) (List_transactionsParameters
-> Maybe List_transactionsParametersQueryOrder
list_transactionsParametersQueryOrder List_transactionsParameters
obj) [Series] -> [[Series]] -> [[Series]]
forall a. a -> [a] -> [a]
: [Series]
-> (List_transactionsParametersQuerySort -> [Series])
-> Maybe List_transactionsParametersQuerySort
-> [Series]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Series]
forall a. Monoid a => a
GHC.Base.mempty (Series -> [Series]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Series -> [Series])
-> (List_transactionsParametersQuerySort -> Series)
-> List_transactionsParametersQuerySort
-> [Series]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"querySort" Key -> List_transactionsParametersQuerySort -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..=)) (List_transactionsParameters
-> Maybe List_transactionsParametersQuerySort
list_transactionsParametersQuerySort List_transactionsParameters
obj) [Series] -> [[Series]] -> [[Series]]
forall a. a -> [a] -> [a]
: [Series]
-> (List_transactionsParametersQuerySuccess -> [Series])
-> Maybe List_transactionsParametersQuerySuccess
-> [Series]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Series]
forall a. Monoid a => a
GHC.Base.mempty (Series -> [Series]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Series -> [Series])
-> (List_transactionsParametersQuerySuccess -> Series)
-> List_transactionsParametersQuerySuccess
-> [Series]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"querySuccess" Key -> List_transactionsParametersQuerySuccess -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..=)) (List_transactionsParameters
-> Maybe List_transactionsParametersQuerySuccess
list_transactionsParametersQuerySuccess List_transactionsParameters
obj) [Series] -> [[Series]] -> [[Series]]
forall a. a -> [a] -> [a]
: [Series]
-> (List_transactionsParametersQueryType -> [Series])
-> Maybe List_transactionsParametersQueryType
-> [Series]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Series]
forall a. Monoid a => a
GHC.Base.mempty (Series -> [Series]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Series -> [Series])
-> (List_transactionsParametersQueryType -> Series)
-> List_transactionsParametersQueryType
-> [Series]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"queryType" Key -> List_transactionsParametersQueryType -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..=)) (List_transactionsParameters
-> Maybe List_transactionsParametersQueryType
list_transactionsParametersQueryType List_transactionsParameters
obj) [Series] -> [[Series]] -> [[Series]]
forall a. a -> [a] -> [a]
: [[Series]]
forall a. Monoid a => a
GHC.Base.mempty)))
instance Data.Aeson.Types.FromJSON.FromJSON List_transactionsParameters where
    parseJSON :: Value -> Parser List_transactionsParameters
parseJSON = String
-> (Object -> Parser List_transactionsParameters)
-> Value
-> Parser List_transactionsParameters
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.Aeson.Types.FromJSON.withObject String
"List_transactionsParameters" (\Object
obj -> ((((((((Maybe JsonDateTime
 -> Maybe JsonDateTime
 -> Maybe [Text]
 -> Maybe Int
 -> Maybe List_transactionsParametersQueryOrder
 -> Maybe List_transactionsParametersQuerySort
 -> Maybe List_transactionsParametersQuerySuccess
 -> Maybe List_transactionsParametersQueryType
 -> List_transactionsParameters)
-> Parser
     (Maybe JsonDateTime
      -> Maybe JsonDateTime
      -> Maybe [Text]
      -> Maybe Int
      -> Maybe List_transactionsParametersQueryOrder
      -> Maybe List_transactionsParametersQuerySort
      -> Maybe List_transactionsParametersQuerySuccess
      -> Maybe List_transactionsParametersQueryType
      -> List_transactionsParameters)
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure Maybe JsonDateTime
-> Maybe JsonDateTime
-> Maybe [Text]
-> Maybe Int
-> Maybe List_transactionsParametersQueryOrder
-> Maybe List_transactionsParametersQuerySort
-> Maybe List_transactionsParametersQuerySuccess
-> Maybe List_transactionsParametersQueryType
-> List_transactionsParameters
List_transactionsParameters Parser
  (Maybe JsonDateTime
   -> Maybe JsonDateTime
   -> Maybe [Text]
   -> Maybe Int
   -> Maybe List_transactionsParametersQueryOrder
   -> Maybe List_transactionsParametersQuerySort
   -> Maybe List_transactionsParametersQuerySuccess
   -> Maybe List_transactionsParametersQueryType
   -> List_transactionsParameters)
-> Parser (Maybe JsonDateTime)
-> Parser
     (Maybe JsonDateTime
      -> Maybe [Text]
      -> Maybe Int
      -> Maybe List_transactionsParametersQueryOrder
      -> Maybe List_transactionsParametersQuerySort
      -> Maybe List_transactionsParametersQuerySuccess
      -> Maybe List_transactionsParametersQueryType
      -> List_transactionsParameters)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Key -> Parser (Maybe JsonDateTime)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Key
"queryBegin_time")) Parser
  (Maybe JsonDateTime
   -> Maybe [Text]
   -> Maybe Int
   -> Maybe List_transactionsParametersQueryOrder
   -> Maybe List_transactionsParametersQuerySort
   -> Maybe List_transactionsParametersQuerySuccess
   -> Maybe List_transactionsParametersQueryType
   -> List_transactionsParameters)
-> Parser (Maybe JsonDateTime)
-> Parser
     (Maybe [Text]
      -> Maybe Int
      -> Maybe List_transactionsParametersQueryOrder
      -> Maybe List_transactionsParametersQuerySort
      -> Maybe List_transactionsParametersQuerySuccess
      -> Maybe List_transactionsParametersQueryType
      -> List_transactionsParameters)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Key -> Parser (Maybe JsonDateTime)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Key
"queryEnd_time")) Parser
  (Maybe [Text]
   -> Maybe Int
   -> Maybe List_transactionsParametersQueryOrder
   -> Maybe List_transactionsParametersQuerySort
   -> Maybe List_transactionsParametersQuerySuccess
   -> Maybe List_transactionsParametersQueryType
   -> List_transactionsParameters)
-> Parser (Maybe [Text])
-> Parser
     (Maybe Int
      -> Maybe List_transactionsParametersQueryOrder
      -> Maybe List_transactionsParametersQuerySort
      -> Maybe List_transactionsParametersQuerySuccess
      -> Maybe List_transactionsParametersQueryType
      -> List_transactionsParameters)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Key -> Parser (Maybe [Text])
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Key
"queryIds")) Parser
  (Maybe Int
   -> Maybe List_transactionsParametersQueryOrder
   -> Maybe List_transactionsParametersQuerySort
   -> Maybe List_transactionsParametersQuerySuccess
   -> Maybe List_transactionsParametersQueryType
   -> List_transactionsParameters)
-> Parser (Maybe Int)
-> Parser
     (Maybe List_transactionsParametersQueryOrder
      -> Maybe List_transactionsParametersQuerySort
      -> Maybe List_transactionsParametersQuerySuccess
      -> Maybe List_transactionsParametersQueryType
      -> List_transactionsParameters)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Key -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Key
"queryLimit")) Parser
  (Maybe List_transactionsParametersQueryOrder
   -> Maybe List_transactionsParametersQuerySort
   -> Maybe List_transactionsParametersQuerySuccess
   -> Maybe List_transactionsParametersQueryType
   -> List_transactionsParameters)
-> Parser (Maybe List_transactionsParametersQueryOrder)
-> Parser
     (Maybe List_transactionsParametersQuerySort
      -> Maybe List_transactionsParametersQuerySuccess
      -> Maybe List_transactionsParametersQueryType
      -> List_transactionsParameters)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object
-> Key -> Parser (Maybe List_transactionsParametersQueryOrder)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Key
"queryOrder")) Parser
  (Maybe List_transactionsParametersQuerySort
   -> Maybe List_transactionsParametersQuerySuccess
   -> Maybe List_transactionsParametersQueryType
   -> List_transactionsParameters)
-> Parser (Maybe List_transactionsParametersQuerySort)
-> Parser
     (Maybe List_transactionsParametersQuerySuccess
      -> Maybe List_transactionsParametersQueryType
      -> List_transactionsParameters)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object
-> Key -> Parser (Maybe List_transactionsParametersQuerySort)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Key
"querySort")) Parser
  (Maybe List_transactionsParametersQuerySuccess
   -> Maybe List_transactionsParametersQueryType
   -> List_transactionsParameters)
-> Parser (Maybe List_transactionsParametersQuerySuccess)
-> Parser
     (Maybe List_transactionsParametersQueryType
      -> List_transactionsParameters)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object
-> Key -> Parser (Maybe List_transactionsParametersQuerySuccess)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Key
"querySuccess")) Parser
  (Maybe List_transactionsParametersQueryType
   -> List_transactionsParameters)
-> Parser (Maybe List_transactionsParametersQueryType)
-> Parser List_transactionsParameters
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object
-> Key -> Parser (Maybe List_transactionsParametersQueryType)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Key
"queryType"))

-- | Create a new 'List_transactionsParameters' with all required fields.
mkList_transactionsParameters :: List_transactionsParameters
mkList_transactionsParameters :: List_transactionsParameters
mkList_transactionsParameters =
    List_transactionsParameters
        { list_transactionsParametersQueryBegin_time :: Maybe JsonDateTime
list_transactionsParametersQueryBegin_time = Maybe JsonDateTime
forall a. Maybe a
GHC.Maybe.Nothing
        , list_transactionsParametersQueryEnd_time :: Maybe JsonDateTime
list_transactionsParametersQueryEnd_time = Maybe JsonDateTime
forall a. Maybe a
GHC.Maybe.Nothing
        , list_transactionsParametersQueryIds :: Maybe [Text]
list_transactionsParametersQueryIds = Maybe [Text]
forall a. Maybe a
GHC.Maybe.Nothing
        , list_transactionsParametersQueryLimit :: Maybe Int
list_transactionsParametersQueryLimit = Maybe Int
forall a. Maybe a
GHC.Maybe.Nothing
        , list_transactionsParametersQueryOrder :: Maybe List_transactionsParametersQueryOrder
list_transactionsParametersQueryOrder = Maybe List_transactionsParametersQueryOrder
forall a. Maybe a
GHC.Maybe.Nothing
        , list_transactionsParametersQuerySort :: Maybe List_transactionsParametersQuerySort
list_transactionsParametersQuerySort = Maybe List_transactionsParametersQuerySort
forall a. Maybe a
GHC.Maybe.Nothing
        , list_transactionsParametersQuerySuccess :: Maybe List_transactionsParametersQuerySuccess
list_transactionsParametersQuerySuccess = Maybe List_transactionsParametersQuerySuccess
forall a. Maybe a
GHC.Maybe.Nothing
        , list_transactionsParametersQueryType :: Maybe List_transactionsParametersQueryType
list_transactionsParametersQueryType = Maybe List_transactionsParametersQueryType
forall a. Maybe a
GHC.Maybe.Nothing
        }

{- | Defines the enum schema located at @paths.\/transactions.GET.parameters.properties.queryOrder@ in the specification.

Represents the parameter named \'order\'

Sort order.
-}
data List_transactionsParametersQueryOrder
    = -- | This case is used if the value encountered during decoding does not match any of the provided cases in the specification.
      List_transactionsParametersQueryOrderOther Data.Aeson.Types.Internal.Value
    | -- | This constructor can be used to send values to the server which are not present in the specification yet.
      List_transactionsParametersQueryOrderTyped Data.Text.Internal.Text
    | -- | Represents the JSON value @"asc"@
      List_transactionsParametersQueryOrderEnumAsc
    | -- | Represents the JSON value @"desc"@
      List_transactionsParametersQueryOrderEnumDesc
    deriving (Int -> List_transactionsParametersQueryOrder -> ShowS
[List_transactionsParametersQueryOrder] -> ShowS
List_transactionsParametersQueryOrder -> String
(Int -> List_transactionsParametersQueryOrder -> ShowS)
-> (List_transactionsParametersQueryOrder -> String)
-> ([List_transactionsParametersQueryOrder] -> ShowS)
-> Show List_transactionsParametersQueryOrder
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> List_transactionsParametersQueryOrder -> ShowS
showsPrec :: Int -> List_transactionsParametersQueryOrder -> ShowS
$cshow :: List_transactionsParametersQueryOrder -> String
show :: List_transactionsParametersQueryOrder -> String
$cshowList :: [List_transactionsParametersQueryOrder] -> ShowS
showList :: [List_transactionsParametersQueryOrder] -> ShowS
GHC.Show.Show, List_transactionsParametersQueryOrder
-> List_transactionsParametersQueryOrder -> Bool
(List_transactionsParametersQueryOrder
 -> List_transactionsParametersQueryOrder -> Bool)
-> (List_transactionsParametersQueryOrder
    -> List_transactionsParametersQueryOrder -> Bool)
-> Eq List_transactionsParametersQueryOrder
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: List_transactionsParametersQueryOrder
-> List_transactionsParametersQueryOrder -> Bool
== :: List_transactionsParametersQueryOrder
-> List_transactionsParametersQueryOrder -> Bool
$c/= :: List_transactionsParametersQueryOrder
-> List_transactionsParametersQueryOrder -> Bool
/= :: List_transactionsParametersQueryOrder
-> List_transactionsParametersQueryOrder -> Bool
GHC.Classes.Eq)

instance Data.Aeson.Types.ToJSON.ToJSON List_transactionsParametersQueryOrder where
    toJSON :: List_transactionsParametersQueryOrder -> Value
toJSON (List_transactionsParametersQueryOrderOther Value
val) = Value
val
    toJSON (List_transactionsParametersQueryOrderTyped Text
val) = Text -> Value
forall a. ToJSON a => a -> Value
Data.Aeson.Types.ToJSON.toJSON Text
val
    toJSON (List_transactionsParametersQueryOrder
List_transactionsParametersQueryOrderEnumAsc) = Value
"asc"
    toJSON (List_transactionsParametersQueryOrder
List_transactionsParametersQueryOrderEnumDesc) = Value
"desc"
instance Data.Aeson.Types.FromJSON.FromJSON List_transactionsParametersQueryOrder where
    parseJSON :: Value -> Parser List_transactionsParametersQueryOrder
parseJSON Value
val =
        List_transactionsParametersQueryOrder
-> Parser List_transactionsParametersQueryOrder
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure
            ( if
                | Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"asc" -> List_transactionsParametersQueryOrder
List_transactionsParametersQueryOrderEnumAsc
                | Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"desc" -> List_transactionsParametersQueryOrder
List_transactionsParametersQueryOrderEnumDesc
                | Bool
GHC.Base.otherwise -> Value -> List_transactionsParametersQueryOrder
List_transactionsParametersQueryOrderOther Value
val
            )

{- | Defines the enum schema located at @paths.\/transactions.GET.parameters.properties.querySort@ in the specification.

Represents the parameter named \'sort\'

Sort field. You *really* only want to sort by \`updated_at\` in ascending
order. In descending order updated records will move behind the cursor and could
prevent some records from being returned.
-}
data List_transactionsParametersQuerySort
    = -- | This case is used if the value encountered during decoding does not match any of the provided cases in the specification.
      List_transactionsParametersQuerySortOther Data.Aeson.Types.Internal.Value
    | -- | This constructor can be used to send values to the server which are not present in the specification yet.
      List_transactionsParametersQuerySortTyped Data.Text.Internal.Text
    | -- | Represents the JSON value @"created_at"@
      List_transactionsParametersQuerySortEnumCreated_at
    | -- | Represents the JSON value @"updated_at"@
      List_transactionsParametersQuerySortEnumUpdated_at
    deriving (Int -> List_transactionsParametersQuerySort -> ShowS
[List_transactionsParametersQuerySort] -> ShowS
List_transactionsParametersQuerySort -> String
(Int -> List_transactionsParametersQuerySort -> ShowS)
-> (List_transactionsParametersQuerySort -> String)
-> ([List_transactionsParametersQuerySort] -> ShowS)
-> Show List_transactionsParametersQuerySort
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> List_transactionsParametersQuerySort -> ShowS
showsPrec :: Int -> List_transactionsParametersQuerySort -> ShowS
$cshow :: List_transactionsParametersQuerySort -> String
show :: List_transactionsParametersQuerySort -> String
$cshowList :: [List_transactionsParametersQuerySort] -> ShowS
showList :: [List_transactionsParametersQuerySort] -> ShowS
GHC.Show.Show, List_transactionsParametersQuerySort
-> List_transactionsParametersQuerySort -> Bool
(List_transactionsParametersQuerySort
 -> List_transactionsParametersQuerySort -> Bool)
-> (List_transactionsParametersQuerySort
    -> List_transactionsParametersQuerySort -> Bool)
-> Eq List_transactionsParametersQuerySort
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: List_transactionsParametersQuerySort
-> List_transactionsParametersQuerySort -> Bool
== :: List_transactionsParametersQuerySort
-> List_transactionsParametersQuerySort -> Bool
$c/= :: List_transactionsParametersQuerySort
-> List_transactionsParametersQuerySort -> Bool
/= :: List_transactionsParametersQuerySort
-> List_transactionsParametersQuerySort -> Bool
GHC.Classes.Eq)

instance Data.Aeson.Types.ToJSON.ToJSON List_transactionsParametersQuerySort where
    toJSON :: List_transactionsParametersQuerySort -> Value
toJSON (List_transactionsParametersQuerySortOther Value
val) = Value
val
    toJSON (List_transactionsParametersQuerySortTyped Text
val) = Text -> Value
forall a. ToJSON a => a -> Value
Data.Aeson.Types.ToJSON.toJSON Text
val
    toJSON (List_transactionsParametersQuerySort
List_transactionsParametersQuerySortEnumCreated_at) = Value
"created_at"
    toJSON (List_transactionsParametersQuerySort
List_transactionsParametersQuerySortEnumUpdated_at) = Value
"updated_at"
instance Data.Aeson.Types.FromJSON.FromJSON List_transactionsParametersQuerySort where
    parseJSON :: Value -> Parser List_transactionsParametersQuerySort
parseJSON Value
val =
        List_transactionsParametersQuerySort
-> Parser List_transactionsParametersQuerySort
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure
            ( if
                | Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"created_at" -> List_transactionsParametersQuerySort
List_transactionsParametersQuerySortEnumCreated_at
                | Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"updated_at" -> List_transactionsParametersQuerySort
List_transactionsParametersQuerySortEnumUpdated_at
                | Bool
GHC.Base.otherwise -> Value -> List_transactionsParametersQuerySort
List_transactionsParametersQuerySortOther Value
val
            )

{- | Defines the enum schema located at @paths.\/transactions.GET.parameters.properties.querySuccess@ in the specification.

Represents the parameter named \'success\'

Filter by success field.
-}
data List_transactionsParametersQuerySuccess
    = -- | This case is used if the value encountered during decoding does not match any of the provided cases in the specification.
      List_transactionsParametersQuerySuccessOther Data.Aeson.Types.Internal.Value
    | -- | This constructor can be used to send values to the server which are not present in the specification yet.
      List_transactionsParametersQuerySuccessTyped Data.Text.Internal.Text
    | -- | Represents the JSON value @true@
      List_transactionsParametersQuerySuccessEnumTrue
    deriving (Int -> List_transactionsParametersQuerySuccess -> ShowS
[List_transactionsParametersQuerySuccess] -> ShowS
List_transactionsParametersQuerySuccess -> String
(Int -> List_transactionsParametersQuerySuccess -> ShowS)
-> (List_transactionsParametersQuerySuccess -> String)
-> ([List_transactionsParametersQuerySuccess] -> ShowS)
-> Show List_transactionsParametersQuerySuccess
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> List_transactionsParametersQuerySuccess -> ShowS
showsPrec :: Int -> List_transactionsParametersQuerySuccess -> ShowS
$cshow :: List_transactionsParametersQuerySuccess -> String
show :: List_transactionsParametersQuerySuccess -> String
$cshowList :: [List_transactionsParametersQuerySuccess] -> ShowS
showList :: [List_transactionsParametersQuerySuccess] -> ShowS
GHC.Show.Show, List_transactionsParametersQuerySuccess
-> List_transactionsParametersQuerySuccess -> Bool
(List_transactionsParametersQuerySuccess
 -> List_transactionsParametersQuerySuccess -> Bool)
-> (List_transactionsParametersQuerySuccess
    -> List_transactionsParametersQuerySuccess -> Bool)
-> Eq List_transactionsParametersQuerySuccess
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: List_transactionsParametersQuerySuccess
-> List_transactionsParametersQuerySuccess -> Bool
== :: List_transactionsParametersQuerySuccess
-> List_transactionsParametersQuerySuccess -> Bool
$c/= :: List_transactionsParametersQuerySuccess
-> List_transactionsParametersQuerySuccess -> Bool
/= :: List_transactionsParametersQuerySuccess
-> List_transactionsParametersQuerySuccess -> Bool
GHC.Classes.Eq)

instance Data.Aeson.Types.ToJSON.ToJSON List_transactionsParametersQuerySuccess where
    toJSON :: List_transactionsParametersQuerySuccess -> Value
toJSON (List_transactionsParametersQuerySuccessOther Value
val) = Value
val
    toJSON (List_transactionsParametersQuerySuccessTyped Text
val) = Text -> Value
forall a. ToJSON a => a -> Value
Data.Aeson.Types.ToJSON.toJSON Text
val
    toJSON (List_transactionsParametersQuerySuccess
List_transactionsParametersQuerySuccessEnumTrue) = Bool -> Value
Data.Aeson.Types.Internal.Bool Bool
GHC.Types.True
instance Data.Aeson.Types.FromJSON.FromJSON List_transactionsParametersQuerySuccess where
    parseJSON :: Value -> Parser List_transactionsParametersQuerySuccess
parseJSON Value
val =
        List_transactionsParametersQuerySuccess
-> Parser List_transactionsParametersQuerySuccess
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure
            ( if
                | Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Bool -> Value
Data.Aeson.Types.Internal.Bool Bool
GHC.Types.True -> List_transactionsParametersQuerySuccess
List_transactionsParametersQuerySuccessEnumTrue
                | Bool
GHC.Base.otherwise -> Value -> List_transactionsParametersQuerySuccess
List_transactionsParametersQuerySuccessOther Value
val
            )

{- | Defines the enum schema located at @paths.\/transactions.GET.parameters.properties.queryType@ in the specification.

Represents the parameter named \'type\'

Filter by type field. The value \`payment\` will return both \`purchase\` and \`capture\` transactions.
-}
data List_transactionsParametersQueryType
    = -- | This case is used if the value encountered during decoding does not match any of the provided cases in the specification.
      List_transactionsParametersQueryTypeOther Data.Aeson.Types.Internal.Value
    | -- | This constructor can be used to send values to the server which are not present in the specification yet.
      List_transactionsParametersQueryTypeTyped Data.Text.Internal.Text
    | -- | Represents the JSON value @"authorization"@
      List_transactionsParametersQueryTypeEnumAuthorization
    | -- | Represents the JSON value @"capture"@
      List_transactionsParametersQueryTypeEnumCapture
    | -- | Represents the JSON value @"payment"@
      List_transactionsParametersQueryTypeEnumPayment
    | -- | Represents the JSON value @"purchase"@
      List_transactionsParametersQueryTypeEnumPurchase
    | -- | Represents the JSON value @"refund"@
      List_transactionsParametersQueryTypeEnumRefund
    | -- | Represents the JSON value @"verify"@
      List_transactionsParametersQueryTypeEnumVerify
    deriving (Int -> List_transactionsParametersQueryType -> ShowS
[List_transactionsParametersQueryType] -> ShowS
List_transactionsParametersQueryType -> String
(Int -> List_transactionsParametersQueryType -> ShowS)
-> (List_transactionsParametersQueryType -> String)
-> ([List_transactionsParametersQueryType] -> ShowS)
-> Show List_transactionsParametersQueryType
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> List_transactionsParametersQueryType -> ShowS
showsPrec :: Int -> List_transactionsParametersQueryType -> ShowS
$cshow :: List_transactionsParametersQueryType -> String
show :: List_transactionsParametersQueryType -> String
$cshowList :: [List_transactionsParametersQueryType] -> ShowS
showList :: [List_transactionsParametersQueryType] -> ShowS
GHC.Show.Show, List_transactionsParametersQueryType
-> List_transactionsParametersQueryType -> Bool
(List_transactionsParametersQueryType
 -> List_transactionsParametersQueryType -> Bool)
-> (List_transactionsParametersQueryType
    -> List_transactionsParametersQueryType -> Bool)
-> Eq List_transactionsParametersQueryType
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: List_transactionsParametersQueryType
-> List_transactionsParametersQueryType -> Bool
== :: List_transactionsParametersQueryType
-> List_transactionsParametersQueryType -> Bool
$c/= :: List_transactionsParametersQueryType
-> List_transactionsParametersQueryType -> Bool
/= :: List_transactionsParametersQueryType
-> List_transactionsParametersQueryType -> Bool
GHC.Classes.Eq)

instance Data.Aeson.Types.ToJSON.ToJSON List_transactionsParametersQueryType where
    toJSON :: List_transactionsParametersQueryType -> Value
toJSON (List_transactionsParametersQueryTypeOther Value
val) = Value
val
    toJSON (List_transactionsParametersQueryTypeTyped Text
val) = Text -> Value
forall a. ToJSON a => a -> Value
Data.Aeson.Types.ToJSON.toJSON Text
val
    toJSON (List_transactionsParametersQueryType
List_transactionsParametersQueryTypeEnumAuthorization) = Value
"authorization"
    toJSON (List_transactionsParametersQueryType
List_transactionsParametersQueryTypeEnumCapture) = Value
"capture"
    toJSON (List_transactionsParametersQueryType
List_transactionsParametersQueryTypeEnumPayment) = Value
"payment"
    toJSON (List_transactionsParametersQueryType
List_transactionsParametersQueryTypeEnumPurchase) = Value
"purchase"
    toJSON (List_transactionsParametersQueryType
List_transactionsParametersQueryTypeEnumRefund) = Value
"refund"
    toJSON (List_transactionsParametersQueryType
List_transactionsParametersQueryTypeEnumVerify) = Value
"verify"
instance Data.Aeson.Types.FromJSON.FromJSON List_transactionsParametersQueryType where
    parseJSON :: Value -> Parser List_transactionsParametersQueryType
parseJSON Value
val =
        List_transactionsParametersQueryType
-> Parser List_transactionsParametersQueryType
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure
            ( if
                | Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"authorization" -> List_transactionsParametersQueryType
List_transactionsParametersQueryTypeEnumAuthorization
                | Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"capture" -> List_transactionsParametersQueryType
List_transactionsParametersQueryTypeEnumCapture
                | Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"payment" -> List_transactionsParametersQueryType
List_transactionsParametersQueryTypeEnumPayment
                | Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"purchase" -> List_transactionsParametersQueryType
List_transactionsParametersQueryTypeEnumPurchase
                | Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"refund" -> List_transactionsParametersQueryType
List_transactionsParametersQueryTypeEnumRefund
                | Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"verify" -> List_transactionsParametersQueryType
List_transactionsParametersQueryTypeEnumVerify
                | Bool
GHC.Base.otherwise -> Value -> List_transactionsParametersQueryType
List_transactionsParametersQueryTypeOther Value
val
            )

{- | Represents a response of the operation 'list_transactions'.

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), 'List_transactionsResponseError' is used.
-}
data List_transactionsResponse
    = -- | Means either no matching case available or a parse error
      List_transactionsResponseError GHC.Base.String
    | -- | A list of the site\'s transactions.
      List_transactionsResponse200 TransactionList
    | -- | Invalid or unpermitted parameter.
      List_transactionsResponse400 Error
    | -- | Incorrect site or subscription ID.
      List_transactionsResponse404 Error
    | -- | Unexpected error.
      List_transactionsResponseDefault Error
    deriving (Int -> List_transactionsResponse -> ShowS
[List_transactionsResponse] -> ShowS
List_transactionsResponse -> String
(Int -> List_transactionsResponse -> ShowS)
-> (List_transactionsResponse -> String)
-> ([List_transactionsResponse] -> ShowS)
-> Show List_transactionsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> List_transactionsResponse -> ShowS
showsPrec :: Int -> List_transactionsResponse -> ShowS
$cshow :: List_transactionsResponse -> String
show :: List_transactionsResponse -> String
$cshowList :: [List_transactionsResponse] -> ShowS
showList :: [List_transactionsResponse] -> ShowS
GHC.Show.Show, List_transactionsResponse -> List_transactionsResponse -> Bool
(List_transactionsResponse -> List_transactionsResponse -> Bool)
-> (List_transactionsResponse -> List_transactionsResponse -> Bool)
-> Eq List_transactionsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: List_transactionsResponse -> List_transactionsResponse -> Bool
== :: List_transactionsResponse -> List_transactionsResponse -> Bool
$c/= :: List_transactionsResponse -> List_transactionsResponse -> Bool
/= :: List_transactionsResponse -> List_transactionsResponse -> Bool
GHC.Classes.Eq)

{- | > GET /transactions

The same as 'list_transactions' but accepts an explicit configuration.
-}
list_transactionsWithConfiguration ::
    forall m.
    (RecurlyClient.Common.MonadHTTP m) =>
    -- | The configuration to use in the request
    RecurlyClient.Common.Configuration ->
    -- | Contains all available parameters of this operation (query and path parameters)
    List_transactionsParameters ->
    -- | Monadic computation which returns the result of the operation
    m (Network.HTTP.Client.Types.Response List_transactionsResponse)
list_transactionsWithConfiguration :: forall (m :: * -> *).
MonadHTTP m =>
Configuration
-> List_transactionsParameters
-> m (Response List_transactionsResponse)
list_transactionsWithConfiguration
    Configuration
config
    List_transactionsParameters
parameters =
        (Response ByteString -> Response List_transactionsResponse)
-> m (Response ByteString)
-> m (Response List_transactionsResponse)
forall a b. (a -> b) -> m a -> m b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
GHC.Base.fmap
            ( \Response ByteString
response_4 ->
                (ByteString -> List_transactionsResponse)
-> Response ByteString -> Response List_transactionsResponse
forall a b. (a -> b) -> Response a -> Response b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
GHC.Base.fmap
                    ( (String -> List_transactionsResponse)
-> (List_transactionsResponse -> List_transactionsResponse)
-> Either String List_transactionsResponse
-> List_transactionsResponse
forall a c b. (a -> c) -> (b -> c) -> Either a b -> c
Data.Either.either String -> List_transactionsResponse
List_transactionsResponseError List_transactionsResponse -> List_transactionsResponse
forall a. a -> a
GHC.Base.id
                        (Either String List_transactionsResponse
 -> List_transactionsResponse)
-> (ByteString -> Either String List_transactionsResponse)
-> ByteString
-> List_transactionsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. ( \Response ByteString
response ByteString
body ->
                                        if
                                            | (\Status
status_5 -> Status -> Int
Network.HTTP.Types.Status.statusCode Status
status_5 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) ->
                                                TransactionList -> List_transactionsResponse
List_transactionsResponse200
                                                    (TransactionList -> List_transactionsResponse)
-> Either String TransactionList
-> Either String List_transactionsResponse
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Data.Functor.<$> ( ByteString -> Either String TransactionList
forall a. FromJSON a => ByteString -> Either String a
Data.Aeson.eitherDecodeStrict ByteString
body ::
                                                                        Data.Either.Either
                                                                            GHC.Base.String
                                                                            TransactionList
                                                                     )
                                            | (\Status
status_6 -> Status -> Int
Network.HTTP.Types.Status.statusCode Status
status_6 Int -> Int -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Int
400) (Response ByteString -> Status
forall body. Response body -> Status
Network.HTTP.Client.Types.responseStatus Response ByteString
response) ->
                                                Error -> List_transactionsResponse
List_transactionsResponse400
                                                    (Error -> List_transactionsResponse)
-> Either String Error -> Either String List_transactionsResponse
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
                                                                     )
                                            | (\Status
status_7 -> Status -> Int
Network.HTTP.Types.Status.statusCode Status
status_7 Int -> Int -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Int
404) (Response ByteString -> Status
forall body. Response body -> Status
Network.HTTP.Client.Types.responseStatus Response ByteString
response) ->
                                                Error -> List_transactionsResponse
List_transactionsResponse404
                                                    (Error -> List_transactionsResponse)
-> Either String Error -> Either String List_transactionsResponse
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 -> 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 -> List_transactionsResponse
List_transactionsResponseDefault
                                                    (Error -> List_transactionsResponse)
-> Either String Error -> Either String List_transactionsResponse
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 List_transactionsResponse
forall a b. a -> Either a b
Data.Either.Left String
"Missing default response type"
                                   )
                            Response ByteString
response_4
                    )
                    Response ByteString
response_4
            )
            ( Configuration
-> Text -> Text -> [QueryParameter] -> m (Response ByteString)
forall (m :: * -> *).
MonadHTTP m =>
Configuration
-> Text -> Text -> [QueryParameter] -> m (Response ByteString)
RecurlyClient.Common.doCallWithConfiguration
                Configuration
config
                (Text -> Text
Data.Text.toUpper (Text -> Text) -> Text -> Text
forall a b. (a -> b) -> a -> b
GHC.Base.$ String -> Text
Data.Text.Internal.pack String
"GET")
                Text
"/transactions"
                [ Text -> Maybe Value -> Text -> Bool -> QueryParameter
RecurlyClient.Common.QueryParameter (String -> Text
Data.Text.Internal.pack String
"ids") ([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.<$> List_transactionsParameters -> Maybe [Text]
list_transactionsParametersQueryIds List_transactionsParameters
parameters) (String -> Text
Data.Text.Internal.pack String
"form") Bool
GHC.Types.False
                , Text -> Maybe Value -> Text -> Bool -> QueryParameter
RecurlyClient.Common.QueryParameter (String -> Text
Data.Text.Internal.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.<$> List_transactionsParameters -> Maybe Int
list_transactionsParametersQueryLimit List_transactionsParameters
parameters) (String -> Text
Data.Text.Internal.pack String
"form") Bool
GHC.Types.False
                , Text -> Maybe Value -> Text -> Bool -> QueryParameter
RecurlyClient.Common.QueryParameter (String -> Text
Data.Text.Internal.pack String
"order") (List_transactionsParametersQueryOrder -> Value
forall a. ToJSON a => a -> Value
Data.Aeson.Types.ToJSON.toJSON (List_transactionsParametersQueryOrder -> Value)
-> Maybe List_transactionsParametersQueryOrder -> Maybe Value
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Data.Functor.<$> List_transactionsParameters
-> Maybe List_transactionsParametersQueryOrder
list_transactionsParametersQueryOrder List_transactionsParameters
parameters) (String -> Text
Data.Text.Internal.pack String
"form") Bool
GHC.Types.False
                , Text -> Maybe Value -> Text -> Bool -> QueryParameter
RecurlyClient.Common.QueryParameter (String -> Text
Data.Text.Internal.pack String
"sort") (List_transactionsParametersQuerySort -> Value
forall a. ToJSON a => a -> Value
Data.Aeson.Types.ToJSON.toJSON (List_transactionsParametersQuerySort -> Value)
-> Maybe List_transactionsParametersQuerySort -> Maybe Value
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Data.Functor.<$> List_transactionsParameters
-> Maybe List_transactionsParametersQuerySort
list_transactionsParametersQuerySort List_transactionsParameters
parameters) (String -> Text
Data.Text.Internal.pack String
"form") Bool
GHC.Types.False
                , Text -> Maybe Value -> Text -> Bool -> QueryParameter
RecurlyClient.Common.QueryParameter (String -> Text
Data.Text.Internal.pack String
"begin_time") (JsonDateTime -> Value
forall a. ToJSON a => a -> Value
Data.Aeson.Types.ToJSON.toJSON (JsonDateTime -> Value) -> Maybe JsonDateTime -> Maybe Value
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Data.Functor.<$> List_transactionsParameters -> Maybe JsonDateTime
list_transactionsParametersQueryBegin_time List_transactionsParameters
parameters) (String -> Text
Data.Text.Internal.pack String
"form") Bool
GHC.Types.False
                , Text -> Maybe Value -> Text -> Bool -> QueryParameter
RecurlyClient.Common.QueryParameter (String -> Text
Data.Text.Internal.pack String
"end_time") (JsonDateTime -> Value
forall a. ToJSON a => a -> Value
Data.Aeson.Types.ToJSON.toJSON (JsonDateTime -> Value) -> Maybe JsonDateTime -> Maybe Value
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Data.Functor.<$> List_transactionsParameters -> Maybe JsonDateTime
list_transactionsParametersQueryEnd_time List_transactionsParameters
parameters) (String -> Text
Data.Text.Internal.pack String
"form") Bool
GHC.Types.False
                , Text -> Maybe Value -> Text -> Bool -> QueryParameter
RecurlyClient.Common.QueryParameter (String -> Text
Data.Text.Internal.pack String
"type") (List_transactionsParametersQueryType -> Value
forall a. ToJSON a => a -> Value
Data.Aeson.Types.ToJSON.toJSON (List_transactionsParametersQueryType -> Value)
-> Maybe List_transactionsParametersQueryType -> Maybe Value
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Data.Functor.<$> List_transactionsParameters
-> Maybe List_transactionsParametersQueryType
list_transactionsParametersQueryType List_transactionsParameters
parameters) (String -> Text
Data.Text.Internal.pack String
"form") Bool
GHC.Types.False
                , Text -> Maybe Value -> Text -> Bool -> QueryParameter
RecurlyClient.Common.QueryParameter (String -> Text
Data.Text.Internal.pack String
"success") (List_transactionsParametersQuerySuccess -> Value
forall a. ToJSON a => a -> Value
Data.Aeson.Types.ToJSON.toJSON (List_transactionsParametersQuerySuccess -> Value)
-> Maybe List_transactionsParametersQuerySuccess -> Maybe Value
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Data.Functor.<$> List_transactionsParameters
-> Maybe List_transactionsParametersQuerySuccess
list_transactionsParametersQuerySuccess List_transactionsParameters
parameters) (String -> Text
Data.Text.Internal.pack String
"form") Bool
GHC.Types.False
                ]
            )

{- | > GET /transactions

The same as 'list_transactions' but returns the raw 'Data.ByteString.ByteString'.
-}
list_transactionsRaw ::
    forall m.
    (RecurlyClient.Common.MonadHTTP m) =>
    -- | Contains all available parameters of this operation (query and path parameters)
    List_transactionsParameters ->
    -- | Monadic computation which returns the result of the operation
    RecurlyClient.Common.ClientT m (Network.HTTP.Client.Types.Response Data.ByteString.Internal.Type.ByteString)
list_transactionsRaw :: forall (m :: * -> *).
MonadHTTP m =>
List_transactionsParameters -> ClientT m (Response ByteString)
list_transactionsRaw List_transactionsParameters
parameters =
    ClientT m (Response ByteString) -> ClientT m (Response ByteString)
forall a. a -> a
GHC.Base.id
        ( Text -> Text -> [QueryParameter] -> ClientT m (Response ByteString)
forall (m :: * -> *).
MonadHTTP m =>
Text -> Text -> [QueryParameter] -> ClientT m (Response ByteString)
RecurlyClient.Common.doCallWithConfigurationM
            (Text -> Text
Data.Text.toUpper (Text -> Text) -> Text -> Text
forall a b. (a -> b) -> a -> b
GHC.Base.$ String -> Text
Data.Text.Internal.pack String
"GET")
            Text
"/transactions"
            [ Text -> Maybe Value -> Text -> Bool -> QueryParameter
RecurlyClient.Common.QueryParameter (String -> Text
Data.Text.Internal.pack String
"ids") ([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.<$> List_transactionsParameters -> Maybe [Text]
list_transactionsParametersQueryIds List_transactionsParameters
parameters) (String -> Text
Data.Text.Internal.pack String
"form") Bool
GHC.Types.False
            , Text -> Maybe Value -> Text -> Bool -> QueryParameter
RecurlyClient.Common.QueryParameter (String -> Text
Data.Text.Internal.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.<$> List_transactionsParameters -> Maybe Int
list_transactionsParametersQueryLimit List_transactionsParameters
parameters) (String -> Text
Data.Text.Internal.pack String
"form") Bool
GHC.Types.False
            , Text -> Maybe Value -> Text -> Bool -> QueryParameter
RecurlyClient.Common.QueryParameter (String -> Text
Data.Text.Internal.pack String
"order") (List_transactionsParametersQueryOrder -> Value
forall a. ToJSON a => a -> Value
Data.Aeson.Types.ToJSON.toJSON (List_transactionsParametersQueryOrder -> Value)
-> Maybe List_transactionsParametersQueryOrder -> Maybe Value
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Data.Functor.<$> List_transactionsParameters
-> Maybe List_transactionsParametersQueryOrder
list_transactionsParametersQueryOrder List_transactionsParameters
parameters) (String -> Text
Data.Text.Internal.pack String
"form") Bool
GHC.Types.False
            , Text -> Maybe Value -> Text -> Bool -> QueryParameter
RecurlyClient.Common.QueryParameter (String -> Text
Data.Text.Internal.pack String
"sort") (List_transactionsParametersQuerySort -> Value
forall a. ToJSON a => a -> Value
Data.Aeson.Types.ToJSON.toJSON (List_transactionsParametersQuerySort -> Value)
-> Maybe List_transactionsParametersQuerySort -> Maybe Value
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Data.Functor.<$> List_transactionsParameters
-> Maybe List_transactionsParametersQuerySort
list_transactionsParametersQuerySort List_transactionsParameters
parameters) (String -> Text
Data.Text.Internal.pack String
"form") Bool
GHC.Types.False
            , Text -> Maybe Value -> Text -> Bool -> QueryParameter
RecurlyClient.Common.QueryParameter (String -> Text
Data.Text.Internal.pack String
"begin_time") (JsonDateTime -> Value
forall a. ToJSON a => a -> Value
Data.Aeson.Types.ToJSON.toJSON (JsonDateTime -> Value) -> Maybe JsonDateTime -> Maybe Value
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Data.Functor.<$> List_transactionsParameters -> Maybe JsonDateTime
list_transactionsParametersQueryBegin_time List_transactionsParameters
parameters) (String -> Text
Data.Text.Internal.pack String
"form") Bool
GHC.Types.False
            , Text -> Maybe Value -> Text -> Bool -> QueryParameter
RecurlyClient.Common.QueryParameter (String -> Text
Data.Text.Internal.pack String
"end_time") (JsonDateTime -> Value
forall a. ToJSON a => a -> Value
Data.Aeson.Types.ToJSON.toJSON (JsonDateTime -> Value) -> Maybe JsonDateTime -> Maybe Value
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Data.Functor.<$> List_transactionsParameters -> Maybe JsonDateTime
list_transactionsParametersQueryEnd_time List_transactionsParameters
parameters) (String -> Text
Data.Text.Internal.pack String
"form") Bool
GHC.Types.False
            , Text -> Maybe Value -> Text -> Bool -> QueryParameter
RecurlyClient.Common.QueryParameter (String -> Text
Data.Text.Internal.pack String
"type") (List_transactionsParametersQueryType -> Value
forall a. ToJSON a => a -> Value
Data.Aeson.Types.ToJSON.toJSON (List_transactionsParametersQueryType -> Value)
-> Maybe List_transactionsParametersQueryType -> Maybe Value
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Data.Functor.<$> List_transactionsParameters
-> Maybe List_transactionsParametersQueryType
list_transactionsParametersQueryType List_transactionsParameters
parameters) (String -> Text
Data.Text.Internal.pack String
"form") Bool
GHC.Types.False
            , Text -> Maybe Value -> Text -> Bool -> QueryParameter
RecurlyClient.Common.QueryParameter (String -> Text
Data.Text.Internal.pack String
"success") (List_transactionsParametersQuerySuccess -> Value
forall a. ToJSON a => a -> Value
Data.Aeson.Types.ToJSON.toJSON (List_transactionsParametersQuerySuccess -> Value)
-> Maybe List_transactionsParametersQuerySuccess -> Maybe Value
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Data.Functor.<$> List_transactionsParameters
-> Maybe List_transactionsParametersQuerySuccess
list_transactionsParametersQuerySuccess List_transactionsParameters
parameters) (String -> Text
Data.Text.Internal.pack String
"form") Bool
GHC.Types.False
            ]
        )

{- | > GET /transactions

The same as 'list_transactions' but accepts an explicit configuration and returns the raw 'Data.ByteString.ByteString'.
-}
list_transactionsWithConfigurationRaw ::
    forall m.
    (RecurlyClient.Common.MonadHTTP m) =>
    -- | The configuration to use in the request
    RecurlyClient.Common.Configuration ->
    -- | Contains all available parameters of this operation (query and path parameters)
    List_transactionsParameters ->
    -- | Monadic computation which returns the result of the operation
    m (Network.HTTP.Client.Types.Response Data.ByteString.Internal.Type.ByteString)
list_transactionsWithConfigurationRaw :: forall (m :: * -> *).
MonadHTTP m =>
Configuration
-> List_transactionsParameters -> m (Response ByteString)
list_transactionsWithConfigurationRaw
    Configuration
config
    List_transactionsParameters
parameters =
        m (Response ByteString) -> m (Response ByteString)
forall a. a -> a
GHC.Base.id
            ( Configuration
-> Text -> Text -> [QueryParameter] -> m (Response ByteString)
forall (m :: * -> *).
MonadHTTP m =>
Configuration
-> Text -> Text -> [QueryParameter] -> m (Response ByteString)
RecurlyClient.Common.doCallWithConfiguration
                Configuration
config
                (Text -> Text
Data.Text.toUpper (Text -> Text) -> Text -> Text
forall a b. (a -> b) -> a -> b
GHC.Base.$ String -> Text
Data.Text.Internal.pack String
"GET")
                Text
"/transactions"
                [ Text -> Maybe Value -> Text -> Bool -> QueryParameter
RecurlyClient.Common.QueryParameter (String -> Text
Data.Text.Internal.pack String
"ids") ([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.<$> List_transactionsParameters -> Maybe [Text]
list_transactionsParametersQueryIds List_transactionsParameters
parameters) (String -> Text
Data.Text.Internal.pack String
"form") Bool
GHC.Types.False
                , Text -> Maybe Value -> Text -> Bool -> QueryParameter
RecurlyClient.Common.QueryParameter (String -> Text
Data.Text.Internal.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.<$> List_transactionsParameters -> Maybe Int
list_transactionsParametersQueryLimit List_transactionsParameters
parameters) (String -> Text
Data.Text.Internal.pack String
"form") Bool
GHC.Types.False
                , Text -> Maybe Value -> Text -> Bool -> QueryParameter
RecurlyClient.Common.QueryParameter (String -> Text
Data.Text.Internal.pack String
"order") (List_transactionsParametersQueryOrder -> Value
forall a. ToJSON a => a -> Value
Data.Aeson.Types.ToJSON.toJSON (List_transactionsParametersQueryOrder -> Value)
-> Maybe List_transactionsParametersQueryOrder -> Maybe Value
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Data.Functor.<$> List_transactionsParameters
-> Maybe List_transactionsParametersQueryOrder
list_transactionsParametersQueryOrder List_transactionsParameters
parameters) (String -> Text
Data.Text.Internal.pack String
"form") Bool
GHC.Types.False
                , Text -> Maybe Value -> Text -> Bool -> QueryParameter
RecurlyClient.Common.QueryParameter (String -> Text
Data.Text.Internal.pack String
"sort") (List_transactionsParametersQuerySort -> Value
forall a. ToJSON a => a -> Value
Data.Aeson.Types.ToJSON.toJSON (List_transactionsParametersQuerySort -> Value)
-> Maybe List_transactionsParametersQuerySort -> Maybe Value
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Data.Functor.<$> List_transactionsParameters
-> Maybe List_transactionsParametersQuerySort
list_transactionsParametersQuerySort List_transactionsParameters
parameters) (String -> Text
Data.Text.Internal.pack String
"form") Bool
GHC.Types.False
                , Text -> Maybe Value -> Text -> Bool -> QueryParameter
RecurlyClient.Common.QueryParameter (String -> Text
Data.Text.Internal.pack String
"begin_time") (JsonDateTime -> Value
forall a. ToJSON a => a -> Value
Data.Aeson.Types.ToJSON.toJSON (JsonDateTime -> Value) -> Maybe JsonDateTime -> Maybe Value
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Data.Functor.<$> List_transactionsParameters -> Maybe JsonDateTime
list_transactionsParametersQueryBegin_time List_transactionsParameters
parameters) (String -> Text
Data.Text.Internal.pack String
"form") Bool
GHC.Types.False
                , Text -> Maybe Value -> Text -> Bool -> QueryParameter
RecurlyClient.Common.QueryParameter (String -> Text
Data.Text.Internal.pack String
"end_time") (JsonDateTime -> Value
forall a. ToJSON a => a -> Value
Data.Aeson.Types.ToJSON.toJSON (JsonDateTime -> Value) -> Maybe JsonDateTime -> Maybe Value
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Data.Functor.<$> List_transactionsParameters -> Maybe JsonDateTime
list_transactionsParametersQueryEnd_time List_transactionsParameters
parameters) (String -> Text
Data.Text.Internal.pack String
"form") Bool
GHC.Types.False
                , Text -> Maybe Value -> Text -> Bool -> QueryParameter
RecurlyClient.Common.QueryParameter (String -> Text
Data.Text.Internal.pack String
"type") (List_transactionsParametersQueryType -> Value
forall a. ToJSON a => a -> Value
Data.Aeson.Types.ToJSON.toJSON (List_transactionsParametersQueryType -> Value)
-> Maybe List_transactionsParametersQueryType -> Maybe Value
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Data.Functor.<$> List_transactionsParameters
-> Maybe List_transactionsParametersQueryType
list_transactionsParametersQueryType List_transactionsParameters
parameters) (String -> Text
Data.Text.Internal.pack String
"form") Bool
GHC.Types.False
                , Text -> Maybe Value -> Text -> Bool -> QueryParameter
RecurlyClient.Common.QueryParameter (String -> Text
Data.Text.Internal.pack String
"success") (List_transactionsParametersQuerySuccess -> Value
forall a. ToJSON a => a -> Value
Data.Aeson.Types.ToJSON.toJSON (List_transactionsParametersQuerySuccess -> Value)
-> Maybe List_transactionsParametersQuerySuccess -> Maybe Value
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Data.Functor.<$> List_transactionsParameters
-> Maybe List_transactionsParametersQuerySuccess
list_transactionsParametersQuerySuccess List_transactionsParameters
parameters) (String -> Text
Data.Text.Internal.pack String
"form") Bool
GHC.Types.False
                ]
            )