{-# 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.GetLoadBalancerMetricData
-- 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 information about health metrics for your Lightsail load
-- balancer.
--
-- 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.GetLoadBalancerMetricData
  ( -- * Creating a Request
    GetLoadBalancerMetricData (..),
    newGetLoadBalancerMetricData,

    -- * Request Lenses
    getLoadBalancerMetricData_loadBalancerName,
    getLoadBalancerMetricData_metricName,
    getLoadBalancerMetricData_period,
    getLoadBalancerMetricData_startTime,
    getLoadBalancerMetricData_endTime,
    getLoadBalancerMetricData_unit,
    getLoadBalancerMetricData_statistics,

    -- * Destructuring the Response
    GetLoadBalancerMetricDataResponse (..),
    newGetLoadBalancerMetricDataResponse,

    -- * Response Lenses
    getLoadBalancerMetricDataResponse_metricData,
    getLoadBalancerMetricDataResponse_metricName,
    getLoadBalancerMetricDataResponse_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:/ 'newGetLoadBalancerMetricData' smart constructor.
data GetLoadBalancerMetricData = GetLoadBalancerMetricData'
  { -- | The name of the load balancer.
    GetLoadBalancerMetricData -> Text
loadBalancerName :: Prelude.Text,
    -- | The metric for which you want to return information.
    --
    -- Valid load balancer metric names are listed below, along with the most
    -- useful @statistics@ to include in your request, and the published @unit@
    -- value.
    --
    -- -   __@ClientTLSNegotiationErrorCount@__ - The number of TLS connections
    --     initiated by the client that did not establish a session with the
    --     load balancer due to a TLS error generated by the load balancer.
    --     Possible causes include a mismatch of ciphers or protocols.
    --
    --     @Statistics@: The most useful statistic is @Sum@.
    --
    --     @Unit@: The published unit is @Count@.
    --
    -- -   __@HealthyHostCount@__ - The number of target instances that are
    --     considered healthy.
    --
    --     @Statistics@: The most useful statistic are @Average@, @Minimum@,
    --     and @Maximum@.
    --
    --     @Unit@: The published unit is @Count@.
    --
    -- -   __@HTTPCode_Instance_2XX_Count@__ - The number of HTTP 2XX response
    --     codes generated by the target instances. This does not include any
    --     response codes generated by the load balancer.
    --
    --     @Statistics@: The most useful statistic is @Sum@. Note that
    --     @Minimum@, @Maximum@, and @Average@ all return @1@.
    --
    --     @Unit@: The published unit is @Count@.
    --
    -- -   __@HTTPCode_Instance_3XX_Count@__ - The number of HTTP 3XX response
    --     codes generated by the target instances. This does not include any
    --     response codes generated by the load balancer.
    --
    --     @Statistics@: The most useful statistic is @Sum@. Note that
    --     @Minimum@, @Maximum@, and @Average@ all return @1@.
    --
    --     @Unit@: The published unit is @Count@.
    --
    -- -   __@HTTPCode_Instance_4XX_Count@__ - The number of HTTP 4XX response
    --     codes generated by the target instances. This does not include any
    --     response codes generated by the load balancer.
    --
    --     @Statistics@: The most useful statistic is @Sum@. Note that
    --     @Minimum@, @Maximum@, and @Average@ all return @1@.
    --
    --     @Unit@: The published unit is @Count@.
    --
    -- -   __@HTTPCode_Instance_5XX_Count@__ - The number of HTTP 5XX response
    --     codes generated by the target instances. This does not include any
    --     response codes generated by the load balancer.
    --
    --     @Statistics@: The most useful statistic is @Sum@. Note that
    --     @Minimum@, @Maximum@, and @Average@ all return @1@.
    --
    --     @Unit@: The published unit is @Count@.
    --
    -- -   __@HTTPCode_LB_4XX_Count@__ - The number of HTTP 4XX client error
    --     codes that originated from the load balancer. Client errors are
    --     generated when requests are malformed or incomplete. These requests
    --     were not received by the target instance. This count does not
    --     include response codes generated by the target instances.
    --
    --     @Statistics@: The most useful statistic is @Sum@. Note that
    --     @Minimum@, @Maximum@, and @Average@ all return @1@.
    --
    --     @Unit@: The published unit is @Count@.
    --
    -- -   __@HTTPCode_LB_5XX_Count@__ - The number of HTTP 5XX server error
    --     codes that originated from the load balancer. This does not include
    --     any response codes generated by the target instance. This metric is
    --     reported if there are no healthy instances attached to the load
    --     balancer, or if the request rate exceeds the capacity of the
    --     instances (spillover) or the load balancer.
    --
    --     @Statistics@: The most useful statistic is @Sum@. Note that
    --     @Minimum@, @Maximum@, and @Average@ all return @1@.
    --
    --     @Unit@: The published unit is @Count@.
    --
    -- -   __@InstanceResponseTime@__ - The time elapsed, in seconds, after the
    --     request leaves the load balancer until a response from the target
    --     instance is received.
    --
    --     @Statistics@: The most useful statistic is @Average@.
    --
    --     @Unit@: The published unit is @Seconds@.
    --
    -- -   __@RejectedConnectionCount@__ - The number of connections that were
    --     rejected because the load balancer had reached its maximum number of
    --     connections.
    --
    --     @Statistics@: The most useful statistic is @Sum@.
    --
    --     @Unit@: The published unit is @Count@.
    --
    -- -   __@RequestCount@__ - The number of requests processed over IPv4.
    --     This count includes only the requests with a response generated by a
    --     target instance of the load balancer.
    --
    --     @Statistics@: The most useful statistic is @Sum@. Note that
    --     @Minimum@, @Maximum@, and @Average@ all return @1@.
    --
    --     @Unit@: The published unit is @Count@.
    --
    -- -   __@UnhealthyHostCount@__ - The number of target instances that are
    --     considered unhealthy.
    --
    --     @Statistics@: The most useful statistic are @Average@, @Minimum@,
    --     and @Maximum@.
    --
    --     @Unit@: The published unit is @Count@.
    GetLoadBalancerMetricData -> LoadBalancerMetricName
metricName :: LoadBalancerMetricName,
    -- | The granularity, in seconds, of the returned data points.
    GetLoadBalancerMetricData -> Natural
period :: Prelude.Natural,
    -- | The start time of the period.
    GetLoadBalancerMetricData -> POSIX
startTime :: Data.POSIX,
    -- | The end time of the period.
    GetLoadBalancerMetricData -> POSIX
endTime :: Data.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.
    GetLoadBalancerMetricData -> 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.
    GetLoadBalancerMetricData -> [MetricStatistic]
statistics :: [MetricStatistic]
  }
  deriving (GetLoadBalancerMetricData -> GetLoadBalancerMetricData -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetLoadBalancerMetricData -> GetLoadBalancerMetricData -> Bool
$c/= :: GetLoadBalancerMetricData -> GetLoadBalancerMetricData -> Bool
== :: GetLoadBalancerMetricData -> GetLoadBalancerMetricData -> Bool
$c== :: GetLoadBalancerMetricData -> GetLoadBalancerMetricData -> Bool
Prelude.Eq, ReadPrec [GetLoadBalancerMetricData]
ReadPrec GetLoadBalancerMetricData
Int -> ReadS GetLoadBalancerMetricData
ReadS [GetLoadBalancerMetricData]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetLoadBalancerMetricData]
$creadListPrec :: ReadPrec [GetLoadBalancerMetricData]
readPrec :: ReadPrec GetLoadBalancerMetricData
$creadPrec :: ReadPrec GetLoadBalancerMetricData
readList :: ReadS [GetLoadBalancerMetricData]
$creadList :: ReadS [GetLoadBalancerMetricData]
readsPrec :: Int -> ReadS GetLoadBalancerMetricData
$creadsPrec :: Int -> ReadS GetLoadBalancerMetricData
Prelude.Read, Int -> GetLoadBalancerMetricData -> ShowS
[GetLoadBalancerMetricData] -> ShowS
GetLoadBalancerMetricData -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetLoadBalancerMetricData] -> ShowS
$cshowList :: [GetLoadBalancerMetricData] -> ShowS
show :: GetLoadBalancerMetricData -> String
$cshow :: GetLoadBalancerMetricData -> String
showsPrec :: Int -> GetLoadBalancerMetricData -> ShowS
$cshowsPrec :: Int -> GetLoadBalancerMetricData -> ShowS
Prelude.Show, forall x.
Rep GetLoadBalancerMetricData x -> GetLoadBalancerMetricData
forall x.
GetLoadBalancerMetricData -> Rep GetLoadBalancerMetricData x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetLoadBalancerMetricData x -> GetLoadBalancerMetricData
$cfrom :: forall x.
GetLoadBalancerMetricData -> Rep GetLoadBalancerMetricData x
Prelude.Generic)

-- |
-- Create a value of 'GetLoadBalancerMetricData' 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:
--
-- 'loadBalancerName', 'getLoadBalancerMetricData_loadBalancerName' - The name of the load balancer.
--
-- 'metricName', 'getLoadBalancerMetricData_metricName' - The metric for which you want to return information.
--
-- Valid load balancer metric names are listed below, along with the most
-- useful @statistics@ to include in your request, and the published @unit@
-- value.
--
-- -   __@ClientTLSNegotiationErrorCount@__ - The number of TLS connections
--     initiated by the client that did not establish a session with the
--     load balancer due to a TLS error generated by the load balancer.
--     Possible causes include a mismatch of ciphers or protocols.
--
--     @Statistics@: The most useful statistic is @Sum@.
--
--     @Unit@: The published unit is @Count@.
--
-- -   __@HealthyHostCount@__ - The number of target instances that are
--     considered healthy.
--
--     @Statistics@: The most useful statistic are @Average@, @Minimum@,
--     and @Maximum@.
--
--     @Unit@: The published unit is @Count@.
--
-- -   __@HTTPCode_Instance_2XX_Count@__ - The number of HTTP 2XX response
--     codes generated by the target instances. This does not include any
--     response codes generated by the load balancer.
--
--     @Statistics@: The most useful statistic is @Sum@. Note that
--     @Minimum@, @Maximum@, and @Average@ all return @1@.
--
--     @Unit@: The published unit is @Count@.
--
-- -   __@HTTPCode_Instance_3XX_Count@__ - The number of HTTP 3XX response
--     codes generated by the target instances. This does not include any
--     response codes generated by the load balancer.
--
--     @Statistics@: The most useful statistic is @Sum@. Note that
--     @Minimum@, @Maximum@, and @Average@ all return @1@.
--
--     @Unit@: The published unit is @Count@.
--
-- -   __@HTTPCode_Instance_4XX_Count@__ - The number of HTTP 4XX response
--     codes generated by the target instances. This does not include any
--     response codes generated by the load balancer.
--
--     @Statistics@: The most useful statistic is @Sum@. Note that
--     @Minimum@, @Maximum@, and @Average@ all return @1@.
--
--     @Unit@: The published unit is @Count@.
--
-- -   __@HTTPCode_Instance_5XX_Count@__ - The number of HTTP 5XX response
--     codes generated by the target instances. This does not include any
--     response codes generated by the load balancer.
--
--     @Statistics@: The most useful statistic is @Sum@. Note that
--     @Minimum@, @Maximum@, and @Average@ all return @1@.
--
--     @Unit@: The published unit is @Count@.
--
-- -   __@HTTPCode_LB_4XX_Count@__ - The number of HTTP 4XX client error
--     codes that originated from the load balancer. Client errors are
--     generated when requests are malformed or incomplete. These requests
--     were not received by the target instance. This count does not
--     include response codes generated by the target instances.
--
--     @Statistics@: The most useful statistic is @Sum@. Note that
--     @Minimum@, @Maximum@, and @Average@ all return @1@.
--
--     @Unit@: The published unit is @Count@.
--
-- -   __@HTTPCode_LB_5XX_Count@__ - The number of HTTP 5XX server error
--     codes that originated from the load balancer. This does not include
--     any response codes generated by the target instance. This metric is
--     reported if there are no healthy instances attached to the load
--     balancer, or if the request rate exceeds the capacity of the
--     instances (spillover) or the load balancer.
--
--     @Statistics@: The most useful statistic is @Sum@. Note that
--     @Minimum@, @Maximum@, and @Average@ all return @1@.
--
--     @Unit@: The published unit is @Count@.
--
-- -   __@InstanceResponseTime@__ - The time elapsed, in seconds, after the
--     request leaves the load balancer until a response from the target
--     instance is received.
--
--     @Statistics@: The most useful statistic is @Average@.
--
--     @Unit@: The published unit is @Seconds@.
--
-- -   __@RejectedConnectionCount@__ - The number of connections that were
--     rejected because the load balancer had reached its maximum number of
--     connections.
--
--     @Statistics@: The most useful statistic is @Sum@.
--
--     @Unit@: The published unit is @Count@.
--
-- -   __@RequestCount@__ - The number of requests processed over IPv4.
--     This count includes only the requests with a response generated by a
--     target instance of the load balancer.
--
--     @Statistics@: The most useful statistic is @Sum@. Note that
--     @Minimum@, @Maximum@, and @Average@ all return @1@.
--
--     @Unit@: The published unit is @Count@.
--
-- -   __@UnhealthyHostCount@__ - The number of target instances that are
--     considered unhealthy.
--
--     @Statistics@: The most useful statistic are @Average@, @Minimum@,
--     and @Maximum@.
--
--     @Unit@: The published unit is @Count@.
--
-- 'period', 'getLoadBalancerMetricData_period' - The granularity, in seconds, of the returned data points.
--
-- 'startTime', 'getLoadBalancerMetricData_startTime' - The start time of the period.
--
-- 'endTime', 'getLoadBalancerMetricData_endTime' - The end time of the period.
--
-- 'unit', 'getLoadBalancerMetricData_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', 'getLoadBalancerMetricData_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.
newGetLoadBalancerMetricData ::
  -- | 'loadBalancerName'
  Prelude.Text ->
  -- | 'metricName'
  LoadBalancerMetricName ->
  -- | 'period'
  Prelude.Natural ->
  -- | 'startTime'
  Prelude.UTCTime ->
  -- | 'endTime'
  Prelude.UTCTime ->
  -- | 'unit'
  MetricUnit ->
  GetLoadBalancerMetricData
