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