{-# 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.GetSavingsPlansCoverage
-- 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 the Savings Plans covered for your account. This enables you
-- to see how much of your cost is covered by a Savings Plan. An
-- organization’s management account can see the coverage of the associated
-- member accounts. This supports dimensions, Cost Categories, and nested
-- expressions. For any time period, you can filter data for Savings Plans
-- usage with the following dimensions:
--
-- -   @LINKED_ACCOUNT@
--
-- -   @REGION@
--
-- -   @SERVICE@
--
-- -   @INSTANCE_FAMILY@
--
-- To determine valid values for a dimension, use the @GetDimensionValues@
-- operation.
module Amazonka.CostExplorer.GetSavingsPlansCoverage
  ( -- * Creating a Request
    GetSavingsPlansCoverage (..),
    newGetSavingsPlansCoverage,

    -- * Request Lenses
    getSavingsPlansCoverage_groupBy,
    getSavingsPlansCoverage_metrics,
    getSavingsPlansCoverage_granularity,
    getSavingsPlansCoverage_nextToken,
    getSavingsPlansCoverage_filter,
    getSavingsPlansCoverage_maxResults,
    getSavingsPlansCoverage_sortBy,
    getSavingsPlansCoverage_timePeriod,

    -- * Destructuring the Response
    GetSavingsPlansCoverageResponse (..),
    newGetSavingsPlansCoverageResponse,

    -- * Response Lenses
    getSavingsPlansCoverageResponse_nextToken,
    getSavingsPlansCoverageResponse_httpStatus,
    getSavingsPlansCoverageResponse_savingsPlansCoverages,
  )
where

import qualified Amazonka.Core as Core
import Amazonka.CostExplorer.Types
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | /See:/ 'newGetSavingsPlansCoverage' smart constructor.
data GetSavingsPlansCoverage = GetSavingsPlansCoverage'
  { -- | You can group the data using the attributes @INSTANCE_FAMILY@, @REGION@,
    -- or @SERVICE@.
    GetSavingsPlansCoverage -> Maybe [GroupDefinition]
groupBy :: Prelude.Maybe [GroupDefinition],
    -- | The measurement that you want your Savings Plans coverage reported in.
    -- The only valid value is @SpendCoveredBySavingsPlans@.
    GetSavingsPlansCoverage -> Maybe [Text]
metrics :: Prelude.Maybe [Prelude.Text],
    -- | The granularity of the Amazon Web Services cost data for your Savings
    -- Plans. @Granularity@ can\'t be set if @GroupBy@ is set.
    --
    -- The @GetSavingsPlansCoverage@ operation supports only @DAILY@ and
    -- @MONTHLY@ granularities.
    GetSavingsPlansCoverage -> Maybe Granularity
granularity :: Prelude.Maybe Granularity,
    -- | 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.
    GetSavingsPlansCoverage -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | Filters Savings Plans coverage data by dimensions. You can filter data
    -- for Savings Plans usage with the following dimensions:
    --
    -- -   @LINKED_ACCOUNT@
    --
    -- -   @REGION@
    --
    -- -   @SERVICE@
    --
    -- -   @INSTANCE_FAMILY@
    --
    -- @GetSavingsPlansCoverage@ 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. If there are multiple values for a dimension, they are OR\'d
    -- together.
    --
    -- Cost category is also supported.
    GetSavingsPlansCoverage -> 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@.
    GetSavingsPlansCoverage -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
    -- | The value by which you want to sort the data.
    --
    -- The following values are supported for @Key@:
    --
    -- -   @SpendCoveredBySavingsPlan@
    --
    -- -   @OnDemandCost@
    --
    -- -   @CoveragePercentage@
    --
    -- -   @TotalCost@
    --
    -- -   @InstanceFamily@
    --
    -- -   @Region@
    --
    -- -   @Service@
    --
    -- Supported values for @SortOrder@ are @ASCENDING@ or @DESCENDING@.
    GetSavingsPlansCoverage -> 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.
    GetSavingsPlansCoverage -> DateInterval
timePeriod :: DateInterval
  }
  deriving (GetSavingsPlansCoverage -> GetSavingsPlansCoverage -> Bool
(GetSavingsPlansCoverage -> GetSavingsPlansCoverage -> Bool)
-> (GetSavingsPlansCoverage -> GetSavingsPlansCoverage -> Bool)
-> Eq GetSavingsPlansCoverage
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetSavingsPlansCoverage -> GetSavingsPlansCoverage -> Bool
$c/= :: GetSavingsPlansCoverage -> GetSavingsPlansCoverage -> Bool
== :: GetSavingsPlansCoverage -> GetSavingsPlansCoverage -> Bool
$c== :: GetSavingsPlansCoverage -> GetSavingsPlansCoverage -> Bool
Prelude.Eq, ReadPrec [GetSavingsPlansCoverage]
ReadPrec GetSavingsPlansCoverage
Int -> ReadS GetSavingsPlansCoverage
ReadS [GetSavingsPlansCoverage]
(Int -> ReadS GetSavingsPlansCoverage)
-> ReadS [GetSavingsPlansCoverage]
-> ReadPrec GetSavingsPlansCoverage
-> ReadPrec [GetSavingsPlansCoverage]
-> Read GetSavingsPlansCoverage
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetSavingsPlansCoverage]
$creadListPrec :: ReadPrec [GetSavingsPlansCoverage]
readPrec :: ReadPrec GetSavingsPlansCoverage
$creadPrec :: ReadPrec GetSavingsPlansCoverage
readList :: ReadS [GetSavingsPlansCoverage]
$creadList :: ReadS [GetSavingsPlansCoverage]
readsPrec :: Int -> ReadS GetSavingsPlansCoverage
$creadsPrec :: Int -> ReadS GetSavingsPlansCoverage
Prelude.Read, Int -> GetSavingsPlansCoverage -> ShowS
[GetSavingsPlansCoverage] -> ShowS
GetSavingsPlansCoverage -> String
(Int -> GetSavingsPlansCoverage -> ShowS)
-> (GetSavingsPlansCoverage -> String)
-> ([GetSavingsPlansCoverage] -> ShowS)
-> Show GetSavingsPlansCoverage
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetSavingsPlansCoverage] -> ShowS
$cshowList :: [GetSavingsPlansCoverage] -> ShowS
show :: GetSavingsPlansCoverage -> String
$cshow :: GetSavingsPlansCoverage -> String
showsPrec :: Int -> GetSavingsPlansCoverage -> ShowS
$cshowsPrec :: Int -> GetSavingsPlansCoverage -> ShowS
Prelude.Show, (forall x.
 GetSavingsPlansCoverage -> Rep GetSavingsPlansCoverage x)
