{-# LANGUAGE ExplicitForAll #-}
{-# LANGUAGE MultiWayIf #-}
{-# LANGUAGE OverloadedStrings #-}
module StripeAPI.Operations.PostPromotionCodesPromotionCode 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
postPromotionCodesPromotionCode ::
forall m.
StripeAPI.Common.MonadHTTP m =>
Data.Text.Internal.Text ->
GHC.Maybe.Maybe PostPromotionCodesPromotionCodeRequestBody ->
StripeAPI.Common.ClientT m (Network.HTTP.Client.Types.Response PostPromotionCodesPromotionCodeResponse)
postPromotionCodesPromotionCode :: Text
-> Maybe PostPromotionCodesPromotionCodeRequestBody
-> ClientT m (Response PostPromotionCodesPromotionCodeResponse)
postPromotionCodesPromotionCode
Text
promotionCode
Maybe PostPromotionCodesPromotionCodeRequestBody
body =
(Response ByteString
-> Response PostPromotionCodesPromotionCodeResponse)
-> ClientT m (Response ByteString)
-> ClientT m (Response PostPromotionCodesPromotionCodeResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
GHC.Base.fmap
( \Response ByteString
response_0 ->
(ByteString -> PostPromotionCodesPromotionCodeResponse)
-> Response ByteString
-> Response PostPromotionCodesPromotionCodeResponse
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
GHC.Base.fmap
( (String -> PostPromotionCodesPromotionCodeResponse)
-> (PostPromotionCodesPromotionCodeResponse
-> PostPromotionCodesPromotionCodeResponse)
-> Either String PostPromotionCodesPromotionCodeResponse
-> PostPromotionCodesPromotionCodeResponse
forall a c b. (a -> c) -> (b -> c) -> Either a b -> c
Data.Either.either String -> PostPromotionCodesPromotionCodeResponse
PostPromotionCodesPromotionCodeResponseError PostPromotionCodesPromotionCodeResponse
-> PostPromotionCodesPromotionCodeResponse
forall a. a -> a
GHC.Base.id
(Either String PostPromotionCodesPromotionCodeResponse
-> PostPromotionCodesPromotionCodeResponse)
-> (ByteString
-> Either String PostPromotionCodesPromotionCodeResponse)
-> ByteString
-> PostPromotionCodesPromotionCodeResponse
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) ->
PromotionCode -> PostPromotionCodesPromotionCodeResponse
PostPromotionCodesPromotionCodeResponse200
(PromotionCode -> PostPromotionCodesPromotionCodeResponse)
-> Either String PromotionCode
-> Either String PostPromotionCodesPromotionCodeResponse
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Data.Functor.<$> ( ByteString -> Either String PromotionCode
forall a. FromJSON a => ByteString -> Either String a
Data.Aeson.eitherDecodeStrict ByteString
body ::
Data.Either.Either
GHC.Base.String
PromotionCode
)
| 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 -> PostPromotionCodesPromotionCodeResponse
PostPromotionCodesPromotionCodeResponseDefault
(Error -> PostPromotionCodesPromotionCodeResponse)
-> Either String Error
-> Either String PostPromotionCodesPromotionCodeResponse
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 PostPromotionCodesPromotionCodeResponse
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]
-> Maybe PostPromotionCodesPromotionCodeRequestBody
-> RequestBodyEncoding
-> ClientT m (Response ByteString)
forall (m :: * -> *) body.
(MonadHTTP m, ToJSON body) =>
Text
-> Text
-> [QueryParameter]
-> Maybe body
-> RequestBodyEncoding
-> ClientT m (Response ByteString)
StripeAPI.Common.doBodyCallWithConfigurationM (Text -> Text
Data.Text.toUpper (Text -> Text) -> Text -> Text
forall a b. (a -> b) -> a -> b
GHC.Base.$ String -> Text
Data.Text.pack String
"POST") (String -> Text
Data.Text.pack (String
"/v1/promotion_codes/" String -> String -> String
forall a. [a] -> [a] -> [a]
GHC.Base.++ (ByteString -> String
Data.ByteString.Char8.unpack (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.$ (String -> ByteString
Data.ByteString.Char8.pack (String -> ByteString) -> String -> ByteString
forall a b. (a -> b) -> a -> b
GHC.Base.$ Text -> String
forall a. StringifyModel a => a -> String
StripeAPI.Common.stringifyModel Text
promotionCode)) String -> String -> String
forall a. [a] -> [a] -> [a]
GHC.Base.++ String
""))) [QueryParameter]
forall a. Monoid a => a
GHC.Base.mempty Maybe PostPromotionCodesPromotionCodeRequestBody
body RequestBodyEncoding
StripeAPI.Common.RequestBodyEncodingFormData)
data PostPromotionCodesPromotionCodeRequestBody = PostPromotionCodesPromotionCodeRequestBody
{
PostPromotionCodesPromotionCodeRequestBody -> Maybe Bool
postPromotionCodesPromotionCodeRequestBodyActive :: (GHC.Maybe.Maybe GHC.Types.Bool),
PostPromotionCodesPromotionCodeRequestBody -> Maybe [Text]
postPromotionCodesPromotionCodeRequestBodyExpand :: (GHC.Maybe.Maybe ([Data.Text.Internal.Text])),
PostPromotionCodesPromotionCodeRequestBody
-> Maybe
PostPromotionCodesPromotionCodeRequestBodyMetadata'Variants
postPromotionCodesPromotionCodeRequestBodyMetadata :: (GHC.Maybe.Maybe PostPromotionCodesPromotionCodeRequestBodyMetadata'Variants)
}
deriving
( Int
-> PostPromotionCodesPromotionCodeRequestBody -> String -> String
[PostPromotionCodesPromotionCodeRequestBody] -> String -> String
PostPromotionCodesPromotionCodeRequestBody -> String
(Int
-> PostPromotionCodesPromotionCodeRequestBody -> String -> String)
-> (PostPromotionCodesPromotionCodeRequestBody -> String)
-> ([PostPromotionCodesPromotionCodeRequestBody]
-> String -> String)
-> Show PostPromotionCodesPromotionCodeRequestBody
forall a.
(Int -> a -> String -> String)
-> (a -> String) -> ([a] -> String -> String) -> Show a
showList :: [PostPromotionCodesPromotionCodeRequestBody] -> String -> String
$cshowList :: [PostPromotionCodesPromotionCodeRequestBody] -> String -> String
show :: PostPromotionCodesPromotionCodeRequestBody -> String
$cshow :: PostPromotionCodesPromotionCodeRequestBody -> String
showsPrec :: Int
-> PostPromotionCodesPromotionCodeRequestBody -> String -> String
$cshowsPrec :: Int
-> PostPromotionCodesPromotionCodeRequestBody -> String -> String
GHC.Show.Show,
PostPromotionCodesPromotionCodeRequestBody
-> PostPromotionCodesPromotionCodeRequestBody -> Bool
(PostPromotionCodesPromotionCodeRequestBody
-> PostPromotionCodesPromotionCodeRequestBody -> Bool)
-> (PostPromotionCodesPromotionCodeRequestBody
-> PostPromotionCodesPromotionCodeRequestBody -> Bool)
-> Eq PostPromotionCodesPromotionCodeRequestBody
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PostPromotionCodesPromotionCodeRequestBody
-> PostPromotionCodesPromotionCodeRequestBody -> Bool
$c/= :: PostPromotionCodesPromotionCodeRequestBody
-> PostPromotionCodesPromotionCodeRequestBody -> Bool
== :: PostPromotionCodesPromotionCodeRequestBody
-> PostPromotionCodesPromotionCodeRequestBody -> Bool
$c== :: PostPromotionCodesPromotionCodeRequestBody
-> PostPromotionCodesPromotionCodeRequestBody -> Bool
GHC.Classes.Eq
)
instance Data.Aeson.Types.ToJSON.ToJSON PostPromotionCodesPromotionCodeRequestBody where
toJSON :: PostPromotionCodesPromotionCodeRequestBody -> Value
toJSON PostPromotionCodesPromotionCodeRequestBody
obj = [Pair] -> Value
Data.Aeson.Types.Internal.object (Text
"active" Text -> Maybe Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= PostPromotionCodesPromotionCodeRequestBody -> Maybe Bool
postPromotionCodesPromotionCodeRequestBodyActive PostPromotionCodesPromotionCodeRequestBody
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"expand" Text -> Maybe [Text] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= PostPromotionCodesPromotionCodeRequestBody -> Maybe [Text]
postPromotionCodesPromotionCodeRequestBodyExpand PostPromotionCodesPromotionCodeRequestBody
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"metadata" Text
-> Maybe
PostPromotionCodesPromotionCodeRequestBodyMetadata'Variants
-> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= PostPromotionCodesPromotionCodeRequestBody
-> Maybe
PostPromotionCodesPromotionCodeRequestBodyMetadata'Variants
postPromotionCodesPromotionCodeRequestBodyMetadata PostPromotionCodesPromotionCodeRequestBody
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: [Pair]
forall a. Monoid a => a
GHC.Base.mempty)
toEncoding :: PostPromotionCodesPromotionCodeRequestBody -> Encoding
toEncoding PostPromotionCodesPromotionCodeRequestBody
obj = Series -> Encoding
Data.Aeson.Encoding.Internal.pairs ((Text
"active" Text -> Maybe Bool -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= PostPromotionCodesPromotionCodeRequestBody -> Maybe Bool
postPromotionCodesPromotionCodeRequestBodyActive PostPromotionCodesPromotionCodeRequestBody
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"expand" Text -> Maybe [Text] -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= PostPromotionCodesPromotionCodeRequestBody -> Maybe [Text]
postPromotionCodesPromotionCodeRequestBodyExpand PostPromotionCodesPromotionCodeRequestBody
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> (Text
"metadata" Text
-> Maybe
PostPromotionCodesPromotionCodeRequestBodyMetadata'Variants
-> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= PostPromotionCodesPromotionCodeRequestBody
-> Maybe
PostPromotionCodesPromotionCodeRequestBodyMetadata'Variants
postPromotionCodesPromotionCodeRequestBodyMetadata PostPromotionCodesPromotionCodeRequestBody
obj)))
instance Data.Aeson.Types.FromJSON.FromJSON PostPromotionCodesPromotionCodeRequestBody where
parseJSON :: Value -> Parser PostPromotionCodesPromotionCodeRequestBody
parseJSON = String
-> (Object -> Parser PostPromotionCodesPromotionCodeRequestBody)
-> Value
-> Parser PostPromotionCodesPromotionCodeRequestBody
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.Aeson.Types.FromJSON.withObject String
"PostPromotionCodesPromotionCodeRequestBody" (\Object
obj -> (((Maybe Bool
-> Maybe [Text]
-> Maybe
PostPromotionCodesPromotionCodeRequestBodyMetadata'Variants
-> PostPromotionCodesPromotionCodeRequestBody)
-> Parser
(Maybe Bool
-> Maybe [Text]
-> Maybe
PostPromotionCodesPromotionCodeRequestBodyMetadata'Variants
-> PostPromotionCodesPromotionCodeRequestBody)
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure Maybe Bool
-> Maybe [Text]
-> Maybe
PostPromotionCodesPromotionCodeRequestBodyMetadata'Variants
-> PostPromotionCodesPromotionCodeRequestBody
PostPromotionCodesPromotionCodeRequestBody Parser
(Maybe Bool
-> Maybe [Text]
-> Maybe
PostPromotionCodesPromotionCodeRequestBodyMetadata'Variants
-> PostPromotionCodesPromotionCodeRequestBody)
-> Parser (Maybe Bool)
-> Parser
(Maybe [Text]
-> Maybe
PostPromotionCodesPromotionCodeRequestBodyMetadata'Variants
-> PostPromotionCodesPromotionCodeRequestBody)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object -> Text -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Text
"active")) Parser
(Maybe [Text]
-> Maybe
PostPromotionCodesPromotionCodeRequestBodyMetadata'Variants
-> PostPromotionCodesPromotionCodeRequestBody)
-> Parser (Maybe [Text])
-> Parser
(Maybe PostPromotionCodesPromotionCodeRequestBodyMetadata'Variants
-> PostPromotionCodesPromotionCodeRequestBody)
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
"expand")) Parser
(Maybe PostPromotionCodesPromotionCodeRequestBodyMetadata'Variants
-> PostPromotionCodesPromotionCodeRequestBody)
-> Parser
(Maybe PostPromotionCodesPromotionCodeRequestBodyMetadata'Variants)
-> Parser PostPromotionCodesPromotionCodeRequestBody
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object
-> Text
-> Parser
(Maybe PostPromotionCodesPromotionCodeRequestBodyMetadata'Variants)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Text
"metadata"))
mkPostPromotionCodesPromotionCodeRequestBody :: PostPromotionCodesPromotionCodeRequestBody
mkPostPromotionCodesPromotionCodeRequestBody :: PostPromotionCodesPromotionCodeRequestBody
mkPostPromotionCodesPromotionCodeRequestBody =
PostPromotionCodesPromotionCodeRequestBody :: Maybe Bool
-> Maybe [Text]
-> Maybe
PostPromotionCodesPromotionCodeRequestBodyMetadata'Variants
-> PostPromotionCodesPromotionCodeRequestBody
PostPromotionCodesPromotionCodeRequestBody
{ postPromotionCodesPromotionCodeRequestBodyActive :: Maybe Bool
postPromotionCodesPromotionCodeRequestBodyActive = Maybe Bool
forall a. Maybe a
GHC.Maybe.Nothing,
postPromotionCodesPromotionCodeRequestBodyExpand :: Maybe [Text]
postPromotionCodesPromotionCodeRequestBodyExpand = Maybe [Text]
forall a. Maybe a
GHC.Maybe.Nothing,
postPromotionCodesPromotionCodeRequestBodyMetadata :: Maybe PostPromotionCodesPromotionCodeRequestBodyMetadata'Variants
postPromotionCodesPromotionCodeRequestBodyMetadata = Maybe PostPromotionCodesPromotionCodeRequestBodyMetadata'Variants
forall a. Maybe a
GHC.Maybe.Nothing
}
data PostPromotionCodesPromotionCodeRequestBodyMetadata'Variants
=
PostPromotionCodesPromotionCodeRequestBodyMetadata'EmptyString
| PostPromotionCodesPromotionCodeRequestBodyMetadata'Object Data.Aeson.Types.Internal.Object
deriving (Int
-> PostPromotionCodesPromotionCodeRequestBodyMetadata'Variants
-> String
-> String
[PostPromotionCodesPromotionCodeRequestBodyMetadata'Variants]
-> String -> String
PostPromotionCodesPromotionCodeRequestBodyMetadata'Variants
-> String
(Int
-> PostPromotionCodesPromotionCodeRequestBodyMetadata'Variants
-> String
-> String)
-> (PostPromotionCodesPromotionCodeRequestBodyMetadata'Variants
-> String)
-> ([PostPromotionCodesPromotionCodeRequestBodyMetadata'Variants]
-> String -> String)
-> Show PostPromotionCodesPromotionCodeRequestBodyMetadata'Variants
forall a.
(Int -> a -> String -> String)
-> (a -> String) -> ([a] -> String -> String) -> Show a
showList :: [PostPromotionCodesPromotionCodeRequestBodyMetadata'Variants]
-> String -> String
$cshowList :: [PostPromotionCodesPromotionCodeRequestBodyMetadata'Variants]
-> String -> String
show :: PostPromotionCodesPromotionCodeRequestBodyMetadata'Variants
-> String
$cshow :: PostPromotionCodesPromotionCodeRequestBodyMetadata'Variants
-> String
showsPrec :: Int
-> PostPromotionCodesPromotionCodeRequestBodyMetadata'Variants
-> String
-> String
$cshowsPrec :: Int
-> PostPromotionCodesPromotionCodeRequestBodyMetadata'Variants
-> String
-> String
GHC.Show.Show, PostPromotionCodesPromotionCodeRequestBodyMetadata'Variants
-> PostPromotionCodesPromotionCodeRequestBodyMetadata'Variants
-> Bool
(PostPromotionCodesPromotionCodeRequestBodyMetadata'Variants
-> PostPromotionCodesPromotionCodeRequestBodyMetadata'Variants
-> Bool)
-> (PostPromotionCodesPromotionCodeRequestBodyMetadata'Variants
-> PostPromotionCodesPromotionCodeRequestBodyMetadata'Variants
-> Bool)
-> Eq PostPromotionCodesPromotionCodeRequestBodyMetadata'Variants
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PostPromotionCodesPromotionCodeRequestBodyMetadata'Variants
-> PostPromotionCodesPromotionCodeRequestBodyMetadata'Variants
-> Bool
$c/= :: PostPromotionCodesPromotionCodeRequestBodyMetadata'Variants
-> PostPromotionCodesPromotionCodeRequestBodyMetadata'Variants
-> Bool
== :: PostPromotionCodesPromotionCodeRequestBodyMetadata'Variants
-> PostPromotionCodesPromotionCodeRequestBodyMetadata'Variants
-> Bool
$c== :: PostPromotionCodesPromotionCodeRequestBodyMetadata'Variants
-> PostPromotionCodesPromotionCodeRequestBodyMetadata'Variants
-> Bool
GHC.Classes.Eq)
instance Data.Aeson.Types.ToJSON.ToJSON PostPromotionCodesPromotionCodeRequestBodyMetadata'Variants where
toJSON :: PostPromotionCodesPromotionCodeRequestBodyMetadata'Variants
-> Value
toJSON (PostPromotionCodesPromotionCodeRequestBodyMetadata'Object Object
a) = Object -> Value
forall a. ToJSON a => a -> Value
Data.Aeson.Types.ToJSON.toJSON Object
a
toJSON (PostPromotionCodesPromotionCodeRequestBodyMetadata'Variants
PostPromotionCodesPromotionCodeRequestBodyMetadata'EmptyString) = Value
""
instance Data.Aeson.Types.FromJSON.FromJSON PostPromotionCodesPromotionCodeRequestBodyMetadata'Variants where
parseJSON :: Value
-> Parser
PostPromotionCodesPromotionCodeRequestBodyMetadata'Variants
parseJSON Value
val =
if
| Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"" -> PostPromotionCodesPromotionCodeRequestBodyMetadata'Variants
-> Parser
PostPromotionCodesPromotionCodeRequestBodyMetadata'Variants
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure PostPromotionCodesPromotionCodeRequestBodyMetadata'Variants
PostPromotionCodesPromotionCodeRequestBodyMetadata'EmptyString
| Bool
GHC.Base.otherwise -> case (Object
-> PostPromotionCodesPromotionCodeRequestBodyMetadata'Variants
PostPromotionCodesPromotionCodeRequestBodyMetadata'Object (Object
-> PostPromotionCodesPromotionCodeRequestBodyMetadata'Variants)
-> Result Object
-> Result
PostPromotionCodesPromotionCodeRequestBodyMetadata'Variants
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Data.Functor.<$> Value -> Result Object
forall a. FromJSON a => Value -> Result a
Data.Aeson.Types.FromJSON.fromJSON Value
val) Result PostPromotionCodesPromotionCodeRequestBodyMetadata'Variants
-> Result
PostPromotionCodesPromotionCodeRequestBodyMetadata'Variants
-> Result
PostPromotionCodesPromotionCodeRequestBodyMetadata'Variants
forall (f :: * -> *) a. Alternative f => f a -> f a -> f a
GHC.Base.<|> String
-> Result
PostPromotionCodesPromotionCodeRequestBodyMetadata'Variants
forall a. String -> Result a
Data.Aeson.Types.Internal.Error String
"No variant matched" of
Data.Aeson.Types.Internal.Success PostPromotionCodesPromotionCodeRequestBodyMetadata'Variants
a -> PostPromotionCodesPromotionCodeRequestBodyMetadata'Variants
-> Parser
PostPromotionCodesPromotionCodeRequestBodyMetadata'Variants
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure PostPromotionCodesPromotionCodeRequestBodyMetadata'Variants
a
Data.Aeson.Types.Internal.Error String
a -> String
-> Parser
PostPromotionCodesPromotionCodeRequestBodyMetadata'Variants
forall (m :: * -> *) a. MonadFail m => String -> m a
Control.Monad.Fail.fail String
a
data PostPromotionCodesPromotionCodeResponse
=
PostPromotionCodesPromotionCodeResponseError GHC.Base.String
|
PostPromotionCodesPromotionCodeResponse200 PromotionCode
|
PostPromotionCodesPromotionCodeResponseDefault Error
deriving (Int -> PostPromotionCodesPromotionCodeResponse -> String -> String
[PostPromotionCodesPromotionCodeResponse] -> String -> String
PostPromotionCodesPromotionCodeResponse -> String
(Int
-> PostPromotionCodesPromotionCodeResponse -> String -> String)
-> (PostPromotionCodesPromotionCodeResponse -> String)
-> ([PostPromotionCodesPromotionCodeResponse] -> String -> String)
-> Show PostPromotionCodesPromotionCodeResponse
forall a.
(Int -> a -> String -> String)
-> (a -> String) -> ([a] -> String -> String) -> Show a
showList :: [PostPromotionCodesPromotionCodeResponse] -> String -> String
$cshowList :: [PostPromotionCodesPromotionCodeResponse] -> String -> String
show :: PostPromotionCodesPromotionCodeResponse -> String
$cshow :: PostPromotionCodesPromotionCodeResponse -> String
showsPrec :: Int -> PostPromotionCodesPromotionCodeResponse -> String -> String
$cshowsPrec :: Int -> PostPromotionCodesPromotionCodeResponse -> String -> String
GHC.Show.Show, PostPromotionCodesPromotionCodeResponse
-> PostPromotionCodesPromotionCodeResponse -> Bool
(PostPromotionCodesPromotionCodeResponse
-> PostPromotionCodesPromotionCodeResponse -> Bool)
-> (PostPromotionCodesPromotionCodeResponse
-> PostPromotionCodesPromotionCodeResponse -> Bool)
-> Eq PostPromotionCodesPromotionCodeResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PostPromotionCodesPromotionCodeResponse
-> PostPromotionCodesPromotionCodeResponse -> Bool
$c/= :: PostPromotionCodesPromotionCodeResponse
-> PostPromotionCodesPromotionCodeResponse -> Bool
== :: PostPromotionCodesPromotionCodeResponse
-> PostPromotionCodesPromotionCodeResponse -> Bool
$c== :: PostPromotionCodesPromotionCodeResponse
-> PostPromotionCodesPromotionCodeResponse -> Bool
GHC.Classes.Eq)