{-# 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.Lightsail.GetRelationalDatabaseMetricData
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Returns the data points of the specified metric for a database in Amazon
-- Lightsail.
--
-- Metrics report the utilization of your resources, and the error counts
-- generated by them. Monitor and collect metric data regularly to maintain
-- the reliability, availability, and performance of your resources.
module Amazonka.Lightsail.GetRelationalDatabaseMetricData
  ( -- * Creating a Request
    GetRelationalDatabaseMetricData (..),
    newGetRelationalDatabaseMetricData,

    -- * Request Lenses
    getRelationalDatabaseMetricData_relationalDatabaseName,
    getRelationalDatabaseMetricData_metricName,
    getRelationalDatabaseMetricData_period,
    getRelationalDatabaseMetricData_startTime,
    getRelationalDatabaseMetricData_endTime,
    getRelationalDatabaseMetricData_unit,
    getRelationalDatabaseMetricData_statistics,

    -- * Destructuring the Response
    GetRelationalDatabaseMetricDataResponse (..),
    newGetRelationalDatabaseMetricDataResponse,

    -- * Response Lenses
    getRelationalDatabaseMetricDataResponse_metricName,
    getRelationalDatabaseMetricDataResponse_metricData,
    getRelationalDatabaseMetricDataResponse_httpStatus,
  )
where

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

-- | /See:/ 'newGetRelationalDatabaseMetricData' smart constructor.
data GetRelationalDatabaseMetricData = GetRelationalDatabaseMetricData'
  { -- | The name of your database from which to get metric data.
    GetRelationalDatabaseMetricData -> Text
relationalDatabaseName :: Prelude.Text,
    -- | The metric for which you want to return information.
    --
    -- Valid relational database metric names are listed below, along with the
    -- most useful @statistics@ to include in your request, and the published
    -- @unit@ value. All relational database metric data is available in
    -- 1-minute (60 seconds) granularity.
    --
    -- -   __@CPUUtilization@__ - The percentage of CPU utilization currently
    --     in use on the database.
    --
    --     @Statistics@: The most useful statistics are @Maximum@ and
    --     @Average@.
    --
    --     @Unit@: The published unit is @Percent@.
    --
    -- -   __@DatabaseConnections@__ - The number of database connections in
    --     use.
    --
    --     @Statistics@: The most useful statistics are @Maximum@ and @Sum@.
    --
    --     @Unit@: The published unit is @Count@.
    --
    -- -   __@DiskQueueDepth@__ - The number of outstanding IOs (read\/write
    --     requests) that are waiting to access the disk.
    --
    --     @Statistics@: The most useful statistic is @Sum@.
    --
    --     @Unit@: The published unit is @Count@.
    --
    -- -   __@FreeStorageSpace@__ - The amount of available storage space.
    --
    --     @Statistics@: The most useful statistic is @Sum@.
    --
    --     @Unit@: The published unit is @Bytes@.
    --
    -- -   __@NetworkReceiveThroughput@__ - The incoming (Receive) network
    --     traffic on the database, including both customer database traffic
    --     and AWS traffic used for monitoring and replication.
    --
    --     @Statistics@: The most useful statistic is @Average@.
    --
    --     @Unit@: The published unit is @Bytes\/Second@.
    --
    -- -   __@NetworkTransmitThroughput@__ - The outgoing (Transmit) network
    --     traffic on the database, including both customer database traffic
    --     and AWS traffic used for monitoring and replication.
    --
    --     @Statistics@: The most useful statistic is @Average@.
    --
    --     @Unit@: The published unit is @Bytes\/Second@.
    GetRelationalDatabaseMetricData -> RelationalDatabaseMetricName
metricName :: RelationalDatabaseMetricName,
    -- | The granularity, in seconds, of the returned data points.
    --
    -- All relational database metric data is available in 1-minute (60
    -- seconds) granularity.
    GetRelationalDatabaseMetricData -> Natural
period :: Prelude.Natural,
    -- | The start of the time interval from which to get metric data.
    --
    -- Constraints:
    --
    -- -   Specified in Coordinated Universal Time (UTC).
    --
    -- -   Specified in the Unix time format.
    --
    --     For example, if you wish to use a start time of October 1, 2018, at
    --     8 PM UTC, then you input @1538424000@ as the start time.
    GetRelationalDatabaseMetricData -> POSIX
startTime :: Core.POSIX,
    -- | The end of the time interval from which to get metric data.
    --
    -- Constraints:
    --
    -- -   Specified in Coordinated Universal Time (UTC).
    --
    -- -   Specified in the Unix time format.
    --
    --     For example, if you wish to use an end time of October 1, 2018, at 8
    --     PM UTC, then you input @1538424000@ as the end time.
    GetRelationalDatabaseMetricData -> POSIX
endTime :: Core.POSIX,
    -- | The unit for the metric data request. Valid units depend on the metric
    -- data being requested. For the valid units with each available metric,
    -- see the @metricName@ parameter.
    GetRelationalDatabaseMetricData -> MetricUnit
unit :: MetricUnit,
    -- | The statistic for the metric.
    --
    -- The following statistics are available:
    --
    -- -   @Minimum@ - The lowest value observed during the specified period.
    --     Use this value to determine low volumes of activity for your
    --     application.
    --
    -- -   @Maximum@ - The highest value observed during the specified period.
    --     Use this value to determine high volumes of activity for your
    --     application.
    --
    -- -   @Sum@ - All values submitted for the matching metric added together.
    --     You can use this statistic to determine the total volume of a
    --     metric.
    --
    -- -   @Average@ - The value of Sum \/ SampleCount during the specified
    --     period. By comparing this statistic with the Minimum and Maximum
    --     values, you can determine the full scope of a metric and how close
    --     the average use is to the Minimum and Maximum values. This
    --     comparison helps you to know when to increase or decrease your
    --     resources.
    --
    -- -   @SampleCount@ - The count, or number, of data points used for the
    --     statistical calculation.
    GetRelationalDatabaseMetricData -> [MetricStatistic]
statistics :: [MetricStatistic]
  }
  deriving (GetRelationalDatabaseMetricData
-> GetRelationalDatabaseMetricData -> Bool
(GetRelationalDatabaseMetricData
 -> GetRelationalDatabaseMetricData -> Bool)
-> (GetRelationalDatabaseMetricData
    -> GetRelationalDatabaseMetricData -> Bool)
-> Eq GetRelationalDatabaseMetricData
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetRelationalDatabaseMetricData
-> GetRelationalDatabaseMetricData -> Bool
$c/= :: GetRelationalDatabaseMetricData
-> GetRelationalDatabaseMetricData -> Bool
== :: GetRelationalDatabaseMetricData
-> GetRelationalDatabaseMetricData -> Bool
$c== :: GetRelationalDatabaseMetricData
-> GetRelationalDatabaseMetricData -> Bool
Prelude.Eq, ReadPrec [GetRelationalDatabaseMetricData]
ReadPrec GetRelationalDatabaseMetricData
Int -> ReadS GetRelationalDatabaseMetricData
ReadS [GetRelationalDatabaseMetricData]
(Int -> ReadS GetRelationalDatabaseMetricData)
-> ReadS [GetRelationalDatabaseMetricData]
-> ReadPrec GetRelationalDatabaseMetricData
-> ReadPrec [GetRelationalDatabaseMetricData]
-> Read GetRelationalDatabaseMetricData
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetRelationalDatabaseMetricData]
$creadListPrec :: ReadPrec [GetRelationalDatabaseMetricData]
readPrec :: ReadPrec GetRelationalDatabaseMetricData
$creadPrec :: ReadPrec GetRelationalDatabaseMetricData
readList :: ReadS [GetRelationalDatabaseMetricData]
$creadList :: ReadS [GetRelationalDatabaseMetricData]
readsPrec :: Int -> ReadS GetRelationalDatabaseMetricData
$creadsPrec :: Int -> ReadS GetRelationalDatabaseMetricData
Prelude.Read, Int -> GetRelationalDatabaseMetricData -> ShowS
[GetRelationalDatabaseMetricData] -> ShowS
GetRelationalDatabaseMetricData -> String
(Int -> GetRelationalDatabaseMetricData -> ShowS)
-> (GetRelationalDatabaseMetricData -> String)
-> ([GetRelationalDatabaseMetricData] -> ShowS)
-> Show GetRelationalDatabaseMetricData
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetRelationalDatabaseMetricData] -> ShowS
$cshowList :: [GetRelationalDatabaseMetricData] -> ShowS
show :: GetRelationalDatabaseMetricData -> String
$cshow :: GetRelationalDatabaseMetricData -> String
showsPrec :: Int -> GetRelationalDatabaseMetricData -> ShowS
$cshowsPrec :: Int -> GetRelationalDatabaseMetricData -> ShowS
Prelude.Show, (forall x.
 GetRelationalDatabaseMetricData
 -> Rep GetRelationalDatabaseMetricData x)
