{-# 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_account_line_items
module RecurlyClient.Operations.List_account_line_items 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 /accounts/{account_id}/line_items

See the [Pagination Guide](\/developers\/guides\/pagination.html) to learn how to use pagination in the API and Client Libraries.
-}
list_account_line_items ::
    forall m.
    (RecurlyClient.Common.MonadHTTP m) =>
    -- | Contains all available parameters of this operation (query and path parameters)
    List_account_line_itemsParameters ->
    -- | Monadic computation which returns the result of the operation
    RecurlyClient.Common.ClientT m (Network.HTTP.Client.Types.Response List_account_line_itemsResponse)
list_account_line_items :: forall (m :: * -> *).
MonadHTTP m =>
List_account_line_itemsParameters
-> ClientT m (Response List_account_line_itemsResponse)
list_account_line_items List_account_line_itemsParameters
parameters =
    (Response ByteString -> Response List_account_line_itemsResponse)
-> ClientT m (Response ByteString)
-> ClientT m (Response List_account_line_itemsResponse)
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_account_line_itemsResponse)
-> Response ByteString -> Response List_account_line_itemsResponse
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_account_line_itemsResponse)
-> (List_account_line_itemsResponse
    -> List_account_line_itemsResponse)
-> Either String List_account_line_itemsResponse
-> List_account_line_itemsResponse
forall a c b. (a -> c) -> (b -> c) -> Either a b -> c
Data.Either.either String -> List_account_line_itemsResponse
List_account_line_itemsResponseError List_account_line_itemsResponse -> List_account_line_itemsResponse
forall a. a -> a
GHC.Base.id
                    (Either String List_account_line_itemsResponse
 -> List_account_line_itemsResponse)
-> (ByteString -> Either String List_account_line_itemsResponse)
-> ByteString
-> List_account_line_itemsResponse
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) ->
                                            LineItemList -> List_account_line_itemsResponse
List_account_line_itemsResponse200
                                                (LineItemList -> List_account_line_itemsResponse)
-> Either String LineItemList
-> Either String List_account_line_itemsResponse
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Data.Functor.<$> ( ByteString -> Either String LineItemList
forall a. FromJSON a => ByteString -> Either String a
Data.Aeson.eitherDecodeStrict ByteString
body ::
                                                                    Data.Either.Either
                                                                        GHC.Base.String
                                                                        LineItemList
                                                                 )
                                        | (\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_account_line_itemsResponse
List_account_line_itemsResponse400
                                                (Error -> List_account_line_itemsResponse)
-> Either String Error
-> Either String List_account_line_itemsResponse
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_account_line_itemsResponse
List_account_line_itemsResponse404
                                                (Error -> List_account_line_itemsResponse)
-> Either String Error
-> Either String List_account_line_itemsResponse
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_account_line_itemsResponse
List_account_line_itemsResponseDefault
                                                (Error -> List_account_line_itemsResponse)
-> Either String Error
-> Either String List_account_line_itemsResponse
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_account_line_itemsResponse
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
"/accounts/" Text -> Text -> Text
forall a. Semigroup a => a -> a -> a
GHC.Base.<> (ByteString -> Text
RecurlyClient.Common.byteToText (Bool -> ByteString -> ByteString
Network.HTTP.Types.URI.urlEncode Bool
GHC.Types.True (ByteString -> ByteString) -> ByteString -> ByteString
forall a b. (a -> b) -> a -> b
GHC.Base.$ (Text -> ByteString
RecurlyClient.Common.textToByte (Text -> ByteString) -> Text -> ByteString
forall a b. (a -> b) -> a -> b
GHC.Base.$ Text -> Text
forall a. ToJSON a => a -> Text
RecurlyClient.Common.stringifyModel (List_account_line_itemsParameters -> Text
list_account_line_itemsParametersPathAccount_id List_account_line_itemsParameters
parameters))) Text -> Text -> Text
forall a. Semigroup a => a -> a -> a
GHC.Base.<> Text
"/line_items"))
            [ 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_account_line_itemsParameters -> Maybe [Text]
list_account_line_itemsParametersQueryIds List_account_line_itemsParameters
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_account_line_itemsParameters -> Maybe Int
list_account_line_itemsParametersQueryLimit List_account_line_itemsParameters
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_account_line_itemsParametersQueryOrder -> Value
forall a. ToJSON a => a -> Value
Data.Aeson.Types.ToJSON.toJSON (List_account_line_itemsParametersQueryOrder -> Value)
-> Maybe List_account_line_itemsParametersQueryOrder -> Maybe Value
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Data.Functor.<$> List_account_line_itemsParameters
-> Maybe List_account_line_itemsParametersQueryOrder
list_account_line_itemsParametersQueryOrder List_account_line_itemsParameters
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_account_line_itemsParametersQuerySort -> Value
forall a. ToJSON a => a -> Value
Data.Aeson.Types.ToJSON.toJSON (List_account_line_itemsParametersQuerySort -> Value)
-> Maybe List_account_line_itemsParametersQuerySort -> Maybe Value
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Data.Functor.<$> List_account_line_itemsParameters
-> Maybe List_account_line_itemsParametersQuerySort
list_account_line_itemsParametersQuerySort List_account_line_itemsParameters
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_account_line_itemsParameters -> Maybe JsonDateTime
list_account_line_itemsParametersQueryBegin_time List_account_line_itemsParameters
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_account_line_itemsParameters -> Maybe JsonDateTime
list_account_line_itemsParametersQueryEnd_time List_account_line_itemsParameters
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
"original") (List_account_line_itemsParametersQueryOriginal -> Value
forall a. ToJSON a => a -> Value
Data.Aeson.Types.ToJSON.toJSON (List_account_line_itemsParametersQueryOriginal -> Value)
-> Maybe List_account_line_itemsParametersQueryOriginal
-> Maybe Value
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Data.Functor.<$> List_account_line_itemsParameters
-> Maybe List_account_line_itemsParametersQueryOriginal
list_account_line_itemsParametersQueryOriginal List_account_line_itemsParameters
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
"state") (List_account_line_itemsParametersQueryState -> Value
forall a. ToJSON a => a -> Value
Data.Aeson.Types.ToJSON.toJSON (List_account_line_itemsParametersQueryState -> Value)
-> Maybe List_account_line_itemsParametersQueryState -> Maybe Value
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Data.Functor.<$> List_account_line_itemsParameters
-> Maybe List_account_line_itemsParametersQueryState
list_account_line_itemsParametersQueryState List_account_line_itemsParameters
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_account_line_itemsParametersQueryType -> Value
forall a. ToJSON a => a -> Value
Data.Aeson.Types.ToJSON.toJSON (List_account_line_itemsParametersQueryType -> Value)
-> Maybe List_account_line_itemsParametersQueryType -> Maybe Value
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Data.Functor.<$> List_account_line_itemsParameters
-> Maybe List_account_line_itemsParametersQueryType
list_account_line_itemsParametersQueryType List_account_line_itemsParameters
parameters) (String -> Text
Data.Text.Internal.pack String
"form") Bool
GHC.Types.False
            ]
        )

