{-# 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 #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.Lightsail.Types.ContainerServiceHealthCheckConfig
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.Lightsail.Types.ContainerServiceHealthCheckConfig where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | Describes the health check configuration of an Amazon Lightsail
-- container service.
--
-- /See:/ 'newContainerServiceHealthCheckConfig' smart constructor.
data ContainerServiceHealthCheckConfig = ContainerServiceHealthCheckConfig'
  { -- | The number of consecutive health checks successes required before moving
    -- the container to the @Healthy@ state. The default value is @2@.
    ContainerServiceHealthCheckConfig -> Maybe Int
healthyThreshold :: Prelude.Maybe Prelude.Int,
    -- | The path on the container on which to perform the health check. The
    -- default value is @\/@.
    ContainerServiceHealthCheckConfig -> Maybe Text
path :: Prelude.Maybe Prelude.Text,
    -- | The HTTP codes to use when checking for a successful response from a
    -- container. You can specify values between @200@ and @499@. You can
    -- specify multiple values (for example, @200,202@) or a range of values
    -- (for example, @200-299@).
    ContainerServiceHealthCheckConfig -> Maybe Text
successCodes :: Prelude.Maybe Prelude.Text,
    -- | The approximate interval, in seconds, between health checks of an
    -- individual container. You can specify between 5 and 300 seconds. The
    -- default value is @5@.
    ContainerServiceHealthCheckConfig -> Maybe Int
intervalSeconds :: Prelude.Maybe Prelude.Int,
    -- | The amount of time, in seconds, during which no response means a failed
    -- health check. You can specify between 2 and 60 seconds. The default
    -- value is @2@.
    ContainerServiceHealthCheckConfig -> Maybe Int
timeoutSeconds :: Prelude.Maybe Prelude.Int,
    -- | The number of consecutive health check failures required before moving
    -- the container to the @Unhealthy@ state. The default value is @2@.
    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)

-- |
-- Create a value of 'ContainerServiceHealthCheckConfig' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'healthyThreshold', 'containerServiceHealthCheckConfig_healthyThreshold' - The number of consecutive health checks successes required before moving
-- the container to the @Healthy@ state. The default value is @2@.
--
-- 'path', 'containerServiceHealthCheckConfig_path' - The path on the container on which to perform the health check. The
-- default value is @\/@.
--
-- 'successCodes', 'containerServiceHealthCheckConfig_successCodes' - The HTTP codes to use when checking for a successful response from a
-- container. You can specify values between @200@ and @499@. You can
-- specify multiple values (for example, @200,202@) or a range of values
-- (for example, @200-299@).
--
-- 'intervalSeconds', 'containerServiceHealthCheckConfig_intervalSeconds' - The approximate interval, in seconds, between health checks of an
-- individual container. You can specify between 5 and 300 seconds. The
-- default value is @5@.
--
-- 'timeoutSeconds', 'containerServiceHealthCheckConfig_timeoutSeconds' - The amount of time, in seconds, during which no response means a failed
-- health check. You can specify between 2 and 60 seconds. The default
-- value is @2@.
--
-- 'unhealthyThreshold', 'containerServiceHealthCheckConfig_unhealthyThreshold' - The number of consecutive health check failures required before moving
-- the container to the @Unhealthy@ state. The default value is @2@.
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
    }

-- | The number of consecutive health checks successes required before moving
-- the container to the @Healthy@ state. The default value is @2@.
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)

-- | The path on the container on which to perform the health check. The
-- default value is @\/@.
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)

-- | The HTTP codes to use when checking for a successful response from a
-- container. You can specify values between @200@ and @499@. You can
-- specify multiple values (for example, @200,202@) or a range of values
-- (for example, @200-299@).
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)

-- | The approximate interval, in seconds, between health checks of an
-- individual container. You can specify between 5 and 300 seconds. The
-- default value is @5@.
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)

-- | The amount of time, in seconds, during which no response means a failed
-- health check. You can specify between 2 and 60 seconds. The default
-- value is @2@.
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)

-- | The number of consecutive health check failures required before moving
-- the container to the @Unhealthy@ state. The default value is @2@.
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
          ]
      )