{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}
module Amazonka.MarketplaceEntitlement.Types.EntitlementValue where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data EntitlementValue = EntitlementValue'
{
EntitlementValue -> Maybe Int
integerValue :: Prelude.Maybe Prelude.Int,
EntitlementValue -> Maybe Double
doubleValue :: Prelude.Maybe Prelude.Double,
EntitlementValue -> Maybe Text
stringValue :: Prelude.Maybe Prelude.Text,
EntitlementValue -> Maybe Bool
booleanValue :: Prelude.Maybe Prelude.Bool
}
deriving (EntitlementValue -> EntitlementValue -> Bool
(EntitlementValue -> EntitlementValue -> Bool)
-> (EntitlementValue -> EntitlementValue -> Bool)
-> Eq EntitlementValue
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: EntitlementValue -> EntitlementValue -> Bool
$c/= :: EntitlementValue -> EntitlementValue -> Bool
== :: EntitlementValue -> EntitlementValue -> Bool
$c== :: EntitlementValue -> EntitlementValue -> Bool
Prelude.Eq, ReadPrec [EntitlementValue]
ReadPrec EntitlementValue
Int -> ReadS EntitlementValue
ReadS [EntitlementValue]
(Int -> ReadS EntitlementValue)
-> ReadS [EntitlementValue]
-> ReadPrec EntitlementValue
-> ReadPrec [EntitlementValue]
-> Read EntitlementValue
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [EntitlementValue]
$creadListPrec :: ReadPrec [EntitlementValue]
readPrec :: ReadPrec EntitlementValue
$creadPrec :: ReadPrec EntitlementValue
readList :: ReadS [EntitlementValue]
$creadList :: ReadS [EntitlementValue]
readsPrec :: Int -> ReadS EntitlementValue
$creadsPrec :: Int -> ReadS EntitlementValue
Prelude.Read, Int -> EntitlementValue -> ShowS
[EntitlementValue] -> ShowS
EntitlementValue -> String
(Int -> EntitlementValue -> ShowS)
-> (EntitlementValue -> String)
-> ([EntitlementValue] -> ShowS)
-> Show EntitlementValue
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [EntitlementValue] -> ShowS
$cshowList :: [EntitlementValue] -> ShowS
show :: EntitlementValue -> String
$cshow :: EntitlementValue -> String
showsPrec :: Int -> EntitlementValue -> ShowS
$cshowsPrec :: Int -> EntitlementValue -> ShowS
Prelude.Show, (forall x. EntitlementValue -> Rep EntitlementValue x)
-> (forall x. Rep EntitlementValue x -> EntitlementValue)
-> Generic EntitlementValue
forall x. Rep EntitlementValue x -> EntitlementValue
forall x. EntitlementValue -> Rep EntitlementValue x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep EntitlementValue x -> EntitlementValue
$cfrom :: forall x. EntitlementValue -> Rep EntitlementValue x
Prelude.Generic)
newEntitlementValue ::
EntitlementValue
newEntitlementValue :: EntitlementValue
newEntitlementValue =
EntitlementValue' :: Maybe Int
-> Maybe Double -> Maybe Text -> Maybe Bool -> EntitlementValue
EntitlementValue'
{ $sel:integerValue:EntitlementValue' :: Maybe Int
integerValue = Maybe Int
forall a. Maybe a
Prelude.Nothing,
$sel:doubleValue:EntitlementValue' :: Maybe Double
doubleValue = Maybe Double
forall a. Maybe a
Prelude.Nothing,
$sel:stringValue:EntitlementValue' :: Maybe Text
stringValue = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:booleanValue:EntitlementValue' :: Maybe Bool
booleanValue = Maybe Bool
forall a. Maybe a
Prelude.Nothing
}
entitlementValue_integerValue :: Lens.Lens' EntitlementValue (Prelude.Maybe Prelude.Int)
entitlementValue_integerValue :: (Maybe Int -> f (Maybe Int))
-> EntitlementValue -> f EntitlementValue
entitlementValue_integerValue = (EntitlementValue -> Maybe Int)
-> (EntitlementValue -> Maybe Int -> EntitlementValue)
-> Lens EntitlementValue EntitlementValue (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EntitlementValue' {Maybe Int
integerValue :: Maybe Int
$sel:integerValue:EntitlementValue' :: EntitlementValue -> Maybe Int
integerValue} -> Maybe Int
integerValue) (\s :: EntitlementValue
s@EntitlementValue' {} Maybe Int
a -> EntitlementValue
s {$sel:integerValue:EntitlementValue' :: Maybe Int
integerValue = Maybe Int
a} :: EntitlementValue)
entitlementValue_doubleValue :: Lens.Lens' EntitlementValue (Prelude.Maybe Prelude.Double)
entitlementValue_doubleValue :: (Maybe Double -> f (Maybe Double))
-> EntitlementValue -> f EntitlementValue
entitlementValue_doubleValue = (EntitlementValue -> Maybe Double)
-> (EntitlementValue -> Maybe Double -> EntitlementValue)
-> Lens
EntitlementValue EntitlementValue (Maybe Double) (Maybe Double)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EntitlementValue' {Maybe Double
doubleValue :: Maybe Double
$sel:doubleValue:EntitlementValue' :: EntitlementValue -> Maybe Double
doubleValue} -> Maybe Double
doubleValue) (\s :: EntitlementValue
s@EntitlementValue' {} Maybe Double
a -> EntitlementValue
s {$sel:doubleValue:EntitlementValue' :: Maybe Double
doubleValue = Maybe Double
a} :: EntitlementValue)
entitlementValue_stringValue :: Lens.Lens' EntitlementValue (Prelude.Maybe Prelude.Text)
entitlementValue_stringValue :: (Maybe Text -> f (Maybe Text))
-> EntitlementValue -> f EntitlementValue
entitlementValue_stringValue = (EntitlementValue -> Maybe Text)
-> (EntitlementValue -> Maybe Text -> EntitlementValue)
-> Lens EntitlementValue EntitlementValue (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EntitlementValue' {Maybe Text
stringValue :: Maybe Text
$sel:stringValue:EntitlementValue' :: EntitlementValue -> Maybe Text
stringValue} -> Maybe Text
stringValue) (\s :: EntitlementValue
s@EntitlementValue' {} Maybe Text
a -> EntitlementValue
s {$sel:stringValue:EntitlementValue' :: Maybe Text
stringValue = Maybe Text
a} :: EntitlementValue)
entitlementValue_booleanValue :: Lens.Lens' EntitlementValue (Prelude.Maybe Prelude.Bool)
entitlementValue_booleanValue :: (Maybe Bool -> f (Maybe Bool))
-> EntitlementValue -> f EntitlementValue
entitlementValue_booleanValue = (EntitlementValue -> Maybe Bool)
-> (EntitlementValue -> Maybe Bool -> EntitlementValue)
-> Lens EntitlementValue EntitlementValue (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EntitlementValue' {Maybe Bool
booleanValue :: Maybe Bool
$sel:booleanValue:EntitlementValue' :: EntitlementValue -> Maybe Bool
booleanValue} -> Maybe Bool
booleanValue) (\s :: EntitlementValue
s@EntitlementValue' {} Maybe Bool
a -> EntitlementValue
s {$sel:booleanValue:EntitlementValue' :: Maybe Bool
booleanValue = Maybe Bool
a} :: EntitlementValue)
instance Core.FromJSON EntitlementValue where
parseJSON :: Value -> Parser EntitlementValue
parseJSON =
String
-> (Object -> Parser EntitlementValue)
-> Value
-> Parser EntitlementValue
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"EntitlementValue"
( \Object
x ->
Maybe Int
-> Maybe Double -> Maybe Text -> Maybe Bool -> EntitlementValue
EntitlementValue'
(Maybe Int
-> Maybe Double -> Maybe Text -> Maybe Bool -> EntitlementValue)
-> Parser (Maybe Int)
-> Parser
(Maybe Double -> Maybe Text -> Maybe Bool -> EntitlementValue)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"IntegerValue")
Parser
(Maybe Double -> Maybe Text -> Maybe Bool -> EntitlementValue)
-> Parser (Maybe Double)
-> Parser (Maybe Text -> Maybe Bool -> EntitlementValue)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Double)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"DoubleValue")
Parser (Maybe Text -> Maybe Bool -> EntitlementValue)
-> Parser (Maybe Text) -> Parser (Maybe Bool -> EntitlementValue)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"StringValue")
Parser (Maybe Bool -> EntitlementValue)
-> Parser (Maybe Bool) -> Parser EntitlementValue
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"BooleanValue")
)
instance Prelude.Hashable EntitlementValue
instance Prelude.NFData EntitlementValue