{-# 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.Connect.Types.UpdateParticipantRoleConfigChannelInfo
-- 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.Connect.Types.UpdateParticipantRoleConfigChannelInfo where

import Amazonka.Connect.Types.ChatParticipantRoleConfig
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

-- | Configuration information for the chat participant role.
--
-- /See:/ 'newUpdateParticipantRoleConfigChannelInfo' smart constructor.
data UpdateParticipantRoleConfigChannelInfo = UpdateParticipantRoleConfigChannelInfo'
  { -- | Configuration information for the chat participant role.
    UpdateParticipantRoleConfigChannelInfo
-> Maybe ChatParticipantRoleConfig
chat :: Prelude.Maybe ChatParticipantRoleConfig
  }
  deriving (UpdateParticipantRoleConfigChannelInfo
-> UpdateParticipantRoleConfigChannelInfo -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateParticipantRoleConfigChannelInfo
-> UpdateParticipantRoleConfigChannelInfo -> Bool
$c/= :: UpdateParticipantRoleConfigChannelInfo
-> UpdateParticipantRoleConfigChannelInfo -> Bool
== :: UpdateParticipantRoleConfigChannelInfo
-> UpdateParticipantRoleConfigChannelInfo -> Bool
$c== :: UpdateParticipantRoleConfigChannelInfo
-> UpdateParticipantRoleConfigChannelInfo -> Bool
Prelude.Eq, ReadPrec [UpdateParticipantRoleConfigChannelInfo]
ReadPrec UpdateParticipantRoleConfigChannelInfo
Int -> ReadS UpdateParticipantRoleConfigChannelInfo
ReadS [UpdateParticipantRoleConfigChannelInfo]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateParticipantRoleConfigChannelInfo]
$creadListPrec :: ReadPrec [UpdateParticipantRoleConfigChannelInfo]
readPrec :: ReadPrec UpdateParticipantRoleConfigChannelInfo
$creadPrec :: ReadPrec UpdateParticipantRoleConfigChannelInfo
readList :: ReadS [UpdateParticipantRoleConfigChannelInfo]
$creadList :: ReadS [UpdateParticipantRoleConfigChannelInfo]
readsPrec :: Int -> ReadS UpdateParticipantRoleConfigChannelInfo
$creadsPrec :: Int -> ReadS UpdateParticipantRoleConfigChannelInfo
Prelude.Read, Int -> UpdateParticipantRoleConfigChannelInfo -> ShowS
[UpdateParticipantRoleConfigChannelInfo] -> ShowS
UpdateParticipantRoleConfigChannelInfo -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateParticipantRoleConfigChannelInfo] -> ShowS
$cshowList :: [UpdateParticipantRoleConfigChannelInfo] -> ShowS
show :: UpdateParticipantRoleConfigChannelInfo -> String
$cshow :: UpdateParticipantRoleConfigChannelInfo -> String
showsPrec :: Int -> UpdateParticipantRoleConfigChannelInfo -> ShowS
$cshowsPrec :: Int -> UpdateParticipantRoleConfigChannelInfo -> ShowS
Prelude.Show, forall x.
Rep UpdateParticipantRoleConfigChannelInfo x
-> UpdateParticipantRoleConfigChannelInfo
forall x.
UpdateParticipantRoleConfigChannelInfo
-> Rep UpdateParticipantRoleConfigChannelInfo x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UpdateParticipantRoleConfigChannelInfo x
-> UpdateParticipantRoleConfigChannelInfo
$cfrom :: forall x.
UpdateParticipantRoleConfigChannelInfo
-> Rep UpdateParticipantRoleConfigChannelInfo x
Prelude.Generic)

-- |
-- Create a value of 'UpdateParticipantRoleConfigChannelInfo' 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:
--
-- 'chat', 'updateParticipantRoleConfigChannelInfo_chat' - Configuration information for the chat participant role.
newUpdateParticipantRoleConfigChannelInfo ::
  UpdateParticipantRoleConfigChannelInfo
newUpdateParticipantRoleConfigChannelInfo :: UpdateParticipantRoleConfigChannelInfo
newUpdateParticipantRoleConfigChannelInfo =
  UpdateParticipantRoleConfigChannelInfo'
    { $sel:chat:UpdateParticipantRoleConfigChannelInfo' :: Maybe ChatParticipantRoleConfig
chat =
        forall a. Maybe a
Prelude.Nothing
    }

-- | Configuration information for the chat participant role.
updateParticipantRoleConfigChannelInfo_chat :: Lens.Lens' UpdateParticipantRoleConfigChannelInfo (Prelude.Maybe ChatParticipantRoleConfig)
updateParticipantRoleConfigChannelInfo_chat :: Lens'
  UpdateParticipantRoleConfigChannelInfo
  (Maybe ChatParticipantRoleConfig)
updateParticipantRoleConfigChannelInfo_chat = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateParticipantRoleConfigChannelInfo' {Maybe ChatParticipantRoleConfig
chat :: Maybe ChatParticipantRoleConfig
$sel:chat:UpdateParticipantRoleConfigChannelInfo' :: UpdateParticipantRoleConfigChannelInfo
-> Maybe ChatParticipantRoleConfig
chat} -> Maybe ChatParticipantRoleConfig
chat) (\s :: UpdateParticipantRoleConfigChannelInfo
s@UpdateParticipantRoleConfigChannelInfo' {} Maybe ChatParticipantRoleConfig
a -> UpdateParticipantRoleConfigChannelInfo
s {$sel:chat:UpdateParticipantRoleConfigChannelInfo' :: Maybe ChatParticipantRoleConfig
chat = Maybe ChatParticipantRoleConfig
a} :: UpdateParticipantRoleConfigChannelInfo)

instance
  Prelude.Hashable
    UpdateParticipantRoleConfigChannelInfo
  where
  hashWithSalt :: Int -> UpdateParticipantRoleConfigChannelInfo -> Int
hashWithSalt
    Int
_salt
    UpdateParticipantRoleConfigChannelInfo' {Maybe ChatParticipantRoleConfig
chat :: Maybe ChatParticipantRoleConfig
$sel:chat:UpdateParticipantRoleConfigChannelInfo' :: UpdateParticipantRoleConfigChannelInfo
-> Maybe ChatParticipantRoleConfig
..} =
      Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ChatParticipantRoleConfig
chat

instance
  Prelude.NFData
    UpdateParticipantRoleConfigChannelInfo
  where
  rnf :: UpdateParticipantRoleConfigChannelInfo -> ()
rnf UpdateParticipantRoleConfigChannelInfo' {Maybe ChatParticipantRoleConfig
chat :: Maybe ChatParticipantRoleConfig
$sel:chat:UpdateParticipantRoleConfigChannelInfo' :: UpdateParticipantRoleConfigChannelInfo
-> Maybe ChatParticipantRoleConfig
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe ChatParticipantRoleConfig
chat

instance
  Data.ToJSON
    UpdateParticipantRoleConfigChannelInfo
  where
  toJSON :: UpdateParticipantRoleConfigChannelInfo -> Value
toJSON UpdateParticipantRoleConfigChannelInfo' {Maybe ChatParticipantRoleConfig
chat :: Maybe ChatParticipantRoleConfig
$sel:chat:UpdateParticipantRoleConfigChannelInfo' :: UpdateParticipantRoleConfigChannelInfo
-> Maybe ChatParticipantRoleConfig
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [(Key
"Chat" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe ChatParticipantRoleConfig
chat]
      )