{-# 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.GetInstanceMetricData
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Returns the data points for the specified Amazon Lightsail instance
-- metric, given an instance name.
--
-- 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.GetInstanceMetricData
  ( -- * Creating a Request
    GetInstanceMetricData (..),
    newGetInstanceMetricData,

    -- * Request Lenses
    getInstanceMetricData_instanceName,
    getInstanceMetricData_metricName,
    getInstanceMetricData_period,
    getInstanceMetricData_startTime,
    getInstanceMetricData_endTime,
    getInstanceMetricData_unit,
    getInstanceMetricData_statistics,

    -- * Destructuring the Response
    GetInstanceMetricDataResponse (..),
    newGetInstanceMetricDataResponse,

    -- * Response Lenses
    getInstanceMetricDataResponse_metricData,
    getInstanceMetricDataResponse_metricName,
    getInstanceMetricDataResponse_httpStatus,
  )
where

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

-- | /See:/ 'newGetInstanceMetricData' smart constructor.
data GetInstanceMetricData = GetInstanceMetricData'
  { -- | The name of the instance for which you want to get metrics data.
    GetInstanceMetricData -> Text
instanceName :: Prelude.Text,
    -- | The metric for which you want to return information.
    --
    -- Valid instance metric names are listed below, along with the most useful
    -- @statistics@ to include in your request, and the published @unit@ value.
    --
    -- -   __@BurstCapacityPercentage@__ - The percentage of CPU performance
    --     available for your instance to burst above its baseline. Your
    --     instance continuously accrues and consumes burst capacity. Burst
    --     capacity stops accruing when your instance\'s
    --     @BurstCapacityPercentage@ reaches 100%. For more information, see
    --     <https://lightsail.aws.amazon.com/ls/docs/en_us/articles/amazon-lightsail-viewing-instance-burst-capacity Viewing instance burst capacity in Amazon Lightsail>.
    --
    --     @Statistics@: The most useful statistics are @Maximum@ and
    --     @Average@.
    --
    --     @Unit@: The published unit is @Percent@.
    --
    -- -   __@BurstCapacityTime@__ - The available amount of time for your
    --     instance to burst at 100% CPU utilization. Your instance
    --     continuously accrues and consumes burst capacity. Burst capacity
    --     time stops accruing when your instance\'s @BurstCapacityPercentage@
    --     metric reaches 100%.
    --
    --     Burst capacity time is consumed at the full rate only when your
    --     instance operates at 100% CPU utilization. For example, if your
    --     instance operates at 50% CPU utilization in the burstable zone for a
    --     5-minute period, then it consumes CPU burst capacity minutes at a
    --     50% rate in that period. Your instance consumed 2 minutes and 30
    --     seconds of CPU burst capacity minutes in the 5-minute period. For
    --     more information, see
    --     <https://lightsail.aws.amazon.com/ls/docs/en_us/articles/amazon-lightsail-viewing-instance-burst-capacity Viewing instance burst capacity in Amazon Lightsail>.
    --
    --     @Statistics@: The most useful statistics are @Maximum@ and
    --     @Average@.
    --
    --     @Unit@: The published unit is @Seconds@.
    --
    -- -   __@CPUUtilization@__ - The percentage of allocated compute units
    --     that are currently in use on the instance. This metric identifies
    --     the processing power to run the applications on the instance. Tools
    --     in your operating system can show a lower percentage than Lightsail
    --     when the instance is not allocated a full processor core.
    --
    --     @Statistics@: The most useful statistics are @Maximum@ and
    --     @Average@.
    --
    --     @Unit@: The published unit is @Percent@.
    --
    -- -   __@NetworkIn@__ - The number of bytes received on all network
    --     interfaces by the instance. This metric identifies the volume of
    --     incoming network traffic to the instance. The number reported is the
    --     number of bytes received during the period. Because this metric is
    --     reported in 5-minute intervals, divide the reported number by 300 to
    --     find Bytes\/second.
    --
    --     @Statistics@: The most useful statistic is @Sum@.
    --
    --     @Unit@: The published unit is @Bytes@.
    --
    -- -   __@NetworkOut@__ - The number of bytes sent out on all network
    --     interfaces by the instance. This metric identifies the volume of
    --     outgoing network traffic from the instance. The number reported is
    --     the number of bytes sent during the period. Because this metric is
    --     reported in 5-minute intervals, divide the reported number by 300 to
    --     find Bytes\/second.
    --
    --     @Statistics@: The most useful statistic is @Sum@.
    --
    --     @Unit@: The published unit is @Bytes@.
    --
    -- -   __@StatusCheckFailed@__ - Reports whether the instance passed or
    --     failed both the instance status check and the system status check.
    --     This metric can be either 0 (passed) or 1 (failed). This metric data
    --     is available in 1-minute (60 seconds) granularity.
    --
    --     @Statistics@: The most useful statistic is @Sum@.
    --
    --     @Unit@: The published unit is @Count@.
    --
    -- -   __@StatusCheckFailed_Instance@__ - Reports whether the instance
    --     passed or failed the instance status check. This metric can be
    --     either 0 (passed) or 1 (failed). This metric data is available in
    --     1-minute (60 seconds) granularity.
    --
    --     @Statistics@: The most useful statistic is @Sum@.
    --
    --     @Unit@: The published unit is @Count@.
    --
    -- -   __@StatusCheckFailed_System@__ - Reports whether the instance passed
    --     or failed the system status check. This metric can be either 0
    --     (passed) or 1 (failed). This metric data is available in 1-minute
    --     (60 seconds) granularity.
    --
    --     @Statistics@: The most useful statistic is @Sum@.
    --
    --     @Unit@: The published unit is @Count@.
    --
    -- -   __@MetadataNoToken@__ - Reports the number of times that the
    --     instance metadata service was successfully accessed without a token.
    --     This metric determines if there are any processes accessing instance
    --     metadata by using Instance Metadata Service Version 1, which
    --     doesn\'t use a token. If all requests use token-backed sessions,
    --     such as Instance Metadata Service Version 2, then the value is 0.
    --
    --     @Statistics@: The most useful statistic is @Sum@.
    --
    --     @Unit@: The published unit is @Count@.
    GetInstanceMetricData -> InstanceMetricName
metricName :: InstanceMetricName,
    -- | The granularity, in seconds, of the returned data points.
    --
    -- The @StatusCheckFailed@, @StatusCheckFailed_Instance@, and
    -- @StatusCheckFailed_System@ instance metric data is available in 1-minute
    -- (60 seconds) granularity. All other instance metric data is available in
    -- 5-minute (300 seconds) granularity.
    GetInstanceMetricData -> Natural
period :: Prelude.Natural,
    -- | The start time of the time period.
    GetInstanceMetricData -> POSIX
startTime :: Data.POSIX,
    -- | The end time of the time period.
    GetInstanceMetricData -> POSIX
endTime :: Data.POSIX,
    -- | The unit for the metric data request. Valid units depend on the metric
    -- data being requested. For the valid units to specify with each available
    -- metric, see the @metricName@ parameter.
    GetInstanceMetricData -> 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.
    GetInstanceMetricData -> [MetricStatistic]
statistics :: [MetricStatistic]
  }
  deriving (GetInstanceMetricData -> GetInstanceMetricData -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetInstanceMetricData -> GetInstanceMetricData -> Bool
$c/= :: GetInstanceMetricData -> GetInstanceMetricData -> Bool
== :: GetInstanceMetricData -> GetInstanceMetricData -> Bool
$c== :: GetInstanceMetricData -> GetInstanceMetricData -> Bool
Prelude.Eq, ReadPrec [GetInstanceMetricData]
ReadPrec GetInstanceMetricData
Int -> ReadS GetInstanceMetricData
ReadS [GetInstanceMetricData]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetInstanceMetricData]
$creadListPrec :: ReadPrec [GetInstanceMetricData]
readPrec :: ReadPrec GetInstanceMetricData
$creadPrec :: ReadPrec GetInstanceMetricData
readList :: ReadS [GetInstanceMetricData]
$creadList :: ReadS [GetInstanceMetricData]
readsPrec :: Int -> ReadS GetInstanceMetricData
$creadsPrec :: Int -> ReadS GetInstanceMetricData
Prelude.Read, Int -> GetInstanceMetricData -> ShowS
[GetInstanceMetricData] -> ShowS
GetInstanceMetricData -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetInstanceMetricData] -> ShowS
$cshowList :: [GetInstanceMetricData] -> ShowS
show :: GetInstanceMetricData -> String
$cshow :: GetInstanceMetricData -> String
showsPrec :: Int -> GetInstanceMetricData -> ShowS
$cshowsPrec :: Int -> GetInstanceMetricData -> ShowS
Prelude.Show, forall x. Rep GetInstanceMetricData x -> GetInstanceMetricData
forall x. GetInstanceMetricData -> Rep GetInstanceMetricData x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetInstanceMetricData x -> GetInstanceMetricData
$cfrom :: forall x. GetInstanceMetricData -> Rep GetInstanceMetricData x
Prelude.Generic)

