{-# 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.ECS.Types.DeploymentController where
import qualified Amazonka.Core as Core
import Amazonka.ECS.Types.DeploymentControllerType
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data DeploymentController = DeploymentController'
{
DeploymentController -> DeploymentControllerType
type' :: DeploymentControllerType
}
deriving (DeploymentController -> DeploymentController -> Bool
(DeploymentController -> DeploymentController -> Bool)
-> (DeploymentController -> DeploymentController -> Bool)
-> Eq DeploymentController
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeploymentController -> DeploymentController -> Bool
$c/= :: DeploymentController -> DeploymentController -> Bool
== :: DeploymentController -> DeploymentController -> Bool
$c== :: DeploymentController -> DeploymentController -> Bool
Prelude.Eq, ReadPrec [DeploymentController]
ReadPrec DeploymentController
Int -> ReadS DeploymentController
ReadS [DeploymentController]
(Int -> ReadS DeploymentController)
-> ReadS [DeploymentController]
-> ReadPrec DeploymentController
-> ReadPrec [DeploymentController]
-> Read DeploymentController
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeploymentController]
$creadListPrec :: ReadPrec [DeploymentController]
readPrec :: ReadPrec DeploymentController
$creadPrec :: ReadPrec DeploymentController
readList :: ReadS [DeploymentController]
$creadList :: ReadS [DeploymentController]
readsPrec :: Int -> ReadS DeploymentController
$creadsPrec :: Int -> ReadS DeploymentController
Prelude.Read, Int -> DeploymentController -> ShowS
[DeploymentController] -> ShowS
DeploymentController -> String
(Int -> DeploymentController -> ShowS)
-> (DeploymentController -> String)
-> ([DeploymentController] -> ShowS)
-> Show DeploymentController
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeploymentController] -> ShowS
$cshowList :: [DeploymentController] -> ShowS
show :: DeploymentController -> String
$cshow :: DeploymentController -> String
showsPrec :: Int -> DeploymentController -> ShowS
$cshowsPrec :: Int -> DeploymentController -> ShowS
Prelude.Show, (forall x. DeploymentController -> Rep DeploymentController x)
-> (forall x. Rep DeploymentController x -> DeploymentController)
-> Generic DeploymentController
forall x. Rep DeploymentController x -> DeploymentController
forall x. DeploymentController -> Rep DeploymentController x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeploymentController x -> DeploymentController
$cfrom :: forall x. DeploymentController -> Rep DeploymentController x
Prelude.Generic)
newDeploymentController ::
DeploymentControllerType ->
DeploymentController
newDeploymentController :: DeploymentControllerType -> DeploymentController
newDeploymentController DeploymentControllerType
pType_ =
DeploymentController' :: DeploymentControllerType -> DeploymentController
DeploymentController' {$sel:type':DeploymentController' :: DeploymentControllerType
type' = DeploymentControllerType
pType_}
deploymentController_type :: Lens.Lens' DeploymentController DeploymentControllerType
deploymentController_type :: (DeploymentControllerType -> f DeploymentControllerType)
-> DeploymentController -> f DeploymentController
deploymentController_type = (DeploymentController -> DeploymentControllerType)
-> (DeploymentController
-> DeploymentControllerType -> DeploymentController)
-> Lens
DeploymentController
DeploymentController
DeploymentControllerType
DeploymentControllerType
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeploymentController' {DeploymentControllerType
type' :: DeploymentControllerType
$sel:type':DeploymentController' :: DeploymentController -> DeploymentControllerType
type'} -> DeploymentControllerType
type') (\s :: DeploymentController
s@DeploymentController' {} DeploymentControllerType
a -> DeploymentController
s {$sel:type':DeploymentController' :: DeploymentControllerType
type' = DeploymentControllerType
a} :: DeploymentController)
instance Core.FromJSON DeploymentController where
parseJSON :: Value -> Parser DeploymentController
parseJSON =
String
-> (Object -> Parser DeploymentController)
-> Value
-> Parser DeploymentController
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"DeploymentController"
( \Object
x ->
DeploymentControllerType -> DeploymentController
DeploymentController' (DeploymentControllerType -> DeploymentController)
-> Parser DeploymentControllerType -> Parser DeploymentController
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser DeploymentControllerType
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"type")
)
instance Prelude.Hashable DeploymentController
instance Prelude.NFData DeploymentController
instance Core.ToJSON DeploymentController where
toJSON :: DeploymentController -> Value
toJSON DeploymentController' {DeploymentControllerType
type' :: DeploymentControllerType
$sel:type':DeploymentController' :: DeploymentController -> DeploymentControllerType
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"type" Text -> DeploymentControllerType -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= DeploymentControllerType
type')]
)