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