{-# LANGUAGE ExplicitForAll #-}
{-# LANGUAGE MultiWayIf #-}
{-# LANGUAGE OverloadedStrings #-}
module StripeAPI.Operations.GetCreditNotes where
import qualified Control.Monad.Fail
import qualified Control.Monad.Trans.Reader
import qualified Data.Aeson
import qualified Data.Aeson as Data.Aeson.Encoding.Internal
import qualified Data.Aeson as Data.Aeson.Types
import qualified Data.Aeson as Data.Aeson.Types.FromJSON
import qualified Data.Aeson as Data.Aeson.Types.Internal
import qualified Data.Aeson as Data.Aeson.Types.ToJSON
import qualified Data.ByteString.Char8
import qualified Data.ByteString.Char8 as Data.ByteString.Internal
import qualified Data.Either
import qualified Data.Functor
import qualified Data.Scientific
import qualified Data.Text
import qualified Data.Text.Internal
import qualified Data.Time.Calendar as Data.Time.Calendar.Days
import qualified Data.Time.LocalTime as Data.Time.LocalTime.Internal.ZonedTime
import qualified Data.Vector
import qualified GHC.Base
import qualified GHC.Classes
import qualified GHC.Int
import qualified GHC.Show
import qualified GHC.Types
import qualified Network.HTTP.Client
import qualified Network.HTTP.Client as Network.HTTP.Client.Request
import qualified Network.HTTP.Client as Network.HTTP.Client.Types
import qualified Network.HTTP.Simple
import qualified Network.HTTP.Types
import qualified Network.HTTP.Types as Network.HTTP.Types.Status
import qualified Network.HTTP.Types as Network.HTTP.Types.URI
import qualified StripeAPI.Common
import StripeAPI.Types
import qualified Prelude as GHC.Integer.Type
import qualified Prelude as GHC.Maybe
getCreditNotes ::
forall m.
StripeAPI.Common.MonadHTTP m =>
GetCreditNotesParameters ->
StripeAPI.Common.StripeT m (Network.HTTP.Client.Types.Response GetCreditNotesResponse)
getCreditNotes :: GetCreditNotesParameters
-> StripeT m (Response GetCreditNotesResponse)
getCreditNotes GetCreditNotesParameters
parameters =
(Response ByteString -> Response GetCreditNotesResponse)
-> StripeT m (Response ByteString)
-> StripeT m (Response GetCreditNotesResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
GHC.Base.fmap
( \Response ByteString
response_0 ->
(ByteString -> GetCreditNotesResponse)
-> Response ByteString -> Response GetCreditNotesResponse
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
GHC.Base.fmap
( (String -> GetCreditNotesResponse)
-> (GetCreditNotesResponse -> GetCreditNotesResponse)
-> Either String GetCreditNotesResponse
-> GetCreditNotesResponse
forall a c b. (a -> c) -> (b -> c) -> Either a b -> c
Data.Either.either String -> GetCreditNotesResponse
GetCreditNotesResponseError GetCreditNotesResponse -> GetCreditNotesResponse
forall a. a -> a
GHC.Base.id
(Either String GetCreditNotesResponse -> GetCreditNotesResponse)
-> (ByteString -> Either String GetCreditNotesResponse)
-> ByteString
-> GetCreditNotesResponse
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) ->
GetCreditNotesResponseBody200 -> GetCreditNotesResponse
GetCreditNotesResponse200
(GetCreditNotesResponseBody200 -> GetCreditNotesResponse)
-> Either String GetCreditNotesResponseBody200
-> Either String GetCreditNotesResponse
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Data.Functor.<$> ( ByteString -> Either String GetCreditNotesResponseBody200
forall a. FromJSON a => ByteString -> Either String a
Data.Aeson.eitherDecodeStrict ByteString
body ::
Data.Either.Either
GHC.Base.String
GetCreditNotesResponseBody200
)
| 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 -> GetCreditNotesResponse
GetCreditNotesResponseDefault
(Error -> GetCreditNotesResponse)
-> Either String Error -> Either String GetCreditNotesResponse
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 GetCreditNotesResponse
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] -> StripeT m (Response ByteString)
forall (m :: * -> *).
MonadHTTP m =>
Text -> Text -> [QueryParameter] -> StripeT m (Response ByteString)
StripeAPI.Common.doCallWithConfigurationM
(Text -> Text
Data.Text.toUpper (Text -> Text) -> Text -> Text
forall a b. (a -> b) -> a -> b
GHC.Base.$ String -> Text
Data.Text.pack String
"GET")
(String -> Text
Data.Text.pack String
"/v1/credit_notes")
[ Text -> Maybe Value -> Text -> Bool -> QueryParameter
StripeAPI.Common.QueryParameter (String -> Text
Data.Text.pack String
"customer") (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.<$> GetCreditNotesParameters -> Maybe Text
getCreditNotesParametersQueryCustomer GetCreditNotesParameters
parameters) (String -> Text
Data.Text.pack String
"form") Bool
GHC.Types.True,
Text -> Maybe Value -> Text -> Bool -> QueryParameter
StripeAPI.Common.QueryParameter (String -> Text
Data.Text.pack String
"ending_before") (Text -> Value
forall a. ToJSON a => a -> Value
Data.Aeson.Types.ToJSON.toJSON (Text -> Value) -> Maybe Text -> Maybe Value
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Data.Functor.<$> GetCreditNotesParameters -> Maybe Text
getCreditNotesParametersQueryEndingBefore GetCreditNotesParameters
parameters) (String -> Text
Data.Text.pack String
"form") Bool
GHC.Types.True,
Text -> Maybe Value -> Text -> Bool -> QueryParameter
StripeAPI.Common.QueryParameter (String -> Text
Data.Text.pack String
"expand") ([Text] -> Value
forall a. ToJSON a => a -> Value
Data.Aeson.Types.ToJSON.toJSON ([Text] -> Value) -> Maybe [Text] -> Maybe Value
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Data.Functor.<$> GetCreditNotesParameters -> Maybe [Text]
getCreditNotesParametersQueryExpand GetCreditNotesParameters
parameters) (String -> Text
Data.Text.pack String
"deepObject") Bool
GHC.Types.True,
Text -> Maybe Value -> Text -> Bool -> QueryParameter
StripeAPI.Common.QueryParameter (String -> Text
Data.Text.pack String
"invoice") (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.<$> GetCreditNotesParameters -> Maybe Text
getCreditNotesParametersQueryInvoice GetCreditNotesParameters
parameters) (String -> Text
Data.Text.pack String
"form") Bool
GHC.Types.True,
Text -> Maybe Value -> Text -> Bool -> QueryParameter
StripeAPI.Common.QueryParameter (String -> Text
Data.Text.pack String
"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.<$> GetCreditNotesParameters -> Maybe Int
getCreditNotesParametersQueryLimit GetCreditNotesParameters
parameters) (String -> Text
Data.Text.pack String
"form") Bool
GHC.Types.True,
Text -> Maybe Value -> Text -> Bool -> QueryParameter
StripeAPI.Common.QueryParameter (String -> Text
Data.Text.pack String
"starting_after") (Text -> Value
forall a. ToJSON a => a -> Value
Data.Aeson.Types.ToJSON.toJSON (Text -> Value) -> Maybe Text -> Maybe Value
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Data.Functor.<$> GetCreditNotesParameters -> Maybe Text
getCreditNotesParametersQueryStartingAfter GetCreditNotesParameters
parameters) (String -> Text
Data.Text.pack String
"form") Bool
GHC.Types.True
]
)
data GetCreditNotesParameters = GetCreditNotesParameters
{
GetCreditNotesParameters -> Maybe Text
getCreditNotesParametersQueryCustomer :: (GHC.Maybe.Maybe Data.Text.Internal.Text),
GetCreditNotesParameters -> Maybe Text
getCreditNotesParametersQueryEndingBefore :: (GHC.Maybe.Maybe Data.Text.Internal.Text),
GetCreditNotesParameters -> Maybe [Text]
getCreditNotesParametersQueryExpand :: (GHC.Maybe.Maybe ([Data.Text.Internal.Text])),
GetCreditNotesParameters -> Maybe Text
getCreditNotesParametersQueryInvoice :: (GHC.Maybe.Maybe Data.Text.Internal.Text),
GetCreditNotesParameters -> Maybe Int
getCreditNotesParametersQueryLimit :: (GHC.Maybe.Maybe GHC.Types.Int),
GetCreditNotesParameters -> Maybe Text
getCreditNotesParametersQueryStartingAfter :: (GHC.Maybe.Maybe Data.Text.Internal.Text)
}
deriving
( Int -> GetCreditNotesParameters -> ShowS
[GetCreditNotesParameters] -> ShowS
GetCreditNotesParameters -> String
(Int -> GetCreditNotesParameters -> ShowS)
-> (GetCreditNotesParameters -> String)
-> ([GetCreditNotesParameters] -> ShowS)
-> Show GetCreditNotesParameters
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetCreditNotesParameters] -> ShowS
$cshowList :: [GetCreditNotesParameters] -> ShowS
show :: GetCreditNotesParameters -> String
$cshow :: GetCreditNotesParameters -> String
showsPrec :: Int -> GetCreditNotesParameters -> ShowS
$cshowsPrec :: Int -> GetCreditNotesParameters -> ShowS
GHC.Show.Show,
GetCreditNotesParameters -> GetCreditNotesParameters -> Bool
(GetCreditNotesParameters -> GetCreditNotesParameters -> Bool)
-> (GetCreditNotesParameters -> GetCreditNotesParameters -> Bool)
-> Eq GetCreditNotesParameters
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetCreditNotesParameters -> GetCreditNotesParameters -> Bool
$c/= :: GetCreditNotesParameters -> GetCreditNotesParameters -> Bool
== :: GetCreditNotesParameters -> GetCreditNotesParameters -> Bool
$c== :: GetCreditNotesParameters -> GetCreditNotesParameters -> Bool
GHC.Classes.Eq
)
instance Data.Aeson.Types.ToJSON.ToJSON GetCreditNotesParameters where
toJSON :: GetCreditNotesParameters -> Value
toJSON GetCreditNotesParameters
obj = [Pair] -> Value
Data.Aeson.Types.Internal.object (Text
"queryCustomer" Text -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= GetCreditNotesParameters -> Maybe Text
getCreditNotesParametersQueryCustomer GetCreditNotesParameters
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"queryEnding_before" Text -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= GetCreditNotesParameters -> Maybe Text
getCreditNotesParametersQueryEndingBefore GetCreditNotesParameters
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"queryExpand" Text -> Maybe [Text] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= GetCreditNotesParameters -> Maybe [Text]
getCreditNotesParametersQueryExpand GetCreditNotesParameters
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"queryInvoice" Text -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= GetCreditNotesParameters -> Maybe Text
getCreditNotesParametersQueryInvoice GetCreditNotesParameters
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"queryLimit" Text -> Maybe Int -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= GetCreditNotesParameters -> Maybe Int
getCreditNotesParametersQueryLimit GetCreditNotesParameters
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"queryStarting_after" Text -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= GetCreditNotesParameters -> Maybe Text
getCreditNotesParametersQueryStartingAfter GetCreditNotesParameters
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: [Pair]
forall a. Monoid a => a
GHC.Base.mempty)
toEncoding :: GetCreditNotesParameters -> Encoding
toEncoding GetCreditNotesParameters
obj = Series -> Encoding
Data.Aeson.Encoding.Internal.pairs ((Text
"queryCustomer" Text -> Maybe Text -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= GetCreditNotesParameters -> Maybe Text
getCreditNotesParametersQueryCustomer GetCreditNotesParameters
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"queryEnding_before" Text -> Maybe Text -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= GetCreditNotesParameters -> Maybe Text
getCreditNotesParametersQueryEndingBefore GetCreditNotesParameters
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"queryExpand" Text -> Maybe [Text] -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= GetCreditNotesParameters -> Maybe [Text]
getCreditNotesParametersQueryExpand GetCreditNotesParameters
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"queryInvoice" Text -> Maybe Text -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= GetCreditNotesParameters -> Maybe Text
getCreditNotesParametersQueryInvoice GetCreditNotesParameters
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"queryLimit" Text -> Maybe Int -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= GetCreditNotesParameters -> Maybe Int
getCreditNotesParametersQueryLimit GetCreditNotesParameters
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> (Text
"queryStarting_after" Text -> Maybe Text -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= GetCreditNotesParameters -> Maybe Text
getCreditNotesParametersQueryStartingAfter GetCreditNotesParameters
obj))))))
instance Data.Aeson.Types.FromJSON.FromJSON GetCreditNotesParameters where
parseJSON :: Value -> Parser GetCreditNotesParameters
parseJSON = String
-> (Object -> Parser GetCreditNotesParameters)
-> Value
-> Parser GetCreditNotesParameters
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.Aeson.Types.FromJSON.withObject String
"GetCreditNotesParameters" (\Object
obj -> ((((((Maybe Text
-> Maybe Text
-> Maybe [Text]
-> Maybe Text
-> Maybe Int
-> Maybe Text
-> GetCreditNotesParameters)
-> Parser
(Maybe Text
-> Maybe Text
-> Maybe [Text]
-> Maybe Text
-> Maybe Int
-> Maybe Text
-> GetCreditNotesParameters)
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure Maybe Text
-> Maybe Text
-> Maybe [Text]
-> Maybe Text
-> Maybe Int
-> Maybe Text
-> GetCreditNotesParameters
GetCreditNotesParameters Parser
(Maybe Text
-> Maybe Text
-> Maybe [Text]
-> Maybe Text
-> Maybe Int
-> Maybe Text
-> GetCreditNotesParameters)
-> Parser (Maybe Text)
-> Parser
(Maybe Text
-> Maybe [Text]
-> Maybe Text
-> Maybe Int
-> Maybe Text
-> GetCreditNotesParameters)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Text
"queryCustomer")) Parser
(Maybe Text
-> Maybe [Text]
-> Maybe Text
-> Maybe Int
-> Maybe Text
-> GetCreditNotesParameters)
-> Parser (Maybe Text)
-> Parser
(Maybe [Text]
-> Maybe Text
-> Maybe Int
-> Maybe Text
-> GetCreditNotesParameters)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Text
"queryEnding_before")) Parser
(Maybe [Text]
-> Maybe Text
-> Maybe Int
-> Maybe Text
-> GetCreditNotesParameters)
-> Parser (Maybe [Text])
-> Parser
(Maybe Text -> Maybe Int -> Maybe Text -> GetCreditNotesParameters)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Text -> Parser (Maybe [Text])
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Text
"queryExpand")) Parser
(Maybe Text -> Maybe Int -> Maybe Text -> GetCreditNotesParameters)
-> Parser (Maybe Text)
-> Parser (Maybe Int -> Maybe Text -> GetCreditNotesParameters)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Text
"queryInvoice")) Parser (Maybe Int -> Maybe Text -> GetCreditNotesParameters)
-> Parser (Maybe Int)
-> Parser (Maybe Text -> GetCreditNotesParameters)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Text -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Text
"queryLimit")) Parser (Maybe Text -> GetCreditNotesParameters)
-> Parser (Maybe Text) -> Parser GetCreditNotesParameters
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Text
"queryStarting_after"))
mkGetCreditNotesParameters :: GetCreditNotesParameters
mkGetCreditNotesParameters :: GetCreditNotesParameters
mkGetCreditNotesParameters =
GetCreditNotesParameters :: Maybe Text
-> Maybe Text
-> Maybe [Text]
-> Maybe Text
-> Maybe Int
-> Maybe Text
-> GetCreditNotesParameters
GetCreditNotesParameters
{ getCreditNotesParametersQueryCustomer :: Maybe Text
getCreditNotesParametersQueryCustomer = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing,
getCreditNotesParametersQueryEndingBefore :: Maybe Text
getCreditNotesParametersQueryEndingBefore = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing,
getCreditNotesParametersQueryExpand :: Maybe [Text]
getCreditNotesParametersQueryExpand = Maybe [Text]
forall a. Maybe a
GHC.Maybe.Nothing,
getCreditNotesParametersQueryInvoice :: Maybe Text
getCreditNotesParametersQueryInvoice = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing,
getCreditNotesParametersQueryLimit :: Maybe Int
getCreditNotesParametersQueryLimit = Maybe Int
forall a. Maybe a
GHC.Maybe.Nothing,
getCreditNotesParametersQueryStartingAfter :: Maybe Text
getCreditNotesParametersQueryStartingAfter = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing
}
data GetCreditNotesResponse
=
GetCreditNotesResponseError GHC.Base.String
|
GetCreditNotesResponse200 GetCreditNotesResponseBody200
|
GetCreditNotesResponseDefault Error
deriving (Int -> GetCreditNotesResponse -> ShowS
[GetCreditNotesResponse] -> ShowS
GetCreditNotesResponse -> String
(Int -> GetCreditNotesResponse -> ShowS)
-> (GetCreditNotesResponse -> String)
-> ([GetCreditNotesResponse] -> ShowS)
-> Show GetCreditNotesResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetCreditNotesResponse] -> ShowS
$cshowList :: [GetCreditNotesResponse] -> ShowS
show :: GetCreditNotesResponse -> String
$cshow :: GetCreditNotesResponse -> String
showsPrec :: Int -> GetCreditNotesResponse -> ShowS
$cshowsPrec :: Int -> GetCreditNotesResponse -> ShowS
GHC.Show.Show, GetCreditNotesResponse -> GetCreditNotesResponse -> Bool
(GetCreditNotesResponse -> GetCreditNotesResponse -> Bool)
-> (GetCreditNotesResponse -> GetCreditNotesResponse -> Bool)
-> Eq GetCreditNotesResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetCreditNotesResponse -> GetCreditNotesResponse -> Bool
$c/= :: GetCreditNotesResponse -> GetCreditNotesResponse -> Bool
== :: GetCreditNotesResponse -> GetCreditNotesResponse -> Bool
$c== :: GetCreditNotesResponse -> GetCreditNotesResponse -> Bool
GHC.Classes.Eq)
data GetCreditNotesResponseBody200 = GetCreditNotesResponseBody200
{
GetCreditNotesResponseBody200 -> [CreditNote]
getCreditNotesResponseBody200Data :: ([CreditNote]),
GetCreditNotesResponseBody200 -> Bool
getCreditNotesResponseBody200HasMore :: GHC.Types.Bool,
GetCreditNotesResponseBody200 -> Text
getCreditNotesResponseBody200Url :: Data.Text.Internal.Text
}
deriving
( Int -> GetCreditNotesResponseBody200 -> ShowS
[GetCreditNotesResponseBody200] -> ShowS
GetCreditNotesResponseBody200 -> String
(Int -> GetCreditNotesResponseBody200 -> ShowS)
-> (GetCreditNotesResponseBody200 -> String)
-> ([GetCreditNotesResponseBody200] -> ShowS)
-> Show GetCreditNotesResponseBody200
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetCreditNotesResponseBody200] -> ShowS
$cshowList :: [GetCreditNotesResponseBody200] -> ShowS
show :: GetCreditNotesResponseBody200 -> String
$cshow :: GetCreditNotesResponseBody200 -> String
showsPrec :: Int -> GetCreditNotesResponseBody200 -> ShowS
$cshowsPrec :: Int -> GetCreditNotesResponseBody200 -> ShowS
GHC.Show.Show,
GetCreditNotesResponseBody200
-> GetCreditNotesResponseBody200 -> Bool
(GetCreditNotesResponseBody200
-> GetCreditNotesResponseBody200 -> Bool)
-> (GetCreditNotesResponseBody200
-> GetCreditNotesResponseBody200 -> Bool)
-> Eq GetCreditNotesResponseBody200
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetCreditNotesResponseBody200
-> GetCreditNotesResponseBody200 -> Bool
$c/= :: GetCreditNotesResponseBody200
-> GetCreditNotesResponseBody200 -> Bool
== :: GetCreditNotesResponseBody200
-> GetCreditNotesResponseBody200 -> Bool
$c== :: GetCreditNotesResponseBody200
-> GetCreditNotesResponseBody200 -> Bool
GHC.Classes.Eq
)
instance Data.Aeson.Types.ToJSON.ToJSON GetCreditNotesResponseBody200 where
toJSON :: GetCreditNotesResponseBody200 -> Value
toJSON GetCreditNotesResponseBody200
obj = [Pair] -> Value
Data.Aeson.Types.Internal.object (Text
"data" Text -> [CreditNote] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= GetCreditNotesResponseBody200 -> [CreditNote]
getCreditNotesResponseBody200Data GetCreditNotesResponseBody200
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"has_more" Text -> Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= GetCreditNotesResponseBody200 -> Bool
getCreditNotesResponseBody200HasMore GetCreditNotesResponseBody200
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"url" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= GetCreditNotesResponseBody200 -> Text
getCreditNotesResponseBody200Url GetCreditNotesResponseBody200
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"object" Text -> Value -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= Text -> Value
Data.Aeson.Types.Internal.String Text
"list" Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: [Pair]
forall a. Monoid a => a
GHC.Base.mempty)
toEncoding :: GetCreditNotesResponseBody200 -> Encoding
toEncoding GetCreditNotesResponseBody200
obj = Series -> Encoding
Data.Aeson.Encoding.Internal.pairs ((Text
"data" Text -> [CreditNote] -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= GetCreditNotesResponseBody200 -> [CreditNote]
getCreditNotesResponseBody200Data GetCreditNotesResponseBody200
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"has_more" Text -> Bool -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= GetCreditNotesResponseBody200 -> Bool
getCreditNotesResponseBody200HasMore GetCreditNotesResponseBody200
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"url" Text -> Text -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= GetCreditNotesResponseBody200 -> Text
getCreditNotesResponseBody200Url GetCreditNotesResponseBody200
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> (Text
"object" Text -> Value -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= Text -> Value
Data.Aeson.Types.Internal.String Text
"list"))))
instance Data.Aeson.Types.FromJSON.FromJSON GetCreditNotesResponseBody200 where
parseJSON :: Value -> Parser GetCreditNotesResponseBody200
parseJSON = String
-> (Object -> Parser GetCreditNotesResponseBody200)
-> Value
-> Parser GetCreditNotesResponseBody200
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.Aeson.Types.FromJSON.withObject String
"GetCreditNotesResponseBody200" (\Object
obj -> ((([CreditNote] -> Bool -> Text -> GetCreditNotesResponseBody200)
-> Parser
([CreditNote] -> Bool -> Text -> GetCreditNotesResponseBody200)
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure [CreditNote] -> Bool -> Text -> GetCreditNotesResponseBody200
GetCreditNotesResponseBody200 Parser
([CreditNote] -> Bool -> Text -> GetCreditNotesResponseBody200)
-> Parser [CreditNote]
-> Parser (Bool -> Text -> GetCreditNotesResponseBody200)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Text -> Parser [CreditNote]
forall a. FromJSON a => Object -> Text -> Parser a
Data.Aeson.Types.FromJSON..: Text
"data")) Parser (Bool -> Text -> GetCreditNotesResponseBody200)
-> Parser Bool -> Parser (Text -> GetCreditNotesResponseBody200)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Text -> Parser Bool
forall a. FromJSON a => Object -> Text -> Parser a
Data.Aeson.Types.FromJSON..: Text
"has_more")) Parser (Text -> GetCreditNotesResponseBody200)
-> Parser Text -> Parser GetCreditNotesResponseBody200
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Data.Aeson.Types.FromJSON..: Text
"url"))
mkGetCreditNotesResponseBody200 ::
[CreditNote] ->
GHC.Types.Bool ->
Data.Text.Internal.Text ->
GetCreditNotesResponseBody200
mkGetCreditNotesResponseBody200 :: [CreditNote] -> Bool -> Text -> GetCreditNotesResponseBody200
mkGetCreditNotesResponseBody200 [CreditNote]
getCreditNotesResponseBody200Data Bool
getCreditNotesResponseBody200HasMore Text
getCreditNotesResponseBody200Url =
GetCreditNotesResponseBody200 :: [CreditNote] -> Bool -> Text -> GetCreditNotesResponseBody200
GetCreditNotesResponseBody200
{ getCreditNotesResponseBody200Data :: [CreditNote]
getCreditNotesResponseBody200Data = [CreditNote]
getCreditNotesResponseBody200Data,
getCreditNotesResponseBody200HasMore :: Bool
getCreditNotesResponseBody200HasMore = Bool
getCreditNotesResponseBody200HasMore,
getCreditNotesResponseBody200Url :: Text
getCreditNotesResponseBody200Url = Text
getCreditNotesResponseBody200Url
}