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

import Amazonka.Connect.Types.OutboundCallerConfig
import Amazonka.Connect.Types.QueueStatus
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.
--
-- /See:/ 'newQueue' smart constructor.
data Queue = Queue'
  { -- | The description of the queue.
    Queue -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
    -- | The identifier for the hours of operation.
    Queue -> Maybe Text
hoursOfOperationId :: Prelude.Maybe Prelude.Text,
    -- | The maximum number of contacts that can be in the queue before it is
    -- considered full.
    Queue -> Maybe Natural
maxContacts :: Prelude.Maybe Prelude.Natural,
    -- | The name of the queue.
    Queue -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
    -- | The outbound caller ID name, number, and outbound whisper flow.
    Queue -> Maybe OutboundCallerConfig
outboundCallerConfig :: Prelude.Maybe OutboundCallerConfig,
    -- | The Amazon Resource Name (ARN) for the queue.
    Queue -> Maybe Text
queueArn :: Prelude.Maybe Prelude.Text,
    -- | The identifier for the queue.
    Queue -> Maybe Text
queueId :: Prelude.Maybe Prelude.Text,
    -- | The status of the queue.
    Queue -> Maybe QueueStatus
status :: Prelude.Maybe QueueStatus,
    -- | The tags used to organize, track, or control access for this resource.
    -- For example, { \"tags\": {\"key1\":\"value1\", \"key2\":\"value2\"} }.
    Queue -> Maybe (HashMap Text Text)
tags :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text)
  }
  deriving (Queue -> Queue -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Queue -> Queue -> Bool
$c/= :: Queue -> Queue -> Bool
== :: Queue -> Queue -> Bool
$c== :: Queue -> Queue -> Bool
Prelude.Eq, ReadPrec [Queue]
ReadPrec Queue
Int -> ReadS Queue
ReadS [Queue]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Queue]
$creadListPrec :: ReadPrec [Queue]
readPrec :: ReadPrec Queue
$creadPrec :: ReadPrec Queue
readList :: ReadS [Queue]
$creadList :: ReadS [Queue]
readsPrec :: Int -> ReadS Queue
$creadsPrec :: Int -> ReadS Queue
Prelude.Read, Int -> Queue -> ShowS
[Queue] -> ShowS
Queue -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Queue] -> ShowS
$cshowList :: [Queue] -> ShowS
show :: Queue -> String
$cshow :: Queue -> String
showsPrec :: Int -> Queue -> ShowS
$cshowsPrec :: Int -> Queue -> ShowS
Prelude.Show, forall x. Rep Queue x -> Queue
forall x. Queue -> Rep Queue x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Queue x -> Queue
$cfrom :: forall x. Queue -> Rep Queue x
Prelude.Generic)

-- |
-- Create a value of 'Queue' 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:
--
-- 'description', 'queue_description' - The description of the queue.
--
-- 'hoursOfOperationId', 'queue_hoursOfOperationId' - The identifier for the hours of operation.
--
-- 'maxContacts', 'queue_maxContacts' - The maximum number of contacts that can be in the queue before it is
-- considered full.
--
-- 'name', 'queue_name' - The name of the queue.
--
-- 'outboundCallerConfig', 'queue_outboundCallerConfig' - The outbound caller ID name, number, and outbound whisper flow.
--
-- 'queueArn', 'queue_queueArn' - The Amazon Resource Name (ARN) for the queue.
--
-- 'queueId', 'queue_queueId' - The identifier for the queue.
--
-- 'status', 'queue_status' - The status of the queue.
--
-- 'tags', 'queue_tags' - The tags used to organize, track, or control access for this resource.
-- For example, { \"tags\": {\"key1\":\"value1\", \"key2\":\"value2\"} }.
newQueue ::
  Queue
newQueue :: Queue
newQueue =
  Queue'
    { $sel:description:Queue' :: Maybe Text
description = forall a. Maybe a
Prelude.Nothing,
      $sel:hoursOfOperationId:Queue' :: Maybe Text
hoursOfOperationId = forall a. Maybe a
Prelude.Nothing,
      $sel:maxContacts:Queue' :: Maybe Natural
maxContacts = forall a. Maybe a
Prelude.Nothing,
      $sel:name:Queue' :: Maybe Text
name = forall a. Maybe a
Prelude.Nothing,
      $sel:outboundCallerConfig:Queue' :: Maybe OutboundCallerConfig
outboundCallerConfig = forall a. Maybe a
Prelude.Nothing,
      $sel:queueArn:Queue' :: Maybe Text
queueArn = forall a. Maybe a
Prelude.Nothing,
      $sel:queueId:Queue' :: Maybe Text
queueId = forall a. Maybe a
Prelude.Nothing,
      $sel:status:Queue' :: Maybe QueueStatus
status = forall a. Maybe a
Prelude.Nothing,
      $sel:tags:Queue' :: Maybe (HashMap Text Text)
tags = forall a. Maybe a
Prelude.Nothing
    }

-- | The description of the queue.
queue_description :: Lens.Lens' Queue (Prelude.Maybe Prelude.Text)
queue_description :: Lens' Queue (Maybe Text)
queue_description = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Queue' {Maybe Text
description :: Maybe Text
$sel:description:Queue' :: Queue -> Maybe Text
description} -> Maybe Text
description) (\s :: Queue
s@Queue' {} Maybe Text
a -> Queue
s {$sel:description:Queue' :: Maybe Text
description = Maybe Text
a} :: Queue)

