{-# 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 InvoiceSettingCustomField module StripeAPI.Types.InvoiceSettingCustomField 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 qualified Prelude as GHC.Integer.Type import qualified Prelude as GHC.Maybe -- | Defines the object schema located at @components.schemas.invoice_setting_custom_field@ in the specification. data InvoiceSettingCustomField = InvoiceSettingCustomField { -- | name: The name of the custom field. -- -- Constraints: -- -- * Maximum length of 5000 invoiceSettingCustomFieldName :: Data.Text.Internal.Text, -- | value: The value of the custom field. -- -- Constraints: -- -- * Maximum length of 5000 invoiceSettingCustomFieldValue :: Data.Text.Internal.Text } deriving ( GHC.Show.Show, GHC.Classes.Eq ) instance Data.Aeson.Types.ToJSON.ToJSON InvoiceSettingCustomField where toJSON obj = Data.Aeson.Types.Internal.object ("name" Data.Aeson.Types.ToJSON..= invoiceSettingCustomFieldName obj : "value" Data.Aeson.Types.ToJSON..= invoiceSettingCustomFieldValue obj : GHC.Base.mempty) toEncoding obj = Data.Aeson.Encoding.Internal.pairs (("name" Data.Aeson.Types.ToJSON..= invoiceSettingCustomFieldName obj) GHC.Base.<> ("value" Data.Aeson.Types.ToJSON..= invoiceSettingCustomFieldValue obj)) instance Data.Aeson.Types.FromJSON.FromJSON InvoiceSettingCustomField where parseJSON = Data.Aeson.Types.FromJSON.withObject "InvoiceSettingCustomField" (\obj -> (GHC.Base.pure InvoiceSettingCustomField GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..: "name")) GHC.Base.<*> (obj Data.Aeson.Types.FromJSON..: "value")) -- | Create a new 'InvoiceSettingCustomField' with all required fields. mkInvoiceSettingCustomField :: -- | 'invoiceSettingCustomFieldName' Data.Text.Internal.Text -> -- | 'invoiceSettingCustomFieldValue' Data.Text.Internal.Text -> InvoiceSettingCustomField mkInvoiceSettingCustomField invoiceSettingCustomFieldName invoiceSettingCustomFieldValue = InvoiceSettingCustomField { invoiceSettingCustomFieldName = invoiceSettingCustomFieldName, invoiceSettingCustomFieldValue = invoiceSettingCustomFieldValue }