-> (forall x.
    Rep GetRelationalDatabaseMetricData x
    -> GetRelationalDatabaseMetricData)
-> Generic GetRelationalDatabaseMetricData
forall x.
Rep GetRelationalDatabaseMetricData x
-> GetRelationalDatabaseMetricData
forall x.
GetRelationalDatabaseMetricData
-> Rep GetRelationalDatabaseMetricData x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetRelationalDatabaseMetricData x
-> GetRelationalDatabaseMetricData
$cfrom :: forall x.
GetRelationalDatabaseMetricData
-> Rep GetRelationalDatabaseMetricData x
Prelude.Generic)

-- |
-- Create a value of 'GetRelationalDatabaseMetricData' 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:
--
-- 'relationalDatabaseName', 'getRelationalDatabaseMetricData_relationalDatabaseName' - The name of your database from which to get metric data.
--
-- 'metricName', 'getRelationalDatabaseMetricData_metricName' - The metric for which you want to return information.
--
-- Valid relational database metric names are listed below, along with the
-- most useful @statistics@ to include in your request, and the published
-- @unit@ value. All relational database metric data is available in
-- 1-minute (60 seconds) granularity.
--
-- -   __@CPUUtilization@__ - The percentage of CPU utilization currently
--     in use on the database.
--
--     @Statistics@: The most useful statistics are @Maximum@ and
--     @Average@.
--
--     @Unit@: The published unit is @Percent@.
--
-- -   __@DatabaseConnections@__ - The number of database connections in
--     use.
--
--     @Statistics@: The most useful statistics are @Maximum@ and @Sum@.
--
--     @Unit@: The published unit is @Count@.
--
-- -   __@DiskQueueDepth@__ - The number of outstanding IOs (read\/write
--     requests) that are waiting to access the disk.
--
--     @Statistics@: The most useful statistic is @Sum@.
--
--     @Unit@: The published unit is @Count@.
--
-- -   __@FreeStorageSpace@__ - The amount of available storage space.
--
--     @Statistics@: The most useful statistic is @Sum@.
--
--     @Unit@: The published unit is @Bytes@.
--
-- -   __@NetworkReceiveThroughput@__ - The incoming (Receive) network
--     traffic on the database, including both customer database traffic
--     and AWS traffic used for monitoring and replication.
--
--     @Statistics@: The most useful statistic is @Average@.
--
--     @Unit@: The published unit is @Bytes\/Second@.
--
-- -   __@NetworkTransmitThroughput@__ - The outgoing (Transmit) network
--     traffic on the database, including both customer database traffic
--     and AWS traffic used for monitoring and replication.
--
--     @Statistics@: The most useful statistic is @Average@.
--
--     @Unit@: The published unit is @Bytes\/Second@.
--
-- 'period', 'getRelationalDatabaseMetricData_period' - The granularity, in seconds, of the returned data points.
--
-- All relational database metric data is available in 1-minute (60
-- seconds) granularity.
--
-- 'startTime', 'getRelationalDatabaseMetricData_startTime' - The start of the time interval from which to get metric data.
--
-- Constraints:
--
-- -   Specified in Coordinated Universal Time (UTC).
--
-- -   Specified in the Unix time format.
--
--     For example, if you wish to use a start time of October 1, 2018, at
--     8 PM UTC, then you input @1538424000@ as the start time.
--
-- 'endTime', 'getRelationalDatabaseMetricData_endTime' - The end of the time interval from which to get metric data.
--
-- Constraints:
--
-- -   Specified in Coordinated Universal Time (UTC).
--
-- -   Specified in the Unix time format.
--
--     For example, if you wish to use an end time of October 1, 2018, at 8
--     PM UTC, then you input @1538424000@ as the end time.
--
-- 'unit', 'getRelationalDatabaseMetricData_unit' - The unit for the metric data request. Valid units depend on the metric
-- data being requested. For the valid units with each available metric,
-- see the @metricName@ parameter.
--
-- 'statistics', 'getRelationalDatabaseMetricData_statistics' - The statistic for the metric.
--
-- The following statistics are available:
--
-- -   @Minimum@ - The lowest value observed during the specified period.
--     Use this value to determine low volumes of activity for your
--     application.
--
-- -   @Maximum@ - The highest value observed during the specified period.
--     Use this value to determine high volumes of activity for your
--     application.
--
-- -   @Sum@ - All values submitted for the matching metric added together.
--     You can use this statistic to determine the total volume of a
--     metric.
--
-- -   @Average@ - The value of Sum \/ SampleCount during the specified
--     period. By comparing this statistic with the Minimum and Maximum
--     values, you can determine the full scope of a metric and how close
--     the average use is to the Minimum and Maximum values. This
--     comparison helps you to know when to increase or decrease your
--     resources.
--
-- -   @SampleCount@ - The count, or number, of data points used for the
--     statistical calculation.
newGetRelationalDatabaseMetricData ::
  -- | 'relationalDatabaseName'
  Prelude.Text ->
  -- | 'metricName'
  RelationalDatabaseMetricName ->
  -- | 'period'
  Prelude.Natural ->
  -- | 'startTime'
  Prelude.UTCTime ->
  -- | 'endTime'
  Prelude.UTCTime ->
  -- | 'unit'
  MetricUnit ->
  GetRelationalDatabaseMetricData
