{-# 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.SecurityHub.Types.AwsEcsTaskDefinitionContainerDefinitionsHealthCheckDetails
-- 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.SecurityHub.Types.AwsEcsTaskDefinitionContainerDefinitionsHealthCheckDetails where

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

-- | The container health check command and associated configuration
-- parameters for the container.
--
-- /See:/ 'newAwsEcsTaskDefinitionContainerDefinitionsHealthCheckDetails' smart constructor.
data AwsEcsTaskDefinitionContainerDefinitionsHealthCheckDetails = AwsEcsTaskDefinitionContainerDefinitionsHealthCheckDetails'
  { -- | The command that the container runs to determine whether it is healthy.
    AwsEcsTaskDefinitionContainerDefinitionsHealthCheckDetails
-> Maybe [Text]
command :: Prelude.Maybe [Prelude.Text],
    -- | The optional grace period in seconds that allows containers time to
    -- bootstrap before failed health checks count towards the maximum number
    -- of retries.
    AwsEcsTaskDefinitionContainerDefinitionsHealthCheckDetails
-> Maybe Int
startPeriod :: Prelude.Maybe Prelude.Int,
    -- | The number of times to retry a failed health check before the container
    -- is considered unhealthy. The default value is 3.
    AwsEcsTaskDefinitionContainerDefinitionsHealthCheckDetails
-> Maybe Int
retries :: Prelude.Maybe Prelude.Int,
    -- | The time period in seconds between each health check execution. The
    -- default value is 30 seconds.
    AwsEcsTaskDefinitionContainerDefinitionsHealthCheckDetails
-> Maybe Int
interval :: Prelude.Maybe Prelude.Int,
    -- | The time period in seconds to wait for a health check to succeed before
    -- it is considered a failure. The default value is 5.
    AwsEcsTaskDefinitionContainerDefinitionsHealthCheckDetails
-> Maybe Int
timeout :: Prelude.Maybe Prelude.Int
  }
  deriving (AwsEcsTaskDefinitionContainerDefinitionsHealthCheckDetails
-> AwsEcsTaskDefinitionContainerDefinitionsHealthCheckDetails
-> Bool
(AwsEcsTaskDefinitionContainerDefinitionsHealthCheckDetails
 -> AwsEcsTaskDefinitionContainerDefinitionsHealthCheckDetails
 -> Bool)
-> (AwsEcsTaskDefinitionContainerDefinitionsHealthCheckDetails
    -> AwsEcsTaskDefinitionContainerDefinitionsHealthCheckDetails
    -> Bool)
-> Eq AwsEcsTaskDefinitionContainerDefinitionsHealthCheckDetails
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AwsEcsTaskDefinitionContainerDefinitionsHealthCheckDetails
-> AwsEcsTaskDefinitionContainerDefinitionsHealthCheckDetails
-> Bool
$c/= :: AwsEcsTaskDefinitionContainerDefinitionsHealthCheckDetails
-> AwsEcsTaskDefinitionContainerDefinitionsHealthCheckDetails
-> Bool
== :: AwsEcsTaskDefinitionContainerDefinitionsHealthCheckDetails
-> AwsEcsTaskDefinitionContainerDefinitionsHealthCheckDetails
-> Bool
$c== :: AwsEcsTaskDefinitionContainerDefinitionsHealthCheckDetails
-> AwsEcsTaskDefinitionContainerDefinitionsHealthCheckDetails
-> Bool
Prelude.Eq, ReadPrec
  [AwsEcsTaskDefinitionContainerDefinitionsHealthCheckDetails]
ReadPrec AwsEcsTaskDefinitionContainerDefinitionsHealthCheckDetails
Int
-> ReadS AwsEcsTaskDefinitionContainerDefinitionsHealthCheckDetails
ReadS [AwsEcsTaskDefinitionContainerDefinitionsHealthCheckDetails]
(Int
 -> ReadS
      AwsEcsTaskDefinitionContainerDefinitionsHealthCheckDetails)
-> ReadS
     [AwsEcsTaskDefinitionContainerDefinitionsHealthCheckDetails]
-> ReadPrec
     AwsEcsTaskDefinitionContainerDefinitionsHealthCheckDetails
-> ReadPrec
     [AwsEcsTaskDefinitionContainerDefinitionsHealthCheckDetails]
-> Read AwsEcsTaskDefinitionContainerDefinitionsHealthCheckDetails
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec
  [AwsEcsTaskDefinitionContainerDefinitionsHealthCheckDetails]
$creadListPrec :: ReadPrec
  [AwsEcsTaskDefinitionContainerDefinitionsHealthCheckDetails]
readPrec :: ReadPrec AwsEcsTaskDefinitionContainerDefinitionsHealthCheckDetails
$creadPrec :: ReadPrec AwsEcsTaskDefinitionContainerDefinitionsHealthCheckDetails
readList :: ReadS [AwsEcsTaskDefinitionContainerDefinitionsHealthCheckDetails]
$creadList :: ReadS [AwsEcsTaskDefinitionContainerDefinitionsHealthCheckDetails]
readsPrec :: Int
-> ReadS AwsEcsTaskDefinitionContainerDefinitionsHealthCheckDetails
$creadsPrec :: Int
-> ReadS AwsEcsTaskDefinitionContainerDefinitionsHealthCheckDetails
Prelude.Read, Int
-> AwsEcsTaskDefinitionContainerDefinitionsHealthCheckDetails
-> ShowS
[AwsEcsTaskDefinitionContainerDefinitionsHealthCheckDetails]
-> ShowS
AwsEcsTaskDefinitionContainerDefinitionsHealthCheckDetails
-> String
(Int
 -> AwsEcsTaskDefinitionContainerDefinitionsHealthCheckDetails
 -> ShowS)
-> (AwsEcsTaskDefinitionContainerDefinitionsHealthCheckDetails
    -> String)
-> ([AwsEcsTaskDefinitionContainerDefinitionsHealthCheckDetails]
    -> ShowS)
-> Show AwsEcsTaskDefinitionContainerDefinitionsHealthCheckDetails
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AwsEcsTaskDefinitionContainerDefinitionsHealthCheckDetails]
-> ShowS
$cshowList :: [AwsEcsTaskDefinitionContainerDefinitionsHealthCheckDetails]
-> ShowS
show :: AwsEcsTaskDefinitionContainerDefinitionsHealthCheckDetails
-> String
$cshow :: AwsEcsTaskDefinitionContainerDefinitionsHealthCheckDetails
-> String
showsPrec :: Int
-> AwsEcsTaskDefinitionContainerDefinitionsHealthCheckDetails
-> ShowS
$cshowsPrec :: Int
-> AwsEcsTaskDefinitionContainerDefinitionsHealthCheckDetails
-> ShowS
Prelude.Show, (forall x.
 AwsEcsTaskDefinitionContainerDefinitionsHealthCheckDetails
 -> Rep
      AwsEcsTaskDefinitionContainerDefinitionsHealthCheckDetails x)
-> (forall x.
    Rep AwsEcsTaskDefinitionContainerDefinitionsHealthCheckDetails x
    -> AwsEcsTaskDefinitionContainerDefinitionsHealthCheckDetails)
-> Generic
     AwsEcsTaskDefinitionContainerDefinitionsHealthCheckDetails
forall x.
Rep AwsEcsTaskDefinitionContainerDefinitionsHealthCheckDetails x
-> AwsEcsTaskDefinitionContainerDefinitionsHealthCheckDetails
forall x.
AwsEcsTaskDefinitionContainerDefinitionsHealthCheckDetails
-> Rep AwsEcsTaskDefinitionContainerDefinitionsHealthCheckDetails x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep AwsEcsTaskDefinitionContainerDefinitionsHealthCheckDetails x
-> AwsEcsTaskDefinitionContainerDefinitionsHealthCheckDetails
$cfrom :: forall x.
AwsEcsTaskDefinitionContainerDefinitionsHealthCheckDetails
-> Rep AwsEcsTaskDefinitionContainerDefinitionsHealthCheckDetails x
Prelude.Generic)

