{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# 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.GetCurrentMetricData
-- 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)
--
-- Gets the real-time metric data from the specified Amazon Connect
-- instance.
--
-- For a description of each metric, see
-- <https://docs.aws.amazon.com/connect/latest/adminguide/real-time-metrics-definitions.html Real-time Metrics Definitions>
-- in the /Amazon Connect Administrator Guide/.
module Amazonka.Connect.GetCurrentMetricData
  ( -- * Creating a Request
    GetCurrentMetricData (..),
    newGetCurrentMetricData,

    -- * Request Lenses
    getCurrentMetricData_nextToken,
    getCurrentMetricData_groupings,
    getCurrentMetricData_maxResults,
    getCurrentMetricData_instanceId,
    getCurrentMetricData_filters,
    getCurrentMetricData_currentMetrics,

    -- * Destructuring the Response
    GetCurrentMetricDataResponse (..),
    newGetCurrentMetricDataResponse,

    -- * Response Lenses
    getCurrentMetricDataResponse_metricResults,
    getCurrentMetricDataResponse_dataSnapshotTime,
    getCurrentMetricDataResponse_nextToken,
    getCurrentMetricDataResponse_httpStatus,
  )
where

import Amazonka.Connect.Types
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | /See:/ 'newGetCurrentMetricData' smart constructor.
data GetCurrentMetricData = GetCurrentMetricData'
  { -- | The token for the next set of results. Use the value returned in the
    -- previous response in the next request to retrieve the next set of
    -- results.
    --
    -- The token expires after 5 minutes from the time it is created.
    -- Subsequent requests that use the token must use the same request
    -- parameters as the request that generated the token.
    GetCurrentMetricData -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The grouping applied to the metrics returned. For example, when grouped
    -- by @QUEUE@, the metrics returned apply to each queue rather than
    -- aggregated for all queues. If you group by @CHANNEL@, you should include
    -- a Channels filter. VOICE, CHAT, and TASK channels are supported.
    --
    -- If no @Grouping@ is included in the request, a summary of metrics is
    -- returned.
    GetCurrentMetricData -> Maybe [Grouping]
groupings :: Prelude.Maybe [Grouping],
    -- | The maximum number of results to return per page.
    GetCurrentMetricData -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
    -- | The identifier of the Amazon Connect instance. You can find the
    -- instanceId in the ARN of the instance.
    GetCurrentMetricData -> Text
instanceId :: Prelude.Text,
    -- | The queues, up to 100, or channels, to use to filter the metrics
    -- returned. Metric data is retrieved only for the resources associated
    -- with the queues or channels included in the filter. You can include both
    -- queue IDs and queue ARNs in the same request. VOICE, CHAT, and TASK
    -- channels are supported.
    GetCurrentMetricData -> Filters
filters :: Filters,
    -- | The metrics to retrieve. Specify the name and unit for each metric. The
    -- following metrics are available. For a description of all the metrics,
    -- see
    -- <https://docs.aws.amazon.com/connect/latest/adminguide/real-time-metrics-definitions.html Real-time Metrics Definitions>
    -- in the /Amazon Connect Administrator Guide/.
    --
    -- [AGENTS_AFTER_CONTACT_WORK]
    --     Unit: COUNT
    --
    --     Name in real-time metrics report:
    --     <https://docs.aws.amazon.com/connect/latest/adminguide/real-time-metrics-definitions.html#aftercallwork-real-time ACW>
    --
    -- [AGENTS_AVAILABLE]
    --     Unit: COUNT
    --
    --     Name in real-time metrics report:
    --     <https://docs.aws.amazon.com/connect/latest/adminguide/real-time-metrics-definitions.html#available-real-time Available>
    --
    -- [AGENTS_ERROR]
    --     Unit: COUNT
    --
    --     Name in real-time metrics report:
    --     <https://docs.aws.amazon.com/connect/latest/adminguide/real-time-metrics-definitions.html#error-real-time Error>
    --
    -- [AGENTS_NON_PRODUCTIVE]
    --     Unit: COUNT
    --
    --     Name in real-time metrics report:
    --     <https://docs.aws.amazon.com/connect/latest/adminguide/real-time-metrics-definitions.html#non-productive-time-real-time NPT (Non-Productive Time)>
    --
    -- [AGENTS_ON_CALL]
    --     Unit: COUNT
    --
    --     Name in real-time metrics report:
    --     <https://docs.aws.amazon.com/connect/latest/adminguide/real-time-metrics-definitions.html#on-call-real-time On contact>
    --
    -- [AGENTS_ON_CONTACT]
    --     Unit: COUNT
    --
    --     Name in real-time metrics report:
    --     <https://docs.aws.amazon.com/connect/latest/adminguide/real-time-metrics-definitions.html#on-call-real-time On contact>
    --
    -- [AGENTS_ONLINE]
    --     Unit: COUNT
    --
    --     Name in real-time metrics report:
    --     <https://docs.aws.amazon.com/connect/latest/adminguide/real-time-metrics-definitions.html#online-real-time Online>
    --
    -- [AGENTS_STAFFED]
    --     Unit: COUNT
    --
    --     Name in real-time metrics report:
    --     <https://docs.aws.amazon.com/connect/latest/adminguide/real-time-metrics-definitions.html#staffed-real-time Staffed>
    --
    -- [CONTACTS_IN_QUEUE]
    --     Unit: COUNT
    --
    --     Name in real-time metrics report:
    --     <https://docs.aws.amazon.com/connect/latest/adminguide/real-time-metrics-definitions.html#in-queue-real-time In queue>
    --
    -- [CONTACTS_SCHEDULED]
    --     Unit: COUNT
    --
    --     Name in real-time metrics report:
    --     <https://docs.aws.amazon.com/connect/latest/adminguide/real-time-metrics-definitions.html#scheduled-real-time Scheduled>
    --
    -- [OLDEST_CONTACT_AGE]
    --     Unit: SECONDS
    --
    --     When you use groupings, Unit says SECONDS and the Value is returned
    --     in SECONDS.
    --
    --     When you do not use groupings, Unit says SECONDS but the Value is
    --     returned in MILLISECONDS. For example, if you get a response like
    --     this:
    --
    --     @{ \"Metric\": { \"Name\": \"OLDEST_CONTACT_AGE\", \"Unit\": \"SECONDS\" }, \"Value\": 24113.0 @}
    --
    --     The actual OLDEST_CONTACT_AGE is 24 seconds.
    --
    --     Name in real-time metrics report:
    --     <https://docs.aws.amazon.com/connect/latest/adminguide/real-time-metrics-definitions.html#oldest-real-time Oldest>
    --
    -- [SLOTS_ACTIVE]
    --     Unit: COUNT
    --
    --     Name in real-time metrics report:
    --     <https://docs.aws.amazon.com/connect/latest/adminguide/real-time-metrics-definitions.html#active-real-time Active>
    --
    -- [SLOTS_AVAILABLE]
    --     Unit: COUNT
    --
    --     Name in real-time metrics report:
    --     <https://docs.aws.amazon.com/connect/latest/adminguide/real-time-metrics-definitions.html#availability-real-time Availability>
    GetCurrentMetricData -> [CurrentMetric]
currentMetrics :: [CurrentMetric]
  }
  deriving (GetCurrentMetricData -> GetCurrentMetricData -> Bool
(GetCurrentMetricData -> GetCurrentMetricData -> Bool)
-> (GetCurrentMetricData -> GetCurrentMetricData -> Bool)
-> Eq GetCurrentMetricData
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetCurrentMetricData -> GetCurrentMetricData -> Bool
$c/= :: GetCurrentMetricData -> GetCurrentMetricData -> Bool
== :: GetCurrentMetricData -> GetCurrentMetricData -> Bool
$c== :: GetCurrentMetricData -> GetCurrentMetricData -> Bool
Prelude.Eq, ReadPrec [GetCurrentMetricData]
ReadPrec GetCurrentMetricData
Int -> ReadS GetCurrentMetricData
ReadS [GetCurrentMetricData]
(Int -> ReadS GetCurrentMetricData)
-> ReadS [GetCurrentMetricData]
-> ReadPrec GetCurrentMetricData
-> ReadPrec [GetCurrentMetricData]
-> Read GetCurrentMetricData
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetCurrentMetricData]
$creadListPrec :: ReadPrec [GetCurrentMetricData]
readPrec :: ReadPrec GetCurrentMetricData
$creadPrec :: ReadPrec GetCurrentMetricData
readList :: ReadS [GetCurrentMetricData]
$creadList :: ReadS [GetCurrentMetricData]
readsPrec :: Int -> ReadS GetCurrentMetricData
$creadsPrec :: Int -> ReadS GetCurrentMetricData
Prelude.Read, Int -> GetCurrentMetricData -> ShowS
[GetCurrentMetricData] -> ShowS
GetCurrentMetricData -> String
(Int -> GetCurrentMetricData -> ShowS)
-> (GetCurrentMetricData -> String)
-> ([GetCurrentMetricData] -> ShowS)
-> Show GetCurrentMetricData
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetCurrentMetricData] -> ShowS
$cshowList :: [GetCurrentMetricData] -> ShowS
show :: GetCurrentMetricData -> String
$cshow :: GetCurrentMetricData -> String
showsPrec :: Int -> GetCurrentMetricData -> ShowS
$cshowsPrec :: Int -> GetCurrentMetricData -> ShowS
Prelude.Show, (forall x. GetCurrentMetricData -> Rep GetCurrentMetricData x)
-> (forall x. Rep GetCurrentMetricData x -> GetCurrentMetricData)
-> Generic GetCurrentMetricData
forall x. Rep GetCurrentMetricData x -> GetCurrentMetricData
forall x. GetCurrentMetricData -> Rep GetCurrentMetricData x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetCurrentMetricData x -> GetCurrentMetricData
$cfrom :: forall x. GetCurrentMetricData -> Rep GetCurrentMetricData x
Prelude.Generic)

