{-# LANGUAGE ExplicitForAll #-}
{-# LANGUAGE MultiWayIf #-}
{-# LANGUAGE OverloadedStrings #-}
module RecurlyClient.Operations.List_coupons 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
list_coupons ::
forall m.
(RecurlyClient.Common.MonadHTTP m) =>
List_couponsParameters ->
RecurlyClient.Common.ClientT m (Network.HTTP.Client.Types.Response List_couponsResponse)
list_coupons :: forall (m :: * -> *).
MonadHTTP m =>
List_couponsParameters -> ClientT m (Response List_couponsResponse)
list_coupons List_couponsParameters
parameters =
(Response ByteString -> Response List_couponsResponse)
-> ClientT m (Response ByteString)
-> ClientT m (Response List_couponsResponse)
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_couponsResponse)
-> Response ByteString -> Response List_couponsResponse
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_couponsResponse)
-> (List_couponsResponse -> List_couponsResponse)
-> Either String List_couponsResponse
-> List_couponsResponse
forall a c b. (a -> c) -> (b -> c) -> Either a b -> c
Data.Either.either String -> List_couponsResponse
List_couponsResponseError List_couponsResponse -> List_couponsResponse
forall a. a -> a
GHC.Base.id
(Either String List_couponsResponse -> List_couponsResponse)
-> (ByteString -> Either String List_couponsResponse)
-> ByteString
-> List_couponsResponse
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) ->
CouponList -> List_couponsResponse
List_couponsResponse200
(CouponList -> List_couponsResponse)
-> Either String CouponList -> Either String List_couponsResponse
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Data.Functor.<$> ( ByteString -> Either String CouponList
forall a. FromJSON a => ByteString -> Either String a
Data.Aeson.eitherDecodeStrict ByteString
body ::
Data.Either.Either
GHC.Base.String
CouponList
)
| (\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_couponsResponse
List_couponsResponse400
(Error -> List_couponsResponse)
-> Either String Error -> Either String List_couponsResponse
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_couponsResponse
List_couponsResponse404
(Error -> List_couponsResponse)
-> Either String Error -> Either String List_couponsResponse
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_couponsResponse
List_couponsResponseDefault
(Error -> List_couponsResponse)
-> Either String Error -> Either String List_couponsResponse
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_couponsResponse
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
"/coupons"
[ 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_couponsParameters -> Maybe [Text]
list_couponsParametersQueryIds List_couponsParameters
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_couponsParameters -> Maybe Int
list_couponsParametersQueryLimit List_couponsParameters
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_couponsParametersQueryOrder -> Value
forall a. ToJSON a => a -> Value
Data.Aeson.Types.ToJSON.toJSON (List_couponsParametersQueryOrder -> Value)
-> Maybe List_couponsParametersQueryOrder -> Maybe Value
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Data.Functor.<$> List_couponsParameters -> Maybe List_couponsParametersQueryOrder
list_couponsParametersQueryOrder List_couponsParameters
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_couponsParametersQuerySort -> Value
forall a. ToJSON a => a -> Value
Data.Aeson.Types.ToJSON.toJSON (List_couponsParametersQuerySort -> Value)
-> Maybe List_couponsParametersQuerySort -> Maybe Value
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Data.Functor.<$> List_couponsParameters -> Maybe List_couponsParametersQuerySort
list_couponsParametersQuerySort List_couponsParameters
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_couponsParameters -> Maybe JsonDateTime
list_couponsParametersQueryBegin_time List_couponsParameters
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_couponsParameters -> Maybe JsonDateTime
list_couponsParametersQueryEnd_time List_couponsParameters
parameters) (String -> Text
Data.Text.Internal.pack String
"form") Bool
GHC.Types.False
]
)
data List_couponsParameters = List_couponsParameters
{ List_couponsParameters -> Maybe JsonDateTime
list_couponsParametersQueryBegin_time :: (GHC.Maybe.Maybe RecurlyClient.Common.JsonDateTime)
, List_couponsParameters -> Maybe JsonDateTime
list_couponsParametersQueryEnd_time :: (GHC.Maybe.Maybe RecurlyClient.Common.JsonDateTime)
, List_couponsParameters -> Maybe [Text]
list_couponsParametersQueryIds :: (GHC.Maybe.Maybe [Data.Text.Internal.Text])
, List_couponsParameters -> Maybe Int
list_couponsParametersQueryLimit :: (GHC.Maybe.Maybe GHC.Types.Int)
, List_couponsParameters -> Maybe List_couponsParametersQueryOrder
list_couponsParametersQueryOrder :: (GHC.Maybe.Maybe List_couponsParametersQueryOrder)
, List_couponsParameters -> Maybe List_couponsParametersQuerySort
list_couponsParametersQuerySort :: (GHC.Maybe.Maybe List_couponsParametersQuerySort)
}
deriving
( Int -> List_couponsParameters -> ShowS
[List_couponsParameters] -> ShowS
List_couponsParameters -> String
(Int -> List_couponsParameters -> ShowS)
-> (List_couponsParameters -> String)
-> ([List_couponsParameters] -> ShowS)
-> Show List_couponsParameters
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> List_couponsParameters -> ShowS
showsPrec :: Int -> List_couponsParameters -> ShowS
$cshow :: List_couponsParameters -> String
show :: List_couponsParameters -> String
$cshowList :: [List_couponsParameters] -> ShowS
showList :: [List_couponsParameters] -> ShowS
GHC.Show.Show
, List_couponsParameters -> List_couponsParameters -> Bool
(List_couponsParameters -> List_couponsParameters -> Bool)
-> (List_couponsParameters -> List_couponsParameters -> Bool)
-> Eq List_couponsParameters
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: List_couponsParameters -> List_couponsParameters -> Bool
== :: List_couponsParameters -> List_couponsParameters -> Bool
$c/= :: List_couponsParameters -> List_couponsParameters -> Bool
/= :: List_couponsParameters -> List_couponsParameters -> Bool
GHC.Classes.Eq
)
instance Data.Aeson.Types.ToJSON.ToJSON List_couponsParameters where
toJSON :: List_couponsParameters -> Value
toJSON List_couponsParameters
obj = [Pair] -> Value
Data.Aeson.Types.Internal.object ([[Pair]] -> [Pair]
forall (t :: * -> *) a. Foldable t => t [a] -> [a]
Data.Foldable.concat ([Pair] -> (JsonDateTime -> [Pair]) -> Maybe JsonDateTime -> [Pair]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Pair]
forall a. Monoid a => a
GHC.Base.mempty (Pair -> [Pair]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Pair -> [Pair])
-> (JsonDateTime -> Pair) -> JsonDateTime -> [Pair]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"queryBegin_time" Key -> JsonDateTime -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..=)) (List_couponsParameters -> Maybe JsonDateTime
list_couponsParametersQueryBegin_time List_couponsParameters
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_couponsParameters -> Maybe JsonDateTime
list_couponsParametersQueryEnd_time List_couponsParameters
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_couponsParameters -> Maybe [Text]
list_couponsParametersQueryIds List_couponsParameters
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_couponsParameters -> Maybe Int
list_couponsParametersQueryLimit List_couponsParameters
obj) [Pair] -> [[Pair]] -> [[Pair]]
forall a. a -> [a] -> [a]
: [Pair]
-> (List_couponsParametersQueryOrder -> [Pair])
-> Maybe List_couponsParametersQueryOrder
-> [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_couponsParametersQueryOrder -> Pair)
-> List_couponsParametersQueryOrder
-> [Pair]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"queryOrder" Key -> List_couponsParametersQueryOrder -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..=)) (List_couponsParameters -> Maybe List_couponsParametersQueryOrder
list_couponsParametersQueryOrder List_couponsParameters
obj) [Pair] -> [[Pair]] -> [[Pair]]
forall a. a -> [a] -> [a]
: [Pair]
-> (List_couponsParametersQuerySort -> [Pair])
-> Maybe List_couponsParametersQuerySort
-> [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_couponsParametersQuerySort -> Pair)
-> List_couponsParametersQuerySort
-> [Pair]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"querySort" Key -> List_couponsParametersQuerySort -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
Data.Aeson.Types.ToJSON..=)) (List_couponsParameters -> Maybe List_couponsParametersQuerySort
list_couponsParametersQuerySort List_couponsParameters
obj) [Pair] -> [[Pair]] -> [[Pair]]
forall a. a -> [a] -> [a]
: [[Pair]]
forall a. Monoid a => a
GHC.Base.mempty))
toEncoding :: List_couponsParameters -> Encoding
toEncoding List_couponsParameters
obj = Series -> Encoding
Data.Aeson.Encoding.Internal.pairs ([Series] -> Series
forall a. Monoid a => [a] -> a
GHC.Base.mconcat ([[Series]] -> [Series]
forall (t :: * -> *) a. Foldable t => t [a] -> [a]
Data.Foldable.concat ([Series]
-> (JsonDateTime -> [Series]) -> Maybe JsonDateTime -> [Series]
forall b a. b -> (a -> b) -> Maybe a -> b
Data.Maybe.maybe [Series]
forall a. Monoid a => a
GHC.Base.mempty (Series -> [Series]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure (Series -> [Series])
-> (JsonDateTime -> Series) -> JsonDateTime -> [Series]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"queryBegin_time" Key -> JsonDateTime -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..=)) (List_couponsParameters -> Maybe JsonDateTime
list_couponsParametersQueryBegin_time List_couponsParameters
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_couponsParameters -> Maybe JsonDateTime
list_couponsParametersQueryEnd_time List_couponsParameters
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_couponsParameters -> Maybe [Text]
list_couponsParametersQueryIds List_couponsParameters
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_couponsParameters -> Maybe Int
list_couponsParametersQueryLimit List_couponsParameters
obj) [Series] -> [[Series]] -> [[Series]]
forall a. a -> [a] -> [a]
: [Series]
-> (List_couponsParametersQueryOrder -> [Series])
-> Maybe List_couponsParametersQueryOrder
-> [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_couponsParametersQueryOrder -> Series)
-> List_couponsParametersQueryOrder
-> [Series]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"queryOrder" Key -> List_couponsParametersQueryOrder -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..=)) (List_couponsParameters -> Maybe List_couponsParametersQueryOrder
list_couponsParametersQueryOrder List_couponsParameters
obj) [Series] -> [[Series]] -> [[Series]]
forall a. a -> [a] -> [a]
: [Series]
-> (List_couponsParametersQuerySort -> [Series])
-> Maybe List_couponsParametersQuerySort
-> [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_couponsParametersQuerySort -> Series)
-> List_couponsParametersQuerySort
-> [Series]
forall b c a. (b -> c) -> (a -> b) -> a -> c
GHC.Base.. (Key
"querySort" Key -> List_couponsParametersQuerySort -> Series
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Series
Data.Aeson.Types.ToJSON..=)) (List_couponsParameters -> Maybe List_couponsParametersQuerySort
list_couponsParametersQuerySort List_couponsParameters
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_couponsParameters where
parseJSON :: Value -> Parser List_couponsParameters
parseJSON = String
-> (Object -> Parser List_couponsParameters)
-> Value
-> Parser List_couponsParameters
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.Aeson.Types.FromJSON.withObject String
"List_couponsParameters" (\Object
obj -> ((((((Maybe JsonDateTime
-> Maybe JsonDateTime
-> Maybe [Text]
-> Maybe Int
-> Maybe List_couponsParametersQueryOrder
-> Maybe List_couponsParametersQuerySort
-> List_couponsParameters)
-> Parser
(Maybe JsonDateTime
-> Maybe JsonDateTime
-> Maybe [Text]
-> Maybe Int
-> Maybe List_couponsParametersQueryOrder
-> Maybe List_couponsParametersQuerySort
-> List_couponsParameters)
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure Maybe JsonDateTime
-> Maybe JsonDateTime
-> Maybe [Text]
-> Maybe Int
-> Maybe List_couponsParametersQueryOrder
-> Maybe List_couponsParametersQuerySort
-> List_couponsParameters
List_couponsParameters Parser
(Maybe JsonDateTime
-> Maybe JsonDateTime
-> Maybe [Text]
-> Maybe Int
-> Maybe List_couponsParametersQueryOrder
-> Maybe List_couponsParametersQuerySort
-> List_couponsParameters)
-> Parser (Maybe JsonDateTime)
-> Parser
(Maybe JsonDateTime
-> Maybe [Text]
-> Maybe Int
-> Maybe List_couponsParametersQueryOrder
-> Maybe List_couponsParametersQuerySort
-> List_couponsParameters)
forall a b. Parser (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Key -> Parser (Maybe JsonDateTime)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Key
"queryBegin_time")) Parser
(Maybe JsonDateTime
-> Maybe [Text]
-> Maybe Int
-> Maybe List_couponsParametersQueryOrder
-> Maybe List_couponsParametersQuerySort
-> List_couponsParameters)
-> Parser (Maybe JsonDateTime)
-> Parser
(Maybe [Text]
-> Maybe Int
-> Maybe List_couponsParametersQueryOrder
-> Maybe List_couponsParametersQuerySort
-> List_couponsParameters)
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_couponsParametersQueryOrder
-> Maybe List_couponsParametersQuerySort
-> List_couponsParameters)
-> Parser (Maybe [Text])
-> Parser
(Maybe Int
-> Maybe List_couponsParametersQueryOrder
-> Maybe List_couponsParametersQuerySort
-> List_couponsParameters)
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_couponsParametersQueryOrder
-> Maybe List_couponsParametersQuerySort
-> List_couponsParameters)
-> Parser (Maybe Int)
-> Parser
(Maybe List_couponsParametersQueryOrder
-> Maybe List_couponsParametersQuerySort -> List_couponsParameters)
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_couponsParametersQueryOrder
-> Maybe List_couponsParametersQuerySort -> List_couponsParameters)
-> Parser (Maybe List_couponsParametersQueryOrder)
-> Parser
(Maybe List_couponsParametersQuerySort -> List_couponsParameters)
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_couponsParametersQueryOrder)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Key
"queryOrder")) Parser
(Maybe List_couponsParametersQuerySort -> List_couponsParameters)
-> Parser (Maybe List_couponsParametersQuerySort)
-> Parser List_couponsParameters
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_couponsParametersQuerySort)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Key
"querySort"))
mkList_couponsParameters :: List_couponsParameters
mkList_couponsParameters :: List_couponsParameters
mkList_couponsParameters =
List_couponsParameters
{ list_couponsParametersQueryBegin_time :: Maybe JsonDateTime
list_couponsParametersQueryBegin_time = Maybe JsonDateTime
forall a. Maybe a
GHC.Maybe.Nothing
, list_couponsParametersQueryEnd_time :: Maybe JsonDateTime
list_couponsParametersQueryEnd_time = Maybe JsonDateTime
forall a. Maybe a
GHC.Maybe.Nothing
, list_couponsParametersQueryIds :: Maybe [Text]
list_couponsParametersQueryIds = Maybe [Text]
forall a. Maybe a
GHC.Maybe.Nothing
, list_couponsParametersQueryLimit :: Maybe Int
list_couponsParametersQueryLimit = Maybe Int
forall a. Maybe a
GHC.Maybe.Nothing
, list_couponsParametersQueryOrder :: Maybe List_couponsParametersQueryOrder
list_couponsParametersQueryOrder = Maybe List_couponsParametersQueryOrder
forall a. Maybe a
GHC.Maybe.Nothing
, list_couponsParametersQuerySort :: Maybe List_couponsParametersQuerySort
list_couponsParametersQuerySort = Maybe List_couponsParametersQuerySort
forall a. Maybe a
GHC.Maybe.Nothing
}
data List_couponsParametersQueryOrder
=
List_couponsParametersQueryOrderOther Data.Aeson.Types.Internal.Value
|
List_couponsParametersQueryOrderTyped Data.Text.Internal.Text
|
List_couponsParametersQueryOrderEnumAsc
|
List_couponsParametersQueryOrderEnumDesc
deriving (Int -> List_couponsParametersQueryOrder -> ShowS
[List_couponsParametersQueryOrder] -> ShowS
List_couponsParametersQueryOrder -> String
(Int -> List_couponsParametersQueryOrder -> ShowS)
-> (List_couponsParametersQueryOrder -> String)
-> ([List_couponsParametersQueryOrder] -> ShowS)
-> Show List_couponsParametersQueryOrder
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> List_couponsParametersQueryOrder -> ShowS
showsPrec :: Int -> List_couponsParametersQueryOrder -> ShowS
$cshow :: List_couponsParametersQueryOrder -> String
show :: List_couponsParametersQueryOrder -> String
$cshowList :: [List_couponsParametersQueryOrder] -> ShowS
showList :: [List_couponsParametersQueryOrder] -> ShowS
GHC.Show.Show, List_couponsParametersQueryOrder
-> List_couponsParametersQueryOrder -> Bool
(List_couponsParametersQueryOrder
-> List_couponsParametersQueryOrder -> Bool)
-> (List_couponsParametersQueryOrder
-> List_couponsParametersQueryOrder -> Bool)
-> Eq List_couponsParametersQueryOrder
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: List_couponsParametersQueryOrder
-> List_couponsParametersQueryOrder -> Bool
== :: List_couponsParametersQueryOrder
-> List_couponsParametersQueryOrder -> Bool
$c/= :: List_couponsParametersQueryOrder
-> List_couponsParametersQueryOrder -> Bool
/= :: List_couponsParametersQueryOrder
-> List_couponsParametersQueryOrder -> Bool
GHC.Classes.Eq)
instance Data.Aeson.Types.ToJSON.ToJSON List_couponsParametersQueryOrder where
toJSON :: List_couponsParametersQueryOrder -> Value
toJSON (List_couponsParametersQueryOrderOther Value
val) = Value
val
toJSON (List_couponsParametersQueryOrderTyped Text
val) = Text -> Value
forall a. ToJSON a => a -> Value
Data.Aeson.Types.ToJSON.toJSON Text
val
toJSON (List_couponsParametersQueryOrder
List_couponsParametersQueryOrderEnumAsc) = Value
"asc"
toJSON (List_couponsParametersQueryOrder
List_couponsParametersQueryOrderEnumDesc) = Value
"desc"
instance Data.Aeson.Types.FromJSON.FromJSON List_couponsParametersQueryOrder where
parseJSON :: Value -> Parser List_couponsParametersQueryOrder
parseJSON Value
val =
List_couponsParametersQueryOrder
-> Parser List_couponsParametersQueryOrder
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_couponsParametersQueryOrder
List_couponsParametersQueryOrderEnumAsc
| Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"desc" -> List_couponsParametersQueryOrder
List_couponsParametersQueryOrderEnumDesc
| Bool
GHC.Base.otherwise -> Value -> List_couponsParametersQueryOrder
List_couponsParametersQueryOrderOther Value
val
)
data List_couponsParametersQuerySort
=
List_couponsParametersQuerySortOther Data.Aeson.Types.Internal.Value
|
List_couponsParametersQuerySortTyped Data.Text.Internal.Text
|
List_couponsParametersQuerySortEnumCreated_at
|
List_couponsParametersQuerySortEnumUpdated_at
deriving (Int -> List_couponsParametersQuerySort -> ShowS
[List_couponsParametersQuerySort] -> ShowS
List_couponsParametersQuerySort -> String
(Int -> List_couponsParametersQuerySort -> ShowS)
-> (List_couponsParametersQuerySort -> String)
-> ([List_couponsParametersQuerySort] -> ShowS)
-> Show List_couponsParametersQuerySort
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> List_couponsParametersQuerySort -> ShowS
showsPrec :: Int -> List_couponsParametersQuerySort -> ShowS
$cshow :: List_couponsParametersQuerySort -> String
show :: List_couponsParametersQuerySort -> String
$cshowList :: [List_couponsParametersQuerySort] -> ShowS
showList :: [List_couponsParametersQuerySort] -> ShowS
GHC.Show.Show, List_couponsParametersQuerySort
-> List_couponsParametersQuerySort -> Bool
(List_couponsParametersQuerySort
-> List_couponsParametersQuerySort -> Bool)
-> (List_couponsParametersQuerySort
-> List_couponsParametersQuerySort -> Bool)
-> Eq List_couponsParametersQuerySort
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: List_couponsParametersQuerySort
-> List_couponsParametersQuerySort -> Bool
== :: List_couponsParametersQuerySort
-> List_couponsParametersQuerySort -> Bool
$c/= :: List_couponsParametersQuerySort
-> List_couponsParametersQuerySort -> Bool
/= :: List_couponsParametersQuerySort
-> List_couponsParametersQuerySort -> Bool
GHC.Classes.Eq)
instance Data.Aeson.Types.ToJSON.ToJSON List_couponsParametersQuerySort where
toJSON :: List_couponsParametersQuerySort -> Value
toJSON (List_couponsParametersQuerySortOther Value
val) = Value
val
toJSON (List_couponsParametersQuerySortTyped Text
val) = Text -> Value
forall a. ToJSON a => a -> Value
Data.Aeson.Types.ToJSON.toJSON Text
val
toJSON (List_couponsParametersQuerySort
List_couponsParametersQuerySortEnumCreated_at) = Value
"created_at"
toJSON (List_couponsParametersQuerySort
List_couponsParametersQuerySortEnumUpdated_at) = Value
"updated_at"
instance Data.Aeson.Types.FromJSON.FromJSON List_couponsParametersQuerySort where
parseJSON :: Value -> Parser List_couponsParametersQuerySort
parseJSON Value
val =
List_couponsParametersQuerySort
-> Parser List_couponsParametersQuerySort
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_couponsParametersQuerySort
List_couponsParametersQuerySortEnumCreated_at
| Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"updated_at" -> List_couponsParametersQuerySort
List_couponsParametersQuerySortEnumUpdated_at
| Bool
GHC.Base.otherwise -> Value -> List_couponsParametersQuerySort
List_couponsParametersQuerySortOther Value
val
)
data List_couponsResponse
=
List_couponsResponseError GHC.Base.String
|
List_couponsResponse200 CouponList
|
List_couponsResponse400 Error
|
List_couponsResponse404 Error
|
List_couponsResponseDefault Error
deriving (Int -> List_couponsResponse -> ShowS
[List_couponsResponse] -> ShowS
List_couponsResponse -> String
(Int -> List_couponsResponse -> ShowS)
-> (List_couponsResponse -> String)
-> ([List_couponsResponse] -> ShowS)
-> Show List_couponsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> List_couponsResponse -> ShowS
showsPrec :: Int -> List_couponsResponse -> ShowS
$cshow :: List_couponsResponse -> String
show :: List_couponsResponse -> String
$cshowList :: [List_couponsResponse] -> ShowS
showList :: [List_couponsResponse] -> ShowS
GHC.Show.Show, List_couponsResponse -> List_couponsResponse -> Bool
(List_couponsResponse -> List_couponsResponse -> Bool)
-> (List_couponsResponse -> List_couponsResponse -> Bool)
-> Eq List_couponsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: List_couponsResponse -> List_couponsResponse -> Bool
== :: List_couponsResponse -> List_couponsResponse -> Bool
$c/= :: List_couponsResponse -> List_couponsResponse -> Bool
/= :: List_couponsResponse -> List_couponsResponse -> Bool
GHC.Classes.Eq)
list_couponsWithConfiguration ::
forall m.
(RecurlyClient.Common.MonadHTTP m) =>
RecurlyClient.Common.Configuration ->
List_couponsParameters ->
m (Network.HTTP.Client.Types.Response List_couponsResponse)
list_couponsWithConfiguration :: forall (m :: * -> *).
MonadHTTP m =>
Configuration
-> List_couponsParameters -> m (Response List_couponsResponse)
list_couponsWithConfiguration
Configuration
config
List_couponsParameters
parameters =
(Response ByteString -> Response List_couponsResponse)
-> m (Response ByteString) -> m (Response List_couponsResponse)
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_couponsResponse)
-> Response ByteString -> Response List_couponsResponse
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_couponsResponse)
-> (List_couponsResponse -> List_couponsResponse)
-> Either String List_couponsResponse
-> List_couponsResponse
forall a c b. (a -> c) -> (b -> c) -> Either a b -> c
Data.Either.either String -> List_couponsResponse
List_couponsResponseError List_couponsResponse -> List_couponsResponse
forall a. a -> a
GHC.Base.id
(Either String List_couponsResponse -> List_couponsResponse)
-> (ByteString -> Either String List_couponsResponse)
-> ByteString
-> List_couponsResponse
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) ->
CouponList -> List_couponsResponse
List_couponsResponse200
(CouponList -> List_couponsResponse)
-> Either String CouponList -> Either String List_couponsResponse
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Data.Functor.<$> ( ByteString -> Either String CouponList
forall a. FromJSON a => ByteString -> Either String a
Data.Aeson.eitherDecodeStrict ByteString
body ::
Data.Either.Either
GHC.Base.String
CouponList
)
| (\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_couponsResponse
List_couponsResponse400
(Error -> List_couponsResponse)
-> Either String Error -> Either String List_couponsResponse
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_couponsResponse
List_couponsResponse404
(Error -> List_couponsResponse)
-> Either String Error -> Either String List_couponsResponse
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_couponsResponse
List_couponsResponseDefault
(Error -> List_couponsResponse)
-> Either String Error -> Either String List_couponsResponse
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_couponsResponse
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
"/coupons"
[ 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_couponsParameters -> Maybe [Text]
list_couponsParametersQueryIds List_couponsParameters
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_couponsParameters -> Maybe Int
list_couponsParametersQueryLimit List_couponsParameters
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_couponsParametersQueryOrder -> Value
forall a. ToJSON a => a -> Value
Data.Aeson.Types.ToJSON.toJSON (List_couponsParametersQueryOrder -> Value)
-> Maybe List_couponsParametersQueryOrder -> Maybe Value
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Data.Functor.<$> List_couponsParameters -> Maybe List_couponsParametersQueryOrder
list_couponsParametersQueryOrder List_couponsParameters
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_couponsParametersQuerySort -> Value
forall a. ToJSON a => a -> Value
Data.Aeson.Types.ToJSON.toJSON (List_couponsParametersQuerySort -> Value)
-> Maybe List_couponsParametersQuerySort -> Maybe Value
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Data.Functor.<$> List_couponsParameters -> Maybe List_couponsParametersQuerySort
list_couponsParametersQuerySort List_couponsParameters
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_couponsParameters -> Maybe JsonDateTime
list_couponsParametersQueryBegin_time List_couponsParameters
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_couponsParameters -> Maybe JsonDateTime
list_couponsParametersQueryEnd_time List_couponsParameters
parameters) (String -> Text
Data.Text.Internal.pack String
"form") Bool
GHC.Types.False
]
)
list_couponsRaw ::
forall m.
(RecurlyClient.Common.MonadHTTP m) =>
List_couponsParameters ->
RecurlyClient.Common.ClientT m (Network.HTTP.Client.Types.Response Data.ByteString.Internal.Type.ByteString)
list_couponsRaw :: forall (m :: * -> *).
MonadHTTP m =>
List_couponsParameters -> ClientT m (Response ByteString)
list_couponsRaw List_couponsParameters
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
"/coupons"
[ 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_couponsParameters -> Maybe [Text]
list_couponsParametersQueryIds List_couponsParameters
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_couponsParameters -> Maybe Int
list_couponsParametersQueryLimit List_couponsParameters
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_couponsParametersQueryOrder -> Value
forall a. ToJSON a => a -> Value
Data.Aeson.Types.ToJSON.toJSON (List_couponsParametersQueryOrder -> Value)
-> Maybe List_couponsParametersQueryOrder -> Maybe Value
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Data.Functor.<$> List_couponsParameters -> Maybe List_couponsParametersQueryOrder
list_couponsParametersQueryOrder List_couponsParameters
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_couponsParametersQuerySort -> Value
forall a. ToJSON a => a -> Value
Data.Aeson.Types.ToJSON.toJSON (List_couponsParametersQuerySort -> Value)
-> Maybe List_couponsParametersQuerySort -> Maybe Value
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Data.Functor.<$> List_couponsParameters -> Maybe List_couponsParametersQuerySort
list_couponsParametersQuerySort List_couponsParameters
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_couponsParameters -> Maybe JsonDateTime
list_couponsParametersQueryBegin_time List_couponsParameters
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_couponsParameters -> Maybe JsonDateTime
list_couponsParametersQueryEnd_time List_couponsParameters
parameters) (String -> Text
Data.Text.Internal.pack String
"form") Bool
GHC.Types.False
]
)
list_couponsWithConfigurationRaw ::
forall m.
(RecurlyClient.Common.MonadHTTP m) =>
RecurlyClient.Common.Configuration ->
List_couponsParameters ->
m (Network.HTTP.Client.Types.Response Data.ByteString.Internal.Type.ByteString)
list_couponsWithConfigurationRaw :: forall (m :: * -> *).
MonadHTTP m =>
Configuration -> List_couponsParameters -> m (Response ByteString)
list_couponsWithConfigurationRaw
Configuration
config
List_couponsParameters
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
"/coupons"
[ 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_couponsParameters -> Maybe [Text]
list_couponsParametersQueryIds List_couponsParameters
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_couponsParameters -> Maybe Int
list_couponsParametersQueryLimit List_couponsParameters
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_couponsParametersQueryOrder -> Value
forall a. ToJSON a => a -> Value
Data.Aeson.Types.ToJSON.toJSON (List_couponsParametersQueryOrder -> Value)
-> Maybe List_couponsParametersQueryOrder -> Maybe Value
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Data.Functor.<$> List_couponsParameters -> Maybe List_couponsParametersQueryOrder
list_couponsParametersQueryOrder List_couponsParameters
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_couponsParametersQuerySort -> Value
forall a. ToJSON a => a -> Value
Data.Aeson.Types.ToJSON.toJSON (List_couponsParametersQuerySort -> Value)
-> Maybe List_couponsParametersQuerySort -> Maybe Value
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Data.Functor.<$> List_couponsParameters -> Maybe List_couponsParametersQuerySort
list_couponsParametersQuerySort List_couponsParameters
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_couponsParameters -> Maybe JsonDateTime
list_couponsParametersQueryBegin_time List_couponsParameters
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_couponsParameters -> Maybe JsonDateTime
list_couponsParametersQueryEnd_time List_couponsParameters
parameters) (String -> Text
Data.Text.Internal.pack String
"form") Bool
GHC.Types.False
]
)