newGetRelationalDatabaseMetricData :: Text
-> RelationalDatabaseMetricName
-> Natural
-> UTCTime
-> UTCTime
-> MetricUnit
-> GetRelationalDatabaseMetricData
newGetRelationalDatabaseMetricData
  Text
pRelationalDatabaseName_
  RelationalDatabaseMetricName
pMetricName_
  Natural
pPeriod_
  UTCTime
pStartTime_
  UTCTime
pEndTime_
  MetricUnit
pUnit_ =
    GetRelationalDatabaseMetricData' :: Text
-> RelationalDatabaseMetricName
-> Natural
-> POSIX
-> POSIX
-> MetricUnit
-> [MetricStatistic]
-> GetRelationalDatabaseMetricData
GetRelationalDatabaseMetricData'
      { $sel:relationalDatabaseName:GetRelationalDatabaseMetricData' :: Text
relationalDatabaseName =
          Text
pRelationalDatabaseName_,
        $sel:metricName:GetRelationalDatabaseMetricData' :: RelationalDatabaseMetricName
metricName = RelationalDatabaseMetricName
pMetricName_,
        $sel:period:GetRelationalDatabaseMetricData' :: Natural
period = Natural
pPeriod_,
        $sel:startTime:GetRelationalDatabaseMetricData' :: 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:GetRelationalDatabaseMetricData' :: 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:unit:GetRelationalDatabaseMetricData' :: MetricUnit
unit = MetricUnit
pUnit_,
        $sel:statistics:GetRelationalDatabaseMetricData' :: [MetricStatistic]
statistics = [MetricStatistic]
forall a. Monoid a => a
Prelude.mempty
      }

-- | The name of your database from which to get metric data.
getRelationalDatabaseMetricData_relationalDatabaseName :: Lens.Lens' GetRelationalDatabaseMetricData Prelude.Text
getRelationalDatabaseMetricData_relationalDatabaseName :: (Text -> f Text)
-> GetRelationalDatabaseMetricData
-> f GetRelationalDatabaseMetricData
getRelationalDatabaseMetricData_relationalDatabaseName = (GetRelationalDatabaseMetricData -> Text)
-> (GetRelationalDatabaseMetricData
    -> Text -> GetRelationalDatabaseMetricData)
-> Lens
     GetRelationalDatabaseMetricData
     GetRelationalDatabaseMetricData
     Text
     Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetRelationalDatabaseMetricData' {Text
relationalDatabaseName :: Text
$sel:relationalDatabaseName:GetRelationalDatabaseMetricData' :: GetRelationalDatabaseMetricData -> Text
relationalDatabaseName} -> Text
relationalDatabaseName) (\s :: GetRelationalDatabaseMetricData
s@GetRelationalDatabaseMetricData' {} Text
a -> GetRelationalDatabaseMetricData
s {$sel:relationalDatabaseName:GetRelationalDatabaseMetricData' :: Text
relationalDatabaseName = Text
a} :: GetRelationalDatabaseMetricData)

-- | The metric for which you want to return information.
--
-- Valid relational database metric names are listed below, along with the
-- most useful @statistics@ to include in your request, and the published
-- @unit@ value. All relational database metric data is available in
-- 1-minute (60 seconds) granularity.
--
-- -   __@CPUUtilization@__ - The percentage of CPU utilization currently
--     in use on the database.
--
--     @Statistics@: The most useful statistics are @Maximum@ and
--     @Average@.
--
--     @Unit@: The published unit is @Percent@.
--
-- -   __@DatabaseConnections@__ - The number of database connections in
--     use.
--
--     @Statistics@: The most useful statistics are @Maximum@ and @Sum@.
--
--     @Unit@: The published unit is @Count@.
--
-- -   __@DiskQueueDepth@__ - The number of outstanding IOs (read\/write
--     requests) that are waiting to access the disk.
--
--     @Statistics@: The most useful statistic is @Sum@.
--
--     @Unit@: The published unit is @Count@.
--
-- -   __@FreeStorageSpace@__ - The amount of available storage space.
--
--     @Statistics@: The most useful statistic is @Sum@.
--
--     @Unit@: The published unit is @Bytes@.
--
-- -   __@NetworkReceiveThroughput@__ - The incoming (Receive) network
--     traffic on the database, including both customer database traffic
--     and AWS traffic used for monitoring and replication.
--
--     @Statistics@: The most useful statistic is @Average@.
--
--     @Unit@: The published unit is @Bytes\/Second@.
--
-- -   __@NetworkTransmitThroughput@__ - The outgoing (Transmit) network
--     traffic on the database, including both customer database traffic
--     and AWS traffic used for monitoring and replication.
--
--     @Statistics@: The most useful statistic is @Average@.
--
--     @Unit@: The published unit is @Bytes\/Second@.
getRelationalDatabaseMetricData_metricName :: Lens.Lens' GetRelationalDatabaseMetricData RelationalDatabaseMetricName
getRelationalDatabaseMetricData_metricName :: (RelationalDatabaseMetricName -> f RelationalDatabaseMetricName)
-> GetRelationalDatabaseMetricData
-> f GetRelationalDatabaseMetricData
getRelationalDatabaseMetricData_metricName = (GetRelationalDatabaseMetricData -> RelationalDatabaseMetricName)
-> (GetRelationalDatabaseMetricData
    -> RelationalDatabaseMetricName -> GetRelationalDatabaseMetricData)
-> Lens
     GetRelationalDatabaseMetricData
     GetRelationalDatabaseMetricData
     RelationalDatabaseMetricName
     RelationalDatabaseMetricName
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetRelationalDatabaseMetricData' {RelationalDatabaseMetricName
metricName :: RelationalDatabaseMetricName
$sel:metricName:GetRelationalDatabaseMetricData' :: GetRelationalDatabaseMetricData -> RelationalDatabaseMetricName
metricName} -> RelationalDatabaseMetricName
metricName) (\s :: GetRelationalDatabaseMetricData
s@GetRelationalDatabaseMetricData' {} RelationalDatabaseMetricName
a -> GetRelationalDatabaseMetricData
s {$sel:metricName:GetRelationalDatabaseMetricData' :: RelationalDatabaseMetricName
metricName = RelationalDatabaseMetricName
a} :: GetRelationalDatabaseMetricData)

-- | The granularity, in seconds, of the returned data points.
--
-- All relational database metric data is available in 1-minute (60
-- seconds) granularity.
getRelationalDatabaseMetricData_period :: Lens.Lens' GetRelationalDatabaseMetricData Prelude.Natural
getRelationalDatabaseMetricData_period :: (Natural -> f Natural)
-> GetRelationalDatabaseMetricData
-> f GetRelationalDatabaseMetricData
getRelationalDatabaseMetricData_period = (GetRelationalDatabaseMetricData -> Natural)
-> (GetRelationalDatabaseMetricData
    -> Natural -> GetRelationalDatabaseMetricData)
-> Lens
     GetRelationalDatabaseMetricData
     GetRelationalDatabaseMetricData
     Natural
     Natural
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetRelationalDatabaseMetricData' {Natural
period :: Natural
$sel:period:GetRelationalDatabaseMetricData' :: GetRelationalDatabaseMetricData -> Natural
period} -> Natural
period) (\s :: GetRelationalDatabaseMetricData
s@GetRelationalDatabaseMetricData' {} Natural
a -> GetRelationalDatabaseMetricData
s {$sel:period:GetRelationalDatabaseMetricData' :: Natural
period = Natural
a} :: GetRelationalDatabaseMetricData)

