{-# 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.SavingsPlans.DescribeSavingsPlansOfferingRates
-- 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)
--
-- Describes the specified Savings Plans offering rates.
module Amazonka.SavingsPlans.DescribeSavingsPlansOfferingRates
  ( -- * Creating a Request
    DescribeSavingsPlansOfferingRates (..),
    newDescribeSavingsPlansOfferingRates,

    -- * Request Lenses
    describeSavingsPlansOfferingRates_savingsPlanOfferingIds,
    describeSavingsPlansOfferingRates_serviceCodes,
    describeSavingsPlansOfferingRates_filters,
    describeSavingsPlansOfferingRates_nextToken,
    describeSavingsPlansOfferingRates_savingsPlanTypes,
    describeSavingsPlansOfferingRates_products,
    describeSavingsPlansOfferingRates_savingsPlanPaymentOptions,
    describeSavingsPlansOfferingRates_usageTypes,
    describeSavingsPlansOfferingRates_operations,
    describeSavingsPlansOfferingRates_maxResults,

    -- * Destructuring the Response
    DescribeSavingsPlansOfferingRatesResponse (..),
    newDescribeSavingsPlansOfferingRatesResponse,

    -- * Response Lenses
    describeSavingsPlansOfferingRatesResponse_searchResults,
    describeSavingsPlansOfferingRatesResponse_nextToken,
    describeSavingsPlansOfferingRatesResponse_httpStatus,
  )
where

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

-- | /See:/ 'newDescribeSavingsPlansOfferingRates' smart constructor.
data DescribeSavingsPlansOfferingRates = DescribeSavingsPlansOfferingRates'
  { -- | The IDs of the offerings.
    DescribeSavingsPlansOfferingRates -> Maybe [Text]
savingsPlanOfferingIds :: Prelude.Maybe [Prelude.Text],
    -- | The services.
    DescribeSavingsPlansOfferingRates
-> Maybe [SavingsPlanRateServiceCode]
serviceCodes :: Prelude.Maybe [SavingsPlanRateServiceCode],
    -- | The filters.
    DescribeSavingsPlansOfferingRates
-> Maybe [SavingsPlanOfferingRateFilterElement]
filters :: Prelude.Maybe [SavingsPlanOfferingRateFilterElement],
    -- | The token for the next page of results.
    DescribeSavingsPlansOfferingRates -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The plan types.
    DescribeSavingsPlansOfferingRates -> Maybe [SavingsPlanType]
savingsPlanTypes :: Prelude.Maybe [SavingsPlanType],
    -- | The AWS products.
    DescribeSavingsPlansOfferingRates -> Maybe [SavingsPlanProductType]
products :: Prelude.Maybe [SavingsPlanProductType],
    -- | The payment options.
    DescribeSavingsPlansOfferingRates
-> Maybe [SavingsPlanPaymentOption]
savingsPlanPaymentOptions :: Prelude.Maybe [SavingsPlanPaymentOption],
    -- | The usage details of the line item in the billing report.
    DescribeSavingsPlansOfferingRates -> Maybe [Text]
usageTypes :: Prelude.Maybe [Prelude.Text],
    -- | The specific AWS operation for the line item in the billing report.
    DescribeSavingsPlansOfferingRates -> Maybe [Text]
operations :: Prelude.Maybe [Prelude.Text],
    -- | The maximum number of results to return with a single call. To retrieve
    -- additional results, make another call with the returned token value.
    DescribeSavingsPlansOfferingRates -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural
  }
  deriving (DescribeSavingsPlansOfferingRates
-> DescribeSavingsPlansOfferingRates -> Bool
(DescribeSavingsPlansOfferingRates
 -> DescribeSavingsPlansOfferingRates -> Bool)
-> (DescribeSavingsPlansOfferingRates
    -> DescribeSavingsPlansOfferingRates -> Bool)
-> Eq DescribeSavingsPlansOfferingRates
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeSavingsPlansOfferingRates
-> DescribeSavingsPlansOfferingRates -> Bool
$c/= :: DescribeSavingsPlansOfferingRates
-> DescribeSavingsPlansOfferingRates -> Bool
== :: DescribeSavingsPlansOfferingRates
-> DescribeSavingsPlansOfferingRates -> Bool
$c== :: DescribeSavingsPlansOfferingRates
-> DescribeSavingsPlansOfferingRates -> Bool
Prelude.Eq, ReadPrec [DescribeSavingsPlansOfferingRates]
ReadPrec DescribeSavingsPlansOfferingRates
Int -> ReadS DescribeSavingsPlansOfferingRates
ReadS [DescribeSavingsPlansOfferingRates]
(Int -> ReadS DescribeSavingsPlansOfferingRates)
-> ReadS [DescribeSavingsPlansOfferingRates]
-> ReadPrec DescribeSavingsPlansOfferingRates
-> ReadPrec [DescribeSavingsPlansOfferingRates]
-> Read DescribeSavingsPlansOfferingRates
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeSavingsPlansOfferingRates]
$creadListPrec :: ReadPrec [DescribeSavingsPlansOfferingRates]
readPrec :: ReadPrec DescribeSavingsPlansOfferingRates
$creadPrec :: ReadPrec DescribeSavingsPlansOfferingRates
readList :: ReadS [DescribeSavingsPlansOfferingRates]
$creadList :: ReadS [DescribeSavingsPlansOfferingRates]
readsPrec :: Int -> ReadS DescribeSavingsPlansOfferingRates
$creadsPrec :: Int -> ReadS DescribeSavingsPlansOfferingRates
Prelude.Read, Int -> DescribeSavingsPlansOfferingRates -> ShowS
[DescribeSavingsPlansOfferingRates] -> ShowS
DescribeSavingsPlansOfferingRates -> String
(Int -> DescribeSavingsPlansOfferingRates -> ShowS)
-> (DescribeSavingsPlansOfferingRates -> String)
-> ([DescribeSavingsPlansOfferingRates] -> ShowS)
-> Show DescribeSavingsPlansOfferingRates
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeSavingsPlansOfferingRates] -> ShowS
$cshowList :: [DescribeSavingsPlansOfferingRates] -> ShowS
show :: DescribeSavingsPlansOfferingRates -> String
$cshow :: DescribeSavingsPlansOfferingRates -> String
showsPrec :: Int -> DescribeSavingsPlansOfferingRates -> ShowS
$cshowsPrec :: Int -> DescribeSavingsPlansOfferingRates -> ShowS
Prelude.Show, (forall x.
 DescribeSavingsPlansOfferingRates
 -> Rep DescribeSavingsPlansOfferingRates x)
-> (forall x.
    Rep DescribeSavingsPlansOfferingRates x
    -> DescribeSavingsPlansOfferingRates)
