{-# 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 #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.LookoutVision.Types.GreengrassConfiguration
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
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

-- | Configuration information for the AWS IoT Greengrass component created
-- in a model packaging job. For more information, see
-- StartModelPackagingJob.
--
-- You can\'t specify a component with the same @ComponentName@ and
-- @Componentversion@ as an existing component with the same component name
-- and component version.
--
-- /See:/ 'newGreengrassConfiguration' smart constructor.
data GreengrassConfiguration = GreengrassConfiguration'
  { -- | Additional compiler options for the Greengrass component. Currently,
    -- only NVIDIA Graphics Processing Units (GPU) and CPU accelerators are
    -- supported. If you specify @TargetDevice@, don\'t specify
    -- @CompilerOptions@.
    --
    -- For more information, see /Compiler options/ in the Amazon Lookout for
    -- Vision Developer Guide.
    GreengrassConfiguration -> Maybe Text
compilerOptions :: Prelude.Maybe Prelude.Text,
    -- | A description for the AWS IoT Greengrass component.
    GreengrassConfiguration -> Maybe Text
componentDescription :: Prelude.Maybe Prelude.Text,
    -- | A Version for the AWS IoT Greengrass component. If you don\'t provide a
    -- value, a default value of @ @/@Model Version@/@.0.0@ is used.
    GreengrassConfiguration -> Maybe Text
componentVersion :: Prelude.Maybe Prelude.Text,
    -- | A set of tags (key-value pairs) that you want to attach to the AWS IoT
    -- Greengrass component.
    GreengrassConfiguration -> Maybe [Tag]
tags :: Prelude.Maybe [Tag],
    -- | The target device for the model. Currently the only supported value is
    -- @jetson_xavier@. If you specify @TargetDevice@, you can\'t specify
    -- @TargetPlatform@.
    GreengrassConfiguration -> Maybe TargetDevice
targetDevice :: Prelude.Maybe TargetDevice,
    -- | The target platform for the model. If you specify @TargetPlatform@, you
    -- can\'t specify @TargetDevice@.
    GreengrassConfiguration -> Maybe TargetPlatform
targetPlatform :: Prelude.Maybe TargetPlatform,
    -- | An S3 location in which Lookout for Vision stores the component
    -- artifacts.
    GreengrassConfiguration -> S3Location
s3OutputLocation :: S3Location,
    -- | A name for the AWS IoT Greengrass component.
    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)

-- |
-- Create a value of 'GreengrassConfiguration' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'compilerOptions', 'greengrassConfiguration_compilerOptions' - Additional compiler options for the Greengrass component. Currently,
-- only NVIDIA Graphics Processing Units (GPU) and CPU accelerators are
-- supported. If you specify @TargetDevice@, don\'t specify
-- @CompilerOptions@.
--
-- For more information, see /Compiler options/ in the Amazon Lookout for
-- Vision Developer Guide.
--
-- 'componentDescription', 'greengrassConfiguration_componentDescription' - A description for the AWS IoT Greengrass component.
--
-- 'componentVersion', 'greengrassConfiguration_componentVersion' - A Version for the AWS IoT Greengrass component. If you don\'t provide a
-- value, a default value of @ @/@Model Version@/@.0.0@ is used.
--
-- 'tags', 'greengrassConfiguration_tags' - A set of tags (key-value pairs) that you want to attach to the AWS IoT
-- Greengrass component.
--
-- 'targetDevice', 'greengrassConfiguration_targetDevice' - The target device for the model. Currently the only supported value is
-- @jetson_xavier@. If you specify @TargetDevice@, you can\'t specify
-- @TargetPlatform@.
--
-- 'targetPlatform', 'greengrassConfiguration_targetPlatform' - The target platform for the model. If you specify @TargetPlatform@, you
-- can\'t specify @TargetDevice@.
--
-- 's3OutputLocation', 'greengrassConfiguration_s3OutputLocation' - An S3 location in which Lookout for Vision stores the component
-- artifacts.
--
-- 'componentName', 'greengrassConfiguration_componentName' - A name for the AWS IoT Greengrass component.
newGreengrassConfiguration ::
  -- | 's3OutputLocation'
  S3Location ->
  -- | 'componentName'
  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_
      }

-- | Additional compiler options for the Greengrass component. Currently,
-- only NVIDIA Graphics Processing Units (GPU) and CPU accelerators are
-- supported. If you specify @TargetDevice@, don\'t specify
-- @CompilerOptions@.
--
-- For more information, see /Compiler options/ in the Amazon Lookout for
-- Vision Developer Guide.
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)

-- | A description for the AWS IoT Greengrass component.
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)

-- | A Version for the AWS IoT Greengrass component. If you don\'t provide a
-- value, a default value of @ @/@Model Version@/@.0.0@ is used.
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)

-- | A set of tags (key-value pairs) that you want to attach to the AWS IoT
-- Greengrass component.
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

-- | The target device for the model. Currently the only supported value is
-- @jetson_xavier@. If you specify @TargetDevice@, you can\'t specify
-- @TargetPlatform@.
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)

-- | The target platform for the model. If you specify @TargetPlatform@, you
-- can\'t specify @TargetDevice@.
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)

-- | An S3 location in which Lookout for Vision stores the component
-- artifacts.
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)

-- | A name for the AWS IoT Greengrass component.
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)
          ]
      )