{-# LANGUAGE MultiWayIf #-}
{-# LANGUAGE OverloadedStrings #-}
module StripeAPI.Types.DeletedProduct 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
data DeletedProduct = DeletedProduct
{
DeletedProduct -> Text
deletedProductId :: Data.Text.Internal.Text
}
deriving
( Int -> DeletedProduct -> ShowS
[DeletedProduct] -> ShowS
DeletedProduct -> String
(Int -> DeletedProduct -> ShowS)
-> (DeletedProduct -> String)
-> ([DeletedProduct] -> ShowS)
-> Show DeletedProduct
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeletedProduct] -> ShowS
$cshowList :: [DeletedProduct] -> ShowS
show :: DeletedProduct -> String
$cshow :: DeletedProduct -> String
showsPrec :: Int -> DeletedProduct -> ShowS
$cshowsPrec :: Int -> DeletedProduct -> ShowS
GHC.Show.Show,
DeletedProduct -> DeletedProduct -> Bool
(DeletedProduct -> DeletedProduct -> Bool)
-> (DeletedProduct -> DeletedProduct -> Bool) -> Eq DeletedProduct
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeletedProduct -> DeletedProduct -> Bool
$c/= :: DeletedProduct -> DeletedProduct -> Bool
== :: DeletedProduct -> DeletedProduct -> Bool
$c== :: DeletedProduct -> DeletedProduct -> Bool
GHC.Classes.Eq
)
instance Data.Aeson.Types.ToJSON.ToJSON DeletedProduct where
toJSON :: DeletedProduct -> Value
toJSON DeletedProduct
obj = [Pair] -> Value
Data.Aeson.Types.Internal.object (Text
"id" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= DeletedProduct -> Text
deletedProductId DeletedProduct
obj Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: Text
"deleted" Text -> Value -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= Bool -> Value
Data.Aeson.Types.Internal.Bool Bool
GHC.Types.True 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
"product" Pair -> [Pair] -> [Pair]
forall a. a -> [a] -> [a]
: [Pair]
forall a. Monoid a => a
GHC.Base.mempty)
toEncoding :: DeletedProduct -> Encoding
toEncoding DeletedProduct
obj = Series -> Encoding
Data.Aeson.Encoding.Internal.pairs ((Text
"id" Text -> Text -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= DeletedProduct -> Text
deletedProductId DeletedProduct
obj) Series -> Series -> Series
forall a. Semigroup a => a -> a -> a
GHC.Base.<> ((Text
"deleted" Text -> Value -> Series
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Data.Aeson.Types.ToJSON..= Bool -> Value
Data.Aeson.Types.Internal.Bool Bool
GHC.Types.True) 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
"product")))
instance Data.Aeson.Types.FromJSON.FromJSON DeletedProduct where
parseJSON :: Value -> Parser DeletedProduct
parseJSON = String
-> (Object -> Parser DeletedProduct)
-> Value
-> Parser DeletedProduct
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.Aeson.Types.FromJSON.withObject String
"DeletedProduct" (\Object
obj -> (Text -> DeletedProduct) -> Parser (Text -> DeletedProduct)
forall (f :: * -> *) a. Applicative f => a -> f a
GHC.Base.pure Text -> DeletedProduct
DeletedProduct Parser (Text -> DeletedProduct)
-> Parser Text -> Parser DeletedProduct
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
"id"))
mkDeletedProduct ::
Data.Text.Internal.Text ->
DeletedProduct
mkDeletedProduct :: Text -> DeletedProduct
mkDeletedProduct Text
deletedProductId = DeletedProduct :: Text -> DeletedProduct
DeletedProduct {deletedProductId :: Text
deletedProductId = Text
deletedProductId}