{-# 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.SES.Types.CloudWatchDimensionConfiguration where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.SES.Types.DimensionValueSource
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.FromXML
CloudWatchDimensionConfiguration
where
parseXML :: [Node] -> Either String CloudWatchDimensionConfiguration
parseXML [Node]
x =
Text
-> DimensionValueSource -> Text -> CloudWatchDimensionConfiguration
CloudWatchDimensionConfiguration'
(Text
-> DimensionValueSource
-> Text
-> CloudWatchDimensionConfiguration)
-> Either String Text
-> Either
String
(DimensionValueSource -> Text -> CloudWatchDimensionConfiguration)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x [Node] -> Text -> Either String Text
forall a. FromXML a => [Node] -> Text -> Either String a
Core..@ Text
"DimensionName")
Either
String
(DimensionValueSource -> Text -> CloudWatchDimensionConfiguration)
-> Either String DimensionValueSource
-> Either String (Text -> CloudWatchDimensionConfiguration)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String DimensionValueSource
forall a. FromXML a => [Node] -> Text -> Either String a
Core..@ Text
"DimensionValueSource")
Either String (Text -> CloudWatchDimensionConfiguration)
-> Either String Text
-> Either String CloudWatchDimensionConfiguration
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String Text
forall a. FromXML a => [Node] -> Text -> Either String a
Core..@ Text
"DefaultDimensionValue")
instance
Prelude.Hashable
CloudWatchDimensionConfiguration
instance
Prelude.NFData
CloudWatchDimensionConfiguration
instance
Core.ToQuery
CloudWatchDimensionConfiguration
where
toQuery :: CloudWatchDimensionConfiguration -> QueryString
toQuery CloudWatchDimensionConfiguration' {Text
DimensionValueSource
defaultDimensionValue :: Text
dimensionValueSource :: DimensionValueSource
dimensionName :: Text
$sel:defaultDimensionValue:CloudWatchDimensionConfiguration' :: CloudWatchDimensionConfiguration -> Text
$sel:dimensionValueSource:CloudWatchDimensionConfiguration' :: CloudWatchDimensionConfiguration -> DimensionValueSource
$sel:dimensionName:CloudWatchDimensionConfiguration' :: CloudWatchDimensionConfiguration -> Text
..} =
[QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"DimensionName" ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Text
dimensionName,
ByteString
"DimensionValueSource" ByteString -> DimensionValueSource -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: DimensionValueSource
dimensionValueSource,
ByteString
"DefaultDimensionValue"
ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Text
defaultDimensionValue
]