-> (forall x.
    Rep GetSavingsPlansCoverage x -> GetSavingsPlansCoverage)
-> Generic GetSavingsPlansCoverage
forall x. Rep GetSavingsPlansCoverage x -> GetSavingsPlansCoverage
forall x. GetSavingsPlansCoverage -> Rep GetSavingsPlansCoverage x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetSavingsPlansCoverage x -> GetSavingsPlansCoverage
$cfrom :: forall x. GetSavingsPlansCoverage -> Rep GetSavingsPlansCoverage x
Prelude.Generic)

-- |
-- Create a value of 'GetSavingsPlansCoverage' 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:
--
-- 'groupBy', 'getSavingsPlansCoverage_groupBy' - You can group the data using the attributes @INSTANCE_FAMILY@, @REGION@,
-- or @SERVICE@.
--
-- 'metrics', 'getSavingsPlansCoverage_metrics' - The measurement that you want your Savings Plans coverage reported in.
-- The only valid value is @SpendCoveredBySavingsPlans@.
--
-- 'granularity', 'getSavingsPlansCoverage_granularity' - The granularity of the Amazon Web Services cost data for your Savings
-- Plans. @Granularity@ can\'t be set if @GroupBy@ is set.
--
-- The @GetSavingsPlansCoverage@ operation supports only @DAILY@ and
-- @MONTHLY@ granularities.
--
-- 'nextToken', 'getSavingsPlansCoverage_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.
--
-- 'filter'', 'getSavingsPlansCoverage_filter' - Filters Savings Plans coverage data by dimensions. You can filter data
-- for Savings Plans usage with the following dimensions:
--
-- -   @LINKED_ACCOUNT@
--
-- -   @REGION@
--
-- -   @SERVICE@
--
-- -   @INSTANCE_FAMILY@
--
-- @GetSavingsPlansCoverage@ 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. If there are multiple values for a dimension, they are OR\'d
-- together.
--
-- Cost category is also supported.
--
-- 'maxResults', 'getSavingsPlansCoverage_maxResults' - The number of items to be returned in a response. The default is @20@,
-- with a minimum value of @1@.
--
-- 'sortBy', 'getSavingsPlansCoverage_sortBy' - The value by which you want to sort the data.
--
-- The following values are supported for @Key@:
--
-- -   @SpendCoveredBySavingsPlan@
--
-- -   @OnDemandCost@
--
-- -   @CoveragePercentage@
--
-- -   @TotalCost@
--
-- -   @InstanceFamily@
--
-- -   @Region@
--
-- -   @Service@
--
-- Supported values for @SortOrder@ are @ASCENDING@ or @DESCENDING@.
--
-- 'timePeriod', 'getSavingsPlansCoverage_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.
newGetSavingsPlansCoverage ::
  -- | 'timePeriod'
  DateInterval ->
  GetSavingsPlansCoverage
newGetSavingsPlansCoverage :: DateInterval -> GetSavingsPlansCoverage
newGetSavingsPlansCoverage DateInterval
pTimePeriod_ =
  GetSavingsPlansCoverage' :: Maybe [GroupDefinition]
