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