-- | The start of the time interval from which to get metric data.
--
-- Constraints:
--
-- -   Specified in Coordinated Universal Time (UTC).
--
-- -   Specified in the Unix time format.
--
--     For example, if you wish to use a start time of October 1, 2018, at
--     8 PM UTC, then you input @1538424000@ as the start time.
getRelationalDatabaseMetricData_startTime :: Lens.Lens' GetRelationalDatabaseMetricData Prelude.UTCTime
getRelationalDatabaseMetricData_startTime :: (UTCTime -> f UTCTime)
-> GetRelationalDatabaseMetricData
-> f GetRelationalDatabaseMetricData
getRelationalDatabaseMetricData_startTime = (GetRelationalDatabaseMetricData -> POSIX)
-> (GetRelationalDatabaseMetricData
    -> POSIX -> GetRelationalDatabaseMetricData)
-> Lens
     GetRelationalDatabaseMetricData
     GetRelationalDatabaseMetricData
     POSIX
     POSIX
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetRelationalDatabaseMetricData' {POSIX
startTime :: POSIX
$sel:startTime:GetRelationalDatabaseMetricData' :: GetRelationalDatabaseMetricData -> POSIX
startTime} -> POSIX
startTime) (\s :: GetRelationalDatabaseMetricData
s@GetRelationalDatabaseMetricData' {} POSIX
a -> GetRelationalDatabaseMetricData
s {$sel:startTime:GetRelationalDatabaseMetricData' :: POSIX
startTime = POSIX
a} :: GetRelationalDatabaseMetricData) ((POSIX -> f POSIX)
 -> GetRelationalDatabaseMetricData
 -> f GetRelationalDatabaseMetricData)
-> ((UTCTime -> f UTCTime) -> POSIX -> f POSIX)
-> (UTCTime -> f UTCTime)
-> GetRelationalDatabaseMetricData
-> f GetRelationalDatabaseMetricData
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 interval from which to get metric data.
--
-- Constraints:
--
-- -   Specified in Coordinated Universal Time (UTC).
--
-- -   Specified in the Unix time format.
--
--     For example, if you wish to use an end time of October 1, 2018, at 8
--     PM UTC, then you input @1538424000@ as the end time.
getRelationalDatabaseMetricData_endTime :: Lens.Lens' GetRelationalDatabaseMetricData Prelude.UTCTime
getRelationalDatabaseMetricData_endTime :: (UTCTime -> f UTCTime)
-> GetRelationalDatabaseMetricData
-> f GetRelationalDatabaseMetricData
getRelationalDatabaseMetricData_endTime = (GetRelationalDatabaseMetricData -> POSIX)
-> (GetRelationalDatabaseMetricData
    -> POSIX -> GetRelationalDatabaseMetricData)
-> Lens
     GetRelationalDatabaseMetricData
     GetRelationalDatabaseMetricData
     POSIX
     POSIX
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetRelationalDatabaseMetricData' {POSIX
endTime :: POSIX
$sel:endTime:GetRelationalDatabaseMetricData' :: GetRelationalDatabaseMetricData -> POSIX
endTime} -> POSIX
endTime) (\s :: GetRelationalDatabaseMetricData
s@GetRelationalDatabaseMetricData' {} POSIX
a -> GetRelationalDatabaseMetricData
s {$sel:endTime:GetRelationalDatabaseMetricData' :: POSIX
endTime = POSIX
a} :: GetRelationalDatabaseMetricData) ((POSIX -> f POSIX)
 -> GetRelationalDatabaseMetricData
 -> f GetRelationalDatabaseMetricData)
-> ((UTCTime -> f UTCTime) -> POSIX -> f POSIX)
-> (UTCTime -> f UTCTime)
-> GetRelationalDatabaseMetricData
-> f GetRelationalDatabaseMetricData
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 unit for the metric data request. Valid units depend on the metric
-- data being requested. For the valid units with each available metric,
-- see the @metricName@ parameter.
getRelationalDatabaseMetricData_unit :: Lens.Lens' GetRelationalDatabaseMetricData MetricUnit
getRelationalDatabaseMetricData_unit :: (MetricUnit -> f MetricUnit)
-> GetRelationalDatabaseMetricData
-> f GetRelationalDatabaseMetricData
getRelationalDatabaseMetricData_unit = (GetRelationalDatabaseMetricData -> MetricUnit)
-> (GetRelationalDatabaseMetricData
    -> MetricUnit -> GetRelationalDatabaseMetricData)
-> Lens
     GetRelationalDatabaseMetricData
     GetRelationalDatabaseMetricData
     MetricUnit
     MetricUnit
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetRelationalDatabaseMetricData' {MetricUnit
unit :: MetricUnit
$sel:unit:GetRelationalDatabaseMetricData' :: GetRelationalDatabaseMetricData -> MetricUnit
unit} -> MetricUnit
unit) (\s :: GetRelationalDatabaseMetricData
s@GetRelationalDatabaseMetricData' {} MetricUnit
a -> GetRelationalDatabaseMetricData
s {$sel:unit:GetRelationalDatabaseMetricData' :: MetricUnit
unit = MetricUnit
a} :: GetRelationalDatabaseMetricData)

