{-# 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.XRay.GetTimeSeriesServiceStatistics
-- 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)
--
-- Get an aggregation of service statistics defined by a specific time
-- range.
--
-- This operation returns paginated results.
module Amazonka.XRay.GetTimeSeriesServiceStatistics
  ( -- * Creating a Request
    GetTimeSeriesServiceStatistics (..),
    newGetTimeSeriesServiceStatistics,

    -- * Request Lenses
    getTimeSeriesServiceStatistics_entitySelectorExpression,
    getTimeSeriesServiceStatistics_period,
    getTimeSeriesServiceStatistics_forecastStatistics,
    getTimeSeriesServiceStatistics_nextToken,
    getTimeSeriesServiceStatistics_groupARN,
    getTimeSeriesServiceStatistics_groupName,
    getTimeSeriesServiceStatistics_startTime,
    getTimeSeriesServiceStatistics_endTime,

    -- * Destructuring the Response
    GetTimeSeriesServiceStatisticsResponse (..),
    newGetTimeSeriesServiceStatisticsResponse,

    -- * Response Lenses
    getTimeSeriesServiceStatisticsResponse_containsOldGroupVersions,
    getTimeSeriesServiceStatisticsResponse_timeSeriesServiceStatistics,
    getTimeSeriesServiceStatisticsResponse_nextToken,
    getTimeSeriesServiceStatisticsResponse_httpStatus,
  )
where

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
import Amazonka.XRay.Types

-- | /See:/ 'newGetTimeSeriesServiceStatistics' smart constructor.
data GetTimeSeriesServiceStatistics = GetTimeSeriesServiceStatistics'
  { -- | A filter expression defining entities that will be aggregated for
    -- statistics. Supports ID, service, and edge functions. If no selector
    -- expression is specified, edge statistics are returned.
    GetTimeSeriesServiceStatistics -> Maybe Text
entitySelectorExpression :: Prelude.Maybe Prelude.Text,
    -- | Aggregation period in seconds.
    GetTimeSeriesServiceStatistics -> Maybe Int
period :: Prelude.Maybe Prelude.Int,
    -- | The forecasted high and low fault count values. Forecast enabled
    -- requests require the EntitySelectorExpression ID be provided.
    GetTimeSeriesServiceStatistics -> Maybe Bool
forecastStatistics :: Prelude.Maybe Prelude.Bool,
    -- | Pagination token.
    GetTimeSeriesServiceStatistics -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The Amazon Resource Name (ARN) of the group for which to pull statistics
    -- from.
    GetTimeSeriesServiceStatistics -> Maybe Text
groupARN :: Prelude.Maybe Prelude.Text,
    -- | The case-sensitive name of the group for which to pull statistics from.
    GetTimeSeriesServiceStatistics -> Maybe Text
groupName :: Prelude.Maybe Prelude.Text,
    -- | The start of the time frame for which to aggregate statistics.
    GetTimeSeriesServiceStatistics -> POSIX
startTime :: Core.POSIX,
    -- | The end of the time frame for which to aggregate statistics.
    GetTimeSeriesServiceStatistics -> POSIX
endTime :: Core.POSIX
  }
  deriving (GetTimeSeriesServiceStatistics
-> GetTimeSeriesServiceStatistics -> Bool
(GetTimeSeriesServiceStatistics
 -> GetTimeSeriesServiceStatistics -> Bool)
-> (GetTimeSeriesServiceStatistics
    -> GetTimeSeriesServiceStatistics -> Bool)
-> Eq GetTimeSeriesServiceStatistics
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetTimeSeriesServiceStatistics
-> GetTimeSeriesServiceStatistics -> Bool
$c/= :: GetTimeSeriesServiceStatistics
-> GetTimeSeriesServiceStatistics -> Bool
== :: GetTimeSeriesServiceStatistics
-> GetTimeSeriesServiceStatistics -> Bool
$c== :: GetTimeSeriesServiceStatistics
-> GetTimeSeriesServiceStatistics -> Bool
Prelude.Eq, ReadPrec [GetTimeSeriesServiceStatistics]
ReadPrec GetTimeSeriesServiceStatistics
Int -> ReadS GetTimeSeriesServiceStatistics
ReadS [GetTimeSeriesServiceStatistics]
(Int -> ReadS GetTimeSeriesServiceStatistics)
-> ReadS [GetTimeSeriesServiceStatistics]
-> ReadPrec GetTimeSeriesServiceStatistics
-> ReadPrec [GetTimeSeriesServiceStatistics]
-> Read GetTimeSeriesServiceStatistics
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetTimeSeriesServiceStatistics]
$creadListPrec :: ReadPrec [GetTimeSeriesServiceStatistics]
readPrec :: ReadPrec GetTimeSeriesServiceStatistics
$creadPrec :: ReadPrec GetTimeSeriesServiceStatistics
readList :: ReadS [GetTimeSeriesServiceStatistics]
$creadList :: ReadS [GetTimeSeriesServiceStatistics]
readsPrec :: Int -> ReadS GetTimeSeriesServiceStatistics
$creadsPrec :: Int -> ReadS GetTimeSeriesServiceStatistics
Prelude.Read, Int -> GetTimeSeriesServiceStatistics -> ShowS
[GetTimeSeriesServiceStatistics] -> ShowS
GetTimeSeriesServiceStatistics -> String
(Int -> GetTimeSeriesServiceStatistics -> ShowS)
-> (GetTimeSeriesServiceStatistics -> String)
-> ([GetTimeSeriesServiceStatistics] -> ShowS)
-> Show GetTimeSeriesServiceStatistics
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetTimeSeriesServiceStatistics] -> ShowS
$cshowList :: [GetTimeSeriesServiceStatistics] -> ShowS
show :: GetTimeSeriesServiceStatistics -> String
$cshow :: GetTimeSeriesServiceStatistics -> String
showsPrec :: Int -> GetTimeSeriesServiceStatistics -> ShowS
$cshowsPrec :: Int -> GetTimeSeriesServiceStatistics -> ShowS
Prelude.Show, (forall x.
 GetTimeSeriesServiceStatistics
 -> Rep GetTimeSeriesServiceStatistics x)