newGetLoadBalancerMetricData :: Text
-> LoadBalancerMetricName
-> Natural
-> UTCTime
-> UTCTime
-> MetricUnit
-> GetLoadBalancerMetricData
newGetLoadBalancerMetricData
  Text
pLoadBalancerName_
  LoadBalancerMetricName
pMetricName_
  Natural
pPeriod_
  UTCTime
pStartTime_
  UTCTime
pEndTime_
  MetricUnit
pUnit_ =
    GetLoadBalancerMetricData'
      { $sel:loadBalancerName:GetLoadBalancerMetricData' :: Text
loadBalancerName =
          Text
pLoadBalancerName_,
        $sel:metricName:GetLoadBalancerMetricData' :: LoadBalancerMetricName
metricName = LoadBalancerMetricName
pMetricName_,
        $sel:period:GetLoadBalancerMetricData' :: Natural
period = Natural
pPeriod_,
        $sel:startTime:GetLoadBalancerMetricData' :: POSIX
startTime = forall (a :: Format). Iso' (Time a) UTCTime
Data._Time forall t b. AReview t b -> b -> t
Lens.# UTCTime
pStartTime_,
        $sel:endTime:GetLoadBalancerMetricData' :: POSIX
endTime = forall (a :: Format). Iso' (Time a) UTCTime
Data._Time forall t b. AReview t b -> b -> t
Lens.# UTCTime
pEndTime_,
        $sel:unit:GetLoadBalancerMetricData' :: MetricUnit
unit = MetricUnit
pUnit_,
        $sel:statistics:GetLoadBalancerMetricData' :: [MetricStatistic]
statistics = forall a. Monoid a => a
Prelude.mempty
      }

