{-# LANGUAGE MultiWayIf #-}
-- CHANGE WITH CAUTION: This is a generated code file generated by https://github.com/Haskell-OpenAPI-Code-Generator/Haskell-OpenAPI-Client-Code-Generator.
{-# LANGUAGE OverloadedStrings #-}

-- | Contains the types generated from the schema IssuingDisputeNotReceivedEvidence
module StripeAPI.Types.IssuingDisputeNotReceivedEvidence where

import qualified Control.Monad.Fail
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.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 GHC.Base
import qualified GHC.Classes
import qualified GHC.Int
import qualified GHC.Show
import qualified GHC.Types
import qualified StripeAPI.Common
import StripeAPI.TypeAlias
import {-# SOURCE #-} StripeAPI.Types.File
import qualified Prelude as GHC.Integer.Type
import qualified Prelude as GHC.Maybe

-- | Defines the object schema located at @components.schemas.issuing_dispute_not_received_evidence@ in the specification.
data IssuingDisputeNotReceivedEvidence = IssuingDisputeNotReceivedEvidence
  { -- | additional_documentation: (ID of a [file upload](https:\/\/stripe.com\/docs\/guides\/file-upload)) Additional documentation supporting the dispute.
    IssuingDisputeNotReceivedEvidence
-> Maybe
     IssuingDisputeNotReceivedEvidenceAdditionalDocumentation'Variants
issuingDisputeNotReceivedEvidenceAdditionalDocumentation :: (GHC.Maybe.Maybe IssuingDisputeNotReceivedEvidenceAdditionalDocumentation'Variants),
    -- | expected_at: Date when the cardholder expected to receive the product.
    IssuingDisputeNotReceivedEvidence -> Maybe Int
issuingDisputeNotReceivedEvidenceExpectedAt :: (GHC.Maybe.Maybe GHC.Types.Int),
    -- | explanation: Explanation of why the cardholder is disputing this transaction.
    --
    -- Constraints:
    --
    -- * Maximum length of 5000
    IssuingDisputeNotReceivedEvidence -> Maybe Text
issuingDisputeNotReceivedEvidenceExplanation :: (GHC.Maybe.Maybe Data.Text.Internal.Text),
    -- | product_description: Description of the merchandise or service that was purchased.
    --
    -- Constraints:
    --
    -- * Maximum length of 5000
    IssuingDisputeNotReceivedEvidence -> Maybe Text
issuingDisputeNotReceivedEvidenceProductDescription :: (GHC.Maybe.Maybe Data.Text.Internal.Text),
    -- | product_type: Whether the product was a merchandise or service.
    IssuingDisputeNotReceivedEvidence
-> Maybe IssuingDisputeNotReceivedEvidenceProductType'
issuingDisputeNotReceivedEvidenceProductType :: (GHC.Maybe.Maybe IssuingDisputeNotReceivedEvidenceProductType')
  }
  deriving
    ( Int -> IssuingDisputeNotReceivedEvidence -> ShowS
[IssuingDisputeNotReceivedEvidence] -> ShowS
IssuingDisputeNotReceivedEvidence -> String
(Int -> IssuingDisputeNotReceivedEvidence -> ShowS)
-> (IssuingDisputeNotReceivedEvidence -> String)
-> ([IssuingDisputeNotReceivedEvidence] -> ShowS)
-> Show IssuingDisputeNotReceivedEvidence
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [IssuingDisputeNotReceivedEvidence] -> ShowS
$cshowList :: [IssuingDisputeNotReceivedEvidence] -> ShowS
show :: IssuingDisputeNotReceivedEvidence -> String
$cshow :: IssuingDisputeNotReceivedEvidence -> String
showsPrec :: Int -> IssuingDisputeNotReceivedEvidence -> ShowS
$cshowsPrec :: Int -> IssuingDisputeNotReceivedEvidence -> ShowS
GHC.Show.Show,
      IssuingDisputeNotReceivedEvidence
-> IssuingDisputeNotReceivedEvidence -> Bool
(IssuingDisputeNotReceivedEvidence
 -> IssuingDisputeNotReceivedEvidence -> Bool)
-> (IssuingDisputeNotReceivedEvidence
    -> IssuingDisputeNotReceivedEvidence -> Bool)
-> Eq IssuingDisputeNotReceivedEvidence
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: IssuingDisputeNotReceivedEvidence
-> IssuingDisputeNotReceivedEvidence -> Bool
$c/= :: IssuingDisputeNotReceivedEvidence
-> IssuingDisputeNotReceivedEvidence -> Bool
== :: IssuingDisputeNotReceivedEvidence
-> IssuingDisputeNotReceivedEvidence -> Bool
$c== :: IssuingDisputeNotReceivedEvidence
-> IssuingDisputeNotReceivedEvidence -> Bool
GHC.Classes.Eq
    )

instance Data.Aeson.Types.ToJSON.ToJSON IssuingDisputeNotReceivedEvidence where
  toJSON :: IssuingDisputeNotReceivedEvidence -> Value
toJSON IssuingDisputeNotReceivedEvidence
obj = [Pair] -> Value
Data.Aeson.Types.Internal.object (Text
"additional_documentation" Text
-> Maybe
     IssuingDisputeNotReceivedEvidenceAdditionalDocumentation'Variants
-> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= IssuingDisputeNotReceivedEvidence
-> Maybe
     IssuingDisputeNotReceivedEvidenceAdditionalDocumentation'Variants
issuingDisputeNotReceivedEvidenceAdditionalDocumentation IssuingDisputeNotReceivedEvidence
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"expected_at" Text -> Maybe Int -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= IssuingDisputeNotReceivedEvidence -> Maybe Int
issuingDisputeNotReceivedEvidenceExpectedAt IssuingDisputeNotReceivedEvidence
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"explanation" Text -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= IssuingDisputeNotReceivedEvidence -> Maybe Text
issuingDisputeNotReceivedEvidenceExplanation IssuingDisputeNotReceivedEvidence
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"product_description" Text -> Maybe Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= IssuingDisputeNotReceivedEvidence -> Maybe Text
issuingDisputeNotReceivedEvidenceProductDescription IssuingDisputeNotReceivedEvidence
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"product_type" Text -> Maybe IssuingDisputeNotReceivedEvidenceProductType' -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= IssuingDisputeNotReceivedEvidence
-> Maybe IssuingDisputeNotReceivedEvidenceProductType'
issuingDisputeNotReceivedEvidenceProductType IssuingDisputeNotReceivedEvidence
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: [Pair]
forall a. Monoid a => a
GHC.Base.mempty)
  toEncoding :: IssuingDisputeNotReceivedEvidence -> Encoding
toEncoding IssuingDisputeNotReceivedEvidence
obj = Series -> Encoding
Data.Aeson.Encoding.Internal.pairs ((Text
"additional_documentation" Text
-> Maybe
     IssuingDisputeNotReceivedEvidenceAdditionalDocumentation'Variants
-> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= IssuingDisputeNotReceivedEvidence
-> Maybe
     IssuingDisputeNotReceivedEvidenceAdditionalDocumentation'Variants
issuingDisputeNotReceivedEvidenceAdditionalDocumentation IssuingDisputeNotReceivedEvidence
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"expected_at" Text -> Maybe Int -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= IssuingDisputeNotReceivedEvidence -> Maybe Int
issuingDisputeNotReceivedEvidenceExpectedAt IssuingDisputeNotReceivedEvidence
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"explanation" Text -> Maybe Text -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= IssuingDisputeNotReceivedEvidence -> Maybe Text
issuingDisputeNotReceivedEvidenceExplanation IssuingDisputeNotReceivedEvidence
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"product_description" Text -> Maybe Text -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= IssuingDisputeNotReceivedEvidence -> Maybe Text
issuingDisputeNotReceivedEvidenceProductDescription IssuingDisputeNotReceivedEvidence
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> (Text
"product_type" Text
-> Maybe IssuingDisputeNotReceivedEvidenceProductType' -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= IssuingDisputeNotReceivedEvidence
-> Maybe IssuingDisputeNotReceivedEvidenceProductType'
issuingDisputeNotReceivedEvidenceProductType IssuingDisputeNotReceivedEvidence
obj)))))

instance Data.Aeson.Types.FromJSON.FromJSON IssuingDisputeNotReceivedEvidence where
  parseJSON :: Value -> Parser IssuingDisputeNotReceivedEvidence
parseJSON = String
-> (Object -> Parser IssuingDisputeNotReceivedEvidence)
-> Value
-> Parser IssuingDisputeNotReceivedEvidence
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.Aeson.Types.FromJSON.withObject String
"IssuingDisputeNotReceivedEvidence" (\Object
obj -> (((((Maybe
   IssuingDisputeNotReceivedEvidenceAdditionalDocumentation'Variants
 -> Maybe Int
 -> Maybe Text
 -> Maybe Text
 -> Maybe IssuingDisputeNotReceivedEvidenceProductType'
 -> IssuingDisputeNotReceivedEvidence)
-> Parser
     (Maybe
        IssuingDisputeNotReceivedEvidenceAdditionalDocumentation'Variants
      -> Maybe Int
      -> Maybe Text
      -> Maybe Text
      -> Maybe IssuingDisputeNotReceivedEvidenceProductType'
      -> IssuingDisputeNotReceivedEvidence)
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure Maybe
  IssuingDisputeNotReceivedEvidenceAdditionalDocumentation'Variants
-> Maybe Int
-> Maybe Text
-> Maybe Text
-> Maybe IssuingDisputeNotReceivedEvidenceProductType'
-> IssuingDisputeNotReceivedEvidence
IssuingDisputeNotReceivedEvidence Parser
  (Maybe
     IssuingDisputeNotReceivedEvidenceAdditionalDocumentation'Variants
   -> Maybe Int
   -> Maybe Text
   -> Maybe Text
   -> Maybe IssuingDisputeNotReceivedEvidenceProductType'
   -> IssuingDisputeNotReceivedEvidence)
-> Parser
     (Maybe
        IssuingDisputeNotReceivedEvidenceAdditionalDocumentation'Variants)
-> Parser
     (Maybe Int
      -> Maybe Text
      -> Maybe Text
      -> Maybe IssuingDisputeNotReceivedEvidenceProductType'
      -> IssuingDisputeNotReceivedEvidence)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object
-> Text
-> Parser
     (Maybe
        IssuingDisputeNotReceivedEvidenceAdditionalDocumentation'Variants)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Text
"additional_documentation")) Parser
  (Maybe Int
   -> Maybe Text
   -> Maybe Text
   -> Maybe IssuingDisputeNotReceivedEvidenceProductType'
   -> IssuingDisputeNotReceivedEvidence)
-> Parser (Maybe Int)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe IssuingDisputeNotReceivedEvidenceProductType'
      -> IssuingDisputeNotReceivedEvidence)
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
"expected_at")) Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe IssuingDisputeNotReceivedEvidenceProductType'
   -> IssuingDisputeNotReceivedEvidence)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe IssuingDisputeNotReceivedEvidenceProductType'
      -> IssuingDisputeNotReceivedEvidence)
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
"explanation")) Parser
  (Maybe Text
   -> Maybe IssuingDisputeNotReceivedEvidenceProductType'
   -> IssuingDisputeNotReceivedEvidence)
-> Parser (Maybe Text)
-> Parser
     (Maybe IssuingDisputeNotReceivedEvidenceProductType'
      -> IssuingDisputeNotReceivedEvidence)
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
"product_description")) Parser
  (Maybe IssuingDisputeNotReceivedEvidenceProductType'
   -> IssuingDisputeNotReceivedEvidence)
-> Parser (Maybe IssuingDisputeNotReceivedEvidenceProductType')
-> Parser IssuingDisputeNotReceivedEvidence
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
GHC.Base.<*> (Object
obj Object
-> Text
-> Parser (Maybe IssuingDisputeNotReceivedEvidenceProductType')
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Data.Aeson.Types.FromJSON..:? Text
"product_type"))

-- | Create a new 'IssuingDisputeNotReceivedEvidence' with all required fields.
mkIssuingDisputeNotReceivedEvidence :: IssuingDisputeNotReceivedEvidence
mkIssuingDisputeNotReceivedEvidence :: IssuingDisputeNotReceivedEvidence
mkIssuingDisputeNotReceivedEvidence =
  IssuingDisputeNotReceivedEvidence :: Maybe
  IssuingDisputeNotReceivedEvidenceAdditionalDocumentation'Variants
-> Maybe Int
-> Maybe Text
-> Maybe Text
-> Maybe IssuingDisputeNotReceivedEvidenceProductType'
-> IssuingDisputeNotReceivedEvidence
IssuingDisputeNotReceivedEvidence
    { issuingDisputeNotReceivedEvidenceAdditionalDocumentation :: Maybe
  IssuingDisputeNotReceivedEvidenceAdditionalDocumentation'Variants
issuingDisputeNotReceivedEvidenceAdditionalDocumentation = Maybe
  IssuingDisputeNotReceivedEvidenceAdditionalDocumentation'Variants
forall a. Maybe a
GHC.Maybe.Nothing,
      issuingDisputeNotReceivedEvidenceExpectedAt :: Maybe Int
issuingDisputeNotReceivedEvidenceExpectedAt = Maybe Int
forall a. Maybe a
GHC.Maybe.Nothing,
      issuingDisputeNotReceivedEvidenceExplanation :: Maybe Text
issuingDisputeNotReceivedEvidenceExplanation = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing,
      issuingDisputeNotReceivedEvidenceProductDescription :: Maybe Text
issuingDisputeNotReceivedEvidenceProductDescription = Maybe Text
forall a. Maybe a
GHC.Maybe.Nothing,
      issuingDisputeNotReceivedEvidenceProductType :: Maybe IssuingDisputeNotReceivedEvidenceProductType'
issuingDisputeNotReceivedEvidenceProductType = Maybe IssuingDisputeNotReceivedEvidenceProductType'
forall a. Maybe a
GHC.Maybe.Nothing
    }

-- | Defines the oneOf schema located at @components.schemas.issuing_dispute_not_received_evidence.properties.additional_documentation.anyOf@ in the specification.
--
-- (ID of a [file upload](https:\/\/stripe.com\/docs\/guides\/file-upload)) Additional documentation supporting the dispute.
data IssuingDisputeNotReceivedEvidenceAdditionalDocumentation'Variants
  = IssuingDisputeNotReceivedEvidenceAdditionalDocumentation'Text Data.Text.Internal.Text
  | IssuingDisputeNotReceivedEvidenceAdditionalDocumentation'File File
  deriving (Int
-> IssuingDisputeNotReceivedEvidenceAdditionalDocumentation'Variants
-> ShowS
[IssuingDisputeNotReceivedEvidenceAdditionalDocumentation'Variants]
-> ShowS
IssuingDisputeNotReceivedEvidenceAdditionalDocumentation'Variants
-> String
(Int
 -> IssuingDisputeNotReceivedEvidenceAdditionalDocumentation'Variants
 -> ShowS)
-> (IssuingDisputeNotReceivedEvidenceAdditionalDocumentation'Variants
    -> String)
-> ([IssuingDisputeNotReceivedEvidenceAdditionalDocumentation'Variants]
    -> ShowS)
-> Show
     IssuingDisputeNotReceivedEvidenceAdditionalDocumentation'Variants
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [IssuingDisputeNotReceivedEvidenceAdditionalDocumentation'Variants]
-> ShowS
$cshowList :: [IssuingDisputeNotReceivedEvidenceAdditionalDocumentation'Variants]
-> ShowS
show :: IssuingDisputeNotReceivedEvidenceAdditionalDocumentation'Variants
-> String
$cshow :: IssuingDisputeNotReceivedEvidenceAdditionalDocumentation'Variants
-> String
showsPrec :: Int
-> IssuingDisputeNotReceivedEvidenceAdditionalDocumentation'Variants
-> ShowS
$cshowsPrec :: Int
-> IssuingDisputeNotReceivedEvidenceAdditionalDocumentation'Variants
-> ShowS
GHC.Show.Show, IssuingDisputeNotReceivedEvidenceAdditionalDocumentation'Variants
-> IssuingDisputeNotReceivedEvidenceAdditionalDocumentation'Variants
-> Bool
(IssuingDisputeNotReceivedEvidenceAdditionalDocumentation'Variants
 -> IssuingDisputeNotReceivedEvidenceAdditionalDocumentation'Variants
 -> Bool)
-> (IssuingDisputeNotReceivedEvidenceAdditionalDocumentation'Variants
    -> IssuingDisputeNotReceivedEvidenceAdditionalDocumentation'Variants
    -> Bool)
-> Eq
     IssuingDisputeNotReceivedEvidenceAdditionalDocumentation'Variants
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: IssuingDisputeNotReceivedEvidenceAdditionalDocumentation'Variants
-> IssuingDisputeNotReceivedEvidenceAdditionalDocumentation'Variants
-> Bool
$c/= :: IssuingDisputeNotReceivedEvidenceAdditionalDocumentation'Variants
-> IssuingDisputeNotReceivedEvidenceAdditionalDocumentation'Variants
-> Bool
== :: IssuingDisputeNotReceivedEvidenceAdditionalDocumentation'Variants
-> IssuingDisputeNotReceivedEvidenceAdditionalDocumentation'Variants
-> Bool
$c== :: IssuingDisputeNotReceivedEvidenceAdditionalDocumentation'Variants
-> IssuingDisputeNotReceivedEvidenceAdditionalDocumentation'Variants
-> Bool
GHC.Classes.Eq)

instance Data.Aeson.Types.ToJSON.ToJSON IssuingDisputeNotReceivedEvidenceAdditionalDocumentation'Variants where
  toJSON :: IssuingDisputeNotReceivedEvidenceAdditionalDocumentation'Variants
-> Value
toJSON (IssuingDisputeNotReceivedEvidenceAdditionalDocumentation'Text Text
a) = Text -> Value
forall a. ToJSON a => a -> Value
Data.Aeson.Types.ToJSON.toJSON Text
a
  toJSON (IssuingDisputeNotReceivedEvidenceAdditionalDocumentation'File File
a) = File -> Value
forall a. ToJSON a => a -> Value
Data.Aeson.Types.ToJSON.toJSON File
a

instance Data.Aeson.Types.FromJSON.FromJSON IssuingDisputeNotReceivedEvidenceAdditionalDocumentation'Variants where
  parseJSON :: Value
-> Parser
     IssuingDisputeNotReceivedEvidenceAdditionalDocumentation'Variants
parseJSON Value
val = case (Text
-> IssuingDisputeNotReceivedEvidenceAdditionalDocumentation'Variants
IssuingDisputeNotReceivedEvidenceAdditionalDocumentation'Text (Text
 -> IssuingDisputeNotReceivedEvidenceAdditionalDocumentation'Variants)
-> Result Text
-> Result
     IssuingDisputeNotReceivedEvidenceAdditionalDocumentation'Variants
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Data.Functor.<$> Value -> Result Text
forall a. FromJSON a => Value -> Result a
Data.Aeson.Types.FromJSON.fromJSON Value
val) Result
  IssuingDisputeNotReceivedEvidenceAdditionalDocumentation'Variants
-> Result
     IssuingDisputeNotReceivedEvidenceAdditionalDocumentation'Variants
-> Result
     IssuingDisputeNotReceivedEvidenceAdditionalDocumentation'Variants
forall (f :: * -> *) a. Alternative f => f a -> f a -> f a
GHC.Base.<|> ((File
-> IssuingDisputeNotReceivedEvidenceAdditionalDocumentation'Variants
IssuingDisputeNotReceivedEvidenceAdditionalDocumentation'File (File
 -> IssuingDisputeNotReceivedEvidenceAdditionalDocumentation'Variants)
-> Result File
-> Result
     IssuingDisputeNotReceivedEvidenceAdditionalDocumentation'Variants
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Data.Functor.<$> Value -> Result File
forall a. FromJSON a => Value -> Result a
Data.Aeson.Types.FromJSON.fromJSON Value
val) Result
  IssuingDisputeNotReceivedEvidenceAdditionalDocumentation'Variants
-> Result
     IssuingDisputeNotReceivedEvidenceAdditionalDocumentation'Variants
-> Result
     IssuingDisputeNotReceivedEvidenceAdditionalDocumentation'Variants
forall (f :: * -> *) a. Alternative f => f a -> f a -> f a
GHC.Base.<|> String
-> Result
     IssuingDisputeNotReceivedEvidenceAdditionalDocumentation'Variants
forall a. String -> Result a
Data.Aeson.Types.Internal.Error String
"No variant matched") of
    Data.Aeson.Types.Internal.Success IssuingDisputeNotReceivedEvidenceAdditionalDocumentation'Variants
a -> IssuingDisputeNotReceivedEvidenceAdditionalDocumentation'Variants
-> Parser
     IssuingDisputeNotReceivedEvidenceAdditionalDocumentation'Variants
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure IssuingDisputeNotReceivedEvidenceAdditionalDocumentation'Variants
a
    Data.Aeson.Types.Internal.Error String
a -> String
-> Parser
     IssuingDisputeNotReceivedEvidenceAdditionalDocumentation'Variants
forall (m :: * -> *) a. MonadFail m => String -> m a
Control.Monad.Fail.fail String
a

-- | Defines the enum schema located at @components.schemas.issuing_dispute_not_received_evidence.properties.product_type@ in the specification.
--
-- Whether the product was a merchandise or service.
data IssuingDisputeNotReceivedEvidenceProductType'
  = -- | This case is used if the value encountered during decoding does not match any of the provided cases in the specification.
    IssuingDisputeNotReceivedEvidenceProductType'Other Data.Aeson.Types.Internal.Value
  | -- | This constructor can be used to send values to the server which are not present in the specification yet.
    IssuingDisputeNotReceivedEvidenceProductType'Typed Data.Text.Internal.Text
  | -- | Represents the JSON value @"merchandise"@
    IssuingDisputeNotReceivedEvidenceProductType'EnumMerchandise
  | -- | Represents the JSON value @"service"@
    IssuingDisputeNotReceivedEvidenceProductType'EnumService
  deriving (Int -> IssuingDisputeNotReceivedEvidenceProductType' -> ShowS
[IssuingDisputeNotReceivedEvidenceProductType'] -> ShowS
IssuingDisputeNotReceivedEvidenceProductType' -> String
(Int -> IssuingDisputeNotReceivedEvidenceProductType' -> ShowS)
-> (IssuingDisputeNotReceivedEvidenceProductType' -> String)
-> ([IssuingDisputeNotReceivedEvidenceProductType'] -> ShowS)
-> Show IssuingDisputeNotReceivedEvidenceProductType'
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [IssuingDisputeNotReceivedEvidenceProductType'] -> ShowS
$cshowList :: [IssuingDisputeNotReceivedEvidenceProductType'] -> ShowS
show :: IssuingDisputeNotReceivedEvidenceProductType' -> String
$cshow :: IssuingDisputeNotReceivedEvidenceProductType' -> String
showsPrec :: Int -> IssuingDisputeNotReceivedEvidenceProductType' -> ShowS
$cshowsPrec :: Int -> IssuingDisputeNotReceivedEvidenceProductType' -> ShowS
GHC.Show.Show, IssuingDisputeNotReceivedEvidenceProductType'
-> IssuingDisputeNotReceivedEvidenceProductType' -> Bool
(IssuingDisputeNotReceivedEvidenceProductType'
 -> IssuingDisputeNotReceivedEvidenceProductType' -> Bool)
-> (IssuingDisputeNotReceivedEvidenceProductType'
    -> IssuingDisputeNotReceivedEvidenceProductType' -> Bool)
-> Eq IssuingDisputeNotReceivedEvidenceProductType'
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: IssuingDisputeNotReceivedEvidenceProductType'
-> IssuingDisputeNotReceivedEvidenceProductType' -> Bool
$c/= :: IssuingDisputeNotReceivedEvidenceProductType'
-> IssuingDisputeNotReceivedEvidenceProductType' -> Bool
== :: IssuingDisputeNotReceivedEvidenceProductType'
-> IssuingDisputeNotReceivedEvidenceProductType' -> Bool
$c== :: IssuingDisputeNotReceivedEvidenceProductType'
-> IssuingDisputeNotReceivedEvidenceProductType' -> Bool
GHC.Classes.Eq)

instance Data.Aeson.Types.ToJSON.ToJSON IssuingDisputeNotReceivedEvidenceProductType' where
  toJSON :: IssuingDisputeNotReceivedEvidenceProductType' -> Value
toJSON (IssuingDisputeNotReceivedEvidenceProductType'Other Value
val) = Value
val
  toJSON (IssuingDisputeNotReceivedEvidenceProductType'Typed Text
val) = Text -> Value
forall a. ToJSON a => a -> Value
Data.Aeson.Types.ToJSON.toJSON Text
val
  toJSON (IssuingDisputeNotReceivedEvidenceProductType'
IssuingDisputeNotReceivedEvidenceProductType'EnumMerchandise) = Value
"merchandise"
  toJSON (IssuingDisputeNotReceivedEvidenceProductType'
IssuingDisputeNotReceivedEvidenceProductType'EnumService) = Value
"service"

instance Data.Aeson.Types.FromJSON.FromJSON IssuingDisputeNotReceivedEvidenceProductType' where
  parseJSON :: Value -> Parser IssuingDisputeNotReceivedEvidenceProductType'
parseJSON Value
val =
    IssuingDisputeNotReceivedEvidenceProductType'
-> Parser IssuingDisputeNotReceivedEvidenceProductType'
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
"merchandise" -> IssuingDisputeNotReceivedEvidenceProductType'
IssuingDisputeNotReceivedEvidenceProductType'EnumMerchandise
            | Value
val Value -> Value -> Bool
forall a. Eq a => a -> a -> Bool
GHC.Classes.== Value
"service" -> IssuingDisputeNotReceivedEvidenceProductType'
IssuingDisputeNotReceivedEvidenceProductType'EnumService
            | Bool
GHC.Base.otherwise -> Value -> IssuingDisputeNotReceivedEvidenceProductType'
IssuingDisputeNotReceivedEvidenceProductType'Other Value
val
      )