{-# 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 #-}
module Amazonka.CloudWatch.GetMetricStatistics
(
GetMetricStatistics (..),
newGetMetricStatistics,
getMetricStatistics_dimensions,
getMetricStatistics_extendedStatistics,
getMetricStatistics_statistics,
getMetricStatistics_unit,
getMetricStatistics_namespace,
getMetricStatistics_metricName,
getMetricStatistics_startTime,
getMetricStatistics_endTime,
getMetricStatistics_period,
GetMetricStatisticsResponse (..),
newGetMetricStatisticsResponse,
getMetricStatisticsResponse_datapoints,
getMetricStatisticsResponse_label,
getMetricStatisticsResponse_httpStatus,
)
where
import Amazonka.CloudWatch.Types
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data GetMetricStatistics = GetMetricStatistics'
{
GetMetricStatistics -> Maybe [Dimension]
dimensions :: Prelude.Maybe [Dimension],
GetMetricStatistics -> Maybe (NonEmpty Text)
extendedStatistics :: Prelude.Maybe (Prelude.NonEmpty Prelude.Text),
GetMetricStatistics -> Maybe (NonEmpty Statistic)
statistics :: Prelude.Maybe (Prelude.NonEmpty Statistic),
GetMetricStatistics -> Maybe StandardUnit
unit :: Prelude.Maybe StandardUnit,
GetMetricStatistics -> Text
namespace :: Prelude.Text,
GetMetricStatistics -> Text
metricName :: Prelude.Text,
GetMetricStatistics -> ISO8601
startTime :: Data.ISO8601,
GetMetricStatistics -> ISO8601
endTime :: Data.ISO8601,
GetMetricStatistics -> Natural
period :: Prelude.Natural
}
deriving (GetMetricStatistics -> GetMetricStatistics -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetMetricStatistics -> GetMetricStatistics -> Bool
$c/= :: GetMetricStatistics -> GetMetricStatistics -> Bool
== :: GetMetricStatistics -> GetMetricStatistics -> Bool
$c== :: GetMetricStatistics -> GetMetricStatistics -> Bool
Prelude.Eq, ReadPrec [GetMetricStatistics]
ReadPrec GetMetricStatistics
Int -> ReadS GetMetricStatistics
ReadS [GetMetricStatistics]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetMetricStatistics]
$creadListPrec :: ReadPrec [GetMetricStatistics]
readPrec :: ReadPrec GetMetricStatistics
$creadPrec :: ReadPrec GetMetricStatistics
readList :: ReadS [GetMetricStatistics]
$creadList :: ReadS [GetMetricStatistics]
readsPrec :: Int -> ReadS GetMetricStatistics
$creadsPrec :: Int -> ReadS GetMetricStatistics
Prelude.Read, Int -> GetMetricStatistics -> ShowS
[GetMetricStatistics] -> ShowS
GetMetricStatistics -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetMetricStatistics] -> ShowS
$cshowList :: [GetMetricStatistics] -> ShowS
show :: GetMetricStatistics -> String
$cshow :: GetMetricStatistics -> String
showsPrec :: Int -> GetMetricStatistics -> ShowS
$cshowsPrec :: Int -> GetMetricStatistics -> ShowS
Prelude.Show, forall x. Rep GetMetricStatistics x -> GetMetricStatistics
forall x. GetMetricStatistics -> Rep GetMetricStatistics x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetMetricStatistics x -> GetMetricStatistics
$cfrom :: forall x. GetMetricStatistics -> Rep GetMetricStatistics x
Prelude.Generic)
newGetMetricStatistics ::
Prelude.Text ->
Prelude.Text ->
Prelude.UTCTime ->
Prelude.UTCTime ->
Prelude.Natural ->
GetMetricStatistics
newGetMetricStatistics :: Text
-> Text -> UTCTime -> UTCTime -> Natural -> GetMetricStatistics
newGetMetricStatistics
Text
pNamespace_
Text
pMetricName_
UTCTime
pStartTime_
UTCTime
pEndTime_
Natural
pPeriod_ =
GetMetricStatistics'
{ $sel:dimensions:GetMetricStatistics' :: Maybe [Dimension]
dimensions = forall a. Maybe a
Prelude.Nothing,
$sel:extendedStatistics:GetMetricStatistics' :: Maybe (NonEmpty Text)
extendedStatistics = forall a. Maybe a
Prelude.Nothing,
$sel:statistics:GetMetricStatistics' :: Maybe (NonEmpty Statistic)
statistics = forall a. Maybe a
Prelude.Nothing,
$sel:unit:GetMetricStatistics' :: Maybe StandardUnit
unit = forall a. Maybe a
Prelude.Nothing,
$sel:namespace:GetMetricStatistics' :: Text
namespace = Text
pNamespace_,
$sel:metricName:GetMetricStatistics' :: Text
metricName = Text
pMetricName_,
$sel:startTime:GetMetricStatistics' :: ISO8601
startTime = forall (a :: Format). Iso' (Time a) UTCTime
Data._Time forall t b. AReview t b -> b -> t
Lens.# UTCTime
pStartTime_,
$sel:endTime:GetMetricStatistics' :: ISO8601
endTime = forall (a :: Format). Iso' (Time a) UTCTime
Data._Time forall t b. AReview t b -> b -> t
Lens.# UTCTime
pEndTime_,
$sel:period:GetMetricStatistics' :: Natural
period = Natural
pPeriod_
}
getMetricStatistics_dimensions :: Lens.Lens' GetMetricStatistics (Prelude.Maybe [Dimension])
getMetricStatistics_dimensions :: Lens' GetMetricStatistics (Maybe [Dimension])
getMetricStatistics_dimensions = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetMetricStatistics' {Maybe [Dimension]
dimensions :: Maybe [Dimension]
$sel:dimensions:GetMetricStatistics' :: GetMetricStatistics -> Maybe [Dimension]
dimensions} -> Maybe [Dimension]
dimensions) (\s :: GetMetricStatistics
s@GetMetricStatistics' {} Maybe [Dimension]
a -> GetMetricStatistics
s {$sel:dimensions:GetMetricStatistics' :: Maybe [Dimension]
dimensions = Maybe [Dimension]
a} :: GetMetricStatistics) 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
getMetricStatistics_extendedStatistics :: Lens.Lens' GetMetricStatistics (Prelude.Maybe (Prelude.NonEmpty Prelude.Text))
getMetricStatistics_extendedStatistics :: Lens' GetMetricStatistics (Maybe (NonEmpty Text))
getMetricStatistics_extendedStatistics = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetMetricStatistics' {Maybe (NonEmpty Text)
extendedStatistics :: Maybe (NonEmpty Text)
$sel:extendedStatistics:GetMetricStatistics' :: GetMetricStatistics -> Maybe (NonEmpty Text)
extendedStatistics} -> Maybe (NonEmpty Text)
extendedStatistics) (\s :: GetMetricStatistics
s@GetMetricStatistics' {} Maybe (NonEmpty Text)
a -> GetMetricStatistics
s {$sel:extendedStatistics:GetMetricStatistics' :: Maybe (NonEmpty Text)
extendedStatistics = Maybe (NonEmpty Text)
a} :: GetMetricStatistics) 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
getMetricStatistics_statistics :: Lens.Lens' GetMetricStatistics (Prelude.Maybe (Prelude.NonEmpty Statistic))
getMetricStatistics_statistics :: Lens' GetMetricStatistics (Maybe (NonEmpty Statistic))
getMetricStatistics_statistics = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetMetricStatistics' {Maybe (NonEmpty Statistic)
statistics :: Maybe (NonEmpty Statistic)
$sel:statistics:GetMetricStatistics' :: GetMetricStatistics -> Maybe (NonEmpty Statistic)
statistics} -> Maybe (NonEmpty Statistic)
statistics) (\s :: GetMetricStatistics
s@GetMetricStatistics' {} Maybe (NonEmpty Statistic)
a -> GetMetricStatistics
s {$sel:statistics:GetMetricStatistics' :: Maybe (NonEmpty Statistic)
statistics = Maybe (NonEmpty Statistic)
a} :: GetMetricStatistics) 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
getMetricStatistics_unit :: Lens.Lens' GetMetricStatistics (Prelude.Maybe StandardUnit)
getMetricStatistics_unit :: Lens' GetMetricStatistics (Maybe StandardUnit)
getMetricStatistics_unit = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetMetricStatistics' {Maybe StandardUnit
unit :: Maybe StandardUnit
$sel:unit:GetMetricStatistics' :: GetMetricStatistics -> Maybe StandardUnit
unit} -> Maybe StandardUnit
unit) (\s :: GetMetricStatistics
s@GetMetricStatistics' {} Maybe StandardUnit
a -> GetMetricStatistics
s {$sel:unit:GetMetricStatistics' :: Maybe StandardUnit
unit = Maybe StandardUnit
a} :: GetMetricStatistics)
getMetricStatistics_namespace :: Lens.Lens' GetMetricStatistics Prelude.Text
getMetricStatistics_namespace :: Lens' GetMetricStatistics Text
getMetricStatistics_namespace = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetMetricStatistics' {Text
namespace :: Text
$sel:namespace:GetMetricStatistics' :: GetMetricStatistics -> Text
namespace} -> Text
namespace) (\s :: GetMetricStatistics
s@GetMetricStatistics' {} Text
a -> GetMetricStatistics
s {$sel:namespace:GetMetricStatistics' :: Text
namespace = Text
a} :: GetMetricStatistics)
getMetricStatistics_metricName :: Lens.Lens' GetMetricStatistics Prelude.Text
getMetricStatistics_metricName :: Lens' GetMetricStatistics Text
getMetricStatistics_metricName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetMetricStatistics' {Text
metricName :: Text
$sel:metricName:GetMetricStatistics' :: GetMetricStatistics -> Text
metricName} -> Text
metricName) (\s :: GetMetricStatistics
s@GetMetricStatistics' {} Text
a -> GetMetricStatistics
s {$sel:metricName:GetMetricStatistics' :: Text
metricName = Text
a} :: GetMetricStatistics)
getMetricStatistics_startTime :: Lens.Lens' GetMetricStatistics Prelude.UTCTime
getMetricStatistics_startTime :: Lens' GetMetricStatistics UTCTime
getMetricStatistics_startTime = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetMetricStatistics' {ISO8601
startTime :: ISO8601
$sel:startTime:GetMetricStatistics' :: GetMetricStatistics -> ISO8601
startTime} -> ISO8601
startTime) (\s :: GetMetricStatistics
s@GetMetricStatistics' {} ISO8601
a -> GetMetricStatistics
s {$sel:startTime:GetMetricStatistics' :: ISO8601
startTime = ISO8601
a} :: GetMetricStatistics) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (a :: Format). Iso' (Time a) UTCTime
Data._Time
getMetricStatistics_endTime :: Lens.Lens' GetMetricStatistics Prelude.UTCTime
getMetricStatistics_endTime :: Lens' GetMetricStatistics UTCTime
getMetricStatistics_endTime = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetMetricStatistics' {ISO8601
endTime :: ISO8601
$sel:endTime:GetMetricStatistics' :: GetMetricStatistics -> ISO8601
endTime} -> ISO8601
endTime) (\s :: GetMetricStatistics
s@GetMetricStatistics' {} ISO8601
a -> GetMetricStatistics
s {$sel:endTime:GetMetricStatistics' :: ISO8601
endTime = ISO8601
a} :: GetMetricStatistics) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (a :: Format). Iso' (Time a) UTCTime
Data._Time
getMetricStatistics_period :: Lens.Lens' GetMetricStatistics Prelude.Natural
getMetricStatistics_period :: Lens' GetMetricStatistics Natural
getMetricStatistics_period = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetMetricStatistics' {Natural
period :: Natural
$sel:period:GetMetricStatistics' :: GetMetricStatistics -> Natural
period} -> Natural
period) (\s :: GetMetricStatistics
s@GetMetricStatistics' {} Natural
a -> GetMetricStatistics
s {$sel:period:GetMetricStatistics' :: Natural
period = Natural
a} :: GetMetricStatistics)
instance Core.AWSRequest GetMetricStatistics where
type
AWSResponse GetMetricStatistics =
GetMetricStatisticsResponse
request :: (Service -> Service)
-> GetMetricStatistics -> Request GetMetricStatistics
request Service -> Service
overrides =
forall a. ToRequest a => Service -> a -> Request a
Request.postQuery (Service -> Service
overrides Service
defaultService)
response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy GetMetricStatistics
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse GetMetricStatistics)))
response =
forall (m :: * -> *) a.
MonadResource m =>
Text
-> (Int
-> ResponseHeaders -> [Node] -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveXMLWrapper
Text
"GetMetricStatisticsResult"
( \Int
s ResponseHeaders
h [Node]
x ->
Maybe [Datapoint]
-> Maybe Text -> Int -> GetMetricStatisticsResponse
GetMetricStatisticsResponse'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ( [Node]
x
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"Datapoints"
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
Prelude.>>= forall (f :: * -> *) a b.
Applicative f =>
([a] -> f b) -> [a] -> f (Maybe b)
Core.may (forall a. FromXML a => Text -> [Node] -> Either String [a]
Data.parseXMLList Text
"member")
)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"Label")
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 GetMetricStatistics where
hashWithSalt :: Int -> GetMetricStatistics -> Int
hashWithSalt Int
_salt GetMetricStatistics' {Natural
Maybe [Dimension]
Maybe (NonEmpty Text)
Maybe (NonEmpty Statistic)
Maybe StandardUnit
Text
ISO8601
period :: Natural
endTime :: ISO8601
startTime :: ISO8601
metricName :: Text
namespace :: Text
unit :: Maybe StandardUnit
statistics :: Maybe (NonEmpty Statistic)
extendedStatistics :: Maybe (NonEmpty Text)
dimensions :: Maybe [Dimension]
$sel:period:GetMetricStatistics' :: GetMetricStatistics -> Natural
$sel:endTime:GetMetricStatistics' :: GetMetricStatistics -> ISO8601
$sel:startTime:GetMetricStatistics' :: GetMetricStatistics -> ISO8601
$sel:metricName:GetMetricStatistics' :: GetMetricStatistics -> Text
$sel:namespace:GetMetricStatistics' :: GetMetricStatistics -> Text
$sel:unit:GetMetricStatistics' :: GetMetricStatistics -> Maybe StandardUnit
$sel:statistics:GetMetricStatistics' :: GetMetricStatistics -> Maybe (NonEmpty Statistic)
$sel:extendedStatistics:GetMetricStatistics' :: GetMetricStatistics -> Maybe (NonEmpty Text)
$sel:dimensions:GetMetricStatistics' :: GetMetricStatistics -> Maybe [Dimension]
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Dimension]
dimensions
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (NonEmpty Text)
extendedStatistics
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (NonEmpty Statistic)
statistics
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe StandardUnit
unit
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
namespace
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
metricName
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` ISO8601
startTime
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` ISO8601
endTime
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Natural
period
instance Prelude.NFData GetMetricStatistics where
rnf :: GetMetricStatistics -> ()
rnf GetMetricStatistics' {Natural
Maybe [Dimension]
Maybe (NonEmpty Text)
Maybe (NonEmpty Statistic)
Maybe StandardUnit
Text
ISO8601
period :: Natural
endTime :: ISO8601
startTime :: ISO8601
metricName :: Text
namespace :: Text
unit :: Maybe StandardUnit
statistics :: Maybe (NonEmpty Statistic)
extendedStatistics :: Maybe (NonEmpty Text)
dimensions :: Maybe [Dimension]
$sel:period:GetMetricStatistics' :: GetMetricStatistics -> Natural
$sel:endTime:GetMetricStatistics' :: GetMetricStatistics -> ISO8601
$sel:startTime:GetMetricStatistics' :: GetMetricStatistics -> ISO8601
$sel:metricName:GetMetricStatistics' :: GetMetricStatistics -> Text
$sel:namespace:GetMetricStatistics' :: GetMetricStatistics -> Text
$sel:unit:GetMetricStatistics' :: GetMetricStatistics -> Maybe StandardUnit
$sel:statistics:GetMetricStatistics' :: GetMetricStatistics -> Maybe (NonEmpty Statistic)
$sel:extendedStatistics:GetMetricStatistics' :: GetMetricStatistics -> Maybe (NonEmpty Text)
$sel:dimensions:GetMetricStatistics' :: GetMetricStatistics -> Maybe [Dimension]
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe [Dimension]
dimensions
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe (NonEmpty Text)
extendedStatistics
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe (NonEmpty Statistic)
statistics
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe StandardUnit
unit
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
namespace
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
metricName
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf ISO8601
startTime
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf ISO8601
endTime
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Natural
period
instance Data.ToHeaders GetMetricStatistics where
toHeaders :: GetMetricStatistics -> ResponseHeaders
toHeaders = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
instance Data.ToPath GetMetricStatistics where
toPath :: GetMetricStatistics -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Data.ToQuery GetMetricStatistics where
toQuery :: GetMetricStatistics -> QueryString
toQuery GetMetricStatistics' {Natural
Maybe [Dimension]
Maybe (NonEmpty Text)
Maybe (NonEmpty Statistic)
Maybe StandardUnit
Text
ISO8601
period :: Natural
endTime :: ISO8601
startTime :: ISO8601
metricName :: Text
namespace :: Text
unit :: Maybe StandardUnit
statistics :: Maybe (NonEmpty Statistic)
extendedStatistics :: Maybe (NonEmpty Text)
dimensions :: Maybe [Dimension]
$sel:period:GetMetricStatistics' :: GetMetricStatistics -> Natural
$sel:endTime:GetMetricStatistics' :: GetMetricStatistics -> ISO8601
$sel:startTime:GetMetricStatistics' :: GetMetricStatistics -> ISO8601
$sel:metricName:GetMetricStatistics' :: GetMetricStatistics -> Text
$sel:namespace:GetMetricStatistics' :: GetMetricStatistics -> Text
$sel:unit:GetMetricStatistics' :: GetMetricStatistics -> Maybe StandardUnit
$sel:statistics:GetMetricStatistics' :: GetMetricStatistics -> Maybe (NonEmpty Statistic)
$sel:extendedStatistics:GetMetricStatistics' :: GetMetricStatistics -> Maybe (NonEmpty Text)
$sel:dimensions:GetMetricStatistics' :: GetMetricStatistics -> Maybe [Dimension]
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"Action"
forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: (ByteString
"GetMetricStatistics" :: Prelude.ByteString),
ByteString
"Version"
forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: (ByteString
"2010-08-01" :: Prelude.ByteString),
ByteString
"Dimensions"
forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: forall a. ToQuery a => a -> QueryString
Data.toQuery
(forall a.
(IsList a, ToQuery (Item a)) =>
ByteString -> a -> QueryString
Data.toQueryList ByteString
"member" forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Dimension]
dimensions),
ByteString
"ExtendedStatistics"
forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: forall a. ToQuery a => a -> QueryString
Data.toQuery
( forall a.
(IsList a, ToQuery (Item a)) =>
ByteString -> a -> QueryString
Data.toQueryList ByteString
"member"
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (NonEmpty Text)
extendedStatistics
),
ByteString
"Statistics"
forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: forall a. ToQuery a => a -> QueryString
Data.toQuery
(forall a.
(IsList a, ToQuery (Item a)) =>
ByteString -> a -> QueryString
Data.toQueryList ByteString
"member" forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (NonEmpty Statistic)
statistics),
ByteString
"Unit" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe StandardUnit
unit,
ByteString
"Namespace" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Text
namespace,
ByteString
"MetricName" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Text
metricName,
ByteString
"StartTime" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: ISO8601
startTime,
ByteString
"EndTime" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: ISO8601
endTime,
ByteString
"Period" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Natural
period
]
data GetMetricStatisticsResponse = GetMetricStatisticsResponse'
{
GetMetricStatisticsResponse -> Maybe [Datapoint]
datapoints :: Prelude.Maybe [Datapoint],
GetMetricStatisticsResponse -> Maybe Text
label :: Prelude.Maybe Prelude.Text,
GetMetricStatisticsResponse -> Int
httpStatus :: Prelude.Int
}
deriving (GetMetricStatisticsResponse -> GetMetricStatisticsResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetMetricStatisticsResponse -> GetMetricStatisticsResponse -> Bool
$c/= :: GetMetricStatisticsResponse -> GetMetricStatisticsResponse -> Bool
== :: GetMetricStatisticsResponse -> GetMetricStatisticsResponse -> Bool
$c== :: GetMetricStatisticsResponse -> GetMetricStatisticsResponse -> Bool
Prelude.Eq, ReadPrec [GetMetricStatisticsResponse]
ReadPrec GetMetricStatisticsResponse
Int -> ReadS GetMetricStatisticsResponse
ReadS [GetMetricStatisticsResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetMetricStatisticsResponse]
$creadListPrec :: ReadPrec [GetMetricStatisticsResponse]
readPrec :: ReadPrec GetMetricStatisticsResponse
$creadPrec :: ReadPrec GetMetricStatisticsResponse
readList :: ReadS [GetMetricStatisticsResponse]
$creadList :: ReadS [GetMetricStatisticsResponse]
readsPrec :: Int -> ReadS GetMetricStatisticsResponse
$creadsPrec :: Int -> ReadS GetMetricStatisticsResponse
Prelude.Read, Int -> GetMetricStatisticsResponse -> ShowS
[GetMetricStatisticsResponse] -> ShowS
GetMetricStatisticsResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetMetricStatisticsResponse] -> ShowS
$cshowList :: [GetMetricStatisticsResponse] -> ShowS
show :: GetMetricStatisticsResponse -> String
$cshow :: GetMetricStatisticsResponse -> String
showsPrec :: Int -> GetMetricStatisticsResponse -> ShowS
$cshowsPrec :: Int -> GetMetricStatisticsResponse -> ShowS
Prelude.Show, forall x.
Rep GetMetricStatisticsResponse x -> GetMetricStatisticsResponse
forall x.
GetMetricStatisticsResponse -> Rep GetMetricStatisticsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetMetricStatisticsResponse x -> GetMetricStatisticsResponse
$cfrom :: forall x.
GetMetricStatisticsResponse -> Rep GetMetricStatisticsResponse x
Prelude.Generic)
newGetMetricStatisticsResponse ::
Prelude.Int ->
GetMetricStatisticsResponse
newGetMetricStatisticsResponse :: Int -> GetMetricStatisticsResponse
newGetMetricStatisticsResponse Int
pHttpStatus_ =
GetMetricStatisticsResponse'
{ $sel:datapoints:GetMetricStatisticsResponse' :: Maybe [Datapoint]
datapoints =
forall a. Maybe a
Prelude.Nothing,
$sel:label:GetMetricStatisticsResponse' :: Maybe Text
label = forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:GetMetricStatisticsResponse' :: Int
httpStatus = Int
pHttpStatus_
}
getMetricStatisticsResponse_datapoints :: Lens.Lens' GetMetricStatisticsResponse (Prelude.Maybe [Datapoint])
getMetricStatisticsResponse_datapoints :: Lens' GetMetricStatisticsResponse (Maybe [Datapoint])
getMetricStatisticsResponse_datapoints = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetMetricStatisticsResponse' {Maybe [Datapoint]
datapoints :: Maybe [Datapoint]
$sel:datapoints:GetMetricStatisticsResponse' :: GetMetricStatisticsResponse -> Maybe [Datapoint]
datapoints} -> Maybe [Datapoint]
datapoints) (\s :: GetMetricStatisticsResponse
s@GetMetricStatisticsResponse' {} Maybe [Datapoint]
a -> GetMetricStatisticsResponse
s {$sel:datapoints:GetMetricStatisticsResponse' :: Maybe [Datapoint]
datapoints = Maybe [Datapoint]
a} :: GetMetricStatisticsResponse) 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
getMetricStatisticsResponse_label :: Lens.Lens' GetMetricStatisticsResponse (Prelude.Maybe Prelude.Text)
getMetricStatisticsResponse_label :: Lens' GetMetricStatisticsResponse (Maybe Text)
getMetricStatisticsResponse_label = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetMetricStatisticsResponse' {Maybe Text
label :: Maybe Text
$sel:label:GetMetricStatisticsResponse' :: GetMetricStatisticsResponse -> Maybe Text
label} -> Maybe Text
label) (\s :: GetMetricStatisticsResponse
s@GetMetricStatisticsResponse' {} Maybe Text
a -> GetMetricStatisticsResponse
s {$sel:label:GetMetricStatisticsResponse' :: Maybe Text
label = Maybe Text
a} :: GetMetricStatisticsResponse)
getMetricStatisticsResponse_httpStatus :: Lens.Lens' GetMetricStatisticsResponse Prelude.Int
getMetricStatisticsResponse_httpStatus :: Lens' GetMetricStatisticsResponse Int
getMetricStatisticsResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetMetricStatisticsResponse' {Int
httpStatus :: Int
$sel:httpStatus:GetMetricStatisticsResponse' :: GetMetricStatisticsResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: GetMetricStatisticsResponse
s@GetMetricStatisticsResponse' {} Int
a -> GetMetricStatisticsResponse
s {$sel:httpStatus:GetMetricStatisticsResponse' :: Int
httpStatus = Int
a} :: GetMetricStatisticsResponse)
instance Prelude.NFData GetMetricStatisticsResponse where
rnf :: GetMetricStatisticsResponse -> ()
rnf GetMetricStatisticsResponse' {Int
Maybe [Datapoint]
Maybe Text
httpStatus :: Int
label :: Maybe Text
datapoints :: Maybe [Datapoint]
$sel:httpStatus:GetMetricStatisticsResponse' :: GetMetricStatisticsResponse -> Int
$sel:label:GetMetricStatisticsResponse' :: GetMetricStatisticsResponse -> Maybe Text
$sel:datapoints:GetMetricStatisticsResponse' :: GetMetricStatisticsResponse -> Maybe [Datapoint]
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe [Datapoint]
datapoints
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
label
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus