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

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

-- | Contains summary information about a queue.
--
-- /See:/ 'newQueueSummary' smart constructor.
data QueueSummary = QueueSummary'
  { -- | The Amazon Resource Name (ARN) of the queue.
    QueueSummary -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
    -- | The name of the queue.
    QueueSummary -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
    -- | The identifier of the queue.
    QueueSummary -> Maybe Text
id :: Prelude.Maybe Prelude.Text,
    -- | The type of queue.
    QueueSummary -> Maybe QueueType
queueType :: Prelude.Maybe QueueType
  }
  deriving (QueueSummary -> QueueSummary -> Bool
(QueueSummary -> QueueSummary -> Bool)
-> (QueueSummary -> QueueSummary -> Bool) -> Eq QueueSummary
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: QueueSummary -> QueueSummary -> Bool
$c/= :: QueueSummary -> QueueSummary -> Bool
== :: QueueSummary -> QueueSummary -> Bool
$c== :: QueueSummary -> QueueSummary -> Bool
Prelude.Eq, ReadPrec [QueueSummary]
ReadPrec QueueSummary
Int -> ReadS QueueSummary
ReadS [QueueSummary]
(Int -> ReadS QueueSummary)
-> ReadS [QueueSummary]
-> ReadPrec QueueSummary
-> ReadPrec [QueueSummary]
-> Read QueueSummary
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [QueueSummary]
$creadListPrec :: ReadPrec [QueueSummary]
readPrec :: ReadPrec QueueSummary
$creadPrec :: ReadPrec QueueSummary
readList :: ReadS [QueueSummary]
$creadList :: ReadS [QueueSummary]
readsPrec :: Int -> ReadS QueueSummary
$creadsPrec :: Int -> ReadS QueueSummary
Prelude.Read, Int -> QueueSummary -> ShowS
[QueueSummary] -> ShowS
QueueSummary -> String
(Int -> QueueSummary -> ShowS)
-> (QueueSummary -> String)
-> ([QueueSummary] -> ShowS)
-> Show QueueSummary
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [QueueSummary] -> ShowS
$cshowList :: [QueueSummary] -> ShowS
show :: QueueSummary -> String
$cshow :: QueueSummary -> String
showsPrec :: Int -> QueueSummary -> ShowS
$cshowsPrec :: Int -> QueueSummary -> ShowS
Prelude.Show, (forall x. QueueSummary -> Rep QueueSummary x)
-> (forall x. Rep QueueSummary x -> QueueSummary)
-> Generic QueueSummary
forall x. Rep QueueSummary x -> QueueSummary
forall x. QueueSummary -> Rep QueueSummary x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep QueueSummary x -> QueueSummary
$cfrom :: forall x. QueueSummary -> Rep QueueSummary x
Prelude.Generic)

-- |
-- Create a value of 'QueueSummary' 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:
--
-- 'arn', 'queueSummary_arn' - The Amazon Resource Name (ARN) of the queue.
--
-- 'name', 'queueSummary_name' - The name of the queue.
--
-- 'id', 'queueSummary_id' - The identifier of the queue.
--
-- 'queueType', 'queueSummary_queueType' - The type of queue.
newQueueSummary ::
  QueueSummary
newQueueSummary :: QueueSummary
newQueueSummary =
  QueueSummary' :: Maybe Text
-> Maybe Text -> Maybe Text -> Maybe QueueType -> QueueSummary
QueueSummary'
    { $sel:arn:QueueSummary' :: Maybe Text
arn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:name:QueueSummary' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:id:QueueSummary' :: Maybe Text
id = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:queueType:QueueSummary' :: Maybe QueueType
queueType = Maybe QueueType
forall a. Maybe a
Prelude.Nothing
    }

-- | The Amazon Resource Name (ARN) of the queue.
queueSummary_arn :: Lens.Lens' QueueSummary (Prelude.Maybe Prelude.Text)
queueSummary_arn :: (Maybe Text -> f (Maybe Text)) -> QueueSummary -> f QueueSummary
queueSummary_arn = (QueueSummary -> Maybe Text)
-> (QueueSummary -> Maybe Text -> QueueSummary)
-> Lens QueueSummary QueueSummary (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\QueueSummary' {Maybe Text
arn :: Maybe Text
$sel:arn:QueueSummary' :: QueueSummary -> Maybe Text
arn} -> Maybe Text
arn) (\s :: QueueSummary
s@QueueSummary' {} Maybe Text
a -> QueueSummary
s {$sel:arn:QueueSummary' :: Maybe Text
arn = Maybe Text
a} :: QueueSummary)

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

-- | The identifier of the queue.
queueSummary_id :: Lens.Lens' QueueSummary (Prelude.Maybe Prelude.Text)
queueSummary_id :: (Maybe Text -> f (Maybe Text)) -> QueueSummary -> f QueueSummary
queueSummary_id = (QueueSummary -> Maybe Text)
-> (QueueSummary -> Maybe Text -> QueueSummary)
-> Lens QueueSummary QueueSummary (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\QueueSummary' {Maybe Text
id :: Maybe Text
$sel:id:QueueSummary' :: QueueSummary -> Maybe Text
id} -> Maybe Text
id) (\s :: QueueSummary
s@QueueSummary' {} Maybe Text
a -> QueueSummary
s {$sel:id:QueueSummary' :: Maybe Text
id = Maybe Text
a} :: QueueSummary)

-- | The type of queue.
queueSummary_queueType :: Lens.Lens' QueueSummary (Prelude.Maybe QueueType)
queueSummary_queueType :: (Maybe QueueType -> f (Maybe QueueType))
-> QueueSummary -> f QueueSummary
queueSummary_queueType = (QueueSummary -> Maybe QueueType)
-> (QueueSummary -> Maybe QueueType -> QueueSummary)
-> Lens
     QueueSummary QueueSummary (Maybe QueueType) (Maybe QueueType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\QueueSummary' {Maybe QueueType
queueType :: Maybe QueueType
$sel:queueType:QueueSummary' :: QueueSummary -> Maybe QueueType
queueType} -> Maybe QueueType
queueType) (\s :: QueueSummary
s@QueueSummary' {} Maybe QueueType
a -> QueueSummary
s {$sel:queueType:QueueSummary' :: Maybe QueueType
queueType = Maybe QueueType
a} :: QueueSummary)

instance Core.FromJSON QueueSummary where
  parseJSON :: Value -> Parser QueueSummary
parseJSON =
    String
-> (Object -> Parser QueueSummary) -> Value -> Parser QueueSummary
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"QueueSummary"
      ( \Object
x ->
          Maybe Text
-> Maybe Text -> Maybe Text -> Maybe QueueType -> QueueSummary
QueueSummary'
            (Maybe Text
 -> Maybe Text -> Maybe Text -> Maybe QueueType -> QueueSummary)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text -> Maybe Text -> Maybe QueueType -> QueueSummary)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Arn")
            Parser
  (Maybe Text -> Maybe Text -> Maybe QueueType -> QueueSummary)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Maybe QueueType -> QueueSummary)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Name")
            Parser (Maybe Text -> Maybe QueueType -> QueueSummary)
-> Parser (Maybe Text) -> Parser (Maybe QueueType -> QueueSummary)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Id")
            Parser (Maybe QueueType -> QueueSummary)
-> Parser (Maybe QueueType) -> Parser QueueSummary
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe QueueType)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"QueueType")
      )

instance Prelude.Hashable QueueSummary

instance Prelude.NFData QueueSummary