{-# 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.LookoutVision.Types.GreengrassConfiguration where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.LookoutVision.Types.S3Location
import Amazonka.LookoutVision.Types.Tag
import Amazonka.LookoutVision.Types.TargetDevice
import Amazonka.LookoutVision.Types.TargetPlatform
import qualified Amazonka.Prelude as Prelude
data GreengrassConfiguration = GreengrassConfiguration'
{
GreengrassConfiguration -> Maybe Text
compilerOptions :: Prelude.Maybe Prelude.Text,
GreengrassConfiguration -> Maybe Text
componentDescription :: Prelude.Maybe Prelude.Text,
GreengrassConfiguration -> Maybe Text
componentVersion :: Prelude.Maybe Prelude.Text,
GreengrassConfiguration -> Maybe [Tag]
tags :: Prelude.Maybe [Tag],
GreengrassConfiguration -> Maybe TargetDevice
targetDevice :: Prelude.Maybe TargetDevice,
GreengrassConfiguration -> Maybe TargetPlatform
targetPlatform :: Prelude.Maybe TargetPlatform,
GreengrassConfiguration -> S3Location
s3OutputLocation :: S3Location,
GreengrassConfiguration -> Text
componentName :: Prelude.Text
}
deriving (GreengrassConfiguration -> GreengrassConfiguration -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GreengrassConfiguration -> GreengrassConfiguration -> Bool
$c/= :: GreengrassConfiguration -> GreengrassConfiguration -> Bool
== :: GreengrassConfiguration -> GreengrassConfiguration -> Bool
$c== :: GreengrassConfiguration -> GreengrassConfiguration -> Bool
Prelude.Eq, ReadPrec [GreengrassConfiguration]
ReadPrec GreengrassConfiguration
Int -> ReadS GreengrassConfiguration
ReadS [GreengrassConfiguration]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GreengrassConfiguration]
$creadListPrec :: ReadPrec [GreengrassConfiguration]
readPrec :: ReadPrec GreengrassConfiguration
$creadPrec :: ReadPrec GreengrassConfiguration
readList :: ReadS [GreengrassConfiguration]
$creadList :: ReadS [GreengrassConfiguration]
readsPrec :: Int -> ReadS GreengrassConfiguration
$creadsPrec :: Int -> ReadS GreengrassConfiguration
Prelude.Read, Int -> GreengrassConfiguration -> ShowS
[GreengrassConfiguration] -> ShowS
GreengrassConfiguration -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GreengrassConfiguration] -> ShowS
$cshowList :: [GreengrassConfiguration] -> ShowS
show :: GreengrassConfiguration -> String
$cshow :: GreengrassConfiguration -> String
showsPrec :: Int -> GreengrassConfiguration -> ShowS
$cshowsPrec :: Int -> GreengrassConfiguration -> ShowS
Prelude.Show, forall x. Rep GreengrassConfiguration x -> GreengrassConfiguration
forall x. GreengrassConfiguration -> Rep GreengrassConfiguration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GreengrassConfiguration x -> GreengrassConfiguration
$cfrom :: forall x. GreengrassConfiguration -> Rep GreengrassConfiguration x
Prelude.Generic)
newGreengrassConfiguration ::
S3Location ->
Prelude.Text ->
GreengrassConfiguration
newGreengrassConfiguration :: S3Location -> Text -> GreengrassConfiguration
newGreengrassConfiguration
S3Location
pS3OutputLocation_
Text
pComponentName_ =
GreengrassConfiguration'
{ $sel:compilerOptions:GreengrassConfiguration' :: Maybe Text
compilerOptions =
forall a. Maybe a
Prelude.Nothing,
$sel:componentDescription:GreengrassConfiguration' :: Maybe Text
componentDescription = forall a. Maybe a
Prelude.Nothing,
$sel:componentVersion:GreengrassConfiguration' :: Maybe Text
componentVersion = forall a. Maybe a
Prelude.Nothing,
$sel:tags:GreengrassConfiguration' :: Maybe [Tag]
tags = forall a. Maybe a
Prelude.Nothing,
$sel:targetDevice:GreengrassConfiguration' :: Maybe TargetDevice
targetDevice = forall a. Maybe a
Prelude.Nothing,
$sel:targetPlatform:GreengrassConfiguration' :: Maybe TargetPlatform
targetPlatform = forall a. Maybe a
Prelude.Nothing,
$sel:s3OutputLocation:GreengrassConfiguration' :: S3Location
s3OutputLocation = S3Location
pS3OutputLocation_,
$sel:componentName:GreengrassConfiguration' :: Text
componentName = Text
pComponentName_
}
greengrassConfiguration_compilerOptions :: Lens.Lens' GreengrassConfiguration (Prelude.Maybe Prelude.Text)
greengrassConfiguration_compilerOptions :: Lens' GreengrassConfiguration (Maybe Text)
greengrassConfiguration_compilerOptions = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GreengrassConfiguration' {Maybe Text
compilerOptions :: Maybe Text
$sel:compilerOptions:GreengrassConfiguration' :: GreengrassConfiguration -> Maybe Text
compilerOptions} -> Maybe Text
compilerOptions) (\s :: GreengrassConfiguration
s@GreengrassConfiguration' {} Maybe Text
a -> GreengrassConfiguration
s {$sel:compilerOptions:GreengrassConfiguration' :: Maybe Text
compilerOptions = Maybe Text
a} :: GreengrassConfiguration)
greengrassConfiguration_componentDescription :: Lens.Lens' GreengrassConfiguration (Prelude.Maybe Prelude.Text)
greengrassConfiguration_componentDescription :: Lens' GreengrassConfiguration (Maybe Text)
greengrassConfiguration_componentDescription = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GreengrassConfiguration' {Maybe Text
componentDescription :: Maybe Text
$sel:componentDescription:GreengrassConfiguration' :: GreengrassConfiguration -> Maybe Text
componentDescription} -> Maybe Text
componentDescription) (\s :: GreengrassConfiguration
s@GreengrassConfiguration' {} Maybe Text
a -> GreengrassConfiguration
s {$sel:componentDescription:GreengrassConfiguration' :: Maybe Text
componentDescription = Maybe Text
a} :: GreengrassConfiguration)
greengrassConfiguration_componentVersion :: Lens.Lens' GreengrassConfiguration (Prelude.Maybe Prelude.Text)
greengrassConfiguration_componentVersion :: Lens' GreengrassConfiguration (Maybe Text)
greengrassConfiguration_componentVersion = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GreengrassConfiguration' {Maybe Text
componentVersion :: Maybe Text
$sel:componentVersion:GreengrassConfiguration' :: GreengrassConfiguration -> Maybe Text
componentVersion} -> Maybe Text
componentVersion) (\s :: GreengrassConfiguration
s@GreengrassConfiguration' {} Maybe Text
a -> GreengrassConfiguration
s {$sel:componentVersion:GreengrassConfiguration' :: Maybe Text
componentVersion = Maybe Text
a} :: GreengrassConfiguration)
greengrassConfiguration_tags :: Lens.Lens' GreengrassConfiguration (Prelude.Maybe [Tag])
greengrassConfiguration_tags :: Lens' GreengrassConfiguration (Maybe [Tag])
greengrassConfiguration_tags = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GreengrassConfiguration' {Maybe [Tag]
tags :: Maybe [Tag]
$sel:tags:GreengrassConfiguration' :: GreengrassConfiguration -> Maybe [Tag]
tags} -> Maybe [Tag]
tags) (\s :: GreengrassConfiguration
s@GreengrassConfiguration' {} Maybe [Tag]
a -> GreengrassConfiguration
s {$sel:tags:GreengrassConfiguration' :: Maybe [Tag]
tags = Maybe [Tag]
a} :: GreengrassConfiguration) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
greengrassConfiguration_targetDevice :: Lens.Lens' GreengrassConfiguration (Prelude.Maybe TargetDevice)
greengrassConfiguration_targetDevice :: Lens' GreengrassConfiguration (Maybe TargetDevice)
greengrassConfiguration_targetDevice = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GreengrassConfiguration' {Maybe TargetDevice
targetDevice :: Maybe TargetDevice
$sel:targetDevice:GreengrassConfiguration' :: GreengrassConfiguration -> Maybe TargetDevice
targetDevice} -> Maybe TargetDevice
targetDevice) (\s :: GreengrassConfiguration
s@GreengrassConfiguration' {} Maybe TargetDevice
a -> GreengrassConfiguration
s {$sel:targetDevice:GreengrassConfiguration' :: Maybe TargetDevice
targetDevice = Maybe TargetDevice
a} :: GreengrassConfiguration)
greengrassConfiguration_targetPlatform :: Lens.Lens' GreengrassConfiguration (Prelude.Maybe TargetPlatform)
greengrassConfiguration_targetPlatform :: Lens' GreengrassConfiguration (Maybe TargetPlatform)
greengrassConfiguration_targetPlatform = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GreengrassConfiguration' {Maybe TargetPlatform
targetPlatform :: Maybe TargetPlatform
$sel:targetPlatform:GreengrassConfiguration' :: GreengrassConfiguration -> Maybe TargetPlatform
targetPlatform} -> Maybe TargetPlatform
targetPlatform) (\s :: GreengrassConfiguration
s@GreengrassConfiguration' {} Maybe TargetPlatform
a -> GreengrassConfiguration
s {$sel:targetPlatform:GreengrassConfiguration' :: Maybe TargetPlatform
targetPlatform = Maybe TargetPlatform
a} :: GreengrassConfiguration)
greengrassConfiguration_s3OutputLocation :: Lens.Lens' GreengrassConfiguration S3Location
greengrassConfiguration_s3OutputLocation :: Lens' GreengrassConfiguration S3Location
greengrassConfiguration_s3OutputLocation = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GreengrassConfiguration' {S3Location
s3OutputLocation :: S3Location
$sel:s3OutputLocation:GreengrassConfiguration' :: GreengrassConfiguration -> S3Location
s3OutputLocation} -> S3Location
s3OutputLocation) (\s :: GreengrassConfiguration
s@GreengrassConfiguration' {} S3Location
a -> GreengrassConfiguration
s {$sel:s3OutputLocation:GreengrassConfiguration' :: S3Location
s3OutputLocation = S3Location
a} :: GreengrassConfiguration)
greengrassConfiguration_componentName :: Lens.Lens' GreengrassConfiguration Prelude.Text
greengrassConfiguration_componentName :: Lens' GreengrassConfiguration Text
greengrassConfiguration_componentName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GreengrassConfiguration' {Text
componentName :: Text
$sel:componentName:GreengrassConfiguration' :: GreengrassConfiguration -> Text
componentName} -> Text
componentName) (\s :: GreengrassConfiguration
s@GreengrassConfiguration' {} Text
a -> GreengrassConfiguration
s {$sel:componentName:GreengrassConfiguration' :: Text
componentName = Text
a} :: GreengrassConfiguration)
instance Data.FromJSON GreengrassConfiguration where
parseJSON :: Value -> Parser GreengrassConfiguration
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"GreengrassConfiguration"
( \Object
x ->
Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe [Tag]
-> Maybe TargetDevice
-> Maybe TargetPlatform
-> S3Location
-> Text
-> GreengrassConfiguration
GreengrassConfiguration'
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
"CompilerOptions")
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
"ComponentDescription")
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
"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
"Tags" forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty)
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
"TargetDevice")
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
"TargetPlatform")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"S3OutputLocation")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"ComponentName")
)
instance Prelude.Hashable GreengrassConfiguration where
hashWithSalt :: Int -> GreengrassConfiguration -> Int
hashWithSalt Int
_salt GreengrassConfiguration' {Maybe [Tag]
Maybe Text
Maybe TargetDevice
Maybe TargetPlatform
Text
S3Location
componentName :: Text
s3OutputLocation :: S3Location
targetPlatform :: Maybe TargetPlatform
targetDevice :: Maybe TargetDevice
tags :: Maybe [Tag]
componentVersion :: Maybe Text
componentDescription :: Maybe Text
compilerOptions :: Maybe Text
$sel:componentName:GreengrassConfiguration' :: GreengrassConfiguration -> Text
$sel:s3OutputLocation:GreengrassConfiguration' :: GreengrassConfiguration -> S3Location
$sel:targetPlatform:GreengrassConfiguration' :: GreengrassConfiguration -> Maybe TargetPlatform
$sel:targetDevice:GreengrassConfiguration' :: GreengrassConfiguration -> Maybe TargetDevice
$sel:tags:GreengrassConfiguration' :: GreengrassConfiguration -> Maybe [Tag]
$sel:componentVersion:GreengrassConfiguration' :: GreengrassConfiguration -> Maybe Text
$sel:componentDescription:GreengrassConfiguration' :: GreengrassConfiguration -> Maybe Text
$sel:compilerOptions:GreengrassConfiguration' :: GreengrassConfiguration -> Maybe Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
compilerOptions
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
componentDescription
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
componentVersion
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Tag]
tags
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe TargetDevice
targetDevice
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe TargetPlatform
targetPlatform
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` S3Location
s3OutputLocation
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
componentName
instance Prelude.NFData GreengrassConfiguration where
rnf :: GreengrassConfiguration -> ()
rnf GreengrassConfiguration' {Maybe [Tag]
Maybe Text
Maybe TargetDevice
Maybe TargetPlatform
Text
S3Location
componentName :: Text
s3OutputLocation :: S3Location
targetPlatform :: Maybe TargetPlatform
targetDevice :: Maybe TargetDevice
tags :: Maybe [Tag]
componentVersion :: Maybe Text
componentDescription :: Maybe Text
compilerOptions :: Maybe Text
$sel:componentName:GreengrassConfiguration' :: GreengrassConfiguration -> Text
$sel:s3OutputLocation:GreengrassConfiguration' :: GreengrassConfiguration -> S3Location
$sel:targetPlatform:GreengrassConfiguration' :: GreengrassConfiguration -> Maybe TargetPlatform
$sel:targetDevice:GreengrassConfiguration' :: GreengrassConfiguration -> Maybe TargetDevice
$sel:tags:GreengrassConfiguration' :: GreengrassConfiguration -> Maybe [Tag]
$sel:componentVersion:GreengrassConfiguration' :: GreengrassConfiguration -> Maybe Text
$sel:componentDescription:GreengrassConfiguration' :: GreengrassConfiguration -> Maybe Text
$sel:compilerOptions:GreengrassConfiguration' :: GreengrassConfiguration -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
compilerOptions
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
componentDescription
seq :: forall a b. a -> b -> b
`Prelude.seq` 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 [Tag]
tags
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe TargetDevice
targetDevice
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe TargetPlatform
targetPlatform
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf S3Location
s3OutputLocation
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
componentName
instance Data.ToJSON GreengrassConfiguration where
toJSON :: GreengrassConfiguration -> Value
toJSON GreengrassConfiguration' {Maybe [Tag]
Maybe Text
Maybe TargetDevice
Maybe TargetPlatform
Text
S3Location
componentName :: Text
s3OutputLocation :: S3Location
targetPlatform :: Maybe TargetPlatform
targetDevice :: Maybe TargetDevice
tags :: Maybe [Tag]
componentVersion :: Maybe Text
componentDescription :: Maybe Text
compilerOptions :: Maybe Text
$sel:componentName:GreengrassConfiguration' :: GreengrassConfiguration -> Text
$sel:s3OutputLocation:GreengrassConfiguration' :: GreengrassConfiguration -> S3Location
$sel:targetPlatform:GreengrassConfiguration' :: GreengrassConfiguration -> Maybe TargetPlatform
$sel:targetDevice:GreengrassConfiguration' :: GreengrassConfiguration -> Maybe TargetDevice
$sel:tags:GreengrassConfiguration' :: GreengrassConfiguration -> Maybe [Tag]
$sel:componentVersion:GreengrassConfiguration' :: GreengrassConfiguration -> Maybe Text
$sel:componentDescription:GreengrassConfiguration' :: GreengrassConfiguration -> Maybe Text
$sel:compilerOptions:GreengrassConfiguration' :: GreengrassConfiguration -> Maybe Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"CompilerOptions" 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
compilerOptions,
(Key
"ComponentDescription" 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
componentDescription,
(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
"Tags" 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 [Tag]
tags,
(Key
"TargetDevice" 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 TargetDevice
targetDevice,
(Key
"TargetPlatform" 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 TargetPlatform
targetPlatform,
forall a. a -> Maybe a
Prelude.Just
(Key
"S3OutputLocation" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= S3Location
s3OutputLocation),
forall a. a -> Maybe a
Prelude.Just
(Key
"ComponentName" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
componentName)
]
)