-- | The name of the load balancer.
getLoadBalancerMetricData_loadBalancerName :: Lens.Lens' GetLoadBalancerMetricData Prelude.Text
getLoadBalancerMetricData_loadBalancerName :: Lens' GetLoadBalancerMetricData Text
getLoadBalancerMetricData_loadBalancerName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetLoadBalancerMetricData' {Text
loadBalancerName :: Text
$sel:loadBalancerName:GetLoadBalancerMetricData' :: GetLoadBalancerMetricData -> Text
loadBalancerName} -> Text
loadBalancerName) (\s :: GetLoadBalancerMetricData
s@GetLoadBalancerMetricData' {} Text
a -> GetLoadBalancerMetricData
s {$sel:loadBalancerName:GetLoadBalancerMetricData' :: Text
loadBalancerName = Text
a} :: GetLoadBalancerMetricData)

-- | The metric for which you want to return information.
--
-- Valid load balancer metric names are listed below, along with the most
-- useful @statistics@ to include in your request, and the published @unit@
-- value.
--
-- -   __@ClientTLSNegotiationErrorCount@__ - The number of TLS connections
--     initiated by the client that did not establish a session with the
--     load balancer due to a TLS error generated by the load balancer.
--     Possible causes include a mismatch of ciphers or protocols.
--
--     @Statistics@: The most useful statistic is @Sum@.
--
--     @Unit@: The published unit is @Count@.
--
-- -   __@HealthyHostCount@__ - The number of target instances that are
--     considered healthy.
--
--     @Statistics@: The most useful statistic are @Average@, @Minimum@,
--     and @Maximum@.
--
--     @Unit@: The published unit is @Count@.
--
-- -   __@HTTPCode_Instance_2XX_Count@__ - The number of HTTP 2XX response
--     codes generated by the target instances. This does not include any
--     response codes generated by the load balancer.
--
--     @Statistics@: The most useful statistic is @Sum@. Note that
--     @Minimum@, @Maximum@, and @Average@ all return @1@.
--
--     @Unit@: The published unit is @Count@.
--
-- -   __@HTTPCode_Instance_3XX_Count@__ - The number of HTTP 3XX response
--     codes generated by the target instances. This does not include any
--     response codes generated by the load balancer.
--
--     @Statistics@: The most useful statistic is @Sum@. Note that
--     @Minimum@, @Maximum@, and @Average@ all return @1@.
--
--     @Unit@: The published unit is @Count@.
--
-- -   __@HTTPCode_Instance_4XX_Count@__ - The number of HTTP 4XX response
--     codes generated by the target instances. This does not include any
--     response codes generated by the load balancer.
--
--     @Statistics@: The most useful statistic is @Sum@. Note that
--     @Minimum@, @Maximum@, and @Average@ all return @1@.
--
--     @Unit@: The published unit is @Count@.
--
-- -   __@HTTPCode_Instance_5XX_Count@__ - The number of HTTP 5XX response
--     codes generated by the target instances. This does not include any
--     response codes generated by the load balancer.
--
--     @Statistics@: The most useful statistic is @Sum@. Note that
--     @Minimum@, @Maximum@, and @Average@ all return @1@.
--
--     @Unit@: The published unit is @Count@.
--
-- -   __@HTTPCode_LB_4XX_Count@__ - The number of HTTP 4XX client error
--     codes that originated from the load balancer. Client errors are
--     generated when requests are malformed or incomplete. These requests
--     were not received by the target instance. This count does not
--     include response codes generated by the target instances.
--
--     @Statistics@: The most useful statistic is @Sum@. Note that
--     @Minimum@, @Maximum@, and @Average@ all return @1@.
--
--     @Unit@: The published unit is @Count@.
--
-- -   __@HTTPCode_LB_5XX_Count@__ - The number of HTTP 5XX server error
--     codes that originated from the load balancer. This does not include
--     any response codes generated by the target instance. This metric is
--     reported if there are no healthy instances attached to the load
--     balancer, or if the request rate exceeds the capacity of the
--     instances (spillover) or the load balancer.
--
--     @Statistics@: The most useful statistic is @Sum@. Note that
--     @Minimum@, @Maximum@, and @Average@ all return @1@.
--
--     @Unit@: The published unit is @Count@.
--
-- -   __@InstanceResponseTime@__ - The time elapsed, in seconds, after the
--     request leaves the load balancer until a response from the target
--     instance is received.
--
--     @Statistics@: The most useful statistic is @Average@.
--
--     @Unit@: The published unit is @Seconds@.
--
-- -   __@RejectedConnectionCount@__ - The number of connections that were
--     rejected because the load balancer had reached its maximum number of
--     connections.
--
--     @Statistics@: The most useful statistic is @Sum@.
--
--     @Unit@: The published unit is @Count@.
--
-- -   __@RequestCount@__ - The number of requests processed over IPv4.
--     This count includes only the requests with a response generated by a
--     target instance of the load balancer.
--
--     @Statistics@: The most useful statistic is @Sum@. Note that
--     @Minimum@, @Maximum@, and @Average@ all return @1@.
--
--     @Unit@: The published unit is @Count@.
--
-- -   __@UnhealthyHostCount@__ - The number of target instances that are
--     considered unhealthy.
--
--     @Statistics@: The most useful statistic are @Average@, @Minimum@,
--     and @Maximum@.
--
--     @Unit@: The published unit is @Count@.
getLoadBalancerMetricData_metricName :: Lens.Lens' GetLoadBalancerMetricData LoadBalancerMetricName
getLoadBalancerMetricData_metricName :: Lens' GetLoadBalancerMetricData LoadBalancerMetricName
getLoadBalancerMetricData_metricName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetLoadBalancerMetricData' {LoadBalancerMetricName
metricName :: LoadBalancerMetricName
$sel:metricName:GetLoadBalancerMetricData' :: GetLoadBalancerMetricData -> LoadBalancerMetricName
metricName} -> LoadBalancerMetricName
metricName) (\s :: GetLoadBalancerMetricData
s@GetLoadBalancerMetricData' {} LoadBalancerMetricName
a -> GetLoadBalancerMetricData
s {$sel:metricName:GetLoadBalancerMetricData' :: LoadBalancerMetricName
metricName = LoadBalancerMetricName
a} :: GetLoadBalancerMetricData)