-- |
-- Create a value of 'GetCurrentMetricData' 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:
--
-- 'nextToken', 'getCurrentMetricData_nextToken' - The token for the next set of results. Use the value returned in the
-- previous response in the next request to retrieve the next set of
-- results.
--
-- The token expires after 5 minutes from the time it is created.
-- Subsequent requests that use the token must use the same request
-- parameters as the request that generated the token.
--
-- 'groupings', 'getCurrentMetricData_groupings' - The grouping applied to the metrics returned. For example, when grouped
-- by @QUEUE@, the metrics returned apply to each queue rather than
-- aggregated for all queues. If you group by @CHANNEL@, you should include
-- a Channels filter. VOICE, CHAT, and TASK channels are supported.
--
-- If no @Grouping@ is included in the request, a summary of metrics is
-- returned.
--
-- 'maxResults', 'getCurrentMetricData_maxResults' - The maximum number of results to return per page.
--
-- 'instanceId', 'getCurrentMetricData_instanceId' - The identifier of the Amazon Connect instance. You can find the
-- instanceId in the ARN of the instance.
--
-- 'filters', 'getCurrentMetricData_filters' - The queues, up to 100, or channels, to use to filter the metrics
-- returned. Metric data is retrieved only for the resources associated
-- with the queues or channels included in the filter. You can include both
-- queue IDs and queue ARNs in the same request. VOICE, CHAT, and TASK
-- channels are supported.
--
-- 'currentMetrics', 'getCurrentMetricData_currentMetrics' - The metrics to retrieve. Specify the name and unit for each metric. The
-- following metrics are available. For a description of all the metrics,
-- see
-- <https://docs.aws.amazon.com/connect/latest/adminguide/real-time-metrics-definitions.html Real-time Metrics Definitions>
-- in the /Amazon Connect Administrator Guide/.
--
-- [AGENTS_AFTER_CONTACT_WORK]
--     Unit: COUNT
--
--     Name in real-time metrics report:
--     <https://docs.aws.amazon.com/connect/latest/adminguide/real-time-metrics-definitions.html#aftercallwork-real-time ACW>
--
-- [AGENTS_AVAILABLE]
--     Unit: COUNT
--
--     Name in real-time metrics report:
--     <https://docs.aws.amazon.com/connect/latest/adminguide/real-time-metrics-definitions.html#available-real-time Available>
--
-- [AGENTS_ERROR]
--     Unit: COUNT
--
--     Name in real-time metrics report:
--     <https://docs.aws.amazon.com/connect/latest/adminguide/real-time-metrics-definitions.html#error-real-time Error>
--
-- [AGENTS_NON_PRODUCTIVE]
--     Unit: COUNT
--
--     Name in real-time metrics report:
--     <https://docs.aws.amazon.com/connect/latest/adminguide/real-time-metrics-definitions.html#non-productive-time-real-time NPT (Non-Productive Time)>
--
-- [AGENTS_ON_CALL]
--     Unit: COUNT
--
--     Name in real-time metrics report:
--     <https://docs.aws.amazon.com/connect/latest/adminguide/real-time-metrics-definitions.html#on-call-real-time On contact>
--
-- [AGENTS_ON_CONTACT]
--     Unit: COUNT
--
--     Name in real-time metrics report:
--     <https://docs.aws.amazon.com/connect/latest/adminguide/real-time-metrics-definitions.html#on-call-real-time On contact>
--
-- [AGENTS_ONLINE]
--     Unit: COUNT
--
--     Name in real-time metrics report:
--     <https://docs.aws.amazon.com/connect/latest/adminguide/real-time-metrics-definitions.html#online-real-time Online>
--
-- [AGENTS_STAFFED]
--     Unit: COUNT
--
--     Name in real-time metrics report:
--     <https://docs.aws.amazon.com/connect/latest/adminguide/real-time-metrics-definitions.html#staffed-real-time Staffed>
--
-- [CONTACTS_IN_QUEUE]
--     Unit: COUNT
--
--     Name in real-time metrics report:
--     <https://docs.aws.amazon.com/connect/latest/adminguide/real-time-metrics-definitions.html#in-queue-real-time In queue>
--
-- [CONTACTS_SCHEDULED]
--     Unit: COUNT
--
--     Name in real-time metrics report:
--     <https://docs.aws.amazon.com/connect/latest/adminguide/real-time-metrics-definitions.html#scheduled-real-time Scheduled>
--
-- [OLDEST_CONTACT_AGE]
--     Unit: SECONDS
--
--     When you use groupings, Unit says SECONDS and the Value is returned
--     in SECONDS.
--
--     When you do not use groupings, Unit says SECONDS but the Value is
--     returned in MILLISECONDS. For example, if you get a response like
--     this:
--
--     @{ \"Metric\": { \"Name\": \"OLDEST_CONTACT_AGE\", \"Unit\": \"SECONDS\" }, \"Value\": 24113.0 @}
--
--     The actual OLDEST_CONTACT_AGE is 24 seconds.
--
--     Name in real-time metrics report:
--     <https://docs.aws.amazon.com/connect/latest/adminguide/real-time-metrics-definitions.html#oldest-real-time Oldest>
--
-- [SLOTS_ACTIVE]
--     Unit: COUNT
--
--     Name in real-time metrics report:
--     <https://docs.aws.amazon.com/connect/latest/adminguide/real-time-metrics-definitions.html#active-real-time Active>
--
-- [SLOTS_AVAILABLE]
--     Unit: COUNT
--
--     Name in real-time metrics report:
--     <https://docs.aws.amazon.com/connect/latest/adminguide/real-time-metrics-definitions.html#availability-real-time Availability>
newGetCurrentMetricData ::
  -- | 'instanceId'
  Prelude.Text ->
  -- | 'filters'
  Filters ->
  GetCurrentMetricData
newGetCurrentMetricData :: Text -> Filters -> GetCurrentMetricData
newGetCurrentMetricData Text
pInstanceId_ Filters
pFilters_ =
  GetCurrentMetricData' :: Maybe Text
-> Maybe [Grouping]
-> Maybe Natural
-> Text
-> Filters
-> [CurrentMetric]
-> GetCurrentMetricData
GetCurrentMetricData'
    { $sel:nextToken:GetCurrentMetricData' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:groupings:GetCurrentMetricData' :: Maybe [Grouping]
groupings = Maybe [Grouping]
forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:GetCurrentMetricData' :: Maybe Natural
maxResults = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:instanceId:GetCurrentMetricData' :: Text
instanceId = Text
pInstanceId_,
      $sel:filters:GetCurrentMetricData' :: Filters
filters = Filters
pFilters_,
      $sel:currentMetrics:GetCurrentMetricData' :: [CurrentMetric]
currentMetrics = [CurrentMetric]
forall a. Monoid a => a
Prelude.mempty
    }

-- | The token for the next set of results. Use the value returned in the
-- previous response in the next request to retrieve the next set of
-- results.
--
-- The token expires after 5 minutes from the time it is created.
-- Subsequent requests that use the token must use the same request
-- parameters as the request that generated the token.
getCurrentMetricData_nextToken :: Lens.Lens' GetCurrentMetricData (Prelude.Maybe Prelude.Text)
getCurrentMetricData_nextToken :: (Maybe Text -> f (Maybe Text))
-> GetCurrentMetricData -> f GetCurrentMetricData
getCurrentMetricData_nextToken = (GetCurrentMetricData -> Maybe Text)
-> (GetCurrentMetricData -> Maybe Text -> GetCurrentMetricData)
-> Lens
     GetCurrentMetricData GetCurrentMetricData (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetCurrentMetricData' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:GetCurrentMetricData' :: GetCurrentMetricData -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: GetCurrentMetricData
s@GetCurrentMetricData' {} Maybe Text
a -> GetCurrentMetricData
s {$sel:nextToken:GetCurrentMetricData' :: Maybe Text
nextToken = Maybe Text
a} :: GetCurrentMetricData)

-- | The grouping applied to the metrics returned. For example, when grouped
-- by @QUEUE@, the metrics returned apply to each queue rather than
-- aggregated for all queues. If you group by @CHANNEL@, you should include
-- a Channels filter. VOICE, CHAT, and TASK channels are supported.
--
-- If no @Grouping@ is included in the request, a summary of metrics is
-- returned.
getCurrentMetricData_groupings :: Lens.Lens' GetCurrentMetricData (Prelude.Maybe [Grouping])
getCurrentMetricData_groupings :: (Maybe [Grouping] -> f (Maybe [Grouping]))
-> GetCurrentMetricData -> f GetCurrentMetricData
getCurrentMetricData_groupings = (GetCurrentMetricData -> Maybe [Grouping])
-> (GetCurrentMetricData
    -> Maybe [Grouping] -> GetCurrentMetricData)
-> Lens
     GetCurrentMetricData
     GetCurrentMetricData
     (Maybe [Grouping])
     (Maybe [Grouping])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetCurrentMetricData' {Maybe [Grouping]
groupings :: Maybe [Grouping]
$sel:groupings:GetCurrentMetricData' :: GetCurrentMetricData -> Maybe [Grouping]
groupings} -> Maybe [Grouping]
groupings) (\s :: GetCurrentMetricData
s@GetCurrentMetricData' {} Maybe [Grouping]
a -> GetCurrentMetricData
s {$sel:groupings:GetCurrentMetricData' :: Maybe [Grouping]
groupings = Maybe [Grouping]
a} :: GetCurrentMetricData) ((Maybe [Grouping] -> f (Maybe [Grouping]))
 -> GetCurrentMetricData -> f GetCurrentMetricData)
