{-# 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.AwsEcsTaskDefinitionContainerDefinitionsDependsOnDetails
-- 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.AwsEcsTaskDefinitionContainerDefinitionsDependsOnDetails where

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

-- | A dependency that is defined for container startup and shutdown.
--
-- /See:/ 'newAwsEcsTaskDefinitionContainerDefinitionsDependsOnDetails' smart constructor.
data AwsEcsTaskDefinitionContainerDefinitionsDependsOnDetails = AwsEcsTaskDefinitionContainerDefinitionsDependsOnDetails'
  { -- | The name of the dependent container.
    AwsEcsTaskDefinitionContainerDefinitionsDependsOnDetails
-> Maybe Text
containerName :: Prelude.Maybe Prelude.Text,
    -- | The dependency condition of the dependent container. Indicates the
    -- required status of the dependent container before the current container
    -- can start.
    AwsEcsTaskDefinitionContainerDefinitionsDependsOnDetails
-> Maybe Text
condition :: Prelude.Maybe Prelude.Text
  }
  deriving (AwsEcsTaskDefinitionContainerDefinitionsDependsOnDetails
-> AwsEcsTaskDefinitionContainerDefinitionsDependsOnDetails -> Bool
(AwsEcsTaskDefinitionContainerDefinitionsDependsOnDetails
 -> AwsEcsTaskDefinitionContainerDefinitionsDependsOnDetails
 -> Bool)
-> (AwsEcsTaskDefinitionContainerDefinitionsDependsOnDetails
    -> AwsEcsTaskDefinitionContainerDefinitionsDependsOnDetails
    -> Bool)
-> Eq AwsEcsTaskDefinitionContainerDefinitionsDependsOnDetails
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AwsEcsTaskDefinitionContainerDefinitionsDependsOnDetails
-> AwsEcsTaskDefinitionContainerDefinitionsDependsOnDetails -> Bool
$c/= :: AwsEcsTaskDefinitionContainerDefinitionsDependsOnDetails
-> AwsEcsTaskDefinitionContainerDefinitionsDependsOnDetails -> Bool
== :: AwsEcsTaskDefinitionContainerDefinitionsDependsOnDetails
-> AwsEcsTaskDefinitionContainerDefinitionsDependsOnDetails -> Bool
$c== :: AwsEcsTaskDefinitionContainerDefinitionsDependsOnDetails
-> AwsEcsTaskDefinitionContainerDefinitionsDependsOnDetails -> Bool
Prelude.Eq, ReadPrec [AwsEcsTaskDefinitionContainerDefinitionsDependsOnDetails]
ReadPrec AwsEcsTaskDefinitionContainerDefinitionsDependsOnDetails
Int
-> ReadS AwsEcsTaskDefinitionContainerDefinitionsDependsOnDetails
ReadS [AwsEcsTaskDefinitionContainerDefinitionsDependsOnDetails]
(Int
 -> ReadS AwsEcsTaskDefinitionContainerDefinitionsDependsOnDetails)
-> ReadS [AwsEcsTaskDefinitionContainerDefinitionsDependsOnDetails]
-> ReadPrec
     AwsEcsTaskDefinitionContainerDefinitionsDependsOnDetails
-> ReadPrec
     [AwsEcsTaskDefinitionContainerDefinitionsDependsOnDetails]
-> Read AwsEcsTaskDefinitionContainerDefinitionsDependsOnDetails
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AwsEcsTaskDefinitionContainerDefinitionsDependsOnDetails]
$creadListPrec :: ReadPrec [AwsEcsTaskDefinitionContainerDefinitionsDependsOnDetails]
readPrec :: ReadPrec AwsEcsTaskDefinitionContainerDefinitionsDependsOnDetails
$creadPrec :: ReadPrec AwsEcsTaskDefinitionContainerDefinitionsDependsOnDetails
readList :: ReadS [AwsEcsTaskDefinitionContainerDefinitionsDependsOnDetails]
$creadList :: ReadS [AwsEcsTaskDefinitionContainerDefinitionsDependsOnDetails]
readsPrec :: Int
-> ReadS AwsEcsTaskDefinitionContainerDefinitionsDependsOnDetails
$creadsPrec :: Int
-> ReadS AwsEcsTaskDefinitionContainerDefinitionsDependsOnDetails
Prelude.Read, Int
-> AwsEcsTaskDefinitionContainerDefinitionsDependsOnDetails
-> ShowS
[AwsEcsTaskDefinitionContainerDefinitionsDependsOnDetails] -> ShowS
AwsEcsTaskDefinitionContainerDefinitionsDependsOnDetails -> String
(Int
 -> AwsEcsTaskDefinitionContainerDefinitionsDependsOnDetails
 -> ShowS)
-> (AwsEcsTaskDefinitionContainerDefinitionsDependsOnDetails
    -> String)
-> ([AwsEcsTaskDefinitionContainerDefinitionsDependsOnDetails]
    -> ShowS)
-> Show AwsEcsTaskDefinitionContainerDefinitionsDependsOnDetails
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AwsEcsTaskDefinitionContainerDefinitionsDependsOnDetails] -> ShowS
$cshowList :: [AwsEcsTaskDefinitionContainerDefinitionsDependsOnDetails] -> ShowS
show :: AwsEcsTaskDefinitionContainerDefinitionsDependsOnDetails -> String
$cshow :: AwsEcsTaskDefinitionContainerDefinitionsDependsOnDetails -> String
showsPrec :: Int
-> AwsEcsTaskDefinitionContainerDefinitionsDependsOnDetails
-> ShowS
$cshowsPrec :: Int
-> AwsEcsTaskDefinitionContainerDefinitionsDependsOnDetails
-> ShowS
Prelude.Show, (forall x.
 AwsEcsTaskDefinitionContainerDefinitionsDependsOnDetails
 -> Rep AwsEcsTaskDefinitionContainerDefinitionsDependsOnDetails x)
