{-# 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.CloudWatchDestination where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.SES.Types.CloudWatchDimensionConfiguration
data CloudWatchDestination = CloudWatchDestination'
{
CloudWatchDestination -> [CloudWatchDimensionConfiguration]
dimensionConfigurations :: [CloudWatchDimensionConfiguration]
}
deriving (CloudWatchDestination -> CloudWatchDestination -> Bool
(CloudWatchDestination -> CloudWatchDestination -> Bool)
-> (CloudWatchDestination -> CloudWatchDestination -> Bool)
-> Eq CloudWatchDestination
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CloudWatchDestination -> CloudWatchDestination -> Bool
$c/= :: CloudWatchDestination -> CloudWatchDestination -> Bool
== :: CloudWatchDestination -> CloudWatchDestination -> Bool
$c== :: CloudWatchDestination -> CloudWatchDestination -> Bool
Prelude.Eq, ReadPrec [CloudWatchDestination]
ReadPrec CloudWatchDestination
Int -> ReadS CloudWatchDestination
ReadS [CloudWatchDestination]
(Int -> ReadS CloudWatchDestination)
-> ReadS [CloudWatchDestination]
-> ReadPrec CloudWatchDestination
-> ReadPrec [CloudWatchDestination]
-> Read CloudWatchDestination
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CloudWatchDestination]
$creadListPrec :: ReadPrec [CloudWatchDestination]
readPrec :: ReadPrec CloudWatchDestination
$creadPrec :: ReadPrec CloudWatchDestination
readList :: ReadS [CloudWatchDestination]
$creadList :: ReadS [CloudWatchDestination]
readsPrec :: Int -> ReadS CloudWatchDestination
$creadsPrec :: Int -> ReadS CloudWatchDestination
Prelude.Read, Int -> CloudWatchDestination -> ShowS
[CloudWatchDestination] -> ShowS
CloudWatchDestination -> String
(Int -> CloudWatchDestination -> ShowS)
-> (CloudWatchDestination -> String)
-> ([CloudWatchDestination] -> ShowS)
-> Show CloudWatchDestination
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CloudWatchDestination] -> ShowS
$cshowList :: [CloudWatchDestination] -> ShowS
show :: CloudWatchDestination -> String
$cshow :: CloudWatchDestination -> String
showsPrec :: Int -> CloudWatchDestination -> ShowS
$cshowsPrec :: Int -> CloudWatchDestination -> ShowS
Prelude.Show, (forall x. CloudWatchDestination -> Rep CloudWatchDestination x)
-> (forall x. Rep CloudWatchDestination x -> CloudWatchDestination)
-> Generic CloudWatchDestination
forall x. Rep CloudWatchDestination x -> CloudWatchDestination
forall x. CloudWatchDestination -> Rep CloudWatchDestination x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CloudWatchDestination x -> CloudWatchDestination
$cfrom :: forall x. CloudWatchDestination -> Rep CloudWatchDestination x
Prelude.Generic)
newCloudWatchDestination ::
CloudWatchDestination
newCloudWatchDestination :: CloudWatchDestination
newCloudWatchDestination =
CloudWatchDestination' :: [CloudWatchDimensionConfiguration] -> CloudWatchDestination
CloudWatchDestination'
{ $sel:dimensionConfigurations:CloudWatchDestination' :: [CloudWatchDimensionConfiguration]
dimensionConfigurations =
[CloudWatchDimensionConfiguration]
forall a. Monoid a => a
Prelude.mempty
}
cloudWatchDestination_dimensionConfigurations :: Lens.Lens' CloudWatchDestination [CloudWatchDimensionConfiguration]
cloudWatchDestination_dimensionConfigurations :: ([CloudWatchDimensionConfiguration]
-> f [CloudWatchDimensionConfiguration])
-> CloudWatchDestination -> f CloudWatchDestination
cloudWatchDestination_dimensionConfigurations = (CloudWatchDestination -> [CloudWatchDimensionConfiguration])
-> (CloudWatchDestination
-> [CloudWatchDimensionConfiguration] -> CloudWatchDestination)
-> Lens
CloudWatchDestination
CloudWatchDestination
[CloudWatchDimensionConfiguration]
[CloudWatchDimensionConfiguration]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CloudWatchDestination' {[CloudWatchDimensionConfiguration]
dimensionConfigurations :: [CloudWatchDimensionConfiguration]
$sel:dimensionConfigurations:CloudWatchDestination' :: CloudWatchDestination -> [CloudWatchDimensionConfiguration]
dimensionConfigurations} -> [CloudWatchDimensionConfiguration]
dimensionConfigurations) (\s :: CloudWatchDestination
s@CloudWatchDestination' {} [CloudWatchDimensionConfiguration]
a -> CloudWatchDestination
s {$sel:dimensionConfigurations:CloudWatchDestination' :: [CloudWatchDimensionConfiguration]
dimensionConfigurations = [CloudWatchDimensionConfiguration]
a} :: CloudWatchDestination) (([CloudWatchDimensionConfiguration]
-> f [CloudWatchDimensionConfiguration])
-> CloudWatchDestination -> f CloudWatchDestination)
-> (([CloudWatchDimensionConfiguration]
-> f [CloudWatchDimensionConfiguration])
-> [CloudWatchDimensionConfiguration]
-> f [CloudWatchDimensionConfiguration])
-> ([CloudWatchDimensionConfiguration]
-> f [CloudWatchDimensionConfiguration])
-> CloudWatchDestination
-> f CloudWatchDestination
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([CloudWatchDimensionConfiguration]
-> f [CloudWatchDimensionConfiguration])
-> [CloudWatchDimensionConfiguration]
-> f [CloudWatchDimensionConfiguration]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
instance Core.FromXML CloudWatchDestination where
parseXML :: [Node] -> Either String CloudWatchDestination
parseXML [Node]
x =
[CloudWatchDimensionConfiguration] -> CloudWatchDestination
CloudWatchDestination'
([CloudWatchDimensionConfiguration] -> CloudWatchDestination)
-> Either String [CloudWatchDimensionConfiguration]
-> Either String CloudWatchDestination
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ( [Node]
x [Node] -> Text -> Either String (Maybe [Node])
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"DimensionConfigurations"
Either String (Maybe [Node]) -> [Node] -> Either String [Node]
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ [Node]
forall a. Monoid a => a
Prelude.mempty
Either String [Node]
-> ([Node] -> Either String [CloudWatchDimensionConfiguration])
-> Either String [CloudWatchDimensionConfiguration]
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
Prelude.>>= Text -> [Node] -> Either String [CloudWatchDimensionConfiguration]
forall a. FromXML a => Text -> [Node] -> Either String [a]
Core.parseXMLList Text
"member"
)
instance Prelude.Hashable CloudWatchDestination
instance Prelude.NFData CloudWatchDestination
instance Core.ToQuery CloudWatchDestination where
toQuery :: CloudWatchDestination -> QueryString
toQuery CloudWatchDestination' {[CloudWatchDimensionConfiguration]
dimensionConfigurations :: [CloudWatchDimensionConfiguration]
$sel:dimensionConfigurations:CloudWatchDestination' :: CloudWatchDestination -> [CloudWatchDimensionConfiguration]
..} =
[QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"DimensionConfigurations"
ByteString -> QueryString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: ByteString -> [CloudWatchDimensionConfiguration] -> QueryString
forall a.
(IsList a, ToQuery (Item a)) =>
ByteString -> a -> QueryString
Core.toQueryList ByteString
"member" [CloudWatchDimensionConfiguration]
dimensionConfigurations
]