-- |
-- Create a value of 'AwsEcsTaskDefinitionContainerDefinitionsHealthCheckDetails' 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:
--
-- 'command', 'awsEcsTaskDefinitionContainerDefinitionsHealthCheckDetails_command' - The command that the container runs to determine whether it is healthy.
--
-- 'startPeriod', 'awsEcsTaskDefinitionContainerDefinitionsHealthCheckDetails_startPeriod' - The optional grace period in seconds that allows containers time to
-- bootstrap before failed health checks count towards the maximum number
-- of retries.
--
-- 'retries', 'awsEcsTaskDefinitionContainerDefinitionsHealthCheckDetails_retries' - The number of times to retry a failed health check before the container
-- is considered unhealthy. The default value is 3.
--
-- 'interval', 'awsEcsTaskDefinitionContainerDefinitionsHealthCheckDetails_interval' - The time period in seconds between each health check execution. The
-- default value is 30 seconds.
--
-- 'timeout', 'awsEcsTaskDefinitionContainerDefinitionsHealthCheckDetails_timeout' - The time period in seconds to wait for a health check to succeed before
-- it is considered a failure. The default value is 5.
newAwsEcsTaskDefinitionContainerDefinitionsHealthCheckDetails ::
  AwsEcsTaskDefinitionContainerDefinitionsHealthCheckDetails