-> ((Maybe [Grouping] -> f (Maybe [Grouping]))
    -> Maybe [Grouping] -> f (Maybe [Grouping]))
-> (Maybe [Grouping] -> f (Maybe [Grouping]))
-> GetCurrentMetricData
-> f GetCurrentMetricData
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Grouping] [Grouping] [Grouping] [Grouping]
-> Iso
     (Maybe [Grouping])
     (Maybe [Grouping])
     (Maybe [Grouping])
     (Maybe [Grouping])
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 AnIso [Grouping] [Grouping] [Grouping] [Grouping]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The maximum number of results to return per page.
getCurrentMetricData_maxResults :: Lens.Lens' GetCurrentMetricData (Prelude.Maybe Prelude.Natural)
getCurrentMetricData_maxResults :: (Maybe Natural -> f (Maybe Natural))
-> GetCurrentMetricData -> f GetCurrentMetricData
getCurrentMetricData_maxResults = (GetCurrentMetricData -> Maybe Natural)
-> (GetCurrentMetricData -> Maybe Natural -> GetCurrentMetricData)
-> Lens
     GetCurrentMetricData
     GetCurrentMetricData
     (Maybe Natural)
     (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetCurrentMetricData' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:GetCurrentMetricData' :: GetCurrentMetricData -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: GetCurrentMetricData
s@GetCurrentMetricData' {} Maybe Natural
a -> GetCurrentMetricData
s {$sel:maxResults:GetCurrentMetricData' :: Maybe Natural
maxResults = Maybe Natural
a} :: GetCurrentMetricData)

