{-# 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.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
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
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]
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
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. 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'
{ $sel:actionOnTimeout:DeploymentReadyOption' :: Maybe DeploymentReadyAction
actionOnTimeout =
forall a. Maybe a
Prelude.Nothing,
$sel:waitTimeInMinutes:DeploymentReadyOption' :: Maybe Int
waitTimeInMinutes = forall a. Maybe a
Prelude.Nothing
}
deploymentReadyOption_actionOnTimeout :: Lens.Lens' DeploymentReadyOption (Prelude.Maybe DeploymentReadyAction)
deploymentReadyOption_actionOnTimeout :: Lens' DeploymentReadyOption (Maybe DeploymentReadyAction)
deploymentReadyOption_actionOnTimeout = 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 :: Lens' DeploymentReadyOption (Maybe Int)
deploymentReadyOption_waitTimeInMinutes = 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 Data.FromJSON DeploymentReadyOption where
parseJSON :: Value -> Parser DeploymentReadyOption
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"DeploymentReadyOption"
( \Object
x ->
Maybe DeploymentReadyAction -> Maybe Int -> DeploymentReadyOption
DeploymentReadyOption'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"actionOnTimeout")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"waitTimeInMinutes")
)
instance Prelude.Hashable DeploymentReadyOption where
hashWithSalt :: Int -> DeploymentReadyOption -> Int
hashWithSalt Int
_salt DeploymentReadyOption' {Maybe Int
Maybe DeploymentReadyAction
waitTimeInMinutes :: Maybe Int
actionOnTimeout :: Maybe DeploymentReadyAction
$sel:waitTimeInMinutes:DeploymentReadyOption' :: DeploymentReadyOption -> Maybe Int
$sel:actionOnTimeout:DeploymentReadyOption' :: DeploymentReadyOption -> Maybe DeploymentReadyAction
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe DeploymentReadyAction
actionOnTimeout
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Int
waitTimeInMinutes
instance Prelude.NFData DeploymentReadyOption where
rnf :: DeploymentReadyOption -> ()
rnf DeploymentReadyOption' {Maybe Int
Maybe DeploymentReadyAction
waitTimeInMinutes :: Maybe Int
actionOnTimeout :: Maybe DeploymentReadyAction
$sel:waitTimeInMinutes:DeploymentReadyOption' :: DeploymentReadyOption -> Maybe Int
$sel:actionOnTimeout:DeploymentReadyOption' :: DeploymentReadyOption -> Maybe DeploymentReadyAction
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe DeploymentReadyAction
actionOnTimeout
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Int
waitTimeInMinutes
instance Data.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
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"actionOnTimeout" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe DeploymentReadyAction
actionOnTimeout,
(Key
"waitTimeInMinutes" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Int
waitTimeInMinutes
]
)