{-# 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.GetReservationCoverage
(
GetReservationCoverage (..),
newGetReservationCoverage,
getReservationCoverage_groupBy,
getReservationCoverage_nextPageToken,
getReservationCoverage_metrics,
getReservationCoverage_granularity,
getReservationCoverage_filter,
getReservationCoverage_maxResults,
getReservationCoverage_sortBy,
getReservationCoverage_timePeriod,
GetReservationCoverageResponse (..),
newGetReservationCoverageResponse,
getReservationCoverageResponse_nextPageToken,
getReservationCoverageResponse_total,
getReservationCoverageResponse_httpStatus,
getReservationCoverageResponse_coveragesByTime,
)
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 GetReservationCoverage = GetReservationCoverage'
{
GetReservationCoverage -> Maybe [GroupDefinition]
groupBy :: Prelude.Maybe [GroupDefinition],
GetReservationCoverage -> Maybe Text
nextPageToken :: Prelude.Maybe Prelude.Text,
GetReservationCoverage -> Maybe [Text]
metrics :: Prelude.Maybe [Prelude.Text],
GetReservationCoverage -> Maybe Granularity
granularity :: Prelude.Maybe Granularity,
GetReservationCoverage -> Maybe Expression
filter' :: Prelude.Maybe Expression,
GetReservationCoverage -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
GetReservationCoverage -> Maybe SortDefinition
sortBy :: Prelude.Maybe SortDefinition,
GetReservationCoverage -> DateInterval
timePeriod :: DateInterval
}
deriving (GetReservationCoverage -> GetReservationCoverage -> Bool
(GetReservationCoverage -> GetReservationCoverage -> Bool)
-> (GetReservationCoverage -> GetReservationCoverage -> Bool)
-> Eq GetReservationCoverage
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetReservationCoverage -> GetReservationCoverage -> Bool
$c/= :: GetReservationCoverage -> GetReservationCoverage -> Bool
== :: GetReservationCoverage -> GetReservationCoverage -> Bool
$c== :: GetReservationCoverage -> GetReservationCoverage -> Bool
Prelude.Eq, ReadPrec [GetReservationCoverage]
ReadPrec GetReservationCoverage
Int -> ReadS GetReservationCoverage
ReadS [GetReservationCoverage]
(Int -> ReadS GetReservationCoverage)
-> ReadS [GetReservationCoverage]
-> ReadPrec GetReservationCoverage
-> ReadPrec [GetReservationCoverage]
-> Read GetReservationCoverage
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetReservationCoverage]
$creadListPrec :: ReadPrec [GetReservationCoverage]
readPrec :: ReadPrec GetReservationCoverage
$creadPrec :: ReadPrec GetReservationCoverage
readList :: ReadS [GetReservationCoverage]
$creadList :: ReadS [GetReservationCoverage]
readsPrec :: Int -> ReadS GetReservationCoverage
$creadsPrec :: Int -> ReadS GetReservationCoverage
Prelude.Read, Int -> GetReservationCoverage -> ShowS
[GetReservationCoverage] -> ShowS
GetReservationCoverage -> String
(Int -> GetReservationCoverage -> ShowS)
-> (GetReservationCoverage -> String)
-> ([GetReservationCoverage] -> ShowS)
-> Show GetReservationCoverage
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetReservationCoverage] -> ShowS
$cshowList :: [GetReservationCoverage] -> ShowS
show :: GetReservationCoverage -> String
$cshow :: GetReservationCoverage -> String
showsPrec :: Int -> GetReservationCoverage -> ShowS
$cshowsPrec :: Int -> GetReservationCoverage -> ShowS
Prelude.Show, (forall x. GetReservationCoverage -> Rep GetReservationCoverage x)
-> (forall x.
Rep GetReservationCoverage x -> GetReservationCoverage)
-> Generic GetReservationCoverage
forall x. Rep GetReservationCoverage x -> GetReservationCoverage
forall x. GetReservationCoverage -> Rep GetReservationCoverage x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetReservationCoverage x -> GetReservationCoverage
$cfrom :: forall x. GetReservationCoverage -> Rep GetReservationCoverage x
Prelude.Generic)
newGetReservationCoverage ::
DateInterval ->
GetReservationCoverage
newGetReservationCoverage :: DateInterval -> GetReservationCoverage
newGetReservationCoverage DateInterval
pTimePeriod_ =
GetReservationCoverage' :: Maybe [GroupDefinition]
-> Maybe Text
-> Maybe [Text]
-> Maybe Granularity
-> Maybe Expression
-> Maybe Natural
-> Maybe SortDefinition
-> DateInterval
-> GetReservationCoverage
GetReservationCoverage'
{ $sel:groupBy:GetReservationCoverage' :: Maybe [GroupDefinition]
groupBy = Maybe [GroupDefinition]
forall a. Maybe a
Prelude.Nothing,
$sel:nextPageToken:GetReservationCoverage' :: Maybe Text
nextPageToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:metrics:GetReservationCoverage' :: Maybe [Text]
metrics = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
$sel:granularity:GetReservationCoverage' :: Maybe Granularity
granularity = Maybe Granularity
forall a. Maybe a
Prelude.Nothing,
$sel:filter':GetReservationCoverage' :: Maybe Expression
filter' = Maybe Expression
forall a. Maybe a
Prelude.Nothing,
$sel:maxResults:GetReservationCoverage' :: Maybe Natural
maxResults = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
$sel:sortBy:GetReservationCoverage' :: Maybe SortDefinition
sortBy = Maybe SortDefinition
forall a. Maybe a
Prelude.Nothing,
$sel:timePeriod:GetReservationCoverage' :: DateInterval
timePeriod = DateInterval
pTimePeriod_
}
getReservationCoverage_groupBy :: Lens.Lens' GetReservationCoverage (Prelude.Maybe [GroupDefinition])
getReservationCoverage_groupBy :: (Maybe [GroupDefinition] -> f (Maybe [GroupDefinition]))
-> GetReservationCoverage -> f GetReservationCoverage
getReservationCoverage_groupBy = (GetReservationCoverage -> Maybe [GroupDefinition])
-> (GetReservationCoverage
-> Maybe [GroupDefinition] -> GetReservationCoverage)
-> Lens
GetReservationCoverage
GetReservationCoverage
(Maybe [GroupDefinition])
(Maybe [GroupDefinition])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetReservationCoverage' {Maybe [GroupDefinition]
groupBy :: Maybe [GroupDefinition]
$sel:groupBy:GetReservationCoverage' :: GetReservationCoverage -> Maybe [GroupDefinition]
groupBy} -> Maybe [GroupDefinition]
groupBy) (\s :: GetReservationCoverage
s@GetReservationCoverage' {} Maybe [GroupDefinition]
a -> GetReservationCoverage
s {$sel:groupBy:GetReservationCoverage' :: Maybe [GroupDefinition]
groupBy = Maybe [GroupDefinition]
a} :: GetReservationCoverage) ((Maybe [GroupDefinition] -> f (Maybe [GroupDefinition]))
-> GetReservationCoverage -> f GetReservationCoverage)
-> ((Maybe [GroupDefinition] -> f (Maybe [GroupDefinition]))
-> Maybe [GroupDefinition] -> f (Maybe [GroupDefinition]))
-> (Maybe [GroupDefinition] -> f (Maybe [GroupDefinition]))
-> GetReservationCoverage
-> f GetReservationCoverage
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
getReservationCoverage_nextPageToken :: Lens.Lens' GetReservationCoverage (Prelude.Maybe Prelude.Text)
getReservationCoverage_nextPageToken :: (Maybe Text -> f (Maybe Text))
-> GetReservationCoverage -> f GetReservationCoverage
getReservationCoverage_nextPageToken = (GetReservationCoverage -> Maybe Text)
-> (GetReservationCoverage -> Maybe Text -> GetReservationCoverage)
-> Lens
GetReservationCoverage
GetReservationCoverage
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetReservationCoverage' {Maybe Text
nextPageToken :: Maybe Text
$sel:nextPageToken:GetReservationCoverage' :: GetReservationCoverage -> Maybe Text
nextPageToken} -> Maybe Text
nextPageToken) (\s :: GetReservationCoverage
s@GetReservationCoverage' {} Maybe Text
a -> GetReservationCoverage
s {$sel:nextPageToken:GetReservationCoverage' :: Maybe Text
nextPageToken = Maybe Text
a} :: GetReservationCoverage)
getReservationCoverage_metrics :: Lens.Lens' GetReservationCoverage (Prelude.Maybe [Prelude.Text])
getReservationCoverage_metrics :: (Maybe [Text] -> f (Maybe [Text]))
-> GetReservationCoverage -> f GetReservationCoverage
getReservationCoverage_metrics = (GetReservationCoverage -> Maybe [Text])
-> (GetReservationCoverage
-> Maybe [Text] -> GetReservationCoverage)
-> Lens
GetReservationCoverage
GetReservationCoverage
(Maybe [Text])
(Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetReservationCoverage' {Maybe [Text]
metrics :: Maybe [Text]
$sel:metrics:GetReservationCoverage' :: GetReservationCoverage -> Maybe [Text]
metrics} -> Maybe [Text]
metrics) (\s :: GetReservationCoverage
s@GetReservationCoverage' {} Maybe [Text]
a -> GetReservationCoverage
s {$sel:metrics:GetReservationCoverage' :: Maybe [Text]
metrics = Maybe [Text]
a} :: GetReservationCoverage) ((Maybe [Text] -> f (Maybe [Text]))
-> GetReservationCoverage -> f GetReservationCoverage)
-> ((Maybe [Text] -> f (Maybe [Text]))
-> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> GetReservationCoverage
-> f GetReservationCoverage
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [Text]) (Maybe [Text]) (Maybe [Text])
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 [Text] [Text] [Text] [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
getReservationCoverage_granularity :: Lens.Lens' GetReservationCoverage (Prelude.Maybe Granularity)
getReservationCoverage_granularity :: (Maybe Granularity -> f (Maybe Granularity))
-> GetReservationCoverage -> f GetReservationCoverage
getReservationCoverage_granularity = (GetReservationCoverage -> Maybe Granularity)
-> (GetReservationCoverage
-> Maybe Granularity -> GetReservationCoverage)
-> Lens
GetReservationCoverage
GetReservationCoverage
(Maybe Granularity)
(Maybe Granularity)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetReservationCoverage' {Maybe Granularity
granularity :: Maybe Granularity
$sel:granularity:GetReservationCoverage' :: GetReservationCoverage -> Maybe Granularity
granularity} -> Maybe Granularity
granularity) (\s :: GetReservationCoverage
s@GetReservationCoverage' {} Maybe Granularity
a -> GetReservationCoverage
s {$sel:granularity:GetReservationCoverage' :: Maybe Granularity
granularity = Maybe Granularity
a} :: GetReservationCoverage)
getReservationCoverage_filter :: Lens.Lens' GetReservationCoverage (Prelude.Maybe Expression)
getReservationCoverage_filter :: (Maybe Expression -> f (Maybe Expression))
-> GetReservationCoverage -> f GetReservationCoverage
getReservationCoverage_filter = (GetReservationCoverage -> Maybe Expression)
-> (GetReservationCoverage
-> Maybe Expression -> GetReservationCoverage)
-> Lens
GetReservationCoverage
GetReservationCoverage
(Maybe Expression)
(Maybe Expression)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetReservationCoverage' {Maybe Expression
filter' :: Maybe Expression
$sel:filter':GetReservationCoverage' :: GetReservationCoverage -> Maybe Expression
filter'} -> Maybe Expression
filter') (\s :: GetReservationCoverage
s@GetReservationCoverage' {} Maybe Expression
a -> GetReservationCoverage
s {$sel:filter':GetReservationCoverage' :: Maybe Expression
filter' = Maybe Expression
a} :: GetReservationCoverage)
getReservationCoverage_maxResults :: Lens.Lens' GetReservationCoverage (Prelude.Maybe Prelude.Natural)
getReservationCoverage_maxResults :: (Maybe Natural -> f (Maybe Natural))
-> GetReservationCoverage -> f GetReservationCoverage
getReservationCoverage_maxResults = (GetReservationCoverage -> Maybe Natural)
-> (GetReservationCoverage
-> Maybe Natural -> GetReservationCoverage)
-> Lens
GetReservationCoverage
GetReservationCoverage
(Maybe Natural)
(Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetReservationCoverage' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:GetReservationCoverage' :: GetReservationCoverage -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: GetReservationCoverage
s@GetReservationCoverage' {} Maybe Natural
a -> GetReservationCoverage
s {$sel:maxResults:GetReservationCoverage' :: Maybe Natural
maxResults = Maybe Natural
a} :: GetReservationCoverage)
getReservationCoverage_sortBy :: Lens.Lens' GetReservationCoverage (Prelude.Maybe SortDefinition)
getReservationCoverage_sortBy :: (Maybe SortDefinition -> f (Maybe SortDefinition))
-> GetReservationCoverage -> f GetReservationCoverage
getReservationCoverage_sortBy = (GetReservationCoverage -> Maybe SortDefinition)
-> (GetReservationCoverage
-> Maybe SortDefinition -> GetReservationCoverage)
-> Lens
GetReservationCoverage
GetReservationCoverage
(Maybe SortDefinition)
(Maybe SortDefinition)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetReservationCoverage' {Maybe SortDefinition
sortBy :: Maybe SortDefinition
$sel:sortBy:GetReservationCoverage' :: GetReservationCoverage -> Maybe SortDefinition
sortBy} -> Maybe SortDefinition
sortBy) (\s :: GetReservationCoverage
s@GetReservationCoverage' {} Maybe SortDefinition
a -> GetReservationCoverage
s {$sel:sortBy:GetReservationCoverage' :: Maybe SortDefinition
sortBy = Maybe SortDefinition
a} :: GetReservationCoverage)
getReservationCoverage_timePeriod :: Lens.Lens' GetReservationCoverage DateInterval
getReservationCoverage_timePeriod :: (DateInterval -> f DateInterval)
-> GetReservationCoverage -> f GetReservationCoverage
getReservationCoverage_timePeriod = (GetReservationCoverage -> DateInterval)
-> (GetReservationCoverage
-> DateInterval -> GetReservationCoverage)
-> Lens
GetReservationCoverage
GetReservationCoverage
DateInterval
DateInterval
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetReservationCoverage' {DateInterval
timePeriod :: DateInterval
$sel:timePeriod:GetReservationCoverage' :: GetReservationCoverage -> DateInterval
timePeriod} -> DateInterval
timePeriod) (\s :: GetReservationCoverage
s@GetReservationCoverage' {} DateInterval
a -> GetReservationCoverage
s {$sel:timePeriod:GetReservationCoverage' :: DateInterval
timePeriod = DateInterval
a} :: GetReservationCoverage)
instance Core.AWSRequest GetReservationCoverage where
type
AWSResponse GetReservationCoverage =
GetReservationCoverageResponse
request :: GetReservationCoverage -> Request GetReservationCoverage
request = Service -> GetReservationCoverage -> Request GetReservationCoverage
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy GetReservationCoverage
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse GetReservationCoverage)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse GetReservationCoverage))
-> Logger
-> Service
-> Proxy GetReservationCoverage
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse GetReservationCoverage)))
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 Coverage
-> Int
-> [CoverageByTime]
-> GetReservationCoverageResponse
GetReservationCoverageResponse'
(Maybe Text
-> Maybe Coverage
-> Int
-> [CoverageByTime]
-> GetReservationCoverageResponse)
-> Either String (Maybe Text)
-> Either
String
(Maybe Coverage
-> Int -> [CoverageByTime] -> GetReservationCoverageResponse)
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 Coverage
-> Int -> [CoverageByTime] -> GetReservationCoverageResponse)
-> Either String (Maybe Coverage)
-> Either
String (Int -> [CoverageByTime] -> GetReservationCoverageResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Coverage)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"Total")
Either
String (Int -> [CoverageByTime] -> GetReservationCoverageResponse)
-> Either String Int
-> Either
String ([CoverageByTime] -> GetReservationCoverageResponse)
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 ([CoverageByTime] -> GetReservationCoverageResponse)
-> Either String [CoverageByTime]
-> Either String GetReservationCoverageResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object -> Text -> Either String (Maybe [CoverageByTime])
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"CoveragesByTime"
Either String (Maybe [CoverageByTime])
-> [CoverageByTime] -> Either String [CoverageByTime]
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ [CoverageByTime]
forall a. Monoid a => a
Prelude.mempty
)
)
instance Prelude.Hashable GetReservationCoverage
instance Prelude.NFData GetReservationCoverage
instance Core.ToHeaders GetReservationCoverage where
toHeaders :: GetReservationCoverage -> ResponseHeaders
toHeaders =
ResponseHeaders -> GetReservationCoverage -> 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.GetReservationCoverage" ::
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 GetReservationCoverage where
toJSON :: GetReservationCoverage -> Value
toJSON GetReservationCoverage' {Maybe Natural
Maybe [Text]
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
metrics :: Maybe [Text]
nextPageToken :: Maybe Text
groupBy :: Maybe [GroupDefinition]
$sel:timePeriod:GetReservationCoverage' :: GetReservationCoverage -> DateInterval
$sel:sortBy:GetReservationCoverage' :: GetReservationCoverage -> Maybe SortDefinition
$sel:maxResults:GetReservationCoverage' :: GetReservationCoverage -> Maybe Natural
$sel:filter':GetReservationCoverage' :: GetReservationCoverage -> Maybe Expression
$sel:granularity:GetReservationCoverage' :: GetReservationCoverage -> Maybe Granularity
$sel:metrics:GetReservationCoverage' :: GetReservationCoverage -> Maybe [Text]
$sel:nextPageToken:GetReservationCoverage' :: GetReservationCoverage -> Maybe Text
$sel:groupBy:GetReservationCoverage' :: GetReservationCoverage -> 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
"Metrics" 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]
metrics,
(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 GetReservationCoverage where
toPath :: GetReservationCoverage -> ByteString
toPath = ByteString -> GetReservationCoverage -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery GetReservationCoverage where
toQuery :: GetReservationCoverage -> QueryString
toQuery = QueryString -> GetReservationCoverage -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data GetReservationCoverageResponse = GetReservationCoverageResponse'
{
GetReservationCoverageResponse -> Maybe Text
nextPageToken :: Prelude.Maybe Prelude.Text,
GetReservationCoverageResponse -> Maybe Coverage
total :: Prelude.Maybe Coverage,
GetReservationCoverageResponse -> Int
httpStatus :: Prelude.Int,
GetReservationCoverageResponse -> [CoverageByTime]
coveragesByTime :: [CoverageByTime]
}
deriving (GetReservationCoverageResponse
-> GetReservationCoverageResponse -> Bool
(GetReservationCoverageResponse
-> GetReservationCoverageResponse -> Bool)
-> (GetReservationCoverageResponse
-> GetReservationCoverageResponse -> Bool)
-> Eq GetReservationCoverageResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetReservationCoverageResponse
-> GetReservationCoverageResponse -> Bool
$c/= :: GetReservationCoverageResponse
-> GetReservationCoverageResponse -> Bool
== :: GetReservationCoverageResponse
-> GetReservationCoverageResponse -> Bool
$c== :: GetReservationCoverageResponse
-> GetReservationCoverageResponse -> Bool
Prelude.Eq, ReadPrec [GetReservationCoverageResponse]
ReadPrec GetReservationCoverageResponse
Int -> ReadS GetReservationCoverageResponse
ReadS [GetReservationCoverageResponse]
(Int -> ReadS GetReservationCoverageResponse)
-> ReadS [GetReservationCoverageResponse]
-> ReadPrec GetReservationCoverageResponse
-> ReadPrec [GetReservationCoverageResponse]
-> Read GetReservationCoverageResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetReservationCoverageResponse]
$creadListPrec :: ReadPrec [GetReservationCoverageResponse]
readPrec :: ReadPrec GetReservationCoverageResponse
$creadPrec :: ReadPrec GetReservationCoverageResponse
readList :: ReadS [GetReservationCoverageResponse]
$creadList :: ReadS [GetReservationCoverageResponse]
readsPrec :: Int -> ReadS GetReservationCoverageResponse
$creadsPrec :: Int -> ReadS GetReservationCoverageResponse
Prelude.Read, Int -> GetReservationCoverageResponse -> ShowS
[GetReservationCoverageResponse] -> ShowS
GetReservationCoverageResponse -> String
(Int -> GetReservationCoverageResponse -> ShowS)
-> (GetReservationCoverageResponse -> String)
-> ([GetReservationCoverageResponse] -> ShowS)
-> Show GetReservationCoverageResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetReservationCoverageResponse] -> ShowS
$cshowList :: [GetReservationCoverageResponse] -> ShowS
show :: GetReservationCoverageResponse -> String
$cshow :: GetReservationCoverageResponse -> String
showsPrec :: Int -> GetReservationCoverageResponse -> ShowS
$cshowsPrec :: Int -> GetReservationCoverageResponse -> ShowS
Prelude.Show, (forall x.
GetReservationCoverageResponse
-> Rep GetReservationCoverageResponse x)
-> (forall x.
Rep GetReservationCoverageResponse x
-> GetReservationCoverageResponse)
-> Generic GetReservationCoverageResponse
forall x.
Rep GetReservationCoverageResponse x
-> GetReservationCoverageResponse
forall x.
GetReservationCoverageResponse
-> Rep GetReservationCoverageResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetReservationCoverageResponse x
-> GetReservationCoverageResponse
$cfrom :: forall x.
GetReservationCoverageResponse
-> Rep GetReservationCoverageResponse x
Prelude.Generic)
newGetReservationCoverageResponse ::
Prelude.Int ->
GetReservationCoverageResponse
newGetReservationCoverageResponse :: Int -> GetReservationCoverageResponse
newGetReservationCoverageResponse Int
pHttpStatus_ =
GetReservationCoverageResponse' :: Maybe Text
-> Maybe Coverage
-> Int
-> [CoverageByTime]
-> GetReservationCoverageResponse
GetReservationCoverageResponse'
{ $sel:nextPageToken:GetReservationCoverageResponse' :: Maybe Text
nextPageToken =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:total:GetReservationCoverageResponse' :: Maybe Coverage
total = Maybe Coverage
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:GetReservationCoverageResponse' :: Int
httpStatus = Int
pHttpStatus_,
$sel:coveragesByTime:GetReservationCoverageResponse' :: [CoverageByTime]
coveragesByTime = [CoverageByTime]
forall a. Monoid a => a
Prelude.mempty
}
getReservationCoverageResponse_nextPageToken :: Lens.Lens' GetReservationCoverageResponse (Prelude.Maybe Prelude.Text)
getReservationCoverageResponse_nextPageToken :: (Maybe Text -> f (Maybe Text))
-> GetReservationCoverageResponse
-> f GetReservationCoverageResponse
getReservationCoverageResponse_nextPageToken = (GetReservationCoverageResponse -> Maybe Text)
-> (GetReservationCoverageResponse
-> Maybe Text -> GetReservationCoverageResponse)
-> Lens
GetReservationCoverageResponse
GetReservationCoverageResponse
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetReservationCoverageResponse' {Maybe Text
nextPageToken :: Maybe Text
$sel:nextPageToken:GetReservationCoverageResponse' :: GetReservationCoverageResponse -> Maybe Text
nextPageToken} -> Maybe Text
nextPageToken) (\s :: GetReservationCoverageResponse
s@GetReservationCoverageResponse' {} Maybe Text
a -> GetReservationCoverageResponse
s {$sel:nextPageToken:GetReservationCoverageResponse' :: Maybe Text
nextPageToken = Maybe Text
a} :: GetReservationCoverageResponse)
getReservationCoverageResponse_total :: Lens.Lens' GetReservationCoverageResponse (Prelude.Maybe Coverage)
getReservationCoverageResponse_total :: (Maybe Coverage -> f (Maybe Coverage))
-> GetReservationCoverageResponse
-> f GetReservationCoverageResponse
getReservationCoverageResponse_total = (GetReservationCoverageResponse -> Maybe Coverage)
-> (GetReservationCoverageResponse
-> Maybe Coverage -> GetReservationCoverageResponse)
-> Lens
GetReservationCoverageResponse
GetReservationCoverageResponse
(Maybe Coverage)
(Maybe Coverage)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetReservationCoverageResponse' {Maybe Coverage
total :: Maybe Coverage
$sel:total:GetReservationCoverageResponse' :: GetReservationCoverageResponse -> Maybe Coverage
total} -> Maybe Coverage
total) (\s :: GetReservationCoverageResponse
s@GetReservationCoverageResponse' {} Maybe Coverage
a -> GetReservationCoverageResponse
s {$sel:total:GetReservationCoverageResponse' :: Maybe Coverage
total = Maybe Coverage
a} :: GetReservationCoverageResponse)
getReservationCoverageResponse_httpStatus :: Lens.Lens' GetReservationCoverageResponse Prelude.Int
getReservationCoverageResponse_httpStatus :: (Int -> f Int)
-> GetReservationCoverageResponse
-> f GetReservationCoverageResponse
getReservationCoverageResponse_httpStatus = (GetReservationCoverageResponse -> Int)
-> (GetReservationCoverageResponse
-> Int -> GetReservationCoverageResponse)
-> Lens
GetReservationCoverageResponse
GetReservationCoverageResponse
Int
Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetReservationCoverageResponse' {Int
httpStatus :: Int
$sel:httpStatus:GetReservationCoverageResponse' :: GetReservationCoverageResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: GetReservationCoverageResponse
s@GetReservationCoverageResponse' {} Int
a -> GetReservationCoverageResponse
s {$sel:httpStatus:GetReservationCoverageResponse' :: Int
httpStatus = Int
a} :: GetReservationCoverageResponse)
getReservationCoverageResponse_coveragesByTime :: Lens.Lens' GetReservationCoverageResponse [CoverageByTime]
getReservationCoverageResponse_coveragesByTime :: ([CoverageByTime] -> f [CoverageByTime])
-> GetReservationCoverageResponse
-> f GetReservationCoverageResponse
getReservationCoverageResponse_coveragesByTime = (GetReservationCoverageResponse -> [CoverageByTime])
-> (GetReservationCoverageResponse
-> [CoverageByTime] -> GetReservationCoverageResponse)
-> Lens
GetReservationCoverageResponse
GetReservationCoverageResponse
[CoverageByTime]
[CoverageByTime]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetReservationCoverageResponse' {[CoverageByTime]
coveragesByTime :: [CoverageByTime]
$sel:coveragesByTime:GetReservationCoverageResponse' :: GetReservationCoverageResponse -> [CoverageByTime]
coveragesByTime} -> [CoverageByTime]
coveragesByTime) (\s :: GetReservationCoverageResponse
s@GetReservationCoverageResponse' {} [CoverageByTime]
a -> GetReservationCoverageResponse
s {$sel:coveragesByTime:GetReservationCoverageResponse' :: [CoverageByTime]
coveragesByTime = [CoverageByTime]
a} :: GetReservationCoverageResponse) (([CoverageByTime] -> f [CoverageByTime])
-> GetReservationCoverageResponse
-> f GetReservationCoverageResponse)
-> (([CoverageByTime] -> f [CoverageByTime])
-> [CoverageByTime] -> f [CoverageByTime])
-> ([CoverageByTime] -> f [CoverageByTime])
-> GetReservationCoverageResponse
-> f GetReservationCoverageResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([CoverageByTime] -> f [CoverageByTime])
-> [CoverageByTime] -> f [CoverageByTime]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
instance
Prelude.NFData
GetReservationCoverageResponse