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

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

-- | Information about the deployment controller type that the service uses.
--
-- /See:/ 'newAwsEcsServiceDeploymentControllerDetails' smart constructor.
data AwsEcsServiceDeploymentControllerDetails = AwsEcsServiceDeploymentControllerDetails'
  { -- | The rolling update (@ECS@) deployment type replaces the current running
    -- version of the container with the latest version.
    --
    -- The blue\/green (@CODE_DEPLOY@) deployment type uses the blue\/green
    -- deployment model that is powered by CodeDeploy. This deployment model a
    -- new deployment of a service can be verified before production traffic is
    -- sent to it.
    --
    -- The external (@EXTERNAL@) deployment type allows the use of any
    -- third-party deployment controller for full control over the deployment
    -- process for an Amazon ECS service.
    --
    -- Valid values: @ECS@ | @CODE_DEPLOY@ | @EXTERNAL@
    AwsEcsServiceDeploymentControllerDetails -> Maybe Text
type' :: Prelude.Maybe Prelude.Text
  }
  deriving (AwsEcsServiceDeploymentControllerDetails
-> AwsEcsServiceDeploymentControllerDetails -> Bool
(AwsEcsServiceDeploymentControllerDetails
 -> AwsEcsServiceDeploymentControllerDetails -> Bool)
-> (AwsEcsServiceDeploymentControllerDetails
    -> AwsEcsServiceDeploymentControllerDetails -> Bool)
-> Eq AwsEcsServiceDeploymentControllerDetails
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AwsEcsServiceDeploymentControllerDetails
-> AwsEcsServiceDeploymentControllerDetails -> Bool
$c/= :: AwsEcsServiceDeploymentControllerDetails
-> AwsEcsServiceDeploymentControllerDetails -> Bool
== :: AwsEcsServiceDeploymentControllerDetails
-> AwsEcsServiceDeploymentControllerDetails -> Bool
$c== :: AwsEcsServiceDeploymentControllerDetails
-> AwsEcsServiceDeploymentControllerDetails -> Bool
Prelude.Eq, ReadPrec [AwsEcsServiceDeploymentControllerDetails]
ReadPrec AwsEcsServiceDeploymentControllerDetails
Int -> ReadS AwsEcsServiceDeploymentControllerDetails
ReadS [AwsEcsServiceDeploymentControllerDetails]
(Int -> ReadS AwsEcsServiceDeploymentControllerDetails)
-> ReadS [AwsEcsServiceDeploymentControllerDetails]
-> ReadPrec AwsEcsServiceDeploymentControllerDetails
-> ReadPrec [AwsEcsServiceDeploymentControllerDetails]
-> Read AwsEcsServiceDeploymentControllerDetails
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AwsEcsServiceDeploymentControllerDetails]
$creadListPrec :: ReadPrec [AwsEcsServiceDeploymentControllerDetails]
readPrec :: ReadPrec AwsEcsServiceDeploymentControllerDetails
$creadPrec :: ReadPrec AwsEcsServiceDeploymentControllerDetails
readList :: ReadS [AwsEcsServiceDeploymentControllerDetails]
$creadList :: ReadS [AwsEcsServiceDeploymentControllerDetails]
readsPrec :: Int -> ReadS AwsEcsServiceDeploymentControllerDetails
$creadsPrec :: Int -> ReadS AwsEcsServiceDeploymentControllerDetails
Prelude.Read, Int -> AwsEcsServiceDeploymentControllerDetails -> ShowS
[AwsEcsServiceDeploymentControllerDetails] -> ShowS
AwsEcsServiceDeploymentControllerDetails -> String
(Int -> AwsEcsServiceDeploymentControllerDetails -> ShowS)
-> (AwsEcsServiceDeploymentControllerDetails -> String)
-> ([AwsEcsServiceDeploymentControllerDetails] -> ShowS)
-> Show AwsEcsServiceDeploymentControllerDetails
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AwsEcsServiceDeploymentControllerDetails] -> ShowS
$cshowList :: [AwsEcsServiceDeploymentControllerDetails] -> ShowS
show :: AwsEcsServiceDeploymentControllerDetails -> String
$cshow :: AwsEcsServiceDeploymentControllerDetails -> String
showsPrec :: Int -> AwsEcsServiceDeploymentControllerDetails -> ShowS
$cshowsPrec :: Int -> AwsEcsServiceDeploymentControllerDetails -> ShowS
Prelude.Show, (forall x.
 AwsEcsServiceDeploymentControllerDetails
 -> Rep AwsEcsServiceDeploymentControllerDetails x)
-> (forall x.
    Rep AwsEcsServiceDeploymentControllerDetails x
    -> AwsEcsServiceDeploymentControllerDetails)
-> Generic AwsEcsServiceDeploymentControllerDetails
forall x.
Rep AwsEcsServiceDeploymentControllerDetails x
-> AwsEcsServiceDeploymentControllerDetails
forall x.
AwsEcsServiceDeploymentControllerDetails
-> Rep AwsEcsServiceDeploymentControllerDetails x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep AwsEcsServiceDeploymentControllerDetails x
-> AwsEcsServiceDeploymentControllerDetails
$cfrom :: forall x.
AwsEcsServiceDeploymentControllerDetails
-> Rep AwsEcsServiceDeploymentControllerDetails x
Prelude.Generic)