-- | The granularity, in seconds, of the returned data points.
getLoadBalancerMetricData_period :: Lens.Lens' GetLoadBalancerMetricData Prelude.Natural
getLoadBalancerMetricData_period :: Lens' GetLoadBalancerMetricData Natural
getLoadBalancerMetricData_period = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetLoadBalancerMetricData' {Natural
period :: Natural
$sel:period:GetLoadBalancerMetricData' :: GetLoadBalancerMetricData -> Natural
period} -> Natural
period) (\s :: GetLoadBalancerMetricData
s@GetLoadBalancerMetricData' {} Natural
a -> GetLoadBalancerMetricData
s {$sel:period:GetLoadBalancerMetricData' :: Natural
period = Natural
a} :: GetLoadBalancerMetricData)

-- | The start time of the period.
getLoadBalancerMetricData_startTime :: Lens.Lens' GetLoadBalancerMetricData Prelude.UTCTime
getLoadBalancerMetricData_startTime :: Lens' GetLoadBalancerMetricData UTCTime
getLoadBalancerMetricData_startTime = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetLoadBalancerMetricData' {POSIX
startTime :: POSIX
$sel:startTime:GetLoadBalancerMetricData' :: GetLoadBalancerMetricData -> POSIX
startTime} -> POSIX
startTime) (\s :: GetLoadBalancerMetricData
s@GetLoadBalancerMetricData' {} POSIX
a -> GetLoadBalancerMetricData
s {$sel:startTime:GetLoadBalancerMetricData' :: POSIX
startTime = POSIX
a} :: GetLoadBalancerMetricData) 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 period.
getLoadBalancerMetricData_endTime :: Lens.Lens' GetLoadBalancerMetricData Prelude.UTCTime
getLoadBalancerMetricData_endTime :: Lens' GetLoadBalancerMetricData UTCTime
getLoadBalancerMetricData_endTime = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetLoadBalancerMetricData' {POSIX
endTime :: POSIX
$sel:endTime:GetLoadBalancerMetricData' :: GetLoadBalancerMetricData -> POSIX
endTime} -> POSIX
endTime) (\s :: GetLoadBalancerMetricData
s@GetLoadBalancerMetricData' {} POSIX
a -> GetLoadBalancerMetricData
s {$sel:endTime:GetLoadBalancerMetricData' :: POSIX
endTime = POSIX
a} :: GetLoadBalancerMetricData) 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 with each available metric,
-- see the @metricName@ parameter.
getLoadBalancerMetricData_unit :: Lens.Lens' GetLoadBalancerMetricData MetricUnit
getLoadBalancerMetricData_unit :: Lens' GetLoadBalancerMetricData MetricUnit
getLoadBalancerMetricData_unit = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetLoadBalancerMetricData' {MetricUnit
unit :: MetricUnit
$sel:unit:GetLoadBalancerMetricData' :: GetLoadBalancerMetricData -> MetricUnit
unit} -> MetricUnit
unit) (\s :: GetLoadBalancerMetricData
s@GetLoadBalancerMetricData' {} MetricUnit
a -> GetLoadBalancerMetricData
s {$sel:unit:GetLoadBalancerMetricData' :: MetricUnit
unit = MetricUnit
a} :: GetLoadBalancerMetricData)

-- | 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.
getLoadBalancerMetricData_statistics :: Lens.Lens' GetLoadBalancerMetricData [MetricStatistic]
getLoadBalancerMetricData_statistics :: Lens' GetLoadBalancerMetricData [MetricStatistic]
getLoadBalancerMetricData_statistics = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetLoadBalancerMetricData' {[MetricStatistic]
statistics :: [MetricStatistic]
$sel:statistics:GetLoadBalancerMetricData' :: GetLoadBalancerMetricData -> [MetricStatistic]
statistics} -> [MetricStatistic]
statistics) (\s :: GetLoadBalancerMetricData
s@GetLoadBalancerMetricData' {} [MetricStatistic]
a -> GetLoadBalancerMetricData
s {$sel:statistics:GetLoadBalancerMetricData' :: [MetricStatistic]
statistics = [MetricStatistic]
a} :: GetLoadBalancerMetricData) 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 GetLoadBalancerMetricData where
  type
    AWSResponse GetLoadBalancerMetricData =
      GetLoadBalancerMetricDataResponse
  request :: (Service -> Service)
-> GetLoadBalancerMetricData -> Request GetLoadBalancerMetricData
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 GetLoadBalancerMetricData
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse GetLoadBalancerMetricData)))
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 LoadBalancerMetricName
-> Int
-> GetLoadBalancerMetricDataResponse
GetLoadBalancerMetricDataResponse'
            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 GetLoadBalancerMetricData where
  hashWithSalt :: Int -> GetLoadBalancerMetricData -> Int
