{-# 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.MigrationHubOrchestrator.Types.TemplateSummary
-- 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.MigrationHubOrchestrator.Types.TemplateSummary where

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

-- | The summary of the template.
--
-- /See:/ 'newTemplateSummary' smart constructor.
data TemplateSummary = TemplateSummary'
  { -- | The Amazon Resource Name (ARN) of the template.
    TemplateSummary -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
    -- | The description of the template.
    TemplateSummary -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
    -- | The ID of the template.
    TemplateSummary -> Maybe Text
id :: Prelude.Maybe Prelude.Text,
    -- | The name of the template.
    TemplateSummary -> Maybe Text
name :: Prelude.Maybe Prelude.Text
  }
  deriving (TemplateSummary -> TemplateSummary -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: TemplateSummary -> TemplateSummary -> Bool
$c/= :: TemplateSummary -> TemplateSummary -> Bool
== :: TemplateSummary -> TemplateSummary -> Bool
$c== :: TemplateSummary -> TemplateSummary -> Bool
Prelude.Eq, ReadPrec [TemplateSummary]
ReadPrec TemplateSummary
Int -> ReadS TemplateSummary
ReadS [TemplateSummary]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [TemplateSummary]
$creadListPrec :: ReadPrec [TemplateSummary]
readPrec :: ReadPrec TemplateSummary
$creadPrec :: ReadPrec TemplateSummary
readList :: ReadS [TemplateSummary]
$creadList :: ReadS [TemplateSummary]
readsPrec :: Int -> ReadS TemplateSummary
$creadsPrec :: Int -> ReadS TemplateSummary
Prelude.Read, Int -> TemplateSummary -> ShowS
[TemplateSummary] -> ShowS
TemplateSummary -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [TemplateSummary] -> ShowS
$cshowList :: [TemplateSummary] -> ShowS
show :: TemplateSummary -> String
$cshow :: TemplateSummary -> String
showsPrec :: Int -> TemplateSummary -> ShowS
$cshowsPrec :: Int -> TemplateSummary -> ShowS
Prelude.Show, forall x. Rep TemplateSummary x -> TemplateSummary
forall x. TemplateSummary -> Rep TemplateSummary x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep TemplateSummary x -> TemplateSummary
$cfrom :: forall x. TemplateSummary -> Rep TemplateSummary x
Prelude.Generic)

-- |
-- Create a value of 'TemplateSummary' 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', 'templateSummary_arn' - The Amazon Resource Name (ARN) of the template.
--
-- 'description', 'templateSummary_description' - The description of the template.
--
-- 'id', 'templateSummary_id' - The ID of the template.
--
-- 'name', 'templateSummary_name' - The name of the template.
newTemplateSummary ::
  TemplateSummary
newTemplateSummary :: TemplateSummary
newTemplateSummary =
  TemplateSummary'
    { $sel:arn:TemplateSummary' :: Maybe Text
arn = forall a. Maybe a
Prelude.Nothing,
      $sel:description:TemplateSummary' :: Maybe Text
description = forall a. Maybe a
Prelude.Nothing,
      $sel:id:TemplateSummary' :: Maybe Text
id = forall a. Maybe a
Prelude.Nothing,
      $sel:name:TemplateSummary' :: Maybe Text
name = forall a. Maybe a
Prelude.Nothing
    }

-- | The Amazon Resource Name (ARN) of the template.
templateSummary_arn :: Lens.Lens' TemplateSummary (Prelude.Maybe Prelude.Text)
templateSummary_arn :: Lens' TemplateSummary (Maybe Text)
templateSummary_arn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TemplateSummary' {Maybe Text
arn :: Maybe Text
$sel:arn:TemplateSummary' :: TemplateSummary -> Maybe Text
arn} -> Maybe Text
arn) (\s :: TemplateSummary
s@TemplateSummary' {} Maybe Text
a -> TemplateSummary
s {$sel:arn:TemplateSummary' :: Maybe Text
arn = Maybe Text
a} :: TemplateSummary)

-- | The description of the template.
templateSummary_description :: Lens.Lens' TemplateSummary (Prelude.Maybe Prelude.Text)
templateSummary_description :: Lens' TemplateSummary (Maybe Text)
templateSummary_description = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TemplateSummary' {Maybe Text
description :: Maybe Text
$sel:description:TemplateSummary' :: TemplateSummary -> Maybe Text
description} -> Maybe Text
description) (\s :: TemplateSummary
s@TemplateSummary' {} Maybe Text
a -> TemplateSummary
s {$sel:description:TemplateSummary' :: Maybe Text
description = Maybe Text
a} :: TemplateSummary)

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

-- | The name of the template.
templateSummary_name :: Lens.Lens' TemplateSummary (Prelude.Maybe Prelude.Text)
templateSummary_name :: Lens' TemplateSummary (Maybe Text)
templateSummary_name = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TemplateSummary' {Maybe Text
name :: Maybe Text
$sel:name:TemplateSummary' :: TemplateSummary -> Maybe Text
name} -> Maybe Text
name) (\s :: TemplateSummary
s@TemplateSummary' {} Maybe Text
a -> TemplateSummary
s {$sel:name:TemplateSummary' :: Maybe Text
name = Maybe Text
a} :: TemplateSummary)

instance Data.FromJSON TemplateSummary where
  parseJSON :: Value -> Parser TemplateSummary
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"TemplateSummary"
      ( \Object
x ->
          Maybe Text
-> Maybe Text -> Maybe Text -> Maybe Text -> TemplateSummary
TemplateSummary'
            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
"arn")
            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
"description")
            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
"id")
            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
"name")
      )

instance Prelude.Hashable TemplateSummary where
  hashWithSalt :: Int -> TemplateSummary -> Int
hashWithSalt Int
_salt TemplateSummary' {Maybe Text
name :: Maybe Text
id :: Maybe Text
description :: Maybe Text
arn :: Maybe Text
$sel:name:TemplateSummary' :: TemplateSummary -> Maybe Text
$sel:id:TemplateSummary' :: TemplateSummary -> Maybe Text
$sel:description:TemplateSummary' :: TemplateSummary -> Maybe Text
$sel:arn:TemplateSummary' :: TemplateSummary -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
arn
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
description
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
id
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
name

instance Prelude.NFData TemplateSummary where
  rnf :: TemplateSummary -> ()
rnf TemplateSummary' {Maybe Text
name :: Maybe Text
id :: Maybe Text
description :: Maybe Text
arn :: Maybe Text
$sel:name:TemplateSummary' :: TemplateSummary -> Maybe Text
$sel:id:TemplateSummary' :: TemplateSummary -> Maybe Text
$sel:description:TemplateSummary' :: TemplateSummary -> Maybe Text
$sel:arn:TemplateSummary' :: TemplateSummary -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
arn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
description
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
id
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
name