{-# 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.AppRunner.Types.HealthCheckConfiguration where
import Amazonka.AppRunner.Types.HealthCheckProtocol
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data HealthCheckConfiguration = HealthCheckConfiguration'
{
HealthCheckConfiguration -> Maybe Natural
healthyThreshold :: Prelude.Maybe Prelude.Natural,
HealthCheckConfiguration -> Maybe Text
path :: Prelude.Maybe Prelude.Text,
HealthCheckConfiguration -> Maybe HealthCheckProtocol
protocol :: Prelude.Maybe HealthCheckProtocol,
HealthCheckConfiguration -> Maybe Natural
interval :: Prelude.Maybe Prelude.Natural,
HealthCheckConfiguration -> Maybe Natural
timeout :: Prelude.Maybe Prelude.Natural,
HealthCheckConfiguration -> Maybe Natural
unhealthyThreshold :: Prelude.Maybe Prelude.Natural
}
deriving (HealthCheckConfiguration -> HealthCheckConfiguration -> Bool
(HealthCheckConfiguration -> HealthCheckConfiguration -> Bool)
-> (HealthCheckConfiguration -> HealthCheckConfiguration -> Bool)
-> Eq HealthCheckConfiguration
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: HealthCheckConfiguration -> HealthCheckConfiguration -> Bool
$c/= :: HealthCheckConfiguration -> HealthCheckConfiguration -> Bool
== :: HealthCheckConfiguration -> HealthCheckConfiguration -> Bool
$c== :: HealthCheckConfiguration -> HealthCheckConfiguration -> Bool
Prelude.Eq, ReadPrec [HealthCheckConfiguration]
ReadPrec HealthCheckConfiguration
Int -> ReadS HealthCheckConfiguration
ReadS [HealthCheckConfiguration]
(Int -> ReadS HealthCheckConfiguration)
-> ReadS [HealthCheckConfiguration]
-> ReadPrec HealthCheckConfiguration
-> ReadPrec [HealthCheckConfiguration]
-> Read HealthCheckConfiguration
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [HealthCheckConfiguration]
$creadListPrec :: ReadPrec [HealthCheckConfiguration]
readPrec :: ReadPrec HealthCheckConfiguration
$creadPrec :: ReadPrec HealthCheckConfiguration
readList :: ReadS [HealthCheckConfiguration]
$creadList :: ReadS [HealthCheckConfiguration]
readsPrec :: Int -> ReadS HealthCheckConfiguration
$creadsPrec :: Int -> ReadS HealthCheckConfiguration
Prelude.Read, Int -> HealthCheckConfiguration -> ShowS
[HealthCheckConfiguration] -> ShowS
HealthCheckConfiguration -> String
(Int -> HealthCheckConfiguration -> ShowS)
-> (HealthCheckConfiguration -> String)
-> ([HealthCheckConfiguration] -> ShowS)
-> Show HealthCheckConfiguration
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [HealthCheckConfiguration] -> ShowS
$cshowList :: [HealthCheckConfiguration] -> ShowS
show :: HealthCheckConfiguration -> String
$cshow :: HealthCheckConfiguration -> String
showsPrec :: Int -> HealthCheckConfiguration -> ShowS
$cshowsPrec :: Int -> HealthCheckConfiguration -> ShowS
Prelude.Show, (forall x.
HealthCheckConfiguration -> Rep HealthCheckConfiguration x)
-> (forall x.
Rep HealthCheckConfiguration x -> HealthCheckConfiguration)
-> Generic HealthCheckConfiguration
forall x.
Rep HealthCheckConfiguration x -> HealthCheckConfiguration
forall x.
HealthCheckConfiguration -> Rep HealthCheckConfiguration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep HealthCheckConfiguration x -> HealthCheckConfiguration
$cfrom :: forall x.
HealthCheckConfiguration -> Rep HealthCheckConfiguration x
Prelude.Generic)
newHealthCheckConfiguration ::
HealthCheckConfiguration
newHealthCheckConfiguration :: HealthCheckConfiguration
newHealthCheckConfiguration =
HealthCheckConfiguration' :: Maybe Natural
-> Maybe Text
-> Maybe HealthCheckProtocol
-> Maybe Natural
-> Maybe Natural
-> Maybe Natural
-> HealthCheckConfiguration
HealthCheckConfiguration'
{ $sel:healthyThreshold:HealthCheckConfiguration' :: Maybe Natural
healthyThreshold =
Maybe Natural
forall a. Maybe a
Prelude.Nothing,
$sel:path:HealthCheckConfiguration' :: Maybe Text
path = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:protocol:HealthCheckConfiguration' :: Maybe HealthCheckProtocol
protocol = Maybe HealthCheckProtocol
forall a. Maybe a
Prelude.Nothing,
$sel:interval:HealthCheckConfiguration' :: Maybe Natural
interval = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
$sel:timeout:HealthCheckConfiguration' :: Maybe Natural
timeout = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
$sel:unhealthyThreshold:HealthCheckConfiguration' :: Maybe Natural
unhealthyThreshold = Maybe Natural
forall a. Maybe a
Prelude.Nothing
}
healthCheckConfiguration_healthyThreshold :: Lens.Lens' HealthCheckConfiguration (Prelude.Maybe Prelude.Natural)
healthCheckConfiguration_healthyThreshold :: (Maybe Natural -> f (Maybe Natural))
-> HealthCheckConfiguration -> f HealthCheckConfiguration
healthCheckConfiguration_healthyThreshold = (HealthCheckConfiguration -> Maybe Natural)
-> (HealthCheckConfiguration
-> Maybe Natural -> HealthCheckConfiguration)
-> Lens
HealthCheckConfiguration
HealthCheckConfiguration
(Maybe Natural)
(Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\HealthCheckConfiguration' {Maybe Natural
healthyThreshold :: Maybe Natural
$sel:healthyThreshold:HealthCheckConfiguration' :: HealthCheckConfiguration -> Maybe Natural
healthyThreshold} -> Maybe Natural
healthyThreshold) (\s :: HealthCheckConfiguration
s@HealthCheckConfiguration' {} Maybe Natural
a -> HealthCheckConfiguration
s {$sel:healthyThreshold:HealthCheckConfiguration' :: Maybe Natural
healthyThreshold = Maybe Natural
a} :: HealthCheckConfiguration)
healthCheckConfiguration_path :: Lens.Lens' HealthCheckConfiguration (Prelude.Maybe Prelude.Text)
healthCheckConfiguration_path :: (Maybe Text -> f (Maybe Text))
-> HealthCheckConfiguration -> f HealthCheckConfiguration
healthCheckConfiguration_path = (HealthCheckConfiguration -> Maybe Text)
-> (HealthCheckConfiguration
-> Maybe Text -> HealthCheckConfiguration)
-> Lens
HealthCheckConfiguration
HealthCheckConfiguration
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\HealthCheckConfiguration' {Maybe Text
path :: Maybe Text
$sel:path:HealthCheckConfiguration' :: HealthCheckConfiguration -> Maybe Text
path} -> Maybe Text
path) (\s :: HealthCheckConfiguration
s@HealthCheckConfiguration' {} Maybe Text
a -> HealthCheckConfiguration
s {$sel:path:HealthCheckConfiguration' :: Maybe Text
path = Maybe Text
a} :: HealthCheckConfiguration)
healthCheckConfiguration_protocol :: Lens.Lens' HealthCheckConfiguration (Prelude.Maybe HealthCheckProtocol)
healthCheckConfiguration_protocol :: (Maybe HealthCheckProtocol -> f (Maybe HealthCheckProtocol))
-> HealthCheckConfiguration -> f HealthCheckConfiguration
healthCheckConfiguration_protocol = (HealthCheckConfiguration -> Maybe HealthCheckProtocol)
-> (HealthCheckConfiguration
-> Maybe HealthCheckProtocol -> HealthCheckConfiguration)
-> Lens
HealthCheckConfiguration
HealthCheckConfiguration
(Maybe HealthCheckProtocol)
(Maybe HealthCheckProtocol)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\HealthCheckConfiguration' {Maybe HealthCheckProtocol
protocol :: Maybe HealthCheckProtocol
$sel:protocol:HealthCheckConfiguration' :: HealthCheckConfiguration -> Maybe HealthCheckProtocol
protocol} -> Maybe HealthCheckProtocol
protocol) (\s :: HealthCheckConfiguration
s@HealthCheckConfiguration' {} Maybe HealthCheckProtocol
a -> HealthCheckConfiguration
s {$sel:protocol:HealthCheckConfiguration' :: Maybe HealthCheckProtocol
protocol = Maybe HealthCheckProtocol
a} :: HealthCheckConfiguration)
healthCheckConfiguration_interval :: Lens.Lens' HealthCheckConfiguration (Prelude.Maybe Prelude.Natural)
healthCheckConfiguration_interval :: (Maybe Natural -> f (Maybe Natural))
-> HealthCheckConfiguration -> f HealthCheckConfiguration
healthCheckConfiguration_interval = (HealthCheckConfiguration -> Maybe Natural)
-> (HealthCheckConfiguration
-> Maybe Natural -> HealthCheckConfiguration)
-> Lens
HealthCheckConfiguration
HealthCheckConfiguration
(Maybe Natural)
(Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\HealthCheckConfiguration' {Maybe Natural
interval :: Maybe Natural
$sel:interval:HealthCheckConfiguration' :: HealthCheckConfiguration -> Maybe Natural
interval} -> Maybe Natural
interval) (\s :: HealthCheckConfiguration
s@HealthCheckConfiguration' {} Maybe Natural
a -> HealthCheckConfiguration
s {$sel:interval:HealthCheckConfiguration' :: Maybe Natural
interval = Maybe Natural
a} :: HealthCheckConfiguration)
healthCheckConfiguration_timeout :: Lens.Lens' HealthCheckConfiguration (Prelude.Maybe Prelude.Natural)
healthCheckConfiguration_timeout :: (Maybe Natural -> f (Maybe Natural))
-> HealthCheckConfiguration -> f HealthCheckConfiguration
healthCheckConfiguration_timeout = (HealthCheckConfiguration -> Maybe Natural)
-> (HealthCheckConfiguration
-> Maybe Natural -> HealthCheckConfiguration)
-> Lens
HealthCheckConfiguration
HealthCheckConfiguration
(Maybe Natural)
(Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\HealthCheckConfiguration' {Maybe Natural
timeout :: Maybe Natural
$sel:timeout:HealthCheckConfiguration' :: HealthCheckConfiguration -> Maybe Natural
timeout} -> Maybe Natural
timeout) (\s :: HealthCheckConfiguration
s@HealthCheckConfiguration' {} Maybe Natural
a -> HealthCheckConfiguration
s {$sel:timeout:HealthCheckConfiguration' :: Maybe Natural
timeout = Maybe Natural
a} :: HealthCheckConfiguration)
healthCheckConfiguration_unhealthyThreshold :: Lens.Lens' HealthCheckConfiguration (Prelude.Maybe Prelude.Natural)
healthCheckConfiguration_unhealthyThreshold :: (Maybe Natural -> f (Maybe Natural))
-> HealthCheckConfiguration -> f HealthCheckConfiguration
healthCheckConfiguration_unhealthyThreshold = (HealthCheckConfiguration -> Maybe Natural)
-> (HealthCheckConfiguration
-> Maybe Natural -> HealthCheckConfiguration)
-> Lens
HealthCheckConfiguration
HealthCheckConfiguration
(Maybe Natural)
(Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\HealthCheckConfiguration' {Maybe Natural
unhealthyThreshold :: Maybe Natural
$sel:unhealthyThreshold:HealthCheckConfiguration' :: HealthCheckConfiguration -> Maybe Natural
unhealthyThreshold} -> Maybe Natural
unhealthyThreshold) (\s :: HealthCheckConfiguration
s@HealthCheckConfiguration' {} Maybe Natural
a -> HealthCheckConfiguration
s {$sel:unhealthyThreshold:HealthCheckConfiguration' :: Maybe Natural
unhealthyThreshold = Maybe Natural
a} :: HealthCheckConfiguration)
instance Core.FromJSON HealthCheckConfiguration where
parseJSON :: Value -> Parser HealthCheckConfiguration
parseJSON =
String
-> (Object -> Parser HealthCheckConfiguration)
-> Value
-> Parser HealthCheckConfiguration
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"HealthCheckConfiguration"
( \Object
x ->
Maybe Natural
-> Maybe Text
-> Maybe HealthCheckProtocol
-> Maybe Natural
-> Maybe Natural
-> Maybe Natural
-> HealthCheckConfiguration
HealthCheckConfiguration'
(Maybe Natural
-> Maybe Text
-> Maybe HealthCheckProtocol
-> Maybe Natural
-> Maybe Natural
-> Maybe Natural
-> HealthCheckConfiguration)
-> Parser (Maybe Natural)
-> Parser
(Maybe Text
-> Maybe HealthCheckProtocol
-> Maybe Natural
-> Maybe Natural
-> Maybe Natural
-> HealthCheckConfiguration)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Natural)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"HealthyThreshold")
Parser
(Maybe Text
-> Maybe HealthCheckProtocol
-> Maybe Natural
-> Maybe Natural
-> Maybe Natural
-> HealthCheckConfiguration)
-> Parser (Maybe Text)
-> Parser
(Maybe HealthCheckProtocol
-> Maybe Natural
-> Maybe Natural
-> Maybe Natural
-> HealthCheckConfiguration)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Path")
Parser
(Maybe HealthCheckProtocol
-> Maybe Natural
-> Maybe Natural
-> Maybe Natural
-> HealthCheckConfiguration)
-> Parser (Maybe HealthCheckProtocol)
-> Parser
(Maybe Natural
-> Maybe Natural -> Maybe Natural -> HealthCheckConfiguration)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe HealthCheckProtocol)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Protocol")
Parser
(Maybe Natural
-> Maybe Natural -> Maybe Natural -> HealthCheckConfiguration)
-> Parser (Maybe Natural)
-> Parser
(Maybe Natural -> Maybe Natural -> HealthCheckConfiguration)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Natural)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Interval")
Parser (Maybe Natural -> Maybe Natural -> HealthCheckConfiguration)
-> Parser (Maybe Natural)
-> Parser (Maybe Natural -> HealthCheckConfiguration)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Natural)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Timeout")
Parser (Maybe Natural -> HealthCheckConfiguration)
-> Parser (Maybe Natural) -> Parser HealthCheckConfiguration
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Natural)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"UnhealthyThreshold")
)
instance Prelude.Hashable HealthCheckConfiguration
instance Prelude.NFData HealthCheckConfiguration
instance Core.ToJSON HealthCheckConfiguration where
toJSON :: HealthCheckConfiguration -> Value
toJSON HealthCheckConfiguration' {Maybe Natural
Maybe Text
Maybe HealthCheckProtocol
unhealthyThreshold :: Maybe Natural
timeout :: Maybe Natural
interval :: Maybe Natural
protocol :: Maybe HealthCheckProtocol
path :: Maybe Text
healthyThreshold :: Maybe Natural
$sel:unhealthyThreshold:HealthCheckConfiguration' :: HealthCheckConfiguration -> Maybe Natural
$sel:timeout:HealthCheckConfiguration' :: HealthCheckConfiguration -> Maybe Natural
$sel:interval:HealthCheckConfiguration' :: HealthCheckConfiguration -> Maybe Natural
$sel:protocol:HealthCheckConfiguration' :: HealthCheckConfiguration -> Maybe HealthCheckProtocol
$sel:path:HealthCheckConfiguration' :: HealthCheckConfiguration -> Maybe Text
$sel:healthyThreshold:HealthCheckConfiguration' :: HealthCheckConfiguration -> Maybe Natural
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"HealthyThreshold" Text -> Natural -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(Natural -> Pair) -> Maybe Natural -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
healthyThreshold,
(Text
"Path" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
path,
(Text
"Protocol" Text -> HealthCheckProtocol -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (HealthCheckProtocol -> Pair)
-> Maybe HealthCheckProtocol -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe HealthCheckProtocol
protocol,
(Text
"Interval" Text -> Natural -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Natural -> Pair) -> Maybe Natural -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
interval,
(Text
"Timeout" Text -> Natural -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Natural -> Pair) -> Maybe Natural -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
timeout,
(Text
"UnhealthyThreshold" Text -> Natural -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(Natural -> Pair) -> Maybe Natural -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
unhealthyThreshold
]
)