{-# 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.Pi.DescribeDimensionKeys
-- 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)
--
-- For a specific time period, retrieve the top @N@ dimension keys for a
-- metric.
--
-- Each response element returns a maximum of 500 bytes. For larger
-- elements, such as SQL statements, only the first 500 bytes are returned.
module Amazonka.Pi.DescribeDimensionKeys
  ( -- * Creating a Request
    DescribeDimensionKeys (..),
    newDescribeDimensionKeys,

    -- * Request Lenses
    describeDimensionKeys_periodInSeconds,
    describeDimensionKeys_nextToken,
    describeDimensionKeys_filter,
    describeDimensionKeys_maxResults,
    describeDimensionKeys_partitionBy,
    describeDimensionKeys_serviceType,
    describeDimensionKeys_identifier,
    describeDimensionKeys_startTime,
    describeDimensionKeys_endTime,
    describeDimensionKeys_metric,
    describeDimensionKeys_groupBy,

    -- * Destructuring the Response
    DescribeDimensionKeysResponse (..),
    newDescribeDimensionKeysResponse,

    -- * Response Lenses
    describeDimensionKeysResponse_alignedEndTime,
    describeDimensionKeysResponse_alignedStartTime,
    describeDimensionKeysResponse_keys,
    describeDimensionKeysResponse_nextToken,
    describeDimensionKeysResponse_partitionKeys,
    describeDimensionKeysResponse_httpStatus,
  )
where

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

-- | /See:/ 'newDescribeDimensionKeys' smart constructor.
data DescribeDimensionKeys = DescribeDimensionKeys'
  { -- | The granularity, in seconds, of the data points returned from
    -- Performance Insights. A period can be as short as one second, or as long
    -- as one day (86400 seconds). Valid values are:
    --
    -- -   @1@ (one second)
    --
    -- -   @60@ (one minute)
    --
    -- -   @300@ (five minutes)
    --
    -- -   @3600@ (one hour)
    --
    -- -   @86400@ (twenty-four hours)
    --
    -- If you don\'t specify @PeriodInSeconds@, then Performance Insights
    -- chooses a value for you, with a goal of returning roughly 100-200 data
    -- points in the response.
    DescribeDimensionKeys -> Maybe Int
periodInSeconds :: Prelude.Maybe Prelude.Int,
    -- | An optional pagination token provided by a previous request. If this
    -- parameter is specified, the response includes only records beyond the
    -- token, up to the value specified by @MaxRecords@.
    DescribeDimensionKeys -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | One or more filters to apply in the request. Restrictions:
    --
    -- -   Any number of filters by the same dimension, as specified in the
    --     @GroupBy@ or @Partition@ parameters.
    --
    -- -   A single filter for any other dimension in this dimension group.
    DescribeDimensionKeys -> Maybe (HashMap Text Text)
filter' :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
    -- | The maximum number of items to return in the response. If more items
    -- exist than the specified @MaxRecords@ value, a pagination token is
    -- included in the response so that the remaining results can be retrieved.
    DescribeDimensionKeys -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
    -- | For each dimension specified in @GroupBy@, specify a secondary dimension
    -- to further subdivide the partition keys in the response.
    DescribeDimensionKeys -> Maybe DimensionGroup
partitionBy :: Prelude.Maybe DimensionGroup,
    -- | The AWS service for which Performance Insights will return metrics. The
    -- only valid value for /ServiceType/ is @RDS@.
    DescribeDimensionKeys -> ServiceType
serviceType :: ServiceType,
    -- | An immutable, AWS Region-unique identifier for a data source.
    -- Performance Insights gathers metrics from this data source.
    --
    -- To use an Amazon RDS instance as a data source, you specify its
    -- @DbiResourceId@ value. For example, specify
    -- @db-FAIHNTYBKTGAUSUZQYPDS2GW4A@
    DescribeDimensionKeys -> Text
identifier :: Prelude.Text,
    -- | The date and time specifying the beginning of the requested time series
    -- data. You must specify a @StartTime@ within the past 7 days. The value
    -- specified is /inclusive/, which means that data points equal to or
    -- greater than @StartTime@ are returned.
    --
    -- The value for @StartTime@ must be earlier than the value for @EndTime@.
    DescribeDimensionKeys -> POSIX
startTime :: Core.POSIX,
    -- | The date and time specifying the end of the requested time series data.
    -- The value specified is /exclusive/, which means that data points less
    -- than (but not equal to) @EndTime@ are returned.
    --
    -- The value for @EndTime@ must be later than the value for @StartTime@.
    DescribeDimensionKeys -> POSIX
endTime :: Core.POSIX,
    -- | The name of a Performance Insights metric to be measured.
    --
    -- Valid values for @Metric@ are:
    --
    -- -   @db.load.avg@ - a scaled representation of the number of active
    --     sessions for the database engine.
    --
    -- -   @db.sampledload.avg@ - the raw number of active sessions for the
    --     database engine.
    --
    -- If the number of active sessions is less than an internal Performance
    -- Insights threshold, @db.load.avg@ and @db.sampledload.avg@ are the same
    -- value. If the number of active sessions is greater than the internal
    -- threshold, Performance Insights samples the active sessions, with
    -- @db.load.avg@ showing the scaled values, @db.sampledload.avg@ showing
    -- the raw values, and @db.sampledload.avg@ less than @db.load.avg@. For
    -- most use cases, you can query @db.load.avg@ only.
    DescribeDimensionKeys -> Text
metric :: Prelude.Text,
    -- | A specification for how to aggregate the data points from a query
    -- result. You must specify a valid dimension group. Performance Insights
    -- returns all dimensions within this group, unless you provide the names
    -- of specific dimensions within this group. You can also request that
    -- Performance Insights return a limited number of values for a dimension.
    DescribeDimensionKeys -> DimensionGroup
groupBy :: DimensionGroup
  }
  deriving (DescribeDimensionKeys -> DescribeDimensionKeys -> Bool
(DescribeDimensionKeys -> DescribeDimensionKeys -> Bool)
-> (DescribeDimensionKeys -> DescribeDimensionKeys -> Bool)
-> Eq DescribeDimensionKeys
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeDimensionKeys -> DescribeDimensionKeys -> Bool
$c/= :: DescribeDimensionKeys -> DescribeDimensionKeys -> Bool
== :: DescribeDimensionKeys -> DescribeDimensionKeys -> Bool
$c== :: DescribeDimensionKeys -> DescribeDimensionKeys -> Bool
Prelude.Eq, ReadPrec [DescribeDimensionKeys]
ReadPrec DescribeDimensionKeys
Int -> ReadS DescribeDimensionKeys
ReadS [DescribeDimensionKeys]
(Int -> ReadS DescribeDimensionKeys)
-> ReadS [DescribeDimensionKeys]
-> ReadPrec DescribeDimensionKeys
-> ReadPrec [DescribeDimensionKeys]
-> Read DescribeDimensionKeys
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeDimensionKeys]
$creadListPrec :: ReadPrec [DescribeDimensionKeys]
readPrec :: ReadPrec DescribeDimensionKeys
$creadPrec :: ReadPrec DescribeDimensionKeys
readList :: ReadS [DescribeDimensionKeys]
$creadList :: ReadS [DescribeDimensionKeys]
readsPrec :: Int -> ReadS DescribeDimensionKeys
$creadsPrec :: Int -> ReadS DescribeDimensionKeys
Prelude.Read, Int -> DescribeDimensionKeys -> ShowS
[DescribeDimensionKeys] -> ShowS
DescribeDimensionKeys -> String
(Int -> DescribeDimensionKeys -> ShowS)
-> (DescribeDimensionKeys -> String)
-> ([DescribeDimensionKeys] -> ShowS)
-> Show DescribeDimensionKeys
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeDimensionKeys] -> ShowS
$cshowList :: [DescribeDimensionKeys] -> ShowS
show :: DescribeDimensionKeys -> String
$cshow :: DescribeDimensionKeys -> String
showsPrec :: Int -> DescribeDimensionKeys -> ShowS
$cshowsPrec :: Int -> DescribeDimensionKeys -> ShowS
Prelude.Show, (forall x. DescribeDimensionKeys -> Rep DescribeDimensionKeys x)
-> (forall x. Rep DescribeDimensionKeys x -> DescribeDimensionKeys)
-> Generic DescribeDimensionKeys
forall x. Rep DescribeDimensionKeys x -> DescribeDimensionKeys
forall x. DescribeDimensionKeys -> Rep DescribeDimensionKeys x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DescribeDimensionKeys x -> DescribeDimensionKeys
$cfrom :: forall x. DescribeDimensionKeys -> Rep DescribeDimensionKeys x
Prelude.Generic)

-- |
-- Create a value of 'DescribeDimensionKeys' 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:
--
-- 'periodInSeconds', 'describeDimensionKeys_periodInSeconds' - The granularity, in seconds, of the data points returned from
-- Performance Insights. A period can be as short as one second, or as long
-- as one day (86400 seconds). Valid values are:
--
-- -   @1@ (one second)
--
-- -   @60@ (one minute)
--
-- -   @300@ (five minutes)
--
-- -   @3600@ (one hour)
--
-- -   @86400@ (twenty-four hours)
--
-- If you don\'t specify @PeriodInSeconds@, then Performance Insights
-- chooses a value for you, with a goal of returning roughly 100-200 data
-- points in the response.
--
-- 'nextToken', 'describeDimensionKeys_nextToken' - An optional pagination token provided by a previous request. If this
-- parameter is specified, the response includes only records beyond the
-- token, up to the value specified by @MaxRecords@.
--
-- 'filter'', 'describeDimensionKeys_filter' - One or more filters to apply in the request. Restrictions:
--
-- -   Any number of filters by the same dimension, as specified in the
--     @GroupBy@ or @Partition@ parameters.
--
-- -   A single filter for any other dimension in this dimension group.
--
-- 'maxResults', 'describeDimensionKeys_maxResults' - The maximum number of items to return in the response. If more items
-- exist than the specified @MaxRecords@ value, a pagination token is
-- included in the response so that the remaining results can be retrieved.
--
-- 'partitionBy', 'describeDimensionKeys_partitionBy' - For each dimension specified in @GroupBy@, specify a secondary dimension
-- to further subdivide the partition keys in the response.
--
-- 'serviceType', 'describeDimensionKeys_serviceType' - The AWS service for which Performance Insights will return metrics. The
-- only valid value for /ServiceType/ is @RDS@.
--
-- 'identifier', 'describeDimensionKeys_identifier' - An immutable, AWS Region-unique identifier for a data source.
-- Performance Insights gathers metrics from this data source.
--
-- To use an Amazon RDS instance as a data source, you specify its
-- @DbiResourceId@ value. For example, specify
-- @db-FAIHNTYBKTGAUSUZQYPDS2GW4A@
--
-- 'startTime', 'describeDimensionKeys_startTime' - The date and time specifying the beginning of the requested time series
-- data. You must specify a @StartTime@ within the past 7 days. The value
-- specified is /inclusive/, which means that data points equal to or
-- greater than @StartTime@ are returned.
--
-- The value for @StartTime@ must be earlier than the value for @EndTime@.
--
-- 'endTime', 'describeDimensionKeys_endTime' - The date and time specifying the end of the requested time series data.
-- The value specified is /exclusive/, which means that data points less
-- than (but not equal to) @EndTime@ are returned.
--
-- The value for @EndTime@ must be later than the value for @StartTime@.
--
-- 'metric', 'describeDimensionKeys_metric' - The name of a Performance Insights metric to be measured.
--
-- Valid values for @Metric@ are:
--
-- -   @db.load.avg@ - a scaled representation of the number of active
--     sessions for the database engine.
--
-- -   @db.sampledload.avg@ - the raw number of active sessions for the
--     database engine.
--
-- If the number of active sessions is less than an internal Performance
-- Insights threshold, @db.load.avg@ and @db.sampledload.avg@ are the same
-- value. If the number of active sessions is greater than the internal
-- threshold, Performance Insights samples the active sessions, with
-- @db.load.avg@ showing the scaled values, @db.sampledload.avg@ showing
-- the raw values, and @db.sampledload.avg@ less than @db.load.avg@. For
-- most use cases, you can query @db.load.avg@ only.
--
-- 'groupBy', 'describeDimensionKeys_groupBy' - A specification for how to aggregate the data points from a query
-- result. You must specify a valid dimension group. Performance Insights
-- returns all dimensions within this group, unless you provide the names
-- of specific dimensions within this group. You can also request that
-- Performance Insights return a limited number of values for a dimension.
newDescribeDimensionKeys ::
  -- | 'serviceType'
  ServiceType ->
  -- | 'identifier'
  Prelude.Text ->
  -- | 'startTime'
  Prelude.UTCTime ->
  -- | 'endTime'
  Prelude.UTCTime ->
  -- | 'metric'
  Prelude.Text ->
  -- | 'groupBy'
  DimensionGroup ->
  DescribeDimensionKeys
newDescribeDimensionKeys :: ServiceType
-> Text
-> UTCTime
-> UTCTime
-> Text
-> DimensionGroup
-> DescribeDimensionKeys
newDescribeDimensionKeys
  ServiceType
pServiceType_
  Text
pIdentifier_
  UTCTime
pStartTime_
  UTCTime
pEndTime_
  Text
pMetric_
  DimensionGroup
pGroupBy_ =
    DescribeDimensionKeys' :: Maybe Int
-> Maybe Text
-> Maybe (HashMap Text Text)
-> Maybe Natural
-> Maybe DimensionGroup
-> ServiceType
-> Text
-> POSIX
-> POSIX
-> Text
-> DimensionGroup
-> DescribeDimensionKeys
DescribeDimensionKeys'
      { $sel:periodInSeconds:DescribeDimensionKeys' :: Maybe Int
periodInSeconds =
          Maybe Int
forall a. Maybe a
Prelude.Nothing,
        $sel:nextToken:DescribeDimensionKeys' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:filter':DescribeDimensionKeys' :: Maybe (HashMap Text Text)
filter' = Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing,
        $sel:maxResults:DescribeDimensionKeys' :: Maybe Natural
maxResults = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
        $sel:partitionBy:DescribeDimensionKeys' :: Maybe DimensionGroup
partitionBy = Maybe DimensionGroup
forall a. Maybe a
Prelude.Nothing,
        $sel:serviceType:DescribeDimensionKeys' :: ServiceType
serviceType = ServiceType
pServiceType_,
        $sel:identifier:DescribeDimensionKeys' :: Text
identifier = Text
pIdentifier_,
        $sel:startTime:DescribeDimensionKeys' :: 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:DescribeDimensionKeys' :: 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:metric:DescribeDimensionKeys' :: Text
metric = Text
pMetric_,
        $sel:groupBy:DescribeDimensionKeys' :: DimensionGroup
groupBy = DimensionGroup
pGroupBy_
      }

-- | The granularity, in seconds, of the data points returned from
-- Performance Insights. A period can be as short as one second, or as long
-- as one day (86400 seconds). Valid values are:
--
-- -   @1@ (one second)
--
-- -   @60@ (one minute)
--
-- -   @300@ (five minutes)
--
-- -   @3600@ (one hour)
--
-- -   @86400@ (twenty-four hours)
--
-- If you don\'t specify @PeriodInSeconds@, then Performance Insights
-- chooses a value for you, with a goal of returning roughly 100-200 data
-- points in the response.
describeDimensionKeys_periodInSeconds :: Lens.Lens' DescribeDimensionKeys (Prelude.Maybe Prelude.Int)
describeDimensionKeys_periodInSeconds :: (Maybe Int -> f (Maybe Int))
-> DescribeDimensionKeys -> f DescribeDimensionKeys
describeDimensionKeys_periodInSeconds = (DescribeDimensionKeys -> Maybe Int)
-> (DescribeDimensionKeys -> Maybe Int -> DescribeDimensionKeys)
-> Lens
     DescribeDimensionKeys DescribeDimensionKeys (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeDimensionKeys' {Maybe Int
periodInSeconds :: Maybe Int
$sel:periodInSeconds:DescribeDimensionKeys' :: DescribeDimensionKeys -> Maybe Int
periodInSeconds} -> Maybe Int
periodInSeconds) (\s :: DescribeDimensionKeys
s@DescribeDimensionKeys' {} Maybe Int
a -> DescribeDimensionKeys
s {$sel:periodInSeconds:DescribeDimensionKeys' :: Maybe Int
periodInSeconds = Maybe Int
a} :: DescribeDimensionKeys)

-- | An optional pagination token provided by a previous request. If this
-- parameter is specified, the response includes only records beyond the
-- token, up to the value specified by @MaxRecords@.
describeDimensionKeys_nextToken :: Lens.Lens' DescribeDimensionKeys (Prelude.Maybe Prelude.Text)
describeDimensionKeys_nextToken :: (Maybe Text -> f (Maybe Text))
-> DescribeDimensionKeys -> f DescribeDimensionKeys
describeDimensionKeys_nextToken = (DescribeDimensionKeys -> Maybe Text)
-> (DescribeDimensionKeys -> Maybe Text -> DescribeDimensionKeys)
-> Lens
     DescribeDimensionKeys
     DescribeDimensionKeys
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeDimensionKeys' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:DescribeDimensionKeys' :: DescribeDimensionKeys -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: DescribeDimensionKeys
s@DescribeDimensionKeys' {} Maybe Text
a -> DescribeDimensionKeys
s {$sel:nextToken:DescribeDimensionKeys' :: Maybe Text
nextToken = Maybe Text
a} :: DescribeDimensionKeys)

-- | One or more filters to apply in the request. Restrictions:
--
-- -   Any number of filters by the same dimension, as specified in the
--     @GroupBy@ or @Partition@ parameters.
--
-- -   A single filter for any other dimension in this dimension group.
describeDimensionKeys_filter :: Lens.Lens' DescribeDimensionKeys (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
describeDimensionKeys_filter :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> DescribeDimensionKeys -> f DescribeDimensionKeys
describeDimensionKeys_filter = (DescribeDimensionKeys -> Maybe (HashMap Text Text))
-> (DescribeDimensionKeys
    -> Maybe (HashMap Text Text) -> DescribeDimensionKeys)
-> Lens
     DescribeDimensionKeys
     DescribeDimensionKeys
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeDimensionKeys' {Maybe (HashMap Text Text)
filter' :: Maybe (HashMap Text Text)
$sel:filter':DescribeDimensionKeys' :: DescribeDimensionKeys -> Maybe (HashMap Text Text)
filter'} -> Maybe (HashMap Text Text)
filter') (\s :: DescribeDimensionKeys
s@DescribeDimensionKeys' {} Maybe (HashMap Text Text)
a -> DescribeDimensionKeys
s {$sel:filter':DescribeDimensionKeys' :: Maybe (HashMap Text Text)
filter' = Maybe (HashMap Text Text)
a} :: DescribeDimensionKeys) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
 -> DescribeDimensionKeys -> f DescribeDimensionKeys)
-> ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
    -> Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> DescribeDimensionKeys
-> f DescribeDimensionKeys
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
-> Iso
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
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
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The maximum number of items to return in the response. If more items
-- exist than the specified @MaxRecords@ value, a pagination token is
-- included in the response so that the remaining results can be retrieved.
describeDimensionKeys_maxResults :: Lens.Lens' DescribeDimensionKeys (Prelude.Maybe Prelude.Natural)
describeDimensionKeys_maxResults :: (Maybe Natural -> f (Maybe Natural))
-> DescribeDimensionKeys -> f DescribeDimensionKeys
describeDimensionKeys_maxResults = (DescribeDimensionKeys -> Maybe Natural)
-> (DescribeDimensionKeys
    -> Maybe Natural -> DescribeDimensionKeys)
-> Lens
     DescribeDimensionKeys
     DescribeDimensionKeys
     (Maybe Natural)
     (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeDimensionKeys' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:DescribeDimensionKeys' :: DescribeDimensionKeys -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: DescribeDimensionKeys
s@DescribeDimensionKeys' {} Maybe Natural
a -> DescribeDimensionKeys
s {$sel:maxResults:DescribeDimensionKeys' :: Maybe Natural
maxResults = Maybe Natural
a} :: DescribeDimensionKeys)

-- | For each dimension specified in @GroupBy@, specify a secondary dimension
-- to further subdivide the partition keys in the response.
describeDimensionKeys_partitionBy :: Lens.Lens' DescribeDimensionKeys (Prelude.Maybe DimensionGroup)
describeDimensionKeys_partitionBy :: (Maybe DimensionGroup -> f (Maybe DimensionGroup))
-> DescribeDimensionKeys -> f DescribeDimensionKeys
describeDimensionKeys_partitionBy = (DescribeDimensionKeys -> Maybe DimensionGroup)
-> (DescribeDimensionKeys
    -> Maybe DimensionGroup -> DescribeDimensionKeys)
-> Lens
     DescribeDimensionKeys
     DescribeDimensionKeys
     (Maybe DimensionGroup)
     (Maybe DimensionGroup)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeDimensionKeys' {Maybe DimensionGroup
partitionBy :: Maybe DimensionGroup
$sel:partitionBy:DescribeDimensionKeys' :: DescribeDimensionKeys -> Maybe DimensionGroup
partitionBy} -> Maybe DimensionGroup
partitionBy) (\s :: DescribeDimensionKeys
s@DescribeDimensionKeys' {} Maybe DimensionGroup
a -> DescribeDimensionKeys
s {$sel:partitionBy:DescribeDimensionKeys' :: Maybe DimensionGroup
partitionBy = Maybe DimensionGroup
a} :: DescribeDimensionKeys)

-- | The AWS service for which Performance Insights will return metrics. The
-- only valid value for /ServiceType/ is @RDS@.
describeDimensionKeys_serviceType :: Lens.Lens' DescribeDimensionKeys ServiceType
describeDimensionKeys_serviceType :: (ServiceType -> f ServiceType)
-> DescribeDimensionKeys -> f DescribeDimensionKeys
describeDimensionKeys_serviceType = (DescribeDimensionKeys -> ServiceType)
-> (DescribeDimensionKeys -> ServiceType -> DescribeDimensionKeys)
-> Lens
     DescribeDimensionKeys DescribeDimensionKeys ServiceType ServiceType
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeDimensionKeys' {ServiceType
serviceType :: ServiceType
$sel:serviceType:DescribeDimensionKeys' :: DescribeDimensionKeys -> ServiceType
serviceType} -> ServiceType
serviceType) (\s :: DescribeDimensionKeys
s@DescribeDimensionKeys' {} ServiceType
a -> DescribeDimensionKeys
s {$sel:serviceType:DescribeDimensionKeys' :: ServiceType
serviceType = ServiceType
a} :: DescribeDimensionKeys)

-- | An immutable, AWS Region-unique identifier for a data source.
-- Performance Insights gathers metrics from this data source.
--
-- To use an Amazon RDS instance as a data source, you specify its
-- @DbiResourceId@ value. For example, specify
-- @db-FAIHNTYBKTGAUSUZQYPDS2GW4A@
describeDimensionKeys_identifier :: Lens.Lens' DescribeDimensionKeys Prelude.Text
describeDimensionKeys_identifier :: (Text -> f Text)
-> DescribeDimensionKeys -> f DescribeDimensionKeys
describeDimensionKeys_identifier = (DescribeDimensionKeys -> Text)
-> (DescribeDimensionKeys -> Text -> DescribeDimensionKeys)
-> Lens DescribeDimensionKeys DescribeDimensionKeys Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeDimensionKeys' {Text
identifier :: Text
$sel:identifier:DescribeDimensionKeys' :: DescribeDimensionKeys -> Text
identifier} -> Text
identifier) (\s :: DescribeDimensionKeys
s@DescribeDimensionKeys' {} Text
a -> DescribeDimensionKeys
s {$sel:identifier:DescribeDimensionKeys' :: Text
identifier = Text
a} :: DescribeDimensionKeys)

-- | The date and time specifying the beginning of the requested time series
-- data. You must specify a @StartTime@ within the past 7 days. The value
-- specified is /inclusive/, which means that data points equal to or
-- greater than @StartTime@ are returned.
--
-- The value for @StartTime@ must be earlier than the value for @EndTime@.
describeDimensionKeys_startTime :: Lens.Lens' DescribeDimensionKeys Prelude.UTCTime
describeDimensionKeys_startTime :: (UTCTime -> f UTCTime)
-> DescribeDimensionKeys -> f DescribeDimensionKeys
describeDimensionKeys_startTime = (DescribeDimensionKeys -> POSIX)
-> (DescribeDimensionKeys -> POSIX -> DescribeDimensionKeys)
-> Lens DescribeDimensionKeys DescribeDimensionKeys POSIX POSIX
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeDimensionKeys' {POSIX
startTime :: POSIX
$sel:startTime:DescribeDimensionKeys' :: DescribeDimensionKeys -> POSIX
startTime} -> POSIX
startTime) (\s :: DescribeDimensionKeys
s@DescribeDimensionKeys' {} POSIX
a -> DescribeDimensionKeys
s {$sel:startTime:DescribeDimensionKeys' :: POSIX
startTime = POSIX
a} :: DescribeDimensionKeys) ((POSIX -> f POSIX)
 -> DescribeDimensionKeys -> f DescribeDimensionKeys)
-> ((UTCTime -> f UTCTime) -> POSIX -> f POSIX)
-> (UTCTime -> f UTCTime)
-> DescribeDimensionKeys
-> f DescribeDimensionKeys
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 date and time specifying the end of the requested time series data.
-- The value specified is /exclusive/, which means that data points less
-- than (but not equal to) @EndTime@ are returned.
--
-- The value for @EndTime@ must be later than the value for @StartTime@.
describeDimensionKeys_endTime :: Lens.Lens' DescribeDimensionKeys Prelude.UTCTime
describeDimensionKeys_endTime :: (UTCTime -> f UTCTime)
-> DescribeDimensionKeys -> f DescribeDimensionKeys
describeDimensionKeys_endTime = (DescribeDimensionKeys -> POSIX)
-> (DescribeDimensionKeys -> POSIX -> DescribeDimensionKeys)
-> Lens DescribeDimensionKeys DescribeDimensionKeys POSIX POSIX
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeDimensionKeys' {POSIX
endTime :: POSIX
$sel:endTime:DescribeDimensionKeys' :: DescribeDimensionKeys -> POSIX
endTime} -> POSIX
endTime) (\s :: DescribeDimensionKeys
s@DescribeDimensionKeys' {} POSIX
a -> DescribeDimensionKeys
s {$sel:endTime:DescribeDimensionKeys' :: POSIX
endTime = POSIX
a} :: DescribeDimensionKeys) ((POSIX -> f POSIX)
 -> DescribeDimensionKeys -> f DescribeDimensionKeys)
-> ((UTCTime -> f UTCTime) -> POSIX -> f POSIX)
-> (UTCTime -> f UTCTime)
-> DescribeDimensionKeys
-> f DescribeDimensionKeys
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 name of a Performance Insights metric to be measured.
--
-- Valid values for @Metric@ are:
--
-- -   @db.load.avg@ - a scaled representation of the number of active
--     sessions for the database engine.
--
-- -   @db.sampledload.avg@ - the raw number of active sessions for the
--     database engine.
--
-- If the number of active sessions is less than an internal Performance
-- Insights threshold, @db.load.avg@ and @db.sampledload.avg@ are the same
-- value. If the number of active sessions is greater than the internal
-- threshold, Performance Insights samples the active sessions, with
-- @db.load.avg@ showing the scaled values, @db.sampledload.avg@ showing
-- the raw values, and @db.sampledload.avg@ less than @db.load.avg@. For
-- most use cases, you can query @db.load.avg@ only.
describeDimensionKeys_metric :: Lens.Lens' DescribeDimensionKeys Prelude.Text
describeDimensionKeys_metric :: (Text -> f Text)
-> DescribeDimensionKeys -> f DescribeDimensionKeys
describeDimensionKeys_metric = (DescribeDimensionKeys -> Text)
-> (DescribeDimensionKeys -> Text -> DescribeDimensionKeys)
-> Lens DescribeDimensionKeys DescribeDimensionKeys Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeDimensionKeys' {Text
metric :: Text
$sel:metric:DescribeDimensionKeys' :: DescribeDimensionKeys -> Text
metric} -> Text
metric) (\s :: DescribeDimensionKeys
s@DescribeDimensionKeys' {} Text
a -> DescribeDimensionKeys
s {$sel:metric:DescribeDimensionKeys' :: Text
metric = Text
a} :: DescribeDimensionKeys)

-- | A specification for how to aggregate the data points from a query
-- result. You must specify a valid dimension group. Performance Insights
-- returns all dimensions within this group, unless you provide the names
-- of specific dimensions within this group. You can also request that
-- Performance Insights return a limited number of values for a dimension.
describeDimensionKeys_groupBy :: Lens.Lens' DescribeDimensionKeys DimensionGroup
describeDimensionKeys_groupBy :: (DimensionGroup -> f DimensionGroup)
-> DescribeDimensionKeys -> f DescribeDimensionKeys
describeDimensionKeys_groupBy = (DescribeDimensionKeys -> DimensionGroup)
-> (DescribeDimensionKeys
    -> DimensionGroup -> DescribeDimensionKeys)
-> Lens
     DescribeDimensionKeys
     DescribeDimensionKeys
     DimensionGroup
     DimensionGroup
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeDimensionKeys' {DimensionGroup
groupBy :: DimensionGroup
$sel:groupBy:DescribeDimensionKeys' :: DescribeDimensionKeys -> DimensionGroup
groupBy} -> DimensionGroup
groupBy) (\s :: DescribeDimensionKeys
s@DescribeDimensionKeys' {} DimensionGroup
a -> DescribeDimensionKeys
s {$sel:groupBy:DescribeDimensionKeys' :: DimensionGroup
groupBy = DimensionGroup
a} :: DescribeDimensionKeys)

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

instance Prelude.NFData DescribeDimensionKeys

instance Core.ToHeaders DescribeDimensionKeys where
  toHeaders :: DescribeDimensionKeys -> ResponseHeaders
toHeaders =
    ResponseHeaders -> DescribeDimensionKeys -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
      ( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"X-Amz-Target"
              HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"PerformanceInsightsv20180227.DescribeDimensionKeys" ::
                          Prelude.ByteString
                      ),
            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 DescribeDimensionKeys where
  toJSON :: DescribeDimensionKeys -> Value
toJSON DescribeDimensionKeys' {Maybe Int
Maybe Natural
Maybe Text
Maybe (HashMap Text Text)
Maybe DimensionGroup
Text
POSIX
DimensionGroup
ServiceType
groupBy :: DimensionGroup
metric :: Text
endTime :: POSIX
startTime :: POSIX
identifier :: Text
serviceType :: ServiceType
partitionBy :: Maybe DimensionGroup
maxResults :: Maybe Natural
filter' :: Maybe (HashMap Text Text)
nextToken :: Maybe Text
periodInSeconds :: Maybe Int
$sel:groupBy:DescribeDimensionKeys' :: DescribeDimensionKeys -> DimensionGroup
$sel:metric:DescribeDimensionKeys' :: DescribeDimensionKeys -> Text
$sel:endTime:DescribeDimensionKeys' :: DescribeDimensionKeys -> POSIX
$sel:startTime:DescribeDimensionKeys' :: DescribeDimensionKeys -> POSIX
$sel:identifier:DescribeDimensionKeys' :: DescribeDimensionKeys -> Text
$sel:serviceType:DescribeDimensionKeys' :: DescribeDimensionKeys -> ServiceType
$sel:partitionBy:DescribeDimensionKeys' :: DescribeDimensionKeys -> Maybe DimensionGroup
$sel:maxResults:DescribeDimensionKeys' :: DescribeDimensionKeys -> Maybe Natural
$sel:filter':DescribeDimensionKeys' :: DescribeDimensionKeys -> Maybe (HashMap Text Text)
$sel:nextToken:DescribeDimensionKeys' :: DescribeDimensionKeys -> Maybe Text
$sel:periodInSeconds:DescribeDimensionKeys' :: DescribeDimensionKeys -> Maybe Int
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"PeriodInSeconds" 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
periodInSeconds,
            (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
"Filter" Text -> HashMap Text Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (HashMap Text Text -> Pair)
-> Maybe (HashMap Text Text) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (HashMap Text Text)
filter',
            (Text
"MaxResults" Text -> Natural -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Natural -> Pair) -> Maybe Natural -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
maxResults,
            (Text
"PartitionBy" Text -> DimensionGroup -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (DimensionGroup -> Pair) -> Maybe DimensionGroup -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe DimensionGroup
partitionBy,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"ServiceType" Text -> ServiceType -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= ServiceType
serviceType),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Identifier" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
identifier),
            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),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Metric" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
metric),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"GroupBy" Text -> DimensionGroup -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= DimensionGroup
groupBy)
          ]
      )

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

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

-- | /See:/ 'newDescribeDimensionKeysResponse' smart constructor.
data DescribeDimensionKeysResponse = DescribeDimensionKeysResponse'
  { -- | The end time for the returned dimension keys, after alignment to a
    -- granular boundary (as specified by @PeriodInSeconds@). @AlignedEndTime@
    -- will be greater than or equal to the value of the user-specified
    -- @Endtime@.
    DescribeDimensionKeysResponse -> Maybe POSIX
alignedEndTime :: Prelude.Maybe Core.POSIX,
    -- | The start time for the returned dimension keys, after alignment to a
    -- granular boundary (as specified by @PeriodInSeconds@).
    -- @AlignedStartTime@ will be less than or equal to the value of the
    -- user-specified @StartTime@.
    DescribeDimensionKeysResponse -> Maybe POSIX
alignedStartTime :: Prelude.Maybe Core.POSIX,
    -- | The dimension keys that were requested.
    DescribeDimensionKeysResponse -> Maybe [DimensionKeyDescription]
keys :: Prelude.Maybe [DimensionKeyDescription],
    -- | An optional pagination token provided by a previous request. If this
    -- parameter is specified, the response includes only records beyond the
    -- token, up to the value specified by @MaxRecords@.
    DescribeDimensionKeysResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | If @PartitionBy@ was present in the request, @PartitionKeys@ contains
    -- the breakdown of dimension keys by the specified partitions.
    DescribeDimensionKeysResponse -> Maybe [ResponsePartitionKey]
partitionKeys :: Prelude.Maybe [ResponsePartitionKey],
    -- | The response's http status code.
    DescribeDimensionKeysResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (DescribeDimensionKeysResponse
-> DescribeDimensionKeysResponse -> Bool
(DescribeDimensionKeysResponse
 -> DescribeDimensionKeysResponse -> Bool)
-> (DescribeDimensionKeysResponse
    -> DescribeDimensionKeysResponse -> Bool)
-> Eq DescribeDimensionKeysResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeDimensionKeysResponse
-> DescribeDimensionKeysResponse -> Bool
$c/= :: DescribeDimensionKeysResponse
-> DescribeDimensionKeysResponse -> Bool
== :: DescribeDimensionKeysResponse
-> DescribeDimensionKeysResponse -> Bool
$c== :: DescribeDimensionKeysResponse
-> DescribeDimensionKeysResponse -> Bool
Prelude.Eq, ReadPrec [DescribeDimensionKeysResponse]
ReadPrec DescribeDimensionKeysResponse
Int -> ReadS DescribeDimensionKeysResponse
ReadS [DescribeDimensionKeysResponse]
(Int -> ReadS DescribeDimensionKeysResponse)
-> ReadS [DescribeDimensionKeysResponse]
-> ReadPrec DescribeDimensionKeysResponse
-> ReadPrec [DescribeDimensionKeysResponse]
-> Read DescribeDimensionKeysResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeDimensionKeysResponse]
$creadListPrec :: ReadPrec [DescribeDimensionKeysResponse]
readPrec :: ReadPrec DescribeDimensionKeysResponse
$creadPrec :: ReadPrec DescribeDimensionKeysResponse
readList :: ReadS [DescribeDimensionKeysResponse]
$creadList :: ReadS [DescribeDimensionKeysResponse]
readsPrec :: Int -> ReadS DescribeDimensionKeysResponse
$creadsPrec :: Int -> ReadS DescribeDimensionKeysResponse
Prelude.Read, Int -> DescribeDimensionKeysResponse -> ShowS
[DescribeDimensionKeysResponse] -> ShowS
DescribeDimensionKeysResponse -> String
(Int -> DescribeDimensionKeysResponse -> ShowS)
-> (DescribeDimensionKeysResponse -> String)
-> ([DescribeDimensionKeysResponse] -> ShowS)
-> Show DescribeDimensionKeysResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeDimensionKeysResponse] -> ShowS
$cshowList :: [DescribeDimensionKeysResponse] -> ShowS
show :: DescribeDimensionKeysResponse -> String
$cshow :: DescribeDimensionKeysResponse -> String
showsPrec :: Int -> DescribeDimensionKeysResponse -> ShowS
$cshowsPrec :: Int -> DescribeDimensionKeysResponse -> ShowS
Prelude.Show, (forall x.
 DescribeDimensionKeysResponse
 -> Rep DescribeDimensionKeysResponse x)
-> (forall x.
    Rep DescribeDimensionKeysResponse x
    -> DescribeDimensionKeysResponse)
-> Generic DescribeDimensionKeysResponse
forall x.
Rep DescribeDimensionKeysResponse x
-> DescribeDimensionKeysResponse
forall x.
DescribeDimensionKeysResponse
-> Rep DescribeDimensionKeysResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeDimensionKeysResponse x
-> DescribeDimensionKeysResponse
$cfrom :: forall x.
DescribeDimensionKeysResponse
-> Rep DescribeDimensionKeysResponse x
Prelude.Generic)

-- |
-- Create a value of 'DescribeDimensionKeysResponse' 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:
--
-- 'alignedEndTime', 'describeDimensionKeysResponse_alignedEndTime' - The end time for the returned dimension keys, after alignment to a
-- granular boundary (as specified by @PeriodInSeconds@). @AlignedEndTime@
-- will be greater than or equal to the value of the user-specified
-- @Endtime@.
--
-- 'alignedStartTime', 'describeDimensionKeysResponse_alignedStartTime' - The start time for the returned dimension keys, after alignment to a
-- granular boundary (as specified by @PeriodInSeconds@).
-- @AlignedStartTime@ will be less than or equal to the value of the
-- user-specified @StartTime@.
--
-- 'keys', 'describeDimensionKeysResponse_keys' - The dimension keys that were requested.
--
-- 'nextToken', 'describeDimensionKeysResponse_nextToken' - An optional pagination token provided by a previous request. If this
-- parameter is specified, the response includes only records beyond the
-- token, up to the value specified by @MaxRecords@.
--
-- 'partitionKeys', 'describeDimensionKeysResponse_partitionKeys' - If @PartitionBy@ was present in the request, @PartitionKeys@ contains
-- the breakdown of dimension keys by the specified partitions.
--
-- 'httpStatus', 'describeDimensionKeysResponse_httpStatus' - The response's http status code.
newDescribeDimensionKeysResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  DescribeDimensionKeysResponse
newDescribeDimensionKeysResponse :: Int -> DescribeDimensionKeysResponse
newDescribeDimensionKeysResponse Int
pHttpStatus_ =
  DescribeDimensionKeysResponse' :: Maybe POSIX
-> Maybe POSIX
-> Maybe [DimensionKeyDescription]
-> Maybe Text
-> Maybe [ResponsePartitionKey]
-> Int
-> DescribeDimensionKeysResponse
DescribeDimensionKeysResponse'
    { $sel:alignedEndTime:DescribeDimensionKeysResponse' :: Maybe POSIX
alignedEndTime =
        Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:alignedStartTime:DescribeDimensionKeysResponse' :: Maybe POSIX
alignedStartTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:keys:DescribeDimensionKeysResponse' :: Maybe [DimensionKeyDescription]
keys = Maybe [DimensionKeyDescription]
forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:DescribeDimensionKeysResponse' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:partitionKeys:DescribeDimensionKeysResponse' :: Maybe [ResponsePartitionKey]
partitionKeys = Maybe [ResponsePartitionKey]
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:DescribeDimensionKeysResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The end time for the returned dimension keys, after alignment to a
-- granular boundary (as specified by @PeriodInSeconds@). @AlignedEndTime@
-- will be greater than or equal to the value of the user-specified
-- @Endtime@.
describeDimensionKeysResponse_alignedEndTime :: Lens.Lens' DescribeDimensionKeysResponse (Prelude.Maybe Prelude.UTCTime)
describeDimensionKeysResponse_alignedEndTime :: (Maybe UTCTime -> f (Maybe UTCTime))
-> DescribeDimensionKeysResponse -> f DescribeDimensionKeysResponse
describeDimensionKeysResponse_alignedEndTime = (DescribeDimensionKeysResponse -> Maybe POSIX)
-> (DescribeDimensionKeysResponse
    -> Maybe POSIX -> DescribeDimensionKeysResponse)
-> Lens
     DescribeDimensionKeysResponse
     DescribeDimensionKeysResponse
     (Maybe POSIX)
     (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeDimensionKeysResponse' {Maybe POSIX
alignedEndTime :: Maybe POSIX
$sel:alignedEndTime:DescribeDimensionKeysResponse' :: DescribeDimensionKeysResponse -> Maybe POSIX
alignedEndTime} -> Maybe POSIX
alignedEndTime) (\s :: DescribeDimensionKeysResponse
s@DescribeDimensionKeysResponse' {} Maybe POSIX
a -> DescribeDimensionKeysResponse
s {$sel:alignedEndTime:DescribeDimensionKeysResponse' :: Maybe POSIX
alignedEndTime = Maybe POSIX
a} :: DescribeDimensionKeysResponse) ((Maybe POSIX -> f (Maybe POSIX))
 -> DescribeDimensionKeysResponse
 -> f DescribeDimensionKeysResponse)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> DescribeDimensionKeysResponse
-> f DescribeDimensionKeysResponse
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 start time for the returned dimension keys, after alignment to a
-- granular boundary (as specified by @PeriodInSeconds@).
-- @AlignedStartTime@ will be less than or equal to the value of the
-- user-specified @StartTime@.
describeDimensionKeysResponse_alignedStartTime :: Lens.Lens' DescribeDimensionKeysResponse (Prelude.Maybe Prelude.UTCTime)
describeDimensionKeysResponse_alignedStartTime :: (Maybe UTCTime -> f (Maybe UTCTime))
-> DescribeDimensionKeysResponse -> f DescribeDimensionKeysResponse
describeDimensionKeysResponse_alignedStartTime = (DescribeDimensionKeysResponse -> Maybe POSIX)
-> (DescribeDimensionKeysResponse
    -> Maybe POSIX -> DescribeDimensionKeysResponse)
-> Lens
     DescribeDimensionKeysResponse
     DescribeDimensionKeysResponse
     (Maybe POSIX)
     (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeDimensionKeysResponse' {Maybe POSIX
alignedStartTime :: Maybe POSIX
$sel:alignedStartTime:DescribeDimensionKeysResponse' :: DescribeDimensionKeysResponse -> Maybe POSIX
alignedStartTime} -> Maybe POSIX
alignedStartTime) (\s :: DescribeDimensionKeysResponse
s@DescribeDimensionKeysResponse' {} Maybe POSIX
a -> DescribeDimensionKeysResponse
s {$sel:alignedStartTime:DescribeDimensionKeysResponse' :: Maybe POSIX
alignedStartTime = Maybe POSIX
a} :: DescribeDimensionKeysResponse) ((Maybe POSIX -> f (Maybe POSIX))
 -> DescribeDimensionKeysResponse
 -> f DescribeDimensionKeysResponse)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> DescribeDimensionKeysResponse
-> f DescribeDimensionKeysResponse
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 dimension keys that were requested.
describeDimensionKeysResponse_keys :: Lens.Lens' DescribeDimensionKeysResponse (Prelude.Maybe [DimensionKeyDescription])
describeDimensionKeysResponse_keys :: (Maybe [DimensionKeyDescription]
 -> f (Maybe [DimensionKeyDescription]))
-> DescribeDimensionKeysResponse -> f DescribeDimensionKeysResponse
describeDimensionKeysResponse_keys = (DescribeDimensionKeysResponse -> Maybe [DimensionKeyDescription])
-> (DescribeDimensionKeysResponse
    -> Maybe [DimensionKeyDescription]
    -> DescribeDimensionKeysResponse)
-> Lens
     DescribeDimensionKeysResponse
     DescribeDimensionKeysResponse
     (Maybe [DimensionKeyDescription])
     (Maybe [DimensionKeyDescription])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeDimensionKeysResponse' {Maybe [DimensionKeyDescription]
keys :: Maybe [DimensionKeyDescription]
$sel:keys:DescribeDimensionKeysResponse' :: DescribeDimensionKeysResponse -> Maybe [DimensionKeyDescription]
keys} -> Maybe [DimensionKeyDescription]
keys) (\s :: DescribeDimensionKeysResponse
s@DescribeDimensionKeysResponse' {} Maybe [DimensionKeyDescription]
a -> DescribeDimensionKeysResponse
s {$sel:keys:DescribeDimensionKeysResponse' :: Maybe [DimensionKeyDescription]
keys = Maybe [DimensionKeyDescription]
a} :: DescribeDimensionKeysResponse) ((Maybe [DimensionKeyDescription]
  -> f (Maybe [DimensionKeyDescription]))
 -> DescribeDimensionKeysResponse
 -> f DescribeDimensionKeysResponse)
-> ((Maybe [DimensionKeyDescription]
     -> f (Maybe [DimensionKeyDescription]))
    -> Maybe [DimensionKeyDescription]
    -> f (Maybe [DimensionKeyDescription]))
-> (Maybe [DimensionKeyDescription]
    -> f (Maybe [DimensionKeyDescription]))
-> DescribeDimensionKeysResponse
-> f DescribeDimensionKeysResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [DimensionKeyDescription]
  [DimensionKeyDescription]
  [DimensionKeyDescription]
  [DimensionKeyDescription]
-> Iso
     (Maybe [DimensionKeyDescription])
     (Maybe [DimensionKeyDescription])
     (Maybe [DimensionKeyDescription])
     (Maybe [DimensionKeyDescription])
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
  [DimensionKeyDescription]
  [DimensionKeyDescription]
  [DimensionKeyDescription]
  [DimensionKeyDescription]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | An optional pagination token provided by a previous request. If this
-- parameter is specified, the response includes only records beyond the
-- token, up to the value specified by @MaxRecords@.
describeDimensionKeysResponse_nextToken :: Lens.Lens' DescribeDimensionKeysResponse (Prelude.Maybe Prelude.Text)
describeDimensionKeysResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> DescribeDimensionKeysResponse -> f DescribeDimensionKeysResponse
describeDimensionKeysResponse_nextToken = (DescribeDimensionKeysResponse -> Maybe Text)
-> (DescribeDimensionKeysResponse
    -> Maybe Text -> DescribeDimensionKeysResponse)
-> Lens
     DescribeDimensionKeysResponse
     DescribeDimensionKeysResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeDimensionKeysResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:DescribeDimensionKeysResponse' :: DescribeDimensionKeysResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: DescribeDimensionKeysResponse
s@DescribeDimensionKeysResponse' {} Maybe Text
a -> DescribeDimensionKeysResponse
s {$sel:nextToken:DescribeDimensionKeysResponse' :: Maybe Text
nextToken = Maybe Text
a} :: DescribeDimensionKeysResponse)

-- | If @PartitionBy@ was present in the request, @PartitionKeys@ contains
-- the breakdown of dimension keys by the specified partitions.
describeDimensionKeysResponse_partitionKeys :: Lens.Lens' DescribeDimensionKeysResponse (Prelude.Maybe [ResponsePartitionKey])
describeDimensionKeysResponse_partitionKeys :: (Maybe [ResponsePartitionKey] -> f (Maybe [ResponsePartitionKey]))
-> DescribeDimensionKeysResponse -> f DescribeDimensionKeysResponse
describeDimensionKeysResponse_partitionKeys = (DescribeDimensionKeysResponse -> Maybe [ResponsePartitionKey])
-> (DescribeDimensionKeysResponse
    -> Maybe [ResponsePartitionKey] -> DescribeDimensionKeysResponse)
-> Lens
     DescribeDimensionKeysResponse
     DescribeDimensionKeysResponse
     (Maybe [ResponsePartitionKey])
     (Maybe [ResponsePartitionKey])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeDimensionKeysResponse' {Maybe [ResponsePartitionKey]
partitionKeys :: Maybe [ResponsePartitionKey]
$sel:partitionKeys:DescribeDimensionKeysResponse' :: DescribeDimensionKeysResponse -> Maybe [ResponsePartitionKey]
partitionKeys} -> Maybe [ResponsePartitionKey]
partitionKeys) (\s :: DescribeDimensionKeysResponse
s@DescribeDimensionKeysResponse' {} Maybe [ResponsePartitionKey]
a -> DescribeDimensionKeysResponse
s {$sel:partitionKeys:DescribeDimensionKeysResponse' :: Maybe [ResponsePartitionKey]
partitionKeys = Maybe [ResponsePartitionKey]
a} :: DescribeDimensionKeysResponse) ((Maybe [ResponsePartitionKey] -> f (Maybe [ResponsePartitionKey]))
 -> DescribeDimensionKeysResponse
 -> f DescribeDimensionKeysResponse)
-> ((Maybe [ResponsePartitionKey]
     -> f (Maybe [ResponsePartitionKey]))
    -> Maybe [ResponsePartitionKey]
    -> f (Maybe [ResponsePartitionKey]))
-> (Maybe [ResponsePartitionKey]
    -> f (Maybe [ResponsePartitionKey]))
-> DescribeDimensionKeysResponse
-> f DescribeDimensionKeysResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [ResponsePartitionKey]
  [ResponsePartitionKey]
  [ResponsePartitionKey]
  [ResponsePartitionKey]
-> Iso
     (Maybe [ResponsePartitionKey])
     (Maybe [ResponsePartitionKey])
     (Maybe [ResponsePartitionKey])
     (Maybe [ResponsePartitionKey])
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
  [ResponsePartitionKey]
  [ResponsePartitionKey]
  [ResponsePartitionKey]
  [ResponsePartitionKey]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

instance Prelude.NFData DescribeDimensionKeysResponse