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