newAwsEcsTaskDefinitionContainerDefinitionsHealthCheckDetails :: AwsEcsTaskDefinitionContainerDefinitionsHealthCheckDetails
newAwsEcsTaskDefinitionContainerDefinitionsHealthCheckDetails =
  AwsEcsTaskDefinitionContainerDefinitionsHealthCheckDetails' :: Maybe [Text]
-> Maybe Int
-> Maybe Int
-> Maybe Int
-> Maybe Int
-> AwsEcsTaskDefinitionContainerDefinitionsHealthCheckDetails
AwsEcsTaskDefinitionContainerDefinitionsHealthCheckDetails'
    { $sel:command:AwsEcsTaskDefinitionContainerDefinitionsHealthCheckDetails' :: Maybe [Text]
command =
        Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
      $sel:startPeriod:AwsEcsTaskDefinitionContainerDefinitionsHealthCheckDetails' :: Maybe Int
startPeriod =
        Maybe Int
forall a. Maybe a
Prelude.Nothing,
      $sel:retries:AwsEcsTaskDefinitionContainerDefinitionsHealthCheckDetails' :: Maybe Int
retries =
        Maybe Int
forall a. Maybe a
Prelude.Nothing,
      $sel:interval:AwsEcsTaskDefinitionContainerDefinitionsHealthCheckDetails' :: Maybe Int
interval =
        Maybe Int
forall a. Maybe a
Prelude.Nothing,
      $sel:timeout:AwsEcsTaskDefinitionContainerDefinitionsHealthCheckDetails' :: Maybe Int
timeout =
        Maybe Int
forall a. Maybe a
Prelude.Nothing
    }

-- | The command that the container runs to determine whether it is healthy.
awsEcsTaskDefinitionContainerDefinitionsHealthCheckDetails_command :: Lens.Lens' AwsEcsTaskDefinitionContainerDefinitionsHealthCheckDetails (Prelude.Maybe [Prelude.Text])
awsEcsTaskDefinitionContainerDefinitionsHealthCheckDetails_command :: (Maybe [Text] -> f (Maybe [Text]))
-> AwsEcsTaskDefinitionContainerDefinitionsHealthCheckDetails
-> f AwsEcsTaskDefinitionContainerDefinitionsHealthCheckDetails
awsEcsTaskDefinitionContainerDefinitionsHealthCheckDetails_command = (AwsEcsTaskDefinitionContainerDefinitionsHealthCheckDetails
 -> Maybe [Text])
