{-# 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.Foldable import qualified Data.Functor import qualified Data.Maybe 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. issuingDisputeNotReceivedEvidenceAdditionalDocumentation :: (GHC.Maybe.Maybe (StripeAPI.Common.Nullable IssuingDisputeNotReceivedEvidenceAdditionalDocumentation'NonNullableVariants)), -- | expected_at: Date when the cardholder expected to receive the product. issuingDisputeNotReceivedEvidenceExpectedAt :: (GHC.Maybe.Maybe (StripeAPI.Common.Nullable GHC.Types.Int)), -- | explanation: Explanation of why the cardholder is disputing this transaction. -- -- Constraints: -- -- * Maximum length of 5000 issuingDisputeNotReceivedEvidenceExplanation :: (GHC.Maybe.Maybe (StripeAPI.Common.Nullable Data.Text.Internal.Text)), -- | product_description: Description of the merchandise or service that was purchased. -- -- Constraints: -- -- * Maximum length of 5000 issuingDisputeNotReceivedEvidenceProductDescription :: (GHC.Maybe.Maybe (StripeAPI.Common.Nullable Data.Text.Internal.Text)), -- | product_type: Whether the product was a merchandise or service. issuingDisputeNotReceivedEvidenceProductType :: (GHC.Maybe.Maybe (StripeAPI.Common.Nullable IssuingDisputeNotReceivedEvidenceProductType'NonNullable)) } deriving ( GHC.Show.Show, GHC.Classes.Eq ) instance Data.Aeson.Types.ToJSON.ToJSON IssuingDisputeNotReceivedEvidence where toJSON obj = Data.Aeson.Types.Internal.object (Data.Foldable.concat (Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("additional_documentation" Data.Aeson.Types.ToJSON..=)) (issuingDisputeNotReceivedEvidenceAdditionalDocumentation obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("expected_at" Data.Aeson.Types.ToJSON..=)) (issuingDisputeNotReceivedEvidenceExpectedAt obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("explanation" Data.Aeson.Types.ToJSON..=)) (issuingDisputeNotReceivedEvidenceExplanation obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("product_description" Data.Aeson.Types.ToJSON..=)) (issuingDisputeNotReceivedEvidenceProductDescription obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("product_type" Data.Aeson.Types.ToJSON..=)) (issuingDisputeNotReceivedEvidenceProductType obj) : GHC.Base.mempty)) toEncoding obj = Data.Aeson.Encoding.Internal.pairs (GHC.Base.mconcat (Data.Foldable.concat (Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("additional_documentation" Data.Aeson.Types.ToJSON..=)) (issuingDisputeNotReceivedEvidenceAdditionalDocumentation obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("expected_at" Data.Aeson.Types.ToJSON..=)) (issuingDisputeNotReceivedEvidenceExpectedAt obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("explanation" Data.Aeson.Types.ToJSON..=)) (issuingDisputeNotReceivedEvidenceExplanation obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("product_description" Data.Aeson.Types.ToJSON..=)) (issuingDisputeNotReceivedEvidenceProductDescription obj) : Data.Maybe.maybe GHC.Base.mempty (GHC.Base.pure GHC.Base.. ("product_type" Data.Aeson.Types.ToJSON..=)) (issuingDisputeNotReceivedEvidenceProductType obj) : GHC.Base.mempty))) instance Data.Aeson.Types.FromJSON.FromJSON IssuingDisputeNotReceivedEvidence where parseJSON = Data.Aeson.Types.FromJSON.withObject "IssuingDisputeNotReceivedEvidence" (\obj -> ((((GHC.Base.pure IssuingDisputeNotReceivedEvidence GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "additional_documentation")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "expected_at")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "explanation")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "product_description")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..:! "product_type")) -- | Create a new 'IssuingDisputeNotReceivedEvidence' with all required fields. mkIssuingDisputeNotReceivedEvidence :: IssuingDisputeNotReceivedEvidence mkIssuingDisputeNotReceivedEvidence = IssuingDisputeNotReceivedEvidence { issuingDisputeNotReceivedEvidenceAdditionalDocumentation = GHC.Maybe.Nothing, issuingDisputeNotReceivedEvidenceExpectedAt = GHC.Maybe.Nothing, issuingDisputeNotReceivedEvidenceExplanation = GHC.Maybe.Nothing, issuingDisputeNotReceivedEvidenceProductDescription = GHC.Maybe.Nothing, issuingDisputeNotReceivedEvidenceProductType = 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'NonNullableVariants = IssuingDisputeNotReceivedEvidenceAdditionalDocumentation'NonNullableText Data.Text.Internal.Text | IssuingDisputeNotReceivedEvidenceAdditionalDocumentation'NonNullableFile File deriving (GHC.Show.Show, GHC.Classes.Eq) instance Data.Aeson.Types.ToJSON.ToJSON IssuingDisputeNotReceivedEvidenceAdditionalDocumentation'NonNullableVariants where toJSON (IssuingDisputeNotReceivedEvidenceAdditionalDocumentation'NonNullableText a) = Data.Aeson.Types.ToJSON.toJSON a toJSON (IssuingDisputeNotReceivedEvidenceAdditionalDocumentation'NonNullableFile a) = Data.Aeson.Types.ToJSON.toJSON a instance Data.Aeson.Types.FromJSON.FromJSON IssuingDisputeNotReceivedEvidenceAdditionalDocumentation'NonNullableVariants where parseJSON val = case (IssuingDisputeNotReceivedEvidenceAdditionalDocumentation'NonNullableText Data.Functor.<$> Data.Aeson.Types.FromJSON.fromJSON val) GHC.Base.<|> ((IssuingDisputeNotReceivedEvidenceAdditionalDocumentation'NonNullableFile Data.Functor.<$> Data.Aeson.Types.FromJSON.fromJSON val) GHC.Base.<|> Data.Aeson.Types.Internal.Error "No variant matched") of Data.Aeson.Types.Internal.Success a -> GHC.Base.pure a Data.Aeson.Types.Internal.Error a -> Control.Monad.Fail.fail 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'NonNullable = -- | This case is used if the value encountered during decoding does not match any of the provided cases in the specification. IssuingDisputeNotReceivedEvidenceProductType'NonNullableOther 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'NonNullableTyped Data.Text.Internal.Text | -- | Represents the JSON value @"merchandise"@ IssuingDisputeNotReceivedEvidenceProductType'NonNullableEnumMerchandise | -- | Represents the JSON value @"service"@ IssuingDisputeNotReceivedEvidenceProductType'NonNullableEnumService deriving (GHC.Show.Show, GHC.Classes.Eq) instance Data.Aeson.Types.ToJSON.ToJSON IssuingDisputeNotReceivedEvidenceProductType'NonNullable where toJSON (IssuingDisputeNotReceivedEvidenceProductType'NonNullableOther val) = val toJSON (IssuingDisputeNotReceivedEvidenceProductType'NonNullableTyped val) = Data.Aeson.Types.ToJSON.toJSON val toJSON (IssuingDisputeNotReceivedEvidenceProductType'NonNullableEnumMerchandise) = "merchandise" toJSON (IssuingDisputeNotReceivedEvidenceProductType'NonNullableEnumService) = "service" instance Data.Aeson.Types.FromJSON.FromJSON IssuingDisputeNotReceivedEvidenceProductType'NonNullable where parseJSON val = GHC.Base.pure ( if | val GHC.Classes.== "merchandise" -> IssuingDisputeNotReceivedEvidenceProductType'NonNullableEnumMerchandise | val GHC.Classes.== "service" -> IssuingDisputeNotReceivedEvidenceProductType'NonNullableEnumService | GHC.Base.otherwise -> IssuingDisputeNotReceivedEvidenceProductType'NonNullableOther val )