-- | The identifier of the Amazon Connect instance. You can find the
-- instanceId in the ARN of the instance.
getCurrentMetricData_instanceId :: Lens.Lens' GetCurrentMetricData Prelude.Text
getCurrentMetricData_instanceId :: (Text -> f Text) -> GetCurrentMetricData -> f GetCurrentMetricData
getCurrentMetricData_instanceId = (GetCurrentMetricData -> Text)
-> (GetCurrentMetricData -> Text -> GetCurrentMetricData)
-> Lens GetCurrentMetricData GetCurrentMetricData Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetCurrentMetricData' {Text
instanceId :: Text
$sel:instanceId:GetCurrentMetricData' :: GetCurrentMetricData -> Text
instanceId} -> Text
instanceId) (\s :: GetCurrentMetricData
s@GetCurrentMetricData' {} Text
a -> GetCurrentMetricData
s {$sel:instanceId:GetCurrentMetricData' :: Text
instanceId = Text
a} :: GetCurrentMetricData)

-- | The queues, up to 100, or channels, to use to filter the metrics
-- returned. Metric data is retrieved only for the resources associated
-- with the queues or channels included in the filter. You can include both
-- queue IDs and queue ARNs in the same request. VOICE, CHAT, and TASK
-- channels are supported.
getCurrentMetricData_filters :: Lens.Lens' GetCurrentMetricData Filters
getCurrentMetricData_filters :: (Filters -> f Filters)
-> GetCurrentMetricData -> f GetCurrentMetricData
getCurrentMetricData_filters = (GetCurrentMetricData -> Filters)
-> (GetCurrentMetricData -> Filters -> GetCurrentMetricData)
-> Lens GetCurrentMetricData GetCurrentMetricData Filters Filters
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetCurrentMetricData' {Filters
filters :: Filters
$sel:filters:GetCurrentMetricData' :: GetCurrentMetricData -> Filters
filters} -> Filters
filters) (\s :: GetCurrentMetricData
s@GetCurrentMetricData' {} Filters
a -> GetCurrentMetricData
s {$sel:filters:GetCurrentMetricData' :: Filters
filters = Filters
a} :: GetCurrentMetricData)

