{-# 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.GetRelationalDatabaseMetricData
(
GetRelationalDatabaseMetricData (..),
newGetRelationalDatabaseMetricData,
getRelationalDatabaseMetricData_relationalDatabaseName,
getRelationalDatabaseMetricData_metricName,
getRelationalDatabaseMetricData_period,
getRelationalDatabaseMetricData_startTime,
getRelationalDatabaseMetricData_endTime,
getRelationalDatabaseMetricData_unit,
getRelationalDatabaseMetricData_statistics,
GetRelationalDatabaseMetricDataResponse (..),
newGetRelationalDatabaseMetricDataResponse,
getRelationalDatabaseMetricDataResponse_metricName,
getRelationalDatabaseMetricDataResponse_metricData,
getRelationalDatabaseMetricDataResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.Lightsail.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data GetRelationalDatabaseMetricData = GetRelationalDatabaseMetricData'
{
GetRelationalDatabaseMetricData -> Text
relationalDatabaseName :: Prelude.Text,
GetRelationalDatabaseMetricData -> RelationalDatabaseMetricName
metricName :: RelationalDatabaseMetricName,
GetRelationalDatabaseMetricData -> Natural
period :: Prelude.Natural,
GetRelationalDatabaseMetricData -> POSIX
startTime :: Core.POSIX,
GetRelationalDatabaseMetricData -> POSIX
endTime :: Core.POSIX,
GetRelationalDatabaseMetricData -> MetricUnit
unit :: MetricUnit,
GetRelationalDatabaseMetricData -> [MetricStatistic]
statistics :: [MetricStatistic]
}
deriving (GetRelationalDatabaseMetricData
-> GetRelationalDatabaseMetricData -> Bool
(GetRelationalDatabaseMetricData
-> GetRelationalDatabaseMetricData -> Bool)
-> (GetRelationalDatabaseMetricData
-> GetRelationalDatabaseMetricData -> Bool)
-> Eq GetRelationalDatabaseMetricData
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetRelationalDatabaseMetricData
-> GetRelationalDatabaseMetricData -> Bool
$c/= :: GetRelationalDatabaseMetricData
-> GetRelationalDatabaseMetricData -> Bool
== :: GetRelationalDatabaseMetricData
-> GetRelationalDatabaseMetricData -> Bool
$c== :: GetRelationalDatabaseMetricData
-> GetRelationalDatabaseMetricData -> Bool
Prelude.Eq, ReadPrec [GetRelationalDatabaseMetricData]
ReadPrec GetRelationalDatabaseMetricData
Int -> ReadS GetRelationalDatabaseMetricData
ReadS [GetRelationalDatabaseMetricData]
(Int -> ReadS GetRelationalDatabaseMetricData)
-> ReadS [GetRelationalDatabaseMetricData]
-> ReadPrec GetRelationalDatabaseMetricData
-> ReadPrec [GetRelationalDatabaseMetricData]
-> Read GetRelationalDatabaseMetricData
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetRelationalDatabaseMetricData]
$creadListPrec :: ReadPrec [GetRelationalDatabaseMetricData]
readPrec :: ReadPrec GetRelationalDatabaseMetricData
$creadPrec :: ReadPrec GetRelationalDatabaseMetricData
readList :: ReadS [GetRelationalDatabaseMetricData]
$creadList :: ReadS [GetRelationalDatabaseMetricData]
readsPrec :: Int -> ReadS GetRelationalDatabaseMetricData
$creadsPrec :: Int -> ReadS GetRelationalDatabaseMetricData
Prelude.Read, Int -> GetRelationalDatabaseMetricData -> ShowS
[GetRelationalDatabaseMetricData] -> ShowS
GetRelationalDatabaseMetricData -> String
(Int -> GetRelationalDatabaseMetricData -> ShowS)
-> (GetRelationalDatabaseMetricData -> String)
-> ([GetRelationalDatabaseMetricData] -> ShowS)
-> Show GetRelationalDatabaseMetricData
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetRelationalDatabaseMetricData] -> ShowS
$cshowList :: [GetRelationalDatabaseMetricData] -> ShowS
show :: GetRelationalDatabaseMetricData -> String
$cshow :: GetRelationalDatabaseMetricData -> String
showsPrec :: Int -> GetRelationalDatabaseMetricData -> ShowS
$cshowsPrec :: Int -> GetRelationalDatabaseMetricData -> ShowS
Prelude.Show, (forall x.
GetRelationalDatabaseMetricData
-> Rep GetRelationalDatabaseMetricData x)
-> (forall x.
Rep GetRelationalDatabaseMetricData x
-> GetRelationalDatabaseMetricData)
-> Generic GetRelationalDatabaseMetricData
forall x.
Rep GetRelationalDatabaseMetricData x
-> GetRelationalDatabaseMetricData
forall x.
GetRelationalDatabaseMetricData
-> Rep GetRelationalDatabaseMetricData x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetRelationalDatabaseMetricData x
-> GetRelationalDatabaseMetricData
$cfrom :: forall x.
GetRelationalDatabaseMetricData
-> Rep GetRelationalDatabaseMetricData x
Prelude.Generic)
newGetRelationalDatabaseMetricData ::
Prelude.Text ->
RelationalDatabaseMetricName ->
Prelude.Natural ->
Prelude.UTCTime ->
Prelude.UTCTime ->
MetricUnit ->
GetRelationalDatabaseMetricData
newGetRelationalDatabaseMetricData :: Text
-> RelationalDatabaseMetricName
-> Natural
-> UTCTime
-> UTCTime
-> MetricUnit
-> GetRelationalDatabaseMetricData
newGetRelationalDatabaseMetricData
Text
pRelationalDatabaseName_
RelationalDatabaseMetricName
pMetricName_
Natural
pPeriod_
UTCTime
pStartTime_
UTCTime
pEndTime_
MetricUnit
pUnit_ =
GetRelationalDatabaseMetricData' :: Text
-> RelationalDatabaseMetricName
-> Natural
-> POSIX
-> POSIX
-> MetricUnit
-> [MetricStatistic]
-> GetRelationalDatabaseMetricData
GetRelationalDatabaseMetricData'
{ $sel:relationalDatabaseName:GetRelationalDatabaseMetricData' :: Text
relationalDatabaseName =
Text
pRelationalDatabaseName_,
$sel:metricName:GetRelationalDatabaseMetricData' :: RelationalDatabaseMetricName
metricName = RelationalDatabaseMetricName
pMetricName_,
$sel:period:GetRelationalDatabaseMetricData' :: Natural
period = Natural
pPeriod_,
$sel:startTime:GetRelationalDatabaseMetricData' :: POSIX
startTime = Tagged UTCTime (Identity UTCTime) -> Tagged POSIX (Identity POSIX)
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time (Tagged UTCTime (Identity UTCTime)
-> Tagged POSIX (Identity POSIX))
-> UTCTime -> POSIX
forall t b. AReview t b -> b -> t
Lens.# UTCTime
pStartTime_,
$sel:endTime:GetRelationalDatabaseMetricData' :: POSIX
endTime = Tagged UTCTime (Identity UTCTime) -> Tagged POSIX (Identity POSIX)
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time (Tagged UTCTime (Identity UTCTime)
-> Tagged POSIX (Identity POSIX))
-> UTCTime -> POSIX
forall t b. AReview t b -> b -> t
Lens.# UTCTime
pEndTime_,
$sel:unit:GetRelationalDatabaseMetricData' :: MetricUnit
unit = MetricUnit
pUnit_,
$sel:statistics:GetRelationalDatabaseMetricData' :: [MetricStatistic]
statistics = [MetricStatistic]
forall a. Monoid a => a
Prelude.mempty
}
getRelationalDatabaseMetricData_relationalDatabaseName :: Lens.Lens' GetRelationalDatabaseMetricData Prelude.Text
getRelationalDatabaseMetricData_relationalDatabaseName :: (Text -> f Text)
-> GetRelationalDatabaseMetricData
-> f GetRelationalDatabaseMetricData
getRelationalDatabaseMetricData_relationalDatabaseName = (GetRelationalDatabaseMetricData -> Text)
-> (GetRelationalDatabaseMetricData
-> Text -> GetRelationalDatabaseMetricData)
-> Lens
GetRelationalDatabaseMetricData
GetRelationalDatabaseMetricData
Text
Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetRelationalDatabaseMetricData' {Text
relationalDatabaseName :: Text
$sel:relationalDatabaseName:GetRelationalDatabaseMetricData' :: GetRelationalDatabaseMetricData -> Text
relationalDatabaseName} -> Text
relationalDatabaseName) (\s :: GetRelationalDatabaseMetricData
s@GetRelationalDatabaseMetricData' {} Text
a -> GetRelationalDatabaseMetricData
s {$sel:relationalDatabaseName:GetRelationalDatabaseMetricData' :: Text
relationalDatabaseName = Text
a} :: GetRelationalDatabaseMetricData)
getRelationalDatabaseMetricData_metricName :: Lens.Lens' GetRelationalDatabaseMetricData RelationalDatabaseMetricName
getRelationalDatabaseMetricData_metricName :: (RelationalDatabaseMetricName -> f RelationalDatabaseMetricName)
-> GetRelationalDatabaseMetricData
-> f GetRelationalDatabaseMetricData
getRelationalDatabaseMetricData_metricName = (GetRelationalDatabaseMetricData -> RelationalDatabaseMetricName)
-> (GetRelationalDatabaseMetricData
-> RelationalDatabaseMetricName -> GetRelationalDatabaseMetricData)
-> Lens
GetRelationalDatabaseMetricData
GetRelationalDatabaseMetricData
RelationalDatabaseMetricName
RelationalDatabaseMetricName
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetRelationalDatabaseMetricData' {RelationalDatabaseMetricName
metricName :: RelationalDatabaseMetricName
$sel:metricName:GetRelationalDatabaseMetricData' :: GetRelationalDatabaseMetricData -> RelationalDatabaseMetricName
metricName} -> RelationalDatabaseMetricName
metricName) (\s :: GetRelationalDatabaseMetricData
s@GetRelationalDatabaseMetricData' {} RelationalDatabaseMetricName
a -> GetRelationalDatabaseMetricData
s {$sel:metricName:GetRelationalDatabaseMetricData' :: RelationalDatabaseMetricName
metricName = RelationalDatabaseMetricName
a} :: GetRelationalDatabaseMetricData)
getRelationalDatabaseMetricData_period :: Lens.Lens' GetRelationalDatabaseMetricData Prelude.Natural
getRelationalDatabaseMetricData_period :: (Natural -> f Natural)
-> GetRelationalDatabaseMetricData
-> f GetRelationalDatabaseMetricData
getRelationalDatabaseMetricData_period = (GetRelationalDatabaseMetricData -> Natural)
-> (GetRelationalDatabaseMetricData
-> Natural -> GetRelationalDatabaseMetricData)
-> Lens
GetRelationalDatabaseMetricData
GetRelationalDatabaseMetricData
Natural
Natural
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetRelationalDatabaseMetricData' {Natural
period :: Natural
$sel:period:GetRelationalDatabaseMetricData' :: GetRelationalDatabaseMetricData -> Natural
period} -> Natural
period) (\s :: GetRelationalDatabaseMetricData
s@GetRelationalDatabaseMetricData' {} Natural
a -> GetRelationalDatabaseMetricData
s {$sel:period:GetRelationalDatabaseMetricData' :: Natural
period = Natural
a} :: GetRelationalDatabaseMetricData)
getRelationalDatabaseMetricData_startTime :: Lens.Lens' GetRelationalDatabaseMetricData Prelude.UTCTime
getRelationalDatabaseMetricData_startTime :: (UTCTime -> f UTCTime)
-> GetRelationalDatabaseMetricData
-> f GetRelationalDatabaseMetricData
getRelationalDatabaseMetricData_startTime = (GetRelationalDatabaseMetricData -> POSIX)
-> (GetRelationalDatabaseMetricData
-> POSIX -> GetRelationalDatabaseMetricData)
-> Lens
GetRelationalDatabaseMetricData
GetRelationalDatabaseMetricData
POSIX
POSIX
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetRelationalDatabaseMetricData' {POSIX
startTime :: POSIX
$sel:startTime:GetRelationalDatabaseMetricData' :: GetRelationalDatabaseMetricData -> POSIX
startTime} -> POSIX
startTime) (\s :: GetRelationalDatabaseMetricData
s@GetRelationalDatabaseMetricData' {} POSIX
a -> GetRelationalDatabaseMetricData
s {$sel:startTime:GetRelationalDatabaseMetricData' :: POSIX
startTime = POSIX
a} :: GetRelationalDatabaseMetricData) ((POSIX -> f POSIX)
-> GetRelationalDatabaseMetricData
-> f GetRelationalDatabaseMetricData)
-> ((UTCTime -> f UTCTime) -> POSIX -> f POSIX)
-> (UTCTime -> f UTCTime)
-> GetRelationalDatabaseMetricData
-> f GetRelationalDatabaseMetricData
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (UTCTime -> f UTCTime) -> POSIX -> f POSIX
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time
getRelationalDatabaseMetricData_endTime :: Lens.Lens' GetRelationalDatabaseMetricData Prelude.UTCTime
getRelationalDatabaseMetricData_endTime :: (UTCTime -> f UTCTime)
-> GetRelationalDatabaseMetricData
-> f GetRelationalDatabaseMetricData
getRelationalDatabaseMetricData_endTime = (GetRelationalDatabaseMetricData -> POSIX)
-> (GetRelationalDatabaseMetricData
-> POSIX -> GetRelationalDatabaseMetricData)
-> Lens
GetRelationalDatabaseMetricData
GetRelationalDatabaseMetricData
POSIX
POSIX
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetRelationalDatabaseMetricData' {POSIX
endTime :: POSIX
$sel:endTime:GetRelationalDatabaseMetricData' :: GetRelationalDatabaseMetricData -> POSIX
endTime} -> POSIX
endTime) (\s :: GetRelationalDatabaseMetricData
s@GetRelationalDatabaseMetricData' {} POSIX
a -> GetRelationalDatabaseMetricData
s {$sel:endTime:GetRelationalDatabaseMetricData' :: POSIX
endTime = POSIX
a} :: GetRelationalDatabaseMetricData) ((POSIX -> f POSIX)
-> GetRelationalDatabaseMetricData
-> f GetRelationalDatabaseMetricData)
-> ((UTCTime -> f UTCTime) -> POSIX -> f POSIX)
-> (UTCTime -> f UTCTime)
-> GetRelationalDatabaseMetricData
-> f GetRelationalDatabaseMetricData
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (UTCTime -> f UTCTime) -> POSIX -> f POSIX
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time
getRelationalDatabaseMetricData_unit :: Lens.Lens' GetRelationalDatabaseMetricData MetricUnit
getRelationalDatabaseMetricData_unit :: (MetricUnit -> f MetricUnit)
-> GetRelationalDatabaseMetricData
-> f GetRelationalDatabaseMetricData
getRelationalDatabaseMetricData_unit = (GetRelationalDatabaseMetricData -> MetricUnit)
-> (GetRelationalDatabaseMetricData
-> MetricUnit -> GetRelationalDatabaseMetricData)
-> Lens
GetRelationalDatabaseMetricData
GetRelationalDatabaseMetricData
MetricUnit
MetricUnit
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetRelationalDatabaseMetricData' {MetricUnit
unit :: MetricUnit
$sel:unit:GetRelationalDatabaseMetricData' :: GetRelationalDatabaseMetricData -> MetricUnit
unit} -> MetricUnit
unit) (\s :: GetRelationalDatabaseMetricData
s@GetRelationalDatabaseMetricData' {} MetricUnit
a -> GetRelationalDatabaseMetricData
s {$sel:unit:GetRelationalDatabaseMetricData' :: MetricUnit
unit = MetricUnit
a} :: GetRelationalDatabaseMetricData)
getRelationalDatabaseMetricData_statistics :: Lens.Lens' GetRelationalDatabaseMetricData [MetricStatistic]
getRelationalDatabaseMetricData_statistics :: ([MetricStatistic] -> f [MetricStatistic])
-> GetRelationalDatabaseMetricData
-> f GetRelationalDatabaseMetricData
getRelationalDatabaseMetricData_statistics = (GetRelationalDatabaseMetricData -> [MetricStatistic])
-> (GetRelationalDatabaseMetricData
-> [MetricStatistic] -> GetRelationalDatabaseMetricData)
-> Lens
GetRelationalDatabaseMetricData
GetRelationalDatabaseMetricData
[MetricStatistic]
[MetricStatistic]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetRelationalDatabaseMetricData' {[MetricStatistic]
statistics :: [MetricStatistic]
$sel:statistics:GetRelationalDatabaseMetricData' :: GetRelationalDatabaseMetricData -> [MetricStatistic]
statistics} -> [MetricStatistic]
statistics) (\s :: GetRelationalDatabaseMetricData
s@GetRelationalDatabaseMetricData' {} [MetricStatistic]
a -> GetRelationalDatabaseMetricData
s {$sel:statistics:GetRelationalDatabaseMetricData' :: [MetricStatistic]
statistics = [MetricStatistic]
a} :: GetRelationalDatabaseMetricData) (([MetricStatistic] -> f [MetricStatistic])
-> GetRelationalDatabaseMetricData
-> f GetRelationalDatabaseMetricData)
-> (([MetricStatistic] -> f [MetricStatistic])
-> [MetricStatistic] -> f [MetricStatistic])
-> ([MetricStatistic] -> f [MetricStatistic])
-> GetRelationalDatabaseMetricData
-> f GetRelationalDatabaseMetricData
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([MetricStatistic] -> f [MetricStatistic])
-> [MetricStatistic] -> f [MetricStatistic]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
instance
Core.AWSRequest
GetRelationalDatabaseMetricData
where
type
AWSResponse GetRelationalDatabaseMetricData =
GetRelationalDatabaseMetricDataResponse
request :: GetRelationalDatabaseMetricData
-> Request GetRelationalDatabaseMetricData
request = Service
-> GetRelationalDatabaseMetricData
-> Request GetRelationalDatabaseMetricData
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy GetRelationalDatabaseMetricData
-> ClientResponse ClientBody
-> m (Either
Error
(ClientResponse (AWSResponse GetRelationalDatabaseMetricData)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse GetRelationalDatabaseMetricData))
-> Logger
-> Service
-> Proxy GetRelationalDatabaseMetricData
-> ClientResponse ClientBody
-> m (Either
Error
(ClientResponse (AWSResponse GetRelationalDatabaseMetricData)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
( \Int
s ResponseHeaders
h Object
x ->
Maybe RelationalDatabaseMetricName
-> Maybe [MetricDatapoint]
-> Int
-> GetRelationalDatabaseMetricDataResponse
GetRelationalDatabaseMetricDataResponse'
(Maybe RelationalDatabaseMetricName
-> Maybe [MetricDatapoint]
-> Int
-> GetRelationalDatabaseMetricDataResponse)
-> Either String (Maybe RelationalDatabaseMetricName)
-> Either
String
(Maybe [MetricDatapoint]
-> Int -> GetRelationalDatabaseMetricDataResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object
-> Text -> Either String (Maybe RelationalDatabaseMetricName)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"metricName")
Either
String
(Maybe [MetricDatapoint]
-> Int -> GetRelationalDatabaseMetricDataResponse)
-> Either String (Maybe [MetricDatapoint])
-> Either String (Int -> GetRelationalDatabaseMetricDataResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe (Maybe [MetricDatapoint]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"metricData" Either String (Maybe (Maybe [MetricDatapoint]))
-> Maybe [MetricDatapoint]
-> Either String (Maybe [MetricDatapoint])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [MetricDatapoint]
forall a. Monoid a => a
Prelude.mempty)
Either String (Int -> GetRelationalDatabaseMetricDataResponse)
-> Either String Int
-> Either String GetRelationalDatabaseMetricDataResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Int -> Either String Int
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (Int -> Int
forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
)
instance
Prelude.Hashable
GetRelationalDatabaseMetricData
instance
Prelude.NFData
GetRelationalDatabaseMetricData
instance
Core.ToHeaders
GetRelationalDatabaseMetricData
where
toHeaders :: GetRelationalDatabaseMetricData -> ResponseHeaders
toHeaders =
ResponseHeaders
-> GetRelationalDatabaseMetricData -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"X-Amz-Target"
HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"Lightsail_20161128.GetRelationalDatabaseMetricData" ::
Prelude.ByteString
),
HeaderName
"Content-Type"
HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Core.ToJSON GetRelationalDatabaseMetricData where
toJSON :: GetRelationalDatabaseMetricData -> Value
toJSON GetRelationalDatabaseMetricData' {Natural
[MetricStatistic]
Text
POSIX
MetricUnit
RelationalDatabaseMetricName
statistics :: [MetricStatistic]
unit :: MetricUnit
endTime :: POSIX
startTime :: POSIX
period :: Natural
metricName :: RelationalDatabaseMetricName
relationalDatabaseName :: Text
$sel:statistics:GetRelationalDatabaseMetricData' :: GetRelationalDatabaseMetricData -> [MetricStatistic]
$sel:unit:GetRelationalDatabaseMetricData' :: GetRelationalDatabaseMetricData -> MetricUnit
$sel:endTime:GetRelationalDatabaseMetricData' :: GetRelationalDatabaseMetricData -> POSIX
$sel:startTime:GetRelationalDatabaseMetricData' :: GetRelationalDatabaseMetricData -> POSIX
$sel:period:GetRelationalDatabaseMetricData' :: GetRelationalDatabaseMetricData -> Natural
$sel:metricName:GetRelationalDatabaseMetricData' :: GetRelationalDatabaseMetricData -> RelationalDatabaseMetricName
$sel:relationalDatabaseName:GetRelationalDatabaseMetricData' :: GetRelationalDatabaseMetricData -> Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
( Text
"relationalDatabaseName"
Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
relationalDatabaseName
),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"metricName" Text -> RelationalDatabaseMetricName -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= RelationalDatabaseMetricName
metricName),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"period" Text -> Natural -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Natural
period),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"startTime" Text -> POSIX -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= POSIX
startTime),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"endTime" Text -> POSIX -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= POSIX
endTime),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"unit" Text -> MetricUnit -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= MetricUnit
unit),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"statistics" Text -> [MetricStatistic] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= [MetricStatistic]
statistics)
]
)
instance Core.ToPath GetRelationalDatabaseMetricData where
toPath :: GetRelationalDatabaseMetricData -> ByteString
toPath = ByteString -> GetRelationalDatabaseMetricData -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery GetRelationalDatabaseMetricData where
toQuery :: GetRelationalDatabaseMetricData -> QueryString
toQuery = QueryString -> GetRelationalDatabaseMetricData -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data GetRelationalDatabaseMetricDataResponse = GetRelationalDatabaseMetricDataResponse'
{
GetRelationalDatabaseMetricDataResponse
-> Maybe RelationalDatabaseMetricName
metricName :: Prelude.Maybe RelationalDatabaseMetricName,
GetRelationalDatabaseMetricDataResponse -> Maybe [MetricDatapoint]
metricData :: Prelude.Maybe [MetricDatapoint],
GetRelationalDatabaseMetricDataResponse -> Int
httpStatus :: Prelude.Int
}
deriving (GetRelationalDatabaseMetricDataResponse
-> GetRelationalDatabaseMetricDataResponse -> Bool
(GetRelationalDatabaseMetricDataResponse
-> GetRelationalDatabaseMetricDataResponse -> Bool)
-> (GetRelationalDatabaseMetricDataResponse
-> GetRelationalDatabaseMetricDataResponse -> Bool)
-> Eq GetRelationalDatabaseMetricDataResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetRelationalDatabaseMetricDataResponse
-> GetRelationalDatabaseMetricDataResponse -> Bool
$c/= :: GetRelationalDatabaseMetricDataResponse
-> GetRelationalDatabaseMetricDataResponse -> Bool
== :: GetRelationalDatabaseMetricDataResponse
-> GetRelationalDatabaseMetricDataResponse -> Bool
$c== :: GetRelationalDatabaseMetricDataResponse
-> GetRelationalDatabaseMetricDataResponse -> Bool
Prelude.Eq, ReadPrec [GetRelationalDatabaseMetricDataResponse]
ReadPrec GetRelationalDatabaseMetricDataResponse
Int -> ReadS GetRelationalDatabaseMetricDataResponse
ReadS [GetRelationalDatabaseMetricDataResponse]
(Int -> ReadS GetRelationalDatabaseMetricDataResponse)
-> ReadS [GetRelationalDatabaseMetricDataResponse]
-> ReadPrec GetRelationalDatabaseMetricDataResponse
-> ReadPrec [GetRelationalDatabaseMetricDataResponse]
-> Read GetRelationalDatabaseMetricDataResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetRelationalDatabaseMetricDataResponse]
$creadListPrec :: ReadPrec [GetRelationalDatabaseMetricDataResponse]
readPrec :: ReadPrec GetRelationalDatabaseMetricDataResponse
$creadPrec :: ReadPrec GetRelationalDatabaseMetricDataResponse
readList :: ReadS [GetRelationalDatabaseMetricDataResponse]
$creadList :: ReadS [GetRelationalDatabaseMetricDataResponse]
readsPrec :: Int -> ReadS GetRelationalDatabaseMetricDataResponse
$creadsPrec :: Int -> ReadS GetRelationalDatabaseMetricDataResponse
Prelude.Read, Int -> GetRelationalDatabaseMetricDataResponse -> ShowS
[GetRelationalDatabaseMetricDataResponse] -> ShowS
GetRelationalDatabaseMetricDataResponse -> String
(Int -> GetRelationalDatabaseMetricDataResponse -> ShowS)
-> (GetRelationalDatabaseMetricDataResponse -> String)
-> ([GetRelationalDatabaseMetricDataResponse] -> ShowS)
-> Show GetRelationalDatabaseMetricDataResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetRelationalDatabaseMetricDataResponse] -> ShowS
$cshowList :: [GetRelationalDatabaseMetricDataResponse] -> ShowS
show :: GetRelationalDatabaseMetricDataResponse -> String
$cshow :: GetRelationalDatabaseMetricDataResponse -> String
showsPrec :: Int -> GetRelationalDatabaseMetricDataResponse -> ShowS
$cshowsPrec :: Int -> GetRelationalDatabaseMetricDataResponse -> ShowS
Prelude.Show, (forall x.
GetRelationalDatabaseMetricDataResponse
-> Rep GetRelationalDatabaseMetricDataResponse x)
-> (forall x.
Rep GetRelationalDatabaseMetricDataResponse x
-> GetRelationalDatabaseMetricDataResponse)
-> Generic GetRelationalDatabaseMetricDataResponse
forall x.
Rep GetRelationalDatabaseMetricDataResponse x
-> GetRelationalDatabaseMetricDataResponse
forall x.
GetRelationalDatabaseMetricDataResponse
-> Rep GetRelationalDatabaseMetricDataResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetRelationalDatabaseMetricDataResponse x
-> GetRelationalDatabaseMetricDataResponse
$cfrom :: forall x.
GetRelationalDatabaseMetricDataResponse
-> Rep GetRelationalDatabaseMetricDataResponse x
Prelude.Generic)
newGetRelationalDatabaseMetricDataResponse ::
Prelude.Int ->
GetRelationalDatabaseMetricDataResponse
newGetRelationalDatabaseMetricDataResponse :: Int -> GetRelationalDatabaseMetricDataResponse
newGetRelationalDatabaseMetricDataResponse
Int
pHttpStatus_ =
GetRelationalDatabaseMetricDataResponse' :: Maybe RelationalDatabaseMetricName
-> Maybe [MetricDatapoint]
-> Int
-> GetRelationalDatabaseMetricDataResponse
GetRelationalDatabaseMetricDataResponse'
{ $sel:metricName:GetRelationalDatabaseMetricDataResponse' :: Maybe RelationalDatabaseMetricName
metricName =
Maybe RelationalDatabaseMetricName
forall a. Maybe a
Prelude.Nothing,
$sel:metricData:GetRelationalDatabaseMetricDataResponse' :: Maybe [MetricDatapoint]
metricData = Maybe [MetricDatapoint]
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:GetRelationalDatabaseMetricDataResponse' :: Int
httpStatus = Int
pHttpStatus_
}
getRelationalDatabaseMetricDataResponse_metricName :: Lens.Lens' GetRelationalDatabaseMetricDataResponse (Prelude.Maybe RelationalDatabaseMetricName)
getRelationalDatabaseMetricDataResponse_metricName :: (Maybe RelationalDatabaseMetricName
-> f (Maybe RelationalDatabaseMetricName))
-> GetRelationalDatabaseMetricDataResponse
-> f GetRelationalDatabaseMetricDataResponse
getRelationalDatabaseMetricDataResponse_metricName = (GetRelationalDatabaseMetricDataResponse
-> Maybe RelationalDatabaseMetricName)
-> (GetRelationalDatabaseMetricDataResponse
-> Maybe RelationalDatabaseMetricName
-> GetRelationalDatabaseMetricDataResponse)
-> Lens
GetRelationalDatabaseMetricDataResponse
GetRelationalDatabaseMetricDataResponse
(Maybe RelationalDatabaseMetricName)
(Maybe RelationalDatabaseMetricName)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetRelationalDatabaseMetricDataResponse' {Maybe RelationalDatabaseMetricName
metricName :: Maybe RelationalDatabaseMetricName
$sel:metricName:GetRelationalDatabaseMetricDataResponse' :: GetRelationalDatabaseMetricDataResponse
-> Maybe RelationalDatabaseMetricName
metricName} -> Maybe RelationalDatabaseMetricName
metricName) (\s :: GetRelationalDatabaseMetricDataResponse
s@GetRelationalDatabaseMetricDataResponse' {} Maybe RelationalDatabaseMetricName
a -> GetRelationalDatabaseMetricDataResponse
s {$sel:metricName:GetRelationalDatabaseMetricDataResponse' :: Maybe RelationalDatabaseMetricName
metricName = Maybe RelationalDatabaseMetricName
a} :: GetRelationalDatabaseMetricDataResponse)
getRelationalDatabaseMetricDataResponse_metricData :: Lens.Lens' GetRelationalDatabaseMetricDataResponse (Prelude.Maybe [MetricDatapoint])
getRelationalDatabaseMetricDataResponse_metricData :: (Maybe [MetricDatapoint] -> f (Maybe [MetricDatapoint]))
-> GetRelationalDatabaseMetricDataResponse
-> f GetRelationalDatabaseMetricDataResponse
getRelationalDatabaseMetricDataResponse_metricData = (GetRelationalDatabaseMetricDataResponse
-> Maybe [MetricDatapoint])
-> (GetRelationalDatabaseMetricDataResponse
-> Maybe [MetricDatapoint]
-> GetRelationalDatabaseMetricDataResponse)
-> Lens
GetRelationalDatabaseMetricDataResponse
GetRelationalDatabaseMetricDataResponse
(Maybe [MetricDatapoint])
(Maybe [MetricDatapoint])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetRelationalDatabaseMetricDataResponse' {Maybe [MetricDatapoint]
metricData :: Maybe [MetricDatapoint]
$sel:metricData:GetRelationalDatabaseMetricDataResponse' :: GetRelationalDatabaseMetricDataResponse -> Maybe [MetricDatapoint]
metricData} -> Maybe [MetricDatapoint]
metricData) (\s :: GetRelationalDatabaseMetricDataResponse
s@GetRelationalDatabaseMetricDataResponse' {} Maybe [MetricDatapoint]
a -> GetRelationalDatabaseMetricDataResponse
s {$sel:metricData:GetRelationalDatabaseMetricDataResponse' :: Maybe [MetricDatapoint]
metricData = Maybe [MetricDatapoint]
a} :: GetRelationalDatabaseMetricDataResponse) ((Maybe [MetricDatapoint] -> f (Maybe [MetricDatapoint]))
-> GetRelationalDatabaseMetricDataResponse
-> f GetRelationalDatabaseMetricDataResponse)
-> ((Maybe [MetricDatapoint] -> f (Maybe [MetricDatapoint]))
-> Maybe [MetricDatapoint] -> f (Maybe [MetricDatapoint]))
-> (Maybe [MetricDatapoint] -> f (Maybe [MetricDatapoint]))
-> GetRelationalDatabaseMetricDataResponse
-> f GetRelationalDatabaseMetricDataResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
[MetricDatapoint]
[MetricDatapoint]
[MetricDatapoint]
[MetricDatapoint]
-> Iso
(Maybe [MetricDatapoint])
(Maybe [MetricDatapoint])
(Maybe [MetricDatapoint])
(Maybe [MetricDatapoint])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso
[MetricDatapoint]
[MetricDatapoint]
[MetricDatapoint]
[MetricDatapoint]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
getRelationalDatabaseMetricDataResponse_httpStatus :: Lens.Lens' GetRelationalDatabaseMetricDataResponse Prelude.Int
getRelationalDatabaseMetricDataResponse_httpStatus :: (Int -> f Int)
-> GetRelationalDatabaseMetricDataResponse
-> f GetRelationalDatabaseMetricDataResponse
getRelationalDatabaseMetricDataResponse_httpStatus = (GetRelationalDatabaseMetricDataResponse -> Int)
-> (GetRelationalDatabaseMetricDataResponse
-> Int -> GetRelationalDatabaseMetricDataResponse)
-> Lens
GetRelationalDatabaseMetricDataResponse
GetRelationalDatabaseMetricDataResponse
Int
Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetRelationalDatabaseMetricDataResponse' {Int
httpStatus :: Int
$sel:httpStatus:GetRelationalDatabaseMetricDataResponse' :: GetRelationalDatabaseMetricDataResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: GetRelationalDatabaseMetricDataResponse
s@GetRelationalDatabaseMetricDataResponse' {} Int
a -> GetRelationalDatabaseMetricDataResponse
s {$sel:httpStatus:GetRelationalDatabaseMetricDataResponse' :: Int
httpStatus = Int
a} :: GetRelationalDatabaseMetricDataResponse)
instance
Prelude.NFData
GetRelationalDatabaseMetricDataResponse