{-# 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.CodeGuruProfiler.BatchGetFrameMetricData
-- 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)
--
-- Returns the time series of values for a requested list of frame metrics
-- from a time period.
module Amazonka.CodeGuruProfiler.BatchGetFrameMetricData
  ( -- * Creating a Request
    BatchGetFrameMetricData (..),
    newBatchGetFrameMetricData,

    -- * Request Lenses
    batchGetFrameMetricData_targetResolution,
    batchGetFrameMetricData_frameMetrics,
    batchGetFrameMetricData_startTime,
    batchGetFrameMetricData_period,
    batchGetFrameMetricData_endTime,
    batchGetFrameMetricData_profilingGroupName,

    -- * Destructuring the Response
    BatchGetFrameMetricDataResponse (..),
    newBatchGetFrameMetricDataResponse,

    -- * Response Lenses
    batchGetFrameMetricDataResponse_httpStatus,
    batchGetFrameMetricDataResponse_endTime,
    batchGetFrameMetricDataResponse_endTimes,
    batchGetFrameMetricDataResponse_frameMetricData,
    batchGetFrameMetricDataResponse_resolution,
    batchGetFrameMetricDataResponse_startTime,
    batchGetFrameMetricDataResponse_unprocessedEndTimes,
  )
where

import Amazonka.CodeGuruProfiler.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

-- | The structure representing the BatchGetFrameMetricDataRequest.
--
-- /See:/ 'newBatchGetFrameMetricData' smart constructor.
data BatchGetFrameMetricData = BatchGetFrameMetricData'
  { -- | The requested resolution of time steps for the returned time series of
    -- values. If the requested target resolution is not available due to data
    -- not being retained we provide a best effort result by falling back to
    -- the most granular available resolution after the target resolution.
    -- There are 3 valid values.
    --
    -- -   @P1D@ — 1 day
    --
    -- -   @PT1H@ — 1 hour
    --
    -- -   @PT5M@ — 5 minutes
    BatchGetFrameMetricData -> Maybe AggregationPeriod
targetResolution :: Prelude.Maybe AggregationPeriod,
    -- | The details of the metrics that are used to request a time series of
    -- values. The metric includes the name of the frame, the aggregation type
    -- to calculate the metric value for the frame, and the thread states to
    -- use to get the count for the metric value of the frame.
    BatchGetFrameMetricData -> Maybe [FrameMetric]
frameMetrics :: Prelude.Maybe [FrameMetric],
    -- | The start time of the time period for the frame metrics used to return
    -- the time series values. This is specified using the ISO 8601 format. For
    -- example, 2020-06-01T13:15:02.001Z represents 1 millisecond past June 1,
    -- 2020 1:15:02 PM UTC.
    BatchGetFrameMetricData -> Maybe POSIX
startTime :: Prelude.Maybe Core.POSIX,
    -- | The duration of the frame metrics used to return the time series values.
    -- Specify using the ISO 8601 format. The maximum period duration is one
    -- day (@PT24H@ or @P1D@).
    BatchGetFrameMetricData -> Maybe Text
period :: Prelude.Maybe Prelude.Text,
    -- | The end time of the time period for the returned time series values.
    -- This is specified using the ISO 8601 format. For example,
    -- 2020-06-01T13:15:02.001Z represents 1 millisecond past June 1, 2020
    -- 1:15:02 PM UTC.
    BatchGetFrameMetricData -> Maybe POSIX
endTime :: Prelude.Maybe Core.POSIX,
    -- | The name of the profiling group associated with the the frame metrics
    -- used to return the time series values.
    BatchGetFrameMetricData -> Text
profilingGroupName :: Prelude.Text
  }
  deriving (BatchGetFrameMetricData -> BatchGetFrameMetricData -> Bool
(BatchGetFrameMetricData -> BatchGetFrameMetricData -> Bool)
-> (BatchGetFrameMetricData -> BatchGetFrameMetricData -> Bool)
-> Eq BatchGetFrameMetricData
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: BatchGetFrameMetricData -> BatchGetFrameMetricData -> Bool
$c/= :: BatchGetFrameMetricData -> BatchGetFrameMetricData -> Bool
== :: BatchGetFrameMetricData -> BatchGetFrameMetricData -> Bool
$c== :: BatchGetFrameMetricData -> BatchGetFrameMetricData -> Bool
Prelude.Eq, ReadPrec [BatchGetFrameMetricData]
ReadPrec BatchGetFrameMetricData
Int -> ReadS BatchGetFrameMetricData
ReadS [BatchGetFrameMetricData]
(Int -> ReadS BatchGetFrameMetricData)
-> ReadS [BatchGetFrameMetricData]
-> ReadPrec BatchGetFrameMetricData
-> ReadPrec [BatchGetFrameMetricData]
-> Read BatchGetFrameMetricData
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [BatchGetFrameMetricData]
$creadListPrec :: ReadPrec [BatchGetFrameMetricData]
readPrec :: ReadPrec BatchGetFrameMetricData
$creadPrec :: ReadPrec BatchGetFrameMetricData
readList :: ReadS [BatchGetFrameMetricData]
$creadList :: ReadS [BatchGetFrameMetricData]
readsPrec :: Int -> ReadS BatchGetFrameMetricData
$creadsPrec :: Int -> ReadS BatchGetFrameMetricData
Prelude.Read, Int -> BatchGetFrameMetricData -> ShowS
[BatchGetFrameMetricData] -> ShowS
BatchGetFrameMetricData -> String
(Int -> BatchGetFrameMetricData -> ShowS)
-> (BatchGetFrameMetricData -> String)
-> ([BatchGetFrameMetricData] -> ShowS)
-> Show BatchGetFrameMetricData
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [BatchGetFrameMetricData] -> ShowS
$cshowList :: [BatchGetFrameMetricData] -> ShowS
show :: BatchGetFrameMetricData -> String
$cshow :: BatchGetFrameMetricData -> String
showsPrec :: Int -> BatchGetFrameMetricData -> ShowS
$cshowsPrec :: Int -> BatchGetFrameMetricData -> ShowS
Prelude.Show, (forall x.
 BatchGetFrameMetricData -> Rep BatchGetFrameMetricData x)
-> (forall x.
    Rep BatchGetFrameMetricData x -> BatchGetFrameMetricData)
-> Generic BatchGetFrameMetricData
forall x. Rep BatchGetFrameMetricData x -> BatchGetFrameMetricData
forall x. BatchGetFrameMetricData -> Rep BatchGetFrameMetricData x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep BatchGetFrameMetricData x -> BatchGetFrameMetricData
$cfrom :: forall x. BatchGetFrameMetricData -> Rep BatchGetFrameMetricData x
Prelude.Generic)