-- | The metrics to retrieve. Specify the name and unit for each metric. The
-- following metrics are available. For a description of all the metrics,
-- see
-- <https://docs.aws.amazon.com/connect/latest/adminguide/real-time-metrics-definitions.html Real-time Metrics Definitions>
-- in the /Amazon Connect Administrator Guide/.
--
-- [AGENTS_AFTER_CONTACT_WORK]
--     Unit: COUNT
--
--     Name in real-time metrics report:
--     <https://docs.aws.amazon.com/connect/latest/adminguide/real-time-metrics-definitions.html#aftercallwork-real-time ACW>
--
-- [AGENTS_AVAILABLE]
--     Unit: COUNT
--
--     Name in real-time metrics report:
--     <https://docs.aws.amazon.com/connect/latest/adminguide/real-time-metrics-definitions.html#available-real-time Available>
--
-- [AGENTS_ERROR]
--     Unit: COUNT
--
--     Name in real-time metrics report:
--     <https://docs.aws.amazon.com/connect/latest/adminguide/real-time-metrics-definitions.html#error-real-time Error>
--
-- [AGENTS_NON_PRODUCTIVE]
--     Unit: COUNT
--
--     Name in real-time metrics report:
--     <https://docs.aws.amazon.com/connect/latest/adminguide/real-time-metrics-definitions.html#non-productive-time-real-time NPT (Non-Productive Time)>
--
-- [AGENTS_ON_CALL]
--     Unit: COUNT
--
--     Name in real-time metrics report:
--     <https://docs.aws.amazon.com/connect/latest/adminguide/real-time-metrics-definitions.html#on-call-real-time On contact>
--
-- [AGENTS_ON_CONTACT]
--     Unit: COUNT
--
--     Name in real-time metrics report:
--     <https://docs.aws.amazon.com/connect/latest/adminguide/real-time-metrics-definitions.html#on-call-real-time On contact>
--
-- [AGENTS_ONLINE]
--     Unit: COUNT
--
--     Name in real-time metrics report:
--     <https://docs.aws.amazon.com/connect/latest/adminguide/real-time-metrics-definitions.html#online-real-time Online>
--
-- [AGENTS_STAFFED]
--     Unit: COUNT
--
--     Name in real-time metrics report:
--     <https://docs.aws.amazon.com/connect/latest/adminguide/real-time-metrics-definitions.html#staffed-real-time Staffed>
--
-- [CONTACTS_IN_QUEUE]
--     Unit: COUNT
--
--     Name in real-time metrics report:
--     <https://docs.aws.amazon.com/connect/latest/adminguide/real-time-metrics-definitions.html#in-queue-real-time In queue>
--
-- [CONTACTS_SCHEDULED]
--     Unit: COUNT
--
--     Name in real-time metrics report:
--     <https://docs.aws.amazon.com/connect/latest/adminguide/real-time-metrics-definitions.html#scheduled-real-time Scheduled>
--
-- [OLDEST_CONTACT_AGE]
--     Unit: SECONDS
--
--     When you use groupings, Unit says SECONDS and the Value is returned
--     in SECONDS.
--
--     When you do not use groupings, Unit says SECONDS but the Value is
--     returned in MILLISECONDS. For example, if you get a response like
--     this:
--
--     @{ \"Metric\": { \"Name\": \"OLDEST_CONTACT_AGE\", \"Unit\": \"SECONDS\" }, \"Value\": 24113.0 @}
--
--     The actual OLDEST_CONTACT_AGE is 24 seconds.
--
--     Name in real-time metrics report:
--     <https://docs.aws.amazon.com/connect/latest/adminguide/real-time-metrics-definitions.html#oldest-real-time Oldest>
--
-- [SLOTS_ACTIVE]
--     Unit: COUNT
--
--     Name in real-time metrics report:
--     <https://docs.aws.amazon.com/connect/latest/adminguide/real-time-metrics-definitions.html#active-real-time Active>
--
-- [SLOTS_AVAILABLE]
--     Unit: COUNT
--
--     Name in real-time metrics report:
--     <https://docs.aws.amazon.com/connect/latest/adminguide/real-time-metrics-definitions.html#availability-real-time Availability>
getCurrentMetricData_currentMetrics :: Lens.Lens' GetCurrentMetricData [CurrentMetric]
getCurrentMetricData_currentMetrics :: ([CurrentMetric] -> f [CurrentMetric])
-> GetCurrentMetricData -> f GetCurrentMetricData
getCurrentMetricData_currentMetrics = (GetCurrentMetricData -> [CurrentMetric])
-> (GetCurrentMetricData
    -> [CurrentMetric] -> GetCurrentMetricData)
-> Lens
     GetCurrentMetricData
     GetCurrentMetricData
     [CurrentMetric]
     [CurrentMetric]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetCurrentMetricData' {[CurrentMetric]
currentMetrics :: [CurrentMetric]
$sel:currentMetrics:GetCurrentMetricData' :: GetCurrentMetricData -> [CurrentMetric]
currentMetrics} -> [CurrentMetric]
currentMetrics) (\s :: GetCurrentMetricData
s@GetCurrentMetricData' {} [CurrentMetric]
a -> GetCurrentMetricData
s {$sel:currentMetrics:GetCurrentMetricData' :: [CurrentMetric]
currentMetrics = [CurrentMetric]
a} :: GetCurrentMetricData) (([CurrentMetric] -> f [CurrentMetric])
 -> GetCurrentMetricData -> f GetCurrentMetricData)
-> (([CurrentMetric] -> f [CurrentMetric])
    -> [CurrentMetric] -> f [CurrentMetric])
-> ([CurrentMetric] -> f [CurrentMetric])
-> GetCurrentMetricData
-> f GetCurrentMetricData
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([CurrentMetric] -> f [CurrentMetric])
-> [CurrentMetric] -> f [CurrentMetric]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance Core.AWSRequest GetCurrentMetricData where
  type
    AWSResponse GetCurrentMetricData =
      GetCurrentMetricDataResponse
  request :: GetCurrentMetricData -> Request GetCurrentMetricData