-> (AwsEcsTaskDefinitionContainerDefinitionsHealthCheckDetails
    -> Maybe [Text]
    -> AwsEcsTaskDefinitionContainerDefinitionsHealthCheckDetails)
-> Lens
     AwsEcsTaskDefinitionContainerDefinitionsHealthCheckDetails
     AwsEcsTaskDefinitionContainerDefinitionsHealthCheckDetails
     (Maybe [Text])
     (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AwsEcsTaskDefinitionContainerDefinitionsHealthCheckDetails' {Maybe [Text]
command :: Maybe [Text]
$sel:command:AwsEcsTaskDefinitionContainerDefinitionsHealthCheckDetails' :: AwsEcsTaskDefinitionContainerDefinitionsHealthCheckDetails
-> Maybe [Text]
command} -> Maybe [Text]
command) (\s :: AwsEcsTaskDefinitionContainerDefinitionsHealthCheckDetails
s@AwsEcsTaskDefinitionContainerDefinitionsHealthCheckDetails' {} Maybe [Text]
a -> AwsEcsTaskDefinitionContainerDefinitionsHealthCheckDetails
s {$sel:command:AwsEcsTaskDefinitionContainerDefinitionsHealthCheckDetails' :: Maybe [Text]
command = Maybe [Text]
a} :: AwsEcsTaskDefinitionContainerDefinitionsHealthCheckDetails) ((Maybe [Text] -> f (Maybe [Text]))
 -> AwsEcsTaskDefinitionContainerDefinitionsHealthCheckDetails
 -> f AwsEcsTaskDefinitionContainerDefinitionsHealthCheckDetails)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> AwsEcsTaskDefinitionContainerDefinitionsHealthCheckDetails
-> f AwsEcsTaskDefinitionContainerDefinitionsHealthCheckDetails
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [Text]) (Maybe [Text]) (Maybe [Text])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso [Text] [Text] [Text] [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The optional grace period in seconds that allows containers time to
-- bootstrap before failed health checks count towards the maximum number
-- of retries.
awsEcsTaskDefinitionContainerDefinitionsHealthCheckDetails_startPeriod :: Lens.Lens' AwsEcsTaskDefinitionContainerDefinitionsHealthCheckDetails (Prelude.Maybe Prelude.Int)
awsEcsTaskDefinitionContainerDefinitionsHealthCheckDetails_startPeriod :: (Maybe Int -> f (Maybe Int))
-> AwsEcsTaskDefinitionContainerDefinitionsHealthCheckDetails
-> f AwsEcsTaskDefinitionContainerDefinitionsHealthCheckDetails
awsEcsTaskDefinitionContainerDefinitionsHealthCheckDetails_startPeriod = (AwsEcsTaskDefinitionContainerDefinitionsHealthCheckDetails
 -> Maybe Int)
-> (AwsEcsTaskDefinitionContainerDefinitionsHealthCheckDetails
    -> Maybe Int
    -> AwsEcsTaskDefinitionContainerDefinitionsHealthCheckDetails)
-> Lens
     AwsEcsTaskDefinitionContainerDefinitionsHealthCheckDetails
     AwsEcsTaskDefinitionContainerDefinitionsHealthCheckDetails
     (Maybe Int)
     (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AwsEcsTaskDefinitionContainerDefinitionsHealthCheckDetails' {Maybe Int
startPeriod :: Maybe Int
$sel:startPeriod:AwsEcsTaskDefinitionContainerDefinitionsHealthCheckDetails' :: AwsEcsTaskDefinitionContainerDefinitionsHealthCheckDetails
-> Maybe Int
startPeriod} -> Maybe Int
startPeriod) (\s :: AwsEcsTaskDefinitionContainerDefinitionsHealthCheckDetails
s@AwsEcsTaskDefinitionContainerDefinitionsHealthCheckDetails' {} Maybe Int
a -> AwsEcsTaskDefinitionContainerDefinitionsHealthCheckDetails
s {$sel:startPeriod:AwsEcsTaskDefinitionContainerDefinitionsHealthCheckDetails' :: Maybe Int
startPeriod = Maybe Int
a} :: AwsEcsTaskDefinitionContainerDefinitionsHealthCheckDetails)