-- |
-- Create a value of 'BatchGetFrameMetricData' 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:
--
-- 'targetResolution', 'batchGetFrameMetricData_targetResolution' - The requested resolution of time steps for the returned time series of
-- values. If the requested target resolution is not available due to data
-- not being retained we provide a best effort result by falling back to
-- the most granular available resolution after the target resolution.
-- There are 3 valid values.
--
-- -   @P1D@ — 1 day
--
-- -   @PT1H@ — 1 hour
--
-- -   @PT5M@ — 5 minutes
--
-- 'frameMetrics', 'batchGetFrameMetricData_frameMetrics' - The details of the metrics that are used to request a time series of
-- values. The metric includes the name of the frame, the aggregation type
-- to calculate the metric value for the frame, and the thread states to
-- use to get the count for the metric value of the frame.
--
-- 'startTime', 'batchGetFrameMetricData_startTime' - The start time of the time period for the frame metrics used to return
-- the time series values. This is specified using the ISO 8601 format. For
-- example, 2020-06-01T13:15:02.001Z represents 1 millisecond past June 1,
-- 2020 1:15:02 PM UTC.
--
-- 'period', 'batchGetFrameMetricData_period' - The duration of the frame metrics used to return the time series values.
-- Specify using the ISO 8601 format. The maximum period duration is one
-- day (@PT24H@ or @P1D@).
--
-- 'endTime', 'batchGetFrameMetricData_endTime' - The end time of the time period for the returned time series values.
-- This is specified using the ISO 8601 format. For example,
-- 2020-06-01T13:15:02.001Z represents 1 millisecond past June 1, 2020
-- 1:15:02 PM UTC.
--
-- 'profilingGroupName', 'batchGetFrameMetricData_profilingGroupName' - The name of the profiling group associated with the the frame metrics
-- used to return the time series values.
newBatchGetFrameMetricData ::
  -- | 'profilingGroupName'
  Prelude.Text ->
  BatchGetFrameMetricData
newBatchGetFrameMetricData :: Text -> BatchGetFrameMetricData
newBatchGetFrameMetricData Text
pProfilingGroupName_ =
  BatchGetFrameMetricData' :: Maybe AggregationPeriod
-> Maybe [FrameMetric]
-> Maybe POSIX
-> Maybe Text
-> Maybe POSIX
-> Text
-> BatchGetFrameMetricData
BatchGetFrameMetricData'
    { $sel:targetResolution:BatchGetFrameMetricData' :: Maybe AggregationPeriod
targetResolution =
        Maybe AggregationPeriod
forall a. Maybe a
Prelude.Nothing,
      $sel:frameMetrics:BatchGetFrameMetricData' :: Maybe [FrameMetric]
frameMetrics = Maybe [FrameMetric]
forall a. Maybe a
Prelude.Nothing,
      $sel:startTime:BatchGetFrameMetricData' :: Maybe POSIX
startTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:period:BatchGetFrameMetricData' :: Maybe Text
period = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:endTime:BatchGetFrameMetricData' :: Maybe POSIX
endTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:profilingGroupName:BatchGetFrameMetricData' :: Text
profilingGroupName = Text
pProfilingGroupName_
    }

-- | The requested resolution of time steps for the returned time series of
-- values. If the requested target resolution is not available due to data
-- not being retained we provide a best effort result by falling back to
-- the most granular available resolution after the target resolution.
-- There are 3 valid values.
--
-- -   @P1D@ — 1 day
--
-- -   @PT1H@ — 1 hour
--
-- -   @PT5M@ — 5 minutes
batchGetFrameMetricData_targetResolution :: Lens.Lens' BatchGetFrameMetricData (Prelude.Maybe AggregationPeriod)
batchGetFrameMetricData_targetResolution :: (Maybe AggregationPeriod -> f (Maybe AggregationPeriod))
-> BatchGetFrameMetricData -> f BatchGetFrameMetricData
batchGetFrameMetricData_targetResolution = (BatchGetFrameMetricData -> Maybe AggregationPeriod)
-> (BatchGetFrameMetricData
    -> Maybe AggregationPeriod -> BatchGetFrameMetricData)
-> Lens
     BatchGetFrameMetricData
     BatchGetFrameMetricData
     (Maybe AggregationPeriod)
     (Maybe AggregationPeriod)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchGetFrameMetricData' {Maybe AggregationPeriod
targetResolution :: Maybe AggregationPeriod
$sel:targetResolution:BatchGetFrameMetricData' :: BatchGetFrameMetricData -> Maybe AggregationPeriod
targetResolution} -> Maybe AggregationPeriod
targetResolution) (\s :: BatchGetFrameMetricData
s@BatchGetFrameMetricData' {} Maybe AggregationPeriod
a -> BatchGetFrameMetricData
s {$sel:targetResolution:BatchGetFrameMetricData' :: Maybe AggregationPeriod
targetResolution = Maybe AggregationPeriod
a} :: BatchGetFrameMetricData)

-- | The details of the metrics that are used to request a time series of
-- values. The metric includes the name of the frame, the aggregation type
-- to calculate the metric value for the frame, and the thread states to
-- use to get the count for the metric value of the frame.
batchGetFrameMetricData_frameMetrics :: Lens.Lens' BatchGetFrameMetricData (Prelude.Maybe [FrameMetric])
batchGetFrameMetricData_frameMetrics :: (Maybe [FrameMetric] -> f (Maybe [FrameMetric]))
-> BatchGetFrameMetricData -> f BatchGetFrameMetricData
batchGetFrameMetricData_frameMetrics = (BatchGetFrameMetricData -> Maybe [FrameMetric])
-> (BatchGetFrameMetricData
    -> Maybe [FrameMetric] -> BatchGetFrameMetricData)
-> Lens
     BatchGetFrameMetricData
     BatchGetFrameMetricData
     (Maybe [FrameMetric])
     (Maybe [FrameMetric])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchGetFrameMetricData' {Maybe [FrameMetric]
frameMetrics :: Maybe [FrameMetric]
$sel:frameMetrics:BatchGetFrameMetricData' :: BatchGetFrameMetricData -> Maybe [FrameMetric]
frameMetrics} -> Maybe [FrameMetric]
frameMetrics) (\s :: BatchGetFrameMetricData
s@BatchGetFrameMetricData' {} Maybe [FrameMetric]
a -> BatchGetFrameMetricData
s {$sel:frameMetrics:BatchGetFrameMetricData' :: Maybe [FrameMetric]
frameMetrics = Maybe [FrameMetric]
a} :: BatchGetFrameMetricData) ((Maybe [FrameMetric] -> f (Maybe [FrameMetric]))
 -> BatchGetFrameMetricData -> f BatchGetFrameMetricData)