request = Service -> GetCurrentMetricData -> Request GetCurrentMetricData
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy GetCurrentMetricData
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse GetCurrentMetricData)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse GetCurrentMetricData))
-> Logger
-> Service
-> Proxy GetCurrentMetricData
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse GetCurrentMetricData)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe [CurrentMetricResult]
-> Maybe POSIX -> Maybe Text -> Int -> GetCurrentMetricDataResponse
GetCurrentMetricDataResponse'
            (Maybe [CurrentMetricResult]
 -> Maybe POSIX
 -> Maybe Text
 -> Int
 -> GetCurrentMetricDataResponse)
-> Either String (Maybe [CurrentMetricResult])
-> Either
     String
     (Maybe POSIX -> Maybe Text -> Int -> GetCurrentMetricDataResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object
-> Text -> Either String (Maybe (Maybe [CurrentMetricResult]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"MetricResults" Either String (Maybe (Maybe [CurrentMetricResult]))
-> Maybe [CurrentMetricResult]
-> Either String (Maybe [CurrentMetricResult])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [CurrentMetricResult]
forall a. Monoid a => a
Prelude.mempty)
            Either
  String
  (Maybe POSIX -> Maybe Text -> Int -> GetCurrentMetricDataResponse)
-> Either String (Maybe POSIX)
-> Either
     String (Maybe Text -> Int -> GetCurrentMetricDataResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"DataSnapshotTime")
            Either String (Maybe Text -> Int -> GetCurrentMetricDataResponse)
-> Either String (Maybe Text)
-> Either String (Int -> GetCurrentMetricDataResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"NextToken")
            Either String (Int -> GetCurrentMetricDataResponse)
-> Either String Int -> Either String GetCurrentMetricDataResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Int -> Either String Int
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (Int -> Int
forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance Prelude.Hashable GetCurrentMetricData

instance Prelude.NFData GetCurrentMetricData

instance Core.ToHeaders GetCurrentMetricData where
  toHeaders :: GetCurrentMetricData -> ResponseHeaders
toHeaders =
    ResponseHeaders -> GetCurrentMetricData -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
      ( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"Content-Type"
              HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"application/x-amz-json-1.1" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Core.ToJSON GetCurrentMetricData where
  toJSON :: GetCurrentMetricData -> Value
toJSON GetCurrentMetricData' {[CurrentMetric]
Maybe Natural
Maybe [Grouping]
Maybe Text
Text
Filters
currentMetrics :: [CurrentMetric]
filters :: Filters
instanceId :: Text
maxResults :: Maybe Natural
groupings :: Maybe [Grouping]
nextToken :: Maybe Text
$sel:currentMetrics:GetCurrentMetricData' :: GetCurrentMetricData -> [CurrentMetric]
$sel:filters:GetCurrentMetricData' :: GetCurrentMetricData -> Filters
$sel:instanceId:GetCurrentMetricData' :: GetCurrentMetricData -> Text
$sel:maxResults:GetCurrentMetricData' :: GetCurrentMetricData -> Maybe Natural
$sel:groupings:GetCurrentMetricData' :: GetCurrentMetricData -> Maybe [Grouping]
$sel:nextToken:GetCurrentMetricData' :: GetCurrentMetricData -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"NextToken" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
nextToken,
            (Text
"Groupings" Text -> [Grouping] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) ([Grouping] -> Pair) -> Maybe [Grouping] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Grouping]
groupings,
            (Text
"MaxResults" Text -> Natural -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Natural -> Pair) -> Maybe Natural -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
maxResults,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Filters" Text -> Filters -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Filters
filters),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              (Text
"CurrentMetrics" Text -> [CurrentMetric] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= [CurrentMetric]
currentMetrics)
          ]
      )

instance Core.ToPath GetCurrentMetricData where
  toPath :: GetCurrentMetricData -> ByteString
toPath GetCurrentMetricData' {[CurrentMetric]
Maybe Natural
Maybe [Grouping]
Maybe Text
Text
Filters
currentMetrics :: [CurrentMetric]
filters :: Filters
instanceId :: Text
maxResults :: Maybe Natural
groupings :: Maybe [Grouping]
nextToken :: Maybe Text
$sel:currentMetrics:GetCurrentMetricData' :: GetCurrentMetricData -> [CurrentMetric]
$sel:filters:GetCurrentMetricData' :: GetCurrentMetricData -> Filters
$sel:instanceId:GetCurrentMetricData' :: GetCurrentMetricData -> Text
$sel:maxResults:GetCurrentMetricData' :: GetCurrentMetricData -> Maybe Natural
$sel:groupings:GetCurrentMetricData' :: GetCurrentMetricData -> Maybe [Grouping]
$sel:nextToken:GetCurrentMetricData' :: GetCurrentMetricData -> Maybe Text
..} =
    [ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ByteString
"/metrics/current/", Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
instanceId]

instance Core.ToQuery GetCurrentMetricData where
  toQuery :: GetCurrentMetricData -> QueryString
toQuery = QueryString -> GetCurrentMetricData -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty

-- | /See:/ 'newGetCurrentMetricDataResponse' smart constructor.
data GetCurrentMetricDataResponse = GetCurrentMetricDataResponse'
  { -- | Information about the real-time metrics.
    GetCurrentMetricDataResponse -> Maybe [CurrentMetricResult]
metricResults :: Prelude.Maybe [CurrentMetricResult],
    -- | The time at which the metrics were retrieved and cached for pagination.
    GetCurrentMetricDataResponse -> Maybe POSIX
dataSnapshotTime :: Prelude.Maybe Core.POSIX,
    -- | If there are additional results, this is the token for the next set of
    -- results.
    --
    -- The token expires after 5 minutes from the time it is created.
    -- Subsequent requests that use the token must use the same request
    -- parameters as the request that generated the token.
    GetCurrentMetricDataResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    GetCurrentMetricDataResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (GetCurrentMetricDataResponse
-> GetCurrentMetricDataResponse -> Bool
(GetCurrentMetricDataResponse
 -> GetCurrentMetricDataResponse -> Bool)
-> (GetCurrentMetricDataResponse
    -> GetCurrentMetricDataResponse -> Bool)
-> Eq GetCurrentMetricDataResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetCurrentMetricDataResponse
-> GetCurrentMetricDataResponse -> Bool
$c/= :: GetCurrentMetricDataResponse
-> GetCurrentMetricDataResponse -> Bool
== :: GetCurrentMetricDataResponse
-> GetCurrentMetricDataResponse -> Bool
$c== :: GetCurrentMetricDataResponse
-> GetCurrentMetricDataResponse -> Bool
Prelude.Eq, ReadPrec [GetCurrentMetricDataResponse]
ReadPrec GetCurrentMetricDataResponse
Int -> ReadS GetCurrentMetricDataResponse
ReadS [GetCurrentMetricDataResponse]
(Int -> ReadS GetCurrentMetricDataResponse)
-> ReadS [GetCurrentMetricDataResponse]
-> ReadPrec GetCurrentMetricDataResponse
-> ReadPrec [GetCurrentMetricDataResponse]
-> Read GetCurrentMetricDataResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetCurrentMetricDataResponse]
$creadListPrec :: ReadPrec [GetCurrentMetricDataResponse]
readPrec :: ReadPrec GetCurrentMetricDataResponse
$creadPrec :: ReadPrec GetCurrentMetricDataResponse
readList :: ReadS [GetCurrentMetricDataResponse]
$creadList :: ReadS [GetCurrentMetricDataResponse]
readsPrec :: Int -> ReadS GetCurrentMetricDataResponse
$creadsPrec :: Int -> ReadS GetCurrentMetricDataResponse
Prelude.Read, Int -> GetCurrentMetricDataResponse -> ShowS
[GetCurrentMetricDataResponse] -> ShowS
GetCurrentMetricDataResponse -> String
(Int -> GetCurrentMetricDataResponse -> ShowS)
-> (GetCurrentMetricDataResponse -> String)
-> ([GetCurrentMetricDataResponse] -> ShowS)
-> Show GetCurrentMetricDataResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetCurrentMetricDataResponse] -> ShowS
$cshowList :: [GetCurrentMetricDataResponse] -> ShowS
show :: GetCurrentMetricDataResponse -> String
$cshow :: GetCurrentMetricDataResponse -> String
showsPrec :: Int -> GetCurrentMetricDataResponse -> ShowS
$cshowsPrec :: Int -> GetCurrentMetricDataResponse -> ShowS
Prelude.Show, (forall x.
 GetCurrentMetricDataResponse -> Rep GetCurrentMetricDataResponse x)
-> (forall x.
    Rep GetCurrentMetricDataResponse x -> GetCurrentMetricDataResponse)
-> Generic GetCurrentMetricDataResponse
forall x.
Rep GetCurrentMetricDataResponse x -> GetCurrentMetricDataResponse
forall x.
GetCurrentMetricDataResponse -> Rep GetCurrentMetricDataResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetCurrentMetricDataResponse x -> GetCurrentMetricDataResponse
$cfrom :: forall x.
GetCurrentMetricDataResponse -> Rep GetCurrentMetricDataResponse x
Prelude.Generic)

-- |
-- Create a value of 'GetCurrentMetricDataResponse' 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:
--
-- 'metricResults', 'getCurrentMetricDataResponse_metricResults' - Information about the real-time metrics.
--
-- 'dataSnapshotTime', 'getCurrentMetricDataResponse_dataSnapshotTime' - The time at which the metrics were retrieved and cached for pagination.
--
-- 'nextToken', 'getCurrentMetricDataResponse_nextToken' - If there are additional results, this is the token for the next set of
-- results.
--
-- The token expires after 5 minutes from the time it is created.
-- Subsequent requests that use the token must use the same request
-- parameters as the request that generated the token.
--
-- 'httpStatus', 'getCurrentMetricDataResponse_httpStatus' - The response's http status code.
newGetCurrentMetricDataResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  GetCurrentMetricDataResponse
newGetCurrentMetricDataResponse :: Int -> GetCurrentMetricDataResponse
newGetCurrentMetricDataResponse Int
pHttpStatus_ =
  GetCurrentMetricDataResponse' :: Maybe [CurrentMetricResult]
-> Maybe POSIX -> Maybe Text -> Int -> GetCurrentMetricDataResponse
GetCurrentMetricDataResponse'
    { $sel:metricResults:GetCurrentMetricDataResponse' :: Maybe [CurrentMetricResult]
metricResults =
        Maybe [CurrentMetricResult]
forall a. Maybe a
Prelude.Nothing,
      $sel:dataSnapshotTime:GetCurrentMetricDataResponse' :: Maybe POSIX
dataSnapshotTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:GetCurrentMetricDataResponse' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:GetCurrentMetricDataResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | Information about the real-time metrics.
getCurrentMetricDataResponse_metricResults :: Lens.Lens' GetCurrentMetricDataResponse (Prelude.Maybe [CurrentMetricResult])
getCurrentMetricDataResponse_metricResults :: (Maybe [CurrentMetricResult] -> f (Maybe [CurrentMetricResult]))
-> GetCurrentMetricDataResponse -> f GetCurrentMetricDataResponse
getCurrentMetricDataResponse_metricResults = (GetCurrentMetricDataResponse -> Maybe [CurrentMetricResult])
-> (GetCurrentMetricDataResponse
    -> Maybe [CurrentMetricResult] -> GetCurrentMetricDataResponse)
-> Lens
     GetCurrentMetricDataResponse
     GetCurrentMetricDataResponse
     (Maybe [CurrentMetricResult])
     (Maybe [CurrentMetricResult])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetCurrentMetricDataResponse' {Maybe [CurrentMetricResult]
metricResults :: Maybe [CurrentMetricResult]
$sel:metricResults:GetCurrentMetricDataResponse' :: GetCurrentMetricDataResponse -> Maybe [CurrentMetricResult]
metricResults} -> Maybe [CurrentMetricResult]
metricResults) (\s :: GetCurrentMetricDataResponse
s@GetCurrentMetricDataResponse' {} Maybe [CurrentMetricResult]
a -> GetCurrentMetricDataResponse
s {$sel:metricResults:GetCurrentMetricDataResponse' :: Maybe [CurrentMetricResult]
metricResults = Maybe [CurrentMetricResult]
a} :: GetCurrentMetricDataResponse) ((Maybe [CurrentMetricResult] -> f (Maybe [CurrentMetricResult]))
 -> GetCurrentMetricDataResponse -> f GetCurrentMetricDataResponse)
