{-# 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.CaseSummary
-- 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.CaseSummary 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

-- | Case summary information.
--
-- /See:/ 'newCaseSummary' smart constructor.
data CaseSummary = CaseSummary'
  { -- | A unique identifier of the case.
    CaseSummary -> Text
caseId :: Prelude.Text,
    -- | A unique identifier of a template.
    CaseSummary -> Text
templateId :: Prelude.Text
  }
  deriving (CaseSummary -> CaseSummary -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CaseSummary -> CaseSummary -> Bool
$c/= :: CaseSummary -> CaseSummary -> Bool
== :: CaseSummary -> CaseSummary -> Bool
$c== :: CaseSummary -> CaseSummary -> Bool
Prelude.Eq, ReadPrec [CaseSummary]
ReadPrec CaseSummary
Int -> ReadS CaseSummary
ReadS [CaseSummary]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CaseSummary]
$creadListPrec :: ReadPrec [CaseSummary]
readPrec :: ReadPrec CaseSummary
$creadPrec :: ReadPrec CaseSummary
readList :: ReadS [CaseSummary]
$creadList :: ReadS [CaseSummary]
readsPrec :: Int -> ReadS CaseSummary
$creadsPrec :: Int -> ReadS CaseSummary
Prelude.Read, Int -> CaseSummary -> ShowS
[CaseSummary] -> ShowS
CaseSummary -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CaseSummary] -> ShowS
$cshowList :: [CaseSummary] -> ShowS
show :: CaseSummary -> String
$cshow :: CaseSummary -> String
showsPrec :: Int -> CaseSummary -> ShowS
$cshowsPrec :: Int -> CaseSummary -> ShowS
Prelude.Show, forall x. Rep CaseSummary x -> CaseSummary
forall x. CaseSummary -> Rep CaseSummary x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CaseSummary x -> CaseSummary
$cfrom :: forall x. CaseSummary -> Rep CaseSummary x
Prelude.Generic)

-- |
-- Create a value of 'CaseSummary' 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:
--
-- 'caseId', 'caseSummary_caseId' - A unique identifier of the case.
--
-- 'templateId', 'caseSummary_templateId' - A unique identifier of a template.
newCaseSummary ::
  -- | 'caseId'
  Prelude.Text ->
  -- | 'templateId'
  Prelude.Text ->
  CaseSummary
newCaseSummary :: Text -> Text -> CaseSummary
newCaseSummary Text
pCaseId_ Text
pTemplateId_ =
  CaseSummary'
    { $sel:caseId:CaseSummary' :: Text
caseId = Text
pCaseId_,
      $sel:templateId:CaseSummary' :: Text
templateId = Text
pTemplateId_
    }

-- | A unique identifier of the case.
caseSummary_caseId :: Lens.Lens' CaseSummary Prelude.Text
caseSummary_caseId :: Lens' CaseSummary Text
caseSummary_caseId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CaseSummary' {Text
caseId :: Text
$sel:caseId:CaseSummary' :: CaseSummary -> Text
caseId} -> Text
caseId) (\s :: CaseSummary
s@CaseSummary' {} Text
a -> CaseSummary
s {$sel:caseId:CaseSummary' :: Text
caseId = Text
a} :: CaseSummary)

-- | A unique identifier of a template.
caseSummary_templateId :: Lens.Lens' CaseSummary Prelude.Text
caseSummary_templateId :: Lens' CaseSummary Text
caseSummary_templateId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CaseSummary' {Text
templateId :: Text
$sel:templateId:CaseSummary' :: CaseSummary -> Text
templateId} -> Text
templateId) (\s :: CaseSummary
s@CaseSummary' {} Text
a -> CaseSummary
s {$sel:templateId:CaseSummary' :: Text
templateId = Text
a} :: CaseSummary)

instance Data.FromJSON CaseSummary where
  parseJSON :: Value -> Parser CaseSummary
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"CaseSummary"
      ( \Object
x ->
          Text -> Text -> CaseSummary
CaseSummary'
            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
"caseId")
            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 CaseSummary where
  hashWithSalt :: Int -> CaseSummary -> Int
hashWithSalt Int
_salt CaseSummary' {Text
templateId :: Text
caseId :: Text
$sel:templateId:CaseSummary' :: CaseSummary -> Text
$sel:caseId:CaseSummary' :: CaseSummary -> Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
caseId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
templateId

instance Prelude.NFData CaseSummary where
  rnf :: CaseSummary -> ()
rnf CaseSummary' {Text
templateId :: Text
caseId :: Text
$sel:templateId:CaseSummary' :: CaseSummary -> Text
$sel:caseId:CaseSummary' :: CaseSummary -> Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Text
caseId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
templateId