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

import Amazonka.ConnectCases.Types.TemplateStatus
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

-- | Template summary information.
--
-- /See:/ 'newTemplateSummary' smart constructor.
data TemplateSummary = TemplateSummary'
  { -- | The template name.
    TemplateSummary -> Text
name :: Prelude.Text,
    -- | The status of the template.
    TemplateSummary -> TemplateStatus
status :: TemplateStatus,
    -- | The Amazon Resource Name (ARN) of the template.
    TemplateSummary -> Text
templateArn :: Prelude.Text,
    -- | The unique identifier for the template.
    TemplateSummary -> Text
templateId :: 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:
--
-- 'name', 'templateSummary_name' - The template name.
--
-- 'status', 'templateSummary_status' - The status of the template.
--
-- 'templateArn', 'templateSummary_templateArn' - The Amazon Resource Name (ARN) of the template.
--
-- 'templateId', 'templateSummary_templateId' - The unique identifier for the template.
newTemplateSummary ::
  -- | 'name'
  Prelude.Text ->
  -- | 'status'
  TemplateStatus ->
  -- | 'templateArn'
  Prelude.Text ->
  -- | 'templateId'
  Prelude.Text ->
  TemplateSummary
newTemplateSummary :: Text -> TemplateStatus -> Text -> Text -> TemplateSummary
newTemplateSummary
  Text
pName_
  TemplateStatus
pStatus_
  Text
pTemplateArn_
  Text
pTemplateId_ =
    TemplateSummary'
      { $sel:name:TemplateSummary' :: Text
name = Text
pName_,
        $sel:status:TemplateSummary' :: TemplateStatus
status = TemplateStatus
pStatus_,
        $sel:templateArn:TemplateSummary' :: Text
templateArn = Text
pTemplateArn_,
        $sel:templateId:TemplateSummary' :: Text
templateId = Text
pTemplateId_
      }

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

-- | The status of the template.
templateSummary_status :: Lens.Lens' TemplateSummary TemplateStatus
templateSummary_status :: Lens' TemplateSummary TemplateStatus
templateSummary_status = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TemplateSummary' {TemplateStatus
status :: TemplateStatus
$sel:status:TemplateSummary' :: TemplateSummary -> TemplateStatus
status} -> TemplateStatus
status) (\s :: TemplateSummary
s@TemplateSummary' {} TemplateStatus
a -> TemplateSummary
s {$sel:status:TemplateSummary' :: TemplateStatus
status = TemplateStatus
a} :: TemplateSummary)

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

-- | The unique identifier for the template.
templateSummary_templateId :: Lens.Lens' TemplateSummary Prelude.Text
templateSummary_templateId :: Lens' TemplateSummary Text
templateSummary_templateId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TemplateSummary' {Text
templateId :: Text
$sel:templateId:TemplateSummary' :: TemplateSummary -> Text
templateId} -> Text
templateId) (\s :: TemplateSummary
s@TemplateSummary' {} Text
a -> TemplateSummary
s {$sel:templateId:TemplateSummary' :: Text
templateId = 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 ->
          Text -> TemplateStatus -> Text -> 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 a
Data..: Key
"name")
            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
"status")
            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
"templateArn")
            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
"templateId")
      )

instance Prelude.Hashable TemplateSummary where
  hashWithSalt :: Int -> TemplateSummary -> Int
hashWithSalt Int
_salt TemplateSummary' {Text
TemplateStatus
templateId :: Text
templateArn :: Text
status :: TemplateStatus
name :: Text
$sel:templateId:TemplateSummary' :: TemplateSummary -> Text
$sel:templateArn:TemplateSummary' :: TemplateSummary -> Text
$sel:status:TemplateSummary' :: TemplateSummary -> TemplateStatus
$sel:name:TemplateSummary' :: TemplateSummary -> Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
name
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` TemplateStatus
status
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
templateArn
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
templateId

instance Prelude.NFData TemplateSummary where
  rnf :: TemplateSummary -> ()
rnf TemplateSummary' {Text
TemplateStatus
templateId :: Text
templateArn :: Text
status :: TemplateStatus
name :: Text
$sel:templateId:TemplateSummary' :: TemplateSummary -> Text
$sel:templateArn:TemplateSummary' :: TemplateSummary -> Text
$sel:status:TemplateSummary' :: TemplateSummary -> TemplateStatus
$sel:name:TemplateSummary' :: TemplateSummary -> Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Text
name
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf TemplateStatus
status
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
templateArn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
templateId