{-# 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 #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.CostExplorer.GetSavingsPlansUtilizationDetails
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Retrieves attribute data along with aggregate utilization and savings
-- data for a given time period. This doesn\'t support granular or grouped
-- data (daily\/monthly) in response. You can\'t retrieve data by dates in
-- a single response similar to @GetSavingsPlanUtilization@, but you have
-- the option to make multiple calls to @GetSavingsPlanUtilizationDetails@
-- by providing individual dates. You can use @GetDimensionValues@ in
-- @SAVINGS_PLANS@ to determine the possible dimension values.
--
-- @GetSavingsPlanUtilizationDetails@ internally groups data by
-- @SavingsPlansArn@.
module Amazonka.CostExplorer.GetSavingsPlansUtilizationDetails
  ( -- * Creating a Request
    GetSavingsPlansUtilizationDetails (..),
    newGetSavingsPlansUtilizationDetails,

    -- * Request Lenses
    getSavingsPlansUtilizationDetails_nextToken,
    getSavingsPlansUtilizationDetails_dataType,
    getSavingsPlansUtilizationDetails_filter,
    getSavingsPlansUtilizationDetails_maxResults,
    getSavingsPlansUtilizationDetails_sortBy,
    getSavingsPlansUtilizationDetails_timePeriod,

    -- * Destructuring the Response
    GetSavingsPlansUtilizationDetailsResponse (..),
    newGetSavingsPlansUtilizationDetailsResponse,

    -- * Response Lenses
    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

-- | /See:/ 'newGetSavingsPlansUtilizationDetails' smart constructor.
data GetSavingsPlansUtilizationDetails = GetSavingsPlansUtilizationDetails'
  { -- | The token to retrieve the next set of results. Amazon Web Services
    -- provides the token when the response from a previous call has more
    -- results than the maximum page size.
    GetSavingsPlansUtilizationDetails -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The data type.
    GetSavingsPlansUtilizationDetails -> Maybe [SavingsPlansDataType]
dataType :: Prelude.Maybe [SavingsPlansDataType],
    -- | Filters Savings Plans utilization coverage data for active Savings Plans
    -- dimensions. You can filter data with the following dimensions:
    --
    -- -   @LINKED_ACCOUNT@
    --
    -- -   @SAVINGS_PLAN_ARN@
    --
    -- -   @REGION@
    --
    -- -   @PAYMENT_OPTION@
    --
    -- -   @INSTANCE_TYPE_FAMILY@
    --
    -- @GetSavingsPlansUtilizationDetails@ uses the same
    -- <https://docs.aws.amazon.com/aws-cost-management/latest/APIReference/API_Expression.html Expression>
    -- object as the other operations, but only @AND@ is supported among each
    -- dimension.
    GetSavingsPlansUtilizationDetails -> Maybe Expression
filter' :: Prelude.Maybe Expression,
    -- | The number of items to be returned in a response. The default is @20@,
    -- with a minimum value of @1@.
    GetSavingsPlansUtilizationDetails -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
    -- | The value by which you want to sort the data.
    --
    -- The following values are supported for @Key@:
    --
    -- -   @UtilizationPercentage@
    --
    -- -   @TotalCommitment@
    --
    -- -   @UsedCommitment@
    --
    -- -   @UnusedCommitment@
    --
    -- -   @NetSavings@
    --
    -- -   @AmortizedRecurringCommitment@
    --
    -- -   @AmortizedUpfrontCommitment@
    --
    -- Supported values for @SortOrder@ are @ASCENDING@ or @DESCENDING@.
    GetSavingsPlansUtilizationDetails -> Maybe SortDefinition
sortBy :: Prelude.Maybe SortDefinition,
    -- | The time period that you want the usage and costs for. The @Start@ date
    -- must be within 13 months. The @End@ date must be after the @Start@ date,
    -- and before the current date. Future dates can\'t be used as an @End@
    -- date.
    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)

-- |
-- Create a value of 'GetSavingsPlansUtilizationDetails' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'nextToken', 'getSavingsPlansUtilizationDetails_nextToken' - The token to retrieve the next set of results. Amazon Web Services
-- provides the token when the response from a previous call has more
-- results than the maximum page size.
--
-- 'dataType', 'getSavingsPlansUtilizationDetails_dataType' - The data type.
--
-- 'filter'', 'getSavingsPlansUtilizationDetails_filter' - Filters Savings Plans utilization coverage data for active Savings Plans
-- dimensions. You can filter data with the following dimensions:
--
-- -   @LINKED_ACCOUNT@
--
-- -   @SAVINGS_PLAN_ARN@
--
-- -   @REGION@
--
-- -   @PAYMENT_OPTION@
--
-- -   @INSTANCE_TYPE_FAMILY@
--
-- @GetSavingsPlansUtilizationDetails@ uses the same
-- <https://docs.aws.amazon.com/aws-cost-management/latest/APIReference/API_Expression.html Expression>
-- object as the other operations, but only @AND@ is supported among each
-- dimension.
--
-- 'maxResults', 'getSavingsPlansUtilizationDetails_maxResults' - The number of items to be returned in a response. The default is @20@,
-- with a minimum value of @1@.
--
-- 'sortBy', 'getSavingsPlansUtilizationDetails_sortBy' - The value by which you want to sort the data.
--
-- The following values are supported for @Key@:
--
-- -   @UtilizationPercentage@
--
-- -   @TotalCommitment@
--
-- -   @UsedCommitment@
--
-- -   @UnusedCommitment@
--
-- -   @NetSavings@
--
-- -   @AmortizedRecurringCommitment@
--
-- -   @AmortizedUpfrontCommitment@
--
-- Supported values for @SortOrder@ are @ASCENDING@ or @DESCENDING@.
--
-- 'timePeriod', 'getSavingsPlansUtilizationDetails_timePeriod' - The time period that you want the usage and costs for. The @Start@ date
-- must be within 13 months. The @End@ date must be after the @Start@ date,
-- and before the current date. Future dates can\'t be used as an @End@
-- date.
newGetSavingsPlansUtilizationDetails ::
  -- | 'timePeriod'
  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_
    }

-- | The token to retrieve the next set of results. Amazon Web Services
-- provides the token when the response from a previous call has more
-- results than the maximum page size.
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)

-- | The data type.
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

-- | Filters Savings Plans utilization coverage data for active Savings Plans
-- dimensions. You can filter data with the following dimensions:
--
-- -   @LINKED_ACCOUNT@
--
-- -   @SAVINGS_PLAN_ARN@
--
-- -   @REGION@
--
-- -   @PAYMENT_OPTION@
--
-- -   @INSTANCE_TYPE_FAMILY@
--
-- @GetSavingsPlansUtilizationDetails@ uses the same
-- <https://docs.aws.amazon.com/aws-cost-management/latest/APIReference/API_Expression.html Expression>
-- object as the other operations, but only @AND@ is supported among each
-- dimension.
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)

-- | The number of items to be returned in a response. The default is @20@,
-- with a minimum value of @1@.
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)

-- | The value by which you want to sort the data.
--
-- The following values are supported for @Key@:
--
-- -   @UtilizationPercentage@
--
-- -   @TotalCommitment@
--
-- -   @UsedCommitment@
--
-- -   @UnusedCommitment@
--
-- -   @NetSavings@
--
-- -   @AmortizedRecurringCommitment@
--
-- -   @AmortizedUpfrontCommitment@
--
-- Supported values for @SortOrder@ are @ASCENDING@ or @DESCENDING@.
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)

-- | The time period that you want the usage and costs for. The @Start@ date
-- must be within 13 months. The @End@ date must be after the @Start@ date,
-- and before the current date. Future dates can\'t be used as an @End@
-- date.
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

-- | /See:/ 'newGetSavingsPlansUtilizationDetailsResponse' smart constructor.
data GetSavingsPlansUtilizationDetailsResponse = GetSavingsPlansUtilizationDetailsResponse'
  { -- | The token to retrieve the next set of results. Amazon Web Services
    -- provides the token when the response from a previous call has more
    -- results than the maximum page size.
    GetSavingsPlansUtilizationDetailsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The total Savings Plans utilization, regardless of time period.
    GetSavingsPlansUtilizationDetailsResponse
-> Maybe SavingsPlansUtilizationAggregates
total :: Prelude.Maybe SavingsPlansUtilizationAggregates,
    -- | The response's http status code.
    GetSavingsPlansUtilizationDetailsResponse -> Int
httpStatus :: Prelude.Int,
    -- | Retrieves a single daily or monthly Savings Plans utilization rate and
    -- details for your account.
    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)

-- |
-- Create a value of 'GetSavingsPlansUtilizationDetailsResponse' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'nextToken', 'getSavingsPlansUtilizationDetailsResponse_nextToken' - The token to retrieve the next set of results. Amazon Web Services
-- provides the token when the response from a previous call has more
-- results than the maximum page size.
--
-- 'total', 'getSavingsPlansUtilizationDetailsResponse_total' - The total Savings Plans utilization, regardless of time period.
--
-- 'httpStatus', 'getSavingsPlansUtilizationDetailsResponse_httpStatus' - The response's http status code.
--
-- 'savingsPlansUtilizationDetails', 'getSavingsPlansUtilizationDetailsResponse_savingsPlansUtilizationDetails' - Retrieves a single daily or monthly Savings Plans utilization rate and
-- details for your account.
--
-- 'timePeriod', 'getSavingsPlansUtilizationDetailsResponse_timePeriod' - Undocumented member.
newGetSavingsPlansUtilizationDetailsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  -- | 'timePeriod'
  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_
      }

-- | The token to retrieve the next set of results. Amazon Web Services
-- provides the token when the response from a previous call has more
-- results than the maximum page size.
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)

-- | The total Savings Plans utilization, regardless of time period.
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)

-- | The response's http status code.
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)

-- | Retrieves a single daily or monthly Savings Plans utilization rate and
-- details for your account.
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

-- | Undocumented member.
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