{-# 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 qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.GreengrassV2.Types.ComponentConfigurationUpdate
import Amazonka.GreengrassV2.Types.ComponentRunWith
import qualified Amazonka.Prelude as Prelude
data ComponentDeploymentSpecification = ComponentDeploymentSpecification'
{
ComponentDeploymentSpecification -> Maybe Text
componentVersion :: Prelude.Maybe Prelude.Text,
ComponentDeploymentSpecification
-> Maybe ComponentConfigurationUpdate
configurationUpdate :: Prelude.Maybe ComponentConfigurationUpdate,
ComponentDeploymentSpecification -> Maybe ComponentRunWith
runWith :: Prelude.Maybe ComponentRunWith
}
deriving (ComponentDeploymentSpecification
-> ComponentDeploymentSpecification -> Bool
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]
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
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.
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'
{ $sel:componentVersion:ComponentDeploymentSpecification' :: Maybe Text
componentVersion =
forall a. Maybe a
Prelude.Nothing,
$sel:configurationUpdate:ComponentDeploymentSpecification' :: Maybe ComponentConfigurationUpdate
configurationUpdate = forall a. Maybe a
Prelude.Nothing,
$sel:runWith:ComponentDeploymentSpecification' :: Maybe ComponentRunWith
runWith = forall a. Maybe a
Prelude.Nothing
}
componentDeploymentSpecification_componentVersion :: Lens.Lens' ComponentDeploymentSpecification (Prelude.Maybe Prelude.Text)
componentDeploymentSpecification_componentVersion :: Lens' ComponentDeploymentSpecification (Maybe Text)
componentDeploymentSpecification_componentVersion = 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_configurationUpdate :: Lens.Lens' ComponentDeploymentSpecification (Prelude.Maybe ComponentConfigurationUpdate)
componentDeploymentSpecification_configurationUpdate :: Lens'
ComponentDeploymentSpecification
(Maybe ComponentConfigurationUpdate)
componentDeploymentSpecification_configurationUpdate = 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)
componentDeploymentSpecification_runWith :: Lens.Lens' ComponentDeploymentSpecification (Prelude.Maybe ComponentRunWith)
componentDeploymentSpecification_runWith :: Lens' ComponentDeploymentSpecification (Maybe ComponentRunWith)
componentDeploymentSpecification_runWith = 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)
instance
Data.FromJSON
ComponentDeploymentSpecification
where
parseJSON :: Value -> Parser ComponentDeploymentSpecification
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"ComponentDeploymentSpecification"
( \Object
x ->
Maybe Text
-> Maybe ComponentConfigurationUpdate
-> Maybe ComponentRunWith
-> ComponentDeploymentSpecification
ComponentDeploymentSpecification'
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
"componentVersion")
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
"configurationUpdate")
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
"runWith")
)
instance
Prelude.Hashable
ComponentDeploymentSpecification
where
hashWithSalt :: Int -> ComponentDeploymentSpecification -> Int
hashWithSalt
Int
_salt
ComponentDeploymentSpecification' {Maybe Text
Maybe ComponentConfigurationUpdate
Maybe ComponentRunWith
runWith :: Maybe ComponentRunWith
configurationUpdate :: Maybe ComponentConfigurationUpdate
componentVersion :: Maybe Text
$sel:runWith:ComponentDeploymentSpecification' :: ComponentDeploymentSpecification -> Maybe ComponentRunWith
$sel:configurationUpdate:ComponentDeploymentSpecification' :: ComponentDeploymentSpecification
-> Maybe ComponentConfigurationUpdate
$sel:componentVersion:ComponentDeploymentSpecification' :: ComponentDeploymentSpecification -> Maybe Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
componentVersion
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ComponentConfigurationUpdate
configurationUpdate
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ComponentRunWith
runWith
instance
Prelude.NFData
ComponentDeploymentSpecification
where
rnf :: ComponentDeploymentSpecification -> ()
rnf ComponentDeploymentSpecification' {Maybe Text
Maybe ComponentConfigurationUpdate
Maybe ComponentRunWith
runWith :: Maybe ComponentRunWith
configurationUpdate :: Maybe ComponentConfigurationUpdate
componentVersion :: Maybe Text
$sel:runWith:ComponentDeploymentSpecification' :: ComponentDeploymentSpecification -> Maybe ComponentRunWith
$sel:configurationUpdate:ComponentDeploymentSpecification' :: ComponentDeploymentSpecification
-> Maybe ComponentConfigurationUpdate
$sel:componentVersion:ComponentDeploymentSpecification' :: ComponentDeploymentSpecification -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
componentVersion
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ComponentConfigurationUpdate
configurationUpdate
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ComponentRunWith
runWith
instance Data.ToJSON ComponentDeploymentSpecification where
toJSON :: ComponentDeploymentSpecification -> Value
toJSON ComponentDeploymentSpecification' {Maybe Text
Maybe ComponentConfigurationUpdate
Maybe ComponentRunWith
runWith :: Maybe ComponentRunWith
configurationUpdate :: Maybe ComponentConfigurationUpdate
componentVersion :: Maybe Text
$sel:runWith:ComponentDeploymentSpecification' :: ComponentDeploymentSpecification -> Maybe ComponentRunWith
$sel:configurationUpdate:ComponentDeploymentSpecification' :: ComponentDeploymentSpecification
-> Maybe ComponentConfigurationUpdate
$sel:componentVersion:ComponentDeploymentSpecification' :: ComponentDeploymentSpecification -> Maybe Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"componentVersion" 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 Text
componentVersion,
(Key
"configurationUpdate" 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 ComponentConfigurationUpdate
configurationUpdate,
(Key
"runWith" 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 ComponentRunWith
runWith
]
)