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

import Amazonka.Connect.Types.Channel
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 the channel and queue identifier for a routing profile.
--
-- /See:/ 'newRoutingProfileQueueReference' smart constructor.
data RoutingProfileQueueReference = RoutingProfileQueueReference'
  { -- | The identifier for the queue.
    RoutingProfileQueueReference -> Text
queueId :: Prelude.Text,
    -- | The channels agents can handle in the Contact Control Panel (CCP) for
    -- this routing profile.
    RoutingProfileQueueReference -> Channel
channel :: Channel
  }
  deriving (RoutingProfileQueueReference
-> RoutingProfileQueueReference -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: RoutingProfileQueueReference
-> RoutingProfileQueueReference -> Bool
$c/= :: RoutingProfileQueueReference
-> RoutingProfileQueueReference -> Bool
== :: RoutingProfileQueueReference
-> RoutingProfileQueueReference -> Bool
$c== :: RoutingProfileQueueReference
-> RoutingProfileQueueReference -> Bool
Prelude.Eq, ReadPrec [RoutingProfileQueueReference]
ReadPrec RoutingProfileQueueReference
Int -> ReadS RoutingProfileQueueReference
ReadS [RoutingProfileQueueReference]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [RoutingProfileQueueReference]
$creadListPrec :: ReadPrec [RoutingProfileQueueReference]
readPrec :: ReadPrec RoutingProfileQueueReference
$creadPrec :: ReadPrec RoutingProfileQueueReference
readList :: ReadS [RoutingProfileQueueReference]
$creadList :: ReadS [RoutingProfileQueueReference]
readsPrec :: Int -> ReadS RoutingProfileQueueReference
$creadsPrec :: Int -> ReadS RoutingProfileQueueReference
Prelude.Read, Int -> RoutingProfileQueueReference -> ShowS
[RoutingProfileQueueReference] -> ShowS
RoutingProfileQueueReference -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [RoutingProfileQueueReference] -> ShowS
$cshowList :: [RoutingProfileQueueReference] -> ShowS
show :: RoutingProfileQueueReference -> String
$cshow :: RoutingProfileQueueReference -> String
showsPrec :: Int -> RoutingProfileQueueReference -> ShowS
$cshowsPrec :: Int -> RoutingProfileQueueReference -> ShowS
Prelude.Show, forall x.
Rep RoutingProfileQueueReference x -> RoutingProfileQueueReference
forall x.
RoutingProfileQueueReference -> Rep RoutingProfileQueueReference x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep RoutingProfileQueueReference x -> RoutingProfileQueueReference
$cfrom :: forall x.
RoutingProfileQueueReference -> Rep RoutingProfileQueueReference x
Prelude.Generic)

-- |
-- Create a value of 'RoutingProfileQueueReference' 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', 'routingProfileQueueReference_queueId' - The identifier for the queue.
--
-- 'channel', 'routingProfileQueueReference_channel' - The channels agents can handle in the Contact Control Panel (CCP) for
-- this routing profile.
newRoutingProfileQueueReference ::
  -- | 'queueId'
  Prelude.Text ->
  -- | 'channel'
  Channel ->
  RoutingProfileQueueReference
newRoutingProfileQueueReference :: Text -> Channel -> RoutingProfileQueueReference
newRoutingProfileQueueReference Text
pQueueId_ Channel
pChannel_ =
  RoutingProfileQueueReference'
    { $sel:queueId:RoutingProfileQueueReference' :: Text
queueId = Text
pQueueId_,
      $sel:channel:RoutingProfileQueueReference' :: Channel
channel = Channel
pChannel_
    }

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

-- | The channels agents can handle in the Contact Control Panel (CCP) for
-- this routing profile.
routingProfileQueueReference_channel :: Lens.Lens' RoutingProfileQueueReference Channel
routingProfileQueueReference_channel :: Lens' RoutingProfileQueueReference Channel
routingProfileQueueReference_channel = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RoutingProfileQueueReference' {Channel
channel :: Channel
$sel:channel:RoutingProfileQueueReference' :: RoutingProfileQueueReference -> Channel
channel} -> Channel
channel) (\s :: RoutingProfileQueueReference
s@RoutingProfileQueueReference' {} Channel
a -> RoutingProfileQueueReference
s {$sel:channel:RoutingProfileQueueReference' :: Channel
channel = Channel
a} :: RoutingProfileQueueReference)

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

instance Prelude.NFData RoutingProfileQueueReference where
  rnf :: RoutingProfileQueueReference -> ()
rnf RoutingProfileQueueReference' {Text
Channel
channel :: Channel
queueId :: Text
$sel:channel:RoutingProfileQueueReference' :: RoutingProfileQueueReference -> Channel
$sel:queueId:RoutingProfileQueueReference' :: RoutingProfileQueueReference -> 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 Channel
channel

instance Data.ToJSON RoutingProfileQueueReference where
  toJSON :: RoutingProfileQueueReference -> Value
toJSON RoutingProfileQueueReference' {Text
Channel
channel :: Channel
queueId :: Text
$sel:channel:RoutingProfileQueueReference' :: RoutingProfileQueueReference -> Channel
$sel:queueId:RoutingProfileQueueReference' :: RoutingProfileQueueReference -> 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
"Channel" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Channel
channel)
          ]
      )