{-# 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.PinpointEmail.Types.CloudWatchDimensionConfiguration where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.PinpointEmail.Types.DimensionValueSource
import qualified Amazonka.Prelude as Prelude
data CloudWatchDimensionConfiguration = CloudWatchDimensionConfiguration'
{
CloudWatchDimensionConfiguration -> Text
dimensionName :: Prelude.Text,
CloudWatchDimensionConfiguration -> DimensionValueSource
dimensionValueSource :: DimensionValueSource,
CloudWatchDimensionConfiguration -> Text
defaultDimensionValue :: Prelude.Text
}
deriving (CloudWatchDimensionConfiguration
-> CloudWatchDimensionConfiguration -> Bool
(CloudWatchDimensionConfiguration
-> CloudWatchDimensionConfiguration -> Bool)
-> (CloudWatchDimensionConfiguration
-> CloudWatchDimensionConfiguration -> Bool)
-> Eq CloudWatchDimensionConfiguration
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CloudWatchDimensionConfiguration
-> CloudWatchDimensionConfiguration -> Bool
$c/= :: CloudWatchDimensionConfiguration
-> CloudWatchDimensionConfiguration -> Bool
== :: CloudWatchDimensionConfiguration
-> CloudWatchDimensionConfiguration -> Bool
$c== :: CloudWatchDimensionConfiguration
-> CloudWatchDimensionConfiguration -> Bool
Prelude.Eq, ReadPrec [CloudWatchDimensionConfiguration]
ReadPrec CloudWatchDimensionConfiguration
Int -> ReadS CloudWatchDimensionConfiguration
ReadS [CloudWatchDimensionConfiguration]
(Int -> ReadS CloudWatchDimensionConfiguration)
-> ReadS [CloudWatchDimensionConfiguration]
-> ReadPrec CloudWatchDimensionConfiguration
-> ReadPrec [CloudWatchDimensionConfiguration]
-> Read CloudWatchDimensionConfiguration
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CloudWatchDimensionConfiguration]
$creadListPrec :: ReadPrec [CloudWatchDimensionConfiguration]
readPrec :: ReadPrec CloudWatchDimensionConfiguration
$creadPrec :: ReadPrec CloudWatchDimensionConfiguration
readList :: ReadS [CloudWatchDimensionConfiguration]
$creadList :: ReadS [CloudWatchDimensionConfiguration]
readsPrec :: Int -> ReadS CloudWatchDimensionConfiguration
$creadsPrec :: Int -> ReadS CloudWatchDimensionConfiguration
Prelude.Read, Int -> CloudWatchDimensionConfiguration -> ShowS
[CloudWatchDimensionConfiguration] -> ShowS
CloudWatchDimensionConfiguration -> String
(Int -> CloudWatchDimensionConfiguration -> ShowS)
-> (CloudWatchDimensionConfiguration -> String)
-> ([CloudWatchDimensionConfiguration] -> ShowS)
-> Show CloudWatchDimensionConfiguration
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CloudWatchDimensionConfiguration] -> ShowS
$cshowList :: [CloudWatchDimensionConfiguration] -> ShowS
show :: CloudWatchDimensionConfiguration -> String
$cshow :: CloudWatchDimensionConfiguration -> String
showsPrec :: Int -> CloudWatchDimensionConfiguration -> ShowS
$cshowsPrec :: Int -> CloudWatchDimensionConfiguration -> ShowS
Prelude.Show, (forall x.
CloudWatchDimensionConfiguration
-> Rep CloudWatchDimensionConfiguration x)
-> (forall x.
Rep CloudWatchDimensionConfiguration x
-> CloudWatchDimensionConfiguration)
-> Generic CloudWatchDimensionConfiguration
forall x.
Rep CloudWatchDimensionConfiguration x
-> CloudWatchDimensionConfiguration
forall x.
CloudWatchDimensionConfiguration
-> Rep CloudWatchDimensionConfiguration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CloudWatchDimensionConfiguration x
-> CloudWatchDimensionConfiguration
$cfrom :: forall x.
CloudWatchDimensionConfiguration
-> Rep CloudWatchDimensionConfiguration x
Prelude.Generic)
newCloudWatchDimensionConfiguration ::
Prelude.Text ->
DimensionValueSource ->
Prelude.Text ->
CloudWatchDimensionConfiguration
newCloudWatchDimensionConfiguration :: Text
-> DimensionValueSource -> Text -> CloudWatchDimensionConfiguration
newCloudWatchDimensionConfiguration
Text
pDimensionName_
DimensionValueSource
pDimensionValueSource_
Text
pDefaultDimensionValue_ =
CloudWatchDimensionConfiguration' :: Text
-> DimensionValueSource -> Text -> CloudWatchDimensionConfiguration
CloudWatchDimensionConfiguration'
{ $sel:dimensionName:CloudWatchDimensionConfiguration' :: Text
dimensionName =
Text
pDimensionName_,
$sel:dimensionValueSource:CloudWatchDimensionConfiguration' :: DimensionValueSource
dimensionValueSource =
DimensionValueSource
pDimensionValueSource_,
$sel:defaultDimensionValue:CloudWatchDimensionConfiguration' :: Text
defaultDimensionValue =
Text
pDefaultDimensionValue_
}
cloudWatchDimensionConfiguration_dimensionName :: Lens.Lens' CloudWatchDimensionConfiguration Prelude.Text
cloudWatchDimensionConfiguration_dimensionName :: (Text -> f Text)
-> CloudWatchDimensionConfiguration
-> f CloudWatchDimensionConfiguration
cloudWatchDimensionConfiguration_dimensionName = (CloudWatchDimensionConfiguration -> Text)
-> (CloudWatchDimensionConfiguration
-> Text -> CloudWatchDimensionConfiguration)
-> Lens
CloudWatchDimensionConfiguration
CloudWatchDimensionConfiguration
Text
Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CloudWatchDimensionConfiguration' {Text
dimensionName :: Text
$sel:dimensionName:CloudWatchDimensionConfiguration' :: CloudWatchDimensionConfiguration -> Text
dimensionName} -> Text
dimensionName) (\s :: CloudWatchDimensionConfiguration
s@CloudWatchDimensionConfiguration' {} Text
a -> CloudWatchDimensionConfiguration
s {$sel:dimensionName:CloudWatchDimensionConfiguration' :: Text
dimensionName = Text
a} :: CloudWatchDimensionConfiguration)
cloudWatchDimensionConfiguration_dimensionValueSource :: Lens.Lens' CloudWatchDimensionConfiguration DimensionValueSource
cloudWatchDimensionConfiguration_dimensionValueSource :: (DimensionValueSource -> f DimensionValueSource)
-> CloudWatchDimensionConfiguration
-> f CloudWatchDimensionConfiguration
cloudWatchDimensionConfiguration_dimensionValueSource = (CloudWatchDimensionConfiguration -> DimensionValueSource)
-> (CloudWatchDimensionConfiguration
-> DimensionValueSource -> CloudWatchDimensionConfiguration)
-> Lens
CloudWatchDimensionConfiguration
CloudWatchDimensionConfiguration
DimensionValueSource
DimensionValueSource
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CloudWatchDimensionConfiguration' {DimensionValueSource
dimensionValueSource :: DimensionValueSource
$sel:dimensionValueSource:CloudWatchDimensionConfiguration' :: CloudWatchDimensionConfiguration -> DimensionValueSource
dimensionValueSource} -> DimensionValueSource
dimensionValueSource) (\s :: CloudWatchDimensionConfiguration
s@CloudWatchDimensionConfiguration' {} DimensionValueSource
a -> CloudWatchDimensionConfiguration
s {$sel:dimensionValueSource:CloudWatchDimensionConfiguration' :: DimensionValueSource
dimensionValueSource = DimensionValueSource
a} :: CloudWatchDimensionConfiguration)
cloudWatchDimensionConfiguration_defaultDimensionValue :: Lens.Lens' CloudWatchDimensionConfiguration Prelude.Text
cloudWatchDimensionConfiguration_defaultDimensionValue :: (Text -> f Text)
-> CloudWatchDimensionConfiguration
-> f CloudWatchDimensionConfiguration
cloudWatchDimensionConfiguration_defaultDimensionValue = (CloudWatchDimensionConfiguration -> Text)
-> (CloudWatchDimensionConfiguration
-> Text -> CloudWatchDimensionConfiguration)
-> Lens
CloudWatchDimensionConfiguration
CloudWatchDimensionConfiguration
Text
Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CloudWatchDimensionConfiguration' {Text
defaultDimensionValue :: Text
$sel:defaultDimensionValue:CloudWatchDimensionConfiguration' :: CloudWatchDimensionConfiguration -> Text
defaultDimensionValue} -> Text
defaultDimensionValue) (\s :: CloudWatchDimensionConfiguration
s@CloudWatchDimensionConfiguration' {} Text
a -> CloudWatchDimensionConfiguration
s {$sel:defaultDimensionValue:CloudWatchDimensionConfiguration' :: Text
defaultDimensionValue = Text
a} :: CloudWatchDimensionConfiguration)
instance
Core.FromJSON
CloudWatchDimensionConfiguration
where
parseJSON :: Value -> Parser CloudWatchDimensionConfiguration
parseJSON =
String
-> (Object -> Parser CloudWatchDimensionConfiguration)
-> Value
-> Parser CloudWatchDimensionConfiguration
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"CloudWatchDimensionConfiguration"
( \Object
x ->
Text
-> DimensionValueSource -> Text -> CloudWatchDimensionConfiguration
CloudWatchDimensionConfiguration'
(Text
-> DimensionValueSource
-> Text
-> CloudWatchDimensionConfiguration)
-> Parser Text
-> Parser
(DimensionValueSource -> Text -> CloudWatchDimensionConfiguration)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"DimensionName")
Parser
(DimensionValueSource -> Text -> CloudWatchDimensionConfiguration)
-> Parser DimensionValueSource
-> Parser (Text -> CloudWatchDimensionConfiguration)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser DimensionValueSource
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"DimensionValueSource")
Parser (Text -> CloudWatchDimensionConfiguration)
-> Parser Text -> Parser CloudWatchDimensionConfiguration
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"DefaultDimensionValue")
)
instance
Prelude.Hashable
CloudWatchDimensionConfiguration
instance
Prelude.NFData
CloudWatchDimensionConfiguration
instance Core.ToJSON CloudWatchDimensionConfiguration where
toJSON :: CloudWatchDimensionConfiguration -> Value
toJSON CloudWatchDimensionConfiguration' {Text
DimensionValueSource
defaultDimensionValue :: Text
dimensionValueSource :: DimensionValueSource
dimensionName :: Text
$sel:defaultDimensionValue:CloudWatchDimensionConfiguration' :: CloudWatchDimensionConfiguration -> Text
$sel:dimensionValueSource:CloudWatchDimensionConfiguration' :: CloudWatchDimensionConfiguration -> DimensionValueSource
$sel:dimensionName:CloudWatchDimensionConfiguration' :: CloudWatchDimensionConfiguration -> Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
(Text
"DimensionName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
dimensionName),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
( Text
"DimensionValueSource"
Text -> DimensionValueSource -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= DimensionValueSource
dimensionValueSource
),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
( Text
"DefaultDimensionValue"
Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
defaultDimensionValue
)
]
)