{-# 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.CloudFront.Types.MonitoringSubscription where
import Amazonka.CloudFront.Types.RealtimeMetricsSubscriptionConfig
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data MonitoringSubscription = MonitoringSubscription'
{
MonitoringSubscription -> Maybe RealtimeMetricsSubscriptionConfig
realtimeMetricsSubscriptionConfig :: Prelude.Maybe RealtimeMetricsSubscriptionConfig
}
deriving (MonitoringSubscription -> MonitoringSubscription -> Bool
(MonitoringSubscription -> MonitoringSubscription -> Bool)
-> (MonitoringSubscription -> MonitoringSubscription -> Bool)
-> Eq MonitoringSubscription
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: MonitoringSubscription -> MonitoringSubscription -> Bool
$c/= :: MonitoringSubscription -> MonitoringSubscription -> Bool
== :: MonitoringSubscription -> MonitoringSubscription -> Bool
$c== :: MonitoringSubscription -> MonitoringSubscription -> Bool
Prelude.Eq, ReadPrec [MonitoringSubscription]
ReadPrec MonitoringSubscription
Int -> ReadS MonitoringSubscription
ReadS [MonitoringSubscription]
(Int -> ReadS MonitoringSubscription)
-> ReadS [MonitoringSubscription]
-> ReadPrec MonitoringSubscription
-> ReadPrec [MonitoringSubscription]
-> Read MonitoringSubscription
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [MonitoringSubscription]
$creadListPrec :: ReadPrec [MonitoringSubscription]
readPrec :: ReadPrec MonitoringSubscription
$creadPrec :: ReadPrec MonitoringSubscription
readList :: ReadS [MonitoringSubscription]
$creadList :: ReadS [MonitoringSubscription]
readsPrec :: Int -> ReadS MonitoringSubscription
$creadsPrec :: Int -> ReadS MonitoringSubscription
Prelude.Read, Int -> MonitoringSubscription -> ShowS
[MonitoringSubscription] -> ShowS
MonitoringSubscription -> String
(Int -> MonitoringSubscription -> ShowS)
-> (MonitoringSubscription -> String)
-> ([MonitoringSubscription] -> ShowS)
-> Show MonitoringSubscription
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [MonitoringSubscription] -> ShowS
$cshowList :: [MonitoringSubscription] -> ShowS
show :: MonitoringSubscription -> String
$cshow :: MonitoringSubscription -> String
showsPrec :: Int -> MonitoringSubscription -> ShowS
$cshowsPrec :: Int -> MonitoringSubscription -> ShowS
Prelude.Show, (forall x. MonitoringSubscription -> Rep MonitoringSubscription x)
-> (forall x.
Rep MonitoringSubscription x -> MonitoringSubscription)
-> Generic MonitoringSubscription
forall x. Rep MonitoringSubscription x -> MonitoringSubscription
forall x. MonitoringSubscription -> Rep MonitoringSubscription x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep MonitoringSubscription x -> MonitoringSubscription
$cfrom :: forall x. MonitoringSubscription -> Rep MonitoringSubscription x
Prelude.Generic)
newMonitoringSubscription ::
MonitoringSubscription
newMonitoringSubscription :: MonitoringSubscription
newMonitoringSubscription =
MonitoringSubscription' :: Maybe RealtimeMetricsSubscriptionConfig -> MonitoringSubscription
MonitoringSubscription'
{ $sel:realtimeMetricsSubscriptionConfig:MonitoringSubscription' :: Maybe RealtimeMetricsSubscriptionConfig
realtimeMetricsSubscriptionConfig =
Maybe RealtimeMetricsSubscriptionConfig
forall a. Maybe a
Prelude.Nothing
}
monitoringSubscription_realtimeMetricsSubscriptionConfig :: Lens.Lens' MonitoringSubscription (Prelude.Maybe RealtimeMetricsSubscriptionConfig)
monitoringSubscription_realtimeMetricsSubscriptionConfig :: (Maybe RealtimeMetricsSubscriptionConfig
-> f (Maybe RealtimeMetricsSubscriptionConfig))
-> MonitoringSubscription -> f MonitoringSubscription
monitoringSubscription_realtimeMetricsSubscriptionConfig = (MonitoringSubscription -> Maybe RealtimeMetricsSubscriptionConfig)
-> (MonitoringSubscription
-> Maybe RealtimeMetricsSubscriptionConfig
-> MonitoringSubscription)
-> Lens
MonitoringSubscription
MonitoringSubscription
(Maybe RealtimeMetricsSubscriptionConfig)
(Maybe RealtimeMetricsSubscriptionConfig)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MonitoringSubscription' {Maybe RealtimeMetricsSubscriptionConfig
realtimeMetricsSubscriptionConfig :: Maybe RealtimeMetricsSubscriptionConfig
$sel:realtimeMetricsSubscriptionConfig:MonitoringSubscription' :: MonitoringSubscription -> Maybe RealtimeMetricsSubscriptionConfig
realtimeMetricsSubscriptionConfig} -> Maybe RealtimeMetricsSubscriptionConfig
realtimeMetricsSubscriptionConfig) (\s :: MonitoringSubscription
s@MonitoringSubscription' {} Maybe RealtimeMetricsSubscriptionConfig
a -> MonitoringSubscription
s {$sel:realtimeMetricsSubscriptionConfig:MonitoringSubscription' :: Maybe RealtimeMetricsSubscriptionConfig
realtimeMetricsSubscriptionConfig = Maybe RealtimeMetricsSubscriptionConfig
a} :: MonitoringSubscription)
instance Core.FromXML MonitoringSubscription where
parseXML :: [Node] -> Either String MonitoringSubscription
parseXML [Node]
x =
Maybe RealtimeMetricsSubscriptionConfig -> MonitoringSubscription
MonitoringSubscription'
(Maybe RealtimeMetricsSubscriptionConfig -> MonitoringSubscription)
-> Either String (Maybe RealtimeMetricsSubscriptionConfig)
-> Either String MonitoringSubscription
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x [Node]
-> Text -> Either String (Maybe RealtimeMetricsSubscriptionConfig)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"RealtimeMetricsSubscriptionConfig")
instance Prelude.Hashable MonitoringSubscription
instance Prelude.NFData MonitoringSubscription
instance Core.ToXML MonitoringSubscription where
toXML :: MonitoringSubscription -> XML
toXML MonitoringSubscription' {Maybe RealtimeMetricsSubscriptionConfig
realtimeMetricsSubscriptionConfig :: Maybe RealtimeMetricsSubscriptionConfig
$sel:realtimeMetricsSubscriptionConfig:MonitoringSubscription' :: MonitoringSubscription -> Maybe RealtimeMetricsSubscriptionConfig
..} =
[XML] -> XML
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ Name
"RealtimeMetricsSubscriptionConfig"
Name -> Maybe RealtimeMetricsSubscriptionConfig -> XML
forall a. ToXML a => Name -> a -> XML
Core.@= Maybe RealtimeMetricsSubscriptionConfig
realtimeMetricsSubscriptionConfig
]