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

import Amazonka.Connect.Types.RoutingProfileQueueReference
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | Contains information about the queue and channel for which priority and
-- delay can be set.
--
-- /See:/ 'newRoutingProfileQueueConfig' smart constructor.
data RoutingProfileQueueConfig = RoutingProfileQueueConfig'
  { -- | Contains information about a queue resource.
    RoutingProfileQueueConfig -> RoutingProfileQueueReference
queueReference :: RoutingProfileQueueReference,
    -- | The order in which contacts are to be handled for the queue. For more
    -- information, see
    -- <https://docs.aws.amazon.com/connect/latest/adminguide/concepts-routing-profiles-priority.html Queues: priority and delay>.
    RoutingProfileQueueConfig -> Natural
priority :: Prelude.Natural,
    -- | The delay, in seconds, a contact should be in the queue before they are
    -- routed to an available agent. For more information, see
    -- <https://docs.aws.amazon.com/connect/latest/adminguide/concepts-routing-profiles-priority.html Queues: priority and delay>
    -- in the /Amazon Connect Administrator Guide/.
    RoutingProfileQueueConfig -> Natural
delay :: Prelude.Natural
  }
  deriving (RoutingProfileQueueConfig -> RoutingProfileQueueConfig -> Bool
(RoutingProfileQueueConfig -> RoutingProfileQueueConfig -> Bool)
-> (RoutingProfileQueueConfig -> RoutingProfileQueueConfig -> Bool)
-> Eq RoutingProfileQueueConfig
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: RoutingProfileQueueConfig -> RoutingProfileQueueConfig -> Bool
$c/= :: RoutingProfileQueueConfig -> RoutingProfileQueueConfig -> Bool
== :: RoutingProfileQueueConfig -> RoutingProfileQueueConfig -> Bool
$c== :: RoutingProfileQueueConfig -> RoutingProfileQueueConfig -> Bool
Prelude.Eq, ReadPrec [RoutingProfileQueueConfig]
ReadPrec RoutingProfileQueueConfig
Int -> ReadS RoutingProfileQueueConfig
ReadS [RoutingProfileQueueConfig]
(Int -> ReadS RoutingProfileQueueConfig)
-> ReadS [RoutingProfileQueueConfig]
-> ReadPrec RoutingProfileQueueConfig
-> ReadPrec [RoutingProfileQueueConfig]
-> Read RoutingProfileQueueConfig
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [RoutingProfileQueueConfig]
$creadListPrec :: ReadPrec [RoutingProfileQueueConfig]
readPrec :: ReadPrec RoutingProfileQueueConfig
$creadPrec :: ReadPrec RoutingProfileQueueConfig
readList :: ReadS [RoutingProfileQueueConfig]
$creadList :: ReadS [RoutingProfileQueueConfig]
readsPrec :: Int -> ReadS RoutingProfileQueueConfig
$creadsPrec :: Int -> ReadS RoutingProfileQueueConfig
Prelude.Read, Int -> RoutingProfileQueueConfig -> ShowS
[RoutingProfileQueueConfig] -> ShowS
RoutingProfileQueueConfig -> String
(Int -> RoutingProfileQueueConfig -> ShowS)
-> (RoutingProfileQueueConfig -> String)
-> ([RoutingProfileQueueConfig] -> ShowS)
-> Show RoutingProfileQueueConfig
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [RoutingProfileQueueConfig] -> ShowS
$cshowList :: [RoutingProfileQueueConfig] -> ShowS
show :: RoutingProfileQueueConfig -> String
$cshow :: RoutingProfileQueueConfig -> String
showsPrec :: Int -> RoutingProfileQueueConfig -> ShowS
$cshowsPrec :: Int -> RoutingProfileQueueConfig -> ShowS
Prelude.Show, (forall x.
 RoutingProfileQueueConfig -> Rep RoutingProfileQueueConfig x)
-> (forall x.
    Rep RoutingProfileQueueConfig x -> RoutingProfileQueueConfig)
-> Generic RoutingProfileQueueConfig
forall x.
Rep RoutingProfileQueueConfig x -> RoutingProfileQueueConfig
forall x.
RoutingProfileQueueConfig -> Rep RoutingProfileQueueConfig x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep RoutingProfileQueueConfig x -> RoutingProfileQueueConfig
$cfrom :: forall x.
RoutingProfileQueueConfig -> Rep RoutingProfileQueueConfig x
Prelude.Generic)

-- |
-- Create a value of 'RoutingProfileQueueConfig' 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:
--
-- 'queueReference', 'routingProfileQueueConfig_queueReference' - Contains information about a queue resource.
--
-- 'priority', 'routingProfileQueueConfig_priority' - The order in which contacts are to be handled for the queue. For more
-- information, see
-- <https://docs.aws.amazon.com/connect/latest/adminguide/concepts-routing-profiles-priority.html Queues: priority and delay>.
--
-- 'delay', 'routingProfileQueueConfig_delay' - The delay, in seconds, a contact should be in the queue before they are
-- routed to an available agent. For more information, see
-- <https://docs.aws.amazon.com/connect/latest/adminguide/concepts-routing-profiles-priority.html Queues: priority and delay>
-- in the /Amazon Connect Administrator Guide/.
newRoutingProfileQueueConfig ::
  -- | 'queueReference'
  RoutingProfileQueueReference ->
  -- | 'priority'
  Prelude.Natural ->
  -- | 'delay'
  Prelude.Natural ->
  RoutingProfileQueueConfig
newRoutingProfileQueueConfig :: RoutingProfileQueueReference
-> Natural -> Natural -> RoutingProfileQueueConfig
newRoutingProfileQueueConfig
  RoutingProfileQueueReference