-> ((Maybe [FrameMetric] -> f (Maybe [FrameMetric]))
    -> Maybe [FrameMetric] -> f (Maybe [FrameMetric]))
-> (Maybe [FrameMetric] -> f (Maybe [FrameMetric]))
-> BatchGetFrameMetricData
-> f BatchGetFrameMetricData
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [FrameMetric] [FrameMetric] [FrameMetric] [FrameMetric]
-> Iso
     (Maybe [FrameMetric])
     (Maybe [FrameMetric])
     (Maybe [FrameMetric])
     (Maybe [FrameMetric])
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 [FrameMetric] [FrameMetric] [FrameMetric] [FrameMetric]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The start time of the time period for the frame metrics used to return
-- the time series values. This is specified using the ISO 8601 format. For
-- example, 2020-06-01T13:15:02.001Z represents 1 millisecond past June 1,
-- 2020 1:15:02 PM UTC.
batchGetFrameMetricData_startTime :: Lens.Lens' BatchGetFrameMetricData (Prelude.Maybe Prelude.UTCTime)
batchGetFrameMetricData_startTime :: (Maybe UTCTime -> f (Maybe UTCTime))
-> BatchGetFrameMetricData -> f BatchGetFrameMetricData
batchGetFrameMetricData_startTime = (BatchGetFrameMetricData -> Maybe POSIX)
-> (BatchGetFrameMetricData
    -> Maybe POSIX -> BatchGetFrameMetricData)
-> Lens
     BatchGetFrameMetricData
     BatchGetFrameMetricData
     (Maybe POSIX)
     (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchGetFrameMetricData' {Maybe POSIX
startTime :: Maybe POSIX
$sel:startTime:BatchGetFrameMetricData' :: BatchGetFrameMetricData -> Maybe POSIX
startTime} -> Maybe POSIX
startTime) (\s :: BatchGetFrameMetricData
s@BatchGetFrameMetricData' {} Maybe POSIX
a -> BatchGetFrameMetricData
s {$sel:startTime:BatchGetFrameMetricData' :: Maybe POSIX
startTime = Maybe POSIX
a} :: BatchGetFrameMetricData) ((Maybe POSIX -> f (Maybe POSIX))
 -> BatchGetFrameMetricData -> f BatchGetFrameMetricData)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> BatchGetFrameMetricData
-> f BatchGetFrameMetricData
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

-- | The duration of the frame metrics used to return the time series values.
-- Specify using the ISO 8601 format. The maximum period duration is one
-- day (@PT24H@ or @P1D@).
batchGetFrameMetricData_period :: Lens.Lens' BatchGetFrameMetricData (Prelude.Maybe Prelude.Text)
batchGetFrameMetricData_period :: (Maybe Text -> f (Maybe Text))
-> BatchGetFrameMetricData -> f BatchGetFrameMetricData
batchGetFrameMetricData_period = (BatchGetFrameMetricData -> Maybe Text)
-> (BatchGetFrameMetricData
    -> Maybe Text -> BatchGetFrameMetricData)
-> Lens
     BatchGetFrameMetricData
     BatchGetFrameMetricData
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchGetFrameMetricData' {Maybe Text
period :: Maybe Text
$sel:period:BatchGetFrameMetricData' :: BatchGetFrameMetricData -> Maybe Text
period} -> Maybe Text
period) (\s :: BatchGetFrameMetricData
s@BatchGetFrameMetricData' {} Maybe Text
a -> BatchGetFrameMetricData
s {$sel:period:BatchGetFrameMetricData' :: Maybe Text
period = Maybe Text
a} :: BatchGetFrameMetricData)

-- | The end time of the time period for the returned time series values.
-- This is specified using the ISO 8601 format. For example,
-- 2020-06-01T13:15:02.001Z represents 1 millisecond past June 1, 2020
-- 1:15:02 PM UTC.
batchGetFrameMetricData_endTime :: Lens.Lens' BatchGetFrameMetricData (Prelude.Maybe Prelude.UTCTime)
batchGetFrameMetricData_endTime :: (Maybe UTCTime -> f (Maybe UTCTime))
-> BatchGetFrameMetricData -> f BatchGetFrameMetricData
batchGetFrameMetricData_endTime = (BatchGetFrameMetricData -> Maybe POSIX)
-> (BatchGetFrameMetricData
    -> Maybe POSIX -> BatchGetFrameMetricData)
-> Lens
     BatchGetFrameMetricData
     BatchGetFrameMetricData
     (Maybe POSIX)
     (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchGetFrameMetricData' {Maybe POSIX
endTime :: Maybe POSIX
$sel:endTime:BatchGetFrameMetricData' :: BatchGetFrameMetricData -> Maybe POSIX
endTime} -> Maybe POSIX
endTime) (\s :: BatchGetFrameMetricData
s@BatchGetFrameMetricData' {} Maybe POSIX
a -> BatchGetFrameMetricData
s {$sel:endTime:BatchGetFrameMetricData' :: Maybe POSIX
endTime = Maybe POSIX
a} :: BatchGetFrameMetricData) ((Maybe POSIX -> f (Maybe POSIX))
 -> BatchGetFrameMetricData -> f BatchGetFrameMetricData)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> BatchGetFrameMetricData
-> f BatchGetFrameMetricData
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

-- | The name of the profiling group associated with the the frame metrics
-- used to return the time series values.
batchGetFrameMetricData_profilingGroupName :: Lens.Lens' BatchGetFrameMetricData Prelude.Text
batchGetFrameMetricData_profilingGroupName :: (Text -> f Text)
-> BatchGetFrameMetricData -> f BatchGetFrameMetricData
batchGetFrameMetricData_profilingGroupName = (BatchGetFrameMetricData -> Text)
-> (BatchGetFrameMetricData -> Text -> BatchGetFrameMetricData)
-> Lens BatchGetFrameMetricData BatchGetFrameMetricData Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchGetFrameMetricData' {Text
profilingGroupName :: Text
$sel:profilingGroupName:BatchGetFrameMetricData' :: BatchGetFrameMetricData -> Text
profilingGroupName} -> Text
profilingGroupName) (\s :: BatchGetFrameMetricData
s@BatchGetFrameMetricData' {} Text
a -> BatchGetFrameMetricData
s {$sel:profilingGroupName:BatchGetFrameMetricData' :: Text
profilingGroupName = Text
a} :: BatchGetFrameMetricData)

instance Core.AWSRequest BatchGetFrameMetricData where
  type
    AWSResponse BatchGetFrameMetricData =
      BatchGetFrameMetricDataResponse
  request :: BatchGetFrameMetricData -> Request BatchGetFrameMetricData