-> ((Maybe [CurrentMetricResult]
     -> f (Maybe [CurrentMetricResult]))
    -> Maybe [CurrentMetricResult] -> f (Maybe [CurrentMetricResult]))
-> (Maybe [CurrentMetricResult] -> f (Maybe [CurrentMetricResult]))
-> GetCurrentMetricDataResponse
-> f GetCurrentMetricDataResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [CurrentMetricResult]
  [CurrentMetricResult]
  [CurrentMetricResult]
  [CurrentMetricResult]
-> Iso
     (Maybe [CurrentMetricResult])
     (Maybe [CurrentMetricResult])
     (Maybe [CurrentMetricResult])
     (Maybe [CurrentMetricResult])
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 AnIso
  [CurrentMetricResult]
  [CurrentMetricResult]
  [CurrentMetricResult]
  [CurrentMetricResult]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The time at which the metrics were retrieved and cached for pagination.
getCurrentMetricDataResponse_dataSnapshotTime :: Lens.Lens' GetCurrentMetricDataResponse (Prelude.Maybe Prelude.UTCTime)
getCurrentMetricDataResponse_dataSnapshotTime :: (Maybe UTCTime -> f (Maybe UTCTime))
-> GetCurrentMetricDataResponse -> f GetCurrentMetricDataResponse
getCurrentMetricDataResponse_dataSnapshotTime = (GetCurrentMetricDataResponse -> Maybe POSIX)
-> (GetCurrentMetricDataResponse
    -> Maybe POSIX -> GetCurrentMetricDataResponse)
-> Lens
     GetCurrentMetricDataResponse
     GetCurrentMetricDataResponse
     (Maybe POSIX)
     (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetCurrentMetricDataResponse' {Maybe POSIX
dataSnapshotTime :: Maybe POSIX
$sel:dataSnapshotTime:GetCurrentMetricDataResponse' :: GetCurrentMetricDataResponse -> Maybe POSIX
dataSnapshotTime} -> Maybe POSIX
dataSnapshotTime) (\s :: GetCurrentMetricDataResponse
s@GetCurrentMetricDataResponse' {} Maybe POSIX
a -> GetCurrentMetricDataResponse
s {$sel:dataSnapshotTime:GetCurrentMetricDataResponse' :: Maybe POSIX
dataSnapshotTime = Maybe POSIX
a} :: GetCurrentMetricDataResponse) ((Maybe POSIX -> f (Maybe POSIX))
 -> GetCurrentMetricDataResponse -> f GetCurrentMetricDataResponse)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> GetCurrentMetricDataResponse
-> f GetCurrentMetricDataResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
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 AnIso POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

-- | If there are additional results, this is the token for the next set of
-- results.
--
-- The token expires after 5 minutes from the time it is created.
-- Subsequent requests that use the token must use the same request
-- parameters as the request that generated the token.
getCurrentMetricDataResponse_nextToken :: Lens.Lens' GetCurrentMetricDataResponse (Prelude.Maybe Prelude.Text)
getCurrentMetricDataResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> GetCurrentMetricDataResponse -> f GetCurrentMetricDataResponse
getCurrentMetricDataResponse_nextToken = (GetCurrentMetricDataResponse -> Maybe Text)
-> (GetCurrentMetricDataResponse
    -> Maybe Text -> GetCurrentMetricDataResponse)
-> Lens
     GetCurrentMetricDataResponse
     GetCurrentMetricDataResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetCurrentMetricDataResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:GetCurrentMetricDataResponse' :: GetCurrentMetricDataResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: GetCurrentMetricDataResponse
s@GetCurrentMetricDataResponse' {} Maybe Text
a -> GetCurrentMetricDataResponse
s {$sel:nextToken:GetCurrentMetricDataResponse' :: Maybe Text
nextToken = Maybe Text
a} :: GetCurrentMetricDataResponse)

-- | The response's http status code.
getCurrentMetricDataResponse_httpStatus :: Lens.Lens' GetCurrentMetricDataResponse Prelude.Int
getCurrentMetricDataResponse_httpStatus :: (Int -> f Int)
-> GetCurrentMetricDataResponse -> f GetCurrentMetricDataResponse
getCurrentMetricDataResponse_httpStatus = (GetCurrentMetricDataResponse -> Int)
-> (GetCurrentMetricDataResponse
    -> Int -> GetCurrentMetricDataResponse)
-> Lens
     GetCurrentMetricDataResponse GetCurrentMetricDataResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetCurrentMetricDataResponse' {Int
httpStatus :: Int
$sel:httpStatus:GetCurrentMetricDataResponse' :: GetCurrentMetricDataResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: GetCurrentMetricDataResponse
s@GetCurrentMetricDataResponse' {} Int
a -> GetCurrentMetricDataResponse
s {$sel:httpStatus:GetCurrentMetricDataResponse' :: Int
httpStatus = Int
a} :: GetCurrentMetricDataResponse)

instance Prelude.NFData GetCurrentMetricDataResponse