{-# 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.GetCostAndUsage
(
GetCostAndUsage (..),
newGetCostAndUsage,
getCostAndUsage_groupBy,
getCostAndUsage_nextPageToken,
getCostAndUsage_filter,
getCostAndUsage_timePeriod,
getCostAndUsage_granularity,
getCostAndUsage_metrics,
GetCostAndUsageResponse (..),
newGetCostAndUsageResponse,
getCostAndUsageResponse_resultsByTime,
getCostAndUsageResponse_nextPageToken,
getCostAndUsageResponse_dimensionValueAttributes,
getCostAndUsageResponse_groupDefinitions,
getCostAndUsageResponse_httpStatus,
)
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 GetCostAndUsage = GetCostAndUsage'
{
GetCostAndUsage -> Maybe [GroupDefinition]
groupBy :: Prelude.Maybe [GroupDefinition],
GetCostAndUsage -> Maybe Text
nextPageToken :: Prelude.Maybe Prelude.Text,
GetCostAndUsage -> Maybe Expression
filter' :: Prelude.Maybe Expression,
GetCostAndUsage -> DateInterval
timePeriod :: DateInterval,
GetCostAndUsage -> Granularity
granularity :: Granularity,
GetCostAndUsage -> [Text]
metrics :: [Prelude.Text]
}
deriving (GetCostAndUsage -> GetCostAndUsage -> Bool
(GetCostAndUsage -> GetCostAndUsage -> Bool)
-> (GetCostAndUsage -> GetCostAndUsage -> Bool)
-> Eq GetCostAndUsage
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetCostAndUsage -> GetCostAndUsage -> Bool
$c/= :: GetCostAndUsage -> GetCostAndUsage -> Bool
== :: GetCostAndUsage -> GetCostAndUsage -> Bool
$c== :: GetCostAndUsage -> GetCostAndUsage -> Bool
Prelude.Eq, ReadPrec [GetCostAndUsage]
ReadPrec GetCostAndUsage
Int -> ReadS GetCostAndUsage
ReadS [GetCostAndUsage]
(Int -> ReadS GetCostAndUsage)
-> ReadS [GetCostAndUsage]
-> ReadPrec GetCostAndUsage
-> ReadPrec [GetCostAndUsage]
-> Read GetCostAndUsage
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetCostAndUsage]
$creadListPrec :: ReadPrec [GetCostAndUsage]
readPrec :: ReadPrec GetCostAndUsage
$creadPrec :: ReadPrec GetCostAndUsage
readList :: ReadS [GetCostAndUsage]
$creadList :: ReadS [GetCostAndUsage]
readsPrec :: Int -> ReadS GetCostAndUsage
$creadsPrec :: Int -> ReadS GetCostAndUsage
Prelude.Read, Int -> GetCostAndUsage -> ShowS
[GetCostAndUsage] -> ShowS
GetCostAndUsage -> String
(Int -> GetCostAndUsage -> ShowS)
-> (GetCostAndUsage -> String)
-> ([GetCostAndUsage] -> ShowS)
-> Show GetCostAndUsage
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetCostAndUsage] -> ShowS
$cshowList :: [GetCostAndUsage] -> ShowS
show :: GetCostAndUsage -> String
$cshow :: GetCostAndUsage -> String
showsPrec :: Int -> GetCostAndUsage -> ShowS
$cshowsPrec :: Int -> GetCostAndUsage -> ShowS
Prelude.Show, (forall x. GetCostAndUsage -> Rep GetCostAndUsage x)
-> (forall x. Rep GetCostAndUsage x -> GetCostAndUsage)
-> Generic GetCostAndUsage
forall x. Rep GetCostAndUsage x -> GetCostAndUsage
forall x. GetCostAndUsage -> Rep GetCostAndUsage x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetCostAndUsage x -> GetCostAndUsage
$cfrom :: forall x. GetCostAndUsage -> Rep GetCostAndUsage x
Prelude.Generic)
newGetCostAndUsage ::
DateInterval ->
Granularity ->
GetCostAndUsage
newGetCostAndUsage :: DateInterval -> Granularity -> GetCostAndUsage
newGetCostAndUsage DateInterval
pTimePeriod_ Granularity
pGranularity_ =
GetCostAndUsage' :: Maybe [GroupDefinition]
-> Maybe Text
-> Maybe Expression
-> DateInterval
-> Granularity
-> [Text]
-> GetCostAndUsage
GetCostAndUsage'
{ $sel:groupBy:GetCostAndUsage' :: Maybe [GroupDefinition]
groupBy = Maybe [GroupDefinition]
forall a. Maybe a
Prelude.Nothing,
$sel:nextPageToken:GetCostAndUsage' :: Maybe Text
nextPageToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:filter':GetCostAndUsage' :: Maybe Expression
filter' = Maybe Expression
forall a. Maybe a
Prelude.Nothing,
$sel:timePeriod:GetCostAndUsage' :: DateInterval
timePeriod = DateInterval
pTimePeriod_,
$sel:granularity:GetCostAndUsage' :: Granularity
granularity = Granularity
pGranularity_,
$sel:metrics:GetCostAndUsage' :: [Text]
metrics = [Text]
forall a. Monoid a => a
Prelude.mempty
}
getCostAndUsage_groupBy :: Lens.Lens' GetCostAndUsage (Prelude.Maybe [GroupDefinition])
getCostAndUsage_groupBy :: (Maybe [GroupDefinition] -> f (Maybe [GroupDefinition]))
-> GetCostAndUsage -> f GetCostAndUsage
getCostAndUsage_groupBy = (GetCostAndUsage -> Maybe [GroupDefinition])
-> (GetCostAndUsage -> Maybe [GroupDefinition] -> GetCostAndUsage)
-> Lens
GetCostAndUsage
GetCostAndUsage
(Maybe [GroupDefinition])
(Maybe [GroupDefinition])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetCostAndUsage' {Maybe [GroupDefinition]
groupBy :: Maybe [GroupDefinition]
$sel:groupBy:GetCostAndUsage' :: GetCostAndUsage -> Maybe [GroupDefinition]
groupBy} -> Maybe [GroupDefinition]
groupBy) (\s :: GetCostAndUsage
s@GetCostAndUsage' {} Maybe [GroupDefinition]
a -> GetCostAndUsage
s {$sel:groupBy:GetCostAndUsage' :: Maybe [GroupDefinition]
groupBy = Maybe [GroupDefinition]
a} :: GetCostAndUsage) ((Maybe [GroupDefinition] -> f (Maybe [GroupDefinition]))
-> GetCostAndUsage -> f GetCostAndUsage)
-> ((Maybe [GroupDefinition] -> f (Maybe [GroupDefinition]))
-> Maybe [GroupDefinition] -> f (Maybe [GroupDefinition]))
-> (Maybe [GroupDefinition] -> f (Maybe [GroupDefinition]))
-> GetCostAndUsage
-> f GetCostAndUsage
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
getCostAndUsage_nextPageToken :: Lens.Lens' GetCostAndUsage (Prelude.Maybe Prelude.Text)
getCostAndUsage_nextPageToken :: (Maybe Text -> f (Maybe Text))
-> GetCostAndUsage -> f GetCostAndUsage
getCostAndUsage_nextPageToken = (GetCostAndUsage -> Maybe Text)
-> (GetCostAndUsage -> Maybe Text -> GetCostAndUsage)
-> Lens GetCostAndUsage GetCostAndUsage (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetCostAndUsage' {Maybe Text
nextPageToken :: Maybe Text
$sel:nextPageToken:GetCostAndUsage' :: GetCostAndUsage -> Maybe Text
nextPageToken} -> Maybe Text
nextPageToken) (\s :: GetCostAndUsage
s@GetCostAndUsage' {} Maybe Text
a -> GetCostAndUsage
s {$sel:nextPageToken:GetCostAndUsage' :: Maybe Text
nextPageToken = Maybe Text
a} :: GetCostAndUsage)
getCostAndUsage_filter :: Lens.Lens' GetCostAndUsage (Prelude.Maybe Expression)
getCostAndUsage_filter :: (Maybe Expression -> f (Maybe Expression))
-> GetCostAndUsage -> f GetCostAndUsage
getCostAndUsage_filter = (GetCostAndUsage -> Maybe Expression)
-> (GetCostAndUsage -> Maybe Expression -> GetCostAndUsage)
-> Lens
GetCostAndUsage
GetCostAndUsage
(Maybe Expression)
(Maybe Expression)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetCostAndUsage' {Maybe Expression
filter' :: Maybe Expression
$sel:filter':GetCostAndUsage' :: GetCostAndUsage -> Maybe Expression
filter'} -> Maybe Expression
filter') (\s :: GetCostAndUsage
s@GetCostAndUsage' {} Maybe Expression
a -> GetCostAndUsage
s {$sel:filter':GetCostAndUsage' :: Maybe Expression
filter' = Maybe Expression
a} :: GetCostAndUsage)
getCostAndUsage_timePeriod :: Lens.Lens' GetCostAndUsage DateInterval
getCostAndUsage_timePeriod :: (DateInterval -> f DateInterval)
-> GetCostAndUsage -> f GetCostAndUsage
getCostAndUsage_timePeriod = (GetCostAndUsage -> DateInterval)
-> (GetCostAndUsage -> DateInterval -> GetCostAndUsage)
-> Lens GetCostAndUsage GetCostAndUsage DateInterval DateInterval
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetCostAndUsage' {DateInterval
timePeriod :: DateInterval
$sel:timePeriod:GetCostAndUsage' :: GetCostAndUsage -> DateInterval
timePeriod} -> DateInterval
timePeriod) (\s :: GetCostAndUsage
s@GetCostAndUsage' {} DateInterval
a -> GetCostAndUsage
s {$sel:timePeriod:GetCostAndUsage' :: DateInterval
timePeriod = DateInterval
a} :: GetCostAndUsage)
getCostAndUsage_granularity :: Lens.Lens' GetCostAndUsage Granularity
getCostAndUsage_granularity :: (Granularity -> f Granularity)
-> GetCostAndUsage -> f GetCostAndUsage
getCostAndUsage_granularity = (GetCostAndUsage -> Granularity)
-> (GetCostAndUsage -> Granularity -> GetCostAndUsage)
-> Lens GetCostAndUsage GetCostAndUsage Granularity Granularity
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetCostAndUsage' {Granularity
granularity :: Granularity
$sel:granularity:GetCostAndUsage' :: GetCostAndUsage -> Granularity
granularity} -> Granularity
granularity) (\s :: GetCostAndUsage
s@GetCostAndUsage' {} Granularity
a -> GetCostAndUsage
s {$sel:granularity:GetCostAndUsage' :: Granularity
granularity = Granularity
a} :: GetCostAndUsage)
getCostAndUsage_metrics :: Lens.Lens' GetCostAndUsage [Prelude.Text]
getCostAndUsage_metrics :: ([Text] -> f [Text]) -> GetCostAndUsage -> f GetCostAndUsage
getCostAndUsage_metrics = (GetCostAndUsage -> [Text])
-> (GetCostAndUsage -> [Text] -> GetCostAndUsage)
-> Lens GetCostAndUsage GetCostAndUsage [Text] [Text]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetCostAndUsage' {[Text]
metrics :: [Text]
$sel:metrics:GetCostAndUsage' :: GetCostAndUsage -> [Text]
metrics} -> [Text]
metrics) (\s :: GetCostAndUsage
s@GetCostAndUsage' {} [Text]
a -> GetCostAndUsage
s {$sel:metrics:GetCostAndUsage' :: [Text]
metrics = [Text]
a} :: GetCostAndUsage) (([Text] -> f [Text]) -> GetCostAndUsage -> f GetCostAndUsage)
-> (([Text] -> f [Text]) -> [Text] -> f [Text])
-> ([Text] -> f [Text])
-> GetCostAndUsage
-> f GetCostAndUsage
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([Text] -> f [Text]) -> [Text] -> f [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
instance Core.AWSRequest GetCostAndUsage where
type
AWSResponse GetCostAndUsage =
GetCostAndUsageResponse
request :: GetCostAndUsage -> Request GetCostAndUsage
request = Service -> GetCostAndUsage -> Request GetCostAndUsage
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy GetCostAndUsage
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse GetCostAndUsage)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse GetCostAndUsage))
-> Logger
-> Service
-> Proxy GetCostAndUsage
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse GetCostAndUsage)))
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 [ResultByTime]
-> Maybe Text
-> Maybe [DimensionValuesWithAttributes]
-> Maybe [GroupDefinition]
-> Int
-> GetCostAndUsageResponse
GetCostAndUsageResponse'
(Maybe [ResultByTime]
-> Maybe Text
-> Maybe [DimensionValuesWithAttributes]
-> Maybe [GroupDefinition]
-> Int
-> GetCostAndUsageResponse)
-> Either String (Maybe [ResultByTime])
-> Either
String
(Maybe Text
-> Maybe [DimensionValuesWithAttributes]
-> Maybe [GroupDefinition]
-> Int
-> GetCostAndUsageResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe (Maybe [ResultByTime]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"ResultsByTime" Either String (Maybe (Maybe [ResultByTime]))
-> Maybe [ResultByTime] -> Either String (Maybe [ResultByTime])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [ResultByTime]
forall a. Monoid a => a
Prelude.mempty)
Either
String
(Maybe Text
-> Maybe [DimensionValuesWithAttributes]
-> Maybe [GroupDefinition]
-> Int
-> GetCostAndUsageResponse)
-> Either String (Maybe Text)
-> Either
String
(Maybe [DimensionValuesWithAttributes]
-> Maybe [GroupDefinition] -> Int -> GetCostAndUsageResponse)
forall (f :: * -> *) a b. Applicative f => 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 [DimensionValuesWithAttributes]
-> Maybe [GroupDefinition] -> Int -> GetCostAndUsageResponse)
-> Either String (Maybe [DimensionValuesWithAttributes])
-> Either
String (Maybe [GroupDefinition] -> Int -> GetCostAndUsageResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object
-> Text
-> Either String (Maybe (Maybe [DimensionValuesWithAttributes]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"DimensionValueAttributes"
Either String (Maybe (Maybe [DimensionValuesWithAttributes]))
-> Maybe [DimensionValuesWithAttributes]
-> Either String (Maybe [DimensionValuesWithAttributes])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [DimensionValuesWithAttributes]
forall a. Monoid a => a
Prelude.mempty
)
Either
String (Maybe [GroupDefinition] -> Int -> GetCostAndUsageResponse)
-> Either String (Maybe [GroupDefinition])
-> Either String (Int -> GetCostAndUsageResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object -> Text -> Either String (Maybe (Maybe [GroupDefinition]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"GroupDefinitions"
Either String (Maybe (Maybe [GroupDefinition]))
-> Maybe [GroupDefinition]
-> Either String (Maybe [GroupDefinition])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [GroupDefinition]
forall a. Monoid a => a
Prelude.mempty
)
Either String (Int -> GetCostAndUsageResponse)
-> Either String Int -> Either String GetCostAndUsageResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Int -> Either String Int
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (Int -> Int
forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
)
instance Prelude.Hashable GetCostAndUsage
instance Prelude.NFData GetCostAndUsage
instance Core.ToHeaders GetCostAndUsage where
toHeaders :: GetCostAndUsage -> ResponseHeaders
toHeaders =
ResponseHeaders -> GetCostAndUsage -> 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.GetCostAndUsage" ::
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 GetCostAndUsage where
toJSON :: GetCostAndUsage -> Value
toJSON GetCostAndUsage' {[Text]
Maybe [GroupDefinition]
Maybe Text
Maybe Expression
DateInterval
Granularity
metrics :: [Text]
granularity :: Granularity
timePeriod :: DateInterval
filter' :: Maybe Expression
nextPageToken :: Maybe Text
groupBy :: Maybe [GroupDefinition]
$sel:metrics:GetCostAndUsage' :: GetCostAndUsage -> [Text]
$sel:granularity:GetCostAndUsage' :: GetCostAndUsage -> Granularity
$sel:timePeriod:GetCostAndUsage' :: GetCostAndUsage -> DateInterval
$sel:filter':GetCostAndUsage' :: GetCostAndUsage -> Maybe Expression
$sel:nextPageToken:GetCostAndUsage' :: GetCostAndUsage -> Maybe Text
$sel:groupBy:GetCostAndUsage' :: GetCostAndUsage -> 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
"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',
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),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Granularity" Text -> Granularity -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Granularity
granularity),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Metrics" Text -> [Text] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= [Text]
metrics)
]
)
instance Core.ToPath GetCostAndUsage where
toPath :: GetCostAndUsage -> ByteString
toPath = ByteString -> GetCostAndUsage -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery GetCostAndUsage where
toQuery :: GetCostAndUsage -> QueryString
toQuery = QueryString -> GetCostAndUsage -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data GetCostAndUsageResponse = GetCostAndUsageResponse'
{
GetCostAndUsageResponse -> Maybe [ResultByTime]
resultsByTime :: Prelude.Maybe [ResultByTime],
GetCostAndUsageResponse -> Maybe Text
nextPageToken :: Prelude.Maybe Prelude.Text,
GetCostAndUsageResponse -> Maybe [DimensionValuesWithAttributes]
dimensionValueAttributes :: Prelude.Maybe [DimensionValuesWithAttributes],
GetCostAndUsageResponse -> Maybe [GroupDefinition]
groupDefinitions :: Prelude.Maybe [GroupDefinition],
GetCostAndUsageResponse -> Int
httpStatus :: Prelude.Int
}
deriving (GetCostAndUsageResponse -> GetCostAndUsageResponse -> Bool
(GetCostAndUsageResponse -> GetCostAndUsageResponse -> Bool)
-> (GetCostAndUsageResponse -> GetCostAndUsageResponse -> Bool)
-> Eq GetCostAndUsageResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetCostAndUsageResponse -> GetCostAndUsageResponse -> Bool
$c/= :: GetCostAndUsageResponse -> GetCostAndUsageResponse -> Bool
== :: GetCostAndUsageResponse -> GetCostAndUsageResponse -> Bool
$c== :: GetCostAndUsageResponse -> GetCostAndUsageResponse -> Bool
Prelude.Eq, ReadPrec [GetCostAndUsageResponse]
ReadPrec GetCostAndUsageResponse
Int -> ReadS GetCostAndUsageResponse
ReadS [GetCostAndUsageResponse]
(Int -> ReadS GetCostAndUsageResponse)
-> ReadS [GetCostAndUsageResponse]
-> ReadPrec GetCostAndUsageResponse
-> ReadPrec [GetCostAndUsageResponse]
-> Read GetCostAndUsageResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetCostAndUsageResponse]
$creadListPrec :: ReadPrec [GetCostAndUsageResponse]
readPrec :: ReadPrec GetCostAndUsageResponse
$creadPrec :: ReadPrec GetCostAndUsageResponse
readList :: ReadS [GetCostAndUsageResponse]
$creadList :: ReadS [GetCostAndUsageResponse]
readsPrec :: Int -> ReadS GetCostAndUsageResponse
$creadsPrec :: Int -> ReadS GetCostAndUsageResponse
Prelude.Read, Int -> GetCostAndUsageResponse -> ShowS
[GetCostAndUsageResponse] -> ShowS
GetCostAndUsageResponse -> String
(Int -> GetCostAndUsageResponse -> ShowS)
-> (GetCostAndUsageResponse -> String)
-> ([GetCostAndUsageResponse] -> ShowS)
-> Show GetCostAndUsageResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetCostAndUsageResponse] -> ShowS
$cshowList :: [GetCostAndUsageResponse] -> ShowS
show :: GetCostAndUsageResponse -> String
$cshow :: GetCostAndUsageResponse -> String
showsPrec :: Int -> GetCostAndUsageResponse -> ShowS
$cshowsPrec :: Int -> GetCostAndUsageResponse -> ShowS
Prelude.Show, (forall x.
GetCostAndUsageResponse -> Rep GetCostAndUsageResponse x)
-> (forall x.
Rep GetCostAndUsageResponse x -> GetCostAndUsageResponse)
-> Generic GetCostAndUsageResponse
forall x. Rep GetCostAndUsageResponse x -> GetCostAndUsageResponse
forall x. GetCostAndUsageResponse -> Rep GetCostAndUsageResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetCostAndUsageResponse x -> GetCostAndUsageResponse
$cfrom :: forall x. GetCostAndUsageResponse -> Rep GetCostAndUsageResponse x
Prelude.Generic)
newGetCostAndUsageResponse ::
Prelude.Int ->
GetCostAndUsageResponse
newGetCostAndUsageResponse :: Int -> GetCostAndUsageResponse
newGetCostAndUsageResponse Int
pHttpStatus_ =
GetCostAndUsageResponse' :: Maybe [ResultByTime]
-> Maybe Text
-> Maybe [DimensionValuesWithAttributes]
-> Maybe [GroupDefinition]
-> Int
-> GetCostAndUsageResponse
GetCostAndUsageResponse'
{ $sel:resultsByTime:GetCostAndUsageResponse' :: Maybe [ResultByTime]
resultsByTime =
Maybe [ResultByTime]
forall a. Maybe a
Prelude.Nothing,
$sel:nextPageToken:GetCostAndUsageResponse' :: Maybe Text
nextPageToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:dimensionValueAttributes:GetCostAndUsageResponse' :: Maybe [DimensionValuesWithAttributes]
dimensionValueAttributes = Maybe [DimensionValuesWithAttributes]
forall a. Maybe a
Prelude.Nothing,
$sel:groupDefinitions:GetCostAndUsageResponse' :: Maybe [GroupDefinition]
groupDefinitions = Maybe [GroupDefinition]
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:GetCostAndUsageResponse' :: Int
httpStatus = Int
pHttpStatus_
}
getCostAndUsageResponse_resultsByTime :: Lens.Lens' GetCostAndUsageResponse (Prelude.Maybe [ResultByTime])
getCostAndUsageResponse_resultsByTime :: (Maybe [ResultByTime] -> f (Maybe [ResultByTime]))
-> GetCostAndUsageResponse -> f GetCostAndUsageResponse
getCostAndUsageResponse_resultsByTime = (GetCostAndUsageResponse -> Maybe [ResultByTime])
-> (GetCostAndUsageResponse
-> Maybe [ResultByTime] -> GetCostAndUsageResponse)
-> Lens
GetCostAndUsageResponse
GetCostAndUsageResponse
(Maybe [ResultByTime])
(Maybe [ResultByTime])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetCostAndUsageResponse' {Maybe [ResultByTime]
resultsByTime :: Maybe [ResultByTime]
$sel:resultsByTime:GetCostAndUsageResponse' :: GetCostAndUsageResponse -> Maybe [ResultByTime]
resultsByTime} -> Maybe [ResultByTime]
resultsByTime) (\s :: GetCostAndUsageResponse
s@GetCostAndUsageResponse' {} Maybe [ResultByTime]
a -> GetCostAndUsageResponse
s {$sel:resultsByTime:GetCostAndUsageResponse' :: Maybe [ResultByTime]
resultsByTime = Maybe [ResultByTime]
a} :: GetCostAndUsageResponse) ((Maybe [ResultByTime] -> f (Maybe [ResultByTime]))
-> GetCostAndUsageResponse -> f GetCostAndUsageResponse)
-> ((Maybe [ResultByTime] -> f (Maybe [ResultByTime]))
-> Maybe [ResultByTime] -> f (Maybe [ResultByTime]))
-> (Maybe [ResultByTime] -> f (Maybe [ResultByTime]))
-> GetCostAndUsageResponse
-> f GetCostAndUsageResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [ResultByTime] [ResultByTime] [ResultByTime] [ResultByTime]
-> Iso
(Maybe [ResultByTime])
(Maybe [ResultByTime])
(Maybe [ResultByTime])
(Maybe [ResultByTime])
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 [ResultByTime] [ResultByTime] [ResultByTime] [ResultByTime]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
getCostAndUsageResponse_nextPageToken :: Lens.Lens' GetCostAndUsageResponse (Prelude.Maybe Prelude.Text)
getCostAndUsageResponse_nextPageToken :: (Maybe Text -> f (Maybe Text))
-> GetCostAndUsageResponse -> f GetCostAndUsageResponse
getCostAndUsageResponse_nextPageToken = (GetCostAndUsageResponse -> Maybe Text)
-> (GetCostAndUsageResponse
-> Maybe Text -> GetCostAndUsageResponse)
-> Lens
GetCostAndUsageResponse
GetCostAndUsageResponse
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetCostAndUsageResponse' {Maybe Text
nextPageToken :: Maybe Text
$sel:nextPageToken:GetCostAndUsageResponse' :: GetCostAndUsageResponse -> Maybe Text
nextPageToken} -> Maybe Text
nextPageToken) (\s :: GetCostAndUsageResponse
s@GetCostAndUsageResponse' {} Maybe Text
a -> GetCostAndUsageResponse
s {$sel:nextPageToken:GetCostAndUsageResponse' :: Maybe Text
nextPageToken = Maybe Text
a} :: GetCostAndUsageResponse)
getCostAndUsageResponse_dimensionValueAttributes :: Lens.Lens' GetCostAndUsageResponse (Prelude.Maybe [DimensionValuesWithAttributes])
getCostAndUsageResponse_dimensionValueAttributes :: (Maybe [DimensionValuesWithAttributes]
-> f (Maybe [DimensionValuesWithAttributes]))
-> GetCostAndUsageResponse -> f GetCostAndUsageResponse
getCostAndUsageResponse_dimensionValueAttributes = (GetCostAndUsageResponse -> Maybe [DimensionValuesWithAttributes])
-> (GetCostAndUsageResponse
-> Maybe [DimensionValuesWithAttributes]
-> GetCostAndUsageResponse)
-> Lens
GetCostAndUsageResponse
GetCostAndUsageResponse
(Maybe [DimensionValuesWithAttributes])
(Maybe [DimensionValuesWithAttributes])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetCostAndUsageResponse' {Maybe [DimensionValuesWithAttributes]
dimensionValueAttributes :: Maybe [DimensionValuesWithAttributes]
$sel:dimensionValueAttributes:GetCostAndUsageResponse' :: GetCostAndUsageResponse -> Maybe [DimensionValuesWithAttributes]
dimensionValueAttributes} -> Maybe [DimensionValuesWithAttributes]
dimensionValueAttributes) (\s :: GetCostAndUsageResponse
s@GetCostAndUsageResponse' {} Maybe [DimensionValuesWithAttributes]
a -> GetCostAndUsageResponse
s {$sel:dimensionValueAttributes:GetCostAndUsageResponse' :: Maybe [DimensionValuesWithAttributes]
dimensionValueAttributes = Maybe [DimensionValuesWithAttributes]
a} :: GetCostAndUsageResponse) ((Maybe [DimensionValuesWithAttributes]
-> f (Maybe [DimensionValuesWithAttributes]))
-> GetCostAndUsageResponse -> f GetCostAndUsageResponse)
-> ((Maybe [DimensionValuesWithAttributes]
-> f (Maybe [DimensionValuesWithAttributes]))
-> Maybe [DimensionValuesWithAttributes]
-> f (Maybe [DimensionValuesWithAttributes]))
-> (Maybe [DimensionValuesWithAttributes]
-> f (Maybe [DimensionValuesWithAttributes]))
-> GetCostAndUsageResponse
-> f GetCostAndUsageResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
[DimensionValuesWithAttributes]
[DimensionValuesWithAttributes]
[DimensionValuesWithAttributes]
[DimensionValuesWithAttributes]
-> Iso
(Maybe [DimensionValuesWithAttributes])
(Maybe [DimensionValuesWithAttributes])
(Maybe [DimensionValuesWithAttributes])
(Maybe [DimensionValuesWithAttributes])
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
[DimensionValuesWithAttributes]
[DimensionValuesWithAttributes]
[DimensionValuesWithAttributes]
[DimensionValuesWithAttributes]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
getCostAndUsageResponse_groupDefinitions :: Lens.Lens' GetCostAndUsageResponse (Prelude.Maybe [GroupDefinition])
getCostAndUsageResponse_groupDefinitions :: (Maybe [GroupDefinition] -> f (Maybe [GroupDefinition]))
-> GetCostAndUsageResponse -> f GetCostAndUsageResponse
getCostAndUsageResponse_groupDefinitions = (GetCostAndUsageResponse -> Maybe [GroupDefinition])
-> (GetCostAndUsageResponse
-> Maybe [GroupDefinition] -> GetCostAndUsageResponse)
-> Lens
GetCostAndUsageResponse
GetCostAndUsageResponse
(Maybe [GroupDefinition])
(Maybe [GroupDefinition])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetCostAndUsageResponse' {Maybe [GroupDefinition]
groupDefinitions :: Maybe [GroupDefinition]
$sel:groupDefinitions:GetCostAndUsageResponse' :: GetCostAndUsageResponse -> Maybe [GroupDefinition]
groupDefinitions} -> Maybe [GroupDefinition]
groupDefinitions) (\s :: GetCostAndUsageResponse
s@GetCostAndUsageResponse' {} Maybe [GroupDefinition]
a -> GetCostAndUsageResponse
s {$sel:groupDefinitions:GetCostAndUsageResponse' :: Maybe [GroupDefinition]
groupDefinitions = Maybe [GroupDefinition]
a} :: GetCostAndUsageResponse) ((Maybe [GroupDefinition] -> f (Maybe [GroupDefinition]))
-> GetCostAndUsageResponse -> f GetCostAndUsageResponse)
-> ((Maybe [GroupDefinition] -> f (Maybe [GroupDefinition]))
-> Maybe [GroupDefinition] -> f (Maybe [GroupDefinition]))
-> (Maybe [GroupDefinition] -> f (Maybe [GroupDefinition]))
-> GetCostAndUsageResponse
-> f GetCostAndUsageResponse
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
getCostAndUsageResponse_httpStatus :: Lens.Lens' GetCostAndUsageResponse Prelude.Int
getCostAndUsageResponse_httpStatus :: (Int -> f Int)
-> GetCostAndUsageResponse -> f GetCostAndUsageResponse
getCostAndUsageResponse_httpStatus = (GetCostAndUsageResponse -> Int)
-> (GetCostAndUsageResponse -> Int -> GetCostAndUsageResponse)
-> Lens GetCostAndUsageResponse GetCostAndUsageResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetCostAndUsageResponse' {Int
httpStatus :: Int
$sel:httpStatus:GetCostAndUsageResponse' :: GetCostAndUsageResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: GetCostAndUsageResponse
s@GetCostAndUsageResponse' {} Int
a -> GetCostAndUsageResponse
s {$sel:httpStatus:GetCostAndUsageResponse' :: Int
httpStatus = Int
a} :: GetCostAndUsageResponse)
instance Prelude.NFData GetCostAndUsageResponse