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