-> Maybe [Text]
-> Maybe Granularity
-> Maybe Text
-> Maybe Expression
-> Maybe Natural
-> Maybe SortDefinition
-> DateInterval
-> GetSavingsPlansCoverage
GetSavingsPlansCoverage'
    { $sel:groupBy:GetSavingsPlansCoverage' :: Maybe [GroupDefinition]
groupBy = Maybe [GroupDefinition]
forall a. Maybe a
Prelude.Nothing,
      $sel:metrics:GetSavingsPlansCoverage' :: Maybe [Text]
metrics = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
      $sel:granularity:GetSavingsPlansCoverage' :: Maybe Granularity
granularity = Maybe Granularity
forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:GetSavingsPlansCoverage' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:filter':GetSavingsPlansCoverage' :: Maybe Expression
filter' = Maybe Expression
forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:GetSavingsPlansCoverage' :: Maybe Natural
maxResults = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:sortBy:GetSavingsPlansCoverage' :: Maybe SortDefinition
sortBy = Maybe SortDefinition
forall a. Maybe a
Prelude.Nothing,
      $sel:timePeriod:GetSavingsPlansCoverage' :: DateInterval
timePeriod = DateInterval
pTimePeriod_
    }

-- | You can group the data using the attributes @INSTANCE_FAMILY@, @REGION@,
-- or @SERVICE@.
getSavingsPlansCoverage_groupBy :: Lens.Lens' GetSavingsPlansCoverage (Prelude.Maybe [GroupDefinition])
getSavingsPlansCoverage_groupBy :: (Maybe [GroupDefinition] -> f (Maybe [GroupDefinition]))
-> GetSavingsPlansCoverage -> f GetSavingsPlansCoverage
getSavingsPlansCoverage_groupBy = (GetSavingsPlansCoverage -> Maybe [GroupDefinition])
-> (GetSavingsPlansCoverage
    -> Maybe [GroupDefinition] -> GetSavingsPlansCoverage)
-> Lens
     GetSavingsPlansCoverage
     GetSavingsPlansCoverage
     (Maybe [GroupDefinition])
     (Maybe [GroupDefinition])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetSavingsPlansCoverage' {Maybe [GroupDefinition]
groupBy :: Maybe [GroupDefinition]
$sel:groupBy:GetSavingsPlansCoverage' :: GetSavingsPlansCoverage -> Maybe [GroupDefinition]
groupBy} -> Maybe [GroupDefinition]
groupBy) (\s :: GetSavingsPlansCoverage
s@GetSavingsPlansCoverage' {} Maybe [GroupDefinition]
a -> GetSavingsPlansCoverage
s {$sel:groupBy:GetSavingsPlansCoverage' :: Maybe [GroupDefinition]
groupBy = Maybe [GroupDefinition]
a} :: GetSavingsPlansCoverage) ((Maybe [GroupDefinition] -> f (Maybe [GroupDefinition]))
 -> GetSavingsPlansCoverage -> f GetSavingsPlansCoverage)
-> ((Maybe [GroupDefinition] -> f (Maybe [GroupDefinition]))
    -> Maybe [GroupDefinition] -> f (Maybe [GroupDefinition]))
-> (Maybe [GroupDefinition] -> f (Maybe [GroupDefinition]))
-> GetSavingsPlansCoverage
-> f GetSavingsPlansCoverage
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [GroupDefinition]
  [GroupDefinition]
  [GroupDefinition]
  [GroupDefinition]
-> Iso
     (Maybe [GroupDefinition])
     (Maybe [GroupDefinition])
     (Maybe [GroupDefinition])
     (Maybe [GroupDefinition])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso
  [GroupDefinition]
  [GroupDefinition]
  [GroupDefinition]
  [GroupDefinition]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The measurement that you want your Savings Plans coverage reported in.
-- The only valid value is @SpendCoveredBySavingsPlans@.
getSavingsPlansCoverage_metrics :: Lens.Lens' GetSavingsPlansCoverage (Prelude.Maybe [Prelude.Text])
getSavingsPlansCoverage_metrics :: (Maybe [Text] -> f (Maybe [Text]))
-> GetSavingsPlansCoverage -> f GetSavingsPlansCoverage
getSavingsPlansCoverage_metrics = (GetSavingsPlansCoverage -> Maybe [Text])
-> (GetSavingsPlansCoverage
    -> Maybe [Text] -> GetSavingsPlansCoverage)
-> Lens
     GetSavingsPlansCoverage
     GetSavingsPlansCoverage
     (Maybe [Text])
     (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetSavingsPlansCoverage' {Maybe [Text]
metrics :: Maybe [Text]
$sel:metrics:GetSavingsPlansCoverage' :: GetSavingsPlansCoverage -> Maybe [Text]
metrics} -> Maybe [Text]
metrics) (\s :: GetSavingsPlansCoverage
s@GetSavingsPlansCoverage' {} Maybe [Text]
a -> GetSavingsPlansCoverage
s {$sel:metrics:GetSavingsPlansCoverage' :: Maybe [Text]
metrics = Maybe [Text]
a} :: GetSavingsPlansCoverage) ((Maybe [Text] -> f (Maybe [Text]))
 -> GetSavingsPlansCoverage -> f GetSavingsPlansCoverage)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> GetSavingsPlansCoverage
-> f GetSavingsPlansCoverage
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [Text]) (Maybe [Text]) (Maybe [Text])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso [Text] [Text] [Text] [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The granularity of the Amazon Web Services cost data for your Savings
-- Plans. @Granularity@ can\'t be set if @GroupBy@ is set.
--
-- The @GetSavingsPlansCoverage@ operation supports only @DAILY@ and
-- @MONTHLY@ granularities.
getSavingsPlansCoverage_granularity :: Lens.Lens' GetSavingsPlansCoverage (Prelude.Maybe Granularity)
getSavingsPlansCoverage_granularity :: (Maybe Granularity -> f (Maybe Granularity))
-> GetSavingsPlansCoverage -> f GetSavingsPlansCoverage
getSavingsPlansCoverage_granularity = (GetSavingsPlansCoverage -> Maybe Granularity)
-> (GetSavingsPlansCoverage
    -> Maybe Granularity -> GetSavingsPlansCoverage)
-> Lens
     GetSavingsPlansCoverage
     GetSavingsPlansCoverage
     (Maybe Granularity)
     (Maybe Granularity)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetSavingsPlansCoverage' {Maybe Granularity
granularity :: Maybe Granularity
$sel:granularity:GetSavingsPlansCoverage' :: GetSavingsPlansCoverage -> Maybe Granularity
granularity} -> Maybe Granularity
granularity) (\s :: GetSavingsPlansCoverage
s@GetSavingsPlansCoverage' {} Maybe Granularity
a -> GetSavingsPlansCoverage
s {$sel:granularity:GetSavingsPlansCoverage' :: Maybe Granularity
granularity = Maybe Granularity
a} :: GetSavingsPlansCoverage)

-- | 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.
getSavingsPlansCoverage_nextToken :: Lens.Lens' GetSavingsPlansCoverage (Prelude.Maybe Prelude.Text)
getSavingsPlansCoverage_nextToken :: (Maybe Text -> f (Maybe Text))
-> GetSavingsPlansCoverage -> f GetSavingsPlansCoverage
getSavingsPlansCoverage_nextToken = (GetSavingsPlansCoverage -> Maybe Text)
-> (GetSavingsPlansCoverage
    -> Maybe Text -> GetSavingsPlansCoverage)
-> Lens
     GetSavingsPlansCoverage
     GetSavingsPlansCoverage
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetSavingsPlansCoverage' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:GetSavingsPlansCoverage' :: GetSavingsPlansCoverage -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: GetSavingsPlansCoverage
s@GetSavingsPlansCoverage' {} Maybe Text
a -> GetSavingsPlansCoverage
s {$sel:nextToken:GetSavingsPlansCoverage' :: Maybe Text
nextToken = Maybe Text
a} :: GetSavingsPlansCoverage)

-- | Filters Savings Plans coverage data by dimensions. You can filter data
-- for Savings Plans usage with the following dimensions:
--
-- -   @LINKED_ACCOUNT@
--
-- -   @REGION@
--
-- -   @SERVICE@
--
-- -   @INSTANCE_FAMILY@
--
-- @GetSavingsPlansCoverage@ 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. If there are multiple values for a dimension, they are OR\'d
-- together.
--
-- Cost category is also supported.
getSavingsPlansCoverage_filter :: Lens.Lens' GetSavingsPlansCoverage (Prelude.Maybe Expression)
getSavingsPlansCoverage_filter :: (Maybe Expression -> f (Maybe Expression))
-> GetSavingsPlansCoverage -> f GetSavingsPlansCoverage
getSavingsPlansCoverage_filter = (GetSavingsPlansCoverage -> Maybe Expression)
-> (GetSavingsPlansCoverage
    -> Maybe Expression -> GetSavingsPlansCoverage)
-> Lens
     GetSavingsPlansCoverage
     GetSavingsPlansCoverage
     (Maybe Expression)
     (Maybe Expression)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetSavingsPlansCoverage' {Maybe Expression
filter' :: Maybe Expression
$sel:filter':GetSavingsPlansCoverage' :: GetSavingsPlansCoverage -> Maybe Expression
filter'} -> Maybe Expression
filter') (\s :: GetSavingsPlansCoverage
s@GetSavingsPlansCoverage' {} Maybe Expression
a -> GetSavingsPlansCoverage
s {$sel:filter':GetSavingsPlansCoverage' :: Maybe Expression
filter' = Maybe Expression
a} :: GetSavingsPlansCoverage)

-- | The number of items to be returned in a response. The default is @20@,
-- with a minimum value of @1@.
getSavingsPlansCoverage_maxResults :: Lens.Lens' GetSavingsPlansCoverage (Prelude.Maybe Prelude.Natural)
getSavingsPlansCoverage_maxResults :: (Maybe Natural -> f (Maybe Natural))
-> GetSavingsPlansCoverage -> f GetSavingsPlansCoverage
getSavingsPlansCoverage_maxResults = (GetSavingsPlansCoverage -> Maybe Natural)
-> (GetSavingsPlansCoverage
    -> Maybe Natural -> GetSavingsPlansCoverage)
-> Lens
     GetSavingsPlansCoverage
     GetSavingsPlansCoverage
     (Maybe Natural)
     (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetSavingsPlansCoverage' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:GetSavingsPlansCoverage' :: GetSavingsPlansCoverage -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: GetSavingsPlansCoverage
s@GetSavingsPlansCoverage' {} Maybe Natural
a -> GetSavingsPlansCoverage
s {$sel:maxResults:GetSavingsPlansCoverage' :: Maybe Natural
maxResults = Maybe Natural
a} :: GetSavingsPlansCoverage)

-- | The value by which you want to sort the data.
--
-- The following values are supported for @Key@:
--
-- -   @SpendCoveredBySavingsPlan@
--
-- -   @OnDemandCost@
--
-- -   @CoveragePercentage@
--
-- -   @TotalCost@
--
-- -   @InstanceFamily@
--
-- -   @Region@
--
-- -   @Service@
--
-- Supported values for @SortOrder@ are @ASCENDING@ or @DESCENDING@.
getSavingsPlansCoverage_sortBy :: Lens.Lens' GetSavingsPlansCoverage (Prelude.Maybe SortDefinition)
getSavingsPlansCoverage_sortBy :: (Maybe SortDefinition -> f (Maybe SortDefinition))
-> GetSavingsPlansCoverage -> f GetSavingsPlansCoverage
getSavingsPlansCoverage_sortBy = (GetSavingsPlansCoverage -> Maybe SortDefinition)
-> (GetSavingsPlansCoverage
    -> Maybe SortDefinition -> GetSavingsPlansCoverage)
-> Lens
     GetSavingsPlansCoverage
     GetSavingsPlansCoverage
     (Maybe SortDefinition)
     (Maybe SortDefinition)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetSavingsPlansCoverage' {Maybe SortDefinition
sortBy :: Maybe SortDefinition
$sel:sortBy:GetSavingsPlansCoverage' :: GetSavingsPlansCoverage -> Maybe SortDefinition
sortBy} -> Maybe SortDefinition
sortBy) (\s :: GetSavingsPlansCoverage
s@GetSavingsPlansCoverage' {} Maybe SortDefinition
a -> GetSavingsPlansCoverage
s {$sel:sortBy:GetSavingsPlansCoverage' :: Maybe SortDefinition
sortBy = Maybe SortDefinition
a} :: GetSavingsPlansCoverage)

-- | 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.
getSavingsPlansCoverage_timePeriod :: Lens.Lens' GetSavingsPlansCoverage DateInterval
getSavingsPlansCoverage_timePeriod :: (DateInterval -> f DateInterval)
-> GetSavingsPlansCoverage -> f GetSavingsPlansCoverage
getSavingsPlansCoverage_timePeriod = (GetSavingsPlansCoverage -> DateInterval)
-> (GetSavingsPlansCoverage
    -> DateInterval -> GetSavingsPlansCoverage)
-> Lens
     GetSavingsPlansCoverage
     GetSavingsPlansCoverage
     DateInterval
     DateInterval
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetSavingsPlansCoverage' {DateInterval
timePeriod :: DateInterval
$sel:timePeriod:GetSavingsPlansCoverage' :: GetSavingsPlansCoverage -> DateInterval
timePeriod} -> DateInterval
timePeriod) (\s :: GetSavingsPlansCoverage
s@GetSavingsPlansCoverage' {} DateInterval
a -> GetSavingsPlansCoverage
s {$sel:timePeriod:GetSavingsPlansCoverage' :: DateInterval
timePeriod = DateInterval
a} :: GetSavingsPlansCoverage)

instance Core.AWSRequest GetSavingsPlansCoverage where
  type
    AWSResponse GetSavingsPlansCoverage =
      GetSavingsPlansCoverageResponse
  request :: GetSavingsPlansCoverage -> Request GetSavingsPlansCoverage
request = Service
-> GetSavingsPlansCoverage -> Request GetSavingsPlansCoverage
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy GetSavingsPlansCoverage
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse GetSavingsPlansCoverage)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse GetSavingsPlansCoverage))
-> Logger
-> Service
-> Proxy GetSavingsPlansCoverage
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse GetSavingsPlansCoverage)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe Text
-> Int -> [SavingsPlansCoverage] -> GetSavingsPlansCoverageResponse
GetSavingsPlansCoverageResponse'
            (Maybe Text
 -> Int
 -> [SavingsPlansCoverage]
 -> GetSavingsPlansCoverageResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Int -> [SavingsPlansCoverage] -> GetSavingsPlansCoverageResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"NextToken")
            Either
  String
  (Int -> [SavingsPlansCoverage] -> GetSavingsPlansCoverageResponse)
