{-# 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.HealthCheck 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.CloudWatchAlarmConfiguration
import Amazonka.Route53.Types.HealthCheckConfig
import Amazonka.Route53.Types.LinkedService
data HealthCheck = HealthCheck'
{
HealthCheck -> Maybe LinkedService
linkedService :: Prelude.Maybe LinkedService,
HealthCheck -> Maybe CloudWatchAlarmConfiguration
cloudWatchAlarmConfiguration :: Prelude.Maybe CloudWatchAlarmConfiguration,
HealthCheck -> Text
id :: Prelude.Text,
HealthCheck -> Text
callerReference :: Prelude.Text,
HealthCheck -> HealthCheckConfig
healthCheckConfig :: HealthCheckConfig,
HealthCheck -> Natural
healthCheckVersion :: Prelude.Natural
}
deriving (HealthCheck -> HealthCheck -> Bool
(HealthCheck -> HealthCheck -> Bool)
-> (HealthCheck -> HealthCheck -> Bool) -> Eq HealthCheck
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: HealthCheck -> HealthCheck -> Bool
$c/= :: HealthCheck -> HealthCheck -> Bool
== :: HealthCheck -> HealthCheck -> Bool
$c== :: HealthCheck -> HealthCheck -> Bool
Prelude.Eq, ReadPrec [HealthCheck]
ReadPrec HealthCheck
Int -> ReadS HealthCheck
ReadS [HealthCheck]
(Int -> ReadS HealthCheck)
-> ReadS [HealthCheck]
-> ReadPrec HealthCheck
-> ReadPrec [HealthCheck]
-> Read HealthCheck
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [HealthCheck]
$creadListPrec :: ReadPrec [HealthCheck]
readPrec :: ReadPrec HealthCheck
$creadPrec :: ReadPrec HealthCheck
readList :: ReadS [HealthCheck]
$creadList :: ReadS [HealthCheck]
readsPrec :: Int -> ReadS HealthCheck
$creadsPrec :: Int -> ReadS HealthCheck
Prelude.Read, Int -> HealthCheck -> ShowS
[HealthCheck] -> ShowS
HealthCheck -> String
(Int -> HealthCheck -> ShowS)
-> (HealthCheck -> String)
-> ([HealthCheck] -> ShowS)
-> Show HealthCheck
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [HealthCheck] -> ShowS
$cshowList :: [HealthCheck] -> ShowS
show :: HealthCheck -> String
$cshow :: HealthCheck -> String
showsPrec :: Int -> HealthCheck -> ShowS
$cshowsPrec :: Int -> HealthCheck -> ShowS
Prelude.Show, (forall x. HealthCheck -> Rep HealthCheck x)
-> (forall x. Rep HealthCheck x -> HealthCheck)
-> Generic HealthCheck
forall x. Rep HealthCheck x -> HealthCheck
forall x. HealthCheck -> Rep HealthCheck x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep HealthCheck x -> HealthCheck
$cfrom :: forall x. HealthCheck -> Rep HealthCheck x
Prelude.Generic)
newHealthCheck ::
Prelude.Text ->
Prelude.Text ->
HealthCheckConfig ->
Prelude.Natural ->
HealthCheck
newHealthCheck :: Text -> Text -> HealthCheckConfig -> Natural -> HealthCheck
newHealthCheck
Text
pId_
Text
pCallerReference_
HealthCheckConfig
pHealthCheckConfig_
Natural
pHealthCheckVersion_ =
HealthCheck' :: Maybe LinkedService
-> Maybe CloudWatchAlarmConfiguration
-> Text
-> Text
-> HealthCheckConfig
-> Natural
-> HealthCheck
HealthCheck'
{ $sel:linkedService:HealthCheck' :: Maybe LinkedService
linkedService = Maybe LinkedService
forall a. Maybe a
Prelude.Nothing,
$sel:cloudWatchAlarmConfiguration:HealthCheck' :: Maybe CloudWatchAlarmConfiguration
cloudWatchAlarmConfiguration = Maybe CloudWatchAlarmConfiguration
forall a. Maybe a
Prelude.Nothing,
$sel:id:HealthCheck' :: Text
id = Text
pId_,
$sel:callerReference:HealthCheck' :: Text
callerReference = Text
pCallerReference_,
$sel:healthCheckConfig:HealthCheck' :: HealthCheckConfig
healthCheckConfig = HealthCheckConfig
pHealthCheckConfig_,
$sel:healthCheckVersion:HealthCheck' :: Natural
healthCheckVersion = Natural
pHealthCheckVersion_
}
healthCheck_linkedService :: Lens.Lens' HealthCheck (Prelude.Maybe LinkedService)
healthCheck_linkedService :: (Maybe LinkedService -> f (Maybe LinkedService))
-> HealthCheck -> f HealthCheck
healthCheck_linkedService = (HealthCheck -> Maybe LinkedService)
-> (HealthCheck -> Maybe LinkedService -> HealthCheck)
-> Lens
HealthCheck HealthCheck (Maybe LinkedService) (Maybe LinkedService)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\HealthCheck' {Maybe LinkedService
linkedService :: Maybe LinkedService
$sel:linkedService:HealthCheck' :: HealthCheck -> Maybe LinkedService
linkedService} -> Maybe LinkedService
linkedService) (\s :: HealthCheck
s@HealthCheck' {} Maybe LinkedService
a -> HealthCheck
s {$sel:linkedService:HealthCheck' :: Maybe LinkedService
linkedService = Maybe LinkedService
a} :: HealthCheck)
healthCheck_cloudWatchAlarmConfiguration :: Lens.Lens' HealthCheck (Prelude.Maybe CloudWatchAlarmConfiguration)
healthCheck_cloudWatchAlarmConfiguration :: (Maybe CloudWatchAlarmConfiguration
-> f (Maybe CloudWatchAlarmConfiguration))
-> HealthCheck -> f HealthCheck
healthCheck_cloudWatchAlarmConfiguration = (HealthCheck -> Maybe CloudWatchAlarmConfiguration)
-> (HealthCheck
-> Maybe CloudWatchAlarmConfiguration -> HealthCheck)
-> Lens
HealthCheck
HealthCheck
(Maybe CloudWatchAlarmConfiguration)
(Maybe CloudWatchAlarmConfiguration)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\HealthCheck' {Maybe CloudWatchAlarmConfiguration
cloudWatchAlarmConfiguration :: Maybe CloudWatchAlarmConfiguration
$sel:cloudWatchAlarmConfiguration:HealthCheck' :: HealthCheck -> Maybe CloudWatchAlarmConfiguration
cloudWatchAlarmConfiguration} -> Maybe CloudWatchAlarmConfiguration
cloudWatchAlarmConfiguration) (\s :: HealthCheck
s@HealthCheck' {} Maybe CloudWatchAlarmConfiguration
a -> HealthCheck
s {$sel:cloudWatchAlarmConfiguration:HealthCheck' :: Maybe CloudWatchAlarmConfiguration
cloudWatchAlarmConfiguration = Maybe CloudWatchAlarmConfiguration
a} :: HealthCheck)
healthCheck_id :: Lens.Lens' HealthCheck Prelude.Text
healthCheck_id :: (Text -> f Text) -> HealthCheck -> f HealthCheck
healthCheck_id = (HealthCheck -> Text)
-> (HealthCheck -> Text -> HealthCheck)
-> Lens HealthCheck HealthCheck Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\HealthCheck' {Text
id :: Text
$sel:id:HealthCheck' :: HealthCheck -> Text
id} -> Text
id) (\s :: HealthCheck
s@HealthCheck' {} Text
a -> HealthCheck
s {$sel:id:HealthCheck' :: Text
id = Text
a} :: HealthCheck)
healthCheck_callerReference :: Lens.Lens' HealthCheck Prelude.Text
healthCheck_callerReference :: (Text -> f Text) -> HealthCheck -> f HealthCheck
healthCheck_callerReference = (HealthCheck -> Text)
-> (HealthCheck -> Text -> HealthCheck)
-> Lens HealthCheck HealthCheck Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\HealthCheck' {Text
callerReference :: Text
$sel:callerReference:HealthCheck' :: HealthCheck -> Text
callerReference} -> Text
callerReference) (\s :: HealthCheck
s@HealthCheck' {} Text
a -> HealthCheck
s {$sel:callerReference:HealthCheck' :: Text
callerReference = Text
a} :: HealthCheck)
healthCheck_healthCheckConfig :: Lens.Lens' HealthCheck HealthCheckConfig
healthCheck_healthCheckConfig :: (HealthCheckConfig -> f HealthCheckConfig)
-> HealthCheck -> f HealthCheck
healthCheck_healthCheckConfig = (HealthCheck -> HealthCheckConfig)
-> (HealthCheck -> HealthCheckConfig -> HealthCheck)
-> Lens HealthCheck HealthCheck HealthCheckConfig HealthCheckConfig
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\HealthCheck' {HealthCheckConfig
healthCheckConfig :: HealthCheckConfig
$sel:healthCheckConfig:HealthCheck' :: HealthCheck -> HealthCheckConfig
healthCheckConfig} -> HealthCheckConfig
healthCheckConfig) (\s :: HealthCheck
s@HealthCheck' {} HealthCheckConfig
a -> HealthCheck
s {$sel:healthCheckConfig:HealthCheck' :: HealthCheckConfig
healthCheckConfig = HealthCheckConfig
a} :: HealthCheck)
healthCheck_healthCheckVersion :: Lens.Lens' HealthCheck Prelude.Natural
healthCheck_healthCheckVersion :: (Natural -> f Natural) -> HealthCheck -> f HealthCheck
healthCheck_healthCheckVersion = (HealthCheck -> Natural)
-> (HealthCheck -> Natural -> HealthCheck)
-> Lens HealthCheck HealthCheck Natural Natural
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\HealthCheck' {Natural
healthCheckVersion :: Natural
$sel:healthCheckVersion:HealthCheck' :: HealthCheck -> Natural
healthCheckVersion} -> Natural
healthCheckVersion) (\s :: HealthCheck
s@HealthCheck' {} Natural
a -> HealthCheck
s {$sel:healthCheckVersion:HealthCheck' :: Natural
healthCheckVersion = Natural
a} :: HealthCheck)
instance Core.FromXML HealthCheck where
parseXML :: [Node] -> Either String HealthCheck
parseXML [Node]
x =
Maybe LinkedService
-> Maybe CloudWatchAlarmConfiguration
-> Text
-> Text
-> HealthCheckConfig
-> Natural
-> HealthCheck
HealthCheck'
(Maybe LinkedService
-> Maybe CloudWatchAlarmConfiguration
-> Text
-> Text
-> HealthCheckConfig
-> Natural
-> HealthCheck)
-> Either String (Maybe LinkedService)
-> Either
String
(Maybe CloudWatchAlarmConfiguration
-> Text -> Text -> HealthCheckConfig -> Natural -> HealthCheck)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x [Node] -> Text -> Either String (Maybe LinkedService)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"LinkedService")
Either
String
(Maybe CloudWatchAlarmConfiguration
-> Text -> Text -> HealthCheckConfig -> Natural -> HealthCheck)
-> Either String (Maybe CloudWatchAlarmConfiguration)
-> Either
String
(Text -> Text -> HealthCheckConfig -> Natural -> HealthCheck)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node]
-> Text -> Either String (Maybe CloudWatchAlarmConfiguration)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"CloudWatchAlarmConfiguration")
Either
String
(Text -> Text -> HealthCheckConfig -> Natural -> HealthCheck)
-> Either String Text
-> Either
String (Text -> HealthCheckConfig -> Natural -> HealthCheck)
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
"Id")
Either String (Text -> HealthCheckConfig -> Natural -> HealthCheck)
-> Either String Text
-> Either String (HealthCheckConfig -> Natural -> HealthCheck)
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
"CallerReference")
Either String (HealthCheckConfig -> Natural -> HealthCheck)
-> Either String HealthCheckConfig
-> Either String (Natural -> HealthCheck)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String HealthCheckConfig
forall a. FromXML a => [Node] -> Text -> Either String a
Core..@ Text
"HealthCheckConfig")
Either String (Natural -> HealthCheck)
-> Either String Natural -> Either String HealthCheck
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String Natural
forall a. FromXML a => [Node] -> Text -> Either String a
Core..@ Text
"HealthCheckVersion")
instance Prelude.Hashable HealthCheck
instance Prelude.NFData HealthCheck