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