{-# 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.DynamoDB.Types.ItemCollectionMetrics where
import qualified Amazonka.Core as Core
import Amazonka.DynamoDB.Types.AttributeValue
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data ItemCollectionMetrics = ItemCollectionMetrics'
{
ItemCollectionMetrics -> Maybe (HashMap Text AttributeValue)
itemCollectionKey :: Prelude.Maybe (Prelude.HashMap Prelude.Text AttributeValue),
ItemCollectionMetrics -> Maybe [Double]
sizeEstimateRangeGB :: Prelude.Maybe [Prelude.Double]
}
deriving (ItemCollectionMetrics -> ItemCollectionMetrics -> Bool
(ItemCollectionMetrics -> ItemCollectionMetrics -> Bool)
-> (ItemCollectionMetrics -> ItemCollectionMetrics -> Bool)
-> Eq ItemCollectionMetrics
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ItemCollectionMetrics -> ItemCollectionMetrics -> Bool
$c/= :: ItemCollectionMetrics -> ItemCollectionMetrics -> Bool
== :: ItemCollectionMetrics -> ItemCollectionMetrics -> Bool
$c== :: ItemCollectionMetrics -> ItemCollectionMetrics -> Bool
Prelude.Eq, ReadPrec [ItemCollectionMetrics]
ReadPrec ItemCollectionMetrics
Int -> ReadS ItemCollectionMetrics
ReadS [ItemCollectionMetrics]
(Int -> ReadS ItemCollectionMetrics)
-> ReadS [ItemCollectionMetrics]
-> ReadPrec ItemCollectionMetrics
-> ReadPrec [ItemCollectionMetrics]
-> Read ItemCollectionMetrics
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ItemCollectionMetrics]
$creadListPrec :: ReadPrec [ItemCollectionMetrics]
readPrec :: ReadPrec ItemCollectionMetrics
$creadPrec :: ReadPrec ItemCollectionMetrics
readList :: ReadS [ItemCollectionMetrics]
$creadList :: ReadS [ItemCollectionMetrics]
readsPrec :: Int -> ReadS ItemCollectionMetrics
$creadsPrec :: Int -> ReadS ItemCollectionMetrics
Prelude.Read, Int -> ItemCollectionMetrics -> ShowS
[ItemCollectionMetrics] -> ShowS
ItemCollectionMetrics -> String
(Int -> ItemCollectionMetrics -> ShowS)
-> (ItemCollectionMetrics -> String)
-> ([ItemCollectionMetrics] -> ShowS)
-> Show ItemCollectionMetrics
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ItemCollectionMetrics] -> ShowS
$cshowList :: [ItemCollectionMetrics] -> ShowS
show :: ItemCollectionMetrics -> String
$cshow :: ItemCollectionMetrics -> String
showsPrec :: Int -> ItemCollectionMetrics -> ShowS
$cshowsPrec :: Int -> ItemCollectionMetrics -> ShowS
Prelude.Show, (forall x. ItemCollectionMetrics -> Rep ItemCollectionMetrics x)
-> (forall x. Rep ItemCollectionMetrics x -> ItemCollectionMetrics)
-> Generic ItemCollectionMetrics
forall x. Rep ItemCollectionMetrics x -> ItemCollectionMetrics
forall x. ItemCollectionMetrics -> Rep ItemCollectionMetrics x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ItemCollectionMetrics x -> ItemCollectionMetrics
$cfrom :: forall x. ItemCollectionMetrics -> Rep ItemCollectionMetrics x
Prelude.Generic)
newItemCollectionMetrics ::
ItemCollectionMetrics
newItemCollectionMetrics :: ItemCollectionMetrics
newItemCollectionMetrics =
ItemCollectionMetrics' :: Maybe (HashMap Text AttributeValue)
-> Maybe [Double] -> ItemCollectionMetrics
ItemCollectionMetrics'
{ $sel:itemCollectionKey:ItemCollectionMetrics' :: Maybe (HashMap Text AttributeValue)
itemCollectionKey =
Maybe (HashMap Text AttributeValue)
forall a. Maybe a
Prelude.Nothing,
$sel:sizeEstimateRangeGB:ItemCollectionMetrics' :: Maybe [Double]
sizeEstimateRangeGB = Maybe [Double]
forall a. Maybe a
Prelude.Nothing
}
itemCollectionMetrics_itemCollectionKey :: Lens.Lens' ItemCollectionMetrics (Prelude.Maybe (Prelude.HashMap Prelude.Text AttributeValue))
itemCollectionMetrics_itemCollectionKey :: (Maybe (HashMap Text AttributeValue)
-> f (Maybe (HashMap Text AttributeValue)))
-> ItemCollectionMetrics -> f ItemCollectionMetrics
itemCollectionMetrics_itemCollectionKey = (ItemCollectionMetrics -> Maybe (HashMap Text AttributeValue))
-> (ItemCollectionMetrics
-> Maybe (HashMap Text AttributeValue) -> ItemCollectionMetrics)
-> Lens
ItemCollectionMetrics
ItemCollectionMetrics
(Maybe (HashMap Text AttributeValue))
(Maybe (HashMap Text AttributeValue))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ItemCollectionMetrics' {Maybe (HashMap Text AttributeValue)
itemCollectionKey :: Maybe (HashMap Text AttributeValue)
$sel:itemCollectionKey:ItemCollectionMetrics' :: ItemCollectionMetrics -> Maybe (HashMap Text AttributeValue)
itemCollectionKey} -> Maybe (HashMap Text AttributeValue)
itemCollectionKey) (\s :: ItemCollectionMetrics
s@ItemCollectionMetrics' {} Maybe (HashMap Text AttributeValue)
a -> ItemCollectionMetrics
s {$sel:itemCollectionKey:ItemCollectionMetrics' :: Maybe (HashMap Text AttributeValue)
itemCollectionKey = Maybe (HashMap Text AttributeValue)
a} :: ItemCollectionMetrics) ((Maybe (HashMap Text AttributeValue)
-> f (Maybe (HashMap Text AttributeValue)))
-> ItemCollectionMetrics -> f ItemCollectionMetrics)
-> ((Maybe (HashMap Text AttributeValue)
-> f (Maybe (HashMap Text AttributeValue)))
-> Maybe (HashMap Text AttributeValue)
-> f (Maybe (HashMap Text AttributeValue)))
-> (Maybe (HashMap Text AttributeValue)
-> f (Maybe (HashMap Text AttributeValue)))
-> ItemCollectionMetrics
-> f ItemCollectionMetrics
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
(HashMap Text AttributeValue)
(HashMap Text AttributeValue)
(HashMap Text AttributeValue)
(HashMap Text AttributeValue)
-> Iso
(Maybe (HashMap Text AttributeValue))
(Maybe (HashMap Text AttributeValue))
(Maybe (HashMap Text AttributeValue))
(Maybe (HashMap Text AttributeValue))
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso
(HashMap Text AttributeValue)
(HashMap Text AttributeValue)
(HashMap Text AttributeValue)
(HashMap Text AttributeValue)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
itemCollectionMetrics_sizeEstimateRangeGB :: Lens.Lens' ItemCollectionMetrics (Prelude.Maybe [Prelude.Double])
itemCollectionMetrics_sizeEstimateRangeGB :: (Maybe [Double] -> f (Maybe [Double]))
-> ItemCollectionMetrics -> f ItemCollectionMetrics
itemCollectionMetrics_sizeEstimateRangeGB = (ItemCollectionMetrics -> Maybe [Double])
-> (ItemCollectionMetrics
-> Maybe [Double] -> ItemCollectionMetrics)
-> Lens
ItemCollectionMetrics
ItemCollectionMetrics
(Maybe [Double])
(Maybe [Double])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ItemCollectionMetrics' {Maybe [Double]
sizeEstimateRangeGB :: Maybe [Double]
$sel:sizeEstimateRangeGB:ItemCollectionMetrics' :: ItemCollectionMetrics -> Maybe [Double]
sizeEstimateRangeGB} -> Maybe [Double]
sizeEstimateRangeGB) (\s :: ItemCollectionMetrics
s@ItemCollectionMetrics' {} Maybe [Double]
a -> ItemCollectionMetrics
s {$sel:sizeEstimateRangeGB:ItemCollectionMetrics' :: Maybe [Double]
sizeEstimateRangeGB = Maybe [Double]
a} :: ItemCollectionMetrics) ((Maybe [Double] -> f (Maybe [Double]))
-> ItemCollectionMetrics -> f ItemCollectionMetrics)
-> ((Maybe [Double] -> f (Maybe [Double]))
-> Maybe [Double] -> f (Maybe [Double]))
-> (Maybe [Double] -> f (Maybe [Double]))
-> ItemCollectionMetrics
-> f ItemCollectionMetrics
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Double] [Double] [Double] [Double]
-> Iso
(Maybe [Double]) (Maybe [Double]) (Maybe [Double]) (Maybe [Double])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso [Double] [Double] [Double] [Double]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
instance Core.FromJSON ItemCollectionMetrics where
parseJSON :: Value -> Parser ItemCollectionMetrics
parseJSON =
String
-> (Object -> Parser ItemCollectionMetrics)
-> Value
-> Parser ItemCollectionMetrics
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"ItemCollectionMetrics"
( \Object
x ->
Maybe (HashMap Text AttributeValue)
-> Maybe [Double] -> ItemCollectionMetrics
ItemCollectionMetrics'
(Maybe (HashMap Text AttributeValue)
-> Maybe [Double] -> ItemCollectionMetrics)
-> Parser (Maybe (HashMap Text AttributeValue))
-> Parser (Maybe [Double] -> ItemCollectionMetrics)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ( Object
x Object
-> Text -> Parser (Maybe (Maybe (HashMap Text AttributeValue)))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ItemCollectionKey"
Parser (Maybe (Maybe (HashMap Text AttributeValue)))
-> Maybe (HashMap Text AttributeValue)
-> Parser (Maybe (HashMap Text AttributeValue))
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe (HashMap Text AttributeValue)
forall a. Monoid a => a
Prelude.mempty
)
Parser (Maybe [Double] -> ItemCollectionMetrics)
-> Parser (Maybe [Double]) -> Parser ItemCollectionMetrics
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object -> Text -> Parser (Maybe (Maybe [Double]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"SizeEstimateRangeGB"
Parser (Maybe (Maybe [Double]))
-> Maybe [Double] -> Parser (Maybe [Double])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [Double]
forall a. Monoid a => a
Prelude.mempty
)
)
instance Prelude.Hashable ItemCollectionMetrics
instance Prelude.NFData ItemCollectionMetrics