{-# 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 #-}
module Amazonka.Connect.Types.QueueReference where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data QueueReference = QueueReference'
{
QueueReference -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
QueueReference -> Maybe Text
id :: Prelude.Maybe Prelude.Text
}
deriving (QueueReference -> QueueReference -> Bool
(QueueReference -> QueueReference -> Bool)
-> (QueueReference -> QueueReference -> Bool) -> Eq QueueReference
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: QueueReference -> QueueReference -> Bool
$c/= :: QueueReference -> QueueReference -> Bool
== :: QueueReference -> QueueReference -> Bool
$c== :: QueueReference -> QueueReference -> Bool
Prelude.Eq, ReadPrec [QueueReference]
ReadPrec QueueReference
Int -> ReadS QueueReference
ReadS [QueueReference]
(Int -> ReadS QueueReference)
-> ReadS [QueueReference]
-> ReadPrec QueueReference
-> ReadPrec [QueueReference]
-> Read QueueReference
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [QueueReference]
$creadListPrec :: ReadPrec [QueueReference]
readPrec :: ReadPrec QueueReference
$creadPrec :: ReadPrec QueueReference
readList :: ReadS [QueueReference]
$creadList :: ReadS [QueueReference]
readsPrec :: Int -> ReadS QueueReference
$creadsPrec :: Int -> ReadS QueueReference
Prelude.Read, Int -> QueueReference -> ShowS
[QueueReference] -> ShowS
QueueReference -> String
(Int -> QueueReference -> ShowS)
-> (QueueReference -> String)
-> ([QueueReference] -> ShowS)
-> Show QueueReference
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [QueueReference] -> ShowS
$cshowList :: [QueueReference] -> ShowS
show :: QueueReference -> String
$cshow :: QueueReference -> String
showsPrec :: Int -> QueueReference -> ShowS
$cshowsPrec :: Int -> QueueReference -> ShowS
Prelude.Show, (forall x. QueueReference -> Rep QueueReference x)
-> (forall x. Rep QueueReference x -> QueueReference)
-> Generic QueueReference
forall x. Rep QueueReference x -> QueueReference
forall x. QueueReference -> Rep QueueReference x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep QueueReference x -> QueueReference
$cfrom :: forall x. QueueReference -> Rep QueueReference x
Prelude.Generic)
newQueueReference ::
QueueReference
newQueueReference :: QueueReference
newQueueReference =
QueueReference' :: Maybe Text -> Maybe Text -> QueueReference
QueueReference'
{ $sel:arn:QueueReference' :: Maybe Text
arn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:id:QueueReference' :: Maybe Text
id = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
queueReference_arn :: Lens.Lens' QueueReference (Prelude.Maybe Prelude.Text)
queueReference_arn :: (Maybe Text -> f (Maybe Text))
-> QueueReference -> f QueueReference
queueReference_arn = (QueueReference -> Maybe Text)
-> (QueueReference -> Maybe Text -> QueueReference)
-> Lens QueueReference QueueReference (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\QueueReference' {Maybe Text
arn :: Maybe Text
$sel:arn:QueueReference' :: QueueReference -> Maybe Text
arn} -> Maybe Text
arn) (\s :: QueueReference
s@QueueReference' {} Maybe Text
a -> QueueReference
s {$sel:arn:QueueReference' :: Maybe Text
arn = Maybe Text
a} :: QueueReference)
queueReference_id :: Lens.Lens' QueueReference (Prelude.Maybe Prelude.Text)
queueReference_id :: (Maybe Text -> f (Maybe Text))
-> QueueReference -> f QueueReference
queueReference_id = (QueueReference -> Maybe Text)
-> (QueueReference -> Maybe Text -> QueueReference)
-> Lens QueueReference QueueReference (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\QueueReference' {Maybe Text
id :: Maybe Text
$sel:id:QueueReference' :: QueueReference -> Maybe Text
id} -> Maybe Text
id) (\s :: QueueReference
s@QueueReference' {} Maybe Text
a -> QueueReference
s {$sel:id:QueueReference' :: Maybe Text
id = Maybe Text
a} :: QueueReference)
instance Core.FromJSON QueueReference where
parseJSON :: Value -> Parser QueueReference
parseJSON =
String
-> (Object -> Parser QueueReference)
-> Value
-> Parser QueueReference
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"QueueReference"
( \Object
x ->
Maybe Text -> Maybe Text -> QueueReference
QueueReference'
(Maybe Text -> Maybe Text -> QueueReference)
-> Parser (Maybe Text) -> Parser (Maybe Text -> QueueReference)
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 -> QueueReference)
-> Parser (Maybe Text) -> Parser QueueReference
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")
)
instance Prelude.Hashable QueueReference
instance Prelude.NFData QueueReference