{-# 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.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
data HealthCheckConfiguration = HealthCheckConfiguration'
{
HealthCheckConfiguration -> Maybe Natural
healthyThreshold :: Prelude.Maybe Prelude.Natural,
HealthCheckConfiguration -> Maybe Natural
interval :: Prelude.Maybe Prelude.Natural,
HealthCheckConfiguration -> Maybe Text
path :: Prelude.Maybe Prelude.Text,
HealthCheckConfiguration -> Maybe HealthCheckProtocol
protocol :: Prelude.Maybe HealthCheckProtocol,
HealthCheckConfiguration -> Maybe Natural
timeout :: Prelude.Maybe Prelude.Natural,
HealthCheckConfiguration -> Maybe Natural
unhealthyThreshold :: Prelude.Maybe Prelude.Natural
}
deriving (HealthCheckConfiguration -> HealthCheckConfiguration -> Bool
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]
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
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.
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'
{ $sel:healthyThreshold:HealthCheckConfiguration' :: Maybe Natural
healthyThreshold =
forall a. Maybe a
Prelude.Nothing,
$sel:interval:HealthCheckConfiguration' :: Maybe Natural
interval = forall a. Maybe a
Prelude.Nothing,
$sel:path:HealthCheckConfiguration' :: Maybe Text
path = forall a. Maybe a
Prelude.Nothing,
$sel:protocol:HealthCheckConfiguration' :: Maybe HealthCheckProtocol
protocol = forall a. Maybe a
Prelude.Nothing,
$sel:timeout:HealthCheckConfiguration' :: Maybe Natural
timeout = forall a. Maybe a
Prelude.Nothing,
$sel:unhealthyThreshold:HealthCheckConfiguration' :: Maybe Natural
unhealthyThreshold = forall a. Maybe a
Prelude.Nothing
}
healthCheckConfiguration_healthyThreshold :: Lens.Lens' HealthCheckConfiguration (Prelude.Maybe Prelude.Natural)
healthCheckConfiguration_healthyThreshold :: Lens' HealthCheckConfiguration (Maybe Natural)
healthCheckConfiguration_healthyThreshold = 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_interval :: Lens.Lens' HealthCheckConfiguration (Prelude.Maybe Prelude.Natural)
healthCheckConfiguration_interval :: Lens' HealthCheckConfiguration (Maybe Natural)
healthCheckConfiguration_interval = 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_path :: Lens.Lens' HealthCheckConfiguration (Prelude.Maybe Prelude.Text)
healthCheckConfiguration_path :: Lens' HealthCheckConfiguration (Maybe Text)
healthCheckConfiguration_path = 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 :: Lens' HealthCheckConfiguration (Maybe HealthCheckProtocol)
healthCheckConfiguration_protocol = 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_timeout :: Lens.Lens' HealthCheckConfiguration (Prelude.Maybe Prelude.Natural)
healthCheckConfiguration_timeout :: Lens' HealthCheckConfiguration (Maybe Natural)
healthCheckConfiguration_timeout = 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 :: Lens' HealthCheckConfiguration (Maybe Natural)
healthCheckConfiguration_unhealthyThreshold = 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 Data.FromJSON HealthCheckConfiguration where
parseJSON :: Value -> Parser HealthCheckConfiguration
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"HealthCheckConfiguration"
( \Object
x ->
Maybe Natural
-> Maybe Natural
-> Maybe Text
-> Maybe HealthCheckProtocol
-> Maybe Natural
-> Maybe Natural
-> HealthCheckConfiguration
HealthCheckConfiguration'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"HealthyThreshold")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"Interval")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"Path")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"Protocol")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"Timeout")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"UnhealthyThreshold")
)
instance Prelude.Hashable HealthCheckConfiguration where
hashWithSalt :: Int -> HealthCheckConfiguration -> Int
hashWithSalt Int
_salt HealthCheckConfiguration' {Maybe Natural
Maybe Text
Maybe HealthCheckProtocol
unhealthyThreshold :: Maybe Natural
timeout :: Maybe Natural
protocol :: Maybe HealthCheckProtocol
path :: Maybe Text
interval :: Maybe Natural
healthyThreshold :: Maybe Natural
$sel:unhealthyThreshold:HealthCheckConfiguration' :: HealthCheckConfiguration -> Maybe Natural
$sel:timeout:HealthCheckConfiguration' :: HealthCheckConfiguration -> Maybe Natural
$sel:protocol:HealthCheckConfiguration' :: HealthCheckConfiguration -> Maybe HealthCheckProtocol
$sel:path:HealthCheckConfiguration' :: HealthCheckConfiguration -> Maybe Text
$sel:interval:HealthCheckConfiguration' :: HealthCheckConfiguration -> Maybe Natural
$sel:healthyThreshold:HealthCheckConfiguration' :: HealthCheckConfiguration -> Maybe Natural
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
healthyThreshold
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
interval
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
path
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe HealthCheckProtocol
protocol
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
timeout
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
unhealthyThreshold
instance Prelude.NFData HealthCheckConfiguration where
rnf :: HealthCheckConfiguration -> ()
rnf HealthCheckConfiguration' {Maybe Natural
Maybe Text
Maybe HealthCheckProtocol
unhealthyThreshold :: Maybe Natural
timeout :: Maybe Natural
protocol :: Maybe HealthCheckProtocol
path :: Maybe Text
interval :: Maybe Natural
healthyThreshold :: Maybe Natural
$sel:unhealthyThreshold:HealthCheckConfiguration' :: HealthCheckConfiguration -> Maybe Natural
$sel:timeout:HealthCheckConfiguration' :: HealthCheckConfiguration -> Maybe Natural
$sel:protocol:HealthCheckConfiguration' :: HealthCheckConfiguration -> Maybe HealthCheckProtocol
$sel:path:HealthCheckConfiguration' :: HealthCheckConfiguration -> Maybe Text
$sel:interval:HealthCheckConfiguration' :: HealthCheckConfiguration -> Maybe Natural
$sel:healthyThreshold:HealthCheckConfiguration' :: HealthCheckConfiguration -> Maybe Natural
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
healthyThreshold
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
interval
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
path
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe HealthCheckProtocol
protocol
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
timeout
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
unhealthyThreshold
instance Data.ToJSON HealthCheckConfiguration where
toJSON :: HealthCheckConfiguration -> Value
toJSON HealthCheckConfiguration' {Maybe Natural
Maybe Text
Maybe HealthCheckProtocol
unhealthyThreshold :: Maybe Natural
timeout :: Maybe Natural
protocol :: Maybe HealthCheckProtocol
path :: Maybe Text
interval :: Maybe Natural
healthyThreshold :: Maybe Natural
$sel:unhealthyThreshold:HealthCheckConfiguration' :: HealthCheckConfiguration -> Maybe Natural
$sel:timeout:HealthCheckConfiguration' :: HealthCheckConfiguration -> Maybe Natural
$sel:protocol:HealthCheckConfiguration' :: HealthCheckConfiguration -> Maybe HealthCheckProtocol
$sel:path:HealthCheckConfiguration' :: HealthCheckConfiguration -> Maybe Text
$sel:interval:HealthCheckConfiguration' :: HealthCheckConfiguration -> Maybe Natural
$sel:healthyThreshold:HealthCheckConfiguration' :: HealthCheckConfiguration -> Maybe Natural
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"HealthyThreshold" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
healthyThreshold,
(Key
"Interval" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
interval,
(Key
"Path" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
path,
(Key
"Protocol" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe HealthCheckProtocol
protocol,
(Key
"Timeout" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
timeout,
(Key
"UnhealthyThreshold" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
unhealthyThreshold
]
)