{-# 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.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
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 CloudWatchAlarmConfiguration
cloudWatchAlarmConfiguration :: Prelude.Maybe CloudWatchAlarmConfiguration,
HealthCheck -> Maybe LinkedService
linkedService :: Prelude.Maybe LinkedService,
HealthCheck -> Text
id :: Prelude.Text,
HealthCheck -> Text
callerReference :: Prelude.Text,
HealthCheck -> HealthCheckConfig
healthCheckConfig :: HealthCheckConfig,
HealthCheck -> Natural
healthCheckVersion :: Prelude.Natural
}
deriving (HealthCheck -> HealthCheck -> Bool
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]
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
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. 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'
{ $sel:cloudWatchAlarmConfiguration:HealthCheck' :: Maybe CloudWatchAlarmConfiguration
cloudWatchAlarmConfiguration =
forall a. Maybe a
Prelude.Nothing,
$sel:linkedService:HealthCheck' :: Maybe LinkedService
linkedService = 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_cloudWatchAlarmConfiguration :: Lens.Lens' HealthCheck (Prelude.Maybe CloudWatchAlarmConfiguration)
healthCheck_cloudWatchAlarmConfiguration :: Lens' HealthCheck (Maybe CloudWatchAlarmConfiguration)
healthCheck_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_linkedService :: Lens.Lens' HealthCheck (Prelude.Maybe LinkedService)
healthCheck_linkedService :: Lens' HealthCheck (Maybe LinkedService)
healthCheck_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_id :: Lens.Lens' HealthCheck Prelude.Text
healthCheck_id :: Lens' HealthCheck Text
healthCheck_id = 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 :: Lens' HealthCheck Text
healthCheck_callerReference = 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 :: Lens' HealthCheck HealthCheckConfig
healthCheck_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 :: Lens' HealthCheck Natural
healthCheck_healthCheckVersion = 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 Data.FromXML HealthCheck where
parseXML :: [Node] -> Either String HealthCheck
parseXML [Node]
x =
Maybe CloudWatchAlarmConfiguration
-> Maybe LinkedService
-> Text
-> Text
-> HealthCheckConfig
-> Natural
-> HealthCheck
HealthCheck'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"CloudWatchAlarmConfiguration")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"LinkedService")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String a
Data..@ Text
"Id")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String a
Data..@ Text
"CallerReference")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String a
Data..@ Text
"HealthCheckConfig")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String a
Data..@ Text
"HealthCheckVersion")
instance Prelude.Hashable HealthCheck where
hashWithSalt :: Int -> HealthCheck -> Int
hashWithSalt Int
_salt HealthCheck' {Natural
Maybe LinkedService
Maybe CloudWatchAlarmConfiguration
Text
HealthCheckConfig
healthCheckVersion :: Natural
healthCheckConfig :: HealthCheckConfig
callerReference :: Text
id :: Text
linkedService :: Maybe LinkedService
cloudWatchAlarmConfiguration :: Maybe CloudWatchAlarmConfiguration
$sel:healthCheckVersion:HealthCheck' :: HealthCheck -> Natural
$sel:healthCheckConfig:HealthCheck' :: HealthCheck -> HealthCheckConfig
$sel:callerReference:HealthCheck' :: HealthCheck -> Text
$sel:id:HealthCheck' :: HealthCheck -> Text
$sel:linkedService:HealthCheck' :: HealthCheck -> Maybe LinkedService
$sel:cloudWatchAlarmConfiguration:HealthCheck' :: HealthCheck -> Maybe CloudWatchAlarmConfiguration
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe CloudWatchAlarmConfiguration
cloudWatchAlarmConfiguration
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe LinkedService
linkedService
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
id
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
callerReference
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` HealthCheckConfig
healthCheckConfig
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Natural
healthCheckVersion
instance Prelude.NFData HealthCheck where
rnf :: HealthCheck -> ()
rnf HealthCheck' {Natural
Maybe LinkedService
Maybe CloudWatchAlarmConfiguration
Text
HealthCheckConfig
healthCheckVersion :: Natural
healthCheckConfig :: HealthCheckConfig
callerReference :: Text
id :: Text
linkedService :: Maybe LinkedService
cloudWatchAlarmConfiguration :: Maybe CloudWatchAlarmConfiguration
$sel:healthCheckVersion:HealthCheck' :: HealthCheck -> Natural
$sel:healthCheckConfig:HealthCheck' :: HealthCheck -> HealthCheckConfig
$sel:callerReference:HealthCheck' :: HealthCheck -> Text
$sel:id:HealthCheck' :: HealthCheck -> Text
$sel:linkedService:HealthCheck' :: HealthCheck -> Maybe LinkedService
$sel:cloudWatchAlarmConfiguration:HealthCheck' :: HealthCheck -> Maybe CloudWatchAlarmConfiguration
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe CloudWatchAlarmConfiguration
cloudWatchAlarmConfiguration
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe LinkedService
linkedService
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
id
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
callerReference
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf HealthCheckConfig
healthCheckConfig
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Natural
healthCheckVersion