{-# 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.ResponseResourceMetricKey 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 ResponseResourceMetricKey = ResponseResourceMetricKey'
{
ResponseResourceMetricKey -> Maybe (HashMap Text Text)
dimensions :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
ResponseResourceMetricKey -> Text
metric :: Prelude.Text
}
deriving (ResponseResourceMetricKey -> ResponseResourceMetricKey -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ResponseResourceMetricKey -> ResponseResourceMetricKey -> Bool
$c/= :: ResponseResourceMetricKey -> ResponseResourceMetricKey -> Bool
== :: ResponseResourceMetricKey -> ResponseResourceMetricKey -> Bool
$c== :: ResponseResourceMetricKey -> ResponseResourceMetricKey -> Bool
Prelude.Eq, ReadPrec [ResponseResourceMetricKey]
ReadPrec ResponseResourceMetricKey
Int -> ReadS ResponseResourceMetricKey
ReadS [ResponseResourceMetricKey]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ResponseResourceMetricKey]
$creadListPrec :: ReadPrec [ResponseResourceMetricKey]
readPrec :: ReadPrec ResponseResourceMetricKey
$creadPrec :: ReadPrec ResponseResourceMetricKey
readList :: ReadS [ResponseResourceMetricKey]
$creadList :: ReadS [ResponseResourceMetricKey]
readsPrec :: Int -> ReadS ResponseResourceMetricKey
$creadsPrec :: Int -> ReadS ResponseResourceMetricKey
Prelude.Read, Int -> ResponseResourceMetricKey -> ShowS
[ResponseResourceMetricKey] -> ShowS
ResponseResourceMetricKey -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ResponseResourceMetricKey] -> ShowS
$cshowList :: [ResponseResourceMetricKey] -> ShowS
show :: ResponseResourceMetricKey -> String
$cshow :: ResponseResourceMetricKey -> String
showsPrec :: Int -> ResponseResourceMetricKey -> ShowS
$cshowsPrec :: Int -> ResponseResourceMetricKey -> ShowS
Prelude.Show, forall x.
Rep ResponseResourceMetricKey x -> ResponseResourceMetricKey
forall x.
ResponseResourceMetricKey -> Rep ResponseResourceMetricKey x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ResponseResourceMetricKey x -> ResponseResourceMetricKey
$cfrom :: forall x.
ResponseResourceMetricKey -> Rep ResponseResourceMetricKey x
Prelude.Generic)
newResponseResourceMetricKey ::
Prelude.Text ->
ResponseResourceMetricKey
newResponseResourceMetricKey :: Text -> ResponseResourceMetricKey
newResponseResourceMetricKey Text
pMetric_ =
ResponseResourceMetricKey'
{ $sel:dimensions:ResponseResourceMetricKey' :: Maybe (HashMap Text Text)
dimensions =
forall a. Maybe a
Prelude.Nothing,
$sel:metric:ResponseResourceMetricKey' :: Text
metric = Text
pMetric_
}
responseResourceMetricKey_dimensions :: Lens.Lens' ResponseResourceMetricKey (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
responseResourceMetricKey_dimensions :: Lens' ResponseResourceMetricKey (Maybe (HashMap Text Text))
responseResourceMetricKey_dimensions = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ResponseResourceMetricKey' {Maybe (HashMap Text Text)
dimensions :: Maybe (HashMap Text Text)
$sel:dimensions:ResponseResourceMetricKey' :: ResponseResourceMetricKey -> Maybe (HashMap Text Text)
dimensions} -> Maybe (HashMap Text Text)
dimensions) (\s :: ResponseResourceMetricKey
s@ResponseResourceMetricKey' {} Maybe (HashMap Text Text)
a -> ResponseResourceMetricKey
s {$sel:dimensions:ResponseResourceMetricKey' :: Maybe (HashMap Text Text)
dimensions = Maybe (HashMap Text Text)
a} :: ResponseResourceMetricKey) 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
responseResourceMetricKey_metric :: Lens.Lens' ResponseResourceMetricKey Prelude.Text
responseResourceMetricKey_metric :: Lens' ResponseResourceMetricKey Text
responseResourceMetricKey_metric = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ResponseResourceMetricKey' {Text
metric :: Text
$sel:metric:ResponseResourceMetricKey' :: ResponseResourceMetricKey -> Text
metric} -> Text
metric) (\s :: ResponseResourceMetricKey
s@ResponseResourceMetricKey' {} Text
a -> ResponseResourceMetricKey
s {$sel:metric:ResponseResourceMetricKey' :: Text
metric = Text
a} :: ResponseResourceMetricKey)
instance Data.FromJSON ResponseResourceMetricKey where
parseJSON :: Value -> Parser ResponseResourceMetricKey
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"ResponseResourceMetricKey"
( \Object
x ->
Maybe (HashMap Text Text) -> Text -> ResponseResourceMetricKey
ResponseResourceMetricKey'
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
"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 a
Data..: Key
"Metric")
)
instance Prelude.Hashable ResponseResourceMetricKey where
hashWithSalt :: Int -> ResponseResourceMetricKey -> Int
hashWithSalt Int
_salt ResponseResourceMetricKey' {Maybe (HashMap Text Text)
Text
metric :: Text
dimensions :: Maybe (HashMap Text Text)
$sel:metric:ResponseResourceMetricKey' :: ResponseResourceMetricKey -> Text
$sel:dimensions:ResponseResourceMetricKey' :: ResponseResourceMetricKey -> Maybe (HashMap Text Text)
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (HashMap Text Text)
dimensions
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
metric
instance Prelude.NFData ResponseResourceMetricKey where
rnf :: ResponseResourceMetricKey -> ()
rnf ResponseResourceMetricKey' {Maybe (HashMap Text Text)
Text
metric :: Text
dimensions :: Maybe (HashMap Text Text)
$sel:metric:ResponseResourceMetricKey' :: ResponseResourceMetricKey -> Text
$sel:dimensions:ResponseResourceMetricKey' :: ResponseResourceMetricKey -> Maybe (HashMap Text Text)
..} =
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 Text
metric