-- | The number of times to retry a failed health check before the container
-- is considered unhealthy. The default value is 3.
awsEcsTaskDefinitionContainerDefinitionsHealthCheckDetails_retries :: Lens.Lens' AwsEcsTaskDefinitionContainerDefinitionsHealthCheckDetails (Prelude.Maybe Prelude.Int)
awsEcsTaskDefinitionContainerDefinitionsHealthCheckDetails_retries :: (Maybe Int -> f (Maybe Int))
-> AwsEcsTaskDefinitionContainerDefinitionsHealthCheckDetails
-> f AwsEcsTaskDefinitionContainerDefinitionsHealthCheckDetails
awsEcsTaskDefinitionContainerDefinitionsHealthCheckDetails_retries = (AwsEcsTaskDefinitionContainerDefinitionsHealthCheckDetails
 -> Maybe Int)
-> (AwsEcsTaskDefinitionContainerDefinitionsHealthCheckDetails
    -> Maybe Int
    -> AwsEcsTaskDefinitionContainerDefinitionsHealthCheckDetails)
-> Lens
     AwsEcsTaskDefinitionContainerDefinitionsHealthCheckDetails
     AwsEcsTaskDefinitionContainerDefinitionsHealthCheckDetails
     (Maybe Int)
     (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AwsEcsTaskDefinitionContainerDefinitionsHealthCheckDetails' {Maybe Int
retries :: Maybe Int
$sel:retries:AwsEcsTaskDefinitionContainerDefinitionsHealthCheckDetails' :: AwsEcsTaskDefinitionContainerDefinitionsHealthCheckDetails
-> Maybe Int
retries} -> Maybe Int
retries) (\s :: AwsEcsTaskDefinitionContainerDefinitionsHealthCheckDetails
s@AwsEcsTaskDefinitionContainerDefinitionsHealthCheckDetails' {} Maybe Int
a -> AwsEcsTaskDefinitionContainerDefinitionsHealthCheckDetails
s {$sel:retries:AwsEcsTaskDefinitionContainerDefinitionsHealthCheckDetails' :: Maybe Int
retries = Maybe Int
a} :: AwsEcsTaskDefinitionContainerDefinitionsHealthCheckDetails)

-- | The time period in seconds between each health check execution. The
-- default value is 30 seconds.
awsEcsTaskDefinitionContainerDefinitionsHealthCheckDetails_interval :: Lens.Lens' AwsEcsTaskDefinitionContainerDefinitionsHealthCheckDetails (Prelude.Maybe Prelude.Int)
awsEcsTaskDefinitionContainerDefinitionsHealthCheckDetails_interval :: (Maybe Int -> f (Maybe Int))
-> AwsEcsTaskDefinitionContainerDefinitionsHealthCheckDetails
-> f AwsEcsTaskDefinitionContainerDefinitionsHealthCheckDetails
awsEcsTaskDefinitionContainerDefinitionsHealthCheckDetails_interval = (AwsEcsTaskDefinitionContainerDefinitionsHealthCheckDetails
 -> Maybe Int)
-> (AwsEcsTaskDefinitionContainerDefinitionsHealthCheckDetails
    -> Maybe Int
    -> AwsEcsTaskDefinitionContainerDefinitionsHealthCheckDetails)
-> Lens
     AwsEcsTaskDefinitionContainerDefinitionsHealthCheckDetails
     AwsEcsTaskDefinitionContainerDefinitionsHealthCheckDetails
     (Maybe Int)
     (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AwsEcsTaskDefinitionContainerDefinitionsHealthCheckDetails' {Maybe Int
interval :: Maybe Int
$sel:interval:AwsEcsTaskDefinitionContainerDefinitionsHealthCheckDetails' :: AwsEcsTaskDefinitionContainerDefinitionsHealthCheckDetails
-> Maybe Int
interval} -> Maybe Int
interval) (\s :: AwsEcsTaskDefinitionContainerDefinitionsHealthCheckDetails
s@AwsEcsTaskDefinitionContainerDefinitionsHealthCheckDetails' {} Maybe Int
a -> AwsEcsTaskDefinitionContainerDefinitionsHealthCheckDetails
s {$sel:interval:AwsEcsTaskDefinitionContainerDefinitionsHealthCheckDetails' :: Maybe Int
interval = Maybe Int
a} :: AwsEcsTaskDefinitionContainerDefinitionsHealthCheckDetails)

-- | The time period in seconds to wait for a health check to succeed before
-- it is considered a failure. The default value is 5.
awsEcsTaskDefinitionContainerDefinitionsHealthCheckDetails_timeout :: Lens.Lens' AwsEcsTaskDefinitionContainerDefinitionsHealthCheckDetails (Prelude.Maybe Prelude.Int)
awsEcsTaskDefinitionContainerDefinitionsHealthCheckDetails_timeout :: (Maybe Int -> f (Maybe Int))
-> AwsEcsTaskDefinitionContainerDefinitionsHealthCheckDetails
-> f AwsEcsTaskDefinitionContainerDefinitionsHealthCheckDetails
awsEcsTaskDefinitionContainerDefinitionsHealthCheckDetails_timeout = (AwsEcsTaskDefinitionContainerDefinitionsHealthCheckDetails
 -> Maybe Int)
-> (AwsEcsTaskDefinitionContainerDefinitionsHealthCheckDetails
    -> Maybe Int
    -> AwsEcsTaskDefinitionContainerDefinitionsHealthCheckDetails)
-> Lens
     AwsEcsTaskDefinitionContainerDefinitionsHealthCheckDetails
     AwsEcsTaskDefinitionContainerDefinitionsHealthCheckDetails
     (Maybe Int)
     (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AwsEcsTaskDefinitionContainerDefinitionsHealthCheckDetails' {Maybe Int
timeout :: Maybe Int
$sel:timeout:AwsEcsTaskDefinitionContainerDefinitionsHealthCheckDetails' :: AwsEcsTaskDefinitionContainerDefinitionsHealthCheckDetails
-> Maybe Int
timeout} -> Maybe Int
timeout) (\s :: AwsEcsTaskDefinitionContainerDefinitionsHealthCheckDetails
s@AwsEcsTaskDefinitionContainerDefinitionsHealthCheckDetails' {} Maybe Int
a -> AwsEcsTaskDefinitionContainerDefinitionsHealthCheckDetails
s {$sel:timeout:AwsEcsTaskDefinitionContainerDefinitionsHealthCheckDetails' :: Maybe Int
timeout = Maybe Int
a} :: AwsEcsTaskDefinitionContainerDefinitionsHealthCheckDetails)

instance
  Core.FromJSON
    AwsEcsTaskDefinitionContainerDefinitionsHealthCheckDetails
  where
  parseJSON :: Value
-> Parser
     AwsEcsTaskDefinitionContainerDefinitionsHealthCheckDetails
parseJSON =
    String
-> (Object
    -> Parser
         AwsEcsTaskDefinitionContainerDefinitionsHealthCheckDetails)
-> Value
-> Parser
     AwsEcsTaskDefinitionContainerDefinitionsHealthCheckDetails
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"AwsEcsTaskDefinitionContainerDefinitionsHealthCheckDetails"
      ( \Object
x ->
          Maybe [Text]
-> Maybe Int
-> Maybe Int
-> Maybe Int
-> Maybe Int
-> AwsEcsTaskDefinitionContainerDefinitionsHealthCheckDetails
AwsEcsTaskDefinitionContainerDefinitionsHealthCheckDetails'
            (Maybe [Text]
 -> Maybe Int
 -> Maybe Int
 -> Maybe Int
 -> Maybe Int
 -> AwsEcsTaskDefinitionContainerDefinitionsHealthCheckDetails)
-> Parser (Maybe [Text])
-> Parser
     (Maybe Int
      -> Maybe Int
      -> Maybe Int
      -> Maybe Int
      -> AwsEcsTaskDefinitionContainerDefinitionsHealthCheckDetails)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe (Maybe [Text]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Command" Parser (Maybe (Maybe [Text]))
-> Maybe [Text] -> Parser (Maybe [Text])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [Text]
forall a. Monoid a => a
Prelude.mempty)
              Parser
  (Maybe Int
   -> Maybe Int
   -> Maybe Int
   -> Maybe Int
   -> AwsEcsTaskDefinitionContainerDefinitionsHealthCheckDetails)
-> Parser (Maybe Int)
-> Parser
     (Maybe Int
      -> Maybe Int
      -> Maybe Int
      -> AwsEcsTaskDefinitionContainerDefinitionsHealthCheckDetails)
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
"StartPeriod")
              Parser
  (Maybe Int
   -> Maybe Int
   -> Maybe Int
   -> AwsEcsTaskDefinitionContainerDefinitionsHealthCheckDetails)
-> Parser (Maybe Int)
-> Parser
     (Maybe Int
      -> Maybe Int
      -> AwsEcsTaskDefinitionContainerDefinitionsHealthCheckDetails)
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
"Retries")
              Parser
  (Maybe Int
   -> Maybe Int
   -> AwsEcsTaskDefinitionContainerDefinitionsHealthCheckDetails)
-> Parser (Maybe Int)
-> Parser
     (Maybe Int
      -> AwsEcsTaskDefinitionContainerDefinitionsHealthCheckDetails)
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
"Interval")
              Parser
  (Maybe Int
   -> AwsEcsTaskDefinitionContainerDefinitionsHealthCheckDetails)
-> Parser (Maybe Int)
-> Parser
     AwsEcsTaskDefinitionContainerDefinitionsHealthCheckDetails
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
"Timeout")
      )

instance
  Prelude.Hashable
    AwsEcsTaskDefinitionContainerDefinitionsHealthCheckDetails

instance
  Prelude.NFData
    AwsEcsTaskDefinitionContainerDefinitionsHealthCheckDetails

instance
  Core.ToJSON
    AwsEcsTaskDefinitionContainerDefinitionsHealthCheckDetails
  where
  toJSON :: AwsEcsTaskDefinitionContainerDefinitionsHealthCheckDetails -> Value
toJSON
    AwsEcsTaskDefinitionContainerDefinitionsHealthCheckDetails' {Maybe Int
Maybe [Text]
timeout :: Maybe Int
interval :: Maybe Int
retries :: Maybe Int
startPeriod :: Maybe Int
command :: Maybe [Text]
$sel:timeout:AwsEcsTaskDefinitionContainerDefinitionsHealthCheckDetails' :: AwsEcsTaskDefinitionContainerDefinitionsHealthCheckDetails
-> Maybe Int
$sel:interval:AwsEcsTaskDefinitionContainerDefinitionsHealthCheckDetails' :: AwsEcsTaskDefinitionContainerDefinitionsHealthCheckDetails
-> Maybe Int
$sel:retries:AwsEcsTaskDefinitionContainerDefinitionsHealthCheckDetails' :: AwsEcsTaskDefinitionContainerDefinitionsHealthCheckDetails
-> Maybe Int
$sel:startPeriod:AwsEcsTaskDefinitionContainerDefinitionsHealthCheckDetails' :: AwsEcsTaskDefinitionContainerDefinitionsHealthCheckDetails
-> Maybe Int
$sel:command:AwsEcsTaskDefinitionContainerDefinitionsHealthCheckDetails' :: AwsEcsTaskDefinitionContainerDefinitionsHealthCheckDetails
-> Maybe [Text]
..} =
      [Pair] -> Value
Core.object
        ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
            [ (Text
"Command" 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]
command,
              (Text
"StartPeriod" 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
startPeriod,
              (Text
"Retries" 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
retries,
              (Text
"Interval" 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
interval,
              (Text
"Timeout" 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
timeout
            ]
        )