{-# 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.ChatParticipantRoleConfig
-- 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.ChatParticipantRoleConfig where

import Amazonka.Connect.Types.ParticipantTimerConfiguration
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:/ 'newChatParticipantRoleConfig' smart constructor.
data ChatParticipantRoleConfig = ChatParticipantRoleConfig'
  { -- | A list of participant timers. You can specify any unique combination of
    -- role and timer type. Duplicate entries error out the request with a 400.
    ChatParticipantRoleConfig -> NonEmpty ParticipantTimerConfiguration
participantTimerConfigList :: Prelude.NonEmpty ParticipantTimerConfiguration
  }
  deriving (ChatParticipantRoleConfig -> ChatParticipantRoleConfig -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ChatParticipantRoleConfig -> ChatParticipantRoleConfig -> Bool
$c/= :: ChatParticipantRoleConfig -> ChatParticipantRoleConfig -> Bool
== :: ChatParticipantRoleConfig -> ChatParticipantRoleConfig -> Bool
$c== :: ChatParticipantRoleConfig -> ChatParticipantRoleConfig -> Bool
Prelude.Eq, ReadPrec [ChatParticipantRoleConfig]
ReadPrec ChatParticipantRoleConfig
Int -> ReadS ChatParticipantRoleConfig
ReadS [ChatParticipantRoleConfig]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ChatParticipantRoleConfig]
$creadListPrec :: ReadPrec [ChatParticipantRoleConfig]
readPrec :: ReadPrec ChatParticipantRoleConfig
$creadPrec :: ReadPrec ChatParticipantRoleConfig
readList :: ReadS [ChatParticipantRoleConfig]
$creadList :: ReadS [ChatParticipantRoleConfig]
readsPrec :: Int -> ReadS ChatParticipantRoleConfig
$creadsPrec :: Int -> ReadS ChatParticipantRoleConfig
Prelude.Read, Int -> ChatParticipantRoleConfig -> ShowS
[ChatParticipantRoleConfig] -> ShowS
ChatParticipantRoleConfig -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ChatParticipantRoleConfig] -> ShowS
$cshowList :: [ChatParticipantRoleConfig] -> ShowS
show :: ChatParticipantRoleConfig -> String
$cshow :: ChatParticipantRoleConfig -> String
showsPrec :: Int -> ChatParticipantRoleConfig -> ShowS
$cshowsPrec :: Int -> ChatParticipantRoleConfig -> ShowS
Prelude.Show, forall x.
Rep ChatParticipantRoleConfig x -> ChatParticipantRoleConfig
forall x.
ChatParticipantRoleConfig -> Rep ChatParticipantRoleConfig x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ChatParticipantRoleConfig x -> ChatParticipantRoleConfig
$cfrom :: forall x.
ChatParticipantRoleConfig -> Rep ChatParticipantRoleConfig x
Prelude.Generic)

-- |
-- Create a value of 'ChatParticipantRoleConfig' 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:
--
-- 'participantTimerConfigList', 'chatParticipantRoleConfig_participantTimerConfigList' - A list of participant timers. You can specify any unique combination of
-- role and timer type. Duplicate entries error out the request with a 400.
newChatParticipantRoleConfig ::
  -- | 'participantTimerConfigList'
  Prelude.NonEmpty ParticipantTimerConfiguration ->
  ChatParticipantRoleConfig
newChatParticipantRoleConfig :: NonEmpty ParticipantTimerConfiguration -> ChatParticipantRoleConfig
newChatParticipantRoleConfig
  NonEmpty ParticipantTimerConfiguration
pParticipantTimerConfigList_ =
    ChatParticipantRoleConfig'
      { $sel:participantTimerConfigList:ChatParticipantRoleConfig' :: NonEmpty ParticipantTimerConfiguration
participantTimerConfigList =
          forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
            forall t b. AReview t b -> b -> t
Lens.# NonEmpty ParticipantTimerConfiguration
pParticipantTimerConfigList_
      }

-- | A list of participant timers. You can specify any unique combination of
-- role and timer type. Duplicate entries error out the request with a 400.
chatParticipantRoleConfig_participantTimerConfigList :: Lens.Lens' ChatParticipantRoleConfig (Prelude.NonEmpty ParticipantTimerConfiguration)
chatParticipantRoleConfig_participantTimerConfigList :: Lens'
  ChatParticipantRoleConfig (NonEmpty ParticipantTimerConfiguration)
chatParticipantRoleConfig_participantTimerConfigList = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ChatParticipantRoleConfig' {NonEmpty ParticipantTimerConfiguration
participantTimerConfigList :: NonEmpty ParticipantTimerConfiguration
$sel:participantTimerConfigList:ChatParticipantRoleConfig' :: ChatParticipantRoleConfig -> NonEmpty ParticipantTimerConfiguration
participantTimerConfigList} -> NonEmpty ParticipantTimerConfiguration
participantTimerConfigList) (\s :: ChatParticipantRoleConfig
s@ChatParticipantRoleConfig' {} NonEmpty ParticipantTimerConfiguration
a -> ChatParticipantRoleConfig
s {$sel:participantTimerConfigList:ChatParticipantRoleConfig' :: NonEmpty ParticipantTimerConfiguration
participantTimerConfigList = NonEmpty ParticipantTimerConfiguration
a} :: ChatParticipantRoleConfig) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance Prelude.Hashable ChatParticipantRoleConfig where
  hashWithSalt :: Int -> ChatParticipantRoleConfig -> Int
hashWithSalt Int
_salt ChatParticipantRoleConfig' {NonEmpty ParticipantTimerConfiguration
participantTimerConfigList :: NonEmpty ParticipantTimerConfiguration
$sel:participantTimerConfigList:ChatParticipantRoleConfig' :: ChatParticipantRoleConfig -> NonEmpty ParticipantTimerConfiguration
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` NonEmpty ParticipantTimerConfiguration
participantTimerConfigList

instance Prelude.NFData ChatParticipantRoleConfig where
  rnf :: ChatParticipantRoleConfig -> ()
rnf ChatParticipantRoleConfig' {NonEmpty ParticipantTimerConfiguration
participantTimerConfigList :: NonEmpty ParticipantTimerConfiguration
$sel:participantTimerConfigList:ChatParticipantRoleConfig' :: ChatParticipantRoleConfig -> NonEmpty ParticipantTimerConfiguration
..} =
    forall a. NFData a => a -> ()
Prelude.rnf NonEmpty ParticipantTimerConfiguration
participantTimerConfigList

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