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