{-# 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.SystemTemplateSummary
-- 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.SystemTemplateSummary where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | An object that contains information about a system.
--
-- /See:/ 'newSystemTemplateSummary' smart constructor.
data SystemTemplateSummary = SystemTemplateSummary'
  { -- | The ARN of the system.
    SystemTemplateSummary -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
    -- | The date when the system was created.
    SystemTemplateSummary -> Maybe POSIX
createdAt :: Prelude.Maybe Core.POSIX,
    -- | The revision number of the system.
    SystemTemplateSummary -> Maybe Integer
revisionNumber :: Prelude.Maybe Prelude.Integer,
    -- | The ID of the system.
    SystemTemplateSummary -> Maybe Text
id :: Prelude.Maybe Prelude.Text
  }
  deriving (SystemTemplateSummary -> SystemTemplateSummary -> Bool
(SystemTemplateSummary -> SystemTemplateSummary -> Bool)
-> (SystemTemplateSummary -> SystemTemplateSummary -> Bool)
-> Eq SystemTemplateSummary
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SystemTemplateSummary -> SystemTemplateSummary -> Bool
$c/= :: SystemTemplateSummary -> SystemTemplateSummary -> Bool
== :: SystemTemplateSummary -> SystemTemplateSummary -> Bool
$c== :: SystemTemplateSummary -> SystemTemplateSummary -> Bool
Prelude.Eq, ReadPrec [SystemTemplateSummary]
ReadPrec SystemTemplateSummary
Int -> ReadS SystemTemplateSummary
ReadS [SystemTemplateSummary]
(Int -> ReadS SystemTemplateSummary)
-> ReadS [SystemTemplateSummary]
-> ReadPrec SystemTemplateSummary
-> ReadPrec [SystemTemplateSummary]
-> Read SystemTemplateSummary
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SystemTemplateSummary]
$creadListPrec :: ReadPrec [SystemTemplateSummary]
readPrec :: ReadPrec SystemTemplateSummary
$creadPrec :: ReadPrec SystemTemplateSummary
readList :: ReadS [SystemTemplateSummary]
$creadList :: ReadS [SystemTemplateSummary]
readsPrec :: Int -> ReadS SystemTemplateSummary
$creadsPrec :: Int -> ReadS SystemTemplateSummary
Prelude.Read, Int -> SystemTemplateSummary -> ShowS
[SystemTemplateSummary] -> ShowS
SystemTemplateSummary -> String
(Int -> SystemTemplateSummary -> ShowS)
-> (SystemTemplateSummary -> String)
-> ([SystemTemplateSummary] -> ShowS)
-> Show SystemTemplateSummary
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SystemTemplateSummary] -> ShowS
$cshowList :: [SystemTemplateSummary] -> ShowS
show :: SystemTemplateSummary -> String
$cshow :: SystemTemplateSummary -> String
showsPrec :: Int -> SystemTemplateSummary -> ShowS
$cshowsPrec :: Int -> SystemTemplateSummary -> ShowS
Prelude.Show, (forall x. SystemTemplateSummary -> Rep SystemTemplateSummary x)
-> (forall x. Rep SystemTemplateSummary x -> SystemTemplateSummary)
-> Generic SystemTemplateSummary
forall x. Rep SystemTemplateSummary x -> SystemTemplateSummary
forall x. SystemTemplateSummary -> Rep SystemTemplateSummary x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SystemTemplateSummary x -> SystemTemplateSummary
$cfrom :: forall x. SystemTemplateSummary -> Rep SystemTemplateSummary x
Prelude.Generic)

-- |
-- Create a value of 'SystemTemplateSummary' 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:
--
-- 'arn', 'systemTemplateSummary_arn' - The ARN of the system.
--
-- 'createdAt', 'systemTemplateSummary_createdAt' - The date when the system was created.
--
-- 'revisionNumber', 'systemTemplateSummary_revisionNumber' - The revision number of the system.
--
-- 'id', 'systemTemplateSummary_id' - The ID of the system.
newSystemTemplateSummary ::
  SystemTemplateSummary
newSystemTemplateSummary :: SystemTemplateSummary
newSystemTemplateSummary =
  SystemTemplateSummary' :: Maybe Text
-> Maybe POSIX
-> Maybe Integer
-> Maybe Text
-> SystemTemplateSummary
SystemTemplateSummary'
    { $sel:arn:SystemTemplateSummary' :: Maybe Text
arn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:createdAt:SystemTemplateSummary' :: Maybe POSIX
createdAt = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:revisionNumber:SystemTemplateSummary' :: Maybe Integer
revisionNumber = Maybe Integer
forall a. Maybe a
Prelude.Nothing,
      $sel:id:SystemTemplateSummary' :: Maybe Text
id = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | The ARN of the system.
systemTemplateSummary_arn :: Lens.Lens' SystemTemplateSummary (Prelude.Maybe Prelude.Text)
systemTemplateSummary_arn :: (Maybe Text -> f (Maybe Text))
-> SystemTemplateSummary -> f SystemTemplateSummary
systemTemplateSummary_arn = (SystemTemplateSummary -> Maybe Text)
-> (SystemTemplateSummary -> Maybe Text -> SystemTemplateSummary)
-> Lens
     SystemTemplateSummary
     SystemTemplateSummary
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SystemTemplateSummary' {Maybe Text
arn :: Maybe Text
$sel:arn:SystemTemplateSummary' :: SystemTemplateSummary -> Maybe Text
arn} -> Maybe Text
arn) (\s :: SystemTemplateSummary
s@SystemTemplateSummary' {} Maybe Text
a -> SystemTemplateSummary
s {$sel:arn:SystemTemplateSummary' :: Maybe Text
arn = Maybe Text
a} :: SystemTemplateSummary)

-- | The date when the system was created.
systemTemplateSummary_createdAt :: Lens.Lens' SystemTemplateSummary (Prelude.Maybe Prelude.UTCTime)
systemTemplateSummary_createdAt :: (Maybe UTCTime -> f (Maybe UTCTime))
-> SystemTemplateSummary -> f SystemTemplateSummary
systemTemplateSummary_createdAt = (SystemTemplateSummary -> Maybe POSIX)
-> (SystemTemplateSummary -> Maybe POSIX -> SystemTemplateSummary)
-> Lens
     SystemTemplateSummary
     SystemTemplateSummary
     (Maybe POSIX)
     (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SystemTemplateSummary' {Maybe POSIX
createdAt :: Maybe POSIX
$sel:createdAt:SystemTemplateSummary' :: SystemTemplateSummary -> Maybe POSIX
createdAt} -> Maybe POSIX
createdAt) (\s :: SystemTemplateSummary
s@SystemTemplateSummary' {} Maybe POSIX
a -> SystemTemplateSummary
s {$sel:createdAt:SystemTemplateSummary' :: Maybe POSIX
createdAt = Maybe POSIX
a} :: SystemTemplateSummary) ((Maybe POSIX -> f (Maybe POSIX))
 -> SystemTemplateSummary -> f SystemTemplateSummary)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> SystemTemplateSummary
-> f SystemTemplateSummary
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
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 AnIso POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

-- | The revision number of the system.
systemTemplateSummary_revisionNumber :: Lens.Lens' SystemTemplateSummary (Prelude.Maybe Prelude.Integer)
systemTemplateSummary_revisionNumber :: (Maybe Integer -> f (Maybe Integer))
-> SystemTemplateSummary -> f SystemTemplateSummary
systemTemplateSummary_revisionNumber = (SystemTemplateSummary -> Maybe Integer)
-> (SystemTemplateSummary
    -> Maybe Integer -> SystemTemplateSummary)
-> Lens
     SystemTemplateSummary
     SystemTemplateSummary
     (Maybe Integer)
     (Maybe Integer)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SystemTemplateSummary' {Maybe Integer
revisionNumber :: Maybe Integer
$sel:revisionNumber:SystemTemplateSummary' :: SystemTemplateSummary -> Maybe Integer
revisionNumber} -> Maybe Integer
revisionNumber) (\s :: SystemTemplateSummary
s@SystemTemplateSummary' {} Maybe Integer
a -> SystemTemplateSummary
s {$sel:revisionNumber:SystemTemplateSummary' :: Maybe Integer
revisionNumber = Maybe Integer
a} :: SystemTemplateSummary)

-- | The ID of the system.
systemTemplateSummary_id :: Lens.Lens' SystemTemplateSummary (Prelude.Maybe Prelude.Text)
systemTemplateSummary_id :: (Maybe Text -> f (Maybe Text))
-> SystemTemplateSummary -> f SystemTemplateSummary
systemTemplateSummary_id = (SystemTemplateSummary -> Maybe Text)
-> (SystemTemplateSummary -> Maybe Text -> SystemTemplateSummary)
-> Lens
     SystemTemplateSummary
     SystemTemplateSummary
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SystemTemplateSummary' {Maybe Text
id :: Maybe Text
$sel:id:SystemTemplateSummary' :: SystemTemplateSummary -> Maybe Text
id} -> Maybe Text
id) (\s :: SystemTemplateSummary
s@SystemTemplateSummary' {} Maybe Text
a -> SystemTemplateSummary
s {$sel:id:SystemTemplateSummary' :: Maybe Text
id = Maybe Text
a} :: SystemTemplateSummary)

instance Core.FromJSON SystemTemplateSummary where
  parseJSON :: Value -> Parser SystemTemplateSummary
parseJSON =
    String
-> (Object -> Parser SystemTemplateSummary)
-> Value
-> Parser SystemTemplateSummary
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"SystemTemplateSummary"
      ( \Object
x ->
          Maybe Text
-> Maybe POSIX
-> Maybe Integer
-> Maybe Text
-> SystemTemplateSummary
SystemTemplateSummary'
            (Maybe Text
 -> Maybe POSIX
 -> Maybe Integer
 -> Maybe Text
 -> SystemTemplateSummary)
-> Parser (Maybe Text)
-> Parser
     (Maybe POSIX
      -> Maybe Integer -> Maybe Text -> SystemTemplateSummary)
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
"arn")
            Parser
  (Maybe POSIX
   -> Maybe Integer -> Maybe Text -> SystemTemplateSummary)
-> Parser (Maybe POSIX)
-> Parser (Maybe Integer -> Maybe Text -> SystemTemplateSummary)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"createdAt")
            Parser (Maybe Integer -> Maybe Text -> SystemTemplateSummary)
-> Parser (Maybe Integer)
-> Parser (Maybe Text -> SystemTemplateSummary)
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
"revisionNumber")
            Parser (Maybe Text -> SystemTemplateSummary)
-> Parser (Maybe Text) -> Parser SystemTemplateSummary
forall (f :: * -> *) a b. Applicative f => 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
"id")
      )

instance Prelude.Hashable SystemTemplateSummary

instance Prelude.NFData SystemTemplateSummary