-- |
-- Create a value of 'AwsEcsServiceDeploymentControllerDetails' 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:
--
-- 'type'', 'awsEcsServiceDeploymentControllerDetails_type' - The rolling update (@ECS@) deployment type replaces the current running
-- version of the container with the latest version.
--
-- The blue\/green (@CODE_DEPLOY@) deployment type uses the blue\/green
-- deployment model that is powered by CodeDeploy. This deployment model a
-- new deployment of a service can be verified before production traffic is
-- sent to it.
--
-- The external (@EXTERNAL@) deployment type allows the use of any
-- third-party deployment controller for full control over the deployment
-- process for an Amazon ECS service.
--
-- Valid values: @ECS@ | @CODE_DEPLOY@ | @EXTERNAL@
newAwsEcsServiceDeploymentControllerDetails ::
  AwsEcsServiceDeploymentControllerDetails
newAwsEcsServiceDeploymentControllerDetails :: AwsEcsServiceDeploymentControllerDetails
newAwsEcsServiceDeploymentControllerDetails =
  AwsEcsServiceDeploymentControllerDetails' :: Maybe Text -> AwsEcsServiceDeploymentControllerDetails
AwsEcsServiceDeploymentControllerDetails'
    { $sel:type':AwsEcsServiceDeploymentControllerDetails' :: Maybe Text
type' =
        Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | The rolling update (@ECS@) deployment type replaces the current running
-- version of the container with the latest version.
--
-- The blue\/green (@CODE_DEPLOY@) deployment type uses the blue\/green
-- deployment model that is powered by CodeDeploy. This deployment model a
-- new deployment of a service can be verified before production traffic is
-- sent to it.
--
-- The external (@EXTERNAL@) deployment type allows the use of any
-- third-party deployment controller for full control over the deployment
-- process for an Amazon ECS service.
--
-- Valid values: @ECS@ | @CODE_DEPLOY@ | @EXTERNAL@
awsEcsServiceDeploymentControllerDetails_type :: Lens.Lens' AwsEcsServiceDeploymentControllerDetails (Prelude.Maybe Prelude.Text)
awsEcsServiceDeploymentControllerDetails_type :: (Maybe Text -> f (Maybe Text))
-> AwsEcsServiceDeploymentControllerDetails
-> f AwsEcsServiceDeploymentControllerDetails
awsEcsServiceDeploymentControllerDetails_type = (AwsEcsServiceDeploymentControllerDetails -> Maybe Text)
-> (AwsEcsServiceDeploymentControllerDetails
    -> Maybe Text -> AwsEcsServiceDeploymentControllerDetails)
-> Lens
     AwsEcsServiceDeploymentControllerDetails
     AwsEcsServiceDeploymentControllerDetails
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AwsEcsServiceDeploymentControllerDetails' {Maybe Text
type' :: Maybe Text
$sel:type':AwsEcsServiceDeploymentControllerDetails' :: AwsEcsServiceDeploymentControllerDetails -> Maybe Text
type'} -> Maybe Text
type') (\s :: AwsEcsServiceDeploymentControllerDetails
s@AwsEcsServiceDeploymentControllerDetails' {} Maybe Text
a -> AwsEcsServiceDeploymentControllerDetails
s {$sel:type':AwsEcsServiceDeploymentControllerDetails' :: Maybe Text
type' = Maybe Text
a} :: AwsEcsServiceDeploymentControllerDetails)

instance
  Core.FromJSON
    AwsEcsServiceDeploymentControllerDetails
  where
  parseJSON :: Value -> Parser AwsEcsServiceDeploymentControllerDetails
parseJSON =
    String
-> (Object -> Parser AwsEcsServiceDeploymentControllerDetails)
-> Value
-> Parser AwsEcsServiceDeploymentControllerDetails
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"AwsEcsServiceDeploymentControllerDetails"
      ( \Object
x ->
          Maybe Text -> AwsEcsServiceDeploymentControllerDetails
AwsEcsServiceDeploymentControllerDetails'
            (Maybe Text -> AwsEcsServiceDeploymentControllerDetails)
-> Parser (Maybe Text)
-> Parser AwsEcsServiceDeploymentControllerDetails
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
"Type")
      )

instance
  Prelude.Hashable
    AwsEcsServiceDeploymentControllerDetails

instance
  Prelude.NFData
    AwsEcsServiceDeploymentControllerDetails

instance
  Core.ToJSON
    AwsEcsServiceDeploymentControllerDetails
  where
  toJSON :: AwsEcsServiceDeploymentControllerDetails -> Value
toJSON AwsEcsServiceDeploymentControllerDetails' {Maybe Text
type' :: Maybe Text
$sel:type':AwsEcsServiceDeploymentControllerDetails' :: AwsEcsServiceDeploymentControllerDetails -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [(Text
"Type" 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
type']
      )