-- |
-- Create a value of 'GetInstanceMetricData' 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:
--
-- 'instanceName', 'getInstanceMetricData_instanceName' - The name of the instance for which you want to get metrics data.
--
-- 'metricName', 'getInstanceMetricData_metricName' - The metric for which you want to return information.
--
-- Valid instance metric names are listed below, along with the most useful
-- @statistics@ to include in your request, and the published @unit@ value.
--
-- -   __@BurstCapacityPercentage@__ - The percentage of CPU performance
--     available for your instance to burst above its baseline. Your
--     instance continuously accrues and consumes burst capacity. Burst
--     capacity stops accruing when your instance\'s
--     @BurstCapacityPercentage@ reaches 100%. For more information, see
--     <https://lightsail.aws.amazon.com/ls/docs/en_us/articles/amazon-lightsail-viewing-instance-burst-capacity Viewing instance burst capacity in Amazon Lightsail>.
--
--     @Statistics@: The most useful statistics are @Maximum@ and
--     @Average@.
--
--     @Unit@: The published unit is @Percent@.
--
-- -   __@BurstCapacityTime@__ - The available amount of time for your
--     instance to burst at 100% CPU utilization. Your instance
--     continuously accrues and consumes burst capacity. Burst capacity
--     time stops accruing when your instance\'s @BurstCapacityPercentage@
--     metric reaches 100%.
--
--     Burst capacity time is consumed at the full rate only when your
--     instance operates at 100% CPU utilization. For example, if your
--     instance operates at 50% CPU utilization in the burstable zone for a
--     5-minute period, then it consumes CPU burst capacity minutes at a
--     50% rate in that period. Your instance consumed 2 minutes and 30
--     seconds of CPU burst capacity minutes in the 5-minute period. For
--     more information, see
--     <https://lightsail.aws.amazon.com/ls/docs/en_us/articles/amazon-lightsail-viewing-instance-burst-capacity Viewing instance burst capacity in Amazon Lightsail>.
--
--     @Statistics@: The most useful statistics are @Maximum@ and
--     @Average@.
--
--     @Unit@: The published unit is @Seconds@.
--
-- -   __@CPUUtilization@__ - The percentage of allocated compute units
--     that are currently in use on the instance. This metric identifies
--     the processing power to run the applications on the instance. Tools
--     in your operating system can show a lower percentage than Lightsail
--     when the instance is not allocated a full processor core.
--
--     @Statistics@: The most useful statistics are @Maximum@ and
--     @Average@.
--
--     @Unit@: The published unit is @Percent@.
--
-- -   __@NetworkIn@__ - The number of bytes received on all network
--     interfaces by the instance. This metric identifies the volume of
--     incoming network traffic to the instance. The number reported is the
--     number of bytes received during the period. Because this metric is
--     reported in 5-minute intervals, divide the reported number by 300 to
--     find Bytes\/second.
--
--     @Statistics@: The most useful statistic is @Sum@.
--
--     @Unit@: The published unit is @Bytes@.
--
-- -   __@NetworkOut@__ - The number of bytes sent out on all network
--     interfaces by the instance. This metric identifies the volume of
--     outgoing network traffic from the instance. The number reported is
--     the number of bytes sent during the period. Because this metric is
--     reported in 5-minute intervals, divide the reported number by 300 to
--     find Bytes\/second.
--
--     @Statistics@: The most useful statistic is @Sum@.
--
--     @Unit@: The published unit is @Bytes@.
--
-- -   __@StatusCheckFailed@__ - Reports whether the instance passed or
--     failed both the instance status check and the system status check.
--     This metric can be either 0 (passed) or 1 (failed). This metric data
--     is available in 1-minute (60 seconds) granularity.
--
--     @Statistics@: The most useful statistic is @Sum@.
--
--     @Unit@: The published unit is @Count@.
--
-- -   __@StatusCheckFailed_Instance@__ - Reports whether the instance
--     passed or failed the instance status check. This metric can be
--     either 0 (passed) or 1 (failed). This metric data is available in
--     1-minute (60 seconds) granularity.
--
--     @Statistics@: The most useful statistic is @Sum@.
--
--     @Unit@: The published unit is @Count@.
--
-- -   __@StatusCheckFailed_System@__ - Reports whether the instance passed
--     or failed the system status check. This metric can be either 0
--     (passed) or 1 (failed). This metric data is available in 1-minute
--     (60 seconds) granularity.
--
--     @Statistics@: The most useful statistic is @Sum@.
--
--     @Unit@: The published unit is @Count@.
--
-- -   __@MetadataNoToken@__ - Reports the number of times that the
--     instance metadata service was successfully accessed without a token.
--     This metric determines if there are any processes accessing instance
--     metadata by using Instance Metadata Service Version 1, which
--     doesn\'t use a token. If all requests use token-backed sessions,
--     such as Instance Metadata Service Version 2, then the value is 0.
--
--     @Statistics@: The most useful statistic is @Sum@.
--
--     @Unit@: The published unit is @Count@.
--
-- 'period', 'getInstanceMetricData_period' - The granularity, in seconds, of the returned data points.
--
-- The @StatusCheckFailed@, @StatusCheckFailed_Instance@, and
-- @StatusCheckFailed_System@ instance metric data is available in 1-minute
-- (60 seconds) granularity. All other instance metric data is available in
-- 5-minute (300 seconds) granularity.
--
-- 'startTime', 'getInstanceMetricData_startTime' - The start time of the time period.
--
-- 'endTime', 'getInstanceMetricData_endTime' - The end time of the time period.
--
-- 'unit', 'getInstanceMetricData_unit' - The unit for the metric data request. Valid units depend on the metric
-- data being requested. For the valid units to specify with each available
-- metric, see the @metricName@ parameter.
--
-- 'statistics', 'getInstanceMetricData_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.
newGetInstanceMetricData ::
  -- | 'instanceName'
  Prelude.Text ->
  -- | 'metricName'
  InstanceMetricName ->
  -- | 'period'
  Prelude.Natural ->
  -- | 'startTime'
  Prelude.UTCTime ->
  -- | 'endTime'
  Prelude.UTCTime ->
  -- | 'unit'
  MetricUnit ->
  GetInstanceMetricData
newGetInstanceMetricData :: Text
-> InstanceMetricName
-> Natural
-> UTCTime
-> UTCTime
-> MetricUnit
-> GetInstanceMetricData
newGetInstanceMetricData
  Text
pInstanceName_
  InstanceMetricName
pMetricName_
  Natural
pPeriod_
  UTCTime
pStartTime_
  UTCTime
pEndTime_
  MetricUnit
pUnit_ =
    GetInstanceMetricData'
      { $sel:instanceName:GetInstanceMetricData' :: Text
instanceName =
          Text
pInstanceName_,
        $sel:metricName:GetInstanceMetricData' :: InstanceMetricName
metricName = InstanceMetricName
pMetricName_,
        $sel:period:GetInstanceMetricData' :: Natural
period = Natural
pPeriod_,
        $sel:startTime:GetInstanceMetricData' :: POSIX
startTime = forall (a :: Format). Iso' (Time a) UTCTime
Data._Time forall t b. AReview t b -> b -> t
Lens.# UTCTime
pStartTime_,
        $sel:endTime:GetInstanceMetricData' :: POSIX
endTime = forall (a :: Format). Iso' (Time a) UTCTime
Data._Time forall t b. AReview t b -> b -> t
Lens.# UTCTime
pEndTime_,
        $sel:unit:GetInstanceMetricData' :: MetricUnit
unit = MetricUnit
pUnit_,
        $sel:statistics:GetInstanceMetricData' :: [MetricStatistic]
statistics = forall a. Monoid a => a
Prelude.mempty
      }

