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

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

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

-- |
-- Create a value of 'FlowTemplateSummary' 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', 'flowTemplateSummary_arn' - The ARN of the workflow.
--
-- 'createdAt', 'flowTemplateSummary_createdAt' - The date when the workflow was created.
--
-- 'revisionNumber', 'flowTemplateSummary_revisionNumber' - The revision number of the workflow.
--
-- 'id', 'flowTemplateSummary_id' - The ID of the workflow.
newFlowTemplateSummary ::
  FlowTemplateSummary
newFlowTemplateSummary :: FlowTemplateSummary
newFlowTemplateSummary =
  FlowTemplateSummary' :: Maybe Text
-> Maybe POSIX
-> Maybe Integer
-> Maybe Text
-> FlowTemplateSummary
FlowTemplateSummary'
    { $sel:arn:FlowTemplateSummary' :: Maybe Text
arn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:createdAt:FlowTemplateSummary' :: Maybe POSIX
createdAt = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:revisionNumber:FlowTemplateSummary' :: Maybe Integer
revisionNumber = Maybe Integer
forall a. Maybe a
Prelude.Nothing,
      $sel:id:FlowTemplateSummary' :: Maybe Text
id = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

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

-- | The date when the workflow was created.
flowTemplateSummary_createdAt :: Lens.Lens' FlowTemplateSummary (Prelude.Maybe Prelude.UTCTime)
flowTemplateSummary_createdAt :: (Maybe UTCTime -> f (Maybe UTCTime))
-> FlowTemplateSummary -> f FlowTemplateSummary
flowTemplateSummary_createdAt = (FlowTemplateSummary -> Maybe POSIX)
-> (FlowTemplateSummary -> Maybe POSIX -> FlowTemplateSummary)
-> Lens
     FlowTemplateSummary FlowTemplateSummary (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FlowTemplateSummary' {Maybe POSIX
createdAt :: Maybe POSIX
$sel:createdAt:FlowTemplateSummary' :: FlowTemplateSummary -> Maybe POSIX
createdAt} -> Maybe POSIX
createdAt) (\s :: FlowTemplateSummary
s@FlowTemplateSummary' {} Maybe POSIX
a -> FlowTemplateSummary
s {$sel:createdAt:FlowTemplateSummary' :: Maybe POSIX
createdAt = Maybe POSIX
a} :: FlowTemplateSummary) ((Maybe POSIX -> f (Maybe POSIX))
 -> FlowTemplateSummary -> f FlowTemplateSummary)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> FlowTemplateSummary
-> f FlowTemplateSummary
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 workflow.
flowTemplateSummary_revisionNumber :: Lens.Lens' FlowTemplateSummary (Prelude.Maybe Prelude.Integer)
flowTemplateSummary_revisionNumber :: (Maybe Integer -> f (Maybe Integer))
-> FlowTemplateSummary -> f FlowTemplateSummary
flowTemplateSummary_revisionNumber = (FlowTemplateSummary -> Maybe Integer)
-> (FlowTemplateSummary -> Maybe Integer -> FlowTemplateSummary)
-> Lens
     FlowTemplateSummary
     FlowTemplateSummary
     (Maybe Integer)
     (Maybe Integer)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FlowTemplateSummary' {Maybe Integer
revisionNumber :: Maybe Integer
$sel:revisionNumber:FlowTemplateSummary' :: FlowTemplateSummary -> Maybe Integer
revisionNumber} -> Maybe Integer
revisionNumber) (\s :: FlowTemplateSummary
s@FlowTemplateSummary' {} Maybe Integer
a -> FlowTemplateSummary
s {$sel:revisionNumber:FlowTemplateSummary' :: Maybe Integer
revisionNumber = Maybe Integer
a} :: FlowTemplateSummary)

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

instance Core.FromJSON FlowTemplateSummary where
  parseJSON :: Value -> Parser FlowTemplateSummary
parseJSON =
    String
-> (Object -> Parser FlowTemplateSummary)
-> Value
-> Parser FlowTemplateSummary
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"FlowTemplateSummary"
      ( \Object
x ->
          Maybe Text
-> Maybe POSIX
-> Maybe Integer
-> Maybe Text
-> FlowTemplateSummary
FlowTemplateSummary'
            (Maybe Text
 -> Maybe POSIX
 -> Maybe Integer
 -> Maybe Text
 -> FlowTemplateSummary)
-> Parser (Maybe Text)
-> Parser
     (Maybe POSIX -> Maybe Integer -> Maybe Text -> FlowTemplateSummary)
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 -> FlowTemplateSummary)
-> Parser (Maybe POSIX)
-> Parser (Maybe Integer -> Maybe Text -> FlowTemplateSummary)
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 -> FlowTemplateSummary)
-> Parser (Maybe Integer)
-> Parser (Maybe Text -> FlowTemplateSummary)
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 -> FlowTemplateSummary)
-> Parser (Maybe Text) -> Parser FlowTemplateSummary
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 FlowTemplateSummary

instance Prelude.NFData FlowTemplateSummary