request = Service
-> BatchGetFrameMetricData -> Request BatchGetFrameMetricData
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy BatchGetFrameMetricData
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse BatchGetFrameMetricData)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse BatchGetFrameMetricData))
-> Logger
-> Service
-> Proxy BatchGetFrameMetricData
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse BatchGetFrameMetricData)))
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 ->
          Int
-> POSIX
-> [TimestampStructure]
-> [FrameMetricDatum]
-> AggregationPeriod
-> POSIX
-> HashMap Text [TimestampStructure]
-> BatchGetFrameMetricDataResponse
BatchGetFrameMetricDataResponse'
            (Int
 -> POSIX
 -> [TimestampStructure]
 -> [FrameMetricDatum]
 -> AggregationPeriod
 -> POSIX
 -> HashMap Text [TimestampStructure]
 -> BatchGetFrameMetricDataResponse)
-> Either String Int
-> Either
     String
     (POSIX
      -> [TimestampStructure]
      -> [FrameMetricDatum]
      -> AggregationPeriod
      -> POSIX
      -> HashMap Text [TimestampStructure]
      -> BatchGetFrameMetricDataResponse)
forall (f :: * -> *) a b. Functor 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))
            Either
  String
  (POSIX
   -> [TimestampStructure]
   -> [FrameMetricDatum]
   -> AggregationPeriod
   -> POSIX
   -> HashMap Text [TimestampStructure]
   -> BatchGetFrameMetricDataResponse)
-> Either String POSIX
-> Either
     String
     ([TimestampStructure]
      -> [FrameMetricDatum]
      -> AggregationPeriod
      -> POSIX
      -> HashMap Text [TimestampStructure]
      -> BatchGetFrameMetricDataResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String POSIX
forall a. FromJSON a => Object -> Text -> Either String a
Core..:> Text
"endTime")
            Either
  String
  ([TimestampStructure]
   -> [FrameMetricDatum]
   -> AggregationPeriod
   -> POSIX
   -> HashMap Text [TimestampStructure]
   -> BatchGetFrameMetricDataResponse)
-> Either String [TimestampStructure]
-> Either
     String
     ([FrameMetricDatum]
      -> AggregationPeriod
      -> POSIX
      -> HashMap Text [TimestampStructure]
      -> BatchGetFrameMetricDataResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe [TimestampStructure])
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"endTimes" Either String (Maybe [TimestampStructure])
-> [TimestampStructure] -> Either String [TimestampStructure]
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ [TimestampStructure]
forall a. Monoid a => a
Prelude.mempty)
            Either
  String
  ([FrameMetricDatum]
   -> AggregationPeriod
   -> POSIX
   -> HashMap Text [TimestampStructure]
   -> BatchGetFrameMetricDataResponse)
-> Either String [FrameMetricDatum]
-> Either
     String
     (AggregationPeriod
      -> POSIX
      -> HashMap Text [TimestampStructure]
      -> BatchGetFrameMetricDataResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object -> Text -> Either String (Maybe [FrameMetricDatum])
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"frameMetricData"
                            Either String (Maybe [FrameMetricDatum])
-> [FrameMetricDatum] -> Either String [FrameMetricDatum]
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ [FrameMetricDatum]
forall a. Monoid a => a
Prelude.mempty
                        )
            Either
  String
  (AggregationPeriod
   -> POSIX
   -> HashMap Text [TimestampStructure]
   -> BatchGetFrameMetricDataResponse)
-> Either String AggregationPeriod
-> Either
     String
     (POSIX
      -> HashMap Text [TimestampStructure]
      -> BatchGetFrameMetricDataResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String AggregationPeriod
forall a. FromJSON a => Object -> Text -> Either String a
Core..:> Text
"resolution")
            Either
  String
  (POSIX
   -> HashMap Text [TimestampStructure]
   -> BatchGetFrameMetricDataResponse)
-> Either String POSIX
-> Either
     String
     (HashMap Text [TimestampStructure]
      -> BatchGetFrameMetricDataResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String POSIX
forall a. FromJSON a => Object -> Text -> Either String a
Core..:> Text
"startTime")
            Either
  String
  (HashMap Text [TimestampStructure]
   -> BatchGetFrameMetricDataResponse)
-> Either String (HashMap Text [TimestampStructure])
-> Either String BatchGetFrameMetricDataResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object
-> Text
-> Either String (Maybe (HashMap Text [TimestampStructure]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"unprocessedEndTimes"
                            Either String (Maybe (HashMap Text [TimestampStructure]))
-> HashMap Text [TimestampStructure]
-> Either String (HashMap Text [TimestampStructure])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ HashMap Text [TimestampStructure]
forall a. Monoid a => a
Prelude.mempty
                        )
      )

instance Prelude.Hashable BatchGetFrameMetricData

instance Prelude.NFData BatchGetFrameMetricData

instance Core.ToHeaders BatchGetFrameMetricData where
  toHeaders :: BatchGetFrameMetricData -> ResponseHeaders
toHeaders =
    ResponseHeaders -> BatchGetFrameMetricData -> 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 BatchGetFrameMetricData where
  toJSON :: BatchGetFrameMetricData -> Value
toJSON BatchGetFrameMetricData' {Maybe [FrameMetric]
Maybe Text
Maybe POSIX
Maybe AggregationPeriod
Text
profilingGroupName :: Text
endTime :: Maybe POSIX
period :: Maybe Text
startTime :: Maybe POSIX
frameMetrics :: Maybe [FrameMetric]
targetResolution :: Maybe AggregationPeriod
$sel:profilingGroupName:BatchGetFrameMetricData' :: BatchGetFrameMetricData -> Text
$sel:endTime:BatchGetFrameMetricData' :: BatchGetFrameMetricData -> Maybe POSIX
$sel:period:BatchGetFrameMetricData' :: BatchGetFrameMetricData -> Maybe Text
$sel:startTime:BatchGetFrameMetricData' :: BatchGetFrameMetricData -> Maybe POSIX
$sel:frameMetrics:BatchGetFrameMetricData' :: BatchGetFrameMetricData -> Maybe [FrameMetric]
$sel:targetResolution:BatchGetFrameMetricData' :: BatchGetFrameMetricData -> Maybe AggregationPeriod
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [(Text
"frameMetrics" Text -> [FrameMetric] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) ([FrameMetric] -> Pair) -> Maybe [FrameMetric] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [FrameMetric]
frameMetrics]
      )

instance Core.ToPath BatchGetFrameMetricData where
  toPath :: BatchGetFrameMetricData -> ByteString