-> Generic DescribeSavingsPlansOfferingRates
forall x.
Rep DescribeSavingsPlansOfferingRates x
-> DescribeSavingsPlansOfferingRates
forall x.
DescribeSavingsPlansOfferingRates
-> Rep DescribeSavingsPlansOfferingRates x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeSavingsPlansOfferingRates x
-> DescribeSavingsPlansOfferingRates
$cfrom :: forall x.
DescribeSavingsPlansOfferingRates
-> Rep DescribeSavingsPlansOfferingRates x
Prelude.Generic)

-- |
-- Create a value of 'DescribeSavingsPlansOfferingRates' 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:
--
-- 'savingsPlanOfferingIds', 'describeSavingsPlansOfferingRates_savingsPlanOfferingIds' - The IDs of the offerings.
--
-- 'serviceCodes', 'describeSavingsPlansOfferingRates_serviceCodes' - The services.
--
-- 'filters', 'describeSavingsPlansOfferingRates_filters' - The filters.
--
-- 'nextToken', 'describeSavingsPlansOfferingRates_nextToken' - The token for the next page of results.
--
-- 'savingsPlanTypes', 'describeSavingsPlansOfferingRates_savingsPlanTypes' - The plan types.
--
-- 'products', 'describeSavingsPlansOfferingRates_products' - The AWS products.
--
-- 'savingsPlanPaymentOptions', 'describeSavingsPlansOfferingRates_savingsPlanPaymentOptions' - The payment options.
--
-- 'usageTypes', 'describeSavingsPlansOfferingRates_usageTypes' - The usage details of the line item in the billing report.
--
-- 'operations', 'describeSavingsPlansOfferingRates_operations' - The specific AWS operation for the line item in the billing report.
--
-- 'maxResults', 'describeSavingsPlansOfferingRates_maxResults' - The maximum number of results to return with a single call. To retrieve
-- additional results, make another call with the returned token value.
newDescribeSavingsPlansOfferingRates ::
  DescribeSavingsPlansOfferingRates
newDescribeSavingsPlansOfferingRates :: DescribeSavingsPlansOfferingRates
newDescribeSavingsPlansOfferingRates =
  DescribeSavingsPlansOfferingRates' :: Maybe [Text]
-> Maybe [SavingsPlanRateServiceCode]
-> Maybe [SavingsPlanOfferingRateFilterElement]
-> Maybe Text
-> Maybe [SavingsPlanType]
-> Maybe [SavingsPlanProductType]
-> Maybe [SavingsPlanPaymentOption]
-> Maybe [Text]
-> Maybe [Text]
-> Maybe Natural
-> DescribeSavingsPlansOfferingRates
DescribeSavingsPlansOfferingRates'
    { $sel:savingsPlanOfferingIds:DescribeSavingsPlansOfferingRates' :: Maybe [Text]
savingsPlanOfferingIds =
        Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
      $sel:serviceCodes:DescribeSavingsPlansOfferingRates' :: Maybe [SavingsPlanRateServiceCode]
serviceCodes = Maybe [SavingsPlanRateServiceCode]
forall a. Maybe a
Prelude.Nothing,
      $sel:filters:DescribeSavingsPlansOfferingRates' :: Maybe [SavingsPlanOfferingRateFilterElement]
filters = Maybe [SavingsPlanOfferingRateFilterElement]
forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:DescribeSavingsPlansOfferingRates' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:savingsPlanTypes:DescribeSavingsPlansOfferingRates' :: Maybe [SavingsPlanType]
savingsPlanTypes = Maybe [SavingsPlanType]
forall a. Maybe a
Prelude.Nothing,
      $sel:products:DescribeSavingsPlansOfferingRates' :: Maybe [SavingsPlanProductType]
products = Maybe [SavingsPlanProductType]
forall a. Maybe a
Prelude.Nothing,
      $sel:savingsPlanPaymentOptions:DescribeSavingsPlansOfferingRates' :: Maybe [SavingsPlanPaymentOption]
savingsPlanPaymentOptions =
        Maybe [SavingsPlanPaymentOption]
forall a. Maybe a
Prelude.Nothing,
      $sel:usageTypes:DescribeSavingsPlansOfferingRates' :: Maybe [Text]
usageTypes = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
      $sel:operations:DescribeSavingsPlansOfferingRates' :: Maybe [Text]
operations = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:DescribeSavingsPlansOfferingRates' :: Maybe Natural
maxResults = Maybe Natural
forall a. Maybe a
Prelude.Nothing
    }

-- | The IDs of the offerings.
describeSavingsPlansOfferingRates_savingsPlanOfferingIds :: Lens.Lens' DescribeSavingsPlansOfferingRates (Prelude.Maybe [Prelude.Text])
describeSavingsPlansOfferingRates_savingsPlanOfferingIds :: (Maybe [Text] -> f (Maybe [Text]))
-> DescribeSavingsPlansOfferingRates
-> f DescribeSavingsPlansOfferingRates
describeSavingsPlansOfferingRates_savingsPlanOfferingIds = (DescribeSavingsPlansOfferingRates -> Maybe [Text])
-> (DescribeSavingsPlansOfferingRates
    -> Maybe [Text] -> DescribeSavingsPlansOfferingRates)
-> Lens
     DescribeSavingsPlansOfferingRates
     DescribeSavingsPlansOfferingRates
     (Maybe [Text])
     (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeSavingsPlansOfferingRates' {Maybe [Text]
savingsPlanOfferingIds :: Maybe [Text]
$sel:savingsPlanOfferingIds:DescribeSavingsPlansOfferingRates' :: DescribeSavingsPlansOfferingRates -> Maybe [Text]
savingsPlanOfferingIds} -> Maybe [Text]
savingsPlanOfferingIds) (\s :: DescribeSavingsPlansOfferingRates
s@DescribeSavingsPlansOfferingRates' {} Maybe [Text]
a -> DescribeSavingsPlansOfferingRates
s {$sel:savingsPlanOfferingIds:DescribeSavingsPlansOfferingRates' :: Maybe [Text]
savingsPlanOfferingIds = Maybe [Text]
a} :: DescribeSavingsPlansOfferingRates) ((Maybe [Text] -> f (Maybe [Text]))
 -> DescribeSavingsPlansOfferingRates
 -> f DescribeSavingsPlansOfferingRates)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> DescribeSavingsPlansOfferingRates
-> f DescribeSavingsPlansOfferingRates
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 services.
describeSavingsPlansOfferingRates_serviceCodes :: Lens.Lens' DescribeSavingsPlansOfferingRates (Prelude.Maybe [SavingsPlanRateServiceCode])
describeSavingsPlansOfferingRates_serviceCodes :: (Maybe [SavingsPlanRateServiceCode]
 -> f (Maybe [SavingsPlanRateServiceCode]))