-> (forall x.
    Rep AwsEcsTaskDefinitionContainerDefinitionsDependsOnDetails x
    -> AwsEcsTaskDefinitionContainerDefinitionsDependsOnDetails)
-> Generic AwsEcsTaskDefinitionContainerDefinitionsDependsOnDetails
forall x.
Rep AwsEcsTaskDefinitionContainerDefinitionsDependsOnDetails x
-> AwsEcsTaskDefinitionContainerDefinitionsDependsOnDetails
forall x.
AwsEcsTaskDefinitionContainerDefinitionsDependsOnDetails
-> Rep AwsEcsTaskDefinitionContainerDefinitionsDependsOnDetails x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep AwsEcsTaskDefinitionContainerDefinitionsDependsOnDetails x
-> AwsEcsTaskDefinitionContainerDefinitionsDependsOnDetails
$cfrom :: forall x.
AwsEcsTaskDefinitionContainerDefinitionsDependsOnDetails
-> Rep AwsEcsTaskDefinitionContainerDefinitionsDependsOnDetails x
Prelude.Generic)

-- |
-- Create a value of 'AwsEcsTaskDefinitionContainerDefinitionsDependsOnDetails' 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:
--
-- 'containerName', 'awsEcsTaskDefinitionContainerDefinitionsDependsOnDetails_containerName' - The name of the dependent container.
--
-- 'condition', 'awsEcsTaskDefinitionContainerDefinitionsDependsOnDetails_condition' - The dependency condition of the dependent container. Indicates the
-- required status of the dependent container before the current container
-- can start.
newAwsEcsTaskDefinitionContainerDefinitionsDependsOnDetails ::
  AwsEcsTaskDefinitionContainerDefinitionsDependsOnDetails
newAwsEcsTaskDefinitionContainerDefinitionsDependsOnDetails :: AwsEcsTaskDefinitionContainerDefinitionsDependsOnDetails
newAwsEcsTaskDefinitionContainerDefinitionsDependsOnDetails =
  AwsEcsTaskDefinitionContainerDefinitionsDependsOnDetails' :: Maybe Text
-> Maybe Text
-> AwsEcsTaskDefinitionContainerDefinitionsDependsOnDetails
AwsEcsTaskDefinitionContainerDefinitionsDependsOnDetails'
    { $sel:containerName:AwsEcsTaskDefinitionContainerDefinitionsDependsOnDetails' :: Maybe Text
containerName =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:condition:AwsEcsTaskDefinitionContainerDefinitionsDependsOnDetails' :: Maybe Text
condition =
        Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | The name of the dependent container.
awsEcsTaskDefinitionContainerDefinitionsDependsOnDetails_containerName :: Lens.Lens' AwsEcsTaskDefinitionContainerDefinitionsDependsOnDetails (Prelude.Maybe Prelude.Text)
awsEcsTaskDefinitionContainerDefinitionsDependsOnDetails_containerName :: (Maybe Text -> f (Maybe Text))
-> AwsEcsTaskDefinitionContainerDefinitionsDependsOnDetails
-> f AwsEcsTaskDefinitionContainerDefinitionsDependsOnDetails
awsEcsTaskDefinitionContainerDefinitionsDependsOnDetails_containerName = (AwsEcsTaskDefinitionContainerDefinitionsDependsOnDetails
 -> Maybe Text)
-> (AwsEcsTaskDefinitionContainerDefinitionsDependsOnDetails
    -> Maybe Text
    -> AwsEcsTaskDefinitionContainerDefinitionsDependsOnDetails)
-> Lens
     AwsEcsTaskDefinitionContainerDefinitionsDependsOnDetails
     AwsEcsTaskDefinitionContainerDefinitionsDependsOnDetails
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AwsEcsTaskDefinitionContainerDefinitionsDependsOnDetails' {Maybe Text
containerName :: Maybe Text
$sel:containerName:AwsEcsTaskDefinitionContainerDefinitionsDependsOnDetails' :: AwsEcsTaskDefinitionContainerDefinitionsDependsOnDetails
-> Maybe Text
containerName} -> Maybe Text
containerName) (\s :: AwsEcsTaskDefinitionContainerDefinitionsDependsOnDetails
s@AwsEcsTaskDefinitionContainerDefinitionsDependsOnDetails' {} Maybe Text
a -> AwsEcsTaskDefinitionContainerDefinitionsDependsOnDetails
s {$sel:containerName:AwsEcsTaskDefinitionContainerDefinitionsDependsOnDetails' :: Maybe Text
containerName = Maybe Text
a} :: AwsEcsTaskDefinitionContainerDefinitionsDependsOnDetails)

