{-# 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.CostExplorer.GetReservationUtilization
(
GetReservationUtilization (..),
newGetReservationUtilization,
getReservationUtilization_groupBy,
getReservationUtilization_nextPageToken,
getReservationUtilization_granularity,
getReservationUtilization_filter,
getReservationUtilization_maxResults,
getReservationUtilization_sortBy,
getReservationUtilization_timePeriod,
GetReservationUtilizationResponse (..),
newGetReservationUtilizationResponse,
getReservationUtilizationResponse_nextPageToken,
getReservationUtilizationResponse_total,
getReservationUtilizationResponse_httpStatus,
getReservationUtilizationResponse_utilizationsByTime,
)
where
import qualified Amazonka.Core as Core
import Amazonka.CostExplorer.Types
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data GetReservationUtilization = GetReservationUtilization'
{
GetReservationUtilization -> Maybe [GroupDefinition]
groupBy :: Prelude.Maybe [GroupDefinition],
GetReservationUtilization -> Maybe Text
nextPageToken :: Prelude.Maybe Prelude.Text,
GetReservationUtilization -> Maybe Granularity
granularity :: Prelude.Maybe Granularity,
GetReservationUtilization -> Maybe Expression
filter' :: Prelude.Maybe Expression,
GetReservationUtilization -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
GetReservationUtilization -> Maybe SortDefinition
sortBy :: Prelude.Maybe SortDefinition,
GetReservationUtilization -> DateInterval
timePeriod :: DateInterval
}
deriving (GetReservationUtilization -> GetReservationUtilization -> Bool
(GetReservationUtilization -> GetReservationUtilization -> Bool)
-> (GetReservationUtilization -> GetReservationUtilization -> Bool)
-> Eq GetReservationUtilization
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetReservationUtilization -> GetReservationUtilization -> Bool
$c/= :: GetReservationUtilization -> GetReservationUtilization -> Bool
== :: GetReservationUtilization -> GetReservationUtilization -> Bool
$c== :: GetReservationUtilization -> GetReservationUtilization -> Bool
Prelude.Eq, ReadPrec [GetReservationUtilization]
ReadPrec GetReservationUtilization
Int -> ReadS GetReservationUtilization
ReadS [GetReservationUtilization]
(Int -> ReadS GetReservationUtilization)
-> ReadS [GetReservationUtilization]
-> ReadPrec GetReservationUtilization
-> ReadPrec [GetReservationUtilization]
-> Read GetReservationUtilization
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetReservationUtilization]
$creadListPrec :: ReadPrec [GetReservationUtilization]
readPrec :: ReadPrec GetReservationUtilization
$creadPrec :: ReadPrec GetReservationUtilization
readList :: ReadS [GetReservationUtilization]
$creadList :: ReadS [GetReservationUtilization]
readsPrec :: Int -> ReadS GetReservationUtilization
$creadsPrec :: Int -> ReadS GetReservationUtilization
Prelude.Read, Int -> GetReservationUtilization -> ShowS
[GetReservationUtilization] -> ShowS
GetReservationUtilization -> String
(Int -> GetReservationUtilization -> ShowS)
-> (GetReservationUtilization -> String)
-> ([GetReservationUtilization] -> ShowS)
-> Show GetReservationUtilization
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetReservationUtilization] -> ShowS
$cshowList :: [GetReservationUtilization] -> ShowS
show :: GetReservationUtilization -> String
$cshow :: GetReservationUtilization -> String
showsPrec :: Int -> GetReservationUtilization -> ShowS
$cshowsPrec :: Int -> GetReservationUtilization -> ShowS
Prelude.Show, (forall x.
GetReservationUtilization -> Rep GetReservationUtilization x)
-> (forall x.
Rep GetReservationUtilization x -> GetReservationUtilization)
-> Generic GetReservationUtilization
forall x.
Rep GetReservationUtilization x -> GetReservationUtilization
forall x.
GetReservationUtilization -> Rep GetReservationUtilization x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetReservationUtilization x -> GetReservationUtilization
$cfrom :: forall x.
GetReservationUtilization -> Rep GetReservationUtilization x
Prelude.Generic)
newGetReservationUtilization ::
DateInterval ->
GetReservationUtilization
newGetReservationUtilization :: DateInterval -> GetReservationUtilization
newGetReservationUtilization DateInterval
pTimePeriod_ =
GetReservationUtilization' :: Maybe [GroupDefinition]
-> Maybe Text
-> Maybe Granularity
-> Maybe Expression
-> Maybe Natural
-> Maybe SortDefinition
-> DateInterval
-> GetReservationUtilization
GetReservationUtilization'
{ $sel:groupBy:GetReservationUtilization' :: Maybe [GroupDefinition]
groupBy =
Maybe [GroupDefinition]
forall a. Maybe a
Prelude.Nothing,
$sel:nextPageToken:GetReservationUtilization' :: Maybe Text
nextPageToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:granularity:GetReservationUtilization' :: Maybe Granularity
granularity = Maybe Granularity
forall a. Maybe a
Prelude.Nothing,
$sel:filter':GetReservationUtilization' :: Maybe Expression
filter' = Maybe Expression
forall a. Maybe a
Prelude.Nothing,
$sel:maxResults:GetReservationUtilization' :: Maybe Natural
maxResults = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
$sel:sortBy:GetReservationUtilization' :: Maybe SortDefinition
sortBy = Maybe SortDefinition
forall a. Maybe a
Prelude.Nothing,
$sel:timePeriod:GetReservationUtilization' :: DateInterval
timePeriod = DateInterval
pTimePeriod_
}
getReservationUtilization_groupBy :: Lens.Lens' GetReservationUtilization (Prelude.Maybe [GroupDefinition])
getReservationUtilization_groupBy :: (Maybe [GroupDefinition] -> f (Maybe [GroupDefinition]))
-> GetReservationUtilization -> f GetReservationUtilization
getReservationUtilization_groupBy = (GetReservationUtilization -> Maybe [GroupDefinition])
-> (GetReservationUtilization
-> Maybe [GroupDefinition] -> GetReservationUtilization)
-> Lens
GetReservationUtilization
GetReservationUtilization
(Maybe [GroupDefinition])
(Maybe [GroupDefinition])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetReservationUtilization' {Maybe [GroupDefinition]
groupBy :: Maybe [GroupDefinition]
$sel:groupBy:GetReservationUtilization' :: GetReservationUtilization -> Maybe [GroupDefinition]
groupBy} -> Maybe [GroupDefinition]
groupBy) (\s :: GetReservationUtilization
s@GetReservationUtilization' {} Maybe [GroupDefinition]
a -> GetReservationUtilization
s {$sel:groupBy:GetReservationUtilization' :: Maybe [GroupDefinition]
groupBy = Maybe [GroupDefinition]
a} :: GetReservationUtilization) ((Maybe [GroupDefinition] -> f (Maybe [GroupDefinition]))
-> GetReservationUtilization -> f GetReservationUtilization)
-> ((Maybe [GroupDefinition] -> f (Maybe [GroupDefinition]))
-> Maybe [GroupDefinition] -> f (Maybe [GroupDefinition]))
-> (Maybe [GroupDefinition] -> f (Maybe [GroupDefinition]))
-> GetReservationUtilization
-> f GetReservationUtilization
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
[GroupDefinition]
[GroupDefinition]
[GroupDefinition]
[GroupDefinition]
-> Iso
(Maybe [GroupDefinition])
(Maybe [GroupDefinition])
(Maybe [GroupDefinition])
(Maybe [GroupDefinition])
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
[GroupDefinition]
[GroupDefinition]
[GroupDefinition]
[GroupDefinition]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
getReservationUtilization_nextPageToken :: Lens.Lens' GetReservationUtilization (Prelude.Maybe Prelude.Text)
getReservationUtilization_nextPageToken :: (Maybe Text -> f (Maybe Text))
-> GetReservationUtilization -> f GetReservationUtilization
getReservationUtilization_nextPageToken = (GetReservationUtilization -> Maybe Text)
-> (GetReservationUtilization
-> Maybe Text -> GetReservationUtilization)
-> Lens
GetReservationUtilization
GetReservationUtilization
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetReservationUtilization' {Maybe Text
nextPageToken :: Maybe Text
$sel:nextPageToken:GetReservationUtilization' :: GetReservationUtilization -> Maybe Text
nextPageToken} -> Maybe Text
nextPageToken) (\s :: GetReservationUtilization
s@GetReservationUtilization' {} Maybe Text
a -> GetReservationUtilization
s {$sel:nextPageToken:GetReservationUtilization' :: Maybe Text
nextPageToken = Maybe Text
a} :: GetReservationUtilization)
getReservationUtilization_granularity :: Lens.Lens' GetReservationUtilization (Prelude.Maybe Granularity)
getReservationUtilization_granularity :: (Maybe Granularity -> f (Maybe Granularity))
-> GetReservationUtilization -> f GetReservationUtilization
getReservationUtilization_granularity = (GetReservationUtilization -> Maybe Granularity)
-> (GetReservationUtilization
-> Maybe Granularity -> GetReservationUtilization)
-> Lens
GetReservationUtilization
GetReservationUtilization
(Maybe Granularity)
(Maybe Granularity)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetReservationUtilization' {Maybe Granularity
granularity :: Maybe Granularity
$sel:granularity:GetReservationUtilization' :: GetReservationUtilization -> Maybe Granularity
granularity} -> Maybe Granularity
granularity) (\s :: GetReservationUtilization
s@GetReservationUtilization' {} Maybe Granularity
a -> GetReservationUtilization
s {$sel:granularity:GetReservationUtilization' :: Maybe Granularity
granularity = Maybe Granularity
a} :: GetReservationUtilization)
getReservationUtilization_filter :: Lens.Lens' GetReservationUtilization (Prelude.Maybe Expression)
getReservationUtilization_filter :: (Maybe Expression -> f (Maybe Expression))
-> GetReservationUtilization -> f GetReservationUtilization
getReservationUtilization_filter = (GetReservationUtilization -> Maybe Expression)
-> (GetReservationUtilization
-> Maybe Expression -> GetReservationUtilization)
-> Lens
GetReservationUtilization
GetReservationUtilization
(Maybe Expression)
(Maybe Expression)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetReservationUtilization' {Maybe Expression
filter' :: Maybe Expression
$sel:filter':GetReservationUtilization' :: GetReservationUtilization -> Maybe Expression
filter'} -> Maybe Expression
filter') (\s :: GetReservationUtilization
s@GetReservationUtilization' {} Maybe Expression
a -> GetReservationUtilization
s {$sel:filter':GetReservationUtilization' :: Maybe Expression
filter' = Maybe Expression
a} :: GetReservationUtilization)
getReservationUtilization_maxResults :: Lens.Lens' GetReservationUtilization (Prelude.Maybe Prelude.Natural)
getReservationUtilization_maxResults :: (Maybe Natural -> f (Maybe Natural))
-> GetReservationUtilization -> f GetReservationUtilization
getReservationUtilization_maxResults = (GetReservationUtilization -> Maybe Natural)
-> (GetReservationUtilization
-> Maybe Natural -> GetReservationUtilization)
-> Lens
GetReservationUtilization
GetReservationUtilization
(Maybe Natural)
(Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetReservationUtilization' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:GetReservationUtilization' :: GetReservationUtilization -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: GetReservationUtilization
s@GetReservationUtilization' {} Maybe Natural
a -> GetReservationUtilization
s {$sel:maxResults:GetReservationUtilization' :: Maybe Natural
maxResults = Maybe Natural
a} :: GetReservationUtilization)
getReservationUtilization_sortBy :: Lens.Lens' GetReservationUtilization (Prelude.Maybe SortDefinition)
getReservationUtilization_sortBy :: (Maybe SortDefinition -> f (Maybe SortDefinition))
-> GetReservationUtilization -> f GetReservationUtilization
getReservationUtilization_sortBy = (GetReservationUtilization -> Maybe SortDefinition)
-> (GetReservationUtilization
-> Maybe SortDefinition -> GetReservationUtilization)
-> Lens
GetReservationUtilization
GetReservationUtilization
(Maybe SortDefinition)
(Maybe SortDefinition)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetReservationUtilization' {Maybe SortDefinition
sortBy :: Maybe SortDefinition
$sel:sortBy:GetReservationUtilization' :: GetReservationUtilization -> Maybe SortDefinition
sortBy} -> Maybe SortDefinition
sortBy) (\s :: GetReservationUtilization
s@GetReservationUtilization' {} Maybe SortDefinition
a -> GetReservationUtilization
s {$sel:sortBy:GetReservationUtilization' :: Maybe SortDefinition
sortBy = Maybe SortDefinition
a} :: GetReservationUtilization)
getReservationUtilization_timePeriod :: Lens.Lens' GetReservationUtilization DateInterval
getReservationUtilization_timePeriod :: (DateInterval -> f DateInterval)
-> GetReservationUtilization -> f GetReservationUtilization
getReservationUtilization_timePeriod = (GetReservationUtilization -> DateInterval)
-> (GetReservationUtilization
-> DateInterval -> GetReservationUtilization)
-> Lens
GetReservationUtilization
GetReservationUtilization
DateInterval
DateInterval
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetReservationUtilization' {DateInterval
timePeriod :: DateInterval
$sel:timePeriod:GetReservationUtilization' :: GetReservationUtilization -> DateInterval
timePeriod} -> DateInterval
timePeriod) (\s :: GetReservationUtilization
s@GetReservationUtilization' {} DateInterval
a -> GetReservationUtilization
s {$sel:timePeriod:GetReservationUtilization' :: DateInterval
timePeriod = DateInterval
a} :: GetReservationUtilization)
instance Core.AWSRequest GetReservationUtilization where
type
AWSResponse GetReservationUtilization =
GetReservationUtilizationResponse
request :: GetReservationUtilization -> Request GetReservationUtilization
request = Service
-> GetReservationUtilization -> Request GetReservationUtilization
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy GetReservationUtilization
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse GetReservationUtilization)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse GetReservationUtilization))
-> Logger
-> Service
-> Proxy GetReservationUtilization
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse GetReservationUtilization)))
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 Text
-> Maybe ReservationAggregates
-> Int
-> [UtilizationByTime]
-> GetReservationUtilizationResponse
GetReservationUtilizationResponse'
(Maybe Text
-> Maybe ReservationAggregates
-> Int
-> [UtilizationByTime]
-> GetReservationUtilizationResponse)
-> Either String (Maybe Text)
-> Either
String
(Maybe ReservationAggregates
-> Int -> [UtilizationByTime] -> GetReservationUtilizationResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"NextPageToken")
Either
String
(Maybe ReservationAggregates
-> Int -> [UtilizationByTime] -> GetReservationUtilizationResponse)
-> Either String (Maybe ReservationAggregates)
-> Either
String
(Int -> [UtilizationByTime] -> GetReservationUtilizationResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe ReservationAggregates)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"Total")
Either
String
(Int -> [UtilizationByTime] -> GetReservationUtilizationResponse)
-> Either String Int
-> Either
String ([UtilizationByTime] -> GetReservationUtilizationResponse)
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))
Either
String ([UtilizationByTime] -> GetReservationUtilizationResponse)
-> Either String [UtilizationByTime]
-> Either String GetReservationUtilizationResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object -> Text -> Either String (Maybe [UtilizationByTime])
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"UtilizationsByTime"
Either String (Maybe [UtilizationByTime])
-> [UtilizationByTime] -> Either String [UtilizationByTime]
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ [UtilizationByTime]
forall a. Monoid a => a
Prelude.mempty
)
)
instance Prelude.Hashable GetReservationUtilization
instance Prelude.NFData GetReservationUtilization
instance Core.ToHeaders GetReservationUtilization where
toHeaders :: GetReservationUtilization -> ResponseHeaders
toHeaders =
ResponseHeaders -> GetReservationUtilization -> 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
"AWSInsightsIndexService.GetReservationUtilization" ::
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 GetReservationUtilization where
toJSON :: GetReservationUtilization -> Value
toJSON GetReservationUtilization' {Maybe Natural
Maybe [GroupDefinition]
Maybe Text
Maybe Granularity
Maybe SortDefinition
Maybe Expression
DateInterval
timePeriod :: DateInterval
sortBy :: Maybe SortDefinition
maxResults :: Maybe Natural
filter' :: Maybe Expression
granularity :: Maybe Granularity
nextPageToken :: Maybe Text
groupBy :: Maybe [GroupDefinition]
$sel:timePeriod:GetReservationUtilization' :: GetReservationUtilization -> DateInterval
$sel:sortBy:GetReservationUtilization' :: GetReservationUtilization -> Maybe SortDefinition
$sel:maxResults:GetReservationUtilization' :: GetReservationUtilization -> Maybe Natural
$sel:filter':GetReservationUtilization' :: GetReservationUtilization -> Maybe Expression
$sel:granularity:GetReservationUtilization' :: GetReservationUtilization -> Maybe Granularity
$sel:nextPageToken:GetReservationUtilization' :: GetReservationUtilization -> Maybe Text
$sel:groupBy:GetReservationUtilization' :: GetReservationUtilization -> Maybe [GroupDefinition]
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"GroupBy" Text -> [GroupDefinition] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) ([GroupDefinition] -> Pair)
-> Maybe [GroupDefinition] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [GroupDefinition]
groupBy,
(Text
"NextPageToken" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
nextPageToken,
(Text
"Granularity" Text -> Granularity -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Granularity -> Pair) -> Maybe Granularity -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Granularity
granularity,
(Text
"Filter" Text -> Expression -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Expression -> Pair) -> Maybe Expression -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Expression
filter',
(Text
"MaxResults" Text -> Natural -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Natural -> Pair) -> Maybe Natural -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
maxResults,
(Text
"SortBy" Text -> SortDefinition -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (SortDefinition -> Pair) -> Maybe SortDefinition -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe SortDefinition
sortBy,
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"TimePeriod" Text -> DateInterval -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= DateInterval
timePeriod)
]
)
instance Core.ToPath GetReservationUtilization where
toPath :: GetReservationUtilization -> ByteString
toPath = ByteString -> GetReservationUtilization -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery GetReservationUtilization where
toQuery :: GetReservationUtilization -> QueryString
toQuery = QueryString -> GetReservationUtilization -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data GetReservationUtilizationResponse = GetReservationUtilizationResponse'
{
GetReservationUtilizationResponse -> Maybe Text
nextPageToken :: Prelude.Maybe Prelude.Text,
GetReservationUtilizationResponse -> Maybe ReservationAggregates
total :: Prelude.Maybe ReservationAggregates,
GetReservationUtilizationResponse -> Int
httpStatus :: Prelude.Int,
GetReservationUtilizationResponse -> [UtilizationByTime]
utilizationsByTime :: [UtilizationByTime]
}
deriving (GetReservationUtilizationResponse
-> GetReservationUtilizationResponse -> Bool
(GetReservationUtilizationResponse
-> GetReservationUtilizationResponse -> Bool)
-> (GetReservationUtilizationResponse
-> GetReservationUtilizationResponse -> Bool)
-> Eq GetReservationUtilizationResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetReservationUtilizationResponse
-> GetReservationUtilizationResponse -> Bool
$c/= :: GetReservationUtilizationResponse
-> GetReservationUtilizationResponse -> Bool
== :: GetReservationUtilizationResponse
-> GetReservationUtilizationResponse -> Bool
$c== :: GetReservationUtilizationResponse
-> GetReservationUtilizationResponse -> Bool
Prelude.Eq, ReadPrec [GetReservationUtilizationResponse]
ReadPrec GetReservationUtilizationResponse
Int -> ReadS GetReservationUtilizationResponse
ReadS [GetReservationUtilizationResponse]
(Int -> ReadS GetReservationUtilizationResponse)
-> ReadS [GetReservationUtilizationResponse]
-> ReadPrec GetReservationUtilizationResponse
-> ReadPrec [GetReservationUtilizationResponse]
-> Read GetReservationUtilizationResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetReservationUtilizationResponse]
$creadListPrec :: ReadPrec [GetReservationUtilizationResponse]
readPrec :: ReadPrec GetReservationUtilizationResponse
$creadPrec :: ReadPrec GetReservationUtilizationResponse
readList :: ReadS [GetReservationUtilizationResponse]
$creadList :: ReadS [GetReservationUtilizationResponse]
readsPrec :: Int -> ReadS GetReservationUtilizationResponse
$creadsPrec :: Int -> ReadS GetReservationUtilizationResponse
Prelude.Read, Int -> GetReservationUtilizationResponse -> ShowS
[GetReservationUtilizationResponse] -> ShowS
GetReservationUtilizationResponse -> String
(Int -> GetReservationUtilizationResponse -> ShowS)
-> (GetReservationUtilizationResponse -> String)
-> ([GetReservationUtilizationResponse] -> ShowS)
-> Show GetReservationUtilizationResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetReservationUtilizationResponse] -> ShowS
$cshowList :: [GetReservationUtilizationResponse] -> ShowS
show :: GetReservationUtilizationResponse -> String
$cshow :: GetReservationUtilizationResponse -> String
showsPrec :: Int -> GetReservationUtilizationResponse -> ShowS
$cshowsPrec :: Int -> GetReservationUtilizationResponse -> ShowS
Prelude.Show, (forall x.
GetReservationUtilizationResponse
-> Rep GetReservationUtilizationResponse x)
-> (forall x.
Rep GetReservationUtilizationResponse x
-> GetReservationUtilizationResponse)
-> Generic GetReservationUtilizationResponse
forall x.
Rep GetReservationUtilizationResponse x
-> GetReservationUtilizationResponse
forall x.
GetReservationUtilizationResponse
-> Rep GetReservationUtilizationResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetReservationUtilizationResponse x
-> GetReservationUtilizationResponse
$cfrom :: forall x.
GetReservationUtilizationResponse
-> Rep GetReservationUtilizationResponse x
Prelude.Generic)
newGetReservationUtilizationResponse ::
Prelude.Int ->
GetReservationUtilizationResponse
newGetReservationUtilizationResponse :: Int -> GetReservationUtilizationResponse
newGetReservationUtilizationResponse Int
pHttpStatus_ =
GetReservationUtilizationResponse' :: Maybe Text
-> Maybe ReservationAggregates
-> Int
-> [UtilizationByTime]
-> GetReservationUtilizationResponse
GetReservationUtilizationResponse'
{ $sel:nextPageToken:GetReservationUtilizationResponse' :: Maybe Text
nextPageToken =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:total:GetReservationUtilizationResponse' :: Maybe ReservationAggregates
total = Maybe ReservationAggregates
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:GetReservationUtilizationResponse' :: Int
httpStatus = Int
pHttpStatus_,
$sel:utilizationsByTime:GetReservationUtilizationResponse' :: [UtilizationByTime]
utilizationsByTime = [UtilizationByTime]
forall a. Monoid a => a
Prelude.mempty
}
getReservationUtilizationResponse_nextPageToken :: Lens.Lens' GetReservationUtilizationResponse (Prelude.Maybe Prelude.Text)
getReservationUtilizationResponse_nextPageToken :: (Maybe Text -> f (Maybe Text))
-> GetReservationUtilizationResponse
-> f GetReservationUtilizationResponse
getReservationUtilizationResponse_nextPageToken = (GetReservationUtilizationResponse -> Maybe Text)
-> (GetReservationUtilizationResponse
-> Maybe Text -> GetReservationUtilizationResponse)
-> Lens
GetReservationUtilizationResponse
GetReservationUtilizationResponse
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetReservationUtilizationResponse' {Maybe Text
nextPageToken :: Maybe Text
$sel:nextPageToken:GetReservationUtilizationResponse' :: GetReservationUtilizationResponse -> Maybe Text
nextPageToken} -> Maybe Text
nextPageToken) (\s :: GetReservationUtilizationResponse
s@GetReservationUtilizationResponse' {} Maybe Text
a -> GetReservationUtilizationResponse
s {$sel:nextPageToken:GetReservationUtilizationResponse' :: Maybe Text
nextPageToken = Maybe Text
a} :: GetReservationUtilizationResponse)
getReservationUtilizationResponse_total :: Lens.Lens' GetReservationUtilizationResponse (Prelude.Maybe ReservationAggregates)
getReservationUtilizationResponse_total :: (Maybe ReservationAggregates -> f (Maybe ReservationAggregates))
-> GetReservationUtilizationResponse
-> f GetReservationUtilizationResponse
getReservationUtilizationResponse_total = (GetReservationUtilizationResponse -> Maybe ReservationAggregates)
-> (GetReservationUtilizationResponse
-> Maybe ReservationAggregates
-> GetReservationUtilizationResponse)
-> Lens
GetReservationUtilizationResponse
GetReservationUtilizationResponse
(Maybe ReservationAggregates)
(Maybe ReservationAggregates)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetReservationUtilizationResponse' {Maybe ReservationAggregates
total :: Maybe ReservationAggregates
$sel:total:GetReservationUtilizationResponse' :: GetReservationUtilizationResponse -> Maybe ReservationAggregates
total} -> Maybe ReservationAggregates
total) (\s :: GetReservationUtilizationResponse
s@GetReservationUtilizationResponse' {} Maybe ReservationAggregates
a -> GetReservationUtilizationResponse
s {$sel:total:GetReservationUtilizationResponse' :: Maybe ReservationAggregates
total = Maybe ReservationAggregates
a} :: GetReservationUtilizationResponse)
getReservationUtilizationResponse_httpStatus :: Lens.Lens' GetReservationUtilizationResponse Prelude.Int
getReservationUtilizationResponse_httpStatus :: (Int -> f Int)
-> GetReservationUtilizationResponse
-> f GetReservationUtilizationResponse
getReservationUtilizationResponse_httpStatus = (GetReservationUtilizationResponse -> Int)
-> (GetReservationUtilizationResponse
-> Int -> GetReservationUtilizationResponse)
-> Lens
GetReservationUtilizationResponse
GetReservationUtilizationResponse
Int
Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetReservationUtilizationResponse' {Int
httpStatus :: Int
$sel:httpStatus:GetReservationUtilizationResponse' :: GetReservationUtilizationResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: GetReservationUtilizationResponse
s@GetReservationUtilizationResponse' {} Int
a -> GetReservationUtilizationResponse
s {$sel:httpStatus:GetReservationUtilizationResponse' :: Int
httpStatus = Int
a} :: GetReservationUtilizationResponse)
getReservationUtilizationResponse_utilizationsByTime :: Lens.Lens' GetReservationUtilizationResponse [UtilizationByTime]
getReservationUtilizationResponse_utilizationsByTime :: ([UtilizationByTime] -> f [UtilizationByTime])
-> GetReservationUtilizationResponse
-> f GetReservationUtilizationResponse
getReservationUtilizationResponse_utilizationsByTime = (GetReservationUtilizationResponse -> [UtilizationByTime])
-> (GetReservationUtilizationResponse
-> [UtilizationByTime] -> GetReservationUtilizationResponse)
-> Lens
GetReservationUtilizationResponse
GetReservationUtilizationResponse
[UtilizationByTime]
[UtilizationByTime]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetReservationUtilizationResponse' {[UtilizationByTime]
utilizationsByTime :: [UtilizationByTime]
$sel:utilizationsByTime:GetReservationUtilizationResponse' :: GetReservationUtilizationResponse -> [UtilizationByTime]
utilizationsByTime} -> [UtilizationByTime]
utilizationsByTime) (\s :: GetReservationUtilizationResponse
s@GetReservationUtilizationResponse' {} [UtilizationByTime]
a -> GetReservationUtilizationResponse
s {$sel:utilizationsByTime:GetReservationUtilizationResponse' :: [UtilizationByTime]
utilizationsByTime = [UtilizationByTime]
a} :: GetReservationUtilizationResponse) (([UtilizationByTime] -> f [UtilizationByTime])
-> GetReservationUtilizationResponse
-> f GetReservationUtilizationResponse)
-> (([UtilizationByTime] -> f [UtilizationByTime])
-> [UtilizationByTime] -> f [UtilizationByTime])
-> ([UtilizationByTime] -> f [UtilizationByTime])
-> GetReservationUtilizationResponse
-> f GetReservationUtilizationResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([UtilizationByTime] -> f [UtilizationByTime])
-> [UtilizationByTime] -> f [UtilizationByTime]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
instance
Prelude.NFData
GetReservationUtilizationResponse