pQueueReference_
  Natural
pPriority_
  Natural
pDelay_ =
    RoutingProfileQueueConfig' :: RoutingProfileQueueReference
-> Natural -> Natural -> RoutingProfileQueueConfig
RoutingProfileQueueConfig'
      { $sel:queueReference:RoutingProfileQueueConfig' :: RoutingProfileQueueReference
queueReference =
          RoutingProfileQueueReference
pQueueReference_,
        $sel:priority:RoutingProfileQueueConfig' :: Natural
priority = Natural
pPriority_,
        $sel:delay:RoutingProfileQueueConfig' :: Natural
delay = Natural
pDelay_
      }

-- | Contains information about a queue resource.
routingProfileQueueConfig_queueReference :: Lens.Lens' RoutingProfileQueueConfig RoutingProfileQueueReference
routingProfileQueueConfig_queueReference :: (RoutingProfileQueueReference -> f RoutingProfileQueueReference)
-> RoutingProfileQueueConfig -> f RoutingProfileQueueConfig
routingProfileQueueConfig_queueReference = (RoutingProfileQueueConfig -> RoutingProfileQueueReference)
-> (RoutingProfileQueueConfig
    -> RoutingProfileQueueReference -> RoutingProfileQueueConfig)
-> Lens
     RoutingProfileQueueConfig
     RoutingProfileQueueConfig
     RoutingProfileQueueReference
     RoutingProfileQueueReference
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RoutingProfileQueueConfig' {RoutingProfileQueueReference
queueReference :: RoutingProfileQueueReference
$sel:queueReference:RoutingProfileQueueConfig' :: RoutingProfileQueueConfig -> RoutingProfileQueueReference
queueReference} -> RoutingProfileQueueReference
queueReference) (\s :: RoutingProfileQueueConfig
s@RoutingProfileQueueConfig' {} RoutingProfileQueueReference
a -> RoutingProfileQueueConfig
s {$sel:queueReference:RoutingProfileQueueConfig' :: RoutingProfileQueueReference
queueReference = RoutingProfileQueueReference
a} :: RoutingProfileQueueConfig)

-- | The order in which contacts are to be handled for the queue. For more
-- information, see
-- <https://docs.aws.amazon.com/connect/latest/adminguide/concepts-routing-profiles-priority.html Queues: priority and delay>.
routingProfileQueueConfig_priority :: Lens.Lens' RoutingProfileQueueConfig Prelude.Natural
routingProfileQueueConfig_priority :: (Natural -> f Natural)
-> RoutingProfileQueueConfig -> f RoutingProfileQueueConfig
routingProfileQueueConfig_priority = (RoutingProfileQueueConfig -> Natural)
-> (RoutingProfileQueueConfig
    -> Natural -> RoutingProfileQueueConfig)
-> Lens
     RoutingProfileQueueConfig RoutingProfileQueueConfig Natural Natural
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RoutingProfileQueueConfig' {Natural
priority :: Natural
$sel:priority:RoutingProfileQueueConfig' :: RoutingProfileQueueConfig -> Natural
priority} -> Natural
priority) (\s :: RoutingProfileQueueConfig
s@RoutingProfileQueueConfig' {} Natural
a -> RoutingProfileQueueConfig
s {$sel:priority:RoutingProfileQueueConfig' :: Natural
priority = Natural
a} :: RoutingProfileQueueConfig)

-- | The delay, in seconds, a contact should be in the queue before they are
-- routed to an available agent. For more information, see
-- <https://docs.aws.amazon.com/connect/latest/adminguide/concepts-routing-profiles-priority.html Queues: priority and delay>
-- in the /Amazon Connect Administrator Guide/.
routingProfileQueueConfig_delay :: Lens.Lens' RoutingProfileQueueConfig Prelude.Natural
routingProfileQueueConfig_delay :: (Natural -> f Natural)
-> RoutingProfileQueueConfig -> f RoutingProfileQueueConfig
routingProfileQueueConfig_delay = (RoutingProfileQueueConfig -> Natural)
-> (RoutingProfileQueueConfig
    -> Natural -> RoutingProfileQueueConfig)
-> Lens
     RoutingProfileQueueConfig RoutingProfileQueueConfig Natural Natural
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RoutingProfileQueueConfig' {Natural
delay :: Natural
$sel:delay:RoutingProfileQueueConfig' :: RoutingProfileQueueConfig -> Natural
delay} -> Natural
delay) (\s :: RoutingProfileQueueConfig
s@RoutingProfileQueueConfig' {} Natural
a -> RoutingProfileQueueConfig
s {$sel:delay:RoutingProfileQueueConfig' :: Natural
delay = Natural
a} :: RoutingProfileQueueConfig)

instance Prelude.Hashable RoutingProfileQueueConfig

instance Prelude.NFData RoutingProfileQueueConfig

instance Core.ToJSON RoutingProfileQueueConfig where
  toJSON :: RoutingProfileQueueConfig -> Value
toJSON RoutingProfileQueueConfig' {Natural
RoutingProfileQueueReference
delay :: Natural
priority :: Natural
queueReference :: RoutingProfileQueueReference
$sel:delay:RoutingProfileQueueConfig' :: RoutingProfileQueueConfig -> Natural
$sel:priority:RoutingProfileQueueConfig' :: RoutingProfileQueueConfig -> Natural
$sel:queueReference:RoutingProfileQueueConfig' :: RoutingProfileQueueConfig -> RoutingProfileQueueReference
..} =
    [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
"QueueReference" Text -> RoutingProfileQueueReference -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= RoutingProfileQueueReference
queueReference),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Priority" Text -> Natural -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Natural
priority),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Delay" Text -> Natural -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Natural
delay)
          ]
      )