{-# 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.Lightsail.GetInstanceMetricData
(
GetInstanceMetricData (..),
newGetInstanceMetricData,
getInstanceMetricData_instanceName,
getInstanceMetricData_metricName,
getInstanceMetricData_period,
getInstanceMetricData_startTime,
getInstanceMetricData_endTime,
getInstanceMetricData_unit,
getInstanceMetricData_statistics,
GetInstanceMetricDataResponse (..),
newGetInstanceMetricDataResponse,
getInstanceMetricDataResponse_metricName,
getInstanceMetricDataResponse_metricData,
getInstanceMetricDataResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.Lightsail.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data GetInstanceMetricData = GetInstanceMetricData'
{
GetInstanceMetricData -> Text
instanceName :: Prelude.Text,
GetInstanceMetricData -> InstanceMetricName
metricName :: InstanceMetricName,
GetInstanceMetricData -> Natural
period :: Prelude.Natural,
GetInstanceMetricData -> POSIX
startTime :: Core.POSIX,
GetInstanceMetricData -> POSIX
endTime :: Core.POSIX,
GetInstanceMetricData -> MetricUnit
unit :: MetricUnit,
GetInstanceMetricData -> [MetricStatistic]
statistics :: [MetricStatistic]
}
deriving (GetInstanceMetricData -> GetInstanceMetricData -> Bool
(GetInstanceMetricData -> GetInstanceMetricData -> Bool)
-> (GetInstanceMetricData -> GetInstanceMetricData -> Bool)
-> Eq GetInstanceMetricData
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]
(Int -> ReadS GetInstanceMetricData)
-> ReadS [GetInstanceMetricData]
-> ReadPrec GetInstanceMetricData
-> ReadPrec [GetInstanceMetricData]
-> Read 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
(Int -> GetInstanceMetricData -> ShowS)
-> (GetInstanceMetricData -> String)
-> ([GetInstanceMetricData] -> ShowS)
-> Show GetInstanceMetricData
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. GetInstanceMetricData -> Rep GetInstanceMetricData x)
-> (forall x. Rep GetInstanceMetricData x -> GetInstanceMetricData)
-> Generic GetInstanceMetricData
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)
newGetInstanceMetricData ::
Prelude.Text ->
InstanceMetricName ->
Prelude.Natural ->
Prelude.UTCTime ->
Prelude.UTCTime ->
MetricUnit ->
GetInstanceMetricData
newGetInstanceMetricData :: Text
-> InstanceMetricName
-> Natural
-> UTCTime
-> UTCTime
-> MetricUnit
-> GetInstanceMetricData
newGetInstanceMetricData
Text
pInstanceName_
InstanceMetricName
pMetricName_
Natural
pPeriod_
UTCTime
pStartTime_
UTCTime
pEndTime_
MetricUnit
pUnit_ =
GetInstanceMetricData' :: Text
-> InstanceMetricName
-> Natural
-> POSIX
-> POSIX
-> MetricUnit
-> [MetricStatistic]
-> GetInstanceMetricData
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 = Tagged UTCTime (Identity UTCTime) -> Tagged POSIX (Identity POSIX)
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time (Tagged UTCTime (Identity UTCTime)
-> Tagged POSIX (Identity POSIX))
-> UTCTime -> POSIX
forall t b. AReview t b -> b -> t
Lens.# UTCTime
pStartTime_,
$sel:endTime:GetInstanceMetricData' :: POSIX
endTime = Tagged UTCTime (Identity UTCTime) -> Tagged POSIX (Identity POSIX)
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time (Tagged UTCTime (Identity UTCTime)
-> Tagged POSIX (Identity POSIX))
-> UTCTime -> POSIX
forall t b. AReview t b -> b -> t
Lens.# UTCTime
pEndTime_,
$sel:unit:GetInstanceMetricData' :: MetricUnit
unit = MetricUnit
pUnit_,
$sel:statistics:GetInstanceMetricData' :: [MetricStatistic]
statistics = [MetricStatistic]
forall a. Monoid a => a
Prelude.mempty
}
getInstanceMetricData_instanceName :: Lens.Lens' GetInstanceMetricData Prelude.Text
getInstanceMetricData_instanceName :: (Text -> f Text)
-> GetInstanceMetricData -> f GetInstanceMetricData
getInstanceMetricData_instanceName = (GetInstanceMetricData -> Text)
-> (GetInstanceMetricData -> Text -> GetInstanceMetricData)
-> Lens GetInstanceMetricData GetInstanceMetricData Text Text
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)
getInstanceMetricData_metricName :: Lens.Lens' GetInstanceMetricData InstanceMetricName
getInstanceMetricData_metricName :: (InstanceMetricName -> f InstanceMetricName)
-> GetInstanceMetricData -> f GetInstanceMetricData
getInstanceMetricData_metricName = (GetInstanceMetricData -> InstanceMetricName)
-> (GetInstanceMetricData
-> InstanceMetricName -> GetInstanceMetricData)
-> Lens
GetInstanceMetricData
GetInstanceMetricData
InstanceMetricName
InstanceMetricName
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)
getInstanceMetricData_period :: Lens.Lens' GetInstanceMetricData Prelude.Natural
getInstanceMetricData_period :: (Natural -> f Natural)
-> GetInstanceMetricData -> f GetInstanceMetricData
getInstanceMetricData_period = (GetInstanceMetricData -> Natural)
-> (GetInstanceMetricData -> Natural -> GetInstanceMetricData)
-> Lens GetInstanceMetricData GetInstanceMetricData Natural Natural
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)
getInstanceMetricData_startTime :: Lens.Lens' GetInstanceMetricData Prelude.UTCTime
getInstanceMetricData_startTime :: (UTCTime -> f UTCTime)
-> GetInstanceMetricData -> f GetInstanceMetricData
getInstanceMetricData_startTime = (GetInstanceMetricData -> POSIX)
-> (GetInstanceMetricData -> POSIX -> GetInstanceMetricData)
-> Lens GetInstanceMetricData GetInstanceMetricData POSIX POSIX
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) ((POSIX -> f POSIX)
-> GetInstanceMetricData -> f GetInstanceMetricData)
-> ((UTCTime -> f UTCTime) -> POSIX -> f POSIX)
-> (UTCTime -> f UTCTime)
-> GetInstanceMetricData
-> f GetInstanceMetricData
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (UTCTime -> f UTCTime) -> POSIX -> f POSIX
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time
getInstanceMetricData_endTime :: Lens.Lens' GetInstanceMetricData Prelude.UTCTime
getInstanceMetricData_endTime :: (UTCTime -> f UTCTime)
-> GetInstanceMetricData -> f GetInstanceMetricData
getInstanceMetricData_endTime = (GetInstanceMetricData -> POSIX)
-> (GetInstanceMetricData -> POSIX -> GetInstanceMetricData)
-> Lens GetInstanceMetricData GetInstanceMetricData POSIX POSIX
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) ((POSIX -> f POSIX)
-> GetInstanceMetricData -> f GetInstanceMetricData)
-> ((UTCTime -> f UTCTime) -> POSIX -> f POSIX)
-> (UTCTime -> f UTCTime)
-> GetInstanceMetricData
-> f GetInstanceMetricData
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (UTCTime -> f UTCTime) -> POSIX -> f POSIX
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time
getInstanceMetricData_unit :: Lens.Lens' GetInstanceMetricData MetricUnit
getInstanceMetricData_unit :: (MetricUnit -> f MetricUnit)
-> GetInstanceMetricData -> f GetInstanceMetricData
getInstanceMetricData_unit = (GetInstanceMetricData -> MetricUnit)
-> (GetInstanceMetricData -> MetricUnit -> GetInstanceMetricData)
-> Lens
GetInstanceMetricData GetInstanceMetricData MetricUnit MetricUnit
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)
getInstanceMetricData_statistics :: Lens.Lens' GetInstanceMetricData [MetricStatistic]
getInstanceMetricData_statistics :: ([MetricStatistic] -> f [MetricStatistic])
-> GetInstanceMetricData -> f GetInstanceMetricData
getInstanceMetricData_statistics = (GetInstanceMetricData -> [MetricStatistic])
-> (GetInstanceMetricData
-> [MetricStatistic] -> GetInstanceMetricData)
-> Lens
GetInstanceMetricData
GetInstanceMetricData
[MetricStatistic]
[MetricStatistic]
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) (([MetricStatistic] -> f [MetricStatistic])
-> GetInstanceMetricData -> f GetInstanceMetricData)
-> (([MetricStatistic] -> f [MetricStatistic])
-> [MetricStatistic] -> f [MetricStatistic])
-> ([MetricStatistic] -> f [MetricStatistic])
-> GetInstanceMetricData
-> f GetInstanceMetricData
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([MetricStatistic] -> f [MetricStatistic])
-> [MetricStatistic] -> f [MetricStatistic]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
instance Core.AWSRequest GetInstanceMetricData where
type
AWSResponse GetInstanceMetricData =
GetInstanceMetricDataResponse
request :: GetInstanceMetricData -> Request GetInstanceMetricData
request = Service -> GetInstanceMetricData -> Request GetInstanceMetricData
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy GetInstanceMetricData
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse GetInstanceMetricData)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse GetInstanceMetricData))
-> Logger
-> Service
-> Proxy GetInstanceMetricData
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse GetInstanceMetricData)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
( \Int
s ResponseHeaders
h Object
x ->
Maybe InstanceMetricName
-> Maybe [MetricDatapoint] -> Int -> GetInstanceMetricDataResponse
GetInstanceMetricDataResponse'
(Maybe InstanceMetricName
-> Maybe [MetricDatapoint] -> Int -> GetInstanceMetricDataResponse)
-> Either String (Maybe InstanceMetricName)
-> Either
String
(Maybe [MetricDatapoint] -> Int -> GetInstanceMetricDataResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe InstanceMetricName)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"metricName")
Either
String
(Maybe [MetricDatapoint] -> Int -> GetInstanceMetricDataResponse)
-> Either String (Maybe [MetricDatapoint])
-> Either String (Int -> GetInstanceMetricDataResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe (Maybe [MetricDatapoint]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"metricData" Either String (Maybe (Maybe [MetricDatapoint]))
-> Maybe [MetricDatapoint]
-> Either String (Maybe [MetricDatapoint])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [MetricDatapoint]
forall a. Monoid a => a
Prelude.mempty)
Either String (Int -> GetInstanceMetricDataResponse)
-> Either String Int -> Either String GetInstanceMetricDataResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Int -> Either String Int
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (Int -> Int
forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
)
instance Prelude.Hashable GetInstanceMetricData
instance Prelude.NFData GetInstanceMetricData
instance Core.ToHeaders GetInstanceMetricData where
toHeaders :: GetInstanceMetricData -> ResponseHeaders
toHeaders =
ResponseHeaders -> GetInstanceMetricData -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"X-Amz-Target"
HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"Lightsail_20161128.GetInstanceMetricData" ::
Prelude.ByteString
),
HeaderName
"Content-Type"
HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Core.ToJSON 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
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"instanceName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
instanceName),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"metricName" Text -> InstanceMetricName -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= InstanceMetricName
metricName),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"period" Text -> Natural -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Natural
period),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"startTime" Text -> POSIX -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= POSIX
startTime),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"endTime" Text -> POSIX -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= POSIX
endTime),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"unit" Text -> MetricUnit -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= MetricUnit
unit),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"statistics" Text -> [MetricStatistic] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= [MetricStatistic]
statistics)
]
)
instance Core.ToPath GetInstanceMetricData where
toPath :: GetInstanceMetricData -> ByteString
toPath = ByteString -> GetInstanceMetricData -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery GetInstanceMetricData where
toQuery :: GetInstanceMetricData -> QueryString
toQuery = QueryString -> GetInstanceMetricData -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data GetInstanceMetricDataResponse = GetInstanceMetricDataResponse'
{
GetInstanceMetricDataResponse -> Maybe InstanceMetricName
metricName :: Prelude.Maybe InstanceMetricName,
GetInstanceMetricDataResponse -> Maybe [MetricDatapoint]
metricData :: Prelude.Maybe [MetricDatapoint],
GetInstanceMetricDataResponse -> Int
httpStatus :: Prelude.Int
}
deriving (GetInstanceMetricDataResponse
-> GetInstanceMetricDataResponse -> Bool
(GetInstanceMetricDataResponse
-> GetInstanceMetricDataResponse -> Bool)
-> (GetInstanceMetricDataResponse
-> GetInstanceMetricDataResponse -> Bool)
-> Eq GetInstanceMetricDataResponse
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]
(Int -> ReadS GetInstanceMetricDataResponse)
-> ReadS [GetInstanceMetricDataResponse]
-> ReadPrec GetInstanceMetricDataResponse
-> ReadPrec [GetInstanceMetricDataResponse]
-> Read 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
(Int -> GetInstanceMetricDataResponse -> ShowS)
-> (GetInstanceMetricDataResponse -> String)
-> ([GetInstanceMetricDataResponse] -> ShowS)
-> Show GetInstanceMetricDataResponse
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.
GetInstanceMetricDataResponse
-> Rep GetInstanceMetricDataResponse x)
-> (forall x.
Rep GetInstanceMetricDataResponse x
-> GetInstanceMetricDataResponse)
-> Generic GetInstanceMetricDataResponse
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)
newGetInstanceMetricDataResponse ::
Prelude.Int ->
GetInstanceMetricDataResponse
newGetInstanceMetricDataResponse :: Int -> GetInstanceMetricDataResponse
newGetInstanceMetricDataResponse Int
pHttpStatus_ =
GetInstanceMetricDataResponse' :: Maybe InstanceMetricName
-> Maybe [MetricDatapoint] -> Int -> GetInstanceMetricDataResponse
GetInstanceMetricDataResponse'
{ $sel:metricName:GetInstanceMetricDataResponse' :: Maybe InstanceMetricName
metricName =
Maybe InstanceMetricName
forall a. Maybe a
Prelude.Nothing,
$sel:metricData:GetInstanceMetricDataResponse' :: Maybe [MetricDatapoint]
metricData = Maybe [MetricDatapoint]
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:GetInstanceMetricDataResponse' :: Int
httpStatus = Int
pHttpStatus_
}
getInstanceMetricDataResponse_metricName :: Lens.Lens' GetInstanceMetricDataResponse (Prelude.Maybe InstanceMetricName)
getInstanceMetricDataResponse_metricName :: (Maybe InstanceMetricName -> f (Maybe InstanceMetricName))
-> GetInstanceMetricDataResponse -> f GetInstanceMetricDataResponse
getInstanceMetricDataResponse_metricName = (GetInstanceMetricDataResponse -> Maybe InstanceMetricName)
-> (GetInstanceMetricDataResponse
-> Maybe InstanceMetricName -> GetInstanceMetricDataResponse)
-> Lens
GetInstanceMetricDataResponse
GetInstanceMetricDataResponse
(Maybe InstanceMetricName)
(Maybe InstanceMetricName)
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)
getInstanceMetricDataResponse_metricData :: Lens.Lens' GetInstanceMetricDataResponse (Prelude.Maybe [MetricDatapoint])
getInstanceMetricDataResponse_metricData :: (Maybe [MetricDatapoint] -> f (Maybe [MetricDatapoint]))
-> GetInstanceMetricDataResponse -> f GetInstanceMetricDataResponse
getInstanceMetricDataResponse_metricData = (GetInstanceMetricDataResponse -> Maybe [MetricDatapoint])
-> (GetInstanceMetricDataResponse
-> Maybe [MetricDatapoint] -> GetInstanceMetricDataResponse)
-> Lens
GetInstanceMetricDataResponse
GetInstanceMetricDataResponse
(Maybe [MetricDatapoint])
(Maybe [MetricDatapoint])
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) ((Maybe [MetricDatapoint] -> f (Maybe [MetricDatapoint]))
-> GetInstanceMetricDataResponse
-> f GetInstanceMetricDataResponse)
-> ((Maybe [MetricDatapoint] -> f (Maybe [MetricDatapoint]))
-> Maybe [MetricDatapoint] -> f (Maybe [MetricDatapoint]))
-> (Maybe [MetricDatapoint] -> f (Maybe [MetricDatapoint]))
-> GetInstanceMetricDataResponse
-> f GetInstanceMetricDataResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
[MetricDatapoint]
[MetricDatapoint]
[MetricDatapoint]
[MetricDatapoint]
-> Iso
(Maybe [MetricDatapoint])
(Maybe [MetricDatapoint])
(Maybe [MetricDatapoint])
(Maybe [MetricDatapoint])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso
[MetricDatapoint]
[MetricDatapoint]
[MetricDatapoint]
[MetricDatapoint]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
getInstanceMetricDataResponse_httpStatus :: Lens.Lens' GetInstanceMetricDataResponse Prelude.Int
getInstanceMetricDataResponse_httpStatus :: (Int -> f Int)
-> GetInstanceMetricDataResponse -> f GetInstanceMetricDataResponse
getInstanceMetricDataResponse_httpStatus = (GetInstanceMetricDataResponse -> Int)
-> (GetInstanceMetricDataResponse
-> Int -> GetInstanceMetricDataResponse)
-> Lens
GetInstanceMetricDataResponse GetInstanceMetricDataResponse Int Int
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