{-# 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.Pricing.Types.AttributeValue where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data AttributeValue = AttributeValue'
{
AttributeValue -> Maybe Text
value :: Prelude.Maybe Prelude.Text
}
deriving (AttributeValue -> AttributeValue -> Bool
(AttributeValue -> AttributeValue -> Bool)
-> (AttributeValue -> AttributeValue -> Bool) -> Eq AttributeValue
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AttributeValue -> AttributeValue -> Bool
$c/= :: AttributeValue -> AttributeValue -> Bool
== :: AttributeValue -> AttributeValue -> Bool
$c== :: AttributeValue -> AttributeValue -> Bool
Prelude.Eq, ReadPrec [AttributeValue]
ReadPrec AttributeValue
Int -> ReadS AttributeValue
ReadS [AttributeValue]
(Int -> ReadS AttributeValue)
-> ReadS [AttributeValue]
-> ReadPrec AttributeValue
-> ReadPrec [AttributeValue]
-> Read AttributeValue
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AttributeValue]
$creadListPrec :: ReadPrec [AttributeValue]
readPrec :: ReadPrec AttributeValue
$creadPrec :: ReadPrec AttributeValue
readList :: ReadS [AttributeValue]
$creadList :: ReadS [AttributeValue]
readsPrec :: Int -> ReadS AttributeValue
$creadsPrec :: Int -> ReadS AttributeValue
Prelude.Read, Int -> AttributeValue -> ShowS
[AttributeValue] -> ShowS
AttributeValue -> String
(Int -> AttributeValue -> ShowS)
-> (AttributeValue -> String)
-> ([AttributeValue] -> ShowS)
-> Show AttributeValue
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AttributeValue] -> ShowS
$cshowList :: [AttributeValue] -> ShowS
show :: AttributeValue -> String
$cshow :: AttributeValue -> String
showsPrec :: Int -> AttributeValue -> ShowS
$cshowsPrec :: Int -> AttributeValue -> ShowS
Prelude.Show, (forall x. AttributeValue -> Rep AttributeValue x)
-> (forall x. Rep AttributeValue x -> AttributeValue)
-> Generic AttributeValue
forall x. Rep AttributeValue x -> AttributeValue
forall x. AttributeValue -> Rep AttributeValue x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep AttributeValue x -> AttributeValue
$cfrom :: forall x. AttributeValue -> Rep AttributeValue x
Prelude.Generic)
newAttributeValue ::
AttributeValue
newAttributeValue :: AttributeValue
newAttributeValue =
AttributeValue' :: Maybe Text -> AttributeValue
AttributeValue' {$sel:value:AttributeValue' :: Maybe Text
value = Maybe Text
forall a. Maybe a
Prelude.Nothing}
attributeValue_value :: Lens.Lens' AttributeValue (Prelude.Maybe Prelude.Text)
attributeValue_value :: (Maybe Text -> f (Maybe Text))
-> AttributeValue -> f AttributeValue
attributeValue_value = (AttributeValue -> Maybe Text)
-> (AttributeValue -> Maybe Text -> AttributeValue)
-> Lens AttributeValue AttributeValue (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AttributeValue' {Maybe Text
value :: Maybe Text
$sel:value:AttributeValue' :: AttributeValue -> Maybe Text
value} -> Maybe Text
value) (\s :: AttributeValue
s@AttributeValue' {} Maybe Text
a -> AttributeValue
s {$sel:value:AttributeValue' :: Maybe Text
value = Maybe Text
a} :: AttributeValue)
instance Core.FromJSON AttributeValue where
parseJSON :: Value -> Parser AttributeValue
parseJSON =
String
-> (Object -> Parser AttributeValue)
-> Value
-> Parser AttributeValue
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"AttributeValue"
( \Object
x ->
Maybe Text -> AttributeValue
AttributeValue' (Maybe Text -> AttributeValue)
-> Parser (Maybe Text) -> Parser AttributeValue
forall (f :: * -> *) a b. Functor 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
"Value")
)
instance Prelude.Hashable AttributeValue
instance Prelude.NFData AttributeValue