-- | The identifier for the hours of operation.
queue_hoursOfOperationId :: Lens.Lens' Queue (Prelude.Maybe Prelude.Text)
queue_hoursOfOperationId :: Lens' Queue (Maybe Text)
queue_hoursOfOperationId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Queue' {Maybe Text
hoursOfOperationId :: Maybe Text
$sel:hoursOfOperationId:Queue' :: Queue -> Maybe Text
hoursOfOperationId} -> Maybe Text
hoursOfOperationId) (\s :: Queue
s@Queue' {} Maybe Text
a -> Queue
s {$sel:hoursOfOperationId:Queue' :: Maybe Text
hoursOfOperationId = Maybe Text
a} :: Queue)

-- | The maximum number of contacts that can be in the queue before it is
-- considered full.
queue_maxContacts :: Lens.Lens' Queue (Prelude.Maybe Prelude.Natural)
queue_maxContacts :: Lens' Queue (Maybe Natural)
queue_maxContacts = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Queue' {Maybe Natural
maxContacts :: Maybe Natural
$sel:maxContacts:Queue' :: Queue -> Maybe Natural
maxContacts} -> Maybe Natural
maxContacts) (\s :: Queue
s@Queue' {} Maybe Natural
a -> Queue
s {$sel:maxContacts:Queue' :: Maybe Natural
maxContacts = Maybe Natural
a} :: Queue)

-- | The name of the queue.
queue_name :: Lens.Lens' Queue (Prelude.Maybe Prelude.Text)
queue_name :: Lens' Queue (Maybe Text)
queue_name = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Queue' {Maybe Text
name :: Maybe Text
$sel:name:Queue' :: Queue -> Maybe Text
name} -> Maybe Text
name) (\s :: Queue
s@Queue' {} Maybe Text
a -> Queue
s {$sel:name:Queue' :: Maybe Text
name = Maybe Text
a} :: Queue)

-- | The outbound caller ID name, number, and outbound whisper flow.
queue_outboundCallerConfig :: Lens.Lens' Queue (Prelude.Maybe OutboundCallerConfig)
queue_outboundCallerConfig :: Lens' Queue (Maybe OutboundCallerConfig)
queue_outboundCallerConfig = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Queue' {Maybe OutboundCallerConfig
outboundCallerConfig :: Maybe OutboundCallerConfig
$sel:outboundCallerConfig:Queue' :: Queue -> Maybe OutboundCallerConfig
outboundCallerConfig} -> Maybe OutboundCallerConfig
outboundCallerConfig) (\s :: Queue
s@Queue' {} Maybe OutboundCallerConfig
a -> Queue
s {$sel:outboundCallerConfig:Queue' :: Maybe OutboundCallerConfig
outboundCallerConfig = Maybe OutboundCallerConfig
a} :: Queue)

-- | The Amazon Resource Name (ARN) for the queue.
queue_queueArn :: Lens.Lens' Queue (Prelude.Maybe Prelude.Text)
queue_queueArn :: Lens' Queue (Maybe Text)
queue_queueArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Queue' {Maybe Text
queueArn :: Maybe Text
$sel:queueArn:Queue' :: Queue -> Maybe Text
queueArn} -> Maybe Text
queueArn) (\s :: Queue
s@Queue' {} Maybe Text
a -> Queue
s {$sel:queueArn:Queue' :: Maybe Text
queueArn = Maybe Text
a} :: Queue)

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