-- | The statistic for the metric.
--
-- The following statistics are available:
--
-- -   @Minimum@ - The lowest value observed during the specified period.
--     Use this value to determine low volumes of activity for your
--     application.
--
-- -   @Maximum@ - The highest value observed during the specified period.
--     Use this value to determine high volumes of activity for your
--     application.
--
-- -   @Sum@ - All values submitted for the matching metric added together.
--     You can use this statistic to determine the total volume of a
--     metric.
--
-- -   @Average@ - The value of Sum \/ SampleCount during the specified
--     period. By comparing this statistic with the Minimum and Maximum
--     values, you can determine the full scope of a metric and how close
--     the average use is to the Minimum and Maximum values. This
--     comparison helps you to know when to increase or decrease your
--     resources.
--
-- -   @SampleCount@ - The count, or number, of data points used for the
--     statistical calculation.
getRelationalDatabaseMetricData_statistics :: Lens.Lens' GetRelationalDatabaseMetricData [MetricStatistic]
getRelationalDatabaseMetricData_statistics :: ([MetricStatistic] -> f [MetricStatistic])
-> GetRelationalDatabaseMetricData
-> f GetRelationalDatabaseMetricData
getRelationalDatabaseMetricData_statistics = (GetRelationalDatabaseMetricData -> [MetricStatistic])
-> (GetRelationalDatabaseMetricData
    -> [MetricStatistic] -> GetRelationalDatabaseMetricData)
-> Lens
     GetRelationalDatabaseMetricData
     GetRelationalDatabaseMetricData
     [MetricStatistic]
     [MetricStatistic]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetRelationalDatabaseMetricData' {[MetricStatistic]
statistics :: [MetricStatistic]
$sel:statistics:GetRelationalDatabaseMetricData' :: GetRelationalDatabaseMetricData -> [MetricStatistic]
statistics} -> [MetricStatistic]
statistics) (\s :: GetRelationalDatabaseMetricData
s@GetRelationalDatabaseMetricData' {} [MetricStatistic]
a -> GetRelationalDatabaseMetricData
s {$sel:statistics:GetRelationalDatabaseMetricData' :: [MetricStatistic]
statistics = [MetricStatistic]
a} :: GetRelationalDatabaseMetricData) (([MetricStatistic] -> f [MetricStatistic])
 -> GetRelationalDatabaseMetricData
 -> f GetRelationalDatabaseMetricData)
-> (([MetricStatistic] -> f [MetricStatistic])
    -> [MetricStatistic] -> f [MetricStatistic])
-> ([MetricStatistic] -> f [MetricStatistic])
-> GetRelationalDatabaseMetricData
-> f GetRelationalDatabaseMetricData
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([MetricStatistic] -> f [MetricStatistic])
-> [MetricStatistic] -> f [MetricStatistic]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

instance
  Prelude.NFData
    GetRelationalDatabaseMetricData

instance
  Core.ToHeaders
    GetRelationalDatabaseMetricData
  where
  toHeaders :: GetRelationalDatabaseMetricData -> ResponseHeaders
toHeaders =
    ResponseHeaders
-> GetRelationalDatabaseMetricData -> 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
"Lightsail_20161128.GetRelationalDatabaseMetricData" ::
                          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 GetRelationalDatabaseMetricData where
  toJSON :: GetRelationalDatabaseMetricData -> Value
toJSON GetRelationalDatabaseMetricData' {Natural
[MetricStatistic]
Text
POSIX
MetricUnit
RelationalDatabaseMetricName
statistics :: [MetricStatistic]
unit :: MetricUnit
endTime :: POSIX
startTime :: POSIX
period :: Natural
metricName :: RelationalDatabaseMetricName
relationalDatabaseName :: Text
$sel:statistics:GetRelationalDatabaseMetricData' :: GetRelationalDatabaseMetricData -> [MetricStatistic]
$sel:unit:GetRelationalDatabaseMetricData' :: GetRelationalDatabaseMetricData -> MetricUnit
$sel:endTime:GetRelationalDatabaseMetricData' :: GetRelationalDatabaseMetricData -> POSIX
$sel:startTime:GetRelationalDatabaseMetricData' :: GetRelationalDatabaseMetricData -> POSIX
$sel:period:GetRelationalDatabaseMetricData' :: GetRelationalDatabaseMetricData -> Natural
$sel:metricName:GetRelationalDatabaseMetricData' :: GetRelationalDatabaseMetricData -> RelationalDatabaseMetricName
$sel:relationalDatabaseName:GetRelationalDatabaseMetricData' :: GetRelationalDatabaseMetricData -> Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              ( Text
"relationalDatabaseName"
                  Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
relationalDatabaseName
              ),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"metricName" Text -> RelationalDatabaseMetricName -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= RelationalDatabaseMetricName
metricName),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"period" Text -> Natural -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Natural
period),
            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
"unit" Text -> MetricUnit -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= MetricUnit
unit),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"statistics" Text -> [MetricStatistic] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= [MetricStatistic]
statistics)
          ]
      )

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

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