-> DescribeSavingsPlansOfferingRates
-> f DescribeSavingsPlansOfferingRates
describeSavingsPlansOfferingRates_serviceCodes = (DescribeSavingsPlansOfferingRates
 -> Maybe [SavingsPlanRateServiceCode])
-> (DescribeSavingsPlansOfferingRates
    -> Maybe [SavingsPlanRateServiceCode]
    -> DescribeSavingsPlansOfferingRates)
-> Lens
     DescribeSavingsPlansOfferingRates
     DescribeSavingsPlansOfferingRates
     (Maybe [SavingsPlanRateServiceCode])
     (Maybe [SavingsPlanRateServiceCode])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeSavingsPlansOfferingRates' {Maybe [SavingsPlanRateServiceCode]
serviceCodes :: Maybe [SavingsPlanRateServiceCode]
$sel:serviceCodes:DescribeSavingsPlansOfferingRates' :: DescribeSavingsPlansOfferingRates
-> Maybe [SavingsPlanRateServiceCode]
serviceCodes} -> Maybe [SavingsPlanRateServiceCode]
serviceCodes) (\s :: DescribeSavingsPlansOfferingRates
s@DescribeSavingsPlansOfferingRates' {} Maybe [SavingsPlanRateServiceCode]
a -> DescribeSavingsPlansOfferingRates
s {$sel:serviceCodes:DescribeSavingsPlansOfferingRates' :: Maybe [SavingsPlanRateServiceCode]
serviceCodes = Maybe [SavingsPlanRateServiceCode]
a} :: DescribeSavingsPlansOfferingRates) ((Maybe [SavingsPlanRateServiceCode]
  -> f (Maybe [SavingsPlanRateServiceCode]))
 -> DescribeSavingsPlansOfferingRates
 -> f DescribeSavingsPlansOfferingRates)
-> ((Maybe [SavingsPlanRateServiceCode]
     -> f (Maybe [SavingsPlanRateServiceCode]))
    -> Maybe [SavingsPlanRateServiceCode]
    -> f (Maybe [SavingsPlanRateServiceCode]))
-> (Maybe [SavingsPlanRateServiceCode]
    -> f (Maybe [SavingsPlanRateServiceCode]))
-> DescribeSavingsPlansOfferingRates
-> f DescribeSavingsPlansOfferingRates
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [SavingsPlanRateServiceCode]
  [SavingsPlanRateServiceCode]
  [SavingsPlanRateServiceCode]
  [SavingsPlanRateServiceCode]
-> Iso
     (Maybe [SavingsPlanRateServiceCode])
     (Maybe [SavingsPlanRateServiceCode])
     (Maybe [SavingsPlanRateServiceCode])
     (Maybe [SavingsPlanRateServiceCode])
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
  [SavingsPlanRateServiceCode]
  [SavingsPlanRateServiceCode]
  [SavingsPlanRateServiceCode]
  [SavingsPlanRateServiceCode]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The filters.
describeSavingsPlansOfferingRates_filters :: Lens.Lens' DescribeSavingsPlansOfferingRates (Prelude.Maybe [SavingsPlanOfferingRateFilterElement])
describeSavingsPlansOfferingRates_filters :: (Maybe [SavingsPlanOfferingRateFilterElement]
 -> f (Maybe [SavingsPlanOfferingRateFilterElement]))
-> DescribeSavingsPlansOfferingRates
-> f DescribeSavingsPlansOfferingRates
describeSavingsPlansOfferingRates_filters = (DescribeSavingsPlansOfferingRates
 -> Maybe [SavingsPlanOfferingRateFilterElement])
-> (DescribeSavingsPlansOfferingRates
    -> Maybe [SavingsPlanOfferingRateFilterElement]
    -> DescribeSavingsPlansOfferingRates)
-> Lens
     DescribeSavingsPlansOfferingRates
     DescribeSavingsPlansOfferingRates
     (Maybe [SavingsPlanOfferingRateFilterElement])
     (Maybe [SavingsPlanOfferingRateFilterElement])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeSavingsPlansOfferingRates' {Maybe [SavingsPlanOfferingRateFilterElement]
filters :: Maybe [SavingsPlanOfferingRateFilterElement]
$sel:filters:DescribeSavingsPlansOfferingRates' :: DescribeSavingsPlansOfferingRates
-> Maybe [SavingsPlanOfferingRateFilterElement]
filters} -> Maybe [SavingsPlanOfferingRateFilterElement]
filters) (\s :: DescribeSavingsPlansOfferingRates
s@DescribeSavingsPlansOfferingRates' {} Maybe [SavingsPlanOfferingRateFilterElement]
a -> DescribeSavingsPlansOfferingRates
s {$sel:filters:DescribeSavingsPlansOfferingRates' :: Maybe [SavingsPlanOfferingRateFilterElement]
filters = Maybe [SavingsPlanOfferingRateFilterElement]
a} :: DescribeSavingsPlansOfferingRates) ((Maybe [SavingsPlanOfferingRateFilterElement]
  -> f (Maybe [SavingsPlanOfferingRateFilterElement]))
 -> DescribeSavingsPlansOfferingRates
 -> f DescribeSavingsPlansOfferingRates)
-> ((Maybe [SavingsPlanOfferingRateFilterElement]
     -> f (Maybe [SavingsPlanOfferingRateFilterElement]))
    -> Maybe [SavingsPlanOfferingRateFilterElement]
    -> f (Maybe [SavingsPlanOfferingRateFilterElement]))
-> (Maybe [SavingsPlanOfferingRateFilterElement]
    -> f (Maybe [SavingsPlanOfferingRateFilterElement]))
-> DescribeSavingsPlansOfferingRates
-> f DescribeSavingsPlansOfferingRates
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [SavingsPlanOfferingRateFilterElement]
  [SavingsPlanOfferingRateFilterElement]
  [SavingsPlanOfferingRateFilterElement]
  [SavingsPlanOfferingRateFilterElement]
-> Iso
     (Maybe [SavingsPlanOfferingRateFilterElement])
     (Maybe [SavingsPlanOfferingRateFilterElement])
     (Maybe [SavingsPlanOfferingRateFilterElement])
     (Maybe [SavingsPlanOfferingRateFilterElement])
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
  [SavingsPlanOfferingRateFilterElement]
  [SavingsPlanOfferingRateFilterElement]
  [SavingsPlanOfferingRateFilterElement]
  [SavingsPlanOfferingRateFilterElement]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The token for the next page of results.
describeSavingsPlansOfferingRates_nextToken :: Lens.Lens' DescribeSavingsPlansOfferingRates (Prelude.Maybe Prelude.Text)
describeSavingsPlansOfferingRates_nextToken :: (Maybe Text -> f (Maybe Text))
-> DescribeSavingsPlansOfferingRates
-> f DescribeSavingsPlansOfferingRates
describeSavingsPlansOfferingRates_nextToken = (DescribeSavingsPlansOfferingRates -> Maybe Text)
-> (DescribeSavingsPlansOfferingRates
    -> Maybe Text -> DescribeSavingsPlansOfferingRates)
-> Lens
     DescribeSavingsPlansOfferingRates
     DescribeSavingsPlansOfferingRates
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeSavingsPlansOfferingRates' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:DescribeSavingsPlansOfferingRates' :: DescribeSavingsPlansOfferingRates -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: DescribeSavingsPlansOfferingRates
s@DescribeSavingsPlansOfferingRates' {} Maybe Text
a -> DescribeSavingsPlansOfferingRates
s {$sel:nextToken:DescribeSavingsPlansOfferingRates' :: Maybe Text
nextToken = Maybe Text
a} :: DescribeSavingsPlansOfferingRates)

-- | The plan types.
describeSavingsPlansOfferingRates_savingsPlanTypes :: Lens.Lens' DescribeSavingsPlansOfferingRates (Prelude.Maybe [SavingsPlanType])
describeSavingsPlansOfferingRates_savingsPlanTypes :: (Maybe [SavingsPlanType] -> f (Maybe [SavingsPlanType]))
-> DescribeSavingsPlansOfferingRates
-> f DescribeSavingsPlansOfferingRates
describeSavingsPlansOfferingRates_savingsPlanTypes = (DescribeSavingsPlansOfferingRates -> Maybe [SavingsPlanType])
-> (DescribeSavingsPlansOfferingRates
    -> Maybe [SavingsPlanType] -> DescribeSavingsPlansOfferingRates)
-> Lens
     DescribeSavingsPlansOfferingRates
     DescribeSavingsPlansOfferingRates
     (Maybe [SavingsPlanType])
     (Maybe [SavingsPlanType])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeSavingsPlansOfferingRates' {Maybe [SavingsPlanType]
savingsPlanTypes :: Maybe [SavingsPlanType]
$sel:savingsPlanTypes:DescribeSavingsPlansOfferingRates' :: DescribeSavingsPlansOfferingRates -> Maybe [SavingsPlanType]
savingsPlanTypes} -> Maybe [SavingsPlanType]
savingsPlanTypes) (\s :: DescribeSavingsPlansOfferingRates
s@DescribeSavingsPlansOfferingRates' {} Maybe [SavingsPlanType]
a -> DescribeSavingsPlansOfferingRates
s {$sel:savingsPlanTypes:DescribeSavingsPlansOfferingRates' :: Maybe [SavingsPlanType]
savingsPlanTypes = Maybe [SavingsPlanType]
a} :: DescribeSavingsPlansOfferingRates) ((Maybe [SavingsPlanType] -> f (Maybe [SavingsPlanType]))
 -> DescribeSavingsPlansOfferingRates
 -> f DescribeSavingsPlansOfferingRates)
-> ((Maybe [SavingsPlanType] -> f (Maybe [SavingsPlanType]))
    -> Maybe [SavingsPlanType] -> f (Maybe [SavingsPlanType]))
-> (Maybe [SavingsPlanType] -> f (Maybe [SavingsPlanType]))
-> DescribeSavingsPlansOfferingRates
-> f DescribeSavingsPlansOfferingRates
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [SavingsPlanType]
  [SavingsPlanType]
  [SavingsPlanType]
  [SavingsPlanType]
-> Iso
     (Maybe [SavingsPlanType])
     (Maybe [SavingsPlanType])
     (Maybe [SavingsPlanType])
     (Maybe [SavingsPlanType])
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
  [SavingsPlanType]
  [SavingsPlanType]
  [SavingsPlanType]
  [SavingsPlanType]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The AWS products.
describeSavingsPlansOfferingRates_products :: Lens.Lens' DescribeSavingsPlansOfferingRates (Prelude.Maybe [SavingsPlanProductType])
describeSavingsPlansOfferingRates_products :: (Maybe [SavingsPlanProductType]
 -> f (Maybe [SavingsPlanProductType]))
-> DescribeSavingsPlansOfferingRates
-> f DescribeSavingsPlansOfferingRates
describeSavingsPlansOfferingRates_products = (DescribeSavingsPlansOfferingRates
 -> Maybe [SavingsPlanProductType])
-> (DescribeSavingsPlansOfferingRates
    -> Maybe [SavingsPlanProductType]
    -> DescribeSavingsPlansOfferingRates)
-> Lens
     DescribeSavingsPlansOfferingRates
     DescribeSavingsPlansOfferingRates
     (Maybe [SavingsPlanProductType])
     (Maybe [SavingsPlanProductType])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeSavingsPlansOfferingRates' {Maybe [SavingsPlanProductType]
products :: Maybe [SavingsPlanProductType]
$sel:products:DescribeSavingsPlansOfferingRates' :: DescribeSavingsPlansOfferingRates -> Maybe [SavingsPlanProductType]
products} -> Maybe [SavingsPlanProductType]
products) (\s :: DescribeSavingsPlansOfferingRates
s@DescribeSavingsPlansOfferingRates' {} Maybe [SavingsPlanProductType]
a -> DescribeSavingsPlansOfferingRates
s {$sel:products:DescribeSavingsPlansOfferingRates' :: Maybe [SavingsPlanProductType]
products = Maybe [SavingsPlanProductType]
a} :: DescribeSavingsPlansOfferingRates) ((Maybe [SavingsPlanProductType]
  -> f (Maybe [SavingsPlanProductType]))
 -> DescribeSavingsPlansOfferingRates
 -> f DescribeSavingsPlansOfferingRates)
-> ((Maybe [SavingsPlanProductType]
     -> f (Maybe [SavingsPlanProductType]))
    -> Maybe [SavingsPlanProductType]
    -> f (Maybe [SavingsPlanProductType]))
-> (Maybe [SavingsPlanProductType]
    -> f (Maybe [SavingsPlanProductType]))
-> DescribeSavingsPlansOfferingRates
-> f DescribeSavingsPlansOfferingRates
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [SavingsPlanProductType]
  [SavingsPlanProductType]
  [SavingsPlanProductType]
  [SavingsPlanProductType]
-> Iso
     (Maybe [SavingsPlanProductType])
     (Maybe [SavingsPlanProductType])
     (Maybe [SavingsPlanProductType])
     (Maybe [SavingsPlanProductType])
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
  [SavingsPlanProductType]
  [SavingsPlanProductType]
  [SavingsPlanProductType]
  [SavingsPlanProductType]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The payment options.
describeSavingsPlansOfferingRates_savingsPlanPaymentOptions :: Lens.Lens' DescribeSavingsPlansOfferingRates (Prelude.Maybe [SavingsPlanPaymentOption])
describeSavingsPlansOfferingRates_savingsPlanPaymentOptions :: (Maybe [SavingsPlanPaymentOption]
 -> f (Maybe [SavingsPlanPaymentOption]))
-> DescribeSavingsPlansOfferingRates
-> f DescribeSavingsPlansOfferingRates
describeSavingsPlansOfferingRates_savingsPlanPaymentOptions = (DescribeSavingsPlansOfferingRates
 -> Maybe [SavingsPlanPaymentOption])
-> (DescribeSavingsPlansOfferingRates
    -> Maybe [SavingsPlanPaymentOption]
    -> DescribeSavingsPlansOfferingRates)
-> Lens
     DescribeSavingsPlansOfferingRates
     DescribeSavingsPlansOfferingRates
     (Maybe [SavingsPlanPaymentOption])
     (Maybe [SavingsPlanPaymentOption])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeSavingsPlansOfferingRates' {Maybe [SavingsPlanPaymentOption]
savingsPlanPaymentOptions :: Maybe [SavingsPlanPaymentOption]
$sel:savingsPlanPaymentOptions:DescribeSavingsPlansOfferingRates' :: DescribeSavingsPlansOfferingRates
-> Maybe [SavingsPlanPaymentOption]
savingsPlanPaymentOptions} -> Maybe [SavingsPlanPaymentOption]
savingsPlanPaymentOptions) (\s :: DescribeSavingsPlansOfferingRates
s@DescribeSavingsPlansOfferingRates' {} Maybe [SavingsPlanPaymentOption]
a -> DescribeSavingsPlansOfferingRates
s {$sel:savingsPlanPaymentOptions:DescribeSavingsPlansOfferingRates' :: Maybe [SavingsPlanPaymentOption]
savingsPlanPaymentOptions = Maybe [SavingsPlanPaymentOption]
a} :: DescribeSavingsPlansOfferingRates) ((Maybe [SavingsPlanPaymentOption]
  -> f (Maybe [SavingsPlanPaymentOption]))
 -> DescribeSavingsPlansOfferingRates
 -> f DescribeSavingsPlansOfferingRates)
-> ((Maybe [SavingsPlanPaymentOption]
     -> f (Maybe [SavingsPlanPaymentOption]))
    -> Maybe [SavingsPlanPaymentOption]
    -> f (Maybe [SavingsPlanPaymentOption]))
-> (Maybe [SavingsPlanPaymentOption]
    -> f (Maybe [SavingsPlanPaymentOption]))
-> DescribeSavingsPlansOfferingRates
-> f DescribeSavingsPlansOfferingRates
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [SavingsPlanPaymentOption]
  [SavingsPlanPaymentOption]
  [SavingsPlanPaymentOption]
  [SavingsPlanPaymentOption]
-> Iso
     (Maybe [SavingsPlanPaymentOption])
     (Maybe [SavingsPlanPaymentOption])
     (Maybe [SavingsPlanPaymentOption])
     (Maybe [SavingsPlanPaymentOption])
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
  [SavingsPlanPaymentOption]
  [SavingsPlanPaymentOption]
  [SavingsPlanPaymentOption]
  [SavingsPlanPaymentOption]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The usage details of the line item in the billing report.
describeSavingsPlansOfferingRates_usageTypes :: Lens.Lens' DescribeSavingsPlansOfferingRates (Prelude.Maybe [Prelude.Text])
describeSavingsPlansOfferingRates_usageTypes :: (Maybe [Text] -> f (Maybe [Text]))
-> DescribeSavingsPlansOfferingRates
-> f DescribeSavingsPlansOfferingRates
describeSavingsPlansOfferingRates_usageTypes = (DescribeSavingsPlansOfferingRates -> Maybe [Text])
-> (DescribeSavingsPlansOfferingRates
    -> Maybe [Text] -> DescribeSavingsPlansOfferingRates)
-> Lens
     DescribeSavingsPlansOfferingRates
     DescribeSavingsPlansOfferingRates
     (Maybe [Text])
     (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeSavingsPlansOfferingRates' {Maybe [Text]
usageTypes :: Maybe [Text]
$sel:usageTypes:DescribeSavingsPlansOfferingRates' :: DescribeSavingsPlansOfferingRates -> Maybe [Text]
usageTypes} -> Maybe [Text]
usageTypes) (\s :: DescribeSavingsPlansOfferingRates
s@DescribeSavingsPlansOfferingRates' {} Maybe [Text]
a -> DescribeSavingsPlansOfferingRates
s {$sel:usageTypes:DescribeSavingsPlansOfferingRates' :: Maybe [Text]
usageTypes = Maybe [Text]
a} :: DescribeSavingsPlansOfferingRates) ((Maybe [Text] -> f (Maybe [Text]))
 -> DescribeSavingsPlansOfferingRates
 -> f DescribeSavingsPlansOfferingRates)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> DescribeSavingsPlansOfferingRates
-> f DescribeSavingsPlansOfferingRates
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 specific AWS operation for the line item in the billing report.
describeSavingsPlansOfferingRates_operations :: Lens.Lens' DescribeSavingsPlansOfferingRates (Prelude.Maybe [Prelude.Text])
describeSavingsPlansOfferingRates_operations :: (Maybe [Text] -> f (Maybe [Text]))
-> DescribeSavingsPlansOfferingRates
-> f DescribeSavingsPlansOfferingRates
describeSavingsPlansOfferingRates_operations = (DescribeSavingsPlansOfferingRates -> Maybe [Text])
-> (DescribeSavingsPlansOfferingRates
    -> Maybe [Text] -> DescribeSavingsPlansOfferingRates)
-> Lens
     DescribeSavingsPlansOfferingRates
     DescribeSavingsPlansOfferingRates
     (Maybe [Text])
     (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeSavingsPlansOfferingRates' {Maybe [Text]
operations :: Maybe [Text]
$sel:operations:DescribeSavingsPlansOfferingRates' :: DescribeSavingsPlansOfferingRates -> Maybe [Text]
operations} -> Maybe [Text]
operations) (\s :: DescribeSavingsPlansOfferingRates
s@DescribeSavingsPlansOfferingRates' {} Maybe [Text]
a -> DescribeSavingsPlansOfferingRates
s {$sel:operations:DescribeSavingsPlansOfferingRates' :: Maybe [Text]
operations = Maybe [Text]
a} :: DescribeSavingsPlansOfferingRates) ((Maybe [Text] -> f (Maybe [Text]))
 -> DescribeSavingsPlansOfferingRates
 -> f DescribeSavingsPlansOfferingRates)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> DescribeSavingsPlansOfferingRates
