{-# 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.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
data EntitlementValue = EntitlementValue'
{
EntitlementValue -> Maybe Bool
booleanValue :: Prelude.Maybe Prelude.Bool,
EntitlementValue -> Maybe Double
doubleValue :: Prelude.Maybe Prelude.Double,
EntitlementValue -> Maybe Int
integerValue :: Prelude.Maybe Prelude.Int,
EntitlementValue -> Maybe Text
stringValue :: Prelude.Maybe Prelude.Text
}
deriving (EntitlementValue -> EntitlementValue -> Bool
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]
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
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. 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'
{ $sel:booleanValue:EntitlementValue' :: Maybe Bool
booleanValue = forall a. Maybe a
Prelude.Nothing,
$sel:doubleValue:EntitlementValue' :: Maybe Double
doubleValue = forall a. Maybe a
Prelude.Nothing,
$sel:integerValue:EntitlementValue' :: Maybe Int
integerValue = forall a. Maybe a
Prelude.Nothing,
$sel:stringValue:EntitlementValue' :: Maybe Text
stringValue = forall a. Maybe a
Prelude.Nothing
}
entitlementValue_booleanValue :: Lens.Lens' EntitlementValue (Prelude.Maybe Prelude.Bool)
entitlementValue_booleanValue :: Lens' EntitlementValue (Maybe Bool)
entitlementValue_booleanValue = 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)
entitlementValue_doubleValue :: Lens.Lens' EntitlementValue (Prelude.Maybe Prelude.Double)
entitlementValue_doubleValue :: Lens' EntitlementValue (Maybe Double)
entitlementValue_doubleValue = 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_integerValue :: Lens.Lens' EntitlementValue (Prelude.Maybe Prelude.Int)
entitlementValue_integerValue :: Lens' EntitlementValue (Maybe Int)
entitlementValue_integerValue = 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_stringValue :: Lens.Lens' EntitlementValue (Prelude.Maybe Prelude.Text)
entitlementValue_stringValue :: Lens' EntitlementValue (Maybe Text)
entitlementValue_stringValue = 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)
instance Data.FromJSON EntitlementValue where
parseJSON :: Value -> Parser EntitlementValue
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"EntitlementValue"
( \Object
x ->
Maybe Bool
-> Maybe Double -> Maybe Int -> Maybe Text -> EntitlementValue
EntitlementValue'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"BooleanValue")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"DoubleValue")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"IntegerValue")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"StringValue")
)
instance Prelude.Hashable EntitlementValue where
hashWithSalt :: Int -> EntitlementValue -> Int
hashWithSalt Int
_salt EntitlementValue' {Maybe Bool
Maybe Double
Maybe Int
Maybe Text
stringValue :: Maybe Text
integerValue :: Maybe Int
doubleValue :: Maybe Double
booleanValue :: Maybe Bool
$sel:stringValue:EntitlementValue' :: EntitlementValue -> Maybe Text
$sel:integerValue:EntitlementValue' :: EntitlementValue -> Maybe Int
$sel:doubleValue:EntitlementValue' :: EntitlementValue -> Maybe Double
$sel:booleanValue:EntitlementValue' :: EntitlementValue -> Maybe Bool
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
booleanValue
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Double
doubleValue
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Int
integerValue
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
stringValue
instance Prelude.NFData EntitlementValue where
rnf :: EntitlementValue -> ()
rnf EntitlementValue' {Maybe Bool
Maybe Double
Maybe Int
Maybe Text
stringValue :: Maybe Text
integerValue :: Maybe Int
doubleValue :: Maybe Double
booleanValue :: Maybe Bool
$sel:stringValue:EntitlementValue' :: EntitlementValue -> Maybe Text
$sel:integerValue:EntitlementValue' :: EntitlementValue -> Maybe Int
$sel:doubleValue:EntitlementValue' :: EntitlementValue -> Maybe Double
$sel:booleanValue:EntitlementValue' :: EntitlementValue -> Maybe Bool
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
booleanValue
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Double
doubleValue
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Int
integerValue
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
stringValue