-- | /See:/ 'newGetRelationalDatabaseMetricDataResponse' smart constructor.
data GetRelationalDatabaseMetricDataResponse = GetRelationalDatabaseMetricDataResponse'
  { -- | The name of the metric returned.
    GetRelationalDatabaseMetricDataResponse
-> Maybe RelationalDatabaseMetricName
metricName :: Prelude.Maybe RelationalDatabaseMetricName,
    -- | An array of objects that describe the metric data returned.
    GetRelationalDatabaseMetricDataResponse -> Maybe [MetricDatapoint]
metricData :: Prelude.Maybe [MetricDatapoint],
    -- | The response's http status code.
    GetRelationalDatabaseMetricDataResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (GetRelationalDatabaseMetricDataResponse
-> GetRelationalDatabaseMetricDataResponse -> Bool
(GetRelationalDatabaseMetricDataResponse
 -> GetRelationalDatabaseMetricDataResponse -> Bool)
-> (GetRelationalDatabaseMetricDataResponse
    -> GetRelationalDatabaseMetricDataResponse -> Bool)
-> Eq GetRelationalDatabaseMetricDataResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetRelationalDatabaseMetricDataResponse
-> GetRelationalDatabaseMetricDataResponse -> Bool
$c/= :: GetRelationalDatabaseMetricDataResponse
-> GetRelationalDatabaseMetricDataResponse -> Bool
== :: GetRelationalDatabaseMetricDataResponse
-> GetRelationalDatabaseMetricDataResponse -> Bool
$c== :: GetRelationalDatabaseMetricDataResponse
-> GetRelationalDatabaseMetricDataResponse -> Bool
Prelude.Eq, ReadPrec [GetRelationalDatabaseMetricDataResponse]
ReadPrec GetRelationalDatabaseMetricDataResponse
Int -> ReadS GetRelationalDatabaseMetricDataResponse
ReadS [GetRelationalDatabaseMetricDataResponse]
(Int -> ReadS GetRelationalDatabaseMetricDataResponse)
-> ReadS [GetRelationalDatabaseMetricDataResponse]
-> ReadPrec GetRelationalDatabaseMetricDataResponse
-> ReadPrec [GetRelationalDatabaseMetricDataResponse]
-> Read GetRelationalDatabaseMetricDataResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetRelationalDatabaseMetricDataResponse]
$creadListPrec :: ReadPrec [GetRelationalDatabaseMetricDataResponse]
readPrec :: ReadPrec GetRelationalDatabaseMetricDataResponse
$creadPrec :: ReadPrec GetRelationalDatabaseMetricDataResponse
readList :: ReadS [GetRelationalDatabaseMetricDataResponse]
$creadList :: ReadS [GetRelationalDatabaseMetricDataResponse]
readsPrec :: Int -> ReadS GetRelationalDatabaseMetricDataResponse
$creadsPrec :: Int -> ReadS GetRelationalDatabaseMetricDataResponse
Prelude.Read, Int -> GetRelationalDatabaseMetricDataResponse -> ShowS
[GetRelationalDatabaseMetricDataResponse] -> ShowS
GetRelationalDatabaseMetricDataResponse -> String
(Int -> GetRelationalDatabaseMetricDataResponse -> ShowS)
-> (GetRelationalDatabaseMetricDataResponse -> String)
-> ([GetRelationalDatabaseMetricDataResponse] -> ShowS)
-> Show GetRelationalDatabaseMetricDataResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetRelationalDatabaseMetricDataResponse] -> ShowS
$cshowList :: [GetRelationalDatabaseMetricDataResponse] -> ShowS
show :: GetRelationalDatabaseMetricDataResponse -> String
$cshow :: GetRelationalDatabaseMetricDataResponse -> String
showsPrec :: Int -> GetRelationalDatabaseMetricDataResponse -> ShowS
$cshowsPrec :: Int -> GetRelationalDatabaseMetricDataResponse -> ShowS
Prelude.Show, (forall x.
 GetRelationalDatabaseMetricDataResponse
 -> Rep GetRelationalDatabaseMetricDataResponse x)
-> (forall x.
    Rep GetRelationalDatabaseMetricDataResponse x
    -> GetRelationalDatabaseMetricDataResponse)
-> Generic GetRelationalDatabaseMetricDataResponse
forall x.
Rep GetRelationalDatabaseMetricDataResponse x
-> GetRelationalDatabaseMetricDataResponse
forall x.
GetRelationalDatabaseMetricDataResponse
-> Rep GetRelationalDatabaseMetricDataResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetRelationalDatabaseMetricDataResponse x
-> GetRelationalDatabaseMetricDataResponse
$cfrom :: forall x.
GetRelationalDatabaseMetricDataResponse
-> Rep GetRelationalDatabaseMetricDataResponse x
Prelude.Generic)

-- |
-- Create a value of 'GetRelationalDatabaseMetricDataResponse' 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:
--
-- 'metricName', 'getRelationalDatabaseMetricDataResponse_metricName' - The name of the metric returned.
--
-- 'metricData', 'getRelationalDatabaseMetricDataResponse_metricData' - An array of objects that describe the metric data returned.
--
-- 'httpStatus', 'getRelationalDatabaseMetricDataResponse_httpStatus' - The response's http status code.
newGetRelationalDatabaseMetricDataResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  GetRelationalDatabaseMetricDataResponse
newGetRelationalDatabaseMetricDataResponse :: Int -> GetRelationalDatabaseMetricDataResponse
newGetRelationalDatabaseMetricDataResponse
  Int
pHttpStatus_ =
    GetRelationalDatabaseMetricDataResponse' :: Maybe RelationalDatabaseMetricName