toPath BatchGetFrameMetricData' {Maybe [FrameMetric]
Maybe Text
Maybe POSIX
Maybe AggregationPeriod
Text
profilingGroupName :: Text
endTime :: Maybe POSIX
period :: Maybe Text
startTime :: Maybe POSIX
frameMetrics :: Maybe [FrameMetric]
targetResolution :: Maybe AggregationPeriod
$sel:profilingGroupName:BatchGetFrameMetricData' :: BatchGetFrameMetricData -> Text
$sel:endTime:BatchGetFrameMetricData' :: BatchGetFrameMetricData -> Maybe POSIX
$sel:period:BatchGetFrameMetricData' :: BatchGetFrameMetricData -> Maybe Text
$sel:startTime:BatchGetFrameMetricData' :: BatchGetFrameMetricData -> Maybe POSIX
$sel:frameMetrics:BatchGetFrameMetricData' :: BatchGetFrameMetricData -> Maybe [FrameMetric]
$sel:targetResolution:BatchGetFrameMetricData' :: BatchGetFrameMetricData -> Maybe AggregationPeriod
..} =
    [ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"/profilingGroups/",
        Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
profilingGroupName,
        ByteString
"/frames/-/metrics"
      ]

instance Core.ToQuery BatchGetFrameMetricData where
  toQuery :: BatchGetFrameMetricData -> QueryString
toQuery BatchGetFrameMetricData' {Maybe [FrameMetric]
Maybe Text
Maybe POSIX
Maybe AggregationPeriod
Text
profilingGroupName :: Text
endTime :: Maybe POSIX
period :: Maybe Text
startTime :: Maybe POSIX
frameMetrics :: Maybe [FrameMetric]
targetResolution :: Maybe AggregationPeriod
$sel:profilingGroupName:BatchGetFrameMetricData' :: BatchGetFrameMetricData -> Text
$sel:endTime:BatchGetFrameMetricData' :: BatchGetFrameMetricData -> Maybe POSIX
$sel:period:BatchGetFrameMetricData' :: BatchGetFrameMetricData -> Maybe Text
$sel:startTime:BatchGetFrameMetricData' :: BatchGetFrameMetricData -> Maybe POSIX
$sel:frameMetrics:BatchGetFrameMetricData' :: BatchGetFrameMetricData -> Maybe [FrameMetric]
$sel:targetResolution:BatchGetFrameMetricData' :: BatchGetFrameMetricData -> Maybe AggregationPeriod
..} =
    [QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"targetResolution" ByteString -> Maybe AggregationPeriod -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe AggregationPeriod
targetResolution,
        ByteString
"startTime" ByteString -> Maybe POSIX -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe POSIX
startTime,
        ByteString
"period" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
period,
        ByteString
"endTime" ByteString -> Maybe POSIX -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe POSIX
endTime
      ]

-- | The structure representing the BatchGetFrameMetricDataResponse.
--
-- /See:/ 'newBatchGetFrameMetricDataResponse' smart constructor.
data BatchGetFrameMetricDataResponse = BatchGetFrameMetricDataResponse'
  { -- | The response's http status code.
    BatchGetFrameMetricDataResponse -> Int
httpStatus :: Prelude.Int,
    -- | The end time of the time period for the returned time series values.
    -- This is specified using the ISO 8601 format. For example,
    -- 2020-06-01T13:15:02.001Z represents 1 millisecond past June 1, 2020
    -- 1:15:02 PM UTC.
    BatchGetFrameMetricDataResponse -> POSIX
endTime :: Core.POSIX,
    -- | List of instances, or time steps, in the time series. For example, if
    -- the @period@ is one day (@PT24H)@), and the @resolution@ is five minutes
    -- (@PT5M@), then there are 288 @endTimes@ in the list that are each five
    -- minutes appart.
    BatchGetFrameMetricDataResponse -> [TimestampStructure]
endTimes :: [TimestampStructure],
    -- | Details of the metrics to request a time series of values. The metric
    -- includes the name of the frame, the aggregation type to calculate the
    -- metric value for the frame, and the thread states to use to get the
    -- count for the metric value of the frame.
    BatchGetFrameMetricDataResponse -> [FrameMetricDatum]
frameMetricData :: [FrameMetricDatum],
    -- | Resolution or granularity of the profile data used to generate the time
    -- series. This is the value used to jump through time steps in a time
    -- series. There are 3 valid values.
    --
    -- -   @P1D@ — 1 day
    --
    -- -   @PT1H@ — 1 hour
    --
    -- -   @PT5M@ — 5 minutes
    BatchGetFrameMetricDataResponse -> AggregationPeriod
resolution :: AggregationPeriod,
    -- | The start time of the time period for the returned time series values.
    -- This is specified using the ISO 8601 format. For example,
    -- 2020-06-01T13:15:02.001Z represents 1 millisecond past June 1, 2020
    -- 1:15:02 PM UTC.
    BatchGetFrameMetricDataResponse -> POSIX
startTime :: Core.POSIX,
    -- | List of instances which remained unprocessed. This will create a missing
    -- time step in the list of end times.
    BatchGetFrameMetricDataResponse
