{-# 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.Pi.Types.DimensionKeyDescription 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 DimensionKeyDescription = DimensionKeyDescription'
{
DimensionKeyDescription -> Maybe (HashMap Text Double)
additionalMetrics :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Double),
DimensionKeyDescription -> Maybe (HashMap Text Text)
dimensions :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
DimensionKeyDescription -> Maybe [Double]
partitions :: Prelude.Maybe [Prelude.Double],
DimensionKeyDescription -> Maybe Double
total :: Prelude.Maybe Prelude.Double
}
deriving (DimensionKeyDescription -> DimensionKeyDescription -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DimensionKeyDescription -> DimensionKeyDescription -> Bool
$c/= :: DimensionKeyDescription -> DimensionKeyDescription -> Bool
== :: DimensionKeyDescription -> DimensionKeyDescription -> Bool
$c== :: DimensionKeyDescription -> DimensionKeyDescription -> Bool
Prelude.Eq, ReadPrec [DimensionKeyDescription]
ReadPrec DimensionKeyDescription
Int -> ReadS DimensionKeyDescription
ReadS [DimensionKeyDescription]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DimensionKeyDescription]
$creadListPrec :: ReadPrec [DimensionKeyDescription]
readPrec :: ReadPrec DimensionKeyDescription
$creadPrec :: ReadPrec DimensionKeyDescription
readList :: ReadS [DimensionKeyDescription]
$creadList :: ReadS [DimensionKeyDescription]
readsPrec :: Int -> ReadS DimensionKeyDescription
$creadsPrec :: Int -> ReadS DimensionKeyDescription
Prelude.Read, Int -> DimensionKeyDescription -> ShowS
[DimensionKeyDescription] -> ShowS
DimensionKeyDescription -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DimensionKeyDescription] -> ShowS
$cshowList :: [DimensionKeyDescription] -> ShowS
show :: DimensionKeyDescription -> String
$cshow :: DimensionKeyDescription -> String
showsPrec :: Int -> DimensionKeyDescription -> ShowS
$cshowsPrec :: Int -> DimensionKeyDescription -> ShowS
Prelude.Show, forall x. Rep DimensionKeyDescription x -> DimensionKeyDescription
forall x. DimensionKeyDescription -> Rep DimensionKeyDescription x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DimensionKeyDescription x -> DimensionKeyDescription
$cfrom :: forall x. DimensionKeyDescription -> Rep DimensionKeyDescription x
Prelude.Generic)
newDimensionKeyDescription ::
DimensionKeyDescription
newDimensionKeyDescription :: DimensionKeyDescription
newDimensionKeyDescription =
DimensionKeyDescription'
{ $sel:additionalMetrics:DimensionKeyDescription' :: Maybe (HashMap Text Double)
additionalMetrics =
forall a. Maybe a
Prelude.Nothing,
$sel:dimensions:DimensionKeyDescription' :: Maybe (HashMap Text Text)
dimensions = forall a. Maybe a
Prelude.Nothing,
$sel:partitions:DimensionKeyDescription' :: Maybe [Double]
partitions = forall a. Maybe a
Prelude.Nothing,
$sel:total:DimensionKeyDescription' :: Maybe Double
total = forall a. Maybe a
Prelude.Nothing
}
dimensionKeyDescription_additionalMetrics :: Lens.Lens' DimensionKeyDescription (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Double))
dimensionKeyDescription_additionalMetrics :: Lens' DimensionKeyDescription (Maybe (HashMap Text Double))
dimensionKeyDescription_additionalMetrics = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DimensionKeyDescription' {Maybe (HashMap Text Double)
additionalMetrics :: Maybe (HashMap Text Double)
$sel:additionalMetrics:DimensionKeyDescription' :: DimensionKeyDescription -> Maybe (HashMap Text Double)
additionalMetrics} -> Maybe (HashMap Text Double)
additionalMetrics) (\s :: DimensionKeyDescription
s@DimensionKeyDescription' {} Maybe (HashMap Text Double)
a -> DimensionKeyDescription
s {$sel:additionalMetrics:DimensionKeyDescription' :: Maybe (HashMap Text Double)
additionalMetrics = Maybe (HashMap Text Double)
a} :: DimensionKeyDescription) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
dimensionKeyDescription_dimensions :: Lens.Lens' DimensionKeyDescription (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
dimensionKeyDescription_dimensions :: Lens' DimensionKeyDescription (Maybe (HashMap Text Text))
dimensionKeyDescription_dimensions = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DimensionKeyDescription' {Maybe (HashMap Text Text)
dimensions :: Maybe (HashMap Text Text)
$sel:dimensions:DimensionKeyDescription' :: DimensionKeyDescription -> Maybe (HashMap Text Text)
dimensions} -> Maybe (HashMap Text Text)
dimensions) (\s :: DimensionKeyDescription
s@DimensionKeyDescription' {} Maybe (HashMap Text Text)
a -> DimensionKeyDescription
s {$sel:dimensions:DimensionKeyDescription' :: Maybe (HashMap Text Text)
dimensions = Maybe (HashMap Text Text)
a} :: DimensionKeyDescription) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
dimensionKeyDescription_partitions :: Lens.Lens' DimensionKeyDescription (Prelude.Maybe [Prelude.Double])
dimensionKeyDescription_partitions :: Lens' DimensionKeyDescription (Maybe [Double])
dimensionKeyDescription_partitions = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DimensionKeyDescription' {Maybe [Double]
partitions :: Maybe [Double]
$sel:partitions:DimensionKeyDescription' :: DimensionKeyDescription -> Maybe [Double]
partitions} -> Maybe [Double]
partitions) (\s :: DimensionKeyDescription
s@DimensionKeyDescription' {} Maybe [Double]
a -> DimensionKeyDescription
s {$sel:partitions:DimensionKeyDescription' :: Maybe [Double]
partitions = Maybe [Double]
a} :: DimensionKeyDescription) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
dimensionKeyDescription_total :: Lens.Lens' DimensionKeyDescription (Prelude.Maybe Prelude.Double)
dimensionKeyDescription_total :: Lens' DimensionKeyDescription (Maybe Double)
dimensionKeyDescription_total = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DimensionKeyDescription' {Maybe Double
total :: Maybe Double
$sel:total:DimensionKeyDescription' :: DimensionKeyDescription -> Maybe Double
total} -> Maybe Double
total) (\s :: DimensionKeyDescription
s@DimensionKeyDescription' {} Maybe Double
a -> DimensionKeyDescription
s {$sel:total:DimensionKeyDescription' :: Maybe Double
total = Maybe Double
a} :: DimensionKeyDescription)
instance Data.FromJSON DimensionKeyDescription where
parseJSON :: Value -> Parser DimensionKeyDescription
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"DimensionKeyDescription"
( \Object
x ->
Maybe (HashMap Text Double)
-> Maybe (HashMap Text Text)
-> Maybe [Double]
-> Maybe Double
-> DimensionKeyDescription
DimensionKeyDescription'
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
"AdditionalMetrics"
forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty
)
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
"Dimensions" forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty)
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
"Partitions" forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty)
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
"Total")
)
instance Prelude.Hashable DimensionKeyDescription where
hashWithSalt :: Int -> DimensionKeyDescription -> Int
hashWithSalt Int
_salt DimensionKeyDescription' {Maybe Double
Maybe [Double]
Maybe (HashMap Text Double)
Maybe (HashMap Text Text)
total :: Maybe Double
partitions :: Maybe [Double]
dimensions :: Maybe (HashMap Text Text)
additionalMetrics :: Maybe (HashMap Text Double)
$sel:total:DimensionKeyDescription' :: DimensionKeyDescription -> Maybe Double
$sel:partitions:DimensionKeyDescription' :: DimensionKeyDescription -> Maybe [Double]
$sel:dimensions:DimensionKeyDescription' :: DimensionKeyDescription -> Maybe (HashMap Text Text)
$sel:additionalMetrics:DimensionKeyDescription' :: DimensionKeyDescription -> Maybe (HashMap Text Double)
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (HashMap Text Double)
additionalMetrics
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (HashMap Text Text)
dimensions
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Double]
partitions
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Double
total
instance Prelude.NFData DimensionKeyDescription where
rnf :: DimensionKeyDescription -> ()
rnf DimensionKeyDescription' {Maybe Double
Maybe [Double]
Maybe (HashMap Text Double)
Maybe (HashMap Text Text)
total :: Maybe Double
partitions :: Maybe [Double]
dimensions :: Maybe (HashMap Text Text)
additionalMetrics :: Maybe (HashMap Text Double)
$sel:total:DimensionKeyDescription' :: DimensionKeyDescription -> Maybe Double
$sel:partitions:DimensionKeyDescription' :: DimensionKeyDescription -> Maybe [Double]
$sel:dimensions:DimensionKeyDescription' :: DimensionKeyDescription -> Maybe (HashMap Text Text)
$sel:additionalMetrics:DimensionKeyDescription' :: DimensionKeyDescription -> Maybe (HashMap Text Double)
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe (HashMap Text Double)
additionalMetrics
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe (HashMap Text Text)
dimensions
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Double]
partitions
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Double
total