hashWithSalt Int
_salt GetLoadBalancerMetricData' {Natural
[MetricStatistic]
Text
POSIX
LoadBalancerMetricName
MetricUnit
statistics :: [MetricStatistic]
unit :: MetricUnit
endTime :: POSIX
startTime :: POSIX
period :: Natural
metricName :: LoadBalancerMetricName
loadBalancerName :: Text
$sel:statistics:GetLoadBalancerMetricData' :: GetLoadBalancerMetricData -> [MetricStatistic]
$sel:unit:GetLoadBalancerMetricData' :: GetLoadBalancerMetricData -> MetricUnit
$sel:endTime:GetLoadBalancerMetricData' :: GetLoadBalancerMetricData -> POSIX
$sel:startTime:GetLoadBalancerMetricData' :: GetLoadBalancerMetricData -> POSIX
$sel:period:GetLoadBalancerMetricData' :: GetLoadBalancerMetricData -> Natural
$sel:metricName:GetLoadBalancerMetricData' :: GetLoadBalancerMetricData -> LoadBalancerMetricName
$sel:loadBalancerName:GetLoadBalancerMetricData' :: GetLoadBalancerMetricData -> Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
loadBalancerName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` LoadBalancerMetricName
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 GetLoadBalancerMetricData where
  rnf :: GetLoadBalancerMetricData -> ()
rnf GetLoadBalancerMetricData' {Natural
[MetricStatistic]
Text
POSIX
LoadBalancerMetricName
MetricUnit
statistics :: [MetricStatistic]
unit :: MetricUnit
endTime :: POSIX
startTime :: POSIX
period :: Natural
metricName :: LoadBalancerMetricName
loadBalancerName :: Text
$sel:statistics:GetLoadBalancerMetricData' :: GetLoadBalancerMetricData -> [MetricStatistic]
$sel:unit:GetLoadBalancerMetricData' :: GetLoadBalancerMetricData -> MetricUnit
$sel:endTime:GetLoadBalancerMetricData' :: GetLoadBalancerMetricData -> POSIX
$sel:startTime:GetLoadBalancerMetricData' :: GetLoadBalancerMetricData -> POSIX
$sel:period:GetLoadBalancerMetricData' :: GetLoadBalancerMetricData -> Natural
$sel:metricName:GetLoadBalancerMetricData' :: GetLoadBalancerMetricData -> LoadBalancerMetricName
$sel:loadBalancerName:GetLoadBalancerMetricData' :: GetLoadBalancerMetricData -> Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Text
loadBalancerName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf LoadBalancerMetricName
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 GetLoadBalancerMetricData where
  toHeaders :: GetLoadBalancerMetricData -> 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.GetLoadBalancerMetricData" ::
                          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 GetLoadBalancerMetricData where
  toJSON :: GetLoadBalancerMetricData -> Value
toJSON GetLoadBalancerMetricData' {Natural
[MetricStatistic]
Text
POSIX
LoadBalancerMetricName
MetricUnit
statistics :: [MetricStatistic]
unit :: MetricUnit
endTime :: POSIX
startTime :: POSIX
period :: Natural
metricName :: LoadBalancerMetricName
loadBalancerName :: Text
$sel:statistics:GetLoadBalancerMetricData' :: GetLoadBalancerMetricData -> [MetricStatistic]
$sel:unit:GetLoadBalancerMetricData' :: GetLoadBalancerMetricData -> MetricUnit
$sel:endTime:GetLoadBalancerMetricData' :: GetLoadBalancerMetricData -> POSIX
$sel:startTime:GetLoadBalancerMetricData' :: GetLoadBalancerMetricData -> POSIX
$sel:period:GetLoadBalancerMetricData' :: GetLoadBalancerMetricData -> Natural
$sel:metricName:GetLoadBalancerMetricData' :: GetLoadBalancerMetricData -> LoadBalancerMetricName
$sel:loadBalancerName:GetLoadBalancerMetricData' :: GetLoadBalancerMetricData -> Text
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ forall a. a -> Maybe a
Prelude.Just
              (Key
"loadBalancerName" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
loadBalancerName),
            forall a. a -> Maybe a
Prelude.Just (Key
"metricName" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= LoadBalancerMetricName
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 GetLoadBalancerMetricData where
  toPath :: GetLoadBalancerMetricData -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"

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

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

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

-- | An array of objects that describe the metric data returned.
getLoadBalancerMetricDataResponse_metricData :: Lens.Lens' GetLoadBalancerMetricDataResponse (Prelude.Maybe [MetricDatapoint])
getLoadBalancerMetricDataResponse_metricData :: Lens' GetLoadBalancerMetricDataResponse (Maybe [MetricDatapoint])
getLoadBalancerMetricDataResponse_metricData = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetLoadBalancerMetricDataResponse' {Maybe [MetricDatapoint]
metricData :: Maybe [MetricDatapoint]
$sel:metricData:GetLoadBalancerMetricDataResponse' :: GetLoadBalancerMetricDataResponse -> Maybe [MetricDatapoint]
metricData} -> Maybe [MetricDatapoint]
metricData) (\s :: GetLoadBalancerMetricDataResponse
s@GetLoadBalancerMetricDataResponse' {} Maybe [MetricDatapoint]
a -> GetLoadBalancerMetricDataResponse
s {$sel:metricData:GetLoadBalancerMetricDataResponse' :: Maybe [MetricDatapoint]
metricData = Maybe [MetricDatapoint]
a} :: GetLoadBalancerMetricDataResponse) 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.
getLoadBalancerMetricDataResponse_metricName :: Lens.Lens' GetLoadBalancerMetricDataResponse (Prelude.Maybe LoadBalancerMetricName)
getLoadBalancerMetricDataResponse_metricName :: Lens'
  GetLoadBalancerMetricDataResponse (Maybe LoadBalancerMetricName)
getLoadBalancerMetricDataResponse_metricName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetLoadBalancerMetricDataResponse' {Maybe LoadBalancerMetricName
metricName :: Maybe LoadBalancerMetricName
$sel:metricName:GetLoadBalancerMetricDataResponse' :: GetLoadBalancerMetricDataResponse -> Maybe LoadBalancerMetricName
metricName} -> Maybe LoadBalancerMetricName
metricName) (\s :: GetLoadBalancerMetricDataResponse
s@GetLoadBalancerMetricDataResponse' {} Maybe LoadBalancerMetricName
a -> GetLoadBalancerMetricDataResponse
s {$sel:metricName:GetLoadBalancerMetricDataResponse' :: Maybe LoadBalancerMetricName
metricName = Maybe LoadBalancerMetricName
a} :: GetLoadBalancerMetricDataResponse)

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

instance
  Prelude.NFData
    GetLoadBalancerMetricDataResponse
  where
  rnf :: GetLoadBalancerMetricDataResponse -> ()
rnf GetLoadBalancerMetricDataResponse' {Int
Maybe [MetricDatapoint]
Maybe LoadBalancerMetricName
httpStatus :: Int
metricName :: Maybe LoadBalancerMetricName
metricData :: Maybe [MetricDatapoint]
$sel:httpStatus:GetLoadBalancerMetricDataResponse' :: GetLoadBalancerMetricDataResponse -> Int
$sel:metricName:GetLoadBalancerMetricDataResponse' :: GetLoadBalancerMetricDataResponse -> Maybe LoadBalancerMetricName
$sel:metricData:GetLoadBalancerMetricDataResponse' :: GetLoadBalancerMetricDataResponse -> 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 LoadBalancerMetricName
metricName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus