{-# 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.IoTThingsGraph.Types.SystemTemplateDescription
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.IoTThingsGraph.Types.SystemTemplateDescription where

import qualified Amazonka.Core as Core
import Amazonka.IoTThingsGraph.Types.DefinitionDocument
import Amazonka.IoTThingsGraph.Types.SystemTemplateSummary
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | An object that contains a system\'s definition document and summary
-- information.
--
-- /See:/ 'newSystemTemplateDescription' smart constructor.
data SystemTemplateDescription = SystemTemplateDescription'
  { -- | An object that contains summary information about a system.
    SystemTemplateDescription -> Maybe SystemTemplateSummary
summary :: Prelude.Maybe SystemTemplateSummary,
    -- | The definition document of a system.
    SystemTemplateDescription -> Maybe DefinitionDocument
definition :: Prelude.Maybe DefinitionDocument,
    -- | The namespace version against which the system was validated. Use this
    -- value in your system instance.
    SystemTemplateDescription -> Maybe Integer
validatedNamespaceVersion :: Prelude.Maybe Prelude.Integer
  }
  deriving (SystemTemplateDescription -> SystemTemplateDescription -> Bool
(SystemTemplateDescription -> SystemTemplateDescription -> Bool)
-> (SystemTemplateDescription -> SystemTemplateDescription -> Bool)
-> Eq SystemTemplateDescription
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SystemTemplateDescription -> SystemTemplateDescription -> Bool
$c/= :: SystemTemplateDescription -> SystemTemplateDescription -> Bool
== :: SystemTemplateDescription -> SystemTemplateDescription -> Bool
$c== :: SystemTemplateDescription -> SystemTemplateDescription -> Bool
Prelude.Eq, ReadPrec [SystemTemplateDescription]
ReadPrec SystemTemplateDescription
Int -> ReadS SystemTemplateDescription
ReadS [SystemTemplateDescription]
(Int -> ReadS SystemTemplateDescription)
-> ReadS [SystemTemplateDescription]
-> ReadPrec SystemTemplateDescription
-> ReadPrec [SystemTemplateDescription]
-> Read SystemTemplateDescription
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SystemTemplateDescription]
$creadListPrec :: ReadPrec [SystemTemplateDescription]
readPrec :: ReadPrec SystemTemplateDescription
$creadPrec :: ReadPrec SystemTemplateDescription
readList :: ReadS [SystemTemplateDescription]
$creadList :: ReadS [SystemTemplateDescription]
readsPrec :: Int -> ReadS SystemTemplateDescription
$creadsPrec :: Int -> ReadS SystemTemplateDescription
Prelude.Read, Int -> SystemTemplateDescription -> ShowS
[SystemTemplateDescription] -> ShowS
SystemTemplateDescription -> String
(Int -> SystemTemplateDescription -> ShowS)
-> (SystemTemplateDescription -> String)
-> ([SystemTemplateDescription] -> ShowS)
-> Show SystemTemplateDescription
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SystemTemplateDescription] -> ShowS
$cshowList :: [SystemTemplateDescription] -> ShowS
show :: SystemTemplateDescription -> String
$cshow :: SystemTemplateDescription -> String
showsPrec :: Int -> SystemTemplateDescription -> ShowS
$cshowsPrec :: Int -> SystemTemplateDescription -> ShowS
Prelude.Show, (forall x.
 SystemTemplateDescription -> Rep SystemTemplateDescription x)
-> (forall x.
    Rep SystemTemplateDescription x -> SystemTemplateDescription)
-> Generic SystemTemplateDescription
forall x.
Rep SystemTemplateDescription x -> SystemTemplateDescription
forall x.
SystemTemplateDescription -> Rep SystemTemplateDescription x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep SystemTemplateDescription x -> SystemTemplateDescription
$cfrom :: forall x.
SystemTemplateDescription -> Rep SystemTemplateDescription x
Prelude.Generic)

-- |
-- Create a value of 'SystemTemplateDescription' 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:
--
-- 'summary', 'systemTemplateDescription_summary' - An object that contains summary information about a system.
--
-- 'definition', 'systemTemplateDescription_definition' - The definition document of a system.
--
-- 'validatedNamespaceVersion', 'systemTemplateDescription_validatedNamespaceVersion' - The namespace version against which the system was validated. Use this
-- value in your system instance.
newSystemTemplateDescription ::
  SystemTemplateDescription
newSystemTemplateDescription :: SystemTemplateDescription
newSystemTemplateDescription =
  SystemTemplateDescription' :: Maybe SystemTemplateSummary
-> Maybe DefinitionDocument
-> Maybe Integer
-> SystemTemplateDescription
SystemTemplateDescription'
    { $sel:summary:SystemTemplateDescription' :: Maybe SystemTemplateSummary
summary =
        Maybe SystemTemplateSummary
forall a. Maybe a
Prelude.Nothing,
      $sel:definition:SystemTemplateDescription' :: Maybe DefinitionDocument
definition = Maybe DefinitionDocument
forall a. Maybe a
Prelude.Nothing,
      $sel:validatedNamespaceVersion:SystemTemplateDescription' :: Maybe Integer
validatedNamespaceVersion = Maybe Integer
forall a. Maybe a
Prelude.Nothing
    }