-> HashMap Text [TimestampStructure]
unprocessedEndTimes :: Prelude.HashMap Prelude.Text [TimestampStructure]
  }
  deriving (BatchGetFrameMetricDataResponse
-> BatchGetFrameMetricDataResponse -> Bool
(BatchGetFrameMetricDataResponse
 -> BatchGetFrameMetricDataResponse -> Bool)
-> (BatchGetFrameMetricDataResponse
    -> BatchGetFrameMetricDataResponse -> Bool)
-> Eq BatchGetFrameMetricDataResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: BatchGetFrameMetricDataResponse
-> BatchGetFrameMetricDataResponse -> Bool
$c/= :: BatchGetFrameMetricDataResponse
-> BatchGetFrameMetricDataResponse -> Bool
== :: BatchGetFrameMetricDataResponse
-> BatchGetFrameMetricDataResponse -> Bool
$c== :: BatchGetFrameMetricDataResponse
-> BatchGetFrameMetricDataResponse -> Bool
Prelude.Eq, ReadPrec [BatchGetFrameMetricDataResponse]
ReadPrec BatchGetFrameMetricDataResponse
Int -> ReadS BatchGetFrameMetricDataResponse
ReadS [BatchGetFrameMetricDataResponse]
(Int -> ReadS BatchGetFrameMetricDataResponse)
-> ReadS [BatchGetFrameMetricDataResponse]
-> ReadPrec BatchGetFrameMetricDataResponse
-> ReadPrec [BatchGetFrameMetricDataResponse]
-> Read BatchGetFrameMetricDataResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [BatchGetFrameMetricDataResponse]
$creadListPrec :: ReadPrec [BatchGetFrameMetricDataResponse]
readPrec :: ReadPrec BatchGetFrameMetricDataResponse
$creadPrec :: ReadPrec BatchGetFrameMetricDataResponse
readList :: ReadS [BatchGetFrameMetricDataResponse]
$creadList :: ReadS [BatchGetFrameMetricDataResponse]
readsPrec :: Int -> ReadS BatchGetFrameMetricDataResponse
$creadsPrec :: Int -> ReadS BatchGetFrameMetricDataResponse
Prelude.Read, Int -> BatchGetFrameMetricDataResponse -> ShowS
[BatchGetFrameMetricDataResponse] -> ShowS
BatchGetFrameMetricDataResponse -> String
(Int -> BatchGetFrameMetricDataResponse -> ShowS)
-> (BatchGetFrameMetricDataResponse -> String)
-> ([BatchGetFrameMetricDataResponse] -> ShowS)
-> Show BatchGetFrameMetricDataResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [BatchGetFrameMetricDataResponse] -> ShowS
$cshowList :: [BatchGetFrameMetricDataResponse] -> ShowS
show :: BatchGetFrameMetricDataResponse -> String
$cshow :: BatchGetFrameMetricDataResponse -> String
showsPrec :: Int -> BatchGetFrameMetricDataResponse -> ShowS
$cshowsPrec :: Int -> BatchGetFrameMetricDataResponse -> ShowS
Prelude.Show, (forall x.
 BatchGetFrameMetricDataResponse
 -> Rep BatchGetFrameMetricDataResponse x)
-> (forall x.
    Rep BatchGetFrameMetricDataResponse x
    -> BatchGetFrameMetricDataResponse)
-> Generic BatchGetFrameMetricDataResponse
forall x.
Rep BatchGetFrameMetricDataResponse x
-> BatchGetFrameMetricDataResponse
forall x.
BatchGetFrameMetricDataResponse
-> Rep BatchGetFrameMetricDataResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep BatchGetFrameMetricDataResponse x
-> BatchGetFrameMetricDataResponse
$cfrom :: forall x.
BatchGetFrameMetricDataResponse
-> Rep BatchGetFrameMetricDataResponse x
Prelude.Generic)

-- |
-- Create a value of 'BatchGetFrameMetricDataResponse' 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:
--
-- 'httpStatus', 'batchGetFrameMetricDataResponse_httpStatus' - The response's http status code.
--
-- 'endTime', 'batchGetFrameMetricDataResponse_endTime' - The end time of the time period for the returned time series values.
-- This is specified using the ISO 8601 format. For example,
-- 2020-06-01T13:15:02.001Z represents 1 millisecond past June 1, 2020
-- 1:15:02 PM UTC.
--
-- 'endTimes', 'batchGetFrameMetricDataResponse_endTimes' - List of instances, or time steps, in the time series. For example, if
-- the @period@ is one day (@PT24H)@), and the @resolution@ is five minutes
-- (@PT5M@), then there are 288 @endTimes@ in the list that are each five
-- minutes appart.
--
-- 'frameMetricData', 'batchGetFrameMetricDataResponse_frameMetricData' - Details of the metrics to request a time series of values. The metric
-- includes the name of the frame, the aggregation type to calculate the
-- metric value for the frame, and the thread states to use to get the
-- count for the metric value of the frame.
--
-- 'resolution', 'batchGetFrameMetricDataResponse_resolution' - Resolution or granularity of the profile data used to generate the time
-- series. This is the value used to jump through time steps in a time
-- series. There are 3 valid values.
--
-- -   @P1D@ — 1 day
--
-- -   @PT1H@ — 1 hour
--
-- -   @PT5M@ — 5 minutes
--
-- 'startTime', 'batchGetFrameMetricDataResponse_startTime' - The start time of the time period for the returned time series values.
-- This is specified using the ISO 8601 format. For example,
-- 2020-06-01T13:15:02.001Z represents 1 millisecond past June 1, 2020
-- 1:15:02 PM UTC.
--
-- 'unprocessedEndTimes', 'batchGetFrameMetricDataResponse_unprocessedEndTimes' - List of instances which remained unprocessed. This will create a missing
-- time step in the list of end times.
newBatchGetFrameMetricDataResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  -- | 'endTime'
  Prelude.UTCTime ->
  -- | 'resolution'
  AggregationPeriod ->
  -- | 'startTime'
  Prelude.UTCTime ->
  BatchGetFrameMetricDataResponse
newBatchGetFrameMetricDataResponse :: Int
-> UTCTime
-> AggregationPeriod
-> UTCTime
-> BatchGetFrameMetricDataResponse
newBatchGetFrameMetricDataResponse
  Int
pHttpStatus_
  UTCTime
pEndTime_
  AggregationPeriod
pResolution_
  UTCTime
pStartTime_ =
    BatchGetFrameMetricDataResponse' :: Int
-> POSIX
-> [TimestampStructure]
-> [FrameMetricDatum]
-> AggregationPeriod
-> POSIX
-> HashMap Text [TimestampStructure]
-> BatchGetFrameMetricDataResponse
BatchGetFrameMetricDataResponse'
      { $sel:httpStatus:BatchGetFrameMetricDataResponse' :: Int
httpStatus =
          Int
pHttpStatus_,
        $sel:endTime:BatchGetFrameMetricDataResponse' :: POSIX
endTime = Tagged UTCTime (Identity UTCTime) -> Tagged POSIX (Identity POSIX)
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time (Tagged UTCTime (Identity UTCTime)
 -> Tagged POSIX (Identity POSIX))
-> UTCTime -> POSIX
forall t b. AReview t b -> b -> t
Lens.# UTCTime
pEndTime_,
        $sel:endTimes:BatchGetFrameMetricDataResponse' :: [TimestampStructure]
endTimes = [TimestampStructure]
forall a. Monoid a => a
Prelude.mempty,
        $sel:frameMetricData:BatchGetFrameMetricDataResponse' :: [FrameMetricDatum]
frameMetricData = [FrameMetricDatum]
forall a. Monoid a => a
Prelude.mempty,
        $sel:resolution:BatchGetFrameMetricDataResponse' :: AggregationPeriod
resolution = AggregationPeriod
pResolution_,
        $sel:startTime:BatchGetFrameMetricDataResponse' :: POSIX
startTime = Tagged UTCTime (Identity UTCTime) -> Tagged POSIX (Identity POSIX)
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time (Tagged UTCTime (Identity UTCTime)
 -> Tagged POSIX (Identity POSIX))
-> UTCTime -> POSIX
forall t b. AReview t b -> b -> t
Lens.# UTCTime
pStartTime_,
        $sel:unprocessedEndTimes:BatchGetFrameMetricDataResponse' :: HashMap Text [TimestampStructure]
unprocessedEndTimes = HashMap Text [TimestampStructure]
forall a. Monoid a => a
Prelude.mempty
      }

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

