{-# 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_invoice_template_accounts
module RecurlyClient.Operations.List_invoice_template_accounts 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 /invoice_templates/{invoice_template_id}/accounts

See the [Pagination Guide](\/developers\/guides\/pagination.html) to learn how to use pagination in the API and Client Libraries.
-}
list_invoice_template_accounts ::
    forall m.
    (RecurlyClient.Common.MonadHTTP m) =>
    -- | Contains all available parameters of this operation (query and path parameters)
    List_invoice_template_accountsParameters ->
    -- | Monadic computation which returns the result of the operation
    RecurlyClient.Common.ClientT m (Network.HTTP.Client.Types.Response List_invoice_template_accountsResponse)
list_invoice_template_accounts :: forall (m :: * -> *).
MonadHTTP m =>
List_invoice_template_accountsParameters
-> ClientT m (Response List_invoice_template_accountsResponse)
list_invoice_template_accounts List_invoice_template_accountsParameters
parameters =
    (Response ByteString
 -> Response List_invoice_template_accountsResponse)
-> ClientT m (Response ByteString)
-> ClientT m (Response List_invoice_template_accountsResponse)
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_invoice_template_accountsResponse)
-> Response ByteString
-> Response List_invoice_template_accountsResponse
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_invoice_template_accountsResponse)
-> (List_invoice_template_accountsResponse
    -> List_invoice_template_accountsResponse)
-> Either String List_invoice_template_accountsResponse
-> List_invoice_template_accountsResponse
forall a c b. (a -> c) -> (b -> c) -> Either a b -> c
Data.Either.either String -> List_invoice_template_accountsResponse
List_invoice_template_accountsResponseError List_invoice_template_accountsResponse
-> List_invoice_template_accountsResponse
forall a. a -> a
GHC.Base.id
                    (Either String List_invoice_template_accountsResponse
 -> List_invoice_template_accountsResponse)
-> (ByteString
    -> Either String List_invoice_template_accountsResponse)
-> ByteString
-> List_invoice_template_accountsResponse
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) ->
                                            AccountList -> List_invoice_template_accountsResponse
List_invoice_template_accountsResponse200
                                                (AccountList -> List_invoice_template_accountsResponse)
-> Either String AccountList
-> Either String List_invoice_template_accountsResponse
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Data.Functor.<$> ( ByteString -> Either String AccountList
forall a. FromJSON a => ByteString -> Either String a
Data.Aeson.eitherDecodeStrict ByteString
body ::
                                                                    Data.Either.Either
                                                                        GHC.Base.String
                                                                        AccountList
                                                                 )
                                        | (\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_invoice_template_accountsResponse
List_invoice_template_accountsResponse400
                                                (Error -> List_invoice_template_accountsResponse)
-> Either String Error
-> Either String List_invoice_template_accountsResponse
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_invoice_template_accountsResponse
List_invoice_template_accountsResponse404
                                                (Error -> List_invoice_template_accountsResponse)
-> Either String Error
-> Either String List_invoice_template_accountsResponse
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_invoice_template_accountsResponse
List_invoice_template_accountsResponseDefault
                                                (Error -> List_invoice_template_accountsResponse)
-> Either String Error
-> Either String List_invoice_template_accountsResponse
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_invoice_template_accountsResponse
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
"/invoice_templates/" 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_invoice_template_accountsParameters -> Text
list_invoice_template_accountsParametersPathInvoice_template_id List_invoice_template_accountsParameters
parameters))) Text -> Text -> Text
forall a. Semigroup a => a -> a -> a
GHC.Base.<> Text
"/accounts"))
            [ 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_invoice_template_accountsParameters -> Maybe [Text]
list_invoice_template_accountsParametersQueryIds List_invoice_template_accountsParameters
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_invoice_template_accountsParameters -> Maybe Int
list_invoice_template_accountsParametersQueryLimit List_invoice_template_accountsParameters
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_invoice_template_accountsParametersQueryOrder -> Value
forall a. ToJSON a => a -> Value
Data.Aeson.Types.ToJSON.toJSON (List_invoice_template_accountsParametersQueryOrder -> Value)
-> Maybe List_invoice_template_accountsParametersQueryOrder
-> Maybe Value
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Data.Functor.<$> List_invoice_template_accountsParameters
-> Maybe List_invoice_template_accountsParametersQueryOrder
list_invoice_template_accountsParametersQueryOrder List_invoice_template_accountsParameters
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_invoice_template_accountsParametersQuerySort -> Value
forall a. ToJSON a => a -> Value
Data.Aeson.Types.ToJSON.toJSON (List_invoice_template_accountsParametersQuerySort -> Value)
-> Maybe List_invoice_template_accountsParametersQuerySort
-> Maybe Value
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Data.Functor.<$> List_invoice_template_accountsParameters
-> Maybe List_invoice_template_accountsParametersQuerySort
list_invoice_template_accountsParametersQuerySort List_invoice_template_accountsParameters
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_invoice_template_accountsParameters -> Maybe JsonDateTime
list_invoice_template_accountsParametersQueryBegin_time List_invoice_template_accountsParameters
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_invoice_template_accountsParameters -> Maybe JsonDateTime
list_invoice_template_accountsParametersQueryEnd_time List_invoice_template_accountsParameters
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
"email") (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_invoice_template_accountsParameters -> Maybe Text
list_invoice_template_accountsParametersQueryEmail List_invoice_template_accountsParameters
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
"subscriber") (Bool -> Value
forall a. ToJSON a => a -> Value
Data.Aeson.Types.ToJSON.toJSON (Bool -> Value) -> Maybe Bool -> Maybe Value
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Data.Functor.<$> List_invoice_template_accountsParameters -> Maybe Bool
list_invoice_template_accountsParametersQuerySubscriber List_invoice_template_accountsParameters
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
"past_due") (List_invoice_template_accountsParametersQueryPast_due -> Value
forall a. ToJSON a => a -> Value
Data.Aeson.Types.ToJSON.toJSON (List_invoice_template_accountsParametersQueryPast_due -> Value)
-> Maybe List_invoice_template_accountsParametersQueryPast_due
-> Maybe Value
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Data.Functor.<$> List_invoice_template_accountsParameters
-> Maybe List_invoice_template_accountsParametersQueryPast_due
list_invoice_template_accountsParametersQueryPast_due List_invoice_template_accountsParameters
parameters) (String -> Text
Data.Text.Internal.pack String
"form") Bool
GHC.Types.False
            ]
        )

-- | Defines the object schema located at @paths.\/invoice_templates\/{invoice_template_id}\/accounts.GET.parameters@ in the specification.
data List_invoice_template_accountsParameters = List_invoice_template_accountsParameters
    { List_invoice_template_accountsParameters -> Text
list_invoice_template_accountsParametersPathInvoice_template_id :: Data.Text.Internal.Text
    -- ^ pathInvoice_template_id: Represents the parameter named \'invoice_template_id\'
    --
    -- Invoice template ID or code. For ID no prefix is used e.g. \`e28zov4fw0v2\`. For code use prefix \`code-\`, e.g. \`code-bob\`.
    , List_invoice_template_accountsParameters -> Maybe JsonDateTime
list_invoice_template_accountsParametersQueryBegin_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_invoice_template_accountsParameters -> Maybe Text
list_invoice_template_accountsParametersQueryEmail :: (GHC.Maybe.Maybe Data.Text.Internal.Text)
    -- ^ queryEmail: Represents the parameter named \'email\'
    --
    -- Filter for accounts with this exact email address. A blank value will return accounts with both \`null\` and \`\"\"\` email addresses. Note that multiple accounts can share one email address.
    , List_invoice_template_accountsParameters -> Maybe JsonDateTime
list_invoice_template_accountsParametersQueryEnd_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_invoice_template_accountsParameters -> Maybe [Text]
list_invoice_template_accountsParametersQueryIds :: (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_invoice_template_accountsParameters -> Maybe Int
list_invoice_template_accountsParametersQueryLimit :: (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_invoice_template_accountsParameters
-> Maybe List_invoice_template_accountsParametersQueryOrder
list_invoice_template_accountsParametersQueryOrder :: (GHC.Maybe.Maybe List_invoice_template_accountsParametersQueryOrder)
    -- ^ queryOrder: Represents the parameter named \'order\'
    --
    -- Sort order.
    , List_invoice_template_accountsParameters
-> Maybe List_invoice_template_accountsParametersQueryPast_due
list_invoice_template_accountsParametersQueryPast_due :: (GHC.Maybe.Maybe List_invoice_template_accountsParametersQueryPast_due)
    -- ^ queryPast_due: Represents the parameter named \'past_due\'
    --
    -- Filter for accounts with an invoice in the \`past_due\` state.
    , List_invoice_template_accountsParameters
-> Maybe List_invoice_template_accountsParametersQuerySort
list_invoice_template_accountsParametersQuerySort :: (GHC.Maybe.Maybe List_invoice_template_accountsParametersQuerySort)
    -- ^ 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_invoice_template_accountsParameters -> Maybe Bool
list_invoice_template_accountsParametersQuerySubscriber :: (GHC.Maybe.Maybe GHC.Types.Bool)
    -- ^ querySubscriber: Represents the parameter named \'subscriber\'
    --
    -- Filter for accounts with or without a subscription in the \`active\`,
    -- \`canceled\`, or \`future\` state.
    }
    deriving
        ( Int -> List_invoice_template_accountsParameters -> ShowS
[List_invoice_template_accountsParameters] -> ShowS
List_invoice_template_accountsParameters -> String
(Int -> List_invoice_template_accountsParameters -> ShowS)
-> (List_invoice_template_accountsParameters -> String)
-> ([List_invoice_template_accountsParameters] -> ShowS)
-> Show List_invoice_template_accountsParameters
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> List_invoice_template_accountsParameters -> ShowS
showsPrec :: Int -> List_invoice_template_accountsParameters -> ShowS
$cshow :: List_invoice_template_accountsParameters -> String
show :: List_invoice_template_accountsParameters -> String
$cshowList :: [List_invoice_template_accountsParameters] -> ShowS
showList :: [List_invoice_template_accountsParameters] -> ShowS
GHC.Show.Show
        , List_invoice_template_accountsParameters
-> List_invoice_template_accountsParameters -> Bool
(List_invoice_template_accountsParameters
 -> List_invoice_template_accountsParameters -> Bool)
-> (List_invoice_template_accountsParameters
    -> List_invoice_template_accountsParameters -> Bool)
-> Eq List_invoice_template_accountsParameters
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: List_invoice_template_accountsParameters
-> List_invoice_template_accountsParameters -> Bool
== :: List_invoice_template_accountsParameters
-> List_invoice_template_accountsParameters -> Bool
$c/= :: List_invoice_template_accountsParameters
-> List_invoice_template_accountsParameters -> Bool
/= :: List_invoice_template_accountsParameters
-> List_invoice_template_accountsParameters -> Bool
GHC.Classes.Eq
        )

instance Data.Aeson.Types.ToJSON.ToJSON List_invoice_template_accountsParameters where
    toJSON :: List_invoice_template_accountsParameters -> Value
toJSON List_invoice_template_accountsParameters
obj = [Pair] -> Value
Data.Aeson.Types.Internal.object ([[Pair]] -> [Pair]
forall (t :: * -> *) a. Foldable t => t [a] -> [a]
Data.Foldable.concat ([Key
"pathInvoice_template_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_invoice_template_accountsParameters -> Text
list_invoice_template_accountsParametersPathInvoice_template_id List_invoice_template_accountsParameters
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_invoice_template_accountsParameters -> Maybe JsonDateTime
list_invoice_template_accountsParametersQueryBegin_time List_invoice_template_accountsParameters
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
"queryEmail" 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_invoice_template_accountsParameters -> Maybe Text
list_invoice_template_accountsParametersQueryEmail List_invoice_template_accountsParameters
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_invoice_template_accountsParameters -> Maybe JsonDateTime
list_invoice_template_accountsParametersQueryEnd_time List_invoice_template_accountsParameters
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_invoice_template_accountsParameters -> Maybe [Text]
list_invoice_template_accountsParametersQueryIds List_invoice_template_accountsParameters
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_invoice_template_accountsParameters -> Maybe Int
list_invoice_template_accountsParametersQueryLimit List_invoice_template_accountsParameters
obj) [Pair] -> [[Pair]] -> [[Pair]]
forall a. a -> [a] -> [a]
: [Pair]
-> (List_invoice_template_accountsParametersQueryOrder -> [Pair])
-> Maybe List_invoice_template_accountsParametersQueryOrder
-> [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_invoice_template_accountsParametersQueryOrder -> Pair)
-> List_invoice_template_accountsParametersQueryOrder
-> [Pair]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"queryOrder" Key -> List_invoice_template_accountsParametersQueryOrder -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..=)) (List_invoice_template_accountsParameters
-> Maybe List_invoice_template_accountsParametersQueryOrder
list_invoice_template_accountsParametersQueryOrder List_invoice_template_accountsParameters
obj) [Pair] -> [[Pair]] -> [[Pair]]
forall a. a -> [a] -> [a]
: [Pair]
-> (List_invoice_template_accountsParametersQueryPast_due
    -> [Pair])
-> Maybe List_invoice_template_accountsParametersQueryPast_due
-> [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_invoice_template_accountsParametersQueryPast_due -> Pair)
-> List_invoice_template_accountsParametersQueryPast_due
-> [Pair]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"queryPast_due" Key
-> List_invoice_template_accountsParametersQueryPast_due -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..=)) (List_invoice_template_accountsParameters
-> Maybe List_invoice_template_accountsParametersQueryPast_due
list_invoice_template_accountsParametersQueryPast_due List_invoice_template_accountsParameters
obj) [Pair] -> [[Pair]] -> [[Pair]]
forall a. a -> [a] -> [a]
: [Pair]
-> (List_invoice_template_accountsParametersQuerySort -> [Pair])
-> Maybe List_invoice_template_accountsParametersQuerySort
-> [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_invoice_template_accountsParametersQuerySort -> Pair)
-> List_invoice_template_accountsParametersQuerySort
-> [Pair]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"querySort" Key -> List_invoice_template_accountsParametersQuerySort -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..=)) (List_invoice_template_accountsParameters
-> Maybe List_invoice_template_accountsParametersQuerySort
list_invoice_template_accountsParametersQuerySort List_invoice_template_accountsParameters
obj) [Pair] -> [[Pair]] -> [[Pair]]
forall a. a -> [a] -> [a]
: [Pair] -> (Bool -> [Pair]) -> Maybe Bool -> [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]) -> (Bool -> Pair) -> Bool -> [Pair]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"querySubscriber" Key -> Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..=)) (List_invoice_template_accountsParameters -> Maybe Bool
list_invoice_template_accountsParametersQuerySubscriber List_invoice_template_accountsParameters
obj) [Pair] -> [[Pair]] -> [[Pair]]
forall a. a -> [a] -> [a]
: [[Pair]]
forall a. Monoid a => a
GHC.Base.mempty))
    toEncoding :: List_invoice_template_accountsParameters -> Encoding
toEncoding List_invoice_template_accountsParameters
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
"pathInvoice_template_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_invoice_template_accountsParameters -> Text
list_invoice_template_accountsParametersPathInvoice_template_id List_invoice_template_accountsParameters
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_invoice_template_accountsParameters -> Maybe JsonDateTime
list_invoice_template_accountsParametersQueryBegin_time List_invoice_template_accountsParameters
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
"queryEmail" 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_invoice_template_accountsParameters -> Maybe Text
list_invoice_template_accountsParametersQueryEmail List_invoice_template_accountsParameters
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_invoice_template_accountsParameters -> Maybe JsonDateTime
list_invoice_template_accountsParametersQueryEnd_time List_invoice_template_accountsParameters
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_invoice_template_accountsParameters -> Maybe [Text]
list_invoice_template_accountsParametersQueryIds List_invoice_template_accountsParameters
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_invoice_template_accountsParameters -> Maybe Int
list_invoice_template_accountsParametersQueryLimit List_invoice_template_accountsParameters
obj) [Series] -> [[Series]] -> [[Series]]
forall a. a -> [a] -> [a]
: [Series]
-> (List_invoice_template_accountsParametersQueryOrder -> [Series])
-> Maybe List_invoice_template_accountsParametersQueryOrder
-> [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_invoice_template_accountsParametersQueryOrder -> Series)
-> List_invoice_template_accountsParametersQueryOrder
-> [Series]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"queryOrder" Key -> List_invoice_template_accountsParametersQueryOrder -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..=)) (List_invoice_template_accountsParameters
-> Maybe List_invoice_template_accountsParametersQueryOrder
list_invoice_template_accountsParametersQueryOrder List_invoice_template_accountsParameters
obj) [Series] -> [[Series]] -> [[Series]]
forall a. a -> [a] -> [a]
: [Series]
-> (List_invoice_template_accountsParametersQueryPast_due
    -> [Series])
-> Maybe List_invoice_template_accountsParametersQueryPast_due
-> [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_invoice_template_accountsParametersQueryPast_due
    -> Series)
-> List_invoice_template_accountsParametersQueryPast_due
-> [Series]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"queryPast_due" Key
-> List_invoice_template_accountsParametersQueryPast_due -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..=)) (List_invoice_template_accountsParameters
-> Maybe List_invoice_template_accountsParametersQueryPast_due
list_invoice_template_accountsParametersQueryPast_due List_invoice_template_accountsParameters
obj) [Series] -> [[Series]] -> [[Series]]
forall a. a -> [a] -> [a]
: [Series]
-> (List_invoice_template_accountsParametersQuerySort -> [Series])
-> Maybe List_invoice_template_accountsParametersQuerySort
-> [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_invoice_template_accountsParametersQuerySort -> Series)
-> List_invoice_template_accountsParametersQuerySort
-> [Series]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"querySort" Key -> List_invoice_template_accountsParametersQuerySort -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..=)) (List_invoice_template_accountsParameters
-> Maybe List_invoice_template_accountsParametersQuerySort
list_invoice_template_accountsParametersQuerySort List_invoice_template_accountsParameters
obj) [Series] -> [[Series]] -> [[Series]]
forall a. a -> [a] -> [a]
: [Series] -> (Bool -> [Series]) -> Maybe Bool -> [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]) -> (Bool -> Series) -> Bool -> [Series]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"querySubscriber" Key -> Bool -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..=)) (List_invoice_template_accountsParameters -> Maybe Bool
list_invoice_template_accountsParametersQuerySubscriber List_invoice_template_accountsParameters
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_invoice_template_accountsParameters where
    parseJSON :: Value -> Parser List_invoice_template_accountsParameters
parseJSON = String
-> (Object -> Parser List_invoice_template_accountsParameters)
-> Value
-> Parser List_invoice_template_accountsParameters
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.Aeson.Types.FromJSON.withObject String
"List_invoice_template_accountsParameters" (\Object
obj -> ((((((((((Text
 -> Maybe JsonDateTime
 -> Maybe Text
 -> Maybe JsonDateTime
 -> Maybe [Text]
 -> Maybe Int
 -> Maybe List_invoice_template_accountsParametersQueryOrder
 -> Maybe List_invoice_template_accountsParametersQueryPast_due
 -> Maybe List_invoice_template_accountsParametersQuerySort
 -> Maybe Bool
 -> List_invoice_template_accountsParameters)
-> Parser
     (Text
      -> Maybe JsonDateTime
      -> Maybe Text
      -> Maybe JsonDateTime
      -> Maybe [Text]
      -> Maybe Int
      -> Maybe List_invoice_template_accountsParametersQueryOrder
      -> Maybe List_invoice_template_accountsParametersQueryPast_due
      -> Maybe List_invoice_template_accountsParametersQuerySort
      -> Maybe Bool
      -> List_invoice_template_accountsParameters)
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure Text
-> Maybe JsonDateTime
-> Maybe Text
-> Maybe JsonDateTime
-> Maybe [Text]
-> Maybe Int
-> Maybe List_invoice_template_accountsParametersQueryOrder
-> Maybe List_invoice_template_accountsParametersQueryPast_due
-> Maybe List_invoice_template_accountsParametersQuerySort
-> Maybe Bool
-> List_invoice_template_accountsParameters
List_invoice_template_accountsParameters Parser
  (Text
   -> Maybe JsonDateTime
   -> Maybe Text
   -> Maybe JsonDateTime
   -> Maybe [Text]
   -> Maybe Int
   -> Maybe List_invoice_template_accountsParametersQueryOrder
   -> Maybe List_invoice_template_accountsParametersQueryPast_due
   -> Maybe List_invoice_template_accountsParametersQuerySort
   -> Maybe Bool
   -> List_invoice_template_accountsParameters)
-> Parser Text
-> Parser
     (Maybe JsonDateTime
      -> Maybe Text
      -> Maybe JsonDateTime
      -> Maybe [Text]
      -> Maybe Int
      -> Maybe List_invoice_template_accountsParametersQueryOrder
      -> Maybe List_invoice_template_accountsParametersQueryPast_due
      -> Maybe List_invoice_template_accountsParametersQuerySort
      -> Maybe Bool
      -> List_invoice_template_accountsParameters)
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
"pathInvoice_template_id")) Parser
  (Maybe JsonDateTime
   -> Maybe Text
   -> Maybe JsonDateTime
   -> Maybe [Text]
   -> Maybe Int
   -> Maybe List_invoice_template_accountsParametersQueryOrder
   -> Maybe List_invoice_template_accountsParametersQueryPast_due
   -> Maybe List_invoice_template_accountsParametersQuerySort
   -> Maybe Bool
   -> List_invoice_template_accountsParameters)
-> Parser (Maybe JsonDateTime)
-> Parser
     (Maybe Text
      -> Maybe JsonDateTime
      -> Maybe [Text]
      -> Maybe Int
      -> Maybe List_invoice_template_accountsParametersQueryOrder
      -> Maybe List_invoice_template_accountsParametersQueryPast_due
      -> Maybe List_invoice_template_accountsParametersQuerySort
      -> Maybe Bool
      -> List_invoice_template_accountsParameters)
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 Text
   -> Maybe JsonDateTime
   -> Maybe [Text]
   -> Maybe Int
   -> Maybe List_invoice_template_accountsParametersQueryOrder
   -> Maybe List_invoice_template_accountsParametersQueryPast_due
   -> Maybe List_invoice_template_accountsParametersQuerySort
   -> Maybe Bool
   -> List_invoice_template_accountsParameters)
-> Parser (Maybe Text)
-> Parser
     (Maybe JsonDateTime
      -> Maybe [Text]
      -> Maybe Int
      -> Maybe List_invoice_template_accountsParametersQueryOrder
      -> Maybe List_invoice_template_accountsParametersQueryPast_due
      -> Maybe List_invoice_template_accountsParametersQuerySort
      -> Maybe Bool
      -> List_invoice_template_accountsParameters)
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
"queryEmail")) Parser
  (Maybe JsonDateTime
   -> Maybe [Text]
   -> Maybe Int
   -> Maybe List_invoice_template_accountsParametersQueryOrder
   -> Maybe List_invoice_template_accountsParametersQueryPast_due
   -> Maybe List_invoice_template_accountsParametersQuerySort
   -> Maybe Bool
   -> List_invoice_template_accountsParameters)
-> Parser (Maybe JsonDateTime)
-> Parser
     (Maybe [Text]
      -> Maybe Int
      -> Maybe List_invoice_template_accountsParametersQueryOrder
      -> Maybe List_invoice_template_accountsParametersQueryPast_due
      -> Maybe List_invoice_template_accountsParametersQuerySort
      -> Maybe Bool
      -> List_invoice_template_accountsParameters)
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_invoice_template_accountsParametersQueryOrder
   -> Maybe List_invoice_template_accountsParametersQueryPast_due
   -> Maybe List_invoice_template_accountsParametersQuerySort
   -> Maybe Bool
   -> List_invoice_template_accountsParameters)
-> Parser (Maybe [Text])
-> Parser
     (Maybe Int
      -> Maybe List_invoice_template_accountsParametersQueryOrder
      -> Maybe List_invoice_template_accountsParametersQueryPast_due
      -> Maybe List_invoice_template_accountsParametersQuerySort
      -> Maybe Bool
      -> List_invoice_template_accountsParameters)
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_invoice_template_accountsParametersQueryOrder
   -> Maybe List_invoice_template_accountsParametersQueryPast_due
   -> Maybe List_invoice_template_accountsParametersQuerySort
   -> Maybe Bool
   -> List_invoice_template_accountsParameters)
-> Parser (Maybe Int)
-> Parser
     (Maybe List_invoice_template_accountsParametersQueryOrder
      -> Maybe List_invoice_template_accountsParametersQueryPast_due
      -> Maybe List_invoice_template_accountsParametersQuerySort
      -> Maybe Bool
      -> List_invoice_template_accountsParameters)
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_invoice_template_accountsParametersQueryOrder
   -> Maybe List_invoice_template_accountsParametersQueryPast_due
   -> Maybe List_invoice_template_accountsParametersQuerySort
   -> Maybe Bool
   -> List_invoice_template_accountsParameters)
-> Parser
     (Maybe List_invoice_template_accountsParametersQueryOrder)
-> Parser
     (Maybe List_invoice_template_accountsParametersQueryPast_due
      -> Maybe List_invoice_template_accountsParametersQuerySort
      -> Maybe Bool
      -> List_invoice_template_accountsParameters)
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_invoice_template_accountsParametersQueryOrder)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Key
"queryOrder")) Parser
  (Maybe List_invoice_template_accountsParametersQueryPast_due
   -> Maybe List_invoice_template_accountsParametersQuerySort
   -> Maybe Bool
   -> List_invoice_template_accountsParameters)
-> Parser
     (Maybe List_invoice_template_accountsParametersQueryPast_due)
-> Parser
     (Maybe List_invoice_template_accountsParametersQuerySort
      -> Maybe Bool -> List_invoice_template_accountsParameters)
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_invoice_template_accountsParametersQueryPast_due)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Key
"queryPast_due")) Parser
  (Maybe List_invoice_template_accountsParametersQuerySort
   -> Maybe Bool -> List_invoice_template_accountsParameters)
-> Parser (Maybe List_invoice_template_accountsParametersQuerySort)
-> Parser (Maybe Bool -> List_invoice_template_accountsParameters)
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_invoice_template_accountsParametersQuerySort)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Key
"querySort")) Parser (Maybe Bool -> List_invoice_template_accountsParameters)
-> Parser (Maybe Bool)
-> Parser List_invoice_template_accountsParameters
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 Bool)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Key
"querySubscriber"))

-- | Create a new 'List_invoice_template_accountsParameters' with all required fields.
mkList_invoice_template_accountsParameters ::
    -- | 'list_invoice_template_accountsParametersPathInvoice_template_id'
    Data.Text.Internal.Text ->
    List_invoice_template_accountsParameters
mkList_invoice_template_accountsParameters :: Text -> List_invoice_template_accountsParameters
mkList_invoice_template_accountsParameters Text
list_invoice_template_accountsParametersPathInvoice_template_id =
    List_invoice_template_accountsParameters
        { list_invoice_template_accountsParametersPathInvoice_template_id :: Text
list_invoice_template_accountsParametersPathInvoice_template_id = Text
list_invoice_template_accountsParametersPathInvoice_template_id
        , list_invoice_template_accountsParametersQueryBegin_time :: Maybe JsonDateTime
list_invoice_template_accountsParametersQueryBegin_time = Maybe JsonDateTime
forall a. Maybe a
GHC.Maybe.Nothing
        , list_invoice_template_accountsParametersQueryEmail :: Maybe Text
list_invoice_template_accountsParametersQueryEmail = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing
        , list_invoice_template_accountsParametersQueryEnd_time :: Maybe JsonDateTime
list_invoice_template_accountsParametersQueryEnd_time = Maybe JsonDateTime
forall a. Maybe a
GHC.Maybe.Nothing
        , list_invoice_template_accountsParametersQueryIds :: Maybe [Text]
list_invoice_template_accountsParametersQueryIds = Maybe [Text]
forall a. Maybe a
GHC.Maybe.Nothing
        , list_invoice_template_accountsParametersQueryLimit :: Maybe Int
list_invoice_template_accountsParametersQueryLimit = Maybe Int
forall a. Maybe a
GHC.Maybe.Nothing
        , list_invoice_template_accountsParametersQueryOrder :: Maybe List_invoice_template_accountsParametersQueryOrder
list_invoice_template_accountsParametersQueryOrder = Maybe List_invoice_template_accountsParametersQueryOrder
forall a. Maybe a
GHC.Maybe.Nothing
        , list_invoice_template_accountsParametersQueryPast_due :: Maybe List_invoice_template_accountsParametersQueryPast_due
list_invoice_template_accountsParametersQueryPast_due = Maybe List_invoice_template_accountsParametersQueryPast_due
forall a. Maybe a
GHC.Maybe.Nothing
        , list_invoice_template_accountsParametersQuerySort :: Maybe List_invoice_template_accountsParametersQuerySort
list_invoice_template_accountsParametersQuerySort = Maybe List_invoice_template_accountsParametersQuerySort
forall a. Maybe a
GHC.Maybe.Nothing
        , list_invoice_template_accountsParametersQuerySubscriber :: Maybe Bool
list_invoice_template_accountsParametersQuerySubscriber = Maybe Bool
forall a. Maybe a
GHC.Maybe.Nothing
        }

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

Represents the parameter named \'order\'

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

instance Data.Aeson.Types.ToJSON.ToJSON List_invoice_template_accountsParametersQueryOrder where
    toJSON :: List_invoice_template_accountsParametersQueryOrder -> Value
toJSON (List_invoice_template_accountsParametersQueryOrderOther Value
val) = Value
val
    toJSON (List_invoice_template_accountsParametersQueryOrderTyped Text
val) = Text -> Value
forall a. ToJSON a => a -> Value
Data.Aeson.Types.ToJSON.toJSON Text
val
    toJSON (List_invoice_template_accountsParametersQueryOrder
List_invoice_template_accountsParametersQueryOrderEnumAsc) = Value
"asc"
    toJSON (List_invoice_template_accountsParametersQueryOrder
List_invoice_template_accountsParametersQueryOrderEnumDesc) = Value
"desc"
instance Data.Aeson.Types.FromJSON.FromJSON List_invoice_template_accountsParametersQueryOrder where
    parseJSON :: Value -> Parser List_invoice_template_accountsParametersQueryOrder
parseJSON Value
val =
        List_invoice_template_accountsParametersQueryOrder
-> Parser List_invoice_template_accountsParametersQueryOrder
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_invoice_template_accountsParametersQueryOrder
List_invoice_template_accountsParametersQueryOrderEnumAsc
                | Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"desc" -> List_invoice_template_accountsParametersQueryOrder
List_invoice_template_accountsParametersQueryOrderEnumDesc
                | Bool
GHC.Base.otherwise -> Value -> List_invoice_template_accountsParametersQueryOrder
List_invoice_template_accountsParametersQueryOrderOther Value
val
            )

{- | Defines the enum schema located at @paths.\/invoice_templates\/{invoice_template_id}\/accounts.GET.parameters.properties.queryPast_due@ in the specification.

Represents the parameter named \'past_due\'

Filter for accounts with an invoice in the \`past_due\` state.
-}
data List_invoice_template_accountsParametersQueryPast_due
    = -- | This case is used if the value encountered during decoding does not match any of the provided cases in the specification.
      List_invoice_template_accountsParametersQueryPast_dueOther 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_invoice_template_accountsParametersQueryPast_dueTyped Data.Text.Internal.Text
    | -- | Represents the JSON value @true@
      List_invoice_template_accountsParametersQueryPast_dueEnumTrue
    deriving (Int
-> List_invoice_template_accountsParametersQueryPast_due -> ShowS
[List_invoice_template_accountsParametersQueryPast_due] -> ShowS
List_invoice_template_accountsParametersQueryPast_due -> String
(Int
 -> List_invoice_template_accountsParametersQueryPast_due -> ShowS)
-> (List_invoice_template_accountsParametersQueryPast_due
    -> String)
-> ([List_invoice_template_accountsParametersQueryPast_due]
    -> ShowS)
-> Show List_invoice_template_accountsParametersQueryPast_due
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int
-> List_invoice_template_accountsParametersQueryPast_due -> ShowS
showsPrec :: Int
-> List_invoice_template_accountsParametersQueryPast_due -> ShowS
$cshow :: List_invoice_template_accountsParametersQueryPast_due -> String
show :: List_invoice_template_accountsParametersQueryPast_due -> String
$cshowList :: [List_invoice_template_accountsParametersQueryPast_due] -> ShowS
showList :: [List_invoice_template_accountsParametersQueryPast_due] -> ShowS
GHC.Show.Show, List_invoice_template_accountsParametersQueryPast_due
-> List_invoice_template_accountsParametersQueryPast_due -> Bool
(List_invoice_template_accountsParametersQueryPast_due
 -> List_invoice_template_accountsParametersQueryPast_due -> Bool)
-> (List_invoice_template_accountsParametersQueryPast_due
    -> List_invoice_template_accountsParametersQueryPast_due -> Bool)
-> Eq List_invoice_template_accountsParametersQueryPast_due
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: List_invoice_template_accountsParametersQueryPast_due
-> List_invoice_template_accountsParametersQueryPast_due -> Bool
== :: List_invoice_template_accountsParametersQueryPast_due
-> List_invoice_template_accountsParametersQueryPast_due -> Bool
$c/= :: List_invoice_template_accountsParametersQueryPast_due
-> List_invoice_template_accountsParametersQueryPast_due -> Bool
/= :: List_invoice_template_accountsParametersQueryPast_due
-> List_invoice_template_accountsParametersQueryPast_due -> Bool
GHC.Classes.Eq)

instance Data.Aeson.Types.ToJSON.ToJSON List_invoice_template_accountsParametersQueryPast_due where
    toJSON :: List_invoice_template_accountsParametersQueryPast_due -> Value
toJSON (List_invoice_template_accountsParametersQueryPast_dueOther Value
val) = Value
val
    toJSON (List_invoice_template_accountsParametersQueryPast_dueTyped Text
val) = Text -> Value
forall a. ToJSON a => a -> Value
Data.Aeson.Types.ToJSON.toJSON Text
val
    toJSON (List_invoice_template_accountsParametersQueryPast_due
List_invoice_template_accountsParametersQueryPast_dueEnumTrue) = Bool -> Value
Data.Aeson.Types.Internal.Bool Bool
GHC.Types.True
instance Data.Aeson.Types.FromJSON.FromJSON List_invoice_template_accountsParametersQueryPast_due where
    parseJSON :: Value
-> Parser List_invoice_template_accountsParametersQueryPast_due
parseJSON Value
val =
        List_invoice_template_accountsParametersQueryPast_due
-> Parser List_invoice_template_accountsParametersQueryPast_due
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_invoice_template_accountsParametersQueryPast_due
List_invoice_template_accountsParametersQueryPast_dueEnumTrue
                | Bool
GHC.Base.otherwise -> Value -> List_invoice_template_accountsParametersQueryPast_due
List_invoice_template_accountsParametersQueryPast_dueOther Value
val
            )

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

instance Data.Aeson.Types.ToJSON.ToJSON List_invoice_template_accountsParametersQuerySort where
    toJSON :: List_invoice_template_accountsParametersQuerySort -> Value
toJSON (List_invoice_template_accountsParametersQuerySortOther Value
val) = Value
val
    toJSON (List_invoice_template_accountsParametersQuerySortTyped Text
val) = Text -> Value
forall a. ToJSON a => a -> Value
Data.Aeson.Types.ToJSON.toJSON Text
val
    toJSON (List_invoice_template_accountsParametersQuerySort
List_invoice_template_accountsParametersQuerySortEnumCreated_at) = Value
"created_at"
    toJSON (List_invoice_template_accountsParametersQuerySort
List_invoice_template_accountsParametersQuerySortEnumUpdated_at) = Value
"updated_at"
instance Data.Aeson.Types.FromJSON.FromJSON List_invoice_template_accountsParametersQuerySort where
    parseJSON :: Value -> Parser List_invoice_template_accountsParametersQuerySort
parseJSON Value
val =
        List_invoice_template_accountsParametersQuerySort
-> Parser List_invoice_template_accountsParametersQuerySort
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_invoice_template_accountsParametersQuerySort
List_invoice_template_accountsParametersQuerySortEnumCreated_at
                | Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"updated_at" -> List_invoice_template_accountsParametersQuerySort
List_invoice_template_accountsParametersQuerySortEnumUpdated_at
                | Bool
GHC.Base.otherwise -> Value -> List_invoice_template_accountsParametersQuerySort
List_invoice_template_accountsParametersQuerySortOther Value
val
            )

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

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_invoice_template_accountsResponseError' is used.
-}
data List_invoice_template_accountsResponse
    = -- | Means either no matching case available or a parse error
      List_invoice_template_accountsResponseError GHC.Base.String
    | -- | A list of an invoice template\'s associated accounts.
      List_invoice_template_accountsResponse200 AccountList
    | -- | Invalid or unpermitted parameter.
      List_invoice_template_accountsResponse400 Error
    | -- | Incorrect site or invoice template ID.
      List_invoice_template_accountsResponse404 Error
    | -- | Unexpected error.
      List_invoice_template_accountsResponseDefault Error
    deriving (Int -> List_invoice_template_accountsResponse -> ShowS
[List_invoice_template_accountsResponse] -> ShowS
List_invoice_template_accountsResponse -> String
(Int -> List_invoice_template_accountsResponse -> ShowS)
-> (List_invoice_template_accountsResponse -> String)
-> ([List_invoice_template_accountsResponse] -> ShowS)
-> Show List_invoice_template_accountsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> List_invoice_template_accountsResponse -> ShowS
showsPrec :: Int -> List_invoice_template_accountsResponse -> ShowS
$cshow :: List_invoice_template_accountsResponse -> String
show :: List_invoice_template_accountsResponse -> String
$cshowList :: [List_invoice_template_accountsResponse] -> ShowS
showList :: [List_invoice_template_accountsResponse] -> ShowS
GHC.Show.Show, List_invoice_template_accountsResponse
-> List_invoice_template_accountsResponse -> Bool
(List_invoice_template_accountsResponse
 -> List_invoice_template_accountsResponse -> Bool)
-> (List_invoice_template_accountsResponse
    -> List_invoice_template_accountsResponse -> Bool)
-> Eq List_invoice_template_accountsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: List_invoice_template_accountsResponse
-> List_invoice_template_accountsResponse -> Bool
== :: List_invoice_template_accountsResponse
-> List_invoice_template_accountsResponse -> Bool
$c/= :: List_invoice_template_accountsResponse
-> List_invoice_template_accountsResponse -> Bool
/= :: List_invoice_template_accountsResponse
-> List_invoice_template_accountsResponse -> Bool
GHC.Classes.Eq)

{- | > GET /invoice_templates/{invoice_template_id}/accounts

The same as 'list_invoice_template_accounts' but accepts an explicit configuration.
-}
list_invoice_template_accountsWithConfiguration ::
    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_invoice_template_accountsParameters ->
    -- | Monadic computation which returns the result of the operation
    m (Network.HTTP.Client.Types.Response List_invoice_template_accountsResponse)
list_invoice_template_accountsWithConfiguration :: forall (m :: * -> *).
MonadHTTP m =>
Configuration
-> List_invoice_template_accountsParameters
-> m (Response List_invoice_template_accountsResponse)
list_invoice_template_accountsWithConfiguration
    Configuration
config
    List_invoice_template_accountsParameters
parameters =
        (Response ByteString
 -> Response List_invoice_template_accountsResponse)
-> m (Response ByteString)
-> m (Response List_invoice_template_accountsResponse)
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_invoice_template_accountsResponse)
-> Response ByteString
-> Response List_invoice_template_accountsResponse
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_invoice_template_accountsResponse)
-> (List_invoice_template_accountsResponse
    -> List_invoice_template_accountsResponse)
-> Either String List_invoice_template_accountsResponse
-> List_invoice_template_accountsResponse
forall a c b. (a -> c) -> (b -> c) -> Either a b -> c
Data.Either.either String -> List_invoice_template_accountsResponse
List_invoice_template_accountsResponseError List_invoice_template_accountsResponse
-> List_invoice_template_accountsResponse
forall a. a -> a
GHC.Base.id
                        (Either String List_invoice_template_accountsResponse
 -> List_invoice_template_accountsResponse)
-> (ByteString
    -> Either String List_invoice_template_accountsResponse)
-> ByteString
-> List_invoice_template_accountsResponse
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) ->
                                                AccountList -> List_invoice_template_accountsResponse
List_invoice_template_accountsResponse200
                                                    (AccountList -> List_invoice_template_accountsResponse)
-> Either String AccountList
-> Either String List_invoice_template_accountsResponse
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Data.Functor.<$> ( ByteString -> Either String AccountList
forall a. FromJSON a => ByteString -> Either String a
Data.Aeson.eitherDecodeStrict ByteString
body ::
                                                                        Data.Either.Either
                                                                            GHC.Base.String
                                                                            AccountList
                                                                     )
                                            | (\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_invoice_template_accountsResponse
List_invoice_template_accountsResponse400
                                                    (Error -> List_invoice_template_accountsResponse)
-> Either String Error
-> Either String List_invoice_template_accountsResponse
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_invoice_template_accountsResponse
List_invoice_template_accountsResponse404
                                                    (Error -> List_invoice_template_accountsResponse)
-> Either String Error
-> Either String List_invoice_template_accountsResponse
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_invoice_template_accountsResponse
List_invoice_template_accountsResponseDefault
                                                    (Error -> List_invoice_template_accountsResponse)
-> Either String Error
-> Either String List_invoice_template_accountsResponse
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_invoice_template_accountsResponse
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
"/invoice_templates/" 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_invoice_template_accountsParameters -> Text
list_invoice_template_accountsParametersPathInvoice_template_id List_invoice_template_accountsParameters
parameters))) Text -> Text -> Text
forall a. Semigroup a => a -> a -> a
GHC.Base.<> Text
"/accounts"))
                [ 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_invoice_template_accountsParameters -> Maybe [Text]
list_invoice_template_accountsParametersQueryIds List_invoice_template_accountsParameters
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_invoice_template_accountsParameters -> Maybe Int
list_invoice_template_accountsParametersQueryLimit List_invoice_template_accountsParameters
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_invoice_template_accountsParametersQueryOrder -> Value
forall a. ToJSON a => a -> Value
Data.Aeson.Types.ToJSON.toJSON (List_invoice_template_accountsParametersQueryOrder -> Value)
-> Maybe List_invoice_template_accountsParametersQueryOrder
-> Maybe Value
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Data.Functor.<$> List_invoice_template_accountsParameters
-> Maybe List_invoice_template_accountsParametersQueryOrder
list_invoice_template_accountsParametersQueryOrder List_invoice_template_accountsParameters
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_invoice_template_accountsParametersQuerySort -> Value
forall a. ToJSON a => a -> Value
Data.Aeson.Types.ToJSON.toJSON (List_invoice_template_accountsParametersQuerySort -> Value)
-> Maybe List_invoice_template_accountsParametersQuerySort
-> Maybe Value
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Data.Functor.<$> List_invoice_template_accountsParameters
-> Maybe List_invoice_template_accountsParametersQuerySort
list_invoice_template_accountsParametersQuerySort List_invoice_template_accountsParameters
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_invoice_template_accountsParameters -> Maybe JsonDateTime
list_invoice_template_accountsParametersQueryBegin_time List_invoice_template_accountsParameters
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_invoice_template_accountsParameters -> Maybe JsonDateTime
list_invoice_template_accountsParametersQueryEnd_time List_invoice_template_accountsParameters
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
"email") (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_invoice_template_accountsParameters -> Maybe Text
list_invoice_template_accountsParametersQueryEmail List_invoice_template_accountsParameters
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
"subscriber") (Bool -> Value
forall a. ToJSON a => a -> Value
Data.Aeson.Types.ToJSON.toJSON (Bool -> Value) -> Maybe Bool -> Maybe Value
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Data.Functor.<$> List_invoice_template_accountsParameters -> Maybe Bool
list_invoice_template_accountsParametersQuerySubscriber List_invoice_template_accountsParameters
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
"past_due") (List_invoice_template_accountsParametersQueryPast_due -> Value
forall a. ToJSON a => a -> Value
Data.Aeson.Types.ToJSON.toJSON (List_invoice_template_accountsParametersQueryPast_due -> Value)
-> Maybe List_invoice_template_accountsParametersQueryPast_due
-> Maybe Value
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Data.Functor.<$> List_invoice_template_accountsParameters
-> Maybe List_invoice_template_accountsParametersQueryPast_due
list_invoice_template_accountsParametersQueryPast_due List_invoice_template_accountsParameters
parameters) (String -> Text
Data.Text.Internal.pack String
"form") Bool
GHC.Types.False
                ]
            )

{- | > GET /invoice_templates/{invoice_template_id}/accounts

The same as 'list_invoice_template_accounts' but returns the raw 'Data.ByteString.ByteString'.
-}
list_invoice_template_accountsRaw ::
    forall m.
    (RecurlyClient.Common.MonadHTTP m) =>
    -- | Contains all available parameters of this operation (query and path parameters)
    List_invoice_template_accountsParameters ->
    -- | Monadic computation which returns the result of the operation
    RecurlyClient.Common.ClientT m (Network.HTTP.Client.Types.Response Data.ByteString.Internal.Type.ByteString)
list_invoice_template_accountsRaw :: forall (m :: * -> *).
MonadHTTP m =>
List_invoice_template_accountsParameters
-> ClientT m (Response ByteString)
list_invoice_template_accountsRaw List_invoice_template_accountsParameters
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
"/invoice_templates/" 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_invoice_template_accountsParameters -> Text
list_invoice_template_accountsParametersPathInvoice_template_id List_invoice_template_accountsParameters
parameters))) Text -> Text -> Text
forall a. Semigroup a => a -> a -> a
GHC.Base.<> Text
"/accounts"))
            [ 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_invoice_template_accountsParameters -> Maybe [Text]
list_invoice_template_accountsParametersQueryIds List_invoice_template_accountsParameters
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_invoice_template_accountsParameters -> Maybe Int
list_invoice_template_accountsParametersQueryLimit List_invoice_template_accountsParameters
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_invoice_template_accountsParametersQueryOrder -> Value
forall a. ToJSON a => a -> Value
Data.Aeson.Types.ToJSON.toJSON (List_invoice_template_accountsParametersQueryOrder -> Value)
-> Maybe List_invoice_template_accountsParametersQueryOrder
-> Maybe Value
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Data.Functor.<$> List_invoice_template_accountsParameters
-> Maybe List_invoice_template_accountsParametersQueryOrder
list_invoice_template_accountsParametersQueryOrder List_invoice_template_accountsParameters
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_invoice_template_accountsParametersQuerySort -> Value
forall a. ToJSON a => a -> Value
Data.Aeson.Types.ToJSON.toJSON (List_invoice_template_accountsParametersQuerySort -> Value)
-> Maybe List_invoice_template_accountsParametersQuerySort
-> Maybe Value
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Data.Functor.<$> List_invoice_template_accountsParameters
-> Maybe List_invoice_template_accountsParametersQuerySort
list_invoice_template_accountsParametersQuerySort List_invoice_template_accountsParameters
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_invoice_template_accountsParameters -> Maybe JsonDateTime
list_invoice_template_accountsParametersQueryBegin_time List_invoice_template_accountsParameters
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_invoice_template_accountsParameters -> Maybe JsonDateTime
list_invoice_template_accountsParametersQueryEnd_time List_invoice_template_accountsParameters
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
"email") (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_invoice_template_accountsParameters -> Maybe Text
list_invoice_template_accountsParametersQueryEmail List_invoice_template_accountsParameters
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
"subscriber") (Bool -> Value
forall a. ToJSON a => a -> Value
Data.Aeson.Types.ToJSON.toJSON (Bool -> Value) -> Maybe Bool -> Maybe Value
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Data.Functor.<$> List_invoice_template_accountsParameters -> Maybe Bool
list_invoice_template_accountsParametersQuerySubscriber List_invoice_template_accountsParameters
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
"past_due") (List_invoice_template_accountsParametersQueryPast_due -> Value
forall a. ToJSON a => a -> Value
Data.Aeson.Types.ToJSON.toJSON (List_invoice_template_accountsParametersQueryPast_due -> Value)
-> Maybe List_invoice_template_accountsParametersQueryPast_due
-> Maybe Value
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Data.Functor.<$> List_invoice_template_accountsParameters
-> Maybe List_invoice_template_accountsParametersQueryPast_due
list_invoice_template_accountsParametersQueryPast_due List_invoice_template_accountsParameters
parameters) (String -> Text
Data.Text.Internal.pack String
"form") Bool
GHC.Types.False
            ]
        )

{- | > GET /invoice_templates/{invoice_template_id}/accounts

The same as 'list_invoice_template_accounts' but accepts an explicit configuration and returns the raw 'Data.ByteString.ByteString'.
-}
list_invoice_template_accountsWithConfigurationRaw ::
    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_invoice_template_accountsParameters ->
    -- | Monadic computation which returns the result of the operation
    m (Network.HTTP.Client.Types.Response Data.ByteString.Internal.Type.ByteString)
list_invoice_template_accountsWithConfigurationRaw :: forall (m :: * -> *).
MonadHTTP m =>
Configuration
-> List_invoice_template_accountsParameters
-> m (Response ByteString)
list_invoice_template_accountsWithConfigurationRaw
    Configuration
config
    List_invoice_template_accountsParameters
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
"/invoice_templates/" 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_invoice_template_accountsParameters -> Text
list_invoice_template_accountsParametersPathInvoice_template_id List_invoice_template_accountsParameters
parameters))) Text -> Text -> Text
forall a. Semigroup a => a -> a -> a
GHC.Base.<> Text
"/accounts"))
                [ 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_invoice_template_accountsParameters -> Maybe [Text]
list_invoice_template_accountsParametersQueryIds List_invoice_template_accountsParameters
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_invoice_template_accountsParameters -> Maybe Int
list_invoice_template_accountsParametersQueryLimit List_invoice_template_accountsParameters
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_invoice_template_accountsParametersQueryOrder -> Value
forall a. ToJSON a => a -> Value
Data.Aeson.Types.ToJSON.toJSON (List_invoice_template_accountsParametersQueryOrder -> Value)
-> Maybe List_invoice_template_accountsParametersQueryOrder
-> Maybe Value
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Data.Functor.<$> List_invoice_template_accountsParameters
-> Maybe List_invoice_template_accountsParametersQueryOrder
list_invoice_template_accountsParametersQueryOrder List_invoice_template_accountsParameters
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_invoice_template_accountsParametersQuerySort -> Value
forall a. ToJSON a => a -> Value
Data.Aeson.Types.ToJSON.toJSON (List_invoice_template_accountsParametersQuerySort -> Value)
-> Maybe List_invoice_template_accountsParametersQuerySort
-> Maybe Value
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Data.Functor.<$> List_invoice_template_accountsParameters
-> Maybe List_invoice_template_accountsParametersQuerySort
list_invoice_template_accountsParametersQuerySort List_invoice_template_accountsParameters
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_invoice_template_accountsParameters -> Maybe JsonDateTime
list_invoice_template_accountsParametersQueryBegin_time List_invoice_template_accountsParameters
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_invoice_template_accountsParameters -> Maybe JsonDateTime
list_invoice_template_accountsParametersQueryEnd_time List_invoice_template_accountsParameters
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
"email") (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_invoice_template_accountsParameters -> Maybe Text
list_invoice_template_accountsParametersQueryEmail List_invoice_template_accountsParameters
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
"subscriber") (Bool -> Value
forall a. ToJSON a => a -> Value
Data.Aeson.Types.ToJSON.toJSON (Bool -> Value) -> Maybe Bool -> Maybe Value
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Data.Functor.<$> List_invoice_template_accountsParameters -> Maybe Bool
list_invoice_template_accountsParametersQuerySubscriber List_invoice_template_accountsParameters
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
"past_due") (List_invoice_template_accountsParametersQueryPast_due -> Value
forall a. ToJSON a => a -> Value
Data.Aeson.Types.ToJSON.toJSON (List_invoice_template_accountsParametersQueryPast_due -> Value)
-> Maybe List_invoice_template_accountsParametersQueryPast_due
-> Maybe Value
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Data.Functor.<$> List_invoice_template_accountsParameters
-> Maybe List_invoice_template_accountsParametersQueryPast_due
list_invoice_template_accountsParametersQueryPast_due List_invoice_template_accountsParameters
parameters) (String -> Text
Data.Text.Internal.pack String
"form") Bool
GHC.Types.False
                ]
            )