-- | An object that contains summary information about a system.
systemTemplateDescription_summary :: Lens.Lens' SystemTemplateDescription (Prelude.Maybe SystemTemplateSummary)
systemTemplateDescription_summary :: (Maybe SystemTemplateSummary -> f (Maybe SystemTemplateSummary))
-> SystemTemplateDescription -> f SystemTemplateDescription
systemTemplateDescription_summary = (SystemTemplateDescription -> Maybe SystemTemplateSummary)
-> (SystemTemplateDescription
    -> Maybe SystemTemplateSummary -> SystemTemplateDescription)
-> Lens
     SystemTemplateDescription
     SystemTemplateDescription
     (Maybe SystemTemplateSummary)
     (Maybe SystemTemplateSummary)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SystemTemplateDescription' {Maybe SystemTemplateSummary
summary :: Maybe SystemTemplateSummary
$sel:summary:SystemTemplateDescription' :: SystemTemplateDescription -> Maybe SystemTemplateSummary
summary} -> Maybe SystemTemplateSummary
summary) (\s :: SystemTemplateDescription
s@SystemTemplateDescription' {} Maybe SystemTemplateSummary
a -> SystemTemplateDescription
s {$sel:summary:SystemTemplateDescription' :: Maybe SystemTemplateSummary
summary = Maybe SystemTemplateSummary
a} :: SystemTemplateDescription)

-- | The definition document of a system.
systemTemplateDescription_definition :: Lens.Lens' SystemTemplateDescription (Prelude.Maybe DefinitionDocument)
systemTemplateDescription_definition :: (Maybe DefinitionDocument -> f (Maybe DefinitionDocument))
-> SystemTemplateDescription -> f SystemTemplateDescription
systemTemplateDescription_definition = (SystemTemplateDescription -> Maybe DefinitionDocument)
-> (SystemTemplateDescription
    -> Maybe DefinitionDocument -> SystemTemplateDescription)
-> Lens
     SystemTemplateDescription
     SystemTemplateDescription
     (Maybe DefinitionDocument)
     (Maybe DefinitionDocument)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SystemTemplateDescription' {Maybe DefinitionDocument
definition :: Maybe DefinitionDocument
$sel:definition:SystemTemplateDescription' :: SystemTemplateDescription -> Maybe DefinitionDocument
definition} -> Maybe DefinitionDocument
definition) (\s :: SystemTemplateDescription
s@SystemTemplateDescription' {} Maybe DefinitionDocument
a -> SystemTemplateDescription
s {$sel:definition:SystemTemplateDescription' :: Maybe DefinitionDocument
definition = Maybe DefinitionDocument
a} :: SystemTemplateDescription)

-- | The namespace version against which the system was validated. Use this
-- value in your system instance.
systemTemplateDescription_validatedNamespaceVersion :: Lens.Lens' SystemTemplateDescription (Prelude.Maybe Prelude.Integer)
systemTemplateDescription_validatedNamespaceVersion :: (Maybe Integer -> f (Maybe Integer))
-> SystemTemplateDescription -> f SystemTemplateDescription
systemTemplateDescription_validatedNamespaceVersion = (SystemTemplateDescription -> Maybe Integer)
-> (SystemTemplateDescription
    -> Maybe Integer -> SystemTemplateDescription)
-> Lens
     SystemTemplateDescription
     SystemTemplateDescription
     (Maybe Integer)
     (Maybe Integer)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SystemTemplateDescription' {Maybe Integer
validatedNamespaceVersion :: Maybe Integer
$sel:validatedNamespaceVersion:SystemTemplateDescription' :: SystemTemplateDescription -> Maybe Integer
validatedNamespaceVersion} -> Maybe Integer
validatedNamespaceVersion) (\s :: SystemTemplateDescription
s@SystemTemplateDescription' {} Maybe Integer
a -> SystemTemplateDescription
s {$sel:validatedNamespaceVersion:SystemTemplateDescription' :: Maybe Integer
validatedNamespaceVersion = Maybe Integer
a} :: SystemTemplateDescription)

instance Core.FromJSON SystemTemplateDescription where
  parseJSON :: Value -> Parser SystemTemplateDescription
parseJSON =
    String
-> (Object -> Parser SystemTemplateDescription)
-> Value
-> Parser SystemTemplateDescription
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"SystemTemplateDescription"
      ( \Object
x ->
          Maybe SystemTemplateSummary
-> Maybe DefinitionDocument
-> Maybe Integer
-> SystemTemplateDescription
SystemTemplateDescription'
            (Maybe SystemTemplateSummary
 -> Maybe DefinitionDocument
 -> Maybe Integer
 -> SystemTemplateDescription)
-> Parser (Maybe SystemTemplateSummary)
-> Parser
     (Maybe DefinitionDocument
      -> Maybe Integer -> SystemTemplateDescription)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe SystemTemplateSummary)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"summary")
            Parser
  (Maybe DefinitionDocument
   -> Maybe Integer -> SystemTemplateDescription)
-> Parser (Maybe DefinitionDocument)
-> Parser (Maybe Integer -> SystemTemplateDescription)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe DefinitionDocument)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"definition")
            Parser (Maybe Integer -> SystemTemplateDescription)
-> Parser (Maybe Integer) -> Parser SystemTemplateDescription
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Integer)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"validatedNamespaceVersion")
      )

instance Prelude.Hashable SystemTemplateDescription

instance Prelude.NFData SystemTemplateDescription