-- | The end time of the time period for the returned time series values.
-- This is specified using the ISO 8601 format. For example,
-- 2020-06-01T13:15:02.001Z represents 1 millisecond past June 1, 2020
-- 1:15:02 PM UTC.
batchGetFrameMetricDataResponse_endTime :: Lens.Lens' BatchGetFrameMetricDataResponse Prelude.UTCTime
batchGetFrameMetricDataResponse_endTime :: (UTCTime -> f UTCTime)
-> BatchGetFrameMetricDataResponse
-> f BatchGetFrameMetricDataResponse
batchGetFrameMetricDataResponse_endTime = (BatchGetFrameMetricDataResponse -> POSIX)
-> (BatchGetFrameMetricDataResponse
    -> POSIX -> BatchGetFrameMetricDataResponse)
-> Lens
     BatchGetFrameMetricDataResponse
     BatchGetFrameMetricDataResponse
     POSIX
     POSIX
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchGetFrameMetricDataResponse' {POSIX
endTime :: POSIX
$sel:endTime:BatchGetFrameMetricDataResponse' :: BatchGetFrameMetricDataResponse -> POSIX
endTime} -> POSIX
endTime) (\s :: BatchGetFrameMetricDataResponse
s@BatchGetFrameMetricDataResponse' {} POSIX
a -> BatchGetFrameMetricDataResponse
s {$sel:endTime:BatchGetFrameMetricDataResponse' :: POSIX
endTime = POSIX
a} :: BatchGetFrameMetricDataResponse) ((POSIX -> f POSIX)
 -> BatchGetFrameMetricDataResponse
 -> f BatchGetFrameMetricDataResponse)
-> ((UTCTime -> f UTCTime) -> POSIX -> f POSIX)
-> (UTCTime -> f UTCTime)
-> BatchGetFrameMetricDataResponse
-> f BatchGetFrameMetricDataResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (UTCTime -> f UTCTime) -> POSIX -> f POSIX
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

-- | List of instances, or time steps, in the time series. For example, if
-- the @period@ is one day (@PT24H)@), and the @resolution@ is five minutes
-- (@PT5M@), then there are 288 @endTimes@ in the list that are each five
-- minutes appart.
batchGetFrameMetricDataResponse_endTimes :: Lens.Lens' BatchGetFrameMetricDataResponse [TimestampStructure]
batchGetFrameMetricDataResponse_endTimes :: ([TimestampStructure] -> f [TimestampStructure])
-> BatchGetFrameMetricDataResponse
-> f BatchGetFrameMetricDataResponse
batchGetFrameMetricDataResponse_endTimes = (BatchGetFrameMetricDataResponse -> [TimestampStructure])
-> (BatchGetFrameMetricDataResponse
    -> [TimestampStructure] -> BatchGetFrameMetricDataResponse)
-> Lens
     BatchGetFrameMetricDataResponse
     BatchGetFrameMetricDataResponse
     [TimestampStructure]
     [TimestampStructure]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchGetFrameMetricDataResponse' {[TimestampStructure]
endTimes :: [TimestampStructure]
$sel:endTimes:BatchGetFrameMetricDataResponse' :: BatchGetFrameMetricDataResponse -> [TimestampStructure]
endTimes} -> [TimestampStructure]
endTimes) (\s :: BatchGetFrameMetricDataResponse
s@BatchGetFrameMetricDataResponse' {} [TimestampStructure]
a -> BatchGetFrameMetricDataResponse
s {$sel:endTimes:BatchGetFrameMetricDataResponse' :: [TimestampStructure]
endTimes = [TimestampStructure]
a} :: BatchGetFrameMetricDataResponse) (([TimestampStructure] -> f [TimestampStructure])
 -> BatchGetFrameMetricDataResponse
 -> f BatchGetFrameMetricDataResponse)
-> (([TimestampStructure] -> f [TimestampStructure])
    -> [TimestampStructure] -> f [TimestampStructure])
-> ([TimestampStructure] -> f [TimestampStructure])
-> BatchGetFrameMetricDataResponse
-> f BatchGetFrameMetricDataResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([TimestampStructure] -> f [TimestampStructure])
-> [TimestampStructure] -> f [TimestampStructure]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | Details of the metrics to request a time series of values. The metric
-- includes the name of the frame, the aggregation type to calculate the
-- metric value for the frame, and the thread states to use to get the
-- count for the metric value of the frame.
batchGetFrameMetricDataResponse_frameMetricData :: Lens.Lens' BatchGetFrameMetricDataResponse [FrameMetricDatum]
batchGetFrameMetricDataResponse_frameMetricData :: ([FrameMetricDatum] -> f [FrameMetricDatum])
-> BatchGetFrameMetricDataResponse
-> f BatchGetFrameMetricDataResponse
batchGetFrameMetricDataResponse_frameMetricData = (BatchGetFrameMetricDataResponse -> [FrameMetricDatum])
-> (BatchGetFrameMetricDataResponse
    -> [FrameMetricDatum] -> BatchGetFrameMetricDataResponse)
-> Lens
     BatchGetFrameMetricDataResponse
     BatchGetFrameMetricDataResponse
     [FrameMetricDatum]
     [FrameMetricDatum]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchGetFrameMetricDataResponse' {[FrameMetricDatum]
frameMetricData :: [FrameMetricDatum]
$sel:frameMetricData:BatchGetFrameMetricDataResponse' :: BatchGetFrameMetricDataResponse -> [FrameMetricDatum]
frameMetricData} -> [FrameMetricDatum]
frameMetricData) (\s :: BatchGetFrameMetricDataResponse
s@BatchGetFrameMetricDataResponse' {} [FrameMetricDatum]
a -> BatchGetFrameMetricDataResponse
s {$sel:frameMetricData:BatchGetFrameMetricDataResponse' :: [FrameMetricDatum]
frameMetricData = [FrameMetricDatum]
a} :: BatchGetFrameMetricDataResponse) (([FrameMetricDatum] -> f [FrameMetricDatum])
 -> BatchGetFrameMetricDataResponse
 -> f BatchGetFrameMetricDataResponse)
-> (([FrameMetricDatum] -> f [FrameMetricDatum])
    -> [FrameMetricDatum] -> f [FrameMetricDatum])
