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

import Amazonka.Connect.Types.RoutingProfileQueueReference
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 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
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]
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
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.
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'
      { $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 :: Lens' RoutingProfileQueueConfig RoutingProfileQueueReference
routingProfileQueueConfig_queueReference = 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 :: Lens' RoutingProfileQueueConfig Natural
routingProfileQueueConfig_priority = 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 :: Lens' RoutingProfileQueueConfig Natural
routingProfileQueueConfig_delay = 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 where
  hashWithSalt :: Int -> RoutingProfileQueueConfig -> Int
hashWithSalt Int
_salt RoutingProfileQueueConfig' {Natural
RoutingProfileQueueReference
delay :: Natural
priority :: Natural
queueReference :: RoutingProfileQueueReference
$sel:delay:RoutingProfileQueueConfig' :: RoutingProfileQueueConfig -> Natural
$sel:priority:RoutingProfileQueueConfig' :: RoutingProfileQueueConfig -> Natural
$sel:queueReference:RoutingProfileQueueConfig' :: RoutingProfileQueueConfig -> RoutingProfileQueueReference
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` RoutingProfileQueueReference
queueReference
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Natural
priority
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Natural
delay

instance Prelude.NFData RoutingProfileQueueConfig where
  rnf :: RoutingProfileQueueConfig -> ()
rnf RoutingProfileQueueConfig' {Natural
RoutingProfileQueueReference
delay :: Natural
priority :: Natural
queueReference :: RoutingProfileQueueReference
$sel:delay:RoutingProfileQueueConfig' :: RoutingProfileQueueConfig -> Natural
$sel:priority:RoutingProfileQueueConfig' :: RoutingProfileQueueConfig -> Natural
$sel:queueReference:RoutingProfileQueueConfig' :: RoutingProfileQueueConfig -> RoutingProfileQueueReference
..} =
    forall a. NFData a => a -> ()
Prelude.rnf RoutingProfileQueueReference
queueReference
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Natural
priority
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Natural
delay

instance Data.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
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ forall a. a -> Maybe a
Prelude.Just
              (Key
"QueueReference" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= RoutingProfileQueueReference
queueReference),
            forall a. a -> Maybe a
Prelude.Just (Key
"Priority" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Natural
priority),
            forall a. a -> Maybe a
Prelude.Just (Key
"Delay" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Natural
delay)
          ]
      )