{-# 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-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- 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.Lens as Lens
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
(RoutingProfileQueueReference
 -> RoutingProfileQueueReference -> Bool)
-> (RoutingProfileQueueReference
    -> RoutingProfileQueueReference -> Bool)
-> Eq RoutingProfileQueueReference
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]
(Int -> ReadS RoutingProfileQueueReference)
-> ReadS [RoutingProfileQueueReference]
-> ReadPrec RoutingProfileQueueReference
-> ReadPrec [RoutingProfileQueueReference]
-> Read 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
(Int -> RoutingProfileQueueReference -> ShowS)
-> (RoutingProfileQueueReference -> String)
-> ([RoutingProfileQueueReference] -> ShowS)
-> Show RoutingProfileQueueReference
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.
 RoutingProfileQueueReference -> Rep RoutingProfileQueueReference x)
-> (forall x.
    Rep RoutingProfileQueueReference x -> RoutingProfileQueueReference)
-> Generic RoutingProfileQueueReference
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' :: Text -> Channel -> RoutingProfileQueueReference
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 :: (Text -> f Text)
-> RoutingProfileQueueReference -> f RoutingProfileQueueReference
routingProfileQueueReference_queueId = (RoutingProfileQueueReference -> Text)
-> (RoutingProfileQueueReference
    -> Text -> RoutingProfileQueueReference)
-> Lens
     RoutingProfileQueueReference RoutingProfileQueueReference Text Text
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 :: (Channel -> f Channel)
-> RoutingProfileQueueReference -> f RoutingProfileQueueReference
routingProfileQueueReference_channel = (RoutingProfileQueueReference -> Channel)
-> (RoutingProfileQueueReference
    -> Channel -> RoutingProfileQueueReference)
-> Lens
     RoutingProfileQueueReference
     RoutingProfileQueueReference
     Channel
     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

instance Prelude.NFData RoutingProfileQueueReference

instance Core.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
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"QueueId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
queueId),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Channel" Text -> Channel -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Channel
channel)
          ]
      )