-- | Defines the object schema located at @paths.\/accounts\/{account_id}\/line_items.GET.parameters@ in the specification.
data List_account_line_itemsParameters = List_account_line_itemsParameters
    { List_account_line_itemsParameters -> Text
list_account_line_itemsParametersPathAccount_id :: Data.Text.Internal.Text
    -- ^ pathAccount_id: Represents the parameter named \'account_id\'
    --
    -- Account ID or code. For ID no prefix is used e.g. \`e28zov4fw0v2\`. For code use prefix \`code-\`, e.g. \`code-bob\`.
    , List_account_line_itemsParameters -> Maybe JsonDateTime
list_account_line_itemsParametersQueryBegin_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_account_line_itemsParameters -> Maybe JsonDateTime
list_account_line_itemsParametersQueryEnd_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_account_line_itemsParameters -> Maybe [Text]
list_account_line_itemsParametersQueryIds :: (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_account_line_itemsParameters -> Maybe Int
list_account_line_itemsParametersQueryLimit :: (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_account_line_itemsParameters
-> Maybe List_account_line_itemsParametersQueryOrder
list_account_line_itemsParametersQueryOrder :: (GHC.Maybe.Maybe List_account_line_itemsParametersQueryOrder)
    -- ^ queryOrder: Represents the parameter named \'order\'
    --
    -- Sort order.
    , List_account_line_itemsParameters
-> Maybe List_account_line_itemsParametersQueryOriginal
list_account_line_itemsParametersQueryOriginal :: (GHC.Maybe.Maybe List_account_line_itemsParametersQueryOriginal)
    -- ^ queryOriginal: Represents the parameter named \'original\'
    --
    -- Filter by original field.
    , List_account_line_itemsParameters
-> Maybe List_account_line_itemsParametersQuerySort
list_account_line_itemsParametersQuerySort :: (GHC.Maybe.Maybe List_account_line_itemsParametersQuerySort)
    -- ^ 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_account_line_itemsParameters
-> Maybe List_account_line_itemsParametersQueryState
list_account_line_itemsParametersQueryState :: (GHC.Maybe.Maybe List_account_line_itemsParametersQueryState)
    -- ^ queryState: Represents the parameter named \'state\'
    --
    -- Filter by state field.
    , List_account_line_itemsParameters
-> Maybe List_account_line_itemsParametersQueryType
list_account_line_itemsParametersQueryType :: (GHC.Maybe.Maybe List_account_line_itemsParametersQueryType)
    -- ^ queryType: Represents the parameter named \'type\'
    --
    -- Filter by type field.
    }
    deriving
        ( Int -> List_account_line_itemsParameters -> ShowS
[List_account_line_itemsParameters] -> ShowS
List_account_line_itemsParameters -> String
(Int -> List_account_line_itemsParameters -> ShowS)
-> (List_account_line_itemsParameters -> String)
-> ([List_account_line_itemsParameters] -> ShowS)
-> Show List_account_line_itemsParameters
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> List_account_line_itemsParameters -> ShowS
showsPrec :: Int -> List_account_line_itemsParameters -> ShowS
$cshow :: List_account_line_itemsParameters -> String
show :: List_account_line_itemsParameters -> String
$cshowList :: [List_account_line_itemsParameters] -> ShowS
showList :: [List_account_line_itemsParameters] -> ShowS
GHC.Show.Show
        , List_account_line_itemsParameters
-> List_account_line_itemsParameters -> Bool
(List_account_line_itemsParameters
 -> List_account_line_itemsParameters -> Bool)
-> (List_account_line_itemsParameters
    -> List_account_line_itemsParameters -> Bool)
-> Eq List_account_line_itemsParameters
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: List_account_line_itemsParameters
-> List_account_line_itemsParameters -> Bool
== :: List_account_line_itemsParameters
-> List_account_line_itemsParameters -> Bool
$c/= :: List_account_line_itemsParameters
-> List_account_line_itemsParameters -> Bool
/= :: List_account_line_itemsParameters
-> List_account_line_itemsParameters -> Bool
GHC.Classes.Eq
        )

instance Data.Aeson.Types.ToJSON.ToJSON List_account_line_itemsParameters where
    toJSON :: List_account_line_itemsParameters -> Value
toJSON List_account_line_itemsParameters
obj = [Pair] -> Value
Data.Aeson.Types.Internal.object ([[Pair]] -> [Pair]
forall (t :: * -> *) a. Foldable t => t [a] -> [a]
Data.Foldable.concat ([Key
"pathAccount_id" 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_account_line_itemsParameters -> Text
list_account_line_itemsParametersPathAccount_id List_account_line_itemsParameters
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
"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_account_line_itemsParameters -> Maybe JsonDateTime
list_account_line_itemsParametersQueryBegin_time List_account_line_itemsParameters
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_account_line_itemsParameters -> Maybe JsonDateTime
list_account_line_itemsParametersQueryEnd_time List_account_line_itemsParameters
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_account_line_itemsParameters -> Maybe [Text]
list_account_line_itemsParametersQueryIds List_account_line_itemsParameters
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_account_line_itemsParameters -> Maybe Int
list_account_line_itemsParametersQueryLimit List_account_line_itemsParameters
obj) [Pair] -> [[Pair]] -> [[Pair]]
forall a. a -> [a] -> [a]
: [Pair]
-> (List_account_line_itemsParametersQueryOrder -> [Pair])
-> Maybe List_account_line_itemsParametersQueryOrder
-> [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_account_line_itemsParametersQueryOrder -> Pair)
-> List_account_line_itemsParametersQueryOrder
-> [Pair]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"queryOrder" Key -> List_account_line_itemsParametersQueryOrder -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..=)) (List_account_line_itemsParameters
-> Maybe List_account_line_itemsParametersQueryOrder
list_account_line_itemsParametersQueryOrder List_account_line_itemsParameters
obj) [Pair] -> [[Pair]] -> [[Pair]]
forall a. a -> [a] -> [a]
: [Pair]
-> (List_account_line_itemsParametersQueryOriginal -> [Pair])
-> Maybe List_account_line_itemsParametersQueryOriginal
-> [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_account_line_itemsParametersQueryOriginal -> Pair)
-> List_account_line_itemsParametersQueryOriginal
-> [Pair]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"queryOriginal" Key -> List_account_line_itemsParametersQueryOriginal -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..=)) (List_account_line_itemsParameters
-> Maybe List_account_line_itemsParametersQueryOriginal
list_account_line_itemsParametersQueryOriginal List_account_line_itemsParameters
obj) [Pair] -> [[Pair]] -> [[Pair]]
forall a. a -> [a] -> [a]
: [Pair]
-> (List_account_line_itemsParametersQuerySort -> [Pair])
-> Maybe List_account_line_itemsParametersQuerySort
-> [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_account_line_itemsParametersQuerySort -> Pair)
-> List_account_line_itemsParametersQuerySort
-> [Pair]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"querySort" Key -> List_account_line_itemsParametersQuerySort -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..=)) (List_account_line_itemsParameters
-> Maybe List_account_line_itemsParametersQuerySort
list_account_line_itemsParametersQuerySort List_account_line_itemsParameters
obj) [Pair] -> [[Pair]] -> [[Pair]]
forall a. a -> [a] -> [a]
: [Pair]
-> (List_account_line_itemsParametersQueryState -> [Pair])
-> Maybe List_account_line_itemsParametersQueryState
-> [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_account_line_itemsParametersQueryState -> Pair)
-> List_account_line_itemsParametersQueryState
-> [Pair]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"queryState" Key -> List_account_line_itemsParametersQueryState -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..=)) (List_account_line_itemsParameters
-> Maybe List_account_line_itemsParametersQueryState
list_account_line_itemsParametersQueryState List_account_line_itemsParameters
obj) [Pair] -> [[Pair]] -> [[Pair]]
forall a. a -> [a] -> [a]
: [Pair]
-> (List_account_line_itemsParametersQueryType -> [Pair])
-> Maybe List_account_line_itemsParametersQueryType
-> [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_account_line_itemsParametersQueryType -> Pair)
-> List_account_line_itemsParametersQueryType
-> [Pair]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"queryType" Key -> List_account_line_itemsParametersQueryType -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..=)) (List_account_line_itemsParameters
-> Maybe List_account_line_itemsParametersQueryType
list_account_line_itemsParametersQueryType List_account_line_itemsParameters
obj) [Pair] -> [[Pair]] -> [[Pair]]
forall a. a -> [a] -> [a]
: [[Pair]]
forall a. Monoid a => a
GHC.Base.mempty))
    toEncoding :: List_account_line_itemsParameters -> Encoding
toEncoding List_account_line_itemsParameters
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 ([Key
"pathAccount_id" 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_account_line_itemsParameters -> Text
list_account_line_itemsParametersPathAccount_id List_account_line_itemsParameters
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
"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_account_line_itemsParameters -> Maybe JsonDateTime
list_account_line_itemsParametersQueryBegin_time List_account_line_itemsParameters
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_account_line_itemsParameters -> Maybe JsonDateTime
list_account_line_itemsParametersQueryEnd_time List_account_line_itemsParameters
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_account_line_itemsParameters -> Maybe [Text]
list_account_line_itemsParametersQueryIds List_account_line_itemsParameters
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_account_line_itemsParameters -> Maybe Int
list_account_line_itemsParametersQueryLimit List_account_line_itemsParameters
obj) [Series] -> [[Series]] -> [[Series]]
forall a. a -> [a] -> [a]
: [Series]
-> (List_account_line_itemsParametersQueryOrder -> [Series])
-> Maybe List_account_line_itemsParametersQueryOrder
-> [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_account_line_itemsParametersQueryOrder -> Series)
-> List_account_line_itemsParametersQueryOrder
-> [Series]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"queryOrder" Key -> List_account_line_itemsParametersQueryOrder -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..=)) (List_account_line_itemsParameters
-> Maybe List_account_line_itemsParametersQueryOrder
list_account_line_itemsParametersQueryOrder List_account_line_itemsParameters
obj) [Series] -> [[Series]] -> [[Series]]
forall a. a -> [a] -> [a]
: [Series]
-> (List_account_line_itemsParametersQueryOriginal -> [Series])
-> Maybe List_account_line_itemsParametersQueryOriginal
-> [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_account_line_itemsParametersQueryOriginal -> Series)
-> List_account_line_itemsParametersQueryOriginal
-> [Series]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"queryOriginal" Key -> List_account_line_itemsParametersQueryOriginal -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..=)) (List_account_line_itemsParameters
-> Maybe List_account_line_itemsParametersQueryOriginal
list_account_line_itemsParametersQueryOriginal List_account_line_itemsParameters
obj) [Series] -> [[Series]] -> [[Series]]
forall a. a -> [a] -> [a]
: [Series]
-> (List_account_line_itemsParametersQuerySort -> [Series])
-> Maybe List_account_line_itemsParametersQuerySort
-> [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_account_line_itemsParametersQuerySort -> Series)
-> List_account_line_itemsParametersQuerySort
-> [Series]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"querySort" Key -> List_account_line_itemsParametersQuerySort -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..=)) (List_account_line_itemsParameters
-> Maybe List_account_line_itemsParametersQuerySort
list_account_line_itemsParametersQuerySort List_account_line_itemsParameters
obj) [Series] -> [[Series]] -> [[Series]]
forall a. a -> [a] -> [a]
: [Series]
-> (List_account_line_itemsParametersQueryState -> [Series])
-> Maybe List_account_line_itemsParametersQueryState
-> [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_account_line_itemsParametersQueryState -> Series)
-> List_account_line_itemsParametersQueryState
-> [Series]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"queryState" Key -> List_account_line_itemsParametersQueryState -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..=)) (List_account_line_itemsParameters
-> Maybe List_account_line_itemsParametersQueryState
list_account_line_itemsParametersQueryState List_account_line_itemsParameters
obj) [Series] -> [[Series]] -> [[Series]]
forall a. a -> [a] -> [a]
: [Series]
-> (List_account_line_itemsParametersQueryType -> [Series])
-> Maybe List_account_line_itemsParametersQueryType
-> [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_account_line_itemsParametersQueryType -> Series)
-> List_account_line_itemsParametersQueryType
-> [Series]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"queryType" Key -> List_account_line_itemsParametersQueryType -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..=)) (List_account_line_itemsParameters
-> Maybe List_account_line_itemsParametersQueryType
list_account_line_itemsParametersQueryType List_account_line_itemsParameters
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_account_line_itemsParameters where
    parseJSON :: Value -> Parser List_account_line_itemsParameters
parseJSON = String
-> (Object -> Parser List_account_line_itemsParameters)
-> Value
-> Parser List_account_line_itemsParameters
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.Aeson.Types.FromJSON.withObject String
"List_account_line_itemsParameters" (\Object
obj -> ((((((((((Text
 -> Maybe JsonDateTime
 -> Maybe JsonDateTime
 -> Maybe [Text]
 -> Maybe Int
 -> Maybe List_account_line_itemsParametersQueryOrder
 -> Maybe List_account_line_itemsParametersQueryOriginal
 -> Maybe List_account_line_itemsParametersQuerySort
 -> Maybe List_account_line_itemsParametersQueryState
 -> Maybe List_account_line_itemsParametersQueryType
 -> List_account_line_itemsParameters)
-> Parser
     (Text
      -> Maybe JsonDateTime
      -> Maybe JsonDateTime
      -> Maybe [Text]
      -> Maybe Int
      -> Maybe List_account_line_itemsParametersQueryOrder
      -> Maybe List_account_line_itemsParametersQueryOriginal
      -> Maybe List_account_line_itemsParametersQuerySort
      -> Maybe List_account_line_itemsParametersQueryState
      -> Maybe List_account_line_itemsParametersQueryType
      -> List_account_line_itemsParameters)
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure Text
-> Maybe JsonDateTime
-> Maybe JsonDateTime
-> Maybe [Text]
-> Maybe Int
-> Maybe List_account_line_itemsParametersQueryOrder
-> Maybe List_account_line_itemsParametersQueryOriginal
-> Maybe List_account_line_itemsParametersQuerySort
-> Maybe List_account_line_itemsParametersQueryState
-> Maybe List_account_line_itemsParametersQueryType
-> List_account_line_itemsParameters
List_account_line_itemsParameters Parser
  (Text
   -> Maybe JsonDateTime
   -> Maybe JsonDateTime
   -> Maybe [Text]
   -> Maybe Int
   -> Maybe List_account_line_itemsParametersQueryOrder
   -> Maybe List_account_line_itemsParametersQueryOriginal
   -> Maybe List_account_line_itemsParametersQuerySort
   -> Maybe List_account_line_itemsParametersQueryState
   -> Maybe List_account_line_itemsParametersQueryType
   -> List_account_line_itemsParameters)
-> Parser Text
-> Parser
     (Maybe JsonDateTime
      -> Maybe JsonDateTime
      -> Maybe [Text]
      -> Maybe Int
      -> Maybe List_account_line_itemsParametersQueryOrder
      -> Maybe List_account_line_itemsParametersQueryOriginal
      -> Maybe List_account_line_itemsParametersQuerySort
      -> Maybe List_account_line_itemsParametersQueryState
      -> Maybe List_account_line_itemsParametersQueryType
      -> List_account_line_itemsParameters)
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 Text
forall a. FromJSON a => Object -> Key -> Parser a
Data.Aeson.Types.FromJSON..: Key
"pathAccount_id")) Parser
  (Maybe JsonDateTime
   -> Maybe JsonDateTime
   -> Maybe [Text]
   -> Maybe Int
   -> Maybe List_account_line_itemsParametersQueryOrder
   -> Maybe List_account_line_itemsParametersQueryOriginal
   -> Maybe List_account_line_itemsParametersQuerySort
   -> Maybe List_account_line_itemsParametersQueryState
   -> Maybe List_account_line_itemsParametersQueryType
   -> List_account_line_itemsParameters)
-> Parser (Maybe JsonDateTime)
-> Parser
     (Maybe JsonDateTime
      -> Maybe [Text]
      -> Maybe Int
      -> Maybe List_account_line_itemsParametersQueryOrder
      -> Maybe List_account_line_itemsParametersQueryOriginal
      -> Maybe List_account_line_itemsParametersQuerySort
      -> Maybe List_account_line_itemsParametersQueryState
      -> Maybe List_account_line_itemsParametersQueryType
      -> List_account_line_itemsParameters)
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_account_line_itemsParametersQueryOrder
   -> Maybe List_account_line_itemsParametersQueryOriginal
   -> Maybe List_account_line_itemsParametersQuerySort
   -> Maybe List_account_line_itemsParametersQueryState
   -> Maybe List_account_line_itemsParametersQueryType
   -> List_account_line_itemsParameters)
-> Parser (Maybe JsonDateTime)
-> Parser
     (Maybe [Text]
      -> Maybe Int
      -> Maybe List_account_line_itemsParametersQueryOrder
      -> Maybe List_account_line_itemsParametersQueryOriginal
      -> Maybe List_account_line_itemsParametersQuerySort
      -> Maybe List_account_line_itemsParametersQueryState
      -> Maybe List_account_line_itemsParametersQueryType
      -> List_account_line_itemsParameters)
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_account_line_itemsParametersQueryOrder
   -> Maybe List_account_line_itemsParametersQueryOriginal
   -> Maybe List_account_line_itemsParametersQuerySort
   -> Maybe List_account_line_itemsParametersQueryState
   -> Maybe List_account_line_itemsParametersQueryType
   -> List_account_line_itemsParameters)
-> Parser (Maybe [Text])
-> Parser
     (Maybe Int
      -> Maybe List_account_line_itemsParametersQueryOrder
      -> Maybe List_account_line_itemsParametersQueryOriginal
      -> Maybe List_account_line_itemsParametersQuerySort
      -> Maybe List_account_line_itemsParametersQueryState
      -> Maybe List_account_line_itemsParametersQueryType
      -> List_account_line_itemsParameters)
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_account_line_itemsParametersQueryOrder
   -> Maybe List_account_line_itemsParametersQueryOriginal
   -> Maybe List_account_line_itemsParametersQuerySort
   -> Maybe List_account_line_itemsParametersQueryState
   -> Maybe List_account_line_itemsParametersQueryType
   -> List_account_line_itemsParameters)
-> Parser (Maybe Int)
-> Parser
     (Maybe List_account_line_itemsParametersQueryOrder
      -> Maybe List_account_line_itemsParametersQueryOriginal
      -> Maybe List_account_line_itemsParametersQuerySort
      -> Maybe List_account_line_itemsParametersQueryState
      -> Maybe List_account_line_itemsParametersQueryType
      -> List_account_line_itemsParameters)
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_account_line_itemsParametersQueryOrder
   -> Maybe List_account_line_itemsParametersQueryOriginal
   -> Maybe List_account_line_itemsParametersQuerySort
   -> Maybe List_account_line_itemsParametersQueryState
   -> Maybe List_account_line_itemsParametersQueryType
   -> List_account_line_itemsParameters)
-> Parser (Maybe List_account_line_itemsParametersQueryOrder)
-> Parser
     (Maybe List_account_line_itemsParametersQueryOriginal
      -> Maybe List_account_line_itemsParametersQuerySort
      -> Maybe List_account_line_itemsParametersQueryState
      -> Maybe List_account_line_itemsParametersQueryType
      -> List_account_line_itemsParameters)
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_account_line_itemsParametersQueryOrder)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Key
"queryOrder")) Parser
  (Maybe List_account_line_itemsParametersQueryOriginal
   -> Maybe List_account_line_itemsParametersQuerySort
   -> Maybe List_account_line_itemsParametersQueryState
   -> Maybe List_account_line_itemsParametersQueryType
   -> List_account_line_itemsParameters)
-> Parser (Maybe List_account_line_itemsParametersQueryOriginal)
-> Parser
     (Maybe List_account_line_itemsParametersQuerySort
      -> Maybe List_account_line_itemsParametersQueryState
      -> Maybe List_account_line_itemsParametersQueryType
      -> List_account_line_itemsParameters)
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_account_line_itemsParametersQueryOriginal)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Key
"queryOriginal")) Parser
  (Maybe List_account_line_itemsParametersQuerySort
   -> Maybe List_account_line_itemsParametersQueryState
   -> Maybe List_account_line_itemsParametersQueryType
   -> List_account_line_itemsParameters)
-> Parser (Maybe List_account_line_itemsParametersQuerySort)
-> Parser
     (Maybe List_account_line_itemsParametersQueryState
      -> Maybe List_account_line_itemsParametersQueryType
      -> List_account_line_itemsParameters)
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_account_line_itemsParametersQuerySort)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Key
"querySort")) Parser
  (Maybe List_account_line_itemsParametersQueryState
   -> Maybe List_account_line_itemsParametersQueryType
   -> List_account_line_itemsParameters)
-> Parser (Maybe List_account_line_itemsParametersQueryState)
-> Parser
     (Maybe List_account_line_itemsParametersQueryType
      -> List_account_line_itemsParameters)
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_account_line_itemsParametersQueryState)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Key
"queryState")) Parser
  (Maybe List_account_line_itemsParametersQueryType
   -> List_account_line_itemsParameters)
-> Parser (Maybe List_account_line_itemsParametersQueryType)
-> Parser List_account_line_itemsParameters
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_account_line_itemsParametersQueryType)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Key
"queryType"))

-- | Create a new 'List_account_line_itemsParameters' with all required fields.
mkList_account_line_itemsParameters ::
    -- | 'list_account_line_itemsParametersPathAccount_id'
    Data.Text.Internal.Text ->
    List_account_line_itemsParameters
mkList_account_line_itemsParameters :: Text -> List_account_line_itemsParameters
mkList_account_line_itemsParameters Text
list_account_line_itemsParametersPathAccount_id =
    List_account_line_itemsParameters
        { list_account_line_itemsParametersPathAccount_id :: Text
list_account_line_itemsParametersPathAccount_id = Text
list_account_line_itemsParametersPathAccount_id
        , list_account_line_itemsParametersQueryBegin_time :: Maybe JsonDateTime
list_account_line_itemsParametersQueryBegin_time = Maybe JsonDateTime
forall a. Maybe a
GHC.Maybe.Nothing
        , list_account_line_itemsParametersQueryEnd_time :: Maybe JsonDateTime
list_account_line_itemsParametersQueryEnd_time = Maybe JsonDateTime
forall a. Maybe a
GHC.Maybe.Nothing
        , list_account_line_itemsParametersQueryIds :: Maybe [Text]
list_account_line_itemsParametersQueryIds = Maybe [Text]
forall a. Maybe a
GHC.Maybe.Nothing
        , list_account_line_itemsParametersQueryLimit :: Maybe Int
list_account_line_itemsParametersQueryLimit = Maybe Int
forall a. Maybe a
GHC.Maybe.Nothing
        , list_account_line_itemsParametersQueryOrder :: Maybe List_account_line_itemsParametersQueryOrder
list_account_line_itemsParametersQueryOrder = Maybe List_account_line_itemsParametersQueryOrder
forall a. Maybe a
GHC.Maybe.Nothing
        , list_account_line_itemsParametersQueryOriginal :: Maybe List_account_line_itemsParametersQueryOriginal
list_account_line_itemsParametersQueryOriginal = Maybe List_account_line_itemsParametersQueryOriginal
forall a. Maybe a
GHC.Maybe.Nothing
        , list_account_line_itemsParametersQuerySort :: Maybe List_account_line_itemsParametersQuerySort
list_account_line_itemsParametersQuerySort = Maybe List_account_line_itemsParametersQuerySort
forall a. Maybe a
GHC.Maybe.Nothing
        , list_account_line_itemsParametersQueryState :: Maybe List_account_line_itemsParametersQueryState
list_account_line_itemsParametersQueryState = Maybe List_account_line_itemsParametersQueryState
forall a. Maybe a
GHC.Maybe.Nothing
        , list_account_line_itemsParametersQueryType :: Maybe List_account_line_itemsParametersQueryType
list_account_line_itemsParametersQueryType = Maybe List_account_line_itemsParametersQueryType
forall a. Maybe a
GHC.Maybe.Nothing
        }

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

Represents the parameter named \'order\'

Sort order.
-}
data List_account_line_itemsParametersQueryOrder
    = -- | This case is used if the value encountered during decoding does not match any of the provided cases in the specification.
      List_account_line_itemsParametersQueryOrderOther 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_account_line_itemsParametersQueryOrderTyped Data.Text.Internal.Text
    | -- | Represents the JSON value @"asc"@
      List_account_line_itemsParametersQueryOrderEnumAsc
    | -- | Represents the JSON value @"desc"@
      List_account_line_itemsParametersQueryOrderEnumDesc
    deriving (Int -> List_account_line_itemsParametersQueryOrder -> ShowS
[List_account_line_itemsParametersQueryOrder] -> ShowS
List_account_line_itemsParametersQueryOrder -> String
(Int -> List_account_line_itemsParametersQueryOrder -> ShowS)
-> (List_account_line_itemsParametersQueryOrder -> String)
-> ([List_account_line_itemsParametersQueryOrder] -> ShowS)
-> Show List_account_line_itemsParametersQueryOrder
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> List_account_line_itemsParametersQueryOrder -> ShowS
showsPrec :: Int -> List_account_line_itemsParametersQueryOrder -> ShowS
$cshow :: List_account_line_itemsParametersQueryOrder -> String
show :: List_account_line_itemsParametersQueryOrder -> String
$cshowList :: [List_account_line_itemsParametersQueryOrder] -> ShowS
showList :: [List_account_line_itemsParametersQueryOrder] -> ShowS
GHC.Show.Show, List_account_line_itemsParametersQueryOrder
-> List_account_line_itemsParametersQueryOrder -> Bool
(List_account_line_itemsParametersQueryOrder
 -> List_account_line_itemsParametersQueryOrder -> Bool)
-> (List_account_line_itemsParametersQueryOrder
    -> List_account_line_itemsParametersQueryOrder -> Bool)
-> Eq List_account_line_itemsParametersQueryOrder
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: List_account_line_itemsParametersQueryOrder
-> List_account_line_itemsParametersQueryOrder -> Bool
== :: List_account_line_itemsParametersQueryOrder
-> List_account_line_itemsParametersQueryOrder -> Bool
$c/= :: List_account_line_itemsParametersQueryOrder
-> List_account_line_itemsParametersQueryOrder -> Bool
/= :: List_account_line_itemsParametersQueryOrder
-> List_account_line_itemsParametersQueryOrder -> Bool
GHC.Classes.Eq)

instance Data.Aeson.Types.ToJSON.ToJSON List_account_line_itemsParametersQueryOrder where
    toJSON :: List_account_line_itemsParametersQueryOrder -> Value
toJSON (List_account_line_itemsParametersQueryOrderOther Value
val) = Value
val
    toJSON (List_account_line_itemsParametersQueryOrderTyped Text
val) = Text -> Value
forall a. ToJSON a => a -> Value
Data.Aeson.Types.ToJSON.toJSON Text
val
    toJSON (List_account_line_itemsParametersQueryOrder
List_account_line_itemsParametersQueryOrderEnumAsc) = Value
"asc"
    toJSON (List_account_line_itemsParametersQueryOrder
List_account_line_itemsParametersQueryOrderEnumDesc) = Value
"desc"
instance Data.Aeson.Types.FromJSON.FromJSON List_account_line_itemsParametersQueryOrder where
    parseJSON :: Value -> Parser List_account_line_itemsParametersQueryOrder
parseJSON Value
val =
        List_account_line_itemsParametersQueryOrder
-> Parser List_account_line_itemsParametersQueryOrder
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_account_line_itemsParametersQueryOrder
List_account_line_itemsParametersQueryOrderEnumAsc
                | Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"desc" -> List_account_line_itemsParametersQueryOrder
List_account_line_itemsParametersQueryOrderEnumDesc
                | Bool
GHC.Base.otherwise -> Value -> List_account_line_itemsParametersQueryOrder
List_account_line_itemsParametersQueryOrderOther Value
val
            )

{- | Defines the enum schema located at @paths.\/accounts\/{account_id}\/line_items.GET.parameters.properties.queryOriginal@ in the specification.

Represents the parameter named \'original\'

Filter by original field.
-}
data List_account_line_itemsParametersQueryOriginal
    = -- | This case is used if the value encountered during decoding does not match any of the provided cases in the specification.
      List_account_line_itemsParametersQueryOriginalOther 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_account_line_itemsParametersQueryOriginalTyped Data.Text.Internal.Text
    | -- | Represents the JSON value @true@
      List_account_line_itemsParametersQueryOriginalEnumTrue
    deriving (Int -> List_account_line_itemsParametersQueryOriginal -> ShowS
[List_account_line_itemsParametersQueryOriginal] -> ShowS
List_account_line_itemsParametersQueryOriginal -> String
(Int -> List_account_line_itemsParametersQueryOriginal -> ShowS)
-> (List_account_line_itemsParametersQueryOriginal -> String)
-> ([List_account_line_itemsParametersQueryOriginal] -> ShowS)
-> Show List_account_line_itemsParametersQueryOriginal
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> List_account_line_itemsParametersQueryOriginal -> ShowS
showsPrec :: Int -> List_account_line_itemsParametersQueryOriginal -> ShowS
$cshow :: List_account_line_itemsParametersQueryOriginal -> String
show :: List_account_line_itemsParametersQueryOriginal -> String
$cshowList :: [List_account_line_itemsParametersQueryOriginal] -> ShowS
showList :: [List_account_line_itemsParametersQueryOriginal] -> ShowS
GHC.Show.Show, List_account_line_itemsParametersQueryOriginal
-> List_account_line_itemsParametersQueryOriginal -> Bool
(List_account_line_itemsParametersQueryOriginal
 -> List_account_line_itemsParametersQueryOriginal -> Bool)
-> (List_account_line_itemsParametersQueryOriginal
    -> List_account_line_itemsParametersQueryOriginal -> Bool)
-> Eq List_account_line_itemsParametersQueryOriginal
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: List_account_line_itemsParametersQueryOriginal
-> List_account_line_itemsParametersQueryOriginal -> Bool
== :: List_account_line_itemsParametersQueryOriginal
-> List_account_line_itemsParametersQueryOriginal -> Bool
$c/= :: List_account_line_itemsParametersQueryOriginal
-> List_account_line_itemsParametersQueryOriginal -> Bool
/= :: List_account_line_itemsParametersQueryOriginal
-> List_account_line_itemsParametersQueryOriginal -> Bool
GHC.Classes.Eq)

instance Data.Aeson.Types.ToJSON.ToJSON List_account_line_itemsParametersQueryOriginal where
    toJSON :: List_account_line_itemsParametersQueryOriginal -> Value
toJSON (List_account_line_itemsParametersQueryOriginalOther Value
val) = Value
val
    toJSON (List_account_line_itemsParametersQueryOriginalTyped Text
val) = Text -> Value
forall a. ToJSON a => a -> Value
Data.Aeson.Types.ToJSON.toJSON Text
val
    toJSON (List_account_line_itemsParametersQueryOriginal
List_account_line_itemsParametersQueryOriginalEnumTrue) = Bool -> Value
Data.Aeson.Types.Internal.Bool Bool
GHC.Types.True
instance Data.Aeson.Types.FromJSON.FromJSON List_account_line_itemsParametersQueryOriginal where
    parseJSON :: Value -> Parser List_account_line_itemsParametersQueryOriginal
parseJSON Value
val =
        List_account_line_itemsParametersQueryOriginal
-> Parser List_account_line_itemsParametersQueryOriginal
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_account_line_itemsParametersQueryOriginal
List_account_line_itemsParametersQueryOriginalEnumTrue
                | Bool
GHC.Base.otherwise -> Value -> List_account_line_itemsParametersQueryOriginal
List_account_line_itemsParametersQueryOriginalOther Value
val
            )

{- | Defines the enum schema located at @paths.\/accounts\/{account_id}\/line_items.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_account_line_itemsParametersQuerySort
    = -- | This case is used if the value encountered during decoding does not match any of the provided cases in the specification.
      List_account_line_itemsParametersQuerySortOther 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_account_line_itemsParametersQuerySortTyped Data.Text.Internal.Text
    | -- | Represents the JSON value @"created_at"@
      List_account_line_itemsParametersQuerySortEnumCreated_at
    | -- | Represents the JSON value @"updated_at"@
      List_account_line_itemsParametersQuerySortEnumUpdated_at
    deriving (Int -> List_account_line_itemsParametersQuerySort -> ShowS
[List_account_line_itemsParametersQuerySort] -> ShowS
List_account_line_itemsParametersQuerySort -> String
(Int -> List_account_line_itemsParametersQuerySort -> ShowS)
-> (List_account_line_itemsParametersQuerySort -> String)
-> ([List_account_line_itemsParametersQuerySort] -> ShowS)
-> Show List_account_line_itemsParametersQuerySort
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> List_account_line_itemsParametersQuerySort -> ShowS
showsPrec :: Int -> List_account_line_itemsParametersQuerySort -> ShowS
$cshow :: List_account_line_itemsParametersQuerySort -> String
show :: List_account_line_itemsParametersQuerySort -> String
$cshowList :: [List_account_line_itemsParametersQuerySort] -> ShowS
showList :: [List_account_line_itemsParametersQuerySort] -> ShowS
GHC.Show.Show, List_account_line_itemsParametersQuerySort
-> List_account_line_itemsParametersQuerySort -> Bool
(List_account_line_itemsParametersQuerySort
 -> List_account_line_itemsParametersQuerySort -> Bool)
-> (List_account_line_itemsParametersQuerySort
    -> List_account_line_itemsParametersQuerySort -> Bool)
-> Eq List_account_line_itemsParametersQuerySort
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: List_account_line_itemsParametersQuerySort
-> List_account_line_itemsParametersQuerySort -> Bool
== :: List_account_line_itemsParametersQuerySort
-> List_account_line_itemsParametersQuerySort -> Bool
$c/= :: List_account_line_itemsParametersQuerySort
-> List_account_line_itemsParametersQuerySort -> Bool
/= :: List_account_line_itemsParametersQuerySort
-> List_account_line_itemsParametersQuerySort -> Bool
GHC.Classes.Eq)

instance Data.Aeson.Types.ToJSON.ToJSON List_account_line_itemsParametersQuerySort where
    toJSON :: List_account_line_itemsParametersQuerySort -> Value
toJSON (List_account_line_itemsParametersQuerySortOther Value
val) = Value
val
    toJSON (List_account_line_itemsParametersQuerySortTyped Text
val) = Text -> Value
forall a. ToJSON a => a -> Value
Data.Aeson.Types.ToJSON.toJSON Text
val
    toJSON (List_account_line_itemsParametersQuerySort
List_account_line_itemsParametersQuerySortEnumCreated_at) = Value
"created_at"
    toJSON (List_account_line_itemsParametersQuerySort
List_account_line_itemsParametersQuerySortEnumUpdated_at) = Value
"updated_at"
instance Data.Aeson.Types.FromJSON.FromJSON List_account_line_itemsParametersQuerySort where
    parseJSON :: Value -> Parser List_account_line_itemsParametersQuerySort
parseJSON Value
val =
        List_account_line_itemsParametersQuerySort
-> Parser List_account_line_itemsParametersQuerySort
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_account_line_itemsParametersQuerySort
List_account_line_itemsParametersQuerySortEnumCreated_at
                | Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"updated_at" -> List_account_line_itemsParametersQuerySort
List_account_line_itemsParametersQuerySortEnumUpdated_at
                | Bool
GHC.Base.otherwise -> Value -> List_account_line_itemsParametersQuerySort
List_account_line_itemsParametersQuerySortOther Value
val
            )

{- | Defines the enum schema located at @paths.\/accounts\/{account_id}\/line_items.GET.parameters.properties.queryState@ in the specification.

Represents the parameter named \'state\'

Filter by state field.
-}
data List_account_line_itemsParametersQueryState
    = -- | This case is used if the value encountered during decoding does not match any of the provided cases in the specification.
      List_account_line_itemsParametersQueryStateOther 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_account_line_itemsParametersQueryStateTyped Data.Text.Internal.Text
    | -- | Represents the JSON value @"invoiced"@
      List_account_line_itemsParametersQueryStateEnumInvoiced
    | -- | Represents the JSON value @"pending"@
      List_account_line_itemsParametersQueryStateEnumPending
    deriving (Int -> List_account_line_itemsParametersQueryState -> ShowS
[List_account_line_itemsParametersQueryState] -> ShowS
List_account_line_itemsParametersQueryState -> String
(Int -> List_account_line_itemsParametersQueryState -> ShowS)
-> (List_account_line_itemsParametersQueryState -> String)
-> ([List_account_line_itemsParametersQueryState] -> ShowS)
-> Show List_account_line_itemsParametersQueryState
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> List_account_line_itemsParametersQueryState -> ShowS
showsPrec :: Int -> List_account_line_itemsParametersQueryState -> ShowS
$cshow :: List_account_line_itemsParametersQueryState -> String
show :: List_account_line_itemsParametersQueryState -> String
$cshowList :: [List_account_line_itemsParametersQueryState] -> ShowS
showList :: [List_account_line_itemsParametersQueryState] -> ShowS
GHC.Show.Show, List_account_line_itemsParametersQueryState
-> List_account_line_itemsParametersQueryState -> Bool
(List_account_line_itemsParametersQueryState
 -> List_account_line_itemsParametersQueryState -> Bool)
-> (List_account_line_itemsParametersQueryState
    -> List_account_line_itemsParametersQueryState -> Bool)
-> Eq List_account_line_itemsParametersQueryState
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: List_account_line_itemsParametersQueryState
-> List_account_line_itemsParametersQueryState -> Bool
== :: List_account_line_itemsParametersQueryState
-> List_account_line_itemsParametersQueryState -> Bool
$c/= :: List_account_line_itemsParametersQueryState
-> List_account_line_itemsParametersQueryState -> Bool
/= :: List_account_line_itemsParametersQueryState
-> List_account_line_itemsParametersQueryState -> Bool
GHC.Classes.Eq)

instance Data.Aeson.Types.ToJSON.ToJSON List_account_line_itemsParametersQueryState where
    toJSON :: List_account_line_itemsParametersQueryState -> Value
toJSON (List_account_line_itemsParametersQueryStateOther Value
val) = Value
val
    toJSON (List_account_line_itemsParametersQueryStateTyped Text
val) = Text -> Value
forall a. ToJSON a => a -> Value
Data.Aeson.Types.ToJSON.toJSON Text
val
    toJSON (List_account_line_itemsParametersQueryState
List_account_line_itemsParametersQueryStateEnumInvoiced) = Value
"invoiced"
    toJSON (List_account_line_itemsParametersQueryState
List_account_line_itemsParametersQueryStateEnumPending) = Value
"pending"
instance Data.Aeson.Types.FromJSON.FromJSON List_account_line_itemsParametersQueryState where
    parseJSON :: Value -> Parser List_account_line_itemsParametersQueryState
parseJSON Value
val =
        List_account_line_itemsParametersQueryState
-> Parser List_account_line_itemsParametersQueryState
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
"invoiced" -> List_account_line_itemsParametersQueryState
List_account_line_itemsParametersQueryStateEnumInvoiced
                | Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"pending" -> List_account_line_itemsParametersQueryState
List_account_line_itemsParametersQueryStateEnumPending
                | Bool
GHC.Base.otherwise -> Value -> List_account_line_itemsParametersQueryState
List_account_line_itemsParametersQueryStateOther Value
val
            )

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

Represents the parameter named \'type\'

Filter by type field.
-}
data List_account_line_itemsParametersQueryType
    = -- | This case is used if the value encountered during decoding does not match any of the provided cases in the specification.
      List_account_line_itemsParametersQueryTypeOther 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_account_line_itemsParametersQueryTypeTyped Data.Text.Internal.Text
    | -- | Represents the JSON value @"charge"@
      List_account_line_itemsParametersQueryTypeEnumCharge
    | -- | Represents the JSON value @"credit"@
      List_account_line_itemsParametersQueryTypeEnumCredit
    deriving (Int -> List_account_line_itemsParametersQueryType -> ShowS
[List_account_line_itemsParametersQueryType] -> ShowS
List_account_line_itemsParametersQueryType -> String
(Int -> List_account_line_itemsParametersQueryType -> ShowS)
-> (List_account_line_itemsParametersQueryType -> String)
-> ([List_account_line_itemsParametersQueryType] -> ShowS)
-> Show List_account_line_itemsParametersQueryType
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> List_account_line_itemsParametersQueryType -> ShowS
showsPrec :: Int -> List_account_line_itemsParametersQueryType -> ShowS
$cshow :: List_account_line_itemsParametersQueryType -> String
show :: List_account_line_itemsParametersQueryType -> String
$cshowList :: [List_account_line_itemsParametersQueryType] -> ShowS
showList :: [List_account_line_itemsParametersQueryType] -> ShowS
GHC.Show.Show, List_account_line_itemsParametersQueryType
-> List_account_line_itemsParametersQueryType -> Bool
(List_account_line_itemsParametersQueryType
 -> List_account_line_itemsParametersQueryType -> Bool)
-> (List_account_line_itemsParametersQueryType
    -> List_account_line_itemsParametersQueryType -> Bool)
-> Eq List_account_line_itemsParametersQueryType
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: List_account_line_itemsParametersQueryType
-> List_account_line_itemsParametersQueryType -> Bool
== :: List_account_line_itemsParametersQueryType
-> List_account_line_itemsParametersQueryType -> Bool
$c/= :: List_account_line_itemsParametersQueryType
-> List_account_line_itemsParametersQueryType -> Bool
/= :: List_account_line_itemsParametersQueryType
-> List_account_line_itemsParametersQueryType -> Bool
GHC.Classes.Eq)

instance Data.Aeson.Types.ToJSON.ToJSON List_account_line_itemsParametersQueryType where
    toJSON :: List_account_line_itemsParametersQueryType -> Value
toJSON (List_account_line_itemsParametersQueryTypeOther Value
val) = Value
val
    toJSON (List_account_line_itemsParametersQueryTypeTyped Text
val) = Text -> Value
forall a. ToJSON a => a -> Value
Data.Aeson.Types.ToJSON.toJSON Text
val
    toJSON (List_account_line_itemsParametersQueryType
List_account_line_itemsParametersQueryTypeEnumCharge) = Value
"charge"
    toJSON (List_account_line_itemsParametersQueryType
List_account_line_itemsParametersQueryTypeEnumCredit) = Value
"credit"
instance Data.Aeson.Types.FromJSON.FromJSON List_account_line_itemsParametersQueryType where
    parseJSON :: Value -> Parser List_account_line_itemsParametersQueryType
parseJSON Value
val =
        List_account_line_itemsParametersQueryType
-> Parser List_account_line_itemsParametersQueryType
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
"charge" -> List_account_line_itemsParametersQueryType
List_account_line_itemsParametersQueryTypeEnumCharge
                | Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"credit" -> List_account_line_itemsParametersQueryType
List_account_line_itemsParametersQueryTypeEnumCredit
                | Bool
GHC.Base.otherwise -> Value -> List_account_line_itemsParametersQueryType
List_account_line_itemsParametersQueryTypeOther Value
val
            )

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

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_account_line_itemsResponseError' is used.
-}
data List_account_line_itemsResponse
    = -- | Means either no matching case available or a parse error
      List_account_line_itemsResponseError GHC.Base.String
    | -- | A list of the account\'s line items.
      List_account_line_itemsResponse200 LineItemList
    | -- | Invalid or unpermitted parameter.
      List_account_line_itemsResponse400 Error
    | -- | Incorrect site ID.
      List_account_line_itemsResponse404 Error
    | -- | Unexpected error.
      List_account_line_itemsResponseDefault Error
    deriving (Int -> List_account_line_itemsResponse -> ShowS
[List_account_line_itemsResponse] -> ShowS
List_account_line_itemsResponse -> String
(Int -> List_account_line_itemsResponse -> ShowS)
-> (List_account_line_itemsResponse -> String)
-> ([List_account_line_itemsResponse] -> ShowS)
-> Show List_account_line_itemsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> List_account_line_itemsResponse -> ShowS
showsPrec :: Int -> List_account_line_itemsResponse -> ShowS
$cshow :: List_account_line_itemsResponse -> String
show :: List_account_line_itemsResponse -> String
$cshowList :: [List_account_line_itemsResponse] -> ShowS
showList :: [List_account_line_itemsResponse] -> ShowS
GHC.Show.Show, List_account_line_itemsResponse
-> List_account_line_itemsResponse -> Bool
(List_account_line_itemsResponse
 -> List_account_line_itemsResponse -> Bool)
-> (List_account_line_itemsResponse
    -> List_account_line_itemsResponse -> Bool)
-> Eq List_account_line_itemsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: List_account_line_itemsResponse
-> List_account_line_itemsResponse -> Bool
== :: List_account_line_itemsResponse
-> List_account_line_itemsResponse -> Bool
$c/= :: List_account_line_itemsResponse
-> List_account_line_itemsResponse -> Bool
/= :: List_account_line_itemsResponse
-> List_account_line_itemsResponse -> Bool
GHC.Classes.Eq)

{- | > GET /accounts/{account_id}/line_items

The same as 'list_account_line_items' but accepts an explicit configuration.
-}
list_account_line_itemsWithConfiguration ::
    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_account_line_itemsParameters ->
    -- | Monadic computation which returns the result of the operation
    m (Network.HTTP.Client.Types.Response List_account_line_itemsResponse)
list_account_line_itemsWithConfiguration :: forall (m :: * -> *).
MonadHTTP m =>
Configuration
-> List_account_line_itemsParameters
-> m (Response List_account_line_itemsResponse)
list_account_line_itemsWithConfiguration
    Configuration
config
    List_account_line_itemsParameters
parameters =
        (Response ByteString -> Response List_account_line_itemsResponse)
-> m (Response ByteString)
-> m (Response List_account_line_itemsResponse)
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_account_line_itemsResponse)
-> Response ByteString -> Response List_account_line_itemsResponse
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_account_line_itemsResponse)
-> (List_account_line_itemsResponse
    -> List_account_line_itemsResponse)
-> Either String List_account_line_itemsResponse
-> List_account_line_itemsResponse
forall a c b. (a -> c) -> (b -> c) -> Either a b -> c
Data.Either.either String -> List_account_line_itemsResponse
List_account_line_itemsResponseError List_account_line_itemsResponse -> List_account_line_itemsResponse
forall a. a -> a
GHC.Base.id
                        (Either String List_account_line_itemsResponse
 -> List_account_line_itemsResponse)
-> (ByteString -> Either String List_account_line_itemsResponse)
-> ByteString
-> List_account_line_itemsResponse
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) ->
                                                LineItemList -> List_account_line_itemsResponse
List_account_line_itemsResponse200
                                                    (LineItemList -> List_account_line_itemsResponse)
-> Either String LineItemList
-> Either String List_account_line_itemsResponse
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Data.Functor.<$> ( ByteString -> Either String LineItemList
forall a. FromJSON a => ByteString -> Either String a
Data.Aeson.eitherDecodeStrict ByteString
body ::
                                                                        Data.Either.Either
                                                                            GHC.Base.String
                                                                            LineItemList
                                                                     )
                                            | (\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_account_line_itemsResponse
List_account_line_itemsResponse400
                                                    (Error -> List_account_line_itemsResponse)
-> Either String Error
-> Either String List_account_line_itemsResponse
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_account_line_itemsResponse
List_account_line_itemsResponse404
                                                    (Error -> List_account_line_itemsResponse)
-> Either String Error
-> Either String List_account_line_itemsResponse
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_account_line_itemsResponse
List_account_line_itemsResponseDefault
                                                    (Error -> List_account_line_itemsResponse)
-> Either String Error
-> Either String List_account_line_itemsResponse
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_account_line_itemsResponse
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
"/accounts/" Text -> Text -> Text
forall a. Semigroup a => a -> a -> a
GHC.Base.<> (ByteString -> Text
RecurlyClient.Common.byteToText (Bool -> ByteString -> ByteString
Network.HTTP.Types.URI.urlEncode Bool
GHC.Types.True (ByteString -> ByteString) -> ByteString -> ByteString
forall a b. (a -> b) -> a -> b
GHC.Base.$ (Text -> ByteString
RecurlyClient.Common.textToByte (Text -> ByteString) -> Text -> ByteString
forall a b. (a -> b) -> a -> b
GHC.Base.$ Text -> Text
forall a. ToJSON a => a -> Text
RecurlyClient.Common.stringifyModel (List_account_line_itemsParameters -> Text
list_account_line_itemsParametersPathAccount_id List_account_line_itemsParameters
parameters))) Text -> Text -> Text
forall a. Semigroup a => a -> a -> a
GHC.Base.<> Text
"/line_items"))
                [ 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_account_line_itemsParameters -> Maybe [Text]
list_account_line_itemsParametersQueryIds List_account_line_itemsParameters
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_account_line_itemsParameters -> Maybe Int
list_account_line_itemsParametersQueryLimit List_account_line_itemsParameters
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_account_line_itemsParametersQueryOrder -> Value
forall a. ToJSON a => a -> Value
Data.Aeson.Types.ToJSON.toJSON (List_account_line_itemsParametersQueryOrder -> Value)
-> Maybe List_account_line_itemsParametersQueryOrder -> Maybe Value
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Data.Functor.<$> List_account_line_itemsParameters
-> Maybe List_account_line_itemsParametersQueryOrder
list_account_line_itemsParametersQueryOrder List_account_line_itemsParameters
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_account_line_itemsParametersQuerySort -> Value
forall a. ToJSON a => a -> Value
Data.Aeson.Types.ToJSON.toJSON (List_account_line_itemsParametersQuerySort -> Value)
-> Maybe List_account_line_itemsParametersQuerySort -> Maybe Value
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Data.Functor.<$> List_account_line_itemsParameters
-> Maybe List_account_line_itemsParametersQuerySort
list_account_line_itemsParametersQuerySort List_account_line_itemsParameters
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_account_line_itemsParameters -> Maybe JsonDateTime
list_account_line_itemsParametersQueryBegin_time List_account_line_itemsParameters
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_account_line_itemsParameters -> Maybe JsonDateTime
list_account_line_itemsParametersQueryEnd_time List_account_line_itemsParameters
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
"original") (List_account_line_itemsParametersQueryOriginal -> Value
forall a. ToJSON a => a -> Value
Data.Aeson.Types.ToJSON.toJSON (List_account_line_itemsParametersQueryOriginal -> Value)
-> Maybe List_account_line_itemsParametersQueryOriginal
-> Maybe Value
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Data.Functor.<$> List_account_line_itemsParameters
-> Maybe List_account_line_itemsParametersQueryOriginal
list_account_line_itemsParametersQueryOriginal List_account_line_itemsParameters
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
"state") (List_account_line_itemsParametersQueryState -> Value
forall a. ToJSON a => a -> Value
Data.Aeson.Types.ToJSON.toJSON (List_account_line_itemsParametersQueryState -> Value)
-> Maybe List_account_line_itemsParametersQueryState -> Maybe Value
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Data.Functor.<$> List_account_line_itemsParameters
-> Maybe List_account_line_itemsParametersQueryState
list_account_line_itemsParametersQueryState List_account_line_itemsParameters
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_account_line_itemsParametersQueryType -> Value
forall a. ToJSON a => a -> Value
Data.Aeson.Types.ToJSON.toJSON (List_account_line_itemsParametersQueryType -> Value)
-> Maybe List_account_line_itemsParametersQueryType -> Maybe Value
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Data.Functor.<$> List_account_line_itemsParameters
-> Maybe List_account_line_itemsParametersQueryType
list_account_line_itemsParametersQueryType List_account_line_itemsParameters
parameters) (String -> Text
Data.Text.Internal.pack String
"form") Bool
GHC.Types.False
                ]
            )

{- | > GET /accounts/{account_id}/line_items

The same as 'list_account_line_items' but returns the raw 'Data.ByteString.ByteString'.
-}
list_account_line_itemsRaw ::
    forall m.
    (RecurlyClient.Common.MonadHTTP m) =>
    -- | Contains all available parameters of this operation (query and path parameters)
    List_account_line_itemsParameters ->
    -- | Monadic computation which returns the result of the operation
    RecurlyClient.Common.ClientT m (Network.HTTP.Client.Types.Response Data.ByteString.Internal.Type.ByteString)
list_account_line_itemsRaw :: forall (m :: * -> *).
MonadHTTP m =>
List_account_line_itemsParameters
-> ClientT m (Response ByteString)
list_account_line_itemsRaw List_account_line_itemsParameters
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
"/accounts/" Text -> Text -> Text
forall a. Semigroup a => a -> a -> a
GHC.Base.<> (ByteString -> Text
RecurlyClient.Common.byteToText (Bool -> ByteString -> ByteString
Network.HTTP.Types.URI.urlEncode Bool
GHC.Types.True (ByteString -> ByteString) -> ByteString -> ByteString
forall a b. (a -> b) -> a -> b
GHC.Base.$ (Text -> ByteString
RecurlyClient.Common.textToByte (Text -> ByteString) -> Text -> ByteString
forall a b. (a -> b) -> a -> b
GHC.Base.$ Text -> Text
forall a. ToJSON a => a -> Text
RecurlyClient.Common.stringifyModel (List_account_line_itemsParameters -> Text
list_account_line_itemsParametersPathAccount_id List_account_line_itemsParameters
parameters))) Text -> Text -> Text
forall a. Semigroup a => a -> a -> a
GHC.Base.<> Text
"/line_items"))
            [ 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_account_line_itemsParameters -> Maybe [Text]
list_account_line_itemsParametersQueryIds List_account_line_itemsParameters
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_account_line_itemsParameters -> Maybe Int
list_account_line_itemsParametersQueryLimit List_account_line_itemsParameters
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_account_line_itemsParametersQueryOrder -> Value
forall a. ToJSON a => a -> Value
Data.Aeson.Types.ToJSON.toJSON (List_account_line_itemsParametersQueryOrder -> Value)
-> Maybe List_account_line_itemsParametersQueryOrder -> Maybe Value
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Data.Functor.<$> List_account_line_itemsParameters
-> Maybe List_account_line_itemsParametersQueryOrder
list_account_line_itemsParametersQueryOrder List_account_line_itemsParameters
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_account_line_itemsParametersQuerySort -> Value
forall a. ToJSON a => a -> Value
Data.Aeson.Types.ToJSON.toJSON (List_account_line_itemsParametersQuerySort -> Value)
-> Maybe List_account_line_itemsParametersQuerySort -> Maybe Value
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Data.Functor.<$> List_account_line_itemsParameters
-> Maybe List_account_line_itemsParametersQuerySort
list_account_line_itemsParametersQuerySort List_account_line_itemsParameters
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_account_line_itemsParameters -> Maybe JsonDateTime
list_account_line_itemsParametersQueryBegin_time List_account_line_itemsParameters
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_account_line_itemsParameters -> Maybe JsonDateTime
list_account_line_itemsParametersQueryEnd_time List_account_line_itemsParameters
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
"original") (List_account_line_itemsParametersQueryOriginal -> Value
forall a. ToJSON a => a -> Value
Data.Aeson.Types.ToJSON.toJSON (List_account_line_itemsParametersQueryOriginal -> Value)
-> Maybe List_account_line_itemsParametersQueryOriginal
-> Maybe Value
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Data.Functor.<$> List_account_line_itemsParameters
-> Maybe List_account_line_itemsParametersQueryOriginal
list_account_line_itemsParametersQueryOriginal List_account_line_itemsParameters
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
"state") (List_account_line_itemsParametersQueryState -> Value
forall a. ToJSON a => a -> Value
Data.Aeson.Types.ToJSON.toJSON (List_account_line_itemsParametersQueryState -> Value)
-> Maybe List_account_line_itemsParametersQueryState -> Maybe Value
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Data.Functor.<$> List_account_line_itemsParameters
-> Maybe List_account_line_itemsParametersQueryState
list_account_line_itemsParametersQueryState List_account_line_itemsParameters
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_account_line_itemsParametersQueryType -> Value
forall a. ToJSON a => a -> Value
Data.Aeson.Types.ToJSON.toJSON (List_account_line_itemsParametersQueryType -> Value)
-> Maybe List_account_line_itemsParametersQueryType -> Maybe Value
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Data.Functor.<$> List_account_line_itemsParameters
-> Maybe List_account_line_itemsParametersQueryType
list_account_line_itemsParametersQueryType List_account_line_itemsParameters
parameters) (String -> Text
Data.Text.Internal.pack String
"form") Bool
GHC.Types.False
            ]
        )

{- | > GET /accounts/{account_id}/line_items

The same as 'list_account_line_items' but accepts an explicit configuration and returns the raw 'Data.ByteString.ByteString'.
-}
list_account_line_itemsWithConfigurationRaw ::
    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_account_line_itemsParameters ->
    -- | Monadic computation which returns the result of the operation
    m (Network.HTTP.Client.Types.Response Data.ByteString.Internal.Type.ByteString)
list_account_line_itemsWithConfigurationRaw :: forall (m :: * -> *).
MonadHTTP m =>
Configuration
-> List_account_line_itemsParameters -> m (Response ByteString)
list_account_line_itemsWithConfigurationRaw
    Configuration
config
    List_account_line_itemsParameters
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
"/accounts/" Text -> Text -> Text
forall a. Semigroup a => a -> a -> a
GHC.Base.<> (ByteString -> Text
RecurlyClient.Common.byteToText (Bool -> ByteString -> ByteString
Network.HTTP.Types.URI.urlEncode Bool
GHC.Types.True (ByteString -> ByteString) -> ByteString -> ByteString
forall a b. (a -> b) -> a -> b
GHC.Base.$ (Text -> ByteString
RecurlyClient.Common.textToByte (Text -> ByteString) -> Text -> ByteString
forall a b. (a -> b) -> a -> b
GHC.Base.$ Text -> Text
forall a. ToJSON a => a -> Text
RecurlyClient.Common.stringifyModel (List_account_line_itemsParameters -> Text
list_account_line_itemsParametersPathAccount_id List_account_line_itemsParameters
parameters))) Text -> Text -> Text
forall a. Semigroup a => a -> a -> a
GHC.Base.<> Text
"/line_items"))
                [ 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_account_line_itemsParameters -> Maybe [Text]
list_account_line_itemsParametersQueryIds List_account_line_itemsParameters
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_account_line_itemsParameters -> Maybe Int
list_account_line_itemsParametersQueryLimit List_account_line_itemsParameters
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_account_line_itemsParametersQueryOrder -> Value
forall a. ToJSON a => a -> Value
Data.Aeson.Types.ToJSON.toJSON (List_account_line_itemsParametersQueryOrder -> Value)
-> Maybe List_account_line_itemsParametersQueryOrder -> Maybe Value
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Data.Functor.<$> List_account_line_itemsParameters
-> Maybe List_account_line_itemsParametersQueryOrder
list_account_line_itemsParametersQueryOrder List_account_line_itemsParameters
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_account_line_itemsParametersQuerySort -> Value
forall a. ToJSON a => a -> Value
Data.Aeson.Types.ToJSON.toJSON (List_account_line_itemsParametersQuerySort -> Value)
-> Maybe List_account_line_itemsParametersQuerySort -> Maybe Value
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Data.Functor.<$> List_account_line_itemsParameters
-> Maybe List_account_line_itemsParametersQuerySort
list_account_line_itemsParametersQuerySort List_account_line_itemsParameters
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_account_line_itemsParameters -> Maybe JsonDateTime
list_account_line_itemsParametersQueryBegin_time List_account_line_itemsParameters
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_account_line_itemsParameters -> Maybe JsonDateTime
list_account_line_itemsParametersQueryEnd_time List_account_line_itemsParameters
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
"original") (List_account_line_itemsParametersQueryOriginal -> Value
forall a. ToJSON a => a -> Value
Data.Aeson.Types.ToJSON.toJSON (List_account_line_itemsParametersQueryOriginal -> Value)
-> Maybe List_account_line_itemsParametersQueryOriginal
-> Maybe Value
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Data.Functor.<$> List_account_line_itemsParameters
-> Maybe List_account_line_itemsParametersQueryOriginal
list_account_line_itemsParametersQueryOriginal List_account_line_itemsParameters
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
"state") (List_account_line_itemsParametersQueryState -> Value
forall a. ToJSON a => a -> Value
Data.Aeson.Types.ToJSON.toJSON (List_account_line_itemsParametersQueryState -> Value)
-> Maybe List_account_line_itemsParametersQueryState -> Maybe Value
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Data.Functor.<$> List_account_line_itemsParameters
-> Maybe List_account_line_itemsParametersQueryState
list_account_line_itemsParametersQueryState List_account_line_itemsParameters
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_account_line_itemsParametersQueryType -> Value
forall a. ToJSON a => a -> Value
Data.Aeson.Types.ToJSON.toJSON (List_account_line_itemsParametersQueryType -> Value)
-> Maybe List_account_line_itemsParametersQueryType -> Maybe Value
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Data.Functor.<$> List_account_line_itemsParameters
-> Maybe List_account_line_itemsParametersQueryType
list_account_line_itemsParametersQueryType List_account_line_itemsParameters
parameters) (String -> Text
Data.Text.Internal.pack String
"form") Bool
GHC.Types.False
                ]
            )