{-# 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.ELB.Types.HealthCheck where
import qualified Amazonka.Core as Core
import Amazonka.ELB.Internal
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data HealthCheck = HealthCheck'
{
HealthCheck -> Text
target :: Prelude.Text,
HealthCheck -> Natural
interval :: Prelude.Natural,
HealthCheck -> Natural
timeout :: Prelude.Natural,
HealthCheck -> Natural
unhealthyThreshold :: Prelude.Natural,
HealthCheck -> Natural
healthyThreshold :: 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.Natural ->
Prelude.Natural ->
Prelude.Natural ->
Prelude.Natural ->
HealthCheck
newHealthCheck :: Text -> Natural -> Natural -> Natural -> Natural -> HealthCheck
newHealthCheck
Text
pTarget_
Natural
pInterval_
Natural
pTimeout_
Natural
pUnhealthyThreshold_
Natural
pHealthyThreshold_ =
HealthCheck' :: Text -> Natural -> Natural -> Natural -> Natural -> HealthCheck
HealthCheck'
{ $sel:target:HealthCheck' :: Text
target = Text
pTarget_,
$sel:interval:HealthCheck' :: Natural
interval = Natural
pInterval_,
$sel:timeout:HealthCheck' :: Natural
timeout = Natural
pTimeout_,
$sel:unhealthyThreshold:HealthCheck' :: Natural
unhealthyThreshold = Natural
pUnhealthyThreshold_,
$sel:healthyThreshold:HealthCheck' :: Natural
healthyThreshold = Natural
pHealthyThreshold_
}
healthCheck_target :: Lens.Lens' HealthCheck Prelude.Text
healthCheck_target :: (Text -> f Text) -> HealthCheck -> f HealthCheck
healthCheck_target = (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
target :: Text
$sel:target:HealthCheck' :: HealthCheck -> Text
target} -> Text
target) (\s :: HealthCheck
s@HealthCheck' {} Text
a -> HealthCheck
s {$sel:target:HealthCheck' :: Text
target = Text
a} :: HealthCheck)
healthCheck_interval :: Lens.Lens' HealthCheck Prelude.Natural
healthCheck_interval :: (Natural -> f Natural) -> HealthCheck -> f HealthCheck
healthCheck_interval = (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
interval :: Natural
$sel:interval:HealthCheck' :: HealthCheck -> Natural
interval} -> Natural
interval) (\s :: HealthCheck
s@HealthCheck' {} Natural
a -> HealthCheck
s {$sel:interval:HealthCheck' :: Natural
interval = Natural
a} :: HealthCheck)
healthCheck_timeout :: Lens.Lens' HealthCheck Prelude.Natural
healthCheck_timeout :: (Natural -> f Natural) -> HealthCheck -> f HealthCheck
healthCheck_timeout = (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
timeout :: Natural
$sel:timeout:HealthCheck' :: HealthCheck -> Natural
timeout} -> Natural
timeout) (\s :: HealthCheck
s@HealthCheck' {} Natural
a -> HealthCheck
s {$sel:timeout:HealthCheck' :: Natural
timeout = Natural
a} :: HealthCheck)
healthCheck_unhealthyThreshold :: Lens.Lens' HealthCheck Prelude.Natural
healthCheck_unhealthyThreshold :: (Natural -> f Natural) -> HealthCheck -> f HealthCheck
healthCheck_unhealthyThreshold = (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
unhealthyThreshold :: Natural
$sel:unhealthyThreshold:HealthCheck' :: HealthCheck -> Natural
unhealthyThreshold} -> Natural
unhealthyThreshold) (\s :: HealthCheck
s@HealthCheck' {} Natural
a -> HealthCheck
s {$sel:unhealthyThreshold:HealthCheck' :: Natural
unhealthyThreshold = Natural
a} :: HealthCheck)
healthCheck_healthyThreshold :: Lens.Lens' HealthCheck Prelude.Natural
healthCheck_healthyThreshold :: (Natural -> f Natural) -> HealthCheck -> f HealthCheck
healthCheck_healthyThreshold = (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
healthyThreshold :: Natural
$sel:healthyThreshold:HealthCheck' :: HealthCheck -> Natural
healthyThreshold} -> Natural
healthyThreshold) (\s :: HealthCheck
s@HealthCheck' {} Natural
a -> HealthCheck
s {$sel:healthyThreshold:HealthCheck' :: Natural
healthyThreshold = Natural
a} :: HealthCheck)
instance Core.FromXML HealthCheck where
parseXML :: [Node] -> Either String HealthCheck
parseXML [Node]
x =
Text -> Natural -> Natural -> Natural -> Natural -> HealthCheck
HealthCheck'
(Text -> Natural -> Natural -> Natural -> Natural -> HealthCheck)
-> Either String Text
-> Either
String (Natural -> Natural -> Natural -> Natural -> HealthCheck)
forall (f :: * -> *) a b. Functor 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
"Target")
Either
String (Natural -> Natural -> Natural -> Natural -> HealthCheck)
-> Either String Natural
-> Either String (Natural -> Natural -> Natural -> 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
"Interval")
Either String (Natural -> Natural -> Natural -> HealthCheck)
-> Either String Natural
-> Either String (Natural -> Natural -> 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
"Timeout")
Either String (Natural -> Natural -> HealthCheck)
-> Either String Natural -> Either String (Natural -> 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
"UnhealthyThreshold")
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
"HealthyThreshold")
instance Prelude.Hashable HealthCheck
instance Prelude.NFData HealthCheck
instance Core.ToQuery HealthCheck where
toQuery :: HealthCheck -> QueryString
toQuery HealthCheck' {Natural
Text
healthyThreshold :: Natural
unhealthyThreshold :: Natural
timeout :: Natural
interval :: Natural
target :: Text
$sel:healthyThreshold:HealthCheck' :: HealthCheck -> Natural
$sel:unhealthyThreshold:HealthCheck' :: HealthCheck -> Natural
$sel:timeout:HealthCheck' :: HealthCheck -> Natural
$sel:interval:HealthCheck' :: HealthCheck -> Natural
$sel:target:HealthCheck' :: HealthCheck -> Text
..} =
[QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"Target" ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Text
target,
ByteString
"Interval" ByteString -> Natural -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Natural
interval,
ByteString
"Timeout" ByteString -> Natural -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Natural
timeout,
ByteString
"UnhealthyThreshold" ByteString -> Natural -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Natural
unhealthyThreshold,
ByteString
"HealthyThreshold" ByteString -> Natural -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Natural
healthyThreshold
]