-> f DescribeSavingsPlansOfferingRates
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 maximum number of results to return with a single call. To retrieve
-- additional results, make another call with the returned token value.
describeSavingsPlansOfferingRates_maxResults :: Lens.Lens' DescribeSavingsPlansOfferingRates (Prelude.Maybe Prelude.Natural)
describeSavingsPlansOfferingRates_maxResults :: (Maybe Natural -> f (Maybe Natural))
-> DescribeSavingsPlansOfferingRates
-> f DescribeSavingsPlansOfferingRates
describeSavingsPlansOfferingRates_maxResults = (DescribeSavingsPlansOfferingRates -> Maybe Natural)
-> (DescribeSavingsPlansOfferingRates
    -> Maybe Natural -> DescribeSavingsPlansOfferingRates)
-> Lens
     DescribeSavingsPlansOfferingRates
     DescribeSavingsPlansOfferingRates
     (Maybe Natural)
     (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeSavingsPlansOfferingRates' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:DescribeSavingsPlansOfferingRates' :: DescribeSavingsPlansOfferingRates -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: DescribeSavingsPlansOfferingRates
s@DescribeSavingsPlansOfferingRates' {} Maybe Natural
a -> DescribeSavingsPlansOfferingRates
s {$sel:maxResults:DescribeSavingsPlansOfferingRates' :: Maybe Natural
maxResults = Maybe Natural
a} :: DescribeSavingsPlansOfferingRates)

instance
  Core.AWSRequest
    DescribeSavingsPlansOfferingRates
  where
  type
    AWSResponse DescribeSavingsPlansOfferingRates =
      DescribeSavingsPlansOfferingRatesResponse
  request :: DescribeSavingsPlansOfferingRates
-> Request DescribeSavingsPlansOfferingRates
request = Service
-> DescribeSavingsPlansOfferingRates
-> Request DescribeSavingsPlansOfferingRates
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy DescribeSavingsPlansOfferingRates
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse (AWSResponse DescribeSavingsPlansOfferingRates)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse DescribeSavingsPlansOfferingRates))
-> Logger
-> Service
-> Proxy DescribeSavingsPlansOfferingRates
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse (AWSResponse DescribeSavingsPlansOfferingRates)))
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 [SavingsPlanOfferingRate]
-> Maybe Text -> Int -> DescribeSavingsPlansOfferingRatesResponse
DescribeSavingsPlansOfferingRatesResponse'
            (Maybe [SavingsPlanOfferingRate]
 -> Maybe Text -> Int -> DescribeSavingsPlansOfferingRatesResponse)
-> Either String (Maybe [SavingsPlanOfferingRate])
-> Either
     String
     (Maybe Text -> Int -> DescribeSavingsPlansOfferingRatesResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object
-> Text -> Either String (Maybe (Maybe [SavingsPlanOfferingRate]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"searchResults" Either String (Maybe (Maybe [SavingsPlanOfferingRate]))
-> Maybe [SavingsPlanOfferingRate]
-> Either String (Maybe [SavingsPlanOfferingRate])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [SavingsPlanOfferingRate]
forall a. Monoid a => a
Prelude.mempty)
              Either
  String
  (Maybe Text -> Int -> DescribeSavingsPlansOfferingRatesResponse)
-> Either String (Maybe Text)
-> Either String (Int -> DescribeSavingsPlansOfferingRatesResponse)
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
"nextToken")
              Either String (Int -> DescribeSavingsPlansOfferingRatesResponse)
-> Either String Int
-> Either String DescribeSavingsPlansOfferingRatesResponse
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
    DescribeSavingsPlansOfferingRates

instance
  Prelude.NFData
    DescribeSavingsPlansOfferingRates

instance
  Core.ToHeaders
    DescribeSavingsPlansOfferingRates
  where
  toHeaders :: DescribeSavingsPlansOfferingRates -> ResponseHeaders
toHeaders =
    ResponseHeaders
-> DescribeSavingsPlansOfferingRates -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
      ( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"Content-Type"
              HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"application/x-amz-json-1.0" ::
                          Prelude.ByteString
                      )
          ]
      )

instance
  Core.ToJSON
    DescribeSavingsPlansOfferingRates
  where
  toJSON :: DescribeSavingsPlansOfferingRates -> Value
toJSON DescribeSavingsPlansOfferingRates' {Maybe Natural
Maybe [Text]
Maybe [SavingsPlanPaymentOption]
Maybe [SavingsPlanProductType]
Maybe [SavingsPlanOfferingRateFilterElement]
Maybe [SavingsPlanRateServiceCode]
Maybe [SavingsPlanType]
Maybe Text
maxResults :: Maybe Natural
operations :: Maybe [Text]
usageTypes :: Maybe [Text]
savingsPlanPaymentOptions :: Maybe [SavingsPlanPaymentOption]
products :: Maybe [SavingsPlanProductType]
savingsPlanTypes :: Maybe [SavingsPlanType]
nextToken :: Maybe Text
filters :: Maybe [SavingsPlanOfferingRateFilterElement]
serviceCodes :: Maybe [SavingsPlanRateServiceCode]
savingsPlanOfferingIds :: Maybe [Text]
$sel:maxResults:DescribeSavingsPlansOfferingRates' :: DescribeSavingsPlansOfferingRates -> Maybe Natural
$sel:operations:DescribeSavingsPlansOfferingRates' :: DescribeSavingsPlansOfferingRates -> Maybe [Text]
$sel:usageTypes:DescribeSavingsPlansOfferingRates' :: DescribeSavingsPlansOfferingRates -> Maybe [Text]
$sel:savingsPlanPaymentOptions:DescribeSavingsPlansOfferingRates' :: DescribeSavingsPlansOfferingRates
-> Maybe [SavingsPlanPaymentOption]
$sel:products:DescribeSavingsPlansOfferingRates' :: DescribeSavingsPlansOfferingRates -> Maybe [SavingsPlanProductType]
$sel:savingsPlanTypes:DescribeSavingsPlansOfferingRates' :: DescribeSavingsPlansOfferingRates -> Maybe [SavingsPlanType]
$sel:nextToken:DescribeSavingsPlansOfferingRates' :: DescribeSavingsPlansOfferingRates -> Maybe Text
$sel:filters:DescribeSavingsPlansOfferingRates' :: DescribeSavingsPlansOfferingRates
-> Maybe [SavingsPlanOfferingRateFilterElement]
$sel:serviceCodes:DescribeSavingsPlansOfferingRates' :: DescribeSavingsPlansOfferingRates
-> Maybe [SavingsPlanRateServiceCode]
$sel:savingsPlanOfferingIds:DescribeSavingsPlansOfferingRates' :: DescribeSavingsPlansOfferingRates -> Maybe [Text]
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"savingsPlanOfferingIds" 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]
savingsPlanOfferingIds,
            (Text
"serviceCodes" Text -> [SavingsPlanRateServiceCode] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) ([SavingsPlanRateServiceCode] -> Pair)
-> Maybe [SavingsPlanRateServiceCode] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [SavingsPlanRateServiceCode]
serviceCodes,
            (Text
"filters" Text -> [SavingsPlanOfferingRateFilterElement] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) ([SavingsPlanOfferingRateFilterElement] -> Pair)
-> Maybe [SavingsPlanOfferingRateFilterElement] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [SavingsPlanOfferingRateFilterElement]
filters,
            (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
"savingsPlanTypes" Text -> [SavingsPlanType] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              ([SavingsPlanType] -> Pair)
-> Maybe [SavingsPlanType] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [SavingsPlanType]
savingsPlanTypes,
            (Text
"products" Text -> [SavingsPlanProductType] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) ([SavingsPlanProductType] -> Pair)
-> Maybe [SavingsPlanProductType] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [SavingsPlanProductType]
products,
            (Text
"savingsPlanPaymentOptions" Text -> [SavingsPlanPaymentOption] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              ([SavingsPlanPaymentOption] -> Pair)
-> Maybe [SavingsPlanPaymentOption] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [SavingsPlanPaymentOption]
savingsPlanPaymentOptions,
            (Text
"usageTypes" 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]
usageTypes,
            (Text
"operations" 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]
operations,
            (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
          ]
      )

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

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

-- | /See:/ 'newDescribeSavingsPlansOfferingRatesResponse' smart constructor.
data DescribeSavingsPlansOfferingRatesResponse = DescribeSavingsPlansOfferingRatesResponse'
  { -- | Information about the Savings Plans offering rates.
    DescribeSavingsPlansOfferingRatesResponse
-> Maybe [SavingsPlanOfferingRate]
searchResults :: Prelude.Maybe [SavingsPlanOfferingRate],
    -- | The token to use to retrieve the next page of results. This value is
    -- null when there are no more results to return.
    DescribeSavingsPlansOfferingRatesResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    DescribeSavingsPlansOfferingRatesResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (DescribeSavingsPlansOfferingRatesResponse
-> DescribeSavingsPlansOfferingRatesResponse -> Bool
(DescribeSavingsPlansOfferingRatesResponse
 -> DescribeSavingsPlansOfferingRatesResponse -> Bool)
-> (DescribeSavingsPlansOfferingRatesResponse
    -> DescribeSavingsPlansOfferingRatesResponse -> Bool)
-> Eq DescribeSavingsPlansOfferingRatesResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeSavingsPlansOfferingRatesResponse
-> DescribeSavingsPlansOfferingRatesResponse -> Bool
$c/= :: DescribeSavingsPlansOfferingRatesResponse
-> DescribeSavingsPlansOfferingRatesResponse -> Bool
== :: DescribeSavingsPlansOfferingRatesResponse
-> DescribeSavingsPlansOfferingRatesResponse -> Bool
$c== :: DescribeSavingsPlansOfferingRatesResponse
-> DescribeSavingsPlansOfferingRatesResponse -> Bool
Prelude.Eq, ReadPrec [DescribeSavingsPlansOfferingRatesResponse]
ReadPrec DescribeSavingsPlansOfferingRatesResponse
Int -> ReadS DescribeSavingsPlansOfferingRatesResponse
ReadS [DescribeSavingsPlansOfferingRatesResponse]
(Int -> ReadS DescribeSavingsPlansOfferingRatesResponse)
-> ReadS [DescribeSavingsPlansOfferingRatesResponse]
-> ReadPrec DescribeSavingsPlansOfferingRatesResponse
-> ReadPrec [DescribeSavingsPlansOfferingRatesResponse]
-> Read DescribeSavingsPlansOfferingRatesResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeSavingsPlansOfferingRatesResponse]
$creadListPrec :: ReadPrec [DescribeSavingsPlansOfferingRatesResponse]
readPrec :: ReadPrec DescribeSavingsPlansOfferingRatesResponse
$creadPrec :: ReadPrec DescribeSavingsPlansOfferingRatesResponse
readList :: ReadS [DescribeSavingsPlansOfferingRatesResponse]
$creadList :: ReadS [DescribeSavingsPlansOfferingRatesResponse]
readsPrec :: Int -> ReadS DescribeSavingsPlansOfferingRatesResponse
$creadsPrec :: Int -> ReadS DescribeSavingsPlansOfferingRatesResponse
Prelude.Read, Int -> DescribeSavingsPlansOfferingRatesResponse -> ShowS
[DescribeSavingsPlansOfferingRatesResponse] -> ShowS
DescribeSavingsPlansOfferingRatesResponse -> String
(Int -> DescribeSavingsPlansOfferingRatesResponse -> ShowS)
-> (DescribeSavingsPlansOfferingRatesResponse -> String)
-> ([DescribeSavingsPlansOfferingRatesResponse] -> ShowS)
-> Show DescribeSavingsPlansOfferingRatesResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeSavingsPlansOfferingRatesResponse] -> ShowS
$cshowList :: [DescribeSavingsPlansOfferingRatesResponse] -> ShowS
show :: DescribeSavingsPlansOfferingRatesResponse -> String
$cshow :: DescribeSavingsPlansOfferingRatesResponse -> String
showsPrec :: Int -> DescribeSavingsPlansOfferingRatesResponse -> ShowS
$cshowsPrec :: Int -> DescribeSavingsPlansOfferingRatesResponse -> ShowS
Prelude.Show, (forall x.
 DescribeSavingsPlansOfferingRatesResponse
 -> Rep DescribeSavingsPlansOfferingRatesResponse x)
-> (forall x.
    Rep DescribeSavingsPlansOfferingRatesResponse x
    -> DescribeSavingsPlansOfferingRatesResponse)
-> Generic DescribeSavingsPlansOfferingRatesResponse
forall x.
Rep DescribeSavingsPlansOfferingRatesResponse x
-> DescribeSavingsPlansOfferingRatesResponse
forall x.
DescribeSavingsPlansOfferingRatesResponse
-> Rep DescribeSavingsPlansOfferingRatesResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeSavingsPlansOfferingRatesResponse x
-> DescribeSavingsPlansOfferingRatesResponse
$cfrom :: forall x.
DescribeSavingsPlansOfferingRatesResponse
-> Rep DescribeSavingsPlansOfferingRatesResponse x
Prelude.Generic)

-- |
-- Create a value of 'DescribeSavingsPlansOfferingRatesResponse' 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:
--
-- 'searchResults', 'describeSavingsPlansOfferingRatesResponse_searchResults' - Information about the Savings Plans offering rates.
--
-- 'nextToken', 'describeSavingsPlansOfferingRatesResponse_nextToken' - The token to use to retrieve the next page of results. This value is
-- null when there are no more results to return.
--
-- 'httpStatus', 'describeSavingsPlansOfferingRatesResponse_httpStatus' - The response's http status code.
newDescribeSavingsPlansOfferingRatesResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  DescribeSavingsPlansOfferingRatesResponse
newDescribeSavingsPlansOfferingRatesResponse :: Int -> DescribeSavingsPlansOfferingRatesResponse
newDescribeSavingsPlansOfferingRatesResponse
  Int
pHttpStatus_ =
    DescribeSavingsPlansOfferingRatesResponse' :: Maybe [SavingsPlanOfferingRate]
-> Maybe Text -> Int -> DescribeSavingsPlansOfferingRatesResponse
DescribeSavingsPlansOfferingRatesResponse'
      { $sel:searchResults:DescribeSavingsPlansOfferingRatesResponse' :: Maybe [SavingsPlanOfferingRate]
searchResults =
          Maybe [SavingsPlanOfferingRate]
forall a. Maybe a
Prelude.Nothing,
        $sel:nextToken:DescribeSavingsPlansOfferingRatesResponse' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:httpStatus:DescribeSavingsPlansOfferingRatesResponse' :: Int
httpStatus = Int
pHttpStatus_
      }

-- | Information about the Savings Plans offering rates.
describeSavingsPlansOfferingRatesResponse_searchResults :: Lens.Lens' DescribeSavingsPlansOfferingRatesResponse (Prelude.Maybe [SavingsPlanOfferingRate])
describeSavingsPlansOfferingRatesResponse_searchResults :: (Maybe [SavingsPlanOfferingRate]
 -> f (Maybe [SavingsPlanOfferingRate]))
-> DescribeSavingsPlansOfferingRatesResponse
-> f DescribeSavingsPlansOfferingRatesResponse
describeSavingsPlansOfferingRatesResponse_searchResults = (DescribeSavingsPlansOfferingRatesResponse
 -> Maybe [SavingsPlanOfferingRate])
-> (DescribeSavingsPlansOfferingRatesResponse
    -> Maybe [SavingsPlanOfferingRate]
    -> DescribeSavingsPlansOfferingRatesResponse)
-> Lens
     DescribeSavingsPlansOfferingRatesResponse
     DescribeSavingsPlansOfferingRatesResponse
     (Maybe [SavingsPlanOfferingRate])
     (Maybe [SavingsPlanOfferingRate])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeSavingsPlansOfferingRatesResponse' {Maybe [SavingsPlanOfferingRate]
searchResults :: Maybe [SavingsPlanOfferingRate]
$sel:searchResults:DescribeSavingsPlansOfferingRatesResponse' :: DescribeSavingsPlansOfferingRatesResponse
-> Maybe [SavingsPlanOfferingRate]
searchResults} -> Maybe [SavingsPlanOfferingRate]
searchResults) (\s :: DescribeSavingsPlansOfferingRatesResponse
s@DescribeSavingsPlansOfferingRatesResponse' {} Maybe [SavingsPlanOfferingRate]
a -> DescribeSavingsPlansOfferingRatesResponse
s {$sel:searchResults:DescribeSavingsPlansOfferingRatesResponse' :: Maybe [SavingsPlanOfferingRate]
searchResults = Maybe [SavingsPlanOfferingRate]
a} :: DescribeSavingsPlansOfferingRatesResponse) ((Maybe [SavingsPlanOfferingRate]
  -> f (Maybe [SavingsPlanOfferingRate]))
 -> DescribeSavingsPlansOfferingRatesResponse
 -> f DescribeSavingsPlansOfferingRatesResponse)
-> ((Maybe [SavingsPlanOfferingRate]
     -> f (Maybe [SavingsPlanOfferingRate]))
    -> Maybe [SavingsPlanOfferingRate]
    -> f (Maybe [SavingsPlanOfferingRate]))
-> (Maybe [SavingsPlanOfferingRate]
    -> f (Maybe [SavingsPlanOfferingRate]))
-> DescribeSavingsPlansOfferingRatesResponse
-> f DescribeSavingsPlansOfferingRatesResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [SavingsPlanOfferingRate]
  [SavingsPlanOfferingRate]
  [SavingsPlanOfferingRate]
  [SavingsPlanOfferingRate]
-> Iso
     (Maybe [SavingsPlanOfferingRate])
     (Maybe [SavingsPlanOfferingRate])
     (Maybe [SavingsPlanOfferingRate])
     (Maybe [SavingsPlanOfferingRate])
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
  [SavingsPlanOfferingRate]
  [SavingsPlanOfferingRate]
  [SavingsPlanOfferingRate]
  [SavingsPlanOfferingRate]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The token to use to retrieve the next page of results. This value is
-- null when there are no more results to return.
describeSavingsPlansOfferingRatesResponse_nextToken :: Lens.Lens' DescribeSavingsPlansOfferingRatesResponse (Prelude.Maybe Prelude.Text)
describeSavingsPlansOfferingRatesResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> DescribeSavingsPlansOfferingRatesResponse
-> f DescribeSavingsPlansOfferingRatesResponse
describeSavingsPlansOfferingRatesResponse_nextToken = (DescribeSavingsPlansOfferingRatesResponse -> Maybe Text)
-> (DescribeSavingsPlansOfferingRatesResponse
    -> Maybe Text -> DescribeSavingsPlansOfferingRatesResponse)
-> Lens
     DescribeSavingsPlansOfferingRatesResponse
     DescribeSavingsPlansOfferingRatesResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeSavingsPlansOfferingRatesResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:DescribeSavingsPlansOfferingRatesResponse' :: DescribeSavingsPlansOfferingRatesResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: DescribeSavingsPlansOfferingRatesResponse
s@DescribeSavingsPlansOfferingRatesResponse' {} Maybe Text
a -> DescribeSavingsPlansOfferingRatesResponse
s {$sel:nextToken:DescribeSavingsPlansOfferingRatesResponse' :: Maybe Text
nextToken = Maybe Text
a} :: DescribeSavingsPlansOfferingRatesResponse)

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

instance
  Prelude.NFData
    DescribeSavingsPlansOfferingRatesResponse