-- | The name of the instance for which you want to get metrics data.
getInstanceMetricData_instanceName :: Lens.Lens' GetInstanceMetricData Prelude.Text
getInstanceMetricData_instanceName :: Lens' GetInstanceMetricData Text
getInstanceMetricData_instanceName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetInstanceMetricData' {Text
instanceName :: Text
$sel:instanceName:GetInstanceMetricData' :: GetInstanceMetricData -> Text
instanceName} -> Text
instanceName) (\s :: GetInstanceMetricData
s@GetInstanceMetricData' {} Text
a -> GetInstanceMetricData
s {$sel:instanceName:GetInstanceMetricData' :: Text
instanceName = Text
a} :: GetInstanceMetricData)

-- | The metric for which you want to return information.
--
-- Valid instance metric names are listed below, along with the most useful
-- @statistics@ to include in your request, and the published @unit@ value.
--
-- -   __@BurstCapacityPercentage@__ - The percentage of CPU performance
--     available for your instance to burst above its baseline. Your
--     instance continuously accrues and consumes burst capacity. Burst
--     capacity stops accruing when your instance\'s
--     @BurstCapacityPercentage@ reaches 100%. For more information, see
--     <https://lightsail.aws.amazon.com/ls/docs/en_us/articles/amazon-lightsail-viewing-instance-burst-capacity Viewing instance burst capacity in Amazon Lightsail>.
--
--     @Statistics@: The most useful statistics are @Maximum@ and
--     @Average@.
--
--     @Unit@: The published unit is @Percent@.
--
-- -   __@BurstCapacityTime@__ - The available amount of time for your
--     instance to burst at 100% CPU utilization. Your instance
--     continuously accrues and consumes burst capacity. Burst capacity
--     time stops accruing when your instance\'s @BurstCapacityPercentage@
--     metric reaches 100%.
--
--     Burst capacity time is consumed at the full rate only when your
--     instance operates at 100% CPU utilization. For example, if your
--     instance operates at 50% CPU utilization in the burstable zone for a
--     5-minute period, then it consumes CPU burst capacity minutes at a
--     50% rate in that period. Your instance consumed 2 minutes and 30
--     seconds of CPU burst capacity minutes in the 5-minute period. For
--     more information, see
--     <https://lightsail.aws.amazon.com/ls/docs/en_us/articles/amazon-lightsail-viewing-instance-burst-capacity Viewing instance burst capacity in Amazon Lightsail>.
--
--     @Statistics@: The most useful statistics are @Maximum@ and
--     @Average@.
--
--     @Unit@: The published unit is @Seconds@.
--
-- -   __@CPUUtilization@__ - The percentage of allocated compute units
--     that are currently in use on the instance. This metric identifies
--     the processing power to run the applications on the instance. Tools
--     in your operating system can show a lower percentage than Lightsail
--     when the instance is not allocated a full processor core.
--
--     @Statistics@: The most useful statistics are @Maximum@ and
--     @Average@.
--
--     @Unit@: The published unit is @Percent@.
--
-- -   __@NetworkIn@__ - The number of bytes received on all network
--     interfaces by the instance. This metric identifies the volume of
--     incoming network traffic to the instance. The number reported is the
--     number of bytes received during the period. Because this metric is
--     reported in 5-minute intervals, divide the reported number by 300 to
--     find Bytes\/second.
--
--     @Statistics@: The most useful statistic is @Sum@.
--
--     @Unit@: The published unit is @Bytes@.
--
-- -   __@NetworkOut@__ - The number of bytes sent out on all network
--     interfaces by the instance. This metric identifies the volume of
--     outgoing network traffic from the instance. The number reported is
--     the number of bytes sent during the period. Because this metric is
--     reported in 5-minute intervals, divide the reported number by 300 to
--     find Bytes\/second.
--
--     @Statistics@: The most useful statistic is @Sum@.
--
--     @Unit@: The published unit is @Bytes@.
--
-- -   __@StatusCheckFailed@__ - Reports whether the instance passed or
--     failed both the instance status check and the system status check.
--     This metric can be either 0 (passed) or 1 (failed). This metric data
--     is available in 1-minute (60 seconds) granularity.
--
--     @Statistics@: The most useful statistic is @Sum@.
--
--     @Unit@: The published unit is @Count@.
--
-- -   __@StatusCheckFailed_Instance@__ - Reports whether the instance
--     passed or failed the instance status check. This metric can be
--     either 0 (passed) or 1 (failed). This metric data is available in
--     1-minute (60 seconds) granularity.
--
--     @Statistics@: The most useful statistic is @Sum@.
--
--     @Unit@: The published unit is @Count@.
--
-- -   __@StatusCheckFailed_System@__ - Reports whether the instance passed
--     or failed the system status check. This metric can be either 0
--     (passed) or 1 (failed). This metric data is available in 1-minute
--     (60 seconds) granularity.
--
--     @Statistics@: The most useful statistic is @Sum@.
--
--     @Unit@: The published unit is @Count@.
--
-- -   __@MetadataNoToken@__ - Reports the number of times that the
--     instance metadata service was successfully accessed without a token.
--     This metric determines if there are any processes accessing instance
--     metadata by using Instance Metadata Service Version 1, which
--     doesn\'t use a token. If all requests use token-backed sessions,
--     such as Instance Metadata Service Version 2, then the value is 0.
--
--     @Statistics@: The most useful statistic is @Sum@.
--
--     @Unit@: The published unit is @Count@.
getInstanceMetricData_metricName :: Lens.Lens' GetInstanceMetricData InstanceMetricName
getInstanceMetricData_metricName :: Lens' GetInstanceMetricData InstanceMetricName
getInstanceMetricData_metricName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetInstanceMetricData' {InstanceMetricName
metricName :: InstanceMetricName
$sel:metricName:GetInstanceMetricData' :: GetInstanceMetricData -> InstanceMetricName
metricName} -> InstanceMetricName
metricName) (\s :: GetInstanceMetricData
s@GetInstanceMetricData' {} InstanceMetricName
a -> GetInstanceMetricData
s {$sel:metricName:GetInstanceMetricData' :: InstanceMetricName
metricName = InstanceMetricName
a} :: GetInstanceMetricData)

