{-# 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.GetSavingsPlansUtilizationDetails
(
GetSavingsPlansUtilizationDetails (..),
newGetSavingsPlansUtilizationDetails,
getSavingsPlansUtilizationDetails_nextToken,
getSavingsPlansUtilizationDetails_dataType,
getSavingsPlansUtilizationDetails_filter,
getSavingsPlansUtilizationDetails_maxResults,
getSavingsPlansUtilizationDetails_sortBy,
getSavingsPlansUtilizationDetails_timePeriod,
GetSavingsPlansUtilizationDetailsResponse (..),
newGetSavingsPlansUtilizationDetailsResponse,
getSavingsPlansUtilizationDetailsResponse_nextToken,
getSavingsPlansUtilizationDetailsResponse_total,
getSavingsPlansUtilizationDetailsResponse_httpStatus,
getSavingsPlansUtilizationDetailsResponse_savingsPlansUtilizationDetails,
getSavingsPlansUtilizationDetailsResponse_timePeriod,
)
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 GetSavingsPlansUtilizationDetails = GetSavingsPlansUtilizationDetails'
{
GetSavingsPlansUtilizationDetails -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
GetSavingsPlansUtilizationDetails -> Maybe [SavingsPlansDataType]
dataType :: Prelude.Maybe [SavingsPlansDataType],
GetSavingsPlansUtilizationDetails -> Maybe Expression
filter' :: Prelude.Maybe Expression,
GetSavingsPlansUtilizationDetails -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
GetSavingsPlansUtilizationDetails -> Maybe SortDefinition
sortBy :: Prelude.Maybe SortDefinition,
GetSavingsPlansUtilizationDetails -> DateInterval
timePeriod :: DateInterval
}
deriving (GetSavingsPlansUtilizationDetails
-> GetSavingsPlansUtilizationDetails -> Bool
(GetSavingsPlansUtilizationDetails
-> GetSavingsPlansUtilizationDetails -> Bool)
-> (GetSavingsPlansUtilizationDetails
-> GetSavingsPlansUtilizationDetails -> Bool)
-> Eq GetSavingsPlansUtilizationDetails
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetSavingsPlansUtilizationDetails
-> GetSavingsPlansUtilizationDetails -> Bool
$c/= :: GetSavingsPlansUtilizationDetails
-> GetSavingsPlansUtilizationDetails -> Bool
== :: GetSavingsPlansUtilizationDetails
-> GetSavingsPlansUtilizationDetails -> Bool
$c== :: GetSavingsPlansUtilizationDetails
-> GetSavingsPlansUtilizationDetails -> Bool
Prelude.Eq, ReadPrec [GetSavingsPlansUtilizationDetails]
ReadPrec GetSavingsPlansUtilizationDetails
Int -> ReadS GetSavingsPlansUtilizationDetails
ReadS [GetSavingsPlansUtilizationDetails]
(Int -> ReadS GetSavingsPlansUtilizationDetails)
-> ReadS [GetSavingsPlansUtilizationDetails]
-> ReadPrec GetSavingsPlansUtilizationDetails
-> ReadPrec [GetSavingsPlansUtilizationDetails]
-> Read GetSavingsPlansUtilizationDetails
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetSavingsPlansUtilizationDetails]
$creadListPrec :: ReadPrec [GetSavingsPlansUtilizationDetails]
readPrec :: ReadPrec GetSavingsPlansUtilizationDetails
$creadPrec :: ReadPrec GetSavingsPlansUtilizationDetails
readList :: ReadS [GetSavingsPlansUtilizationDetails]
$creadList :: ReadS [GetSavingsPlansUtilizationDetails]
readsPrec :: Int -> ReadS GetSavingsPlansUtilizationDetails
$creadsPrec :: Int -> ReadS GetSavingsPlansUtilizationDetails
Prelude.Read, Int -> GetSavingsPlansUtilizationDetails -> ShowS
[GetSavingsPlansUtilizationDetails] -> ShowS
GetSavingsPlansUtilizationDetails -> String
(Int -> GetSavingsPlansUtilizationDetails -> ShowS)
-> (GetSavingsPlansUtilizationDetails -> String)
-> ([GetSavingsPlansUtilizationDetails] -> ShowS)
-> Show GetSavingsPlansUtilizationDetails
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetSavingsPlansUtilizationDetails] -> ShowS
$cshowList :: [GetSavingsPlansUtilizationDetails] -> ShowS
show :: GetSavingsPlansUtilizationDetails -> String
$cshow :: GetSavingsPlansUtilizationDetails -> String
showsPrec :: Int -> GetSavingsPlansUtilizationDetails -> ShowS
$cshowsPrec :: Int -> GetSavingsPlansUtilizationDetails -> ShowS
Prelude.Show, (forall x.
GetSavingsPlansUtilizationDetails
-> Rep GetSavingsPlansUtilizationDetails x)
-> (forall x.
Rep GetSavingsPlansUtilizationDetails x
-> GetSavingsPlansUtilizationDetails)
-> Generic GetSavingsPlansUtilizationDetails
forall x.
Rep GetSavingsPlansUtilizationDetails x
-> GetSavingsPlansUtilizationDetails
forall x.
GetSavingsPlansUtilizationDetails
-> Rep GetSavingsPlansUtilizationDetails x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetSavingsPlansUtilizationDetails x
-> GetSavingsPlansUtilizationDetails
$cfrom :: forall x.
GetSavingsPlansUtilizationDetails
-> Rep GetSavingsPlansUtilizationDetails x
Prelude.Generic)
newGetSavingsPlansUtilizationDetails ::
DateInterval ->
GetSavingsPlansUtilizationDetails
newGetSavingsPlansUtilizationDetails :: DateInterval -> GetSavingsPlansUtilizationDetails
newGetSavingsPlansUtilizationDetails DateInterval
pTimePeriod_ =
GetSavingsPlansUtilizationDetails' :: Maybe Text
-> Maybe [SavingsPlansDataType]
-> Maybe Expression
-> Maybe Natural
-> Maybe SortDefinition
-> DateInterval
-> GetSavingsPlansUtilizationDetails
GetSavingsPlansUtilizationDetails'
{ $sel:nextToken:GetSavingsPlansUtilizationDetails' :: Maybe Text
nextToken =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:dataType:GetSavingsPlansUtilizationDetails' :: Maybe [SavingsPlansDataType]
dataType = Maybe [SavingsPlansDataType]
forall a. Maybe a
Prelude.Nothing,
$sel:filter':GetSavingsPlansUtilizationDetails' :: Maybe Expression
filter' = Maybe Expression
forall a. Maybe a
Prelude.Nothing,
$sel:maxResults:GetSavingsPlansUtilizationDetails' :: Maybe Natural
maxResults = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
$sel:sortBy:GetSavingsPlansUtilizationDetails' :: Maybe SortDefinition
sortBy = Maybe SortDefinition
forall a. Maybe a
Prelude.Nothing,
$sel:timePeriod:GetSavingsPlansUtilizationDetails' :: DateInterval
timePeriod = DateInterval
pTimePeriod_
}
getSavingsPlansUtilizationDetails_nextToken :: Lens.Lens' GetSavingsPlansUtilizationDetails (Prelude.Maybe Prelude.Text)
getSavingsPlansUtilizationDetails_nextToken :: (Maybe Text -> f (Maybe Text))
-> GetSavingsPlansUtilizationDetails
-> f GetSavingsPlansUtilizationDetails
getSavingsPlansUtilizationDetails_nextToken = (GetSavingsPlansUtilizationDetails -> Maybe Text)
-> (GetSavingsPlansUtilizationDetails
-> Maybe Text -> GetSavingsPlansUtilizationDetails)
-> Lens
GetSavingsPlansUtilizationDetails
GetSavingsPlansUtilizationDetails
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetSavingsPlansUtilizationDetails' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:GetSavingsPlansUtilizationDetails' :: GetSavingsPlansUtilizationDetails -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: GetSavingsPlansUtilizationDetails
s@GetSavingsPlansUtilizationDetails' {} Maybe Text
a -> GetSavingsPlansUtilizationDetails
s {$sel:nextToken:GetSavingsPlansUtilizationDetails' :: Maybe Text
nextToken = Maybe Text
a} :: GetSavingsPlansUtilizationDetails)
getSavingsPlansUtilizationDetails_dataType :: Lens.Lens' GetSavingsPlansUtilizationDetails (Prelude.Maybe [SavingsPlansDataType])
getSavingsPlansUtilizationDetails_dataType :: (Maybe [SavingsPlansDataType] -> f (Maybe [SavingsPlansDataType]))
-> GetSavingsPlansUtilizationDetails
-> f GetSavingsPlansUtilizationDetails
getSavingsPlansUtilizationDetails_dataType = (GetSavingsPlansUtilizationDetails -> Maybe [SavingsPlansDataType])
-> (GetSavingsPlansUtilizationDetails
-> Maybe [SavingsPlansDataType]
-> GetSavingsPlansUtilizationDetails)
-> Lens
GetSavingsPlansUtilizationDetails
GetSavingsPlansUtilizationDetails
(Maybe [SavingsPlansDataType])
(Maybe [SavingsPlansDataType])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetSavingsPlansUtilizationDetails' {Maybe [SavingsPlansDataType]
dataType :: Maybe [SavingsPlansDataType]
$sel:dataType:GetSavingsPlansUtilizationDetails' :: GetSavingsPlansUtilizationDetails -> Maybe [SavingsPlansDataType]
dataType} -> Maybe [SavingsPlansDataType]
dataType) (\s :: GetSavingsPlansUtilizationDetails
s@GetSavingsPlansUtilizationDetails' {} Maybe [SavingsPlansDataType]
a -> GetSavingsPlansUtilizationDetails
s {$sel:dataType:GetSavingsPlansUtilizationDetails' :: Maybe [SavingsPlansDataType]
dataType = Maybe [SavingsPlansDataType]
a} :: GetSavingsPlansUtilizationDetails) ((Maybe [SavingsPlansDataType] -> f (Maybe [SavingsPlansDataType]))
-> GetSavingsPlansUtilizationDetails
-> f GetSavingsPlansUtilizationDetails)
-> ((Maybe [SavingsPlansDataType]
-> f (Maybe [SavingsPlansDataType]))
-> Maybe [SavingsPlansDataType]
-> f (Maybe [SavingsPlansDataType]))
-> (Maybe [SavingsPlansDataType]
-> f (Maybe [SavingsPlansDataType]))
-> GetSavingsPlansUtilizationDetails
-> f GetSavingsPlansUtilizationDetails
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
[SavingsPlansDataType]
[SavingsPlansDataType]
[SavingsPlansDataType]
[SavingsPlansDataType]
-> Iso
(Maybe [SavingsPlansDataType])
(Maybe [SavingsPlansDataType])
(Maybe [SavingsPlansDataType])
(Maybe [SavingsPlansDataType])
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
[SavingsPlansDataType]
[SavingsPlansDataType]
[SavingsPlansDataType]
[SavingsPlansDataType]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
getSavingsPlansUtilizationDetails_filter :: Lens.Lens' GetSavingsPlansUtilizationDetails (Prelude.Maybe Expression)
getSavingsPlansUtilizationDetails_filter :: (Maybe Expression -> f (Maybe Expression))
-> GetSavingsPlansUtilizationDetails
-> f GetSavingsPlansUtilizationDetails
getSavingsPlansUtilizationDetails_filter = (GetSavingsPlansUtilizationDetails -> Maybe Expression)
-> (GetSavingsPlansUtilizationDetails
-> Maybe Expression -> GetSavingsPlansUtilizationDetails)
-> Lens
GetSavingsPlansUtilizationDetails
GetSavingsPlansUtilizationDetails
(Maybe Expression)
(Maybe Expression)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetSavingsPlansUtilizationDetails' {Maybe Expression
filter' :: Maybe Expression
$sel:filter':GetSavingsPlansUtilizationDetails' :: GetSavingsPlansUtilizationDetails -> Maybe Expression
filter'} -> Maybe Expression
filter') (\s :: GetSavingsPlansUtilizationDetails
s@GetSavingsPlansUtilizationDetails' {} Maybe Expression
a -> GetSavingsPlansUtilizationDetails
s {$sel:filter':GetSavingsPlansUtilizationDetails' :: Maybe Expression
filter' = Maybe Expression
a} :: GetSavingsPlansUtilizationDetails)
getSavingsPlansUtilizationDetails_maxResults :: Lens.Lens' GetSavingsPlansUtilizationDetails (Prelude.Maybe Prelude.Natural)
getSavingsPlansUtilizationDetails_maxResults :: (Maybe Natural -> f (Maybe Natural))
-> GetSavingsPlansUtilizationDetails
-> f GetSavingsPlansUtilizationDetails
getSavingsPlansUtilizationDetails_maxResults = (GetSavingsPlansUtilizationDetails -> Maybe Natural)
-> (GetSavingsPlansUtilizationDetails
-> Maybe Natural -> GetSavingsPlansUtilizationDetails)
-> Lens
GetSavingsPlansUtilizationDetails
GetSavingsPlansUtilizationDetails
(Maybe Natural)
(Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetSavingsPlansUtilizationDetails' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:GetSavingsPlansUtilizationDetails' :: GetSavingsPlansUtilizationDetails -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: GetSavingsPlansUtilizationDetails
s@GetSavingsPlansUtilizationDetails' {} Maybe Natural
a -> GetSavingsPlansUtilizationDetails
s {$sel:maxResults:GetSavingsPlansUtilizationDetails' :: Maybe Natural
maxResults = Maybe Natural
a} :: GetSavingsPlansUtilizationDetails)
getSavingsPlansUtilizationDetails_sortBy :: Lens.Lens' GetSavingsPlansUtilizationDetails (Prelude.Maybe SortDefinition)
getSavingsPlansUtilizationDetails_sortBy :: (Maybe SortDefinition -> f (Maybe SortDefinition))
-> GetSavingsPlansUtilizationDetails
-> f GetSavingsPlansUtilizationDetails
getSavingsPlansUtilizationDetails_sortBy = (GetSavingsPlansUtilizationDetails -> Maybe SortDefinition)
-> (GetSavingsPlansUtilizationDetails
-> Maybe SortDefinition -> GetSavingsPlansUtilizationDetails)
-> Lens
GetSavingsPlansUtilizationDetails
GetSavingsPlansUtilizationDetails
(Maybe SortDefinition)
(Maybe SortDefinition)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetSavingsPlansUtilizationDetails' {Maybe SortDefinition
sortBy :: Maybe SortDefinition
$sel:sortBy:GetSavingsPlansUtilizationDetails' :: GetSavingsPlansUtilizationDetails -> Maybe SortDefinition
sortBy} -> Maybe SortDefinition
sortBy) (\s :: GetSavingsPlansUtilizationDetails
s@GetSavingsPlansUtilizationDetails' {} Maybe SortDefinition
a -> GetSavingsPlansUtilizationDetails
s {$sel:sortBy:GetSavingsPlansUtilizationDetails' :: Maybe SortDefinition
sortBy = Maybe SortDefinition
a} :: GetSavingsPlansUtilizationDetails)
getSavingsPlansUtilizationDetails_timePeriod :: Lens.Lens' GetSavingsPlansUtilizationDetails DateInterval
getSavingsPlansUtilizationDetails_timePeriod :: (DateInterval -> f DateInterval)
-> GetSavingsPlansUtilizationDetails
-> f GetSavingsPlansUtilizationDetails
getSavingsPlansUtilizationDetails_timePeriod = (GetSavingsPlansUtilizationDetails -> DateInterval)
-> (GetSavingsPlansUtilizationDetails
-> DateInterval -> GetSavingsPlansUtilizationDetails)
-> Lens
GetSavingsPlansUtilizationDetails
GetSavingsPlansUtilizationDetails
DateInterval
DateInterval
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetSavingsPlansUtilizationDetails' {DateInterval
timePeriod :: DateInterval
$sel:timePeriod:GetSavingsPlansUtilizationDetails' :: GetSavingsPlansUtilizationDetails -> DateInterval
timePeriod} -> DateInterval
timePeriod) (\s :: GetSavingsPlansUtilizationDetails
s@GetSavingsPlansUtilizationDetails' {} DateInterval
a -> GetSavingsPlansUtilizationDetails
s {$sel:timePeriod:GetSavingsPlansUtilizationDetails' :: DateInterval
timePeriod = DateInterval
a} :: GetSavingsPlansUtilizationDetails)
instance
Core.AWSRequest
GetSavingsPlansUtilizationDetails
where
type
AWSResponse GetSavingsPlansUtilizationDetails =
GetSavingsPlansUtilizationDetailsResponse
request :: GetSavingsPlansUtilizationDetails
-> Request GetSavingsPlansUtilizationDetails
request = Service
-> GetSavingsPlansUtilizationDetails
-> Request GetSavingsPlansUtilizationDetails
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy GetSavingsPlansUtilizationDetails
-> ClientResponse ClientBody
-> m (Either
Error
(ClientResponse (AWSResponse GetSavingsPlansUtilizationDetails)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse GetSavingsPlansUtilizationDetails))
-> Logger
-> Service
-> Proxy GetSavingsPlansUtilizationDetails
-> ClientResponse ClientBody
-> m (Either
Error
(ClientResponse (AWSResponse GetSavingsPlansUtilizationDetails)))
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 SavingsPlansUtilizationAggregates
-> Int
-> [SavingsPlansUtilizationDetail]
-> DateInterval
-> GetSavingsPlansUtilizationDetailsResponse
GetSavingsPlansUtilizationDetailsResponse'
(Maybe Text
-> Maybe SavingsPlansUtilizationAggregates
-> Int
-> [SavingsPlansUtilizationDetail]
-> DateInterval
-> GetSavingsPlansUtilizationDetailsResponse)
-> Either String (Maybe Text)
-> Either
String
(Maybe SavingsPlansUtilizationAggregates
-> Int
-> [SavingsPlansUtilizationDetail]
-> DateInterval
-> GetSavingsPlansUtilizationDetailsResponse)
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
(Maybe SavingsPlansUtilizationAggregates
-> Int
-> [SavingsPlansUtilizationDetail]
-> DateInterval
-> GetSavingsPlansUtilizationDetailsResponse)
-> Either String (Maybe SavingsPlansUtilizationAggregates)
-> Either
String
(Int
-> [SavingsPlansUtilizationDetail]
-> DateInterval
-> GetSavingsPlansUtilizationDetailsResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object
-> Text -> Either String (Maybe SavingsPlansUtilizationAggregates)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"Total")
Either
String
(Int
-> [SavingsPlansUtilizationDetail]
-> DateInterval
-> GetSavingsPlansUtilizationDetailsResponse)
-> Either String Int
-> Either
String
([SavingsPlansUtilizationDetail]
-> DateInterval -> GetSavingsPlansUtilizationDetailsResponse)
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
([SavingsPlansUtilizationDetail]
-> DateInterval -> GetSavingsPlansUtilizationDetailsResponse)
-> Either String [SavingsPlansUtilizationDetail]
-> Either
String (DateInterval -> GetSavingsPlansUtilizationDetailsResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object
-> Text -> Either String (Maybe [SavingsPlansUtilizationDetail])
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"SavingsPlansUtilizationDetails"
Either String (Maybe [SavingsPlansUtilizationDetail])
-> [SavingsPlansUtilizationDetail]
-> Either String [SavingsPlansUtilizationDetail]
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ [SavingsPlansUtilizationDetail]
forall a. Monoid a => a
Prelude.mempty
)
Either
String (DateInterval -> GetSavingsPlansUtilizationDetailsResponse)
-> Either String DateInterval
-> Either String GetSavingsPlansUtilizationDetailsResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String DateInterval
forall a. FromJSON a => Object -> Text -> Either String a
Core..:> Text
"TimePeriod")
)
instance
Prelude.Hashable
GetSavingsPlansUtilizationDetails
instance
Prelude.NFData
GetSavingsPlansUtilizationDetails
instance
Core.ToHeaders
GetSavingsPlansUtilizationDetails
where
toHeaders :: GetSavingsPlansUtilizationDetails -> ResponseHeaders
toHeaders =
ResponseHeaders
-> GetSavingsPlansUtilizationDetails -> 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.GetSavingsPlansUtilizationDetails" ::
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
GetSavingsPlansUtilizationDetails
where
toJSON :: GetSavingsPlansUtilizationDetails -> Value
toJSON GetSavingsPlansUtilizationDetails' {Maybe Natural
Maybe [SavingsPlansDataType]
Maybe Text
Maybe SortDefinition
Maybe Expression
DateInterval
timePeriod :: DateInterval
sortBy :: Maybe SortDefinition
maxResults :: Maybe Natural
filter' :: Maybe Expression
dataType :: Maybe [SavingsPlansDataType]
nextToken :: Maybe Text
$sel:timePeriod:GetSavingsPlansUtilizationDetails' :: GetSavingsPlansUtilizationDetails -> DateInterval
$sel:sortBy:GetSavingsPlansUtilizationDetails' :: GetSavingsPlansUtilizationDetails -> Maybe SortDefinition
$sel:maxResults:GetSavingsPlansUtilizationDetails' :: GetSavingsPlansUtilizationDetails -> Maybe Natural
$sel:filter':GetSavingsPlansUtilizationDetails' :: GetSavingsPlansUtilizationDetails -> Maybe Expression
$sel:dataType:GetSavingsPlansUtilizationDetails' :: GetSavingsPlansUtilizationDetails -> Maybe [SavingsPlansDataType]
$sel:nextToken:GetSavingsPlansUtilizationDetails' :: GetSavingsPlansUtilizationDetails -> Maybe Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (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
"DataType" Text -> [SavingsPlansDataType] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) ([SavingsPlansDataType] -> Pair)
-> Maybe [SavingsPlansDataType] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [SavingsPlansDataType]
dataType,
(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
GetSavingsPlansUtilizationDetails
where
toPath :: GetSavingsPlansUtilizationDetails -> ByteString
toPath = ByteString -> GetSavingsPlansUtilizationDetails -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance
Core.ToQuery
GetSavingsPlansUtilizationDetails
where
toQuery :: GetSavingsPlansUtilizationDetails -> QueryString
toQuery = QueryString -> GetSavingsPlansUtilizationDetails -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data GetSavingsPlansUtilizationDetailsResponse = GetSavingsPlansUtilizationDetailsResponse'
{
GetSavingsPlansUtilizationDetailsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
GetSavingsPlansUtilizationDetailsResponse
-> Maybe SavingsPlansUtilizationAggregates
total :: Prelude.Maybe SavingsPlansUtilizationAggregates,
GetSavingsPlansUtilizationDetailsResponse -> Int
httpStatus :: Prelude.Int,
GetSavingsPlansUtilizationDetailsResponse
-> [SavingsPlansUtilizationDetail]
savingsPlansUtilizationDetails :: [SavingsPlansUtilizationDetail],
GetSavingsPlansUtilizationDetailsResponse -> DateInterval
timePeriod :: DateInterval
}
deriving (GetSavingsPlansUtilizationDetailsResponse
-> GetSavingsPlansUtilizationDetailsResponse -> Bool
(GetSavingsPlansUtilizationDetailsResponse
-> GetSavingsPlansUtilizationDetailsResponse -> Bool)
-> (GetSavingsPlansUtilizationDetailsResponse
-> GetSavingsPlansUtilizationDetailsResponse -> Bool)
-> Eq GetSavingsPlansUtilizationDetailsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetSavingsPlansUtilizationDetailsResponse
-> GetSavingsPlansUtilizationDetailsResponse -> Bool
$c/= :: GetSavingsPlansUtilizationDetailsResponse
-> GetSavingsPlansUtilizationDetailsResponse -> Bool
== :: GetSavingsPlansUtilizationDetailsResponse
-> GetSavingsPlansUtilizationDetailsResponse -> Bool
$c== :: GetSavingsPlansUtilizationDetailsResponse
-> GetSavingsPlansUtilizationDetailsResponse -> Bool
Prelude.Eq, ReadPrec [GetSavingsPlansUtilizationDetailsResponse]
ReadPrec GetSavingsPlansUtilizationDetailsResponse
Int -> ReadS GetSavingsPlansUtilizationDetailsResponse
ReadS [GetSavingsPlansUtilizationDetailsResponse]
(Int -> ReadS GetSavingsPlansUtilizationDetailsResponse)
-> ReadS [GetSavingsPlansUtilizationDetailsResponse]
-> ReadPrec GetSavingsPlansUtilizationDetailsResponse
-> ReadPrec [GetSavingsPlansUtilizationDetailsResponse]
-> Read GetSavingsPlansUtilizationDetailsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetSavingsPlansUtilizationDetailsResponse]
$creadListPrec :: ReadPrec [GetSavingsPlansUtilizationDetailsResponse]
readPrec :: ReadPrec GetSavingsPlansUtilizationDetailsResponse
$creadPrec :: ReadPrec GetSavingsPlansUtilizationDetailsResponse
readList :: ReadS [GetSavingsPlansUtilizationDetailsResponse]
$creadList :: ReadS [GetSavingsPlansUtilizationDetailsResponse]
readsPrec :: Int -> ReadS GetSavingsPlansUtilizationDetailsResponse
$creadsPrec :: Int -> ReadS GetSavingsPlansUtilizationDetailsResponse
Prelude.Read, Int -> GetSavingsPlansUtilizationDetailsResponse -> ShowS
[GetSavingsPlansUtilizationDetailsResponse] -> ShowS
GetSavingsPlansUtilizationDetailsResponse -> String
(Int -> GetSavingsPlansUtilizationDetailsResponse -> ShowS)
-> (GetSavingsPlansUtilizationDetailsResponse -> String)
-> ([GetSavingsPlansUtilizationDetailsResponse] -> ShowS)
-> Show GetSavingsPlansUtilizationDetailsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetSavingsPlansUtilizationDetailsResponse] -> ShowS
$cshowList :: [GetSavingsPlansUtilizationDetailsResponse] -> ShowS
show :: GetSavingsPlansUtilizationDetailsResponse -> String
$cshow :: GetSavingsPlansUtilizationDetailsResponse -> String
showsPrec :: Int -> GetSavingsPlansUtilizationDetailsResponse -> ShowS
$cshowsPrec :: Int -> GetSavingsPlansUtilizationDetailsResponse -> ShowS
Prelude.Show, (forall x.
GetSavingsPlansUtilizationDetailsResponse
-> Rep GetSavingsPlansUtilizationDetailsResponse x)
-> (forall x.
Rep GetSavingsPlansUtilizationDetailsResponse x
-> GetSavingsPlansUtilizationDetailsResponse)
-> Generic GetSavingsPlansUtilizationDetailsResponse
forall x.
Rep GetSavingsPlansUtilizationDetailsResponse x
-> GetSavingsPlansUtilizationDetailsResponse
forall x.
GetSavingsPlansUtilizationDetailsResponse
-> Rep GetSavingsPlansUtilizationDetailsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetSavingsPlansUtilizationDetailsResponse x
-> GetSavingsPlansUtilizationDetailsResponse
$cfrom :: forall x.
GetSavingsPlansUtilizationDetailsResponse
-> Rep GetSavingsPlansUtilizationDetailsResponse x
Prelude.Generic)
newGetSavingsPlansUtilizationDetailsResponse ::
Prelude.Int ->
DateInterval ->
GetSavingsPlansUtilizationDetailsResponse
newGetSavingsPlansUtilizationDetailsResponse :: Int -> DateInterval -> GetSavingsPlansUtilizationDetailsResponse
newGetSavingsPlansUtilizationDetailsResponse
Int
pHttpStatus_
DateInterval
pTimePeriod_ =
GetSavingsPlansUtilizationDetailsResponse' :: Maybe Text
-> Maybe SavingsPlansUtilizationAggregates
-> Int
-> [SavingsPlansUtilizationDetail]
-> DateInterval
-> GetSavingsPlansUtilizationDetailsResponse
GetSavingsPlansUtilizationDetailsResponse'
{ $sel:nextToken:GetSavingsPlansUtilizationDetailsResponse' :: Maybe Text
nextToken =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:total:GetSavingsPlansUtilizationDetailsResponse' :: Maybe SavingsPlansUtilizationAggregates
total = Maybe SavingsPlansUtilizationAggregates
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:GetSavingsPlansUtilizationDetailsResponse' :: Int
httpStatus = Int
pHttpStatus_,
$sel:savingsPlansUtilizationDetails:GetSavingsPlansUtilizationDetailsResponse' :: [SavingsPlansUtilizationDetail]
savingsPlansUtilizationDetails =
[SavingsPlansUtilizationDetail]
forall a. Monoid a => a
Prelude.mempty,
$sel:timePeriod:GetSavingsPlansUtilizationDetailsResponse' :: DateInterval
timePeriod = DateInterval
pTimePeriod_
}
getSavingsPlansUtilizationDetailsResponse_nextToken :: Lens.Lens' GetSavingsPlansUtilizationDetailsResponse (Prelude.Maybe Prelude.Text)
getSavingsPlansUtilizationDetailsResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> GetSavingsPlansUtilizationDetailsResponse
-> f GetSavingsPlansUtilizationDetailsResponse
getSavingsPlansUtilizationDetailsResponse_nextToken = (GetSavingsPlansUtilizationDetailsResponse -> Maybe Text)
-> (GetSavingsPlansUtilizationDetailsResponse
-> Maybe Text -> GetSavingsPlansUtilizationDetailsResponse)
-> Lens
GetSavingsPlansUtilizationDetailsResponse
GetSavingsPlansUtilizationDetailsResponse
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetSavingsPlansUtilizationDetailsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:GetSavingsPlansUtilizationDetailsResponse' :: GetSavingsPlansUtilizationDetailsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: GetSavingsPlansUtilizationDetailsResponse
s@GetSavingsPlansUtilizationDetailsResponse' {} Maybe Text
a -> GetSavingsPlansUtilizationDetailsResponse
s {$sel:nextToken:GetSavingsPlansUtilizationDetailsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: GetSavingsPlansUtilizationDetailsResponse)
getSavingsPlansUtilizationDetailsResponse_total :: Lens.Lens' GetSavingsPlansUtilizationDetailsResponse (Prelude.Maybe SavingsPlansUtilizationAggregates)
getSavingsPlansUtilizationDetailsResponse_total :: (Maybe SavingsPlansUtilizationAggregates
-> f (Maybe SavingsPlansUtilizationAggregates))
-> GetSavingsPlansUtilizationDetailsResponse
-> f GetSavingsPlansUtilizationDetailsResponse
getSavingsPlansUtilizationDetailsResponse_total = (GetSavingsPlansUtilizationDetailsResponse
-> Maybe SavingsPlansUtilizationAggregates)
-> (GetSavingsPlansUtilizationDetailsResponse
-> Maybe SavingsPlansUtilizationAggregates
-> GetSavingsPlansUtilizationDetailsResponse)
-> Lens
GetSavingsPlansUtilizationDetailsResponse
GetSavingsPlansUtilizationDetailsResponse
(Maybe SavingsPlansUtilizationAggregates)
(Maybe SavingsPlansUtilizationAggregates)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetSavingsPlansUtilizationDetailsResponse' {Maybe SavingsPlansUtilizationAggregates
total :: Maybe SavingsPlansUtilizationAggregates
$sel:total:GetSavingsPlansUtilizationDetailsResponse' :: GetSavingsPlansUtilizationDetailsResponse
-> Maybe SavingsPlansUtilizationAggregates
total} -> Maybe SavingsPlansUtilizationAggregates
total) (\s :: GetSavingsPlansUtilizationDetailsResponse
s@GetSavingsPlansUtilizationDetailsResponse' {} Maybe SavingsPlansUtilizationAggregates
a -> GetSavingsPlansUtilizationDetailsResponse
s {$sel:total:GetSavingsPlansUtilizationDetailsResponse' :: Maybe SavingsPlansUtilizationAggregates
total = Maybe SavingsPlansUtilizationAggregates
a} :: GetSavingsPlansUtilizationDetailsResponse)
getSavingsPlansUtilizationDetailsResponse_httpStatus :: Lens.Lens' GetSavingsPlansUtilizationDetailsResponse Prelude.Int
getSavingsPlansUtilizationDetailsResponse_httpStatus :: (Int -> f Int)
-> GetSavingsPlansUtilizationDetailsResponse
-> f GetSavingsPlansUtilizationDetailsResponse
getSavingsPlansUtilizationDetailsResponse_httpStatus = (GetSavingsPlansUtilizationDetailsResponse -> Int)
-> (GetSavingsPlansUtilizationDetailsResponse
-> Int -> GetSavingsPlansUtilizationDetailsResponse)
-> Lens
GetSavingsPlansUtilizationDetailsResponse
GetSavingsPlansUtilizationDetailsResponse
Int
Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetSavingsPlansUtilizationDetailsResponse' {Int
httpStatus :: Int
$sel:httpStatus:GetSavingsPlansUtilizationDetailsResponse' :: GetSavingsPlansUtilizationDetailsResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: GetSavingsPlansUtilizationDetailsResponse
s@GetSavingsPlansUtilizationDetailsResponse' {} Int
a -> GetSavingsPlansUtilizationDetailsResponse
s {$sel:httpStatus:GetSavingsPlansUtilizationDetailsResponse' :: Int
httpStatus = Int
a} :: GetSavingsPlansUtilizationDetailsResponse)
getSavingsPlansUtilizationDetailsResponse_savingsPlansUtilizationDetails :: Lens.Lens' GetSavingsPlansUtilizationDetailsResponse [SavingsPlansUtilizationDetail]
getSavingsPlansUtilizationDetailsResponse_savingsPlansUtilizationDetails :: ([SavingsPlansUtilizationDetail]
-> f [SavingsPlansUtilizationDetail])
-> GetSavingsPlansUtilizationDetailsResponse
-> f GetSavingsPlansUtilizationDetailsResponse
getSavingsPlansUtilizationDetailsResponse_savingsPlansUtilizationDetails = (GetSavingsPlansUtilizationDetailsResponse
-> [SavingsPlansUtilizationDetail])
-> (GetSavingsPlansUtilizationDetailsResponse
-> [SavingsPlansUtilizationDetail]
-> GetSavingsPlansUtilizationDetailsResponse)
-> Lens
GetSavingsPlansUtilizationDetailsResponse
GetSavingsPlansUtilizationDetailsResponse
[SavingsPlansUtilizationDetail]
[SavingsPlansUtilizationDetail]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetSavingsPlansUtilizationDetailsResponse' {[SavingsPlansUtilizationDetail]
savingsPlansUtilizationDetails :: [SavingsPlansUtilizationDetail]
$sel:savingsPlansUtilizationDetails:GetSavingsPlansUtilizationDetailsResponse' :: GetSavingsPlansUtilizationDetailsResponse
-> [SavingsPlansUtilizationDetail]
savingsPlansUtilizationDetails} -> [SavingsPlansUtilizationDetail]
savingsPlansUtilizationDetails) (\s :: GetSavingsPlansUtilizationDetailsResponse
s@GetSavingsPlansUtilizationDetailsResponse' {} [SavingsPlansUtilizationDetail]
a -> GetSavingsPlansUtilizationDetailsResponse
s {$sel:savingsPlansUtilizationDetails:GetSavingsPlansUtilizationDetailsResponse' :: [SavingsPlansUtilizationDetail]
savingsPlansUtilizationDetails = [SavingsPlansUtilizationDetail]
a} :: GetSavingsPlansUtilizationDetailsResponse) (([SavingsPlansUtilizationDetail]
-> f [SavingsPlansUtilizationDetail])
-> GetSavingsPlansUtilizationDetailsResponse
-> f GetSavingsPlansUtilizationDetailsResponse)
-> (([SavingsPlansUtilizationDetail]
-> f [SavingsPlansUtilizationDetail])
-> [SavingsPlansUtilizationDetail]
-> f [SavingsPlansUtilizationDetail])
-> ([SavingsPlansUtilizationDetail]
-> f [SavingsPlansUtilizationDetail])
-> GetSavingsPlansUtilizationDetailsResponse
-> f GetSavingsPlansUtilizationDetailsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([SavingsPlansUtilizationDetail]
-> f [SavingsPlansUtilizationDetail])
-> [SavingsPlansUtilizationDetail]
-> f [SavingsPlansUtilizationDetail]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
getSavingsPlansUtilizationDetailsResponse_timePeriod :: Lens.Lens' GetSavingsPlansUtilizationDetailsResponse DateInterval
getSavingsPlansUtilizationDetailsResponse_timePeriod :: (DateInterval -> f DateInterval)
-> GetSavingsPlansUtilizationDetailsResponse
-> f GetSavingsPlansUtilizationDetailsResponse
getSavingsPlansUtilizationDetailsResponse_timePeriod = (GetSavingsPlansUtilizationDetailsResponse -> DateInterval)
-> (GetSavingsPlansUtilizationDetailsResponse
-> DateInterval -> GetSavingsPlansUtilizationDetailsResponse)
-> Lens
GetSavingsPlansUtilizationDetailsResponse
GetSavingsPlansUtilizationDetailsResponse
DateInterval
DateInterval
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetSavingsPlansUtilizationDetailsResponse' {DateInterval
timePeriod :: DateInterval
$sel:timePeriod:GetSavingsPlansUtilizationDetailsResponse' :: GetSavingsPlansUtilizationDetailsResponse -> DateInterval
timePeriod} -> DateInterval
timePeriod) (\s :: GetSavingsPlansUtilizationDetailsResponse
s@GetSavingsPlansUtilizationDetailsResponse' {} DateInterval
a -> GetSavingsPlansUtilizationDetailsResponse
s {$sel:timePeriod:GetSavingsPlansUtilizationDetailsResponse' :: DateInterval
timePeriod = DateInterval
a} :: GetSavingsPlansUtilizationDetailsResponse)
instance
Prelude.NFData
GetSavingsPlansUtilizationDetailsResponse