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