-- | The dependency condition of the dependent container. Indicates the
-- required status of the dependent container before the current container
-- can start.
awsEcsTaskDefinitionContainerDefinitionsDependsOnDetails_condition :: Lens.Lens' AwsEcsTaskDefinitionContainerDefinitionsDependsOnDetails (Prelude.Maybe Prelude.Text)
awsEcsTaskDefinitionContainerDefinitionsDependsOnDetails_condition :: (Maybe Text -> f (Maybe Text))
-> AwsEcsTaskDefinitionContainerDefinitionsDependsOnDetails
-> f AwsEcsTaskDefinitionContainerDefinitionsDependsOnDetails
awsEcsTaskDefinitionContainerDefinitionsDependsOnDetails_condition = (AwsEcsTaskDefinitionContainerDefinitionsDependsOnDetails
 -> Maybe Text)
-> (AwsEcsTaskDefinitionContainerDefinitionsDependsOnDetails
    -> Maybe Text
    -> AwsEcsTaskDefinitionContainerDefinitionsDependsOnDetails)
-> Lens
     AwsEcsTaskDefinitionContainerDefinitionsDependsOnDetails
     AwsEcsTaskDefinitionContainerDefinitionsDependsOnDetails
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AwsEcsTaskDefinitionContainerDefinitionsDependsOnDetails' {Maybe Text
condition :: Maybe Text
$sel:condition:AwsEcsTaskDefinitionContainerDefinitionsDependsOnDetails' :: AwsEcsTaskDefinitionContainerDefinitionsDependsOnDetails
-> Maybe Text
condition} -> Maybe Text
condition) (\s :: AwsEcsTaskDefinitionContainerDefinitionsDependsOnDetails
s@AwsEcsTaskDefinitionContainerDefinitionsDependsOnDetails' {} Maybe Text
a -> AwsEcsTaskDefinitionContainerDefinitionsDependsOnDetails
s {$sel:condition:AwsEcsTaskDefinitionContainerDefinitionsDependsOnDetails' :: Maybe Text
condition = Maybe Text
a} :: AwsEcsTaskDefinitionContainerDefinitionsDependsOnDetails)

instance
  Core.FromJSON
    AwsEcsTaskDefinitionContainerDefinitionsDependsOnDetails
  where
  parseJSON :: Value
-> Parser AwsEcsTaskDefinitionContainerDefinitionsDependsOnDetails
parseJSON =
    String
-> (Object
    -> Parser AwsEcsTaskDefinitionContainerDefinitionsDependsOnDetails)
-> Value
-> Parser AwsEcsTaskDefinitionContainerDefinitionsDependsOnDetails
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"AwsEcsTaskDefinitionContainerDefinitionsDependsOnDetails"
      ( \Object
x ->
          Maybe Text
-> Maybe Text
-> AwsEcsTaskDefinitionContainerDefinitionsDependsOnDetails
AwsEcsTaskDefinitionContainerDefinitionsDependsOnDetails'
            (Maybe Text
 -> Maybe Text
 -> AwsEcsTaskDefinitionContainerDefinitionsDependsOnDetails)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> AwsEcsTaskDefinitionContainerDefinitionsDependsOnDetails)
forall (f :: * -> *) a b. Functor 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
"ContainerName")
              Parser
  (Maybe Text
   -> AwsEcsTaskDefinitionContainerDefinitionsDependsOnDetails)
-> Parser (Maybe Text)
-> Parser AwsEcsTaskDefinitionContainerDefinitionsDependsOnDetails
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
"Condition")
      )

instance
  Prelude.Hashable
    AwsEcsTaskDefinitionContainerDefinitionsDependsOnDetails

instance
  Prelude.NFData
    AwsEcsTaskDefinitionContainerDefinitionsDependsOnDetails

instance
  Core.ToJSON
    AwsEcsTaskDefinitionContainerDefinitionsDependsOnDetails
  where
  toJSON :: AwsEcsTaskDefinitionContainerDefinitionsDependsOnDetails -> Value
toJSON
    AwsEcsTaskDefinitionContainerDefinitionsDependsOnDetails' {Maybe Text
condition :: Maybe Text
containerName :: Maybe Text
$sel:condition:AwsEcsTaskDefinitionContainerDefinitionsDependsOnDetails' :: AwsEcsTaskDefinitionContainerDefinitionsDependsOnDetails
-> Maybe Text
$sel:containerName:AwsEcsTaskDefinitionContainerDefinitionsDependsOnDetails' :: AwsEcsTaskDefinitionContainerDefinitionsDependsOnDetails
-> Maybe Text
..} =
      [Pair] -> Value
Core.object
        ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
            [ (Text
"ContainerName" 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
containerName,
              (Text
"Condition" 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
condition
            ]
        )