-- | The granularity, in seconds, of the returned data points.
--
-- The @StatusCheckFailed@, @StatusCheckFailed_Instance@, and
-- @StatusCheckFailed_System@ instance metric data is available in 1-minute
-- (60 seconds) granularity. All other instance metric data is available in
-- 5-minute (300 seconds) granularity.
getInstanceMetricData_period :: Lens.Lens' GetInstanceMetricData Prelude.Natural
getInstanceMetricData_period :: Lens' GetInstanceMetricData Natural
getInstanceMetricData_period = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetInstanceMetricData' {Natural
period :: Natural
$sel:period:GetInstanceMetricData' :: GetInstanceMetricData -> Natural
period} -> Natural
period) (\s :: GetInstanceMetricData
s@GetInstanceMetricData' {} Natural
a -> GetInstanceMetricData
s {$sel:period:GetInstanceMetricData' :: Natural
period = Natural
a} :: GetInstanceMetricData)

-- | The start time of the time period.
getInstanceMetricData_startTime :: Lens.Lens' GetInstanceMetricData Prelude.UTCTime
getInstanceMetricData_startTime :: Lens' GetInstanceMetricData UTCTime
getInstanceMetricData_startTime = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetInstanceMetricData' {POSIX
startTime :: POSIX
$sel:startTime:GetInstanceMetricData' :: GetInstanceMetricData -> POSIX
startTime} -> POSIX
startTime) (\s :: GetInstanceMetricData
s@GetInstanceMetricData' {} POSIX
a -> GetInstanceMetricData
s {$sel:startTime:GetInstanceMetricData' :: POSIX
startTime = POSIX
a} :: GetInstanceMetricData) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (a :: Format). Iso' (Time a) UTCTime
Data._Time

-- | The end time of the time period.
getInstanceMetricData_endTime :: Lens.Lens' GetInstanceMetricData Prelude.UTCTime
getInstanceMetricData_endTime :: Lens' GetInstanceMetricData UTCTime
getInstanceMetricData_endTime = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetInstanceMetricData' {POSIX
endTime :: POSIX
$sel:endTime:GetInstanceMetricData' :: GetInstanceMetricData -> POSIX
endTime} -> POSIX
endTime) (\s :: GetInstanceMetricData
s@GetInstanceMetricData' {} POSIX
a -> GetInstanceMetricData
s {$sel:endTime:GetInstanceMetricData' :: POSIX
endTime = POSIX
a} :: GetInstanceMetricData) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (a :: Format). Iso' (Time a) UTCTime
Data._Time

-- | The unit for the metric data request. Valid units depend on the metric
-- data being requested. For the valid units to specify with each available
-- metric, see the @metricName@ parameter.
getInstanceMetricData_unit :: Lens.Lens' GetInstanceMetricData MetricUnit
getInstanceMetricData_unit :: Lens' GetInstanceMetricData MetricUnit
getInstanceMetricData_unit = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetInstanceMetricData' {MetricUnit
unit :: MetricUnit
$sel:unit:GetInstanceMetricData' :: GetInstanceMetricData -> MetricUnit
unit} -> MetricUnit
unit) (\s :: GetInstanceMetricData
s@GetInstanceMetricData' {} MetricUnit
a -> GetInstanceMetricData
s {$sel:unit:GetInstanceMetricData' :: MetricUnit
unit = MetricUnit
a} :: GetInstanceMetricData)

-- | 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.
getInstanceMetricData_statistics :: Lens.Lens' GetInstanceMetricData [MetricStatistic]
getInstanceMetricData_statistics :: Lens' GetInstanceMetricData [MetricStatistic]
getInstanceMetricData_statistics = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetInstanceMetricData' {[MetricStatistic]
statistics :: [MetricStatistic]
$sel:statistics:GetInstanceMetricData' :: GetInstanceMetricData -> [MetricStatistic]
statistics} -> [MetricStatistic]
statistics) (\s :: GetInstanceMetricData
s@GetInstanceMetricData' {} [MetricStatistic]
a -> GetInstanceMetricData
s {$sel:statistics:GetInstanceMetricData' :: [MetricStatistic]
statistics = [MetricStatistic]
a} :: GetInstanceMetricData) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance Core.AWSRequest GetInstanceMetricData where
  type
    AWSResponse GetInstanceMetricData =
      GetInstanceMetricDataResponse
  request :: (Service -> Service)
-> GetInstanceMetricData -> Request GetInstanceMetricData
request Service -> Service
overrides =
    forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy GetInstanceMetricData
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse GetInstanceMetricData)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe [MetricDatapoint]
-> Maybe InstanceMetricName -> Int -> GetInstanceMetricDataResponse
GetInstanceMetricDataResponse'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"metricData" forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty)
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"metricName")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance Prelude.Hashable GetInstanceMetricData where
  hashWithSalt :: Int -> GetInstanceMetricData -> Int
