module TD.Data.PremiumStoryFeature
(PremiumStoryFeature(..)) where
import qualified Data.Aeson as A
import qualified Data.Aeson.Types as AT
import qualified TD.Lib.Internal as I
data PremiumStoryFeature
= PremiumStoryFeaturePriorityOrder
| PremiumStoryFeatureStealthMode
| PremiumStoryFeaturePermanentViewsHistory
| PremiumStoryFeatureCustomExpirationDuration
| PremiumStoryFeatureSaveStories
| PremiumStoryFeatureLinksAndFormatting
| PremiumStoryFeatureVideoQuality
deriving (PremiumStoryFeature -> PremiumStoryFeature -> Bool
(PremiumStoryFeature -> PremiumStoryFeature -> Bool)
-> (PremiumStoryFeature -> PremiumStoryFeature -> Bool)
-> Eq PremiumStoryFeature
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: PremiumStoryFeature -> PremiumStoryFeature -> Bool
== :: PremiumStoryFeature -> PremiumStoryFeature -> Bool
$c/= :: PremiumStoryFeature -> PremiumStoryFeature -> Bool
/= :: PremiumStoryFeature -> PremiumStoryFeature -> Bool
Eq, Int -> PremiumStoryFeature -> ShowS
[PremiumStoryFeature] -> ShowS
PremiumStoryFeature -> String
(Int -> PremiumStoryFeature -> ShowS)
-> (PremiumStoryFeature -> String)
-> ([PremiumStoryFeature] -> ShowS)
-> Show PremiumStoryFeature
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> PremiumStoryFeature -> ShowS
showsPrec :: Int -> PremiumStoryFeature -> ShowS
$cshow :: PremiumStoryFeature -> String
show :: PremiumStoryFeature -> String
$cshowList :: [PremiumStoryFeature] -> ShowS
showList :: [PremiumStoryFeature] -> ShowS
Show)
instance I.ShortShow PremiumStoryFeature where
shortShow :: PremiumStoryFeature -> String
shortShow PremiumStoryFeature
PremiumStoryFeaturePriorityOrder
= String
"PremiumStoryFeaturePriorityOrder"
shortShow PremiumStoryFeature
PremiumStoryFeatureStealthMode
= String
"PremiumStoryFeatureStealthMode"
shortShow PremiumStoryFeature
PremiumStoryFeaturePermanentViewsHistory
= String
"PremiumStoryFeaturePermanentViewsHistory"
shortShow PremiumStoryFeature
PremiumStoryFeatureCustomExpirationDuration
= String
"PremiumStoryFeatureCustomExpirationDuration"
shortShow PremiumStoryFeature
PremiumStoryFeatureSaveStories
= String
"PremiumStoryFeatureSaveStories"
shortShow PremiumStoryFeature
PremiumStoryFeatureLinksAndFormatting
= String
"PremiumStoryFeatureLinksAndFormatting"
shortShow PremiumStoryFeature
PremiumStoryFeatureVideoQuality
= String
"PremiumStoryFeatureVideoQuality"
instance AT.FromJSON PremiumStoryFeature where
parseJSON :: Value -> Parser PremiumStoryFeature
parseJSON (AT.Object Object
obj) = do
String
t <- Object
obj Object -> Key -> Parser String
forall a. FromJSON a => Object -> Key -> Parser a
A..: Key
"@type" :: AT.Parser String
case String
t of
String
"premiumStoryFeaturePriorityOrder" -> PremiumStoryFeature -> Parser PremiumStoryFeature
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure PremiumStoryFeature
PremiumStoryFeaturePriorityOrder
String
"premiumStoryFeatureStealthMode" -> PremiumStoryFeature -> Parser PremiumStoryFeature
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure PremiumStoryFeature
PremiumStoryFeatureStealthMode
String
"premiumStoryFeaturePermanentViewsHistory" -> PremiumStoryFeature -> Parser PremiumStoryFeature
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure PremiumStoryFeature
PremiumStoryFeaturePermanentViewsHistory
String
"premiumStoryFeatureCustomExpirationDuration" -> PremiumStoryFeature -> Parser PremiumStoryFeature
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure PremiumStoryFeature
PremiumStoryFeatureCustomExpirationDuration
String
"premiumStoryFeatureSaveStories" -> PremiumStoryFeature -> Parser PremiumStoryFeature
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure PremiumStoryFeature
PremiumStoryFeatureSaveStories
String
"premiumStoryFeatureLinksAndFormatting" -> PremiumStoryFeature -> Parser PremiumStoryFeature
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure PremiumStoryFeature
PremiumStoryFeatureLinksAndFormatting
String
"premiumStoryFeatureVideoQuality" -> PremiumStoryFeature -> Parser PremiumStoryFeature
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure PremiumStoryFeature
PremiumStoryFeatureVideoQuality
String
_ -> Parser PremiumStoryFeature
forall a. Monoid a => a
mempty
parseJSON Value
_ = Parser PremiumStoryFeature
forall a. Monoid a => a
mempty
instance AT.ToJSON PremiumStoryFeature where
toJSON :: PremiumStoryFeature -> Value
toJSON PremiumStoryFeature
PremiumStoryFeaturePriorityOrder
= [Pair] -> Value
A.object
[ Key
"@type" Key -> Value -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Text -> Value
AT.String Text
"premiumStoryFeaturePriorityOrder"
]
toJSON PremiumStoryFeature
PremiumStoryFeatureStealthMode
= [Pair] -> Value
A.object
[ Key
"@type" Key -> Value -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Text -> Value
AT.String Text
"premiumStoryFeatureStealthMode"
]
toJSON PremiumStoryFeature
PremiumStoryFeaturePermanentViewsHistory
= [Pair] -> Value
A.object
[ Key
"@type" Key -> Value -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Text -> Value
AT.String Text
"premiumStoryFeaturePermanentViewsHistory"
]
toJSON PremiumStoryFeature
PremiumStoryFeatureCustomExpirationDuration
= [Pair] -> Value
A.object
[ Key
"@type" Key -> Value -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Text -> Value
AT.String Text
"premiumStoryFeatureCustomExpirationDuration"
]
toJSON PremiumStoryFeature
PremiumStoryFeatureSaveStories
= [Pair] -> Value
A.object
[ Key
"@type" Key -> Value -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Text -> Value
AT.String Text
"premiumStoryFeatureSaveStories"
]
toJSON PremiumStoryFeature
PremiumStoryFeatureLinksAndFormatting
= [Pair] -> Value
A.object
[ Key
"@type" Key -> Value -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Text -> Value
AT.String Text
"premiumStoryFeatureLinksAndFormatting"
]
toJSON PremiumStoryFeature
PremiumStoryFeatureVideoQuality
= [Pair] -> Value
A.object
[ Key
"@type" Key -> Value -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> Pair
A..= Text -> Value
AT.String Text
"premiumStoryFeatureVideoQuality"
]