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

-- | Contains information about a queue for a quick connect. The flow must be
-- of type Transfer to Queue.
--
-- /See:/ 'newQueueQuickConnectConfig' smart constructor.
data QueueQuickConnectConfig = QueueQuickConnectConfig'
  { -- | The identifier for the queue.
    QueueQuickConnectConfig -> Text
queueId :: Prelude.Text,
    -- | The identifier of the flow.
    QueueQuickConnectConfig -> Text
contactFlowId :: Prelude.Text
  }
  deriving (QueueQuickConnectConfig -> QueueQuickConnectConfig -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: QueueQuickConnectConfig -> QueueQuickConnectConfig -> Bool
$c/= :: QueueQuickConnectConfig -> QueueQuickConnectConfig -> Bool
== :: QueueQuickConnectConfig -> QueueQuickConnectConfig -> Bool
$c== :: QueueQuickConnectConfig -> QueueQuickConnectConfig -> Bool
Prelude.Eq, ReadPrec [QueueQuickConnectConfig]
ReadPrec QueueQuickConnectConfig
Int -> ReadS QueueQuickConnectConfig
ReadS [QueueQuickConnectConfig]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [QueueQuickConnectConfig]
$creadListPrec :: ReadPrec [QueueQuickConnectConfig]
readPrec :: ReadPrec QueueQuickConnectConfig
$creadPrec :: ReadPrec QueueQuickConnectConfig
readList :: ReadS [QueueQuickConnectConfig]
$creadList :: ReadS [QueueQuickConnectConfig]
readsPrec :: Int -> ReadS QueueQuickConnectConfig
$creadsPrec :: Int -> ReadS QueueQuickConnectConfig
Prelude.Read, Int -> QueueQuickConnectConfig -> ShowS
[QueueQuickConnectConfig] -> ShowS
QueueQuickConnectConfig -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [QueueQuickConnectConfig] -> ShowS
$cshowList :: [QueueQuickConnectConfig] -> ShowS
show :: QueueQuickConnectConfig -> String
$cshow :: QueueQuickConnectConfig -> String
showsPrec :: Int -> QueueQuickConnectConfig -> ShowS
$cshowsPrec :: Int -> QueueQuickConnectConfig -> ShowS
Prelude.Show, forall x. Rep QueueQuickConnectConfig x -> QueueQuickConnectConfig
forall x. QueueQuickConnectConfig -> Rep QueueQuickConnectConfig x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep QueueQuickConnectConfig x -> QueueQuickConnectConfig
$cfrom :: forall x. QueueQuickConnectConfig -> Rep QueueQuickConnectConfig x
Prelude.Generic)

-- |
-- Create a value of 'QueueQuickConnectConfig' 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:
--
-- 'queueId', 'queueQuickConnectConfig_queueId' - The identifier for the queue.
--
-- 'contactFlowId', 'queueQuickConnectConfig_contactFlowId' - The identifier of the flow.
newQueueQuickConnectConfig ::
  -- | 'queueId'
  Prelude.Text ->
  -- | 'contactFlowId'
  Prelude.Text ->
  QueueQuickConnectConfig
newQueueQuickConnectConfig :: Text -> Text -> QueueQuickConnectConfig
newQueueQuickConnectConfig Text
pQueueId_ Text
pContactFlowId_ =
  QueueQuickConnectConfig'
    { $sel:queueId:QueueQuickConnectConfig' :: Text
queueId = Text
pQueueId_,
      $sel:contactFlowId:QueueQuickConnectConfig' :: Text
contactFlowId = Text
pContactFlowId_
    }

-- | The identifier for the queue.
queueQuickConnectConfig_queueId :: Lens.Lens' QueueQuickConnectConfig Prelude.Text
queueQuickConnectConfig_queueId :: Lens' QueueQuickConnectConfig Text
queueQuickConnectConfig_queueId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\QueueQuickConnectConfig' {Text
queueId :: Text
$sel:queueId:QueueQuickConnectConfig' :: QueueQuickConnectConfig -> Text
queueId} -> Text
queueId) (\s :: QueueQuickConnectConfig
s@QueueQuickConnectConfig' {} Text
a -> QueueQuickConnectConfig
s {$sel:queueId:QueueQuickConnectConfig' :: Text
queueId = Text
a} :: QueueQuickConnectConfig)

-- | The identifier of the flow.
queueQuickConnectConfig_contactFlowId :: Lens.Lens' QueueQuickConnectConfig Prelude.Text
queueQuickConnectConfig_contactFlowId :: Lens' QueueQuickConnectConfig Text
queueQuickConnectConfig_contactFlowId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\QueueQuickConnectConfig' {Text
contactFlowId :: Text
$sel:contactFlowId:QueueQuickConnectConfig' :: QueueQuickConnectConfig -> Text
contactFlowId} -> Text
contactFlowId) (\s :: QueueQuickConnectConfig
s@QueueQuickConnectConfig' {} Text
a -> QueueQuickConnectConfig
s {$sel:contactFlowId:QueueQuickConnectConfig' :: Text
contactFlowId = Text
a} :: QueueQuickConnectConfig)

instance Data.FromJSON QueueQuickConnectConfig where
  parseJSON :: Value -> Parser QueueQuickConnectConfig
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"QueueQuickConnectConfig"
      ( \Object
x ->
          Text -> Text -> QueueQuickConnectConfig
QueueQuickConnectConfig'
            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
"QueueId")
            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
"ContactFlowId")
      )

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

instance Prelude.NFData QueueQuickConnectConfig where
  rnf :: QueueQuickConnectConfig -> ()
rnf QueueQuickConnectConfig' {Text
contactFlowId :: Text
queueId :: Text
$sel:contactFlowId:QueueQuickConnectConfig' :: QueueQuickConnectConfig -> Text
$sel:queueId:QueueQuickConnectConfig' :: QueueQuickConnectConfig -> Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Text
queueId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
contactFlowId

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