{-# 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.Lightsail.Types.ContainerServiceHealthCheckConfig where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data ContainerServiceHealthCheckConfig = ContainerServiceHealthCheckConfig'
{
ContainerServiceHealthCheckConfig -> Maybe Int
healthyThreshold :: Prelude.Maybe Prelude.Int,
ContainerServiceHealthCheckConfig -> Maybe Text
path :: Prelude.Maybe Prelude.Text,
ContainerServiceHealthCheckConfig -> Maybe Text
successCodes :: Prelude.Maybe Prelude.Text,
ContainerServiceHealthCheckConfig -> Maybe Int
intervalSeconds :: Prelude.Maybe Prelude.Int,
ContainerServiceHealthCheckConfig -> Maybe Int
timeoutSeconds :: Prelude.Maybe Prelude.Int,
ContainerServiceHealthCheckConfig -> Maybe Int
unhealthyThreshold :: Prelude.Maybe Prelude.Int
}
deriving (ContainerServiceHealthCheckConfig
-> ContainerServiceHealthCheckConfig -> Bool
(ContainerServiceHealthCheckConfig
-> ContainerServiceHealthCheckConfig -> Bool)
-> (ContainerServiceHealthCheckConfig
-> ContainerServiceHealthCheckConfig -> Bool)
-> Eq ContainerServiceHealthCheckConfig
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ContainerServiceHealthCheckConfig
-> ContainerServiceHealthCheckConfig -> Bool
$c/= :: ContainerServiceHealthCheckConfig
-> ContainerServiceHealthCheckConfig -> Bool
== :: ContainerServiceHealthCheckConfig
-> ContainerServiceHealthCheckConfig -> Bool
$c== :: ContainerServiceHealthCheckConfig
-> ContainerServiceHealthCheckConfig -> Bool
Prelude.Eq, ReadPrec [ContainerServiceHealthCheckConfig]
ReadPrec ContainerServiceHealthCheckConfig
Int -> ReadS ContainerServiceHealthCheckConfig
ReadS [ContainerServiceHealthCheckConfig]
(Int -> ReadS ContainerServiceHealthCheckConfig)
-> ReadS [ContainerServiceHealthCheckConfig]
-> ReadPrec ContainerServiceHealthCheckConfig
-> ReadPrec [ContainerServiceHealthCheckConfig]
-> Read ContainerServiceHealthCheckConfig
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ContainerServiceHealthCheckConfig]
$creadListPrec :: ReadPrec [ContainerServiceHealthCheckConfig]
readPrec :: ReadPrec ContainerServiceHealthCheckConfig
$creadPrec :: ReadPrec ContainerServiceHealthCheckConfig
readList :: ReadS [ContainerServiceHealthCheckConfig]
$creadList :: ReadS [ContainerServiceHealthCheckConfig]
readsPrec :: Int -> ReadS ContainerServiceHealthCheckConfig
$creadsPrec :: Int -> ReadS ContainerServiceHealthCheckConfig
Prelude.Read, Int -> ContainerServiceHealthCheckConfig -> ShowS
[ContainerServiceHealthCheckConfig] -> ShowS
ContainerServiceHealthCheckConfig -> String
(Int -> ContainerServiceHealthCheckConfig -> ShowS)
-> (ContainerServiceHealthCheckConfig -> String)
-> ([ContainerServiceHealthCheckConfig] -> ShowS)
-> Show ContainerServiceHealthCheckConfig
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ContainerServiceHealthCheckConfig] -> ShowS
$cshowList :: [ContainerServiceHealthCheckConfig] -> ShowS
show :: ContainerServiceHealthCheckConfig -> String
$cshow :: ContainerServiceHealthCheckConfig -> String
showsPrec :: Int -> ContainerServiceHealthCheckConfig -> ShowS
$cshowsPrec :: Int -> ContainerServiceHealthCheckConfig -> ShowS
Prelude.Show, (forall x.
ContainerServiceHealthCheckConfig
-> Rep ContainerServiceHealthCheckConfig x)
-> (forall x.
Rep ContainerServiceHealthCheckConfig x
-> ContainerServiceHealthCheckConfig)
-> Generic ContainerServiceHealthCheckConfig
forall x.
Rep ContainerServiceHealthCheckConfig x
-> ContainerServiceHealthCheckConfig
forall x.
ContainerServiceHealthCheckConfig
-> Rep ContainerServiceHealthCheckConfig x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ContainerServiceHealthCheckConfig x
-> ContainerServiceHealthCheckConfig
$cfrom :: forall x.
ContainerServiceHealthCheckConfig
-> Rep ContainerServiceHealthCheckConfig x
Prelude.Generic)
newContainerServiceHealthCheckConfig ::
ContainerServiceHealthCheckConfig
newContainerServiceHealthCheckConfig :: ContainerServiceHealthCheckConfig
newContainerServiceHealthCheckConfig =
ContainerServiceHealthCheckConfig' :: Maybe Int
-> Maybe Text
-> Maybe Text
-> Maybe Int
-> Maybe Int
-> Maybe Int
-> ContainerServiceHealthCheckConfig
ContainerServiceHealthCheckConfig'
{ $sel:healthyThreshold:ContainerServiceHealthCheckConfig' :: Maybe Int
healthyThreshold =
Maybe Int
forall a. Maybe a
Prelude.Nothing,
$sel:path:ContainerServiceHealthCheckConfig' :: Maybe Text
path = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:successCodes:ContainerServiceHealthCheckConfig' :: Maybe Text
successCodes = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:intervalSeconds:ContainerServiceHealthCheckConfig' :: Maybe Int
intervalSeconds = Maybe Int
forall a. Maybe a
Prelude.Nothing,
$sel:timeoutSeconds:ContainerServiceHealthCheckConfig' :: Maybe Int
timeoutSeconds = Maybe Int
forall a. Maybe a
Prelude.Nothing,
$sel:unhealthyThreshold:ContainerServiceHealthCheckConfig' :: Maybe Int
unhealthyThreshold = Maybe Int
forall a. Maybe a
Prelude.Nothing
}
containerServiceHealthCheckConfig_healthyThreshold :: Lens.Lens' ContainerServiceHealthCheckConfig (Prelude.Maybe Prelude.Int)
containerServiceHealthCheckConfig_healthyThreshold :: (Maybe Int -> f (Maybe Int))
-> ContainerServiceHealthCheckConfig
-> f ContainerServiceHealthCheckConfig
containerServiceHealthCheckConfig_healthyThreshold = (ContainerServiceHealthCheckConfig -> Maybe Int)
-> (ContainerServiceHealthCheckConfig
-> Maybe Int -> ContainerServiceHealthCheckConfig)
-> Lens
ContainerServiceHealthCheckConfig
ContainerServiceHealthCheckConfig
(Maybe Int)
(Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ContainerServiceHealthCheckConfig' {Maybe Int
healthyThreshold :: Maybe Int
$sel:healthyThreshold:ContainerServiceHealthCheckConfig' :: ContainerServiceHealthCheckConfig -> Maybe Int
healthyThreshold} -> Maybe Int
healthyThreshold) (\s :: ContainerServiceHealthCheckConfig
s@ContainerServiceHealthCheckConfig' {} Maybe Int
a -> ContainerServiceHealthCheckConfig
s {$sel:healthyThreshold:ContainerServiceHealthCheckConfig' :: Maybe Int
healthyThreshold = Maybe Int
a} :: ContainerServiceHealthCheckConfig)
containerServiceHealthCheckConfig_path :: Lens.Lens' ContainerServiceHealthCheckConfig (Prelude.Maybe Prelude.Text)
containerServiceHealthCheckConfig_path :: (Maybe Text -> f (Maybe Text))
-> ContainerServiceHealthCheckConfig
-> f ContainerServiceHealthCheckConfig
containerServiceHealthCheckConfig_path = (ContainerServiceHealthCheckConfig -> Maybe Text)
-> (ContainerServiceHealthCheckConfig
-> Maybe Text -> ContainerServiceHealthCheckConfig)
-> Lens
ContainerServiceHealthCheckConfig
ContainerServiceHealthCheckConfig
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ContainerServiceHealthCheckConfig' {Maybe Text
path :: Maybe Text
$sel:path:ContainerServiceHealthCheckConfig' :: ContainerServiceHealthCheckConfig -> Maybe Text
path} -> Maybe Text
path) (\s :: ContainerServiceHealthCheckConfig
s@ContainerServiceHealthCheckConfig' {} Maybe Text
a -> ContainerServiceHealthCheckConfig
s {$sel:path:ContainerServiceHealthCheckConfig' :: Maybe Text
path = Maybe Text
a} :: ContainerServiceHealthCheckConfig)
containerServiceHealthCheckConfig_successCodes :: Lens.Lens' ContainerServiceHealthCheckConfig (Prelude.Maybe Prelude.Text)
containerServiceHealthCheckConfig_successCodes :: (Maybe Text -> f (Maybe Text))
-> ContainerServiceHealthCheckConfig
-> f ContainerServiceHealthCheckConfig
containerServiceHealthCheckConfig_successCodes = (ContainerServiceHealthCheckConfig -> Maybe Text)
-> (ContainerServiceHealthCheckConfig
-> Maybe Text -> ContainerServiceHealthCheckConfig)
-> Lens
ContainerServiceHealthCheckConfig
ContainerServiceHealthCheckConfig
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ContainerServiceHealthCheckConfig' {Maybe Text
successCodes :: Maybe Text
$sel:successCodes:ContainerServiceHealthCheckConfig' :: ContainerServiceHealthCheckConfig -> Maybe Text
successCodes} -> Maybe Text
successCodes) (\s :: ContainerServiceHealthCheckConfig
s@ContainerServiceHealthCheckConfig' {} Maybe Text
a -> ContainerServiceHealthCheckConfig
s {$sel:successCodes:ContainerServiceHealthCheckConfig' :: Maybe Text
successCodes = Maybe Text
a} :: ContainerServiceHealthCheckConfig)
containerServiceHealthCheckConfig_intervalSeconds :: Lens.Lens' ContainerServiceHealthCheckConfig (Prelude.Maybe Prelude.Int)
containerServiceHealthCheckConfig_intervalSeconds :: (Maybe Int -> f (Maybe Int))
-> ContainerServiceHealthCheckConfig
-> f ContainerServiceHealthCheckConfig
containerServiceHealthCheckConfig_intervalSeconds = (ContainerServiceHealthCheckConfig -> Maybe Int)
-> (ContainerServiceHealthCheckConfig
-> Maybe Int -> ContainerServiceHealthCheckConfig)
-> Lens
ContainerServiceHealthCheckConfig
ContainerServiceHealthCheckConfig
(Maybe Int)
(Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ContainerServiceHealthCheckConfig' {Maybe Int
intervalSeconds :: Maybe Int
$sel:intervalSeconds:ContainerServiceHealthCheckConfig' :: ContainerServiceHealthCheckConfig -> Maybe Int
intervalSeconds} -> Maybe Int
intervalSeconds) (\s :: ContainerServiceHealthCheckConfig
s@ContainerServiceHealthCheckConfig' {} Maybe Int
a -> ContainerServiceHealthCheckConfig
s {$sel:intervalSeconds:ContainerServiceHealthCheckConfig' :: Maybe Int
intervalSeconds = Maybe Int
a} :: ContainerServiceHealthCheckConfig)
containerServiceHealthCheckConfig_timeoutSeconds :: Lens.Lens' ContainerServiceHealthCheckConfig (Prelude.Maybe Prelude.Int)
containerServiceHealthCheckConfig_timeoutSeconds :: (Maybe Int -> f (Maybe Int))
-> ContainerServiceHealthCheckConfig
-> f ContainerServiceHealthCheckConfig
containerServiceHealthCheckConfig_timeoutSeconds = (ContainerServiceHealthCheckConfig -> Maybe Int)
-> (ContainerServiceHealthCheckConfig
-> Maybe Int -> ContainerServiceHealthCheckConfig)
-> Lens
ContainerServiceHealthCheckConfig
ContainerServiceHealthCheckConfig
(Maybe Int)
(Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ContainerServiceHealthCheckConfig' {Maybe Int
timeoutSeconds :: Maybe Int
$sel:timeoutSeconds:ContainerServiceHealthCheckConfig' :: ContainerServiceHealthCheckConfig -> Maybe Int
timeoutSeconds} -> Maybe Int
timeoutSeconds) (\s :: ContainerServiceHealthCheckConfig
s@ContainerServiceHealthCheckConfig' {} Maybe Int
a -> ContainerServiceHealthCheckConfig
s {$sel:timeoutSeconds:ContainerServiceHealthCheckConfig' :: Maybe Int
timeoutSeconds = Maybe Int
a} :: ContainerServiceHealthCheckConfig)
containerServiceHealthCheckConfig_unhealthyThreshold :: Lens.Lens' ContainerServiceHealthCheckConfig (Prelude.Maybe Prelude.Int)
containerServiceHealthCheckConfig_unhealthyThreshold :: (Maybe Int -> f (Maybe Int))
-> ContainerServiceHealthCheckConfig
-> f ContainerServiceHealthCheckConfig
containerServiceHealthCheckConfig_unhealthyThreshold = (ContainerServiceHealthCheckConfig -> Maybe Int)
-> (ContainerServiceHealthCheckConfig
-> Maybe Int -> ContainerServiceHealthCheckConfig)
-> Lens
ContainerServiceHealthCheckConfig
ContainerServiceHealthCheckConfig
(Maybe Int)
(Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ContainerServiceHealthCheckConfig' {Maybe Int
unhealthyThreshold :: Maybe Int
$sel:unhealthyThreshold:ContainerServiceHealthCheckConfig' :: ContainerServiceHealthCheckConfig -> Maybe Int
unhealthyThreshold} -> Maybe Int
unhealthyThreshold) (\s :: ContainerServiceHealthCheckConfig
s@ContainerServiceHealthCheckConfig' {} Maybe Int
a -> ContainerServiceHealthCheckConfig
s {$sel:unhealthyThreshold:ContainerServiceHealthCheckConfig' :: Maybe Int
unhealthyThreshold = Maybe Int
a} :: ContainerServiceHealthCheckConfig)
instance
Core.FromJSON
ContainerServiceHealthCheckConfig
where
parseJSON :: Value -> Parser ContainerServiceHealthCheckConfig
parseJSON =
String
-> (Object -> Parser ContainerServiceHealthCheckConfig)
-> Value
-> Parser ContainerServiceHealthCheckConfig
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"ContainerServiceHealthCheckConfig"
( \Object
x ->
Maybe Int
-> Maybe Text
-> Maybe Text
-> Maybe Int
-> Maybe Int
-> Maybe Int
-> ContainerServiceHealthCheckConfig
ContainerServiceHealthCheckConfig'
(Maybe Int
-> Maybe Text
-> Maybe Text
-> Maybe Int
-> Maybe Int
-> Maybe Int
-> ContainerServiceHealthCheckConfig)
-> Parser (Maybe Int)
-> Parser
(Maybe Text
-> Maybe Text
-> Maybe Int
-> Maybe Int
-> Maybe Int
-> ContainerServiceHealthCheckConfig)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"healthyThreshold")
Parser
(Maybe Text
-> Maybe Text
-> Maybe Int
-> Maybe Int
-> Maybe Int
-> ContainerServiceHealthCheckConfig)
-> Parser (Maybe Text)
-> Parser
(Maybe Text
-> Maybe Int
-> Maybe Int
-> Maybe Int
-> ContainerServiceHealthCheckConfig)
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 Text
-> Maybe Int
-> Maybe Int
-> Maybe Int
-> ContainerServiceHealthCheckConfig)
-> Parser (Maybe Text)
-> Parser
(Maybe Int
-> Maybe Int -> Maybe Int -> ContainerServiceHealthCheckConfig)
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
"successCodes")
Parser
(Maybe Int
-> Maybe Int -> Maybe Int -> ContainerServiceHealthCheckConfig)
-> Parser (Maybe Int)
-> Parser
(Maybe Int -> Maybe Int -> ContainerServiceHealthCheckConfig)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"intervalSeconds")
Parser
(Maybe Int -> Maybe Int -> ContainerServiceHealthCheckConfig)
-> Parser (Maybe Int)
-> Parser (Maybe Int -> ContainerServiceHealthCheckConfig)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"timeoutSeconds")
Parser (Maybe Int -> ContainerServiceHealthCheckConfig)
-> Parser (Maybe Int) -> Parser ContainerServiceHealthCheckConfig
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"unhealthyThreshold")
)
instance
Prelude.Hashable
ContainerServiceHealthCheckConfig
instance
Prelude.NFData
ContainerServiceHealthCheckConfig
instance
Core.ToJSON
ContainerServiceHealthCheckConfig
where
toJSON :: ContainerServiceHealthCheckConfig -> Value
toJSON ContainerServiceHealthCheckConfig' {Maybe Int
Maybe Text
unhealthyThreshold :: Maybe Int
timeoutSeconds :: Maybe Int
intervalSeconds :: Maybe Int
successCodes :: Maybe Text
path :: Maybe Text
healthyThreshold :: Maybe Int
$sel:unhealthyThreshold:ContainerServiceHealthCheckConfig' :: ContainerServiceHealthCheckConfig -> Maybe Int
$sel:timeoutSeconds:ContainerServiceHealthCheckConfig' :: ContainerServiceHealthCheckConfig -> Maybe Int
$sel:intervalSeconds:ContainerServiceHealthCheckConfig' :: ContainerServiceHealthCheckConfig -> Maybe Int
$sel:successCodes:ContainerServiceHealthCheckConfig' :: ContainerServiceHealthCheckConfig -> Maybe Text
$sel:path:ContainerServiceHealthCheckConfig' :: ContainerServiceHealthCheckConfig -> Maybe Text
$sel:healthyThreshold:ContainerServiceHealthCheckConfig' :: ContainerServiceHealthCheckConfig -> Maybe Int
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"healthyThreshold" Text -> Int -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(Int -> Pair) -> Maybe Int -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Int
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
"successCodes" 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
successCodes,
(Text
"intervalSeconds" Text -> Int -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(Int -> Pair) -> Maybe Int -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Int
intervalSeconds,
(Text
"timeoutSeconds" Text -> Int -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(Int -> Pair) -> Maybe Int -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Int
timeoutSeconds,
(Text
"unhealthyThreshold" Text -> Int -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(Int -> Pair) -> Maybe Int -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Int
unhealthyThreshold
]
)