-> (forall x.
    Rep GetTimeSeriesServiceStatistics x
    -> GetTimeSeriesServiceStatistics)
-> Generic GetTimeSeriesServiceStatistics
forall x.
Rep GetTimeSeriesServiceStatistics x
-> GetTimeSeriesServiceStatistics
forall x.
GetTimeSeriesServiceStatistics
-> Rep GetTimeSeriesServiceStatistics x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetTimeSeriesServiceStatistics x
-> GetTimeSeriesServiceStatistics
$cfrom :: forall x.
GetTimeSeriesServiceStatistics
-> Rep GetTimeSeriesServiceStatistics x
Prelude.Generic)

-- |
-- Create a value of 'GetTimeSeriesServiceStatistics' 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:
--
-- 'entitySelectorExpression', 'getTimeSeriesServiceStatistics_entitySelectorExpression' - A filter expression defining entities that will be aggregated for
-- statistics. Supports ID, service, and edge functions. If no selector
-- expression is specified, edge statistics are returned.
--
-- 'period', 'getTimeSeriesServiceStatistics_period' - Aggregation period in seconds.
--
-- 'forecastStatistics', 'getTimeSeriesServiceStatistics_forecastStatistics' - The forecasted high and low fault count values. Forecast enabled
-- requests require the EntitySelectorExpression ID be provided.
--
-- 'nextToken', 'getTimeSeriesServiceStatistics_nextToken' - Pagination token.
--
-- 'groupARN', 'getTimeSeriesServiceStatistics_groupARN' - The Amazon Resource Name (ARN) of the group for which to pull statistics
-- from.
--
-- 'groupName', 'getTimeSeriesServiceStatistics_groupName' - The case-sensitive name of the group for which to pull statistics from.
--
-- 'startTime', 'getTimeSeriesServiceStatistics_startTime' - The start of the time frame for which to aggregate statistics.
--
-- 'endTime', 'getTimeSeriesServiceStatistics_endTime' - The end of the time frame for which to aggregate statistics.
newGetTimeSeriesServiceStatistics ::
  -- | 'startTime'
  Prelude.UTCTime ->
  -- | 'endTime'
  Prelude.UTCTime ->
  GetTimeSeriesServiceStatistics
newGetTimeSeriesServiceStatistics :: UTCTime -> UTCTime -> GetTimeSeriesServiceStatistics
newGetTimeSeriesServiceStatistics
  UTCTime
pStartTime_
  UTCTime
pEndTime_ =
    GetTimeSeriesServiceStatistics' :: Maybe Text
-> Maybe Int
-> Maybe Bool
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> POSIX
-> POSIX
-> GetTimeSeriesServiceStatistics
GetTimeSeriesServiceStatistics'
      { $sel:entitySelectorExpression:GetTimeSeriesServiceStatistics' :: Maybe Text
entitySelectorExpression =
          Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:period:GetTimeSeriesServiceStatistics' :: Maybe Int
period = Maybe Int
forall a. Maybe a
Prelude.Nothing,
        $sel:forecastStatistics:GetTimeSeriesServiceStatistics' :: Maybe Bool
forecastStatistics = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
        $sel:nextToken:GetTimeSeriesServiceStatistics' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:groupARN:GetTimeSeriesServiceStatistics' :: Maybe Text
groupARN = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:groupName:GetTimeSeriesServiceStatistics' :: Maybe Text
groupName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:startTime:GetTimeSeriesServiceStatistics' :: 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:endTime:GetTimeSeriesServiceStatistics' :: 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_
      }

-- | A filter expression defining entities that will be aggregated for
-- statistics. Supports ID, service, and edge functions. If no selector
-- expression is specified, edge statistics are returned.
getTimeSeriesServiceStatistics_entitySelectorExpression :: Lens.Lens' GetTimeSeriesServiceStatistics (Prelude.Maybe Prelude.Text)
getTimeSeriesServiceStatistics_entitySelectorExpression :: (Maybe Text -> f (Maybe Text))
-> GetTimeSeriesServiceStatistics
-> f GetTimeSeriesServiceStatistics
getTimeSeriesServiceStatistics_entitySelectorExpression = (GetTimeSeriesServiceStatistics -> Maybe Text)
-> (GetTimeSeriesServiceStatistics
    -> Maybe Text -> GetTimeSeriesServiceStatistics)
-> Lens
     GetTimeSeriesServiceStatistics
     GetTimeSeriesServiceStatistics
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetTimeSeriesServiceStatistics' {Maybe Text
entitySelectorExpression :: Maybe Text
$sel:entitySelectorExpression:GetTimeSeriesServiceStatistics' :: GetTimeSeriesServiceStatistics -> Maybe Text
entitySelectorExpression} -> Maybe Text
entitySelectorExpression) (\s :: GetTimeSeriesServiceStatistics
s@GetTimeSeriesServiceStatistics' {} Maybe Text
a -> GetTimeSeriesServiceStatistics
s {$sel:entitySelectorExpression:GetTimeSeriesServiceStatistics' :: Maybe Text
entitySelectorExpression = Maybe Text
a} :: GetTimeSeriesServiceStatistics)

-- | Aggregation period in seconds.
getTimeSeriesServiceStatistics_period :: Lens.Lens' GetTimeSeriesServiceStatistics (Prelude.Maybe Prelude.Int)
getTimeSeriesServiceStatistics_period :: (Maybe Int -> f (Maybe Int))
-> GetTimeSeriesServiceStatistics
-> f GetTimeSeriesServiceStatistics
getTimeSeriesServiceStatistics_period = (GetTimeSeriesServiceStatistics -> Maybe Int)
-> (GetTimeSeriesServiceStatistics
    -> Maybe Int -> GetTimeSeriesServiceStatistics)
-> Lens
     GetTimeSeriesServiceStatistics
     GetTimeSeriesServiceStatistics
     (Maybe Int)
     (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetTimeSeriesServiceStatistics' {Maybe Int
period :: Maybe Int
$sel:period:GetTimeSeriesServiceStatistics' :: GetTimeSeriesServiceStatistics -> Maybe Int
period} -> Maybe Int
period) (\s :: GetTimeSeriesServiceStatistics
s@GetTimeSeriesServiceStatistics' {} Maybe Int
a -> GetTimeSeriesServiceStatistics
s {$sel:period:GetTimeSeriesServiceStatistics' :: Maybe Int
period = Maybe Int
a} :: GetTimeSeriesServiceStatistics)

-- | The forecasted high and low fault count values. Forecast enabled
-- requests require the EntitySelectorExpression ID be provided.
getTimeSeriesServiceStatistics_forecastStatistics :: Lens.Lens' GetTimeSeriesServiceStatistics (Prelude.Maybe Prelude.Bool)
getTimeSeriesServiceStatistics_forecastStatistics :: (Maybe Bool -> f (Maybe Bool))
-> GetTimeSeriesServiceStatistics
-> f GetTimeSeriesServiceStatistics
getTimeSeriesServiceStatistics_forecastStatistics = (GetTimeSeriesServiceStatistics -> Maybe Bool)
-> (GetTimeSeriesServiceStatistics
    -> Maybe Bool -> GetTimeSeriesServiceStatistics)
-> Lens
     GetTimeSeriesServiceStatistics
     GetTimeSeriesServiceStatistics
     (Maybe Bool)
     (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetTimeSeriesServiceStatistics' {Maybe Bool
forecastStatistics :: Maybe Bool
$sel:forecastStatistics:GetTimeSeriesServiceStatistics' :: GetTimeSeriesServiceStatistics -> Maybe Bool
forecastStatistics} -> Maybe Bool
forecastStatistics) (\s :: GetTimeSeriesServiceStatistics
s@GetTimeSeriesServiceStatistics' {} Maybe Bool
a -> GetTimeSeriesServiceStatistics
s {$sel:forecastStatistics:GetTimeSeriesServiceStatistics' :: Maybe Bool
forecastStatistics = Maybe Bool
a} :: GetTimeSeriesServiceStatistics)

-- | Pagination token.
getTimeSeriesServiceStatistics_nextToken :: Lens.Lens' GetTimeSeriesServiceStatistics (Prelude.Maybe Prelude.Text)
getTimeSeriesServiceStatistics_nextToken :: (Maybe Text -> f (Maybe Text))
-> GetTimeSeriesServiceStatistics
-> f GetTimeSeriesServiceStatistics
getTimeSeriesServiceStatistics_nextToken = (GetTimeSeriesServiceStatistics -> Maybe Text)
-> (GetTimeSeriesServiceStatistics
    -> Maybe Text -> GetTimeSeriesServiceStatistics)
-> Lens
     GetTimeSeriesServiceStatistics
     GetTimeSeriesServiceStatistics
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetTimeSeriesServiceStatistics' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:GetTimeSeriesServiceStatistics' :: GetTimeSeriesServiceStatistics -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: GetTimeSeriesServiceStatistics
s@GetTimeSeriesServiceStatistics' {} Maybe Text
a -> GetTimeSeriesServiceStatistics
s {$sel:nextToken:GetTimeSeriesServiceStatistics' :: Maybe Text
nextToken = Maybe Text
a} :: GetTimeSeriesServiceStatistics)

-- | The Amazon Resource Name (ARN) of the group for which to pull statistics
-- from.
getTimeSeriesServiceStatistics_groupARN :: Lens.Lens' GetTimeSeriesServiceStatistics (Prelude.Maybe Prelude.Text)
getTimeSeriesServiceStatistics_groupARN :: (Maybe Text -> f (Maybe Text))
-> GetTimeSeriesServiceStatistics
-> f GetTimeSeriesServiceStatistics
getTimeSeriesServiceStatistics_groupARN = (GetTimeSeriesServiceStatistics -> Maybe Text)
-> (GetTimeSeriesServiceStatistics
    -> Maybe Text -> GetTimeSeriesServiceStatistics)
-> Lens
     GetTimeSeriesServiceStatistics
     GetTimeSeriesServiceStatistics
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetTimeSeriesServiceStatistics' {Maybe Text
groupARN :: Maybe Text
$sel:groupARN:GetTimeSeriesServiceStatistics' :: GetTimeSeriesServiceStatistics -> Maybe Text
groupARN} -> Maybe Text
groupARN) (\s :: GetTimeSeriesServiceStatistics
s@GetTimeSeriesServiceStatistics' {} Maybe Text
a -> GetTimeSeriesServiceStatistics
s {$sel:groupARN:GetTimeSeriesServiceStatistics' :: Maybe Text
groupARN = Maybe Text
a} :: GetTimeSeriesServiceStatistics)

-- | The case-sensitive name of the group for which to pull statistics from.
getTimeSeriesServiceStatistics_groupName :: Lens.Lens' GetTimeSeriesServiceStatistics (Prelude.Maybe Prelude.Text)
getTimeSeriesServiceStatistics_groupName :: (Maybe Text -> f (Maybe Text))
-> GetTimeSeriesServiceStatistics
-> f GetTimeSeriesServiceStatistics
getTimeSeriesServiceStatistics_groupName = (GetTimeSeriesServiceStatistics -> Maybe Text)
-> (GetTimeSeriesServiceStatistics
    -> Maybe Text -> GetTimeSeriesServiceStatistics)
-> Lens
     GetTimeSeriesServiceStatistics
     GetTimeSeriesServiceStatistics
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetTimeSeriesServiceStatistics' {Maybe Text
groupName :: Maybe Text
$sel:groupName:GetTimeSeriesServiceStatistics' :: GetTimeSeriesServiceStatistics -> Maybe Text
groupName} -> Maybe Text
groupName) (\s :: GetTimeSeriesServiceStatistics
s@GetTimeSeriesServiceStatistics' {} Maybe Text
a -> GetTimeSeriesServiceStatistics
s {$sel:groupName:GetTimeSeriesServiceStatistics' :: Maybe Text
groupName = Maybe Text
a} :: GetTimeSeriesServiceStatistics)

-- | The start of the time frame for which to aggregate statistics.
getTimeSeriesServiceStatistics_startTime :: Lens.Lens' GetTimeSeriesServiceStatistics Prelude.UTCTime
getTimeSeriesServiceStatistics_startTime :: (UTCTime -> f UTCTime)
-> GetTimeSeriesServiceStatistics
-> f GetTimeSeriesServiceStatistics
getTimeSeriesServiceStatistics_startTime = (GetTimeSeriesServiceStatistics -> POSIX)
-> (GetTimeSeriesServiceStatistics
    -> POSIX -> GetTimeSeriesServiceStatistics)
-> Lens
     GetTimeSeriesServiceStatistics
     GetTimeSeriesServiceStatistics
     POSIX
     POSIX
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetTimeSeriesServiceStatistics' {POSIX
startTime :: POSIX
$sel:startTime:GetTimeSeriesServiceStatistics' :: GetTimeSeriesServiceStatistics -> POSIX
startTime} -> POSIX
startTime) (\s :: GetTimeSeriesServiceStatistics
s@GetTimeSeriesServiceStatistics' {} POSIX
a -> GetTimeSeriesServiceStatistics
s {$sel:startTime:GetTimeSeriesServiceStatistics' :: POSIX
startTime = POSIX
a} :: GetTimeSeriesServiceStatistics) ((POSIX -> f POSIX)
 -> GetTimeSeriesServiceStatistics
 -> f GetTimeSeriesServiceStatistics)
-> ((UTCTime -> f UTCTime) -> POSIX -> f POSIX)
-> (UTCTime -> f UTCTime)
-> GetTimeSeriesServiceStatistics
-> f GetTimeSeriesServiceStatistics
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

-- | The end of the time frame for which to aggregate statistics.
getTimeSeriesServiceStatistics_endTime :: Lens.Lens' GetTimeSeriesServiceStatistics Prelude.UTCTime
getTimeSeriesServiceStatistics_endTime :: (UTCTime -> f UTCTime)
-> GetTimeSeriesServiceStatistics
-> f GetTimeSeriesServiceStatistics
getTimeSeriesServiceStatistics_endTime = (GetTimeSeriesServiceStatistics -> POSIX)
-> (GetTimeSeriesServiceStatistics
    -> POSIX -> GetTimeSeriesServiceStatistics)
-> Lens
     GetTimeSeriesServiceStatistics
     GetTimeSeriesServiceStatistics
     POSIX
     POSIX
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetTimeSeriesServiceStatistics' {POSIX
endTime :: POSIX
$sel:endTime:GetTimeSeriesServiceStatistics' :: GetTimeSeriesServiceStatistics -> POSIX
endTime} -> POSIX
endTime) (\s :: GetTimeSeriesServiceStatistics
s@GetTimeSeriesServiceStatistics' {} POSIX
a -> GetTimeSeriesServiceStatistics
s {$sel:endTime:GetTimeSeriesServiceStatistics' :: POSIX
endTime = POSIX
a} :: GetTimeSeriesServiceStatistics) ((POSIX -> f POSIX)
 -> GetTimeSeriesServiceStatistics
 -> f GetTimeSeriesServiceStatistics)
-> ((UTCTime -> f UTCTime) -> POSIX -> f POSIX)
-> (UTCTime -> f UTCTime)
-> GetTimeSeriesServiceStatistics
-> f GetTimeSeriesServiceStatistics
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

instance Core.AWSPager GetTimeSeriesServiceStatistics where
  page :: GetTimeSeriesServiceStatistics
-> AWSResponse GetTimeSeriesServiceStatistics
-> Maybe GetTimeSeriesServiceStatistics
page GetTimeSeriesServiceStatistics
rq AWSResponse GetTimeSeriesServiceStatistics
rs
    | Maybe Text -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse GetTimeSeriesServiceStatistics
GetTimeSeriesServiceStatisticsResponse
rs
            GetTimeSeriesServiceStatisticsResponse
-> Getting (First Text) GetTimeSeriesServiceStatisticsResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> GetTimeSeriesServiceStatisticsResponse
-> Const (First Text) GetTimeSeriesServiceStatisticsResponse
Lens' GetTimeSeriesServiceStatisticsResponse (Maybe Text)
getTimeSeriesServiceStatisticsResponse_nextToken
              ((Maybe Text -> Const (First Text) (Maybe Text))
 -> GetTimeSeriesServiceStatisticsResponse
 -> Const (First Text) GetTimeSeriesServiceStatisticsResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) GetTimeSeriesServiceStatisticsResponse Text
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (Text -> Const (First Text) Text)
-> Maybe Text -> Const (First Text) (Maybe Text)
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
      Maybe GetTimeSeriesServiceStatistics
forall a. Maybe a
Prelude.Nothing
    | Maybe [TimeSeriesServiceStatistics] -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse GetTimeSeriesServiceStatistics
GetTimeSeriesServiceStatisticsResponse
rs
            GetTimeSeriesServiceStatisticsResponse
-> Getting
     (First [TimeSeriesServiceStatistics])
     GetTimeSeriesServiceStatisticsResponse
     [TimeSeriesServiceStatistics]
-> Maybe [TimeSeriesServiceStatistics]
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe [TimeSeriesServiceStatistics]
 -> Const
      (First [TimeSeriesServiceStatistics])
      (Maybe [TimeSeriesServiceStatistics]))
-> GetTimeSeriesServiceStatisticsResponse
-> Const
     (First [TimeSeriesServiceStatistics])
     GetTimeSeriesServiceStatisticsResponse
Lens'
  GetTimeSeriesServiceStatisticsResponse
  (Maybe [TimeSeriesServiceStatistics])
getTimeSeriesServiceStatisticsResponse_timeSeriesServiceStatistics
              ((Maybe [TimeSeriesServiceStatistics]
  -> Const
       (First [TimeSeriesServiceStatistics])
       (Maybe [TimeSeriesServiceStatistics]))
 -> GetTimeSeriesServiceStatisticsResponse
 -> Const
      (First [TimeSeriesServiceStatistics])
      GetTimeSeriesServiceStatisticsResponse)
-> (([TimeSeriesServiceStatistics]
     -> Const
          (First [TimeSeriesServiceStatistics])
          [TimeSeriesServiceStatistics])
    -> Maybe [TimeSeriesServiceStatistics]
    -> Const
         (First [TimeSeriesServiceStatistics])
         (Maybe [TimeSeriesServiceStatistics]))
-> Getting
     (First [TimeSeriesServiceStatistics])
     GetTimeSeriesServiceStatisticsResponse
     [TimeSeriesServiceStatistics]
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([TimeSeriesServiceStatistics]
 -> Const
      (First [TimeSeriesServiceStatistics])
      [TimeSeriesServiceStatistics])
-> Maybe [TimeSeriesServiceStatistics]
-> Const
     (First [TimeSeriesServiceStatistics])
     (Maybe [TimeSeriesServiceStatistics])
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
      Maybe GetTimeSeriesServiceStatistics
forall a. Maybe a
Prelude.Nothing
    | Bool
Prelude.otherwise =
      GetTimeSeriesServiceStatistics
-> Maybe GetTimeSeriesServiceStatistics
forall a. a -> Maybe a
Prelude.Just (GetTimeSeriesServiceStatistics
 -> Maybe GetTimeSeriesServiceStatistics)
-> GetTimeSeriesServiceStatistics
-> Maybe GetTimeSeriesServiceStatistics
forall a b. (a -> b) -> a -> b
Prelude.$
        GetTimeSeriesServiceStatistics
rq
          GetTimeSeriesServiceStatistics
-> (GetTimeSeriesServiceStatistics
    -> GetTimeSeriesServiceStatistics)
-> GetTimeSeriesServiceStatistics
forall a b. a -> (a -> b) -> b
Prelude.& (Maybe Text -> Identity (Maybe Text))
-> GetTimeSeriesServiceStatistics
-> Identity GetTimeSeriesServiceStatistics
Lens
  GetTimeSeriesServiceStatistics
  GetTimeSeriesServiceStatistics
  (Maybe Text)
  (Maybe Text)
getTimeSeriesServiceStatistics_nextToken
          ((Maybe Text -> Identity (Maybe Text))
 -> GetTimeSeriesServiceStatistics
 -> Identity GetTimeSeriesServiceStatistics)
-> Maybe Text
-> GetTimeSeriesServiceStatistics
-> GetTimeSeriesServiceStatistics
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse GetTimeSeriesServiceStatistics
GetTimeSeriesServiceStatisticsResponse
rs
          GetTimeSeriesServiceStatisticsResponse
-> Getting (First Text) GetTimeSeriesServiceStatisticsResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> GetTimeSeriesServiceStatisticsResponse
-> Const (First Text) GetTimeSeriesServiceStatisticsResponse
Lens' GetTimeSeriesServiceStatisticsResponse (Maybe Text)
getTimeSeriesServiceStatisticsResponse_nextToken
            ((Maybe Text -> Const (First Text) (Maybe Text))
 -> GetTimeSeriesServiceStatisticsResponse
 -> Const (First Text) GetTimeSeriesServiceStatisticsResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) GetTimeSeriesServiceStatisticsResponse Text
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (Text -> Const (First Text) Text)
-> Maybe Text -> Const (First Text) (Maybe Text)
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just

instance
  Core.AWSRequest
    GetTimeSeriesServiceStatistics
  where
  type
    AWSResponse GetTimeSeriesServiceStatistics =
      GetTimeSeriesServiceStatisticsResponse
  request :: GetTimeSeriesServiceStatistics
-> Request GetTimeSeriesServiceStatistics
request = Service
-> GetTimeSeriesServiceStatistics
-> Request GetTimeSeriesServiceStatistics
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy GetTimeSeriesServiceStatistics
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse (AWSResponse GetTimeSeriesServiceStatistics)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse GetTimeSeriesServiceStatistics))
-> Logger
-> Service
-> Proxy GetTimeSeriesServiceStatistics
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse (AWSResponse GetTimeSeriesServiceStatistics)))
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 Bool
-> Maybe [TimeSeriesServiceStatistics]
-> Maybe Text
-> Int
-> GetTimeSeriesServiceStatisticsResponse
GetTimeSeriesServiceStatisticsResponse'
            (Maybe Bool
 -> Maybe [TimeSeriesServiceStatistics]
 -> Maybe Text
 -> Int
 -> GetTimeSeriesServiceStatisticsResponse)
-> Either String (Maybe Bool)
-> Either
     String
     (Maybe [TimeSeriesServiceStatistics]
      -> Maybe Text -> Int -> GetTimeSeriesServiceStatisticsResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe Bool)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"ContainsOldGroupVersions")
            Either
  String
  (Maybe [TimeSeriesServiceStatistics]
   -> Maybe Text -> Int -> GetTimeSeriesServiceStatisticsResponse)
-> Either String (Maybe [TimeSeriesServiceStatistics])
-> Either
     String
     (Maybe Text -> Int -> GetTimeSeriesServiceStatisticsResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object
-> Text
-> Either String (Maybe (Maybe [TimeSeriesServiceStatistics]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"TimeSeriesServiceStatistics"
                            Either String (Maybe (Maybe [TimeSeriesServiceStatistics]))
-> Maybe [TimeSeriesServiceStatistics]
-> Either String (Maybe [TimeSeriesServiceStatistics])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [TimeSeriesServiceStatistics]
forall a. Monoid a => a
Prelude.mempty
                        )
            Either
  String
  (Maybe Text -> Int -> GetTimeSeriesServiceStatisticsResponse)
-> Either String (Maybe Text)
-> Either String (Int -> GetTimeSeriesServiceStatisticsResponse)
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 -> GetTimeSeriesServiceStatisticsResponse)
-> Either String Int
-> Either String GetTimeSeriesServiceStatisticsResponse
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
    GetTimeSeriesServiceStatistics

instance
  Prelude.NFData
    GetTimeSeriesServiceStatistics

instance
  Core.ToHeaders
    GetTimeSeriesServiceStatistics
  where
  toHeaders :: GetTimeSeriesServiceStatistics -> ResponseHeaders
toHeaders = ResponseHeaders
-> GetTimeSeriesServiceStatistics -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const ResponseHeaders
forall a. Monoid a => a
Prelude.mempty

instance Core.ToJSON GetTimeSeriesServiceStatistics where
  toJSON :: GetTimeSeriesServiceStatistics -> Value
toJSON GetTimeSeriesServiceStatistics' {Maybe Bool
Maybe Int
Maybe Text
POSIX
endTime :: POSIX
startTime :: POSIX
groupName :: Maybe Text
groupARN :: Maybe Text
nextToken :: Maybe Text
forecastStatistics :: Maybe Bool
period :: Maybe Int
entitySelectorExpression :: Maybe Text
$sel:endTime:GetTimeSeriesServiceStatistics' :: GetTimeSeriesServiceStatistics -> POSIX
$sel:startTime:GetTimeSeriesServiceStatistics' :: GetTimeSeriesServiceStatistics -> POSIX
$sel:groupName:GetTimeSeriesServiceStatistics' :: GetTimeSeriesServiceStatistics -> Maybe Text
$sel:groupARN:GetTimeSeriesServiceStatistics' :: GetTimeSeriesServiceStatistics -> Maybe Text
$sel:nextToken:GetTimeSeriesServiceStatistics' :: GetTimeSeriesServiceStatistics -> Maybe Text
$sel:forecastStatistics:GetTimeSeriesServiceStatistics' :: GetTimeSeriesServiceStatistics -> Maybe Bool
$sel:period:GetTimeSeriesServiceStatistics' :: GetTimeSeriesServiceStatistics -> Maybe Int
$sel:entitySelectorExpression:GetTimeSeriesServiceStatistics' :: GetTimeSeriesServiceStatistics -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"EntitySelectorExpression" 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
entitySelectorExpression,
            (Text
"Period" Text -> Int -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Int -> Pair) -> Maybe Int -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Int
period,
            (Text
"ForecastStatistics" Text -> Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Bool -> Pair) -> Maybe Bool -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Bool
forecastStatistics,
            (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
"GroupARN" 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
groupARN,
            (Text
"GroupName" 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
groupName,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"StartTime" Text -> POSIX -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= POSIX
startTime),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"EndTime" Text -> POSIX -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= POSIX
endTime)
          ]
      )

instance Core.ToPath GetTimeSeriesServiceStatistics where
  toPath :: GetTimeSeriesServiceStatistics -> ByteString
toPath = ByteString -> GetTimeSeriesServiceStatistics -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/TimeSeriesServiceStatistics"

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

-- | /See:/ 'newGetTimeSeriesServiceStatisticsResponse' smart constructor.
data GetTimeSeriesServiceStatisticsResponse = GetTimeSeriesServiceStatisticsResponse'
  { -- | A flag indicating whether or not a group\'s filter expression has been
    -- consistent, or if a returned aggregation might show statistics from an
    -- older version of the group\'s filter expression.
    GetTimeSeriesServiceStatisticsResponse -> Maybe Bool
containsOldGroupVersions :: Prelude.Maybe Prelude.Bool,
    -- | The collection of statistics.
    GetTimeSeriesServiceStatisticsResponse
-> Maybe [TimeSeriesServiceStatistics]
timeSeriesServiceStatistics :: Prelude.Maybe [TimeSeriesServiceStatistics],
    -- | Pagination token.
    GetTimeSeriesServiceStatisticsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    GetTimeSeriesServiceStatisticsResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (GetTimeSeriesServiceStatisticsResponse
-> GetTimeSeriesServiceStatisticsResponse -> Bool
(GetTimeSeriesServiceStatisticsResponse
 -> GetTimeSeriesServiceStatisticsResponse -> Bool)
-> (GetTimeSeriesServiceStatisticsResponse
    -> GetTimeSeriesServiceStatisticsResponse -> Bool)
-> Eq GetTimeSeriesServiceStatisticsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetTimeSeriesServiceStatisticsResponse
-> GetTimeSeriesServiceStatisticsResponse -> Bool
$c/= :: GetTimeSeriesServiceStatisticsResponse
-> GetTimeSeriesServiceStatisticsResponse -> Bool
== :: GetTimeSeriesServiceStatisticsResponse
-> GetTimeSeriesServiceStatisticsResponse -> Bool
$c== :: GetTimeSeriesServiceStatisticsResponse
-> GetTimeSeriesServiceStatisticsResponse -> Bool
Prelude.Eq, ReadPrec [GetTimeSeriesServiceStatisticsResponse]
ReadPrec GetTimeSeriesServiceStatisticsResponse
Int -> ReadS GetTimeSeriesServiceStatisticsResponse
ReadS [GetTimeSeriesServiceStatisticsResponse]
(Int -> ReadS GetTimeSeriesServiceStatisticsResponse)
-> ReadS [GetTimeSeriesServiceStatisticsResponse]
-> ReadPrec GetTimeSeriesServiceStatisticsResponse
-> ReadPrec [GetTimeSeriesServiceStatisticsResponse]
-> Read GetTimeSeriesServiceStatisticsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetTimeSeriesServiceStatisticsResponse]
$creadListPrec :: ReadPrec [GetTimeSeriesServiceStatisticsResponse]
readPrec :: ReadPrec GetTimeSeriesServiceStatisticsResponse
$creadPrec :: ReadPrec GetTimeSeriesServiceStatisticsResponse
readList :: ReadS [GetTimeSeriesServiceStatisticsResponse]
$creadList :: ReadS [GetTimeSeriesServiceStatisticsResponse]
readsPrec :: Int -> ReadS GetTimeSeriesServiceStatisticsResponse
$creadsPrec :: Int -> ReadS GetTimeSeriesServiceStatisticsResponse
Prelude.Read, Int -> GetTimeSeriesServiceStatisticsResponse -> ShowS
[GetTimeSeriesServiceStatisticsResponse] -> ShowS
GetTimeSeriesServiceStatisticsResponse -> String
(Int -> GetTimeSeriesServiceStatisticsResponse -> ShowS)
-> (GetTimeSeriesServiceStatisticsResponse -> String)
-> ([GetTimeSeriesServiceStatisticsResponse] -> ShowS)
-> Show GetTimeSeriesServiceStatisticsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetTimeSeriesServiceStatisticsResponse] -> ShowS
$cshowList :: [GetTimeSeriesServiceStatisticsResponse] -> ShowS
show :: GetTimeSeriesServiceStatisticsResponse -> String
$cshow :: GetTimeSeriesServiceStatisticsResponse -> String
showsPrec :: Int -> GetTimeSeriesServiceStatisticsResponse -> ShowS
$cshowsPrec :: Int -> GetTimeSeriesServiceStatisticsResponse -> ShowS
Prelude.Show, (forall x.
 GetTimeSeriesServiceStatisticsResponse
 -> Rep GetTimeSeriesServiceStatisticsResponse x)
-> (forall x.
    Rep GetTimeSeriesServiceStatisticsResponse x
    -> GetTimeSeriesServiceStatisticsResponse)
-> Generic GetTimeSeriesServiceStatisticsResponse
forall x.
Rep GetTimeSeriesServiceStatisticsResponse x
-> GetTimeSeriesServiceStatisticsResponse
forall x.
GetTimeSeriesServiceStatisticsResponse
-> Rep GetTimeSeriesServiceStatisticsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetTimeSeriesServiceStatisticsResponse x
-> GetTimeSeriesServiceStatisticsResponse
$cfrom :: forall x.
GetTimeSeriesServiceStatisticsResponse
-> Rep GetTimeSeriesServiceStatisticsResponse x
Prelude.Generic)

-- |
-- Create a value of 'GetTimeSeriesServiceStatisticsResponse' 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:
--
-- 'containsOldGroupVersions', 'getTimeSeriesServiceStatisticsResponse_containsOldGroupVersions' - A flag indicating whether or not a group\'s filter expression has been
-- consistent, or if a returned aggregation might show statistics from an
-- older version of the group\'s filter expression.
--
-- 'timeSeriesServiceStatistics', 'getTimeSeriesServiceStatisticsResponse_timeSeriesServiceStatistics' - The collection of statistics.
--
-- 'nextToken', 'getTimeSeriesServiceStatisticsResponse_nextToken' - Pagination token.
--
-- 'httpStatus', 'getTimeSeriesServiceStatisticsResponse_httpStatus' - The response's http status code.
newGetTimeSeriesServiceStatisticsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  GetTimeSeriesServiceStatisticsResponse
newGetTimeSeriesServiceStatisticsResponse :: Int -> GetTimeSeriesServiceStatisticsResponse
newGetTimeSeriesServiceStatisticsResponse
  Int
pHttpStatus_ =
    GetTimeSeriesServiceStatisticsResponse' :: Maybe Bool
-> Maybe [TimeSeriesServiceStatistics]
-> Maybe Text
-> Int
-> GetTimeSeriesServiceStatisticsResponse
GetTimeSeriesServiceStatisticsResponse'
      { $sel:containsOldGroupVersions:GetTimeSeriesServiceStatisticsResponse' :: Maybe Bool
containsOldGroupVersions =
          Maybe Bool
forall a. Maybe a
Prelude.Nothing,
        $sel:timeSeriesServiceStatistics:GetTimeSeriesServiceStatisticsResponse' :: Maybe [TimeSeriesServiceStatistics]
timeSeriesServiceStatistics =
          Maybe [TimeSeriesServiceStatistics]
forall a. Maybe a
Prelude.Nothing,
        $sel:nextToken:GetTimeSeriesServiceStatisticsResponse' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:httpStatus:GetTimeSeriesServiceStatisticsResponse' :: Int
httpStatus = Int
pHttpStatus_
      }

-- | A flag indicating whether or not a group\'s filter expression has been
-- consistent, or if a returned aggregation might show statistics from an
-- older version of the group\'s filter expression.
getTimeSeriesServiceStatisticsResponse_containsOldGroupVersions :: Lens.Lens' GetTimeSeriesServiceStatisticsResponse (Prelude.Maybe Prelude.Bool)
getTimeSeriesServiceStatisticsResponse_containsOldGroupVersions :: (Maybe Bool -> f (Maybe Bool))
-> GetTimeSeriesServiceStatisticsResponse
-> f GetTimeSeriesServiceStatisticsResponse
getTimeSeriesServiceStatisticsResponse_containsOldGroupVersions = (GetTimeSeriesServiceStatisticsResponse -> Maybe Bool)
-> (GetTimeSeriesServiceStatisticsResponse
    -> Maybe Bool -> GetTimeSeriesServiceStatisticsResponse)
-> Lens
     GetTimeSeriesServiceStatisticsResponse
     GetTimeSeriesServiceStatisticsResponse
     (Maybe Bool)
     (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetTimeSeriesServiceStatisticsResponse' {Maybe Bool
containsOldGroupVersions :: Maybe Bool
$sel:containsOldGroupVersions:GetTimeSeriesServiceStatisticsResponse' :: GetTimeSeriesServiceStatisticsResponse -> Maybe Bool
containsOldGroupVersions} -> Maybe Bool
containsOldGroupVersions) (\s :: GetTimeSeriesServiceStatisticsResponse
s@GetTimeSeriesServiceStatisticsResponse' {} Maybe Bool
a -> GetTimeSeriesServiceStatisticsResponse
s {$sel:containsOldGroupVersions:GetTimeSeriesServiceStatisticsResponse' :: Maybe Bool
containsOldGroupVersions = Maybe Bool
a} :: GetTimeSeriesServiceStatisticsResponse)

-- | The collection of statistics.
getTimeSeriesServiceStatisticsResponse_timeSeriesServiceStatistics :: Lens.Lens' GetTimeSeriesServiceStatisticsResponse (Prelude.Maybe [TimeSeriesServiceStatistics])
getTimeSeriesServiceStatisticsResponse_timeSeriesServiceStatistics :: (Maybe [TimeSeriesServiceStatistics]
 -> f (Maybe [TimeSeriesServiceStatistics]))
-> GetTimeSeriesServiceStatisticsResponse
-> f GetTimeSeriesServiceStatisticsResponse
getTimeSeriesServiceStatisticsResponse_timeSeriesServiceStatistics = (GetTimeSeriesServiceStatisticsResponse
 -> Maybe [TimeSeriesServiceStatistics])
-> (GetTimeSeriesServiceStatisticsResponse
    -> Maybe [TimeSeriesServiceStatistics]
    -> GetTimeSeriesServiceStatisticsResponse)
-> Lens'
     GetTimeSeriesServiceStatisticsResponse
     (Maybe [TimeSeriesServiceStatistics])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetTimeSeriesServiceStatisticsResponse' {Maybe [TimeSeriesServiceStatistics]
timeSeriesServiceStatistics :: Maybe [TimeSeriesServiceStatistics]
$sel:timeSeriesServiceStatistics:GetTimeSeriesServiceStatisticsResponse' :: GetTimeSeriesServiceStatisticsResponse
-> Maybe [TimeSeriesServiceStatistics]
timeSeriesServiceStatistics} -> Maybe [TimeSeriesServiceStatistics]
timeSeriesServiceStatistics) (\s :: GetTimeSeriesServiceStatisticsResponse
s@GetTimeSeriesServiceStatisticsResponse' {} Maybe [TimeSeriesServiceStatistics]
a -> GetTimeSeriesServiceStatisticsResponse
s {$sel:timeSeriesServiceStatistics:GetTimeSeriesServiceStatisticsResponse' :: Maybe [TimeSeriesServiceStatistics]
timeSeriesServiceStatistics = Maybe [TimeSeriesServiceStatistics]
a} :: GetTimeSeriesServiceStatisticsResponse) ((Maybe [TimeSeriesServiceStatistics]
  -> f (Maybe [TimeSeriesServiceStatistics]))
 -> GetTimeSeriesServiceStatisticsResponse
 -> f GetTimeSeriesServiceStatisticsResponse)
-> ((Maybe [TimeSeriesServiceStatistics]
     -> f (Maybe [TimeSeriesServiceStatistics]))
    -> Maybe [TimeSeriesServiceStatistics]
    -> f (Maybe [TimeSeriesServiceStatistics]))
-> (Maybe [TimeSeriesServiceStatistics]
    -> f (Maybe [TimeSeriesServiceStatistics]))
-> GetTimeSeriesServiceStatisticsResponse
-> f GetTimeSeriesServiceStatisticsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [TimeSeriesServiceStatistics]
  [TimeSeriesServiceStatistics]
  [TimeSeriesServiceStatistics]
  [TimeSeriesServiceStatistics]
-> Iso
     (Maybe [TimeSeriesServiceStatistics])
     (Maybe [TimeSeriesServiceStatistics])
     (Maybe [TimeSeriesServiceStatistics])
     (Maybe [TimeSeriesServiceStatistics])
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
  [TimeSeriesServiceStatistics]
  [TimeSeriesServiceStatistics]
  [TimeSeriesServiceStatistics]
  [TimeSeriesServiceStatistics]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | Pagination token.
getTimeSeriesServiceStatisticsResponse_nextToken :: Lens.Lens' GetTimeSeriesServiceStatisticsResponse (Prelude.Maybe Prelude.Text)
getTimeSeriesServiceStatisticsResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> GetTimeSeriesServiceStatisticsResponse
-> f GetTimeSeriesServiceStatisticsResponse
getTimeSeriesServiceStatisticsResponse_nextToken = (GetTimeSeriesServiceStatisticsResponse -> Maybe Text)
-> (GetTimeSeriesServiceStatisticsResponse
    -> Maybe Text -> GetTimeSeriesServiceStatisticsResponse)
-> Lens' GetTimeSeriesServiceStatisticsResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetTimeSeriesServiceStatisticsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:GetTimeSeriesServiceStatisticsResponse' :: GetTimeSeriesServiceStatisticsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: GetTimeSeriesServiceStatisticsResponse
s@GetTimeSeriesServiceStatisticsResponse' {} Maybe Text
a -> GetTimeSeriesServiceStatisticsResponse
s {$sel:nextToken:GetTimeSeriesServiceStatisticsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: GetTimeSeriesServiceStatisticsResponse)

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

instance
  Prelude.NFData
    GetTimeSeriesServiceStatisticsResponse