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

import Amazonka.Connect.Types.Channel
import Amazonka.Connect.Types.QueueReference
import Amazonka.Connect.Types.RoutingProfileReference
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 dimensions for a set of metrics.
--
-- /See:/ 'newDimensions' smart constructor.
data Dimensions = Dimensions'
  { -- | The channel used for grouping and filters.
    Dimensions -> Maybe Channel
channel :: Prelude.Maybe Channel,
    -- | Information about the queue for which metrics are returned.
    Dimensions -> Maybe QueueReference
queue :: Prelude.Maybe QueueReference,
    Dimensions -> Maybe RoutingProfileReference
routingProfile :: Prelude.Maybe RoutingProfileReference
  }
  deriving (Dimensions -> Dimensions -> Bool
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]
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
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. 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)

-- |
-- Create a value of 'Dimensions' 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:
--
-- 'channel', 'dimensions_channel' - The channel used for grouping and filters.
--
-- 'queue', 'dimensions_queue' - Information about the queue for which metrics are returned.
--
-- 'routingProfile', 'dimensions_routingProfile' - Undocumented member.
newDimensions ::
  Dimensions
newDimensions :: Dimensions
newDimensions =
  Dimensions'
    { $sel:channel:Dimensions' :: Maybe Channel
channel = forall a. Maybe a
Prelude.Nothing,
      $sel:queue:Dimensions' :: Maybe QueueReference
queue = forall a. Maybe a
Prelude.Nothing,
      $sel:routingProfile:Dimensions' :: Maybe RoutingProfileReference
routingProfile = forall a. Maybe a
Prelude.Nothing
    }

-- | The channel used for grouping and filters.
dimensions_channel :: Lens.Lens' Dimensions (Prelude.Maybe Channel)
dimensions_channel :: Lens' Dimensions (Maybe Channel)
dimensions_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)

-- | Information about the queue for which metrics are returned.
dimensions_queue :: Lens.Lens' Dimensions (Prelude.Maybe QueueReference)
dimensions_queue :: Lens' Dimensions (Maybe QueueReference)
dimensions_queue = 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)

-- | Undocumented member.
dimensions_routingProfile :: Lens.Lens' Dimensions (Prelude.Maybe RoutingProfileReference)
dimensions_routingProfile :: Lens' Dimensions (Maybe RoutingProfileReference)
dimensions_routingProfile = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Dimensions' {Maybe RoutingProfileReference
routingProfile :: Maybe RoutingProfileReference
$sel:routingProfile:Dimensions' :: Dimensions -> Maybe RoutingProfileReference
routingProfile} -> Maybe RoutingProfileReference
routingProfile) (\s :: Dimensions
s@Dimensions' {} Maybe RoutingProfileReference
a -> Dimensions
s {$sel:routingProfile:Dimensions' :: Maybe RoutingProfileReference
routingProfile = Maybe RoutingProfileReference
a} :: Dimensions)

instance Data.FromJSON Dimensions where
  parseJSON :: Value -> Parser Dimensions
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"Dimensions"
      ( \Object
x ->
          Maybe Channel
-> Maybe QueueReference
-> Maybe RoutingProfileReference
-> Dimensions
Dimensions'
            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
"Channel")
            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
"Queue")
            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
"RoutingProfile")
      )

instance Prelude.Hashable Dimensions where
  hashWithSalt :: Int -> Dimensions -> Int
hashWithSalt Int
_salt Dimensions' {Maybe Channel
Maybe QueueReference
Maybe RoutingProfileReference
routingProfile :: Maybe RoutingProfileReference
queue :: Maybe QueueReference
channel :: Maybe Channel
$sel:routingProfile:Dimensions' :: Dimensions -> Maybe RoutingProfileReference
$sel:queue:Dimensions' :: Dimensions -> Maybe QueueReference
$sel:channel:Dimensions' :: Dimensions -> Maybe Channel
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Channel
channel
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe QueueReference
queue
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe RoutingProfileReference
routingProfile

instance Prelude.NFData Dimensions where
  rnf :: Dimensions -> ()
rnf Dimensions' {Maybe Channel
Maybe QueueReference
Maybe RoutingProfileReference
routingProfile :: Maybe RoutingProfileReference
queue :: Maybe QueueReference
channel :: Maybe Channel
$sel:routingProfile:Dimensions' :: Dimensions -> Maybe RoutingProfileReference
$sel:queue:Dimensions' :: Dimensions -> Maybe QueueReference
$sel:channel:Dimensions' :: Dimensions -> Maybe Channel
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Channel
channel
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe QueueReference
queue
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe RoutingProfileReference
routingProfile