-- | The status of the queue.
queue_status :: Lens.Lens' Queue (Prelude.Maybe QueueStatus)
queue_status :: Lens' Queue (Maybe QueueStatus)
queue_status = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Queue' {Maybe QueueStatus
status :: Maybe QueueStatus
$sel:status:Queue' :: Queue -> Maybe QueueStatus
status} -> Maybe QueueStatus
status) (\s :: Queue
s@Queue' {} Maybe QueueStatus
a -> Queue
s {$sel:status:Queue' :: Maybe QueueStatus
status = Maybe QueueStatus
a} :: Queue)

-- | The tags used to organize, track, or control access for this resource.
-- For example, { \"tags\": {\"key1\":\"value1\", \"key2\":\"value2\"} }.
queue_tags :: Lens.Lens' Queue (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
queue_tags :: Lens' Queue (Maybe (HashMap Text Text))
queue_tags = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Queue' {Maybe (HashMap Text Text)
tags :: Maybe (HashMap Text Text)
$sel:tags:Queue' :: Queue -> Maybe (HashMap Text Text)
tags} -> Maybe (HashMap Text Text)
tags) (\s :: Queue
s@Queue' {} Maybe (HashMap Text Text)
a -> Queue
s {$sel:tags:Queue' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
a} :: Queue) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance Data.FromJSON Queue where
  parseJSON :: Value -> Parser Queue
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"Queue"
      ( \Object
x ->
          Maybe Text
-> Maybe Text
-> Maybe Natural
-> Maybe Text
-> Maybe OutboundCallerConfig
-> Maybe Text
-> Maybe Text
-> Maybe QueueStatus
-> Maybe (HashMap Text Text)
-> Queue
Queue'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"Description")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"HoursOfOperationId")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"MaxContacts")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"Name")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"OutboundCallerConfig")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"QueueArn")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe 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 (Maybe a)
Data..:? Key
"Status")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"Tags" forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty)
      )

instance Prelude.Hashable Queue where
  hashWithSalt :: Int -> Queue -> Int
hashWithSalt Int
_salt Queue' {Maybe Natural
Maybe Text
Maybe (HashMap Text Text)
Maybe OutboundCallerConfig
Maybe QueueStatus
tags :: Maybe (HashMap Text Text)
status :: Maybe QueueStatus
queueId :: Maybe Text
queueArn :: Maybe Text
outboundCallerConfig :: Maybe OutboundCallerConfig
name :: Maybe Text
maxContacts :: Maybe Natural
hoursOfOperationId :: Maybe Text
description :: Maybe Text
$sel:tags:Queue' :: Queue -> Maybe (HashMap Text Text)
$sel:status:Queue' :: Queue -> Maybe QueueStatus
$sel:queueId:Queue' :: Queue -> Maybe Text
$sel:queueArn:Queue' :: Queue -> Maybe Text
$sel:outboundCallerConfig:Queue' :: Queue -> Maybe OutboundCallerConfig
$sel:name:Queue' :: Queue -> Maybe Text
$sel:maxContacts:Queue' :: Queue -> Maybe Natural
$sel:hoursOfOperationId:Queue' :: Queue -> Maybe Text
$sel:description:Queue' :: Queue -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
description
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
hoursOfOperationId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
maxContacts
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
name
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe OutboundCallerConfig
outboundCallerConfig
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
queueArn
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
queueId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe QueueStatus
status
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (HashMap Text Text)
tags

instance Prelude.NFData Queue where
  rnf :: Queue -> ()
rnf Queue' {Maybe Natural
Maybe Text
Maybe (HashMap Text Text)
Maybe OutboundCallerConfig
Maybe QueueStatus
tags :: Maybe (HashMap Text Text)
status :: Maybe QueueStatus
queueId :: Maybe Text
queueArn :: Maybe Text
outboundCallerConfig :: Maybe OutboundCallerConfig
name :: Maybe Text
maxContacts :: Maybe Natural
hoursOfOperationId :: Maybe Text
description :: Maybe Text
$sel:tags:Queue' :: Queue -> Maybe (HashMap Text Text)
$sel:status:Queue' :: Queue -> Maybe QueueStatus
$sel:queueId:Queue' :: Queue -> Maybe Text
$sel:queueArn:Queue' :: Queue -> Maybe Text
$sel:outboundCallerConfig:Queue' :: Queue -> Maybe OutboundCallerConfig
$sel:name:Queue' :: Queue -> Maybe Text
$sel:maxContacts:Queue' :: Queue -> Maybe Natural
$sel:hoursOfOperationId:Queue' :: Queue -> Maybe Text
$sel:description:Queue' :: Queue -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
description
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
hoursOfOperationId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
maxContacts
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
name
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe OutboundCallerConfig
outboundCallerConfig
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
queueArn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
queueId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe QueueStatus
status
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe (HashMap Text Text)
tags