-> ([FrameMetricDatum] -> f [FrameMetricDatum])
-> BatchGetFrameMetricDataResponse
-> f BatchGetFrameMetricDataResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([FrameMetricDatum] -> f [FrameMetricDatum])
-> [FrameMetricDatum] -> f [FrameMetricDatum]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | Resolution or granularity of the profile data used to generate the time
-- series. This is the value used to jump through time steps in a time
-- series. There are 3 valid values.
--
-- -   @P1D@ — 1 day
--
-- -   @PT1H@ — 1 hour
--
-- -   @PT5M@ — 5 minutes
batchGetFrameMetricDataResponse_resolution :: Lens.Lens' BatchGetFrameMetricDataResponse AggregationPeriod
batchGetFrameMetricDataResponse_resolution :: (AggregationPeriod -> f AggregationPeriod)
-> BatchGetFrameMetricDataResponse
-> f BatchGetFrameMetricDataResponse
batchGetFrameMetricDataResponse_resolution = (BatchGetFrameMetricDataResponse -> AggregationPeriod)
-> (BatchGetFrameMetricDataResponse
    -> AggregationPeriod -> BatchGetFrameMetricDataResponse)
-> Lens
     BatchGetFrameMetricDataResponse
     BatchGetFrameMetricDataResponse
     AggregationPeriod
     AggregationPeriod
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchGetFrameMetricDataResponse' {AggregationPeriod
resolution :: AggregationPeriod
$sel:resolution:BatchGetFrameMetricDataResponse' :: BatchGetFrameMetricDataResponse -> AggregationPeriod
resolution} -> AggregationPeriod
resolution) (\s :: BatchGetFrameMetricDataResponse
s@BatchGetFrameMetricDataResponse' {} AggregationPeriod
a -> BatchGetFrameMetricDataResponse
s {$sel:resolution:BatchGetFrameMetricDataResponse' :: AggregationPeriod
resolution = AggregationPeriod
a} :: BatchGetFrameMetricDataResponse)

-- | The start time of the time period for the returned time series values.
-- This is specified using the ISO 8601 format. For example,
-- 2020-06-01T13:15:02.001Z represents 1 millisecond past June 1, 2020
-- 1:15:02 PM UTC.
batchGetFrameMetricDataResponse_startTime :: Lens.Lens' BatchGetFrameMetricDataResponse Prelude.UTCTime
batchGetFrameMetricDataResponse_startTime :: (UTCTime -> f UTCTime)
-> BatchGetFrameMetricDataResponse
-> f BatchGetFrameMetricDataResponse
batchGetFrameMetricDataResponse_startTime = (BatchGetFrameMetricDataResponse -> POSIX)
-> (BatchGetFrameMetricDataResponse
    -> POSIX -> BatchGetFrameMetricDataResponse)
-> Lens
     BatchGetFrameMetricDataResponse
     BatchGetFrameMetricDataResponse
     POSIX
     POSIX
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchGetFrameMetricDataResponse' {POSIX
startTime :: POSIX
$sel:startTime:BatchGetFrameMetricDataResponse' :: BatchGetFrameMetricDataResponse -> POSIX
startTime} -> POSIX
startTime) (\s :: BatchGetFrameMetricDataResponse
s@BatchGetFrameMetricDataResponse' {} POSIX
a -> BatchGetFrameMetricDataResponse
s {$sel:startTime:BatchGetFrameMetricDataResponse' :: POSIX
startTime = POSIX
a} :: BatchGetFrameMetricDataResponse) ((POSIX -> f POSIX)
 -> BatchGetFrameMetricDataResponse
 -> f BatchGetFrameMetricDataResponse)
-> ((UTCTime -> f UTCTime) -> POSIX -> f POSIX)
-> (UTCTime -> f UTCTime)
-> BatchGetFrameMetricDataResponse
-> f BatchGetFrameMetricDataResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (UTCTime -> f UTCTime) -> POSIX -> f POSIX
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

-- | List of instances which remained unprocessed. This will create a missing
-- time step in the list of end times.
batchGetFrameMetricDataResponse_unprocessedEndTimes :: Lens.Lens' BatchGetFrameMetricDataResponse (Prelude.HashMap Prelude.Text [TimestampStructure])
batchGetFrameMetricDataResponse_unprocessedEndTimes :: (HashMap Text [TimestampStructure]
 -> f (HashMap Text [TimestampStructure]))
-> BatchGetFrameMetricDataResponse
-> f BatchGetFrameMetricDataResponse
batchGetFrameMetricDataResponse_unprocessedEndTimes = (BatchGetFrameMetricDataResponse
 -> HashMap Text [TimestampStructure])
-> (BatchGetFrameMetricDataResponse
    -> HashMap Text [TimestampStructure]
    -> BatchGetFrameMetricDataResponse)
-> Lens
     BatchGetFrameMetricDataResponse
     BatchGetFrameMetricDataResponse
     (HashMap Text [TimestampStructure])
     (HashMap Text [TimestampStructure])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchGetFrameMetricDataResponse' {HashMap Text [TimestampStructure]
unprocessedEndTimes :: HashMap Text [TimestampStructure]
$sel:unprocessedEndTimes:BatchGetFrameMetricDataResponse' :: BatchGetFrameMetricDataResponse
-> HashMap Text [TimestampStructure]
unprocessedEndTimes} -> HashMap Text [TimestampStructure]
unprocessedEndTimes) (\s :: BatchGetFrameMetricDataResponse
s@BatchGetFrameMetricDataResponse' {} HashMap Text [TimestampStructure]
a -> BatchGetFrameMetricDataResponse
s {$sel:unprocessedEndTimes:BatchGetFrameMetricDataResponse' :: HashMap Text [TimestampStructure]
unprocessedEndTimes = HashMap Text [TimestampStructure]
a} :: BatchGetFrameMetricDataResponse) ((HashMap Text [TimestampStructure]
  -> f (HashMap Text [TimestampStructure]))
 -> BatchGetFrameMetricDataResponse
 -> f BatchGetFrameMetricDataResponse)
-> ((HashMap Text [TimestampStructure]
     -> f (HashMap Text [TimestampStructure]))
    -> HashMap Text [TimestampStructure]
    -> f (HashMap Text [TimestampStructure]))
-> (HashMap Text [TimestampStructure]
    -> f (HashMap Text [TimestampStructure]))
-> BatchGetFrameMetricDataResponse
-> f BatchGetFrameMetricDataResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (HashMap Text [TimestampStructure]
 -> f (HashMap Text [TimestampStructure]))
-> HashMap Text [TimestampStructure]
-> f (HashMap Text [TimestampStructure])
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance
  Prelude.NFData
    BatchGetFrameMetricDataResponse