-> Maybe [MetricDatapoint]
-> Int
-> GetRelationalDatabaseMetricDataResponse
GetRelationalDatabaseMetricDataResponse'
      { $sel:metricName:GetRelationalDatabaseMetricDataResponse' :: Maybe RelationalDatabaseMetricName
metricName =
          Maybe RelationalDatabaseMetricName
forall a. Maybe a
Prelude.Nothing,
        $sel:metricData:GetRelationalDatabaseMetricDataResponse' :: Maybe [MetricDatapoint]
metricData = Maybe [MetricDatapoint]
forall a. Maybe a
Prelude.Nothing,
        $sel:httpStatus:GetRelationalDatabaseMetricDataResponse' :: Int
httpStatus = Int
pHttpStatus_
      }

-- | The name of the metric returned.
getRelationalDatabaseMetricDataResponse_metricName :: Lens.Lens' GetRelationalDatabaseMetricDataResponse (Prelude.Maybe RelationalDatabaseMetricName)
getRelationalDatabaseMetricDataResponse_metricName :: (Maybe RelationalDatabaseMetricName
 -> f (Maybe RelationalDatabaseMetricName))
-> GetRelationalDatabaseMetricDataResponse
-> f GetRelationalDatabaseMetricDataResponse
getRelationalDatabaseMetricDataResponse_metricName = (GetRelationalDatabaseMetricDataResponse
 -> Maybe RelationalDatabaseMetricName)
-> (GetRelationalDatabaseMetricDataResponse
    -> Maybe RelationalDatabaseMetricName
    -> GetRelationalDatabaseMetricDataResponse)
-> Lens
     GetRelationalDatabaseMetricDataResponse
     GetRelationalDatabaseMetricDataResponse
     (Maybe RelationalDatabaseMetricName)
     (Maybe RelationalDatabaseMetricName)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetRelationalDatabaseMetricDataResponse' {Maybe RelationalDatabaseMetricName
metricName :: Maybe RelationalDatabaseMetricName
$sel:metricName:GetRelationalDatabaseMetricDataResponse' :: GetRelationalDatabaseMetricDataResponse
-> Maybe RelationalDatabaseMetricName
metricName} -> Maybe RelationalDatabaseMetricName
metricName) (\s :: GetRelationalDatabaseMetricDataResponse
s@GetRelationalDatabaseMetricDataResponse' {} Maybe RelationalDatabaseMetricName
a -> GetRelationalDatabaseMetricDataResponse
s {$sel:metricName:GetRelationalDatabaseMetricDataResponse' :: Maybe RelationalDatabaseMetricName
metricName = Maybe RelationalDatabaseMetricName
a} :: GetRelationalDatabaseMetricDataResponse)

-- | An array of objects that describe the metric data returned.
getRelationalDatabaseMetricDataResponse_metricData :: Lens.Lens' GetRelationalDatabaseMetricDataResponse (Prelude.Maybe [MetricDatapoint])
getRelationalDatabaseMetricDataResponse_metricData :: (Maybe [MetricDatapoint] -> f (Maybe [MetricDatapoint]))
-> GetRelationalDatabaseMetricDataResponse
-> f GetRelationalDatabaseMetricDataResponse
getRelationalDatabaseMetricDataResponse_metricData = (GetRelationalDatabaseMetricDataResponse
 -> Maybe [MetricDatapoint])
-> (GetRelationalDatabaseMetricDataResponse
    -> Maybe [MetricDatapoint]
    -> GetRelationalDatabaseMetricDataResponse)
-> Lens
     GetRelationalDatabaseMetricDataResponse
     GetRelationalDatabaseMetricDataResponse
     (Maybe [MetricDatapoint])
     (Maybe [MetricDatapoint])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetRelationalDatabaseMetricDataResponse' {Maybe [MetricDatapoint]
metricData :: Maybe [MetricDatapoint]
$sel:metricData:GetRelationalDatabaseMetricDataResponse' :: GetRelationalDatabaseMetricDataResponse -> Maybe [MetricDatapoint]
metricData} -> Maybe [MetricDatapoint]
metricData) (\s :: GetRelationalDatabaseMetricDataResponse
s@GetRelationalDatabaseMetricDataResponse' {} Maybe [MetricDatapoint]
a -> GetRelationalDatabaseMetricDataResponse
s {$sel:metricData:GetRelationalDatabaseMetricDataResponse' :: Maybe [MetricDatapoint]
metricData = Maybe [MetricDatapoint]
a} :: GetRelationalDatabaseMetricDataResponse) ((Maybe [MetricDatapoint] -> f (Maybe [MetricDatapoint]))
 -> GetRelationalDatabaseMetricDataResponse
 -> f GetRelationalDatabaseMetricDataResponse)
-> ((Maybe [MetricDatapoint] -> f (Maybe [MetricDatapoint]))
    -> Maybe [MetricDatapoint] -> f (Maybe [MetricDatapoint]))
-> (Maybe [MetricDatapoint] -> f (Maybe [MetricDatapoint]))
-> GetRelationalDatabaseMetricDataResponse
-> f GetRelationalDatabaseMetricDataResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [MetricDatapoint]
  [MetricDatapoint]
  [MetricDatapoint]
  [MetricDatapoint]
-> Iso
     (Maybe [MetricDatapoint])
     (Maybe [MetricDatapoint])
     (Maybe [MetricDatapoint])
     (Maybe [MetricDatapoint])
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
  [MetricDatapoint]
  [MetricDatapoint]
  [MetricDatapoint]
  [MetricDatapoint]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

instance
  Prelude.NFData
    GetRelationalDatabaseMetricDataResponse