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