-> Either String Int
-> Either
     String ([SavingsPlansCoverage] -> GetSavingsPlansCoverageResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Int -> Either String Int
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (Int -> Int
forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
            Either
  String ([SavingsPlansCoverage] -> GetSavingsPlansCoverageResponse)
-> Either String [SavingsPlansCoverage]
-> Either String GetSavingsPlansCoverageResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object -> Text -> Either String (Maybe [SavingsPlansCoverage])
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"SavingsPlansCoverages"
                            Either String (Maybe [SavingsPlansCoverage])
-> [SavingsPlansCoverage] -> Either String [SavingsPlansCoverage]
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ [SavingsPlansCoverage]
forall a. Monoid a => a
Prelude.mempty
                        )
      )

instance Prelude.Hashable GetSavingsPlansCoverage

instance Prelude.NFData GetSavingsPlansCoverage

instance Core.ToHeaders GetSavingsPlansCoverage where
  toHeaders :: GetSavingsPlansCoverage -> ResponseHeaders
toHeaders =
    ResponseHeaders -> GetSavingsPlansCoverage -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
      ( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"X-Amz-Target"
              HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"AWSInsightsIndexService.GetSavingsPlansCoverage" ::
                          Prelude.ByteString
                      ),
            HeaderName
"Content-Type"
              HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"application/x-amz-json-1.1" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Core.ToJSON GetSavingsPlansCoverage where
  toJSON :: GetSavingsPlansCoverage -> Value
toJSON GetSavingsPlansCoverage' {Maybe Natural
Maybe [Text]
Maybe [GroupDefinition]
Maybe Text
Maybe Granularity
Maybe SortDefinition
Maybe Expression
DateInterval
timePeriod :: DateInterval
sortBy :: Maybe SortDefinition
maxResults :: Maybe Natural
filter' :: Maybe Expression
nextToken :: Maybe Text
granularity :: Maybe Granularity
metrics :: Maybe [Text]
groupBy :: Maybe [GroupDefinition]
$sel:timePeriod:GetSavingsPlansCoverage' :: GetSavingsPlansCoverage -> DateInterval
$sel:sortBy:GetSavingsPlansCoverage' :: GetSavingsPlansCoverage -> Maybe SortDefinition
$sel:maxResults:GetSavingsPlansCoverage' :: GetSavingsPlansCoverage -> Maybe Natural
$sel:filter':GetSavingsPlansCoverage' :: GetSavingsPlansCoverage -> Maybe Expression
$sel:nextToken:GetSavingsPlansCoverage' :: GetSavingsPlansCoverage -> Maybe Text
$sel:granularity:GetSavingsPlansCoverage' :: GetSavingsPlansCoverage -> Maybe Granularity
$sel:metrics:GetSavingsPlansCoverage' :: GetSavingsPlansCoverage -> Maybe [Text]
$sel:groupBy:GetSavingsPlansCoverage' :: GetSavingsPlansCoverage -> Maybe [GroupDefinition]
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"GroupBy" Text -> [GroupDefinition] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) ([GroupDefinition] -> Pair)
-> Maybe [GroupDefinition] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [GroupDefinition]
groupBy,
            (Text
"Metrics" Text -> [Text] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) ([Text] -> Pair) -> Maybe [Text] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Text]
metrics,
            (Text
"Granularity" Text -> Granularity -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Granularity -> Pair) -> Maybe Granularity -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Granularity
granularity,
            (Text
"NextToken" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
nextToken,
            (Text
"Filter" Text -> Expression -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Expression -> Pair) -> Maybe Expression -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Expression
filter',
            (Text
"MaxResults" Text -> Natural -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Natural -> Pair) -> Maybe Natural -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
maxResults,
            (Text
"SortBy" Text -> SortDefinition -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (SortDefinition -> Pair) -> Maybe SortDefinition -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe SortDefinition
sortBy,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"TimePeriod" Text -> DateInterval -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= DateInterval
timePeriod)
          ]
      )

instance Core.ToPath GetSavingsPlansCoverage where
  toPath :: GetSavingsPlansCoverage -> ByteString
toPath = ByteString -> GetSavingsPlansCoverage -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"

instance Core.ToQuery GetSavingsPlansCoverage where
  toQuery :: GetSavingsPlansCoverage -> QueryString
toQuery = QueryString -> GetSavingsPlansCoverage -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty

-- | /See:/ 'newGetSavingsPlansCoverageResponse' smart constructor.
data GetSavingsPlansCoverageResponse = GetSavingsPlansCoverageResponse'
  { -- | 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.
    GetSavingsPlansCoverageResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    GetSavingsPlansCoverageResponse -> Int
httpStatus :: Prelude.Int,
    -- | The amount of spend that your Savings Plans covered.
    GetSavingsPlansCoverageResponse -> [SavingsPlansCoverage]
savingsPlansCoverages :: [SavingsPlansCoverage]
  }
  deriving (GetSavingsPlansCoverageResponse
-> GetSavingsPlansCoverageResponse -> Bool
(GetSavingsPlansCoverageResponse
 -> GetSavingsPlansCoverageResponse -> Bool)
-> (GetSavingsPlansCoverageResponse
    -> GetSavingsPlansCoverageResponse -> Bool)
-> Eq GetSavingsPlansCoverageResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetSavingsPlansCoverageResponse
-> GetSavingsPlansCoverageResponse -> Bool
$c/= :: GetSavingsPlansCoverageResponse
-> GetSavingsPlansCoverageResponse -> Bool
== :: GetSavingsPlansCoverageResponse
-> GetSavingsPlansCoverageResponse -> Bool
$c== :: GetSavingsPlansCoverageResponse
-> GetSavingsPlansCoverageResponse -> Bool
Prelude.Eq, ReadPrec [GetSavingsPlansCoverageResponse]
ReadPrec GetSavingsPlansCoverageResponse
Int -> ReadS GetSavingsPlansCoverageResponse
ReadS [GetSavingsPlansCoverageResponse]
(Int -> ReadS GetSavingsPlansCoverageResponse)
-> ReadS [GetSavingsPlansCoverageResponse]
-> ReadPrec GetSavingsPlansCoverageResponse
-> ReadPrec [GetSavingsPlansCoverageResponse]
-> Read GetSavingsPlansCoverageResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetSavingsPlansCoverageResponse]
$creadListPrec :: ReadPrec [GetSavingsPlansCoverageResponse]
readPrec :: ReadPrec GetSavingsPlansCoverageResponse
$creadPrec :: ReadPrec GetSavingsPlansCoverageResponse
readList :: ReadS [GetSavingsPlansCoverageResponse]
$creadList :: ReadS [GetSavingsPlansCoverageResponse]
readsPrec :: Int -> ReadS GetSavingsPlansCoverageResponse
$creadsPrec :: Int -> ReadS GetSavingsPlansCoverageResponse
Prelude.Read, Int -> GetSavingsPlansCoverageResponse -> ShowS
[GetSavingsPlansCoverageResponse] -> ShowS
GetSavingsPlansCoverageResponse -> String
(Int -> GetSavingsPlansCoverageResponse -> ShowS)
-> (GetSavingsPlansCoverageResponse -> String)
-> ([GetSavingsPlansCoverageResponse] -> ShowS)
-> Show GetSavingsPlansCoverageResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetSavingsPlansCoverageResponse] -> ShowS
$cshowList :: [GetSavingsPlansCoverageResponse] -> ShowS
show :: GetSavingsPlansCoverageResponse -> String
$cshow :: GetSavingsPlansCoverageResponse -> String
showsPrec :: Int -> GetSavingsPlansCoverageResponse -> ShowS
$cshowsPrec :: Int -> GetSavingsPlansCoverageResponse -> ShowS
Prelude.Show, (forall x.
 GetSavingsPlansCoverageResponse
 -> Rep GetSavingsPlansCoverageResponse x)
-> (forall x.
    Rep GetSavingsPlansCoverageResponse x
    -> GetSavingsPlansCoverageResponse)
-> Generic GetSavingsPlansCoverageResponse
forall x.
Rep GetSavingsPlansCoverageResponse x
-> GetSavingsPlansCoverageResponse
forall x.
GetSavingsPlansCoverageResponse
-> Rep GetSavingsPlansCoverageResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetSavingsPlansCoverageResponse x
-> GetSavingsPlansCoverageResponse
$cfrom :: forall x.
GetSavingsPlansCoverageResponse
-> Rep GetSavingsPlansCoverageResponse x
Prelude.Generic)

-- |
-- Create a value of 'GetSavingsPlansCoverageResponse' 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', 'getSavingsPlansCoverageResponse_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.
--
-- 'httpStatus', 'getSavingsPlansCoverageResponse_httpStatus' - The response's http status code.
--
-- 'savingsPlansCoverages', 'getSavingsPlansCoverageResponse_savingsPlansCoverages' - The amount of spend that your Savings Plans covered.
newGetSavingsPlansCoverageResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  GetSavingsPlansCoverageResponse
newGetSavingsPlansCoverageResponse :: Int -> GetSavingsPlansCoverageResponse
newGetSavingsPlansCoverageResponse Int
pHttpStatus_ =
  GetSavingsPlansCoverageResponse' :: Maybe Text
-> Int -> [SavingsPlansCoverage] -> GetSavingsPlansCoverageResponse
GetSavingsPlansCoverageResponse'
    { $sel:nextToken:GetSavingsPlansCoverageResponse' :: Maybe Text
nextToken =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:GetSavingsPlansCoverageResponse' :: Int
httpStatus = Int
pHttpStatus_,
      $sel:savingsPlansCoverages:GetSavingsPlansCoverageResponse' :: [SavingsPlansCoverage]
savingsPlansCoverages = [SavingsPlansCoverage]
forall a. Monoid a => a
Prelude.mempty
    }

-- | 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.
getSavingsPlansCoverageResponse_nextToken :: Lens.Lens' GetSavingsPlansCoverageResponse (Prelude.Maybe Prelude.Text)
getSavingsPlansCoverageResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> GetSavingsPlansCoverageResponse
-> f GetSavingsPlansCoverageResponse
getSavingsPlansCoverageResponse_nextToken = (GetSavingsPlansCoverageResponse -> Maybe Text)
-> (GetSavingsPlansCoverageResponse
    -> Maybe Text -> GetSavingsPlansCoverageResponse)
-> Lens
     GetSavingsPlansCoverageResponse
     GetSavingsPlansCoverageResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetSavingsPlansCoverageResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:GetSavingsPlansCoverageResponse' :: GetSavingsPlansCoverageResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: GetSavingsPlansCoverageResponse
s@GetSavingsPlansCoverageResponse' {} Maybe Text
a -> GetSavingsPlansCoverageResponse
s {$sel:nextToken:GetSavingsPlansCoverageResponse' :: Maybe Text
nextToken = Maybe Text
a} :: GetSavingsPlansCoverageResponse)

-- | The response's http status code.
getSavingsPlansCoverageResponse_httpStatus :: Lens.Lens' GetSavingsPlansCoverageResponse Prelude.Int
getSavingsPlansCoverageResponse_httpStatus :: (Int -> f Int)
-> GetSavingsPlansCoverageResponse
-> f GetSavingsPlansCoverageResponse
getSavingsPlansCoverageResponse_httpStatus = (GetSavingsPlansCoverageResponse -> Int)
-> (GetSavingsPlansCoverageResponse
    -> Int -> GetSavingsPlansCoverageResponse)
-> Lens
     GetSavingsPlansCoverageResponse
     GetSavingsPlansCoverageResponse
     Int
     Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetSavingsPlansCoverageResponse' {Int
httpStatus :: Int
$sel:httpStatus:GetSavingsPlansCoverageResponse' :: GetSavingsPlansCoverageResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: GetSavingsPlansCoverageResponse
s@GetSavingsPlansCoverageResponse' {} Int
a -> GetSavingsPlansCoverageResponse
s {$sel:httpStatus:GetSavingsPlansCoverageResponse' :: Int
httpStatus = Int
a} :: GetSavingsPlansCoverageResponse)

-- | The amount of spend that your Savings Plans covered.
getSavingsPlansCoverageResponse_savingsPlansCoverages :: Lens.Lens' GetSavingsPlansCoverageResponse [SavingsPlansCoverage]
getSavingsPlansCoverageResponse_savingsPlansCoverages :: ([SavingsPlansCoverage] -> f [SavingsPlansCoverage])
-> GetSavingsPlansCoverageResponse
-> f GetSavingsPlansCoverageResponse
getSavingsPlansCoverageResponse_savingsPlansCoverages = (GetSavingsPlansCoverageResponse -> [SavingsPlansCoverage])
-> (GetSavingsPlansCoverageResponse
    -> [SavingsPlansCoverage] -> GetSavingsPlansCoverageResponse)
-> Lens
     GetSavingsPlansCoverageResponse
     GetSavingsPlansCoverageResponse
     [SavingsPlansCoverage]
     [SavingsPlansCoverage]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetSavingsPlansCoverageResponse' {[SavingsPlansCoverage]
savingsPlansCoverages :: [SavingsPlansCoverage]
$sel:savingsPlansCoverages:GetSavingsPlansCoverageResponse' :: GetSavingsPlansCoverageResponse -> [SavingsPlansCoverage]
savingsPlansCoverages} -> [SavingsPlansCoverage]
savingsPlansCoverages) (\s :: GetSavingsPlansCoverageResponse
s@GetSavingsPlansCoverageResponse' {} [SavingsPlansCoverage]
a -> GetSavingsPlansCoverageResponse
s {$sel:savingsPlansCoverages:GetSavingsPlansCoverageResponse' :: [SavingsPlansCoverage]
savingsPlansCoverages = [SavingsPlansCoverage]
a} :: GetSavingsPlansCoverageResponse) (([SavingsPlansCoverage] -> f [SavingsPlansCoverage])
 -> GetSavingsPlansCoverageResponse
 -> f GetSavingsPlansCoverageResponse)
-> (([SavingsPlansCoverage] -> f [SavingsPlansCoverage])
    -> [SavingsPlansCoverage] -> f [SavingsPlansCoverage])
-> ([SavingsPlansCoverage] -> f [SavingsPlansCoverage])
-> GetSavingsPlansCoverageResponse
-> f GetSavingsPlansCoverageResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([SavingsPlansCoverage] -> f [SavingsPlansCoverage])
-> [SavingsPlansCoverage] -> f [SavingsPlansCoverage]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance
  Prelude.NFData
    GetSavingsPlansCoverageResponse