{-# 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.GetSavingsPlansCoverage
(
GetSavingsPlansCoverage (..),
newGetSavingsPlansCoverage,
getSavingsPlansCoverage_groupBy,
getSavingsPlansCoverage_metrics,
getSavingsPlansCoverage_granularity,
getSavingsPlansCoverage_nextToken,
getSavingsPlansCoverage_filter,
getSavingsPlansCoverage_maxResults,
getSavingsPlansCoverage_sortBy,
getSavingsPlansCoverage_timePeriod,
GetSavingsPlansCoverageResponse (..),
newGetSavingsPlansCoverageResponse,
getSavingsPlansCoverageResponse_nextToken,
getSavingsPlansCoverageResponse_httpStatus,
getSavingsPlansCoverageResponse_savingsPlansCoverages,
)
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 GetSavingsPlansCoverage = GetSavingsPlansCoverage'
{
GetSavingsPlansCoverage -> Maybe [GroupDefinition]
groupBy :: Prelude.Maybe [GroupDefinition],
GetSavingsPlansCoverage -> Maybe [Text]
metrics :: Prelude.Maybe [Prelude.Text],
GetSavingsPlansCoverage -> Maybe Granularity
granularity :: Prelude.Maybe Granularity,
GetSavingsPlansCoverage -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
GetSavingsPlansCoverage -> Maybe Expression
filter' :: Prelude.Maybe Expression,
GetSavingsPlansCoverage -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
GetSavingsPlansCoverage -> Maybe SortDefinition
sortBy :: Prelude.Maybe SortDefinition,
GetSavingsPlansCoverage -> DateInterval
timePeriod :: DateInterval
}
deriving (GetSavingsPlansCoverage -> GetSavingsPlansCoverage -> Bool
(GetSavingsPlansCoverage -> GetSavingsPlansCoverage -> Bool)
-> (GetSavingsPlansCoverage -> GetSavingsPlansCoverage -> Bool)
-> Eq GetSavingsPlansCoverage
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetSavingsPlansCoverage -> GetSavingsPlansCoverage -> Bool
$c/= :: GetSavingsPlansCoverage -> GetSavingsPlansCoverage -> Bool
== :: GetSavingsPlansCoverage -> GetSavingsPlansCoverage -> Bool
$c== :: GetSavingsPlansCoverage -> GetSavingsPlansCoverage -> Bool
Prelude.Eq, ReadPrec [GetSavingsPlansCoverage]
ReadPrec GetSavingsPlansCoverage
Int -> ReadS GetSavingsPlansCoverage
ReadS [GetSavingsPlansCoverage]
(Int -> ReadS GetSavingsPlansCoverage)
-> ReadS [GetSavingsPlansCoverage]
-> ReadPrec GetSavingsPlansCoverage
-> ReadPrec [GetSavingsPlansCoverage]
-> Read GetSavingsPlansCoverage
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetSavingsPlansCoverage]
$creadListPrec :: ReadPrec [GetSavingsPlansCoverage]
readPrec :: ReadPrec GetSavingsPlansCoverage
$creadPrec :: ReadPrec GetSavingsPlansCoverage
readList :: ReadS [GetSavingsPlansCoverage]
$creadList :: ReadS [GetSavingsPlansCoverage]
readsPrec :: Int -> ReadS GetSavingsPlansCoverage
$creadsPrec :: Int -> ReadS GetSavingsPlansCoverage
Prelude.Read, Int -> GetSavingsPlansCoverage -> ShowS
[GetSavingsPlansCoverage] -> ShowS
GetSavingsPlansCoverage -> String
(Int -> GetSavingsPlansCoverage -> ShowS)
-> (GetSavingsPlansCoverage -> String)
-> ([GetSavingsPlansCoverage] -> ShowS)
-> Show GetSavingsPlansCoverage
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetSavingsPlansCoverage] -> ShowS
$cshowList :: [GetSavingsPlansCoverage] -> ShowS
show :: GetSavingsPlansCoverage -> String
$cshow :: GetSavingsPlansCoverage -> String
showsPrec :: Int -> GetSavingsPlansCoverage -> ShowS
$cshowsPrec :: Int -> GetSavingsPlansCoverage -> ShowS
Prelude.Show, (forall x.
GetSavingsPlansCoverage -> Rep GetSavingsPlansCoverage x)
-> (forall x.
Rep GetSavingsPlansCoverage x -> GetSavingsPlansCoverage)
-> Generic GetSavingsPlansCoverage
forall x. Rep GetSavingsPlansCoverage x -> GetSavingsPlansCoverage
forall x. GetSavingsPlansCoverage -> Rep GetSavingsPlansCoverage x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetSavingsPlansCoverage x -> GetSavingsPlansCoverage
$cfrom :: forall x. GetSavingsPlansCoverage -> Rep GetSavingsPlansCoverage x
Prelude.Generic)
newGetSavingsPlansCoverage ::
DateInterval ->
GetSavingsPlansCoverage
newGetSavingsPlansCoverage :: DateInterval -> GetSavingsPlansCoverage
newGetSavingsPlansCoverage DateInterval
pTimePeriod_ =
GetSavingsPlansCoverage' :: Maybe [GroupDefinition]
-> Maybe [Text]
-> Maybe Granularity
-> Maybe Text
-> Maybe Expression
-> Maybe Natural
-> Maybe SortDefinition
-> DateInterval
-> GetSavingsPlansCoverage
GetSavingsPlansCoverage'
{ $sel:groupBy:GetSavingsPlansCoverage' :: Maybe [GroupDefinition]
groupBy = Maybe [GroupDefinition]
forall a. Maybe a
Prelude.Nothing,
$sel:metrics:GetSavingsPlansCoverage' :: Maybe [Text]
metrics = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
$sel:granularity:GetSavingsPlansCoverage' :: Maybe Granularity
granularity = Maybe Granularity
forall a. Maybe a
Prelude.Nothing,
$sel:nextToken:GetSavingsPlansCoverage' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:filter':GetSavingsPlansCoverage' :: Maybe Expression
filter' = Maybe Expression
forall a. Maybe a
Prelude.Nothing,
$sel:maxResults:GetSavingsPlansCoverage' :: Maybe Natural
maxResults = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
$sel:sortBy:GetSavingsPlansCoverage' :: Maybe SortDefinition
sortBy = Maybe SortDefinition
forall a. Maybe a
Prelude.Nothing,
$sel:timePeriod:GetSavingsPlansCoverage' :: DateInterval
timePeriod = DateInterval
pTimePeriod_
}
getSavingsPlansCoverage_groupBy :: Lens.Lens' GetSavingsPlansCoverage (Prelude.Maybe [GroupDefinition])
getSavingsPlansCoverage_groupBy :: (Maybe [GroupDefinition] -> f (Maybe [GroupDefinition]))
-> GetSavingsPlansCoverage -> f GetSavingsPlansCoverage
getSavingsPlansCoverage_groupBy = (GetSavingsPlansCoverage -> Maybe [GroupDefinition])
-> (GetSavingsPlansCoverage
-> Maybe [GroupDefinition] -> GetSavingsPlansCoverage)
-> Lens
GetSavingsPlansCoverage
GetSavingsPlansCoverage
(Maybe [GroupDefinition])
(Maybe [GroupDefinition])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetSavingsPlansCoverage' {Maybe [GroupDefinition]
groupBy :: Maybe [GroupDefinition]
$sel:groupBy:GetSavingsPlansCoverage' :: GetSavingsPlansCoverage -> Maybe [GroupDefinition]
groupBy} -> Maybe [GroupDefinition]
groupBy) (\s :: GetSavingsPlansCoverage
s@GetSavingsPlansCoverage' {} Maybe [GroupDefinition]
a -> GetSavingsPlansCoverage
s {$sel:groupBy:GetSavingsPlansCoverage' :: Maybe [GroupDefinition]
groupBy = Maybe [GroupDefinition]
a} :: GetSavingsPlansCoverage) ((Maybe [GroupDefinition] -> f (Maybe [GroupDefinition]))
-> GetSavingsPlansCoverage -> f GetSavingsPlansCoverage)
-> ((Maybe [GroupDefinition] -> f (Maybe [GroupDefinition]))
-> Maybe [GroupDefinition] -> f (Maybe [GroupDefinition]))
-> (Maybe [GroupDefinition] -> f (Maybe [GroupDefinition]))
-> GetSavingsPlansCoverage
-> f GetSavingsPlansCoverage
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
getSavingsPlansCoverage_metrics :: Lens.Lens' GetSavingsPlansCoverage (Prelude.Maybe [Prelude.Text])
getSavingsPlansCoverage_metrics :: (Maybe [Text] -> f (Maybe [Text]))
-> GetSavingsPlansCoverage -> f GetSavingsPlansCoverage
getSavingsPlansCoverage_metrics = (GetSavingsPlansCoverage -> Maybe [Text])
-> (GetSavingsPlansCoverage
-> Maybe [Text] -> GetSavingsPlansCoverage)
-> Lens
GetSavingsPlansCoverage
GetSavingsPlansCoverage
(Maybe [Text])
(Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetSavingsPlansCoverage' {Maybe [Text]
metrics :: Maybe [Text]
$sel:metrics:GetSavingsPlansCoverage' :: GetSavingsPlansCoverage -> Maybe [Text]
metrics} -> Maybe [Text]
metrics) (\s :: GetSavingsPlansCoverage
s@GetSavingsPlansCoverage' {} Maybe [Text]
a -> GetSavingsPlansCoverage
s {$sel:metrics:GetSavingsPlansCoverage' :: Maybe [Text]
metrics = Maybe [Text]
a} :: GetSavingsPlansCoverage) ((Maybe [Text] -> f (Maybe [Text]))
-> GetSavingsPlansCoverage -> f GetSavingsPlansCoverage)
-> ((Maybe [Text] -> f (Maybe [Text]))
-> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> GetSavingsPlansCoverage
-> f GetSavingsPlansCoverage
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
getSavingsPlansCoverage_granularity :: Lens.Lens' GetSavingsPlansCoverage (Prelude.Maybe Granularity)
getSavingsPlansCoverage_granularity :: (Maybe Granularity -> f (Maybe Granularity))
-> GetSavingsPlansCoverage -> f GetSavingsPlansCoverage
getSavingsPlansCoverage_granularity = (GetSavingsPlansCoverage -> Maybe Granularity)
-> (GetSavingsPlansCoverage
-> Maybe Granularity -> GetSavingsPlansCoverage)
-> Lens
GetSavingsPlansCoverage
GetSavingsPlansCoverage
(Maybe Granularity)
(Maybe Granularity)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetSavingsPlansCoverage' {Maybe Granularity
granularity :: Maybe Granularity
$sel:granularity:GetSavingsPlansCoverage' :: GetSavingsPlansCoverage -> Maybe Granularity
granularity} -> Maybe Granularity
granularity) (\s :: GetSavingsPlansCoverage
s@GetSavingsPlansCoverage' {} Maybe Granularity
a -> GetSavingsPlansCoverage
s {$sel:granularity:GetSavingsPlansCoverage' :: Maybe Granularity
granularity = Maybe Granularity
a} :: GetSavingsPlansCoverage)
getSavingsPlansCoverage_nextToken :: Lens.Lens' GetSavingsPlansCoverage (Prelude.Maybe Prelude.Text)
getSavingsPlansCoverage_nextToken :: (Maybe Text -> f (Maybe Text))
-> GetSavingsPlansCoverage -> f GetSavingsPlansCoverage
getSavingsPlansCoverage_nextToken = (GetSavingsPlansCoverage -> Maybe Text)
-> (GetSavingsPlansCoverage
-> Maybe Text -> GetSavingsPlansCoverage)
-> Lens
GetSavingsPlansCoverage
GetSavingsPlansCoverage
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetSavingsPlansCoverage' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:GetSavingsPlansCoverage' :: GetSavingsPlansCoverage -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: GetSavingsPlansCoverage
s@GetSavingsPlansCoverage' {} Maybe Text
a -> GetSavingsPlansCoverage
s {$sel:nextToken:GetSavingsPlansCoverage' :: Maybe Text
nextToken = Maybe Text
a} :: GetSavingsPlansCoverage)
getSavingsPlansCoverage_filter :: Lens.Lens' GetSavingsPlansCoverage (Prelude.Maybe Expression)
getSavingsPlansCoverage_filter :: (Maybe Expression -> f (Maybe Expression))
-> GetSavingsPlansCoverage -> f GetSavingsPlansCoverage
getSavingsPlansCoverage_filter = (GetSavingsPlansCoverage -> Maybe Expression)
-> (GetSavingsPlansCoverage
-> Maybe Expression -> GetSavingsPlansCoverage)
-> Lens
GetSavingsPlansCoverage
GetSavingsPlansCoverage
(Maybe Expression)
(Maybe Expression)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetSavingsPlansCoverage' {Maybe Expression
filter' :: Maybe Expression
$sel:filter':GetSavingsPlansCoverage' :: GetSavingsPlansCoverage -> Maybe Expression
filter'} -> Maybe Expression
filter') (\s :: GetSavingsPlansCoverage
s@GetSavingsPlansCoverage' {} Maybe Expression
a -> GetSavingsPlansCoverage
s {$sel:filter':GetSavingsPlansCoverage' :: Maybe Expression
filter' = Maybe Expression
a} :: GetSavingsPlansCoverage)
getSavingsPlansCoverage_maxResults :: Lens.Lens' GetSavingsPlansCoverage (Prelude.Maybe Prelude.Natural)
getSavingsPlansCoverage_maxResults :: (Maybe Natural -> f (Maybe Natural))
-> GetSavingsPlansCoverage -> f GetSavingsPlansCoverage
getSavingsPlansCoverage_maxResults = (GetSavingsPlansCoverage -> Maybe Natural)
-> (GetSavingsPlansCoverage
-> Maybe Natural -> GetSavingsPlansCoverage)
-> Lens
GetSavingsPlansCoverage
GetSavingsPlansCoverage
(Maybe Natural)
(Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetSavingsPlansCoverage' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:GetSavingsPlansCoverage' :: GetSavingsPlansCoverage -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: GetSavingsPlansCoverage
s@GetSavingsPlansCoverage' {} Maybe Natural
a -> GetSavingsPlansCoverage
s {$sel:maxResults:GetSavingsPlansCoverage' :: Maybe Natural
maxResults = Maybe Natural
a} :: GetSavingsPlansCoverage)
getSavingsPlansCoverage_sortBy :: Lens.Lens' GetSavingsPlansCoverage (Prelude.Maybe SortDefinition)
getSavingsPlansCoverage_sortBy :: (Maybe SortDefinition -> f (Maybe SortDefinition))
-> GetSavingsPlansCoverage -> f GetSavingsPlansCoverage
getSavingsPlansCoverage_sortBy = (GetSavingsPlansCoverage -> Maybe SortDefinition)
-> (GetSavingsPlansCoverage
-> Maybe SortDefinition -> GetSavingsPlansCoverage)
-> Lens
GetSavingsPlansCoverage
GetSavingsPlansCoverage
(Maybe SortDefinition)
(Maybe SortDefinition)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetSavingsPlansCoverage' {Maybe SortDefinition
sortBy :: Maybe SortDefinition
$sel:sortBy:GetSavingsPlansCoverage' :: GetSavingsPlansCoverage -> Maybe SortDefinition
sortBy} -> Maybe SortDefinition
sortBy) (\s :: GetSavingsPlansCoverage
s@GetSavingsPlansCoverage' {} Maybe SortDefinition
a -> GetSavingsPlansCoverage
s {$sel:sortBy:GetSavingsPlansCoverage' :: Maybe SortDefinition
sortBy = Maybe SortDefinition
a} :: GetSavingsPlansCoverage)
getSavingsPlansCoverage_timePeriod :: Lens.Lens' GetSavingsPlansCoverage DateInterval
getSavingsPlansCoverage_timePeriod :: (DateInterval -> f DateInterval)
-> GetSavingsPlansCoverage -> f GetSavingsPlansCoverage
getSavingsPlansCoverage_timePeriod = (GetSavingsPlansCoverage -> DateInterval)
-> (GetSavingsPlansCoverage
-> DateInterval -> GetSavingsPlansCoverage)
-> Lens
GetSavingsPlansCoverage
GetSavingsPlansCoverage
DateInterval
DateInterval
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetSavingsPlansCoverage' {DateInterval
timePeriod :: DateInterval
$sel:timePeriod:GetSavingsPlansCoverage' :: GetSavingsPlansCoverage -> DateInterval
timePeriod} -> DateInterval
timePeriod) (\s :: GetSavingsPlansCoverage
s@GetSavingsPlansCoverage' {} DateInterval
a -> GetSavingsPlansCoverage
s {$sel:timePeriod:GetSavingsPlansCoverage' :: DateInterval
timePeriod = DateInterval
a} :: GetSavingsPlansCoverage)
instance Core.AWSRequest GetSavingsPlansCoverage where
type
AWSResponse GetSavingsPlansCoverage =
GetSavingsPlansCoverageResponse
request :: GetSavingsPlansCoverage -> Request GetSavingsPlansCoverage
request = Service
-> GetSavingsPlansCoverage -> Request GetSavingsPlansCoverage
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy GetSavingsPlansCoverage
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse GetSavingsPlansCoverage)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse GetSavingsPlansCoverage))
-> Logger
-> Service
-> Proxy GetSavingsPlansCoverage
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse GetSavingsPlansCoverage)))
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
-> Int -> [SavingsPlansCoverage] -> GetSavingsPlansCoverageResponse
GetSavingsPlansCoverageResponse'
(Maybe Text
-> Int
-> [SavingsPlansCoverage]
-> GetSavingsPlansCoverageResponse)
-> Either String (Maybe Text)
-> Either
String
(Int -> [SavingsPlansCoverage] -> GetSavingsPlansCoverageResponse)
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
"NextToken")
Either
String
(Int -> [SavingsPlansCoverage] -> GetSavingsPlansCoverageResponse)
-> Either String Int
-> Either
String ([SavingsPlansCoverage] -> GetSavingsPlansCoverageResponse)
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 ([SavingsPlansCoverage] -> GetSavingsPlansCoverageResponse)
-> Either String [SavingsPlansCoverage]
-> Either String GetSavingsPlansCoverageResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object -> Text -> Either String (Maybe [SavingsPlansCoverage])
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"SavingsPlansCoverages"
Either String (Maybe [SavingsPlansCoverage])
-> [SavingsPlansCoverage] -> Either String [SavingsPlansCoverage]
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ [SavingsPlansCoverage]
forall a. Monoid a => a
Prelude.mempty
)
)
instance Prelude.Hashable GetSavingsPlansCoverage
instance Prelude.NFData GetSavingsPlansCoverage
instance Core.ToHeaders GetSavingsPlansCoverage where
toHeaders :: GetSavingsPlansCoverage -> ResponseHeaders
toHeaders =
ResponseHeaders -> GetSavingsPlansCoverage -> 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.GetSavingsPlansCoverage" ::
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 GetSavingsPlansCoverage where
toJSON :: GetSavingsPlansCoverage -> Value
toJSON GetSavingsPlansCoverage' {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
nextToken :: Maybe Text
granularity :: Maybe Granularity
metrics :: Maybe [Text]
groupBy :: Maybe [GroupDefinition]
$sel:timePeriod:GetSavingsPlansCoverage' :: GetSavingsPlansCoverage -> DateInterval
$sel:sortBy:GetSavingsPlansCoverage' :: GetSavingsPlansCoverage -> Maybe SortDefinition
$sel:maxResults:GetSavingsPlansCoverage' :: GetSavingsPlansCoverage -> Maybe Natural
$sel:filter':GetSavingsPlansCoverage' :: GetSavingsPlansCoverage -> Maybe Expression
$sel:nextToken:GetSavingsPlansCoverage' :: GetSavingsPlansCoverage -> Maybe Text
$sel:granularity:GetSavingsPlansCoverage' :: GetSavingsPlansCoverage -> Maybe Granularity
$sel:metrics:GetSavingsPlansCoverage' :: GetSavingsPlansCoverage -> Maybe [Text]
$sel:groupBy:GetSavingsPlansCoverage' :: GetSavingsPlansCoverage -> 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
"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
"NextToken" 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
nextToken,
(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 GetSavingsPlansCoverage where
toPath :: GetSavingsPlansCoverage -> ByteString
toPath = ByteString -> GetSavingsPlansCoverage -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery GetSavingsPlansCoverage where
toQuery :: GetSavingsPlansCoverage -> QueryString
toQuery = QueryString -> GetSavingsPlansCoverage -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data GetSavingsPlansCoverageResponse = GetSavingsPlansCoverageResponse'
{
GetSavingsPlansCoverageResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
GetSavingsPlansCoverageResponse -> Int
httpStatus :: Prelude.Int,
GetSavingsPlansCoverageResponse -> [SavingsPlansCoverage]
savingsPlansCoverages :: [SavingsPlansCoverage]
}
deriving (GetSavingsPlansCoverageResponse
-> GetSavingsPlansCoverageResponse -> Bool
(GetSavingsPlansCoverageResponse
-> GetSavingsPlansCoverageResponse -> Bool)
-> (GetSavingsPlansCoverageResponse
-> GetSavingsPlansCoverageResponse -> Bool)
-> Eq GetSavingsPlansCoverageResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetSavingsPlansCoverageResponse
-> GetSavingsPlansCoverageResponse -> Bool
$c/= :: GetSavingsPlansCoverageResponse
-> GetSavingsPlansCoverageResponse -> Bool
== :: GetSavingsPlansCoverageResponse
-> GetSavingsPlansCoverageResponse -> Bool
$c== :: GetSavingsPlansCoverageResponse
-> GetSavingsPlansCoverageResponse -> Bool
Prelude.Eq, ReadPrec [GetSavingsPlansCoverageResponse]
ReadPrec GetSavingsPlansCoverageResponse
Int -> ReadS GetSavingsPlansCoverageResponse
ReadS [GetSavingsPlansCoverageResponse]
(Int -> ReadS GetSavingsPlansCoverageResponse)
-> ReadS [GetSavingsPlansCoverageResponse]
-> ReadPrec GetSavingsPlansCoverageResponse
-> ReadPrec [GetSavingsPlansCoverageResponse]
-> Read GetSavingsPlansCoverageResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetSavingsPlansCoverageResponse]
$creadListPrec :: ReadPrec [GetSavingsPlansCoverageResponse]
readPrec :: ReadPrec GetSavingsPlansCoverageResponse
$creadPrec :: ReadPrec GetSavingsPlansCoverageResponse
readList :: ReadS [GetSavingsPlansCoverageResponse]
$creadList :: ReadS [GetSavingsPlansCoverageResponse]
readsPrec :: Int -> ReadS GetSavingsPlansCoverageResponse
$creadsPrec :: Int -> ReadS GetSavingsPlansCoverageResponse
Prelude.Read, Int -> GetSavingsPlansCoverageResponse -> ShowS
[GetSavingsPlansCoverageResponse] -> ShowS
GetSavingsPlansCoverageResponse -> String
(Int -> GetSavingsPlansCoverageResponse -> ShowS)
-> (GetSavingsPlansCoverageResponse -> String)
-> ([GetSavingsPlansCoverageResponse] -> ShowS)
-> Show GetSavingsPlansCoverageResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetSavingsPlansCoverageResponse] -> ShowS
$cshowList :: [GetSavingsPlansCoverageResponse] -> ShowS
show :: GetSavingsPlansCoverageResponse -> String
$cshow :: GetSavingsPlansCoverageResponse -> String
showsPrec :: Int -> GetSavingsPlansCoverageResponse -> ShowS
$cshowsPrec :: Int -> GetSavingsPlansCoverageResponse -> ShowS
Prelude.Show, (forall x.
GetSavingsPlansCoverageResponse
-> Rep GetSavingsPlansCoverageResponse x)
-> (forall x.
Rep GetSavingsPlansCoverageResponse x
-> GetSavingsPlansCoverageResponse)
-> Generic GetSavingsPlansCoverageResponse
forall x.
Rep GetSavingsPlansCoverageResponse x
-> GetSavingsPlansCoverageResponse
forall x.
GetSavingsPlansCoverageResponse
-> Rep GetSavingsPlansCoverageResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetSavingsPlansCoverageResponse x
-> GetSavingsPlansCoverageResponse
$cfrom :: forall x.
GetSavingsPlansCoverageResponse
-> Rep GetSavingsPlansCoverageResponse x
Prelude.Generic)
newGetSavingsPlansCoverageResponse ::
Prelude.Int ->
GetSavingsPlansCoverageResponse
newGetSavingsPlansCoverageResponse :: Int -> GetSavingsPlansCoverageResponse
newGetSavingsPlansCoverageResponse Int
pHttpStatus_ =
GetSavingsPlansCoverageResponse' :: Maybe Text
-> Int -> [SavingsPlansCoverage] -> GetSavingsPlansCoverageResponse
GetSavingsPlansCoverageResponse'
{ $sel:nextToken:GetSavingsPlansCoverageResponse' :: Maybe Text
nextToken =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:GetSavingsPlansCoverageResponse' :: Int
httpStatus = Int
pHttpStatus_,
$sel:savingsPlansCoverages:GetSavingsPlansCoverageResponse' :: [SavingsPlansCoverage]
savingsPlansCoverages = [SavingsPlansCoverage]
forall a. Monoid a => a
Prelude.mempty
}
getSavingsPlansCoverageResponse_nextToken :: Lens.Lens' GetSavingsPlansCoverageResponse (Prelude.Maybe Prelude.Text)
getSavingsPlansCoverageResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> GetSavingsPlansCoverageResponse
-> f GetSavingsPlansCoverageResponse
getSavingsPlansCoverageResponse_nextToken = (GetSavingsPlansCoverageResponse -> Maybe Text)
-> (GetSavingsPlansCoverageResponse
-> Maybe Text -> GetSavingsPlansCoverageResponse)
-> Lens
GetSavingsPlansCoverageResponse
GetSavingsPlansCoverageResponse
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetSavingsPlansCoverageResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:GetSavingsPlansCoverageResponse' :: GetSavingsPlansCoverageResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: GetSavingsPlansCoverageResponse
s@GetSavingsPlansCoverageResponse' {} Maybe Text
a -> GetSavingsPlansCoverageResponse
s {$sel:nextToken:GetSavingsPlansCoverageResponse' :: Maybe Text
nextToken = Maybe Text
a} :: GetSavingsPlansCoverageResponse)
getSavingsPlansCoverageResponse_httpStatus :: Lens.Lens' GetSavingsPlansCoverageResponse Prelude.Int
getSavingsPlansCoverageResponse_httpStatus :: (Int -> f Int)
-> GetSavingsPlansCoverageResponse
-> f GetSavingsPlansCoverageResponse
getSavingsPlansCoverageResponse_httpStatus = (GetSavingsPlansCoverageResponse -> Int)
-> (GetSavingsPlansCoverageResponse
-> Int -> GetSavingsPlansCoverageResponse)
-> Lens
GetSavingsPlansCoverageResponse
GetSavingsPlansCoverageResponse
Int
Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetSavingsPlansCoverageResponse' {Int
httpStatus :: Int
$sel:httpStatus:GetSavingsPlansCoverageResponse' :: GetSavingsPlansCoverageResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: GetSavingsPlansCoverageResponse
s@GetSavingsPlansCoverageResponse' {} Int
a -> GetSavingsPlansCoverageResponse
s {$sel:httpStatus:GetSavingsPlansCoverageResponse' :: Int
httpStatus = Int
a} :: GetSavingsPlansCoverageResponse)
getSavingsPlansCoverageResponse_savingsPlansCoverages :: Lens.Lens' GetSavingsPlansCoverageResponse [SavingsPlansCoverage]
getSavingsPlansCoverageResponse_savingsPlansCoverages :: ([SavingsPlansCoverage] -> f [SavingsPlansCoverage])
-> GetSavingsPlansCoverageResponse
-> f GetSavingsPlansCoverageResponse
getSavingsPlansCoverageResponse_savingsPlansCoverages = (GetSavingsPlansCoverageResponse -> [SavingsPlansCoverage])
-> (GetSavingsPlansCoverageResponse
-> [SavingsPlansCoverage] -> GetSavingsPlansCoverageResponse)
-> Lens
GetSavingsPlansCoverageResponse
GetSavingsPlansCoverageResponse
[SavingsPlansCoverage]
[SavingsPlansCoverage]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetSavingsPlansCoverageResponse' {[SavingsPlansCoverage]
savingsPlansCoverages :: [SavingsPlansCoverage]
$sel:savingsPlansCoverages:GetSavingsPlansCoverageResponse' :: GetSavingsPlansCoverageResponse -> [SavingsPlansCoverage]
savingsPlansCoverages} -> [SavingsPlansCoverage]
savingsPlansCoverages) (\s :: GetSavingsPlansCoverageResponse
s@GetSavingsPlansCoverageResponse' {} [SavingsPlansCoverage]
a -> GetSavingsPlansCoverageResponse
s {$sel:savingsPlansCoverages:GetSavingsPlansCoverageResponse' :: [SavingsPlansCoverage]
savingsPlansCoverages = [SavingsPlansCoverage]
a} :: GetSavingsPlansCoverageResponse) (([SavingsPlansCoverage] -> f [SavingsPlansCoverage])
-> GetSavingsPlansCoverageResponse
-> f GetSavingsPlansCoverageResponse)
-> (([SavingsPlansCoverage] -> f [SavingsPlansCoverage])
-> [SavingsPlansCoverage] -> f [SavingsPlansCoverage])
-> ([SavingsPlansCoverage] -> f [SavingsPlansCoverage])
-> GetSavingsPlansCoverageResponse
-> f GetSavingsPlansCoverageResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([SavingsPlansCoverage] -> f [SavingsPlansCoverage])
-> [SavingsPlansCoverage] -> f [SavingsPlansCoverage]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
instance
Prelude.NFData
GetSavingsPlansCoverageResponse