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

-- | An object that represents an Amazon Connect contact object.
--
-- /See:/ 'newContact' smart constructor.
data Contact = Contact'
  { -- | A unique identifier of a contact in Amazon Connect.
    Contact -> Text
contactArn :: Prelude.Text
  }
  deriving (Contact -> Contact -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Contact -> Contact -> Bool
$c/= :: Contact -> Contact -> Bool
== :: Contact -> Contact -> Bool
$c== :: Contact -> Contact -> Bool
Prelude.Eq, ReadPrec [Contact]
ReadPrec Contact
Int -> ReadS Contact
ReadS [Contact]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Contact]
$creadListPrec :: ReadPrec [Contact]
readPrec :: ReadPrec Contact
$creadPrec :: ReadPrec Contact
readList :: ReadS [Contact]
$creadList :: ReadS [Contact]
readsPrec :: Int -> ReadS Contact
$creadsPrec :: Int -> ReadS Contact
Prelude.Read, Int -> Contact -> ShowS
[Contact] -> ShowS
Contact -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Contact] -> ShowS
$cshowList :: [Contact] -> ShowS
show :: Contact -> String
$cshow :: Contact -> String
showsPrec :: Int -> Contact -> ShowS
$cshowsPrec :: Int -> Contact -> ShowS
Prelude.Show, forall x. Rep Contact x -> Contact
forall x. Contact -> Rep Contact x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Contact x -> Contact
$cfrom :: forall x. Contact -> Rep Contact x
Prelude.Generic)

-- |
-- Create a value of 'Contact' 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:
--
-- 'contactArn', 'contact_contactArn' - A unique identifier of a contact in Amazon Connect.
newContact ::
  -- | 'contactArn'
  Prelude.Text ->
  Contact
newContact :: Text -> Contact
newContact Text
pContactArn_ =
  Contact' {$sel:contactArn:Contact' :: Text
contactArn = Text
pContactArn_}

-- | A unique identifier of a contact in Amazon Connect.
contact_contactArn :: Lens.Lens' Contact Prelude.Text
contact_contactArn :: Lens' Contact Text
contact_contactArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Contact' {Text
contactArn :: Text
$sel:contactArn:Contact' :: Contact -> Text
contactArn} -> Text
contactArn) (\s :: Contact
s@Contact' {} Text
a -> Contact
s {$sel:contactArn:Contact' :: Text
contactArn = Text
a} :: Contact)

instance Prelude.Hashable Contact where
  hashWithSalt :: Int -> Contact -> Int
hashWithSalt Int
_salt Contact' {Text
contactArn :: Text
$sel:contactArn:Contact' :: Contact -> Text
..} =
    Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
contactArn

instance Prelude.NFData Contact where
  rnf :: Contact -> ()
rnf Contact' {Text
contactArn :: Text
$sel:contactArn:Contact' :: Contact -> Text
..} = forall a. NFData a => a -> ()
Prelude.rnf Text
contactArn

instance Data.ToJSON Contact where
  toJSON :: Contact -> Value
toJSON Contact' {Text
contactArn :: Text
$sel:contactArn:Contact' :: Contact -> Text
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [forall a. a -> Maybe a
Prelude.Just (Key
"contactArn" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
contactArn)]
      )