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