hashWithSalt Int
_salt GetInstanceMetricData' {Natural
[MetricStatistic]
Text
POSIX
InstanceMetricName
MetricUnit
statistics :: [MetricStatistic]
unit :: MetricUnit
endTime :: POSIX
startTime :: POSIX
period :: Natural
metricName :: InstanceMetricName
instanceName :: Text
$sel:statistics:GetInstanceMetricData' :: GetInstanceMetricData -> [MetricStatistic]
$sel:unit:GetInstanceMetricData' :: GetInstanceMetricData -> MetricUnit
$sel:endTime:GetInstanceMetricData' :: GetInstanceMetricData -> POSIX
$sel:startTime:GetInstanceMetricData' :: GetInstanceMetricData -> POSIX
$sel:period:GetInstanceMetricData' :: GetInstanceMetricData -> Natural
$sel:metricName:GetInstanceMetricData' :: GetInstanceMetricData -> InstanceMetricName
$sel:instanceName:GetInstanceMetricData' :: GetInstanceMetricData -> Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
instanceName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` InstanceMetricName
metricName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Natural
period
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` POSIX
startTime
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` POSIX
endTime
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` MetricUnit
unit
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` [MetricStatistic]
statistics

instance Prelude.NFData GetInstanceMetricData where
  rnf :: GetInstanceMetricData -> ()
rnf GetInstanceMetricData' {Natural
[MetricStatistic]
Text
POSIX
InstanceMetricName
MetricUnit
statistics :: [MetricStatistic]
unit :: MetricUnit
endTime :: POSIX
startTime :: POSIX
period :: Natural
metricName :: InstanceMetricName
instanceName :: Text
$sel:statistics:GetInstanceMetricData' :: GetInstanceMetricData -> [MetricStatistic]
$sel:unit:GetInstanceMetricData' :: GetInstanceMetricData -> MetricUnit
$sel:endTime:GetInstanceMetricData' :: GetInstanceMetricData -> POSIX
$sel:startTime:GetInstanceMetricData' :: GetInstanceMetricData -> POSIX
$sel:period:GetInstanceMetricData' :: GetInstanceMetricData -> Natural
$sel:metricName:GetInstanceMetricData' :: GetInstanceMetricData -> InstanceMetricName
$sel:instanceName:GetInstanceMetricData' :: GetInstanceMetricData -> Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Text
instanceName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf InstanceMetricName
metricName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Natural
period
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf POSIX
startTime
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf POSIX
endTime
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf MetricUnit
unit
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf [MetricStatistic]
statistics

instance Data.ToHeaders GetInstanceMetricData where
  toHeaders :: GetInstanceMetricData -> ResponseHeaders
toHeaders =
    forall a b. a -> b -> a
Prelude.const
      ( forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"X-Amz-Target"
              forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"Lightsail_20161128.GetInstanceMetricData" ::
                          Prelude.ByteString
                      ),
            HeaderName
"Content-Type"
              forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Data.ToJSON GetInstanceMetricData where
  toJSON :: GetInstanceMetricData -> Value
toJSON GetInstanceMetricData' {Natural
[MetricStatistic]
Text
POSIX
InstanceMetricName
MetricUnit
statistics :: [MetricStatistic]
unit :: MetricUnit
endTime :: POSIX
startTime :: POSIX
period :: Natural
metricName :: InstanceMetricName
instanceName :: Text
$sel:statistics:GetInstanceMetricData' :: GetInstanceMetricData -> [MetricStatistic]
$sel:unit:GetInstanceMetricData' :: GetInstanceMetricData -> MetricUnit
$sel:endTime:GetInstanceMetricData' :: GetInstanceMetricData -> POSIX
$sel:startTime:GetInstanceMetricData' :: GetInstanceMetricData -> POSIX
$sel:period:GetInstanceMetricData' :: GetInstanceMetricData -> Natural
$sel:metricName:GetInstanceMetricData' :: GetInstanceMetricData -> InstanceMetricName
$sel:instanceName:GetInstanceMetricData' :: GetInstanceMetricData -> Text
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ forall a. a -> Maybe a
Prelude.Just (Key
"instanceName" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
instanceName),
            forall a. a -> Maybe a
Prelude.Just (Key
"metricName" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= InstanceMetricName
metricName),
            forall a. a -> Maybe a
Prelude.Just (Key
"period" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Natural
period),
            forall a. a -> Maybe a
Prelude.Just (Key
"startTime" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= POSIX
startTime),
            forall a. a -> Maybe a
Prelude.Just (Key
"endTime" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= POSIX
endTime),
            forall a. a -> Maybe a
Prelude.Just (Key
"unit" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= MetricUnit
unit),
            forall a. a -> Maybe a
Prelude.Just (Key
"statistics" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= [MetricStatistic]
statistics)
          ]
      )

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

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

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

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

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

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

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

instance Prelude.NFData GetInstanceMetricDataResponse where
  rnf :: GetInstanceMetricDataResponse -> ()
rnf GetInstanceMetricDataResponse' {Int
Maybe [MetricDatapoint]
Maybe InstanceMetricName
httpStatus :: Int
metricName :: Maybe InstanceMetricName
metricData :: Maybe [MetricDatapoint]
$sel:httpStatus:GetInstanceMetricDataResponse' :: GetInstanceMetricDataResponse -> Int
$sel:metricName:GetInstanceMetricDataResponse' :: GetInstanceMetricDataResponse -> Maybe InstanceMetricName
$sel:metricData:GetInstanceMetricDataResponse' :: GetInstanceMetricDataResponse -> Maybe [MetricDatapoint]
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe [MetricDatapoint]
metricData
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe InstanceMetricName
metricName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus