{-# 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.DescribeSavingsPlansOfferings
-- 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 offerings.
module Amazonka.SavingsPlans.DescribeSavingsPlansOfferings
  ( -- * Creating a Request
    DescribeSavingsPlansOfferings (..),
    newDescribeSavingsPlansOfferings,

    -- * Request Lenses
    describeSavingsPlansOfferings_serviceCodes,
    describeSavingsPlansOfferings_productType,
    describeSavingsPlansOfferings_filters,
    describeSavingsPlansOfferings_offeringIds,
    describeSavingsPlansOfferings_currencies,
    describeSavingsPlansOfferings_nextToken,
    describeSavingsPlansOfferings_paymentOptions,
    describeSavingsPlansOfferings_descriptions,
    describeSavingsPlansOfferings_durations,
    describeSavingsPlansOfferings_planTypes,
    describeSavingsPlansOfferings_usageTypes,
    describeSavingsPlansOfferings_operations,
    describeSavingsPlansOfferings_maxResults,

    -- * Destructuring the Response
    DescribeSavingsPlansOfferingsResponse (..),
    newDescribeSavingsPlansOfferingsResponse,

    -- * Response Lenses
    describeSavingsPlansOfferingsResponse_searchResults,
    describeSavingsPlansOfferingsResponse_nextToken,
    describeSavingsPlansOfferingsResponse_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:/ 'newDescribeSavingsPlansOfferings' smart constructor.
data DescribeSavingsPlansOfferings = DescribeSavingsPlansOfferings'
  { -- | The services.
    DescribeSavingsPlansOfferings -> Maybe [Text]
serviceCodes :: Prelude.Maybe [Prelude.Text],
    -- | The product type.
    DescribeSavingsPlansOfferings -> Maybe SavingsPlanProductType
productType :: Prelude.Maybe SavingsPlanProductType,
    -- | The filters.
    DescribeSavingsPlansOfferings
-> Maybe [SavingsPlanOfferingFilterElement]
filters :: Prelude.Maybe [SavingsPlanOfferingFilterElement],
    -- | The IDs of the offerings.
    DescribeSavingsPlansOfferings -> Maybe [Text]
offeringIds :: Prelude.Maybe [Prelude.Text],
    -- | The currencies.
    DescribeSavingsPlansOfferings -> Maybe [CurrencyCode]
currencies :: Prelude.Maybe [CurrencyCode],
    -- | The token for the next page of results.
    DescribeSavingsPlansOfferings -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The payment options.
    DescribeSavingsPlansOfferings -> Maybe [SavingsPlanPaymentOption]
paymentOptions :: Prelude.Maybe [SavingsPlanPaymentOption],
    -- | The descriptions.
    DescribeSavingsPlansOfferings -> Maybe [Text]
descriptions :: Prelude.Maybe [Prelude.Text],
    -- | The durations, in seconds.
    DescribeSavingsPlansOfferings -> Maybe [Natural]
durations :: Prelude.Maybe [Prelude.Natural],
    -- | The plan type.
    DescribeSavingsPlansOfferings -> Maybe [SavingsPlanType]
planTypes :: Prelude.Maybe [SavingsPlanType],
    -- | The usage details of the line item in the billing report.
    DescribeSavingsPlansOfferings -> Maybe [Text]
usageTypes :: Prelude.Maybe [Prelude.Text],
    -- | The specific AWS operation for the line item in the billing report.
    DescribeSavingsPlansOfferings -> 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.
    DescribeSavingsPlansOfferings -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural
  }
  deriving (DescribeSavingsPlansOfferings
-> DescribeSavingsPlansOfferings -> Bool
(DescribeSavingsPlansOfferings
 -> DescribeSavingsPlansOfferings -> Bool)
-> (DescribeSavingsPlansOfferings
    -> DescribeSavingsPlansOfferings -> Bool)
-> Eq DescribeSavingsPlansOfferings
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeSavingsPlansOfferings
-> DescribeSavingsPlansOfferings -> Bool
$c/= :: DescribeSavingsPlansOfferings
-> DescribeSavingsPlansOfferings -> Bool
== :: DescribeSavingsPlansOfferings
-> DescribeSavingsPlansOfferings -> Bool
$c== :: DescribeSavingsPlansOfferings
-> DescribeSavingsPlansOfferings -> Bool
Prelude.Eq, ReadPrec [DescribeSavingsPlansOfferings]
ReadPrec DescribeSavingsPlansOfferings
Int -> ReadS DescribeSavingsPlansOfferings
ReadS [DescribeSavingsPlansOfferings]
(Int -> ReadS DescribeSavingsPlansOfferings)
-> ReadS [DescribeSavingsPlansOfferings]
-> ReadPrec DescribeSavingsPlansOfferings
-> ReadPrec [DescribeSavingsPlansOfferings]
-> Read DescribeSavingsPlansOfferings
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeSavingsPlansOfferings]
$creadListPrec :: ReadPrec [DescribeSavingsPlansOfferings]
readPrec :: ReadPrec DescribeSavingsPlansOfferings
$creadPrec :: ReadPrec DescribeSavingsPlansOfferings
readList :: ReadS [DescribeSavingsPlansOfferings]
$creadList :: ReadS [DescribeSavingsPlansOfferings]
readsPrec :: Int -> ReadS DescribeSavingsPlansOfferings
$creadsPrec :: Int -> ReadS DescribeSavingsPlansOfferings
Prelude.Read, Int -> DescribeSavingsPlansOfferings -> ShowS
[DescribeSavingsPlansOfferings] -> ShowS
DescribeSavingsPlansOfferings -> String
(Int -> DescribeSavingsPlansOfferings -> ShowS)
-> (DescribeSavingsPlansOfferings -> String)
-> ([DescribeSavingsPlansOfferings] -> ShowS)
-> Show DescribeSavingsPlansOfferings
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeSavingsPlansOfferings] -> ShowS
$cshowList :: [DescribeSavingsPlansOfferings] -> ShowS
show :: DescribeSavingsPlansOfferings -> String
$cshow :: DescribeSavingsPlansOfferings -> String
showsPrec :: Int -> DescribeSavingsPlansOfferings -> ShowS
$cshowsPrec :: Int -> DescribeSavingsPlansOfferings -> ShowS
Prelude.Show, (forall x.
 DescribeSavingsPlansOfferings
 -> Rep DescribeSavingsPlansOfferings x)
-> (forall x.
    Rep DescribeSavingsPlansOfferings x
    -> DescribeSavingsPlansOfferings)
-> Generic DescribeSavingsPlansOfferings
forall x.
Rep DescribeSavingsPlansOfferings x
-> DescribeSavingsPlansOfferings
forall x.
DescribeSavingsPlansOfferings
-> Rep DescribeSavingsPlansOfferings x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeSavingsPlansOfferings x
-> DescribeSavingsPlansOfferings
$cfrom :: forall x.
DescribeSavingsPlansOfferings
-> Rep DescribeSavingsPlansOfferings x
Prelude.Generic)

-- |
-- Create a value of 'DescribeSavingsPlansOfferings' 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:
--
-- 'serviceCodes', 'describeSavingsPlansOfferings_serviceCodes' - The services.
--
-- 'productType', 'describeSavingsPlansOfferings_productType' - The product type.
--
-- 'filters', 'describeSavingsPlansOfferings_filters' - The filters.
--
-- 'offeringIds', 'describeSavingsPlansOfferings_offeringIds' - The IDs of the offerings.
--
-- 'currencies', 'describeSavingsPlansOfferings_currencies' - The currencies.
--
-- 'nextToken', 'describeSavingsPlansOfferings_nextToken' - The token for the next page of results.
--
-- 'paymentOptions', 'describeSavingsPlansOfferings_paymentOptions' - The payment options.
--
-- 'descriptions', 'describeSavingsPlansOfferings_descriptions' - The descriptions.
--
-- 'durations', 'describeSavingsPlansOfferings_durations' - The durations, in seconds.
--
-- 'planTypes', 'describeSavingsPlansOfferings_planTypes' - The plan type.
--
-- 'usageTypes', 'describeSavingsPlansOfferings_usageTypes' - The usage details of the line item in the billing report.
--
-- 'operations', 'describeSavingsPlansOfferings_operations' - The specific AWS operation for the line item in the billing report.
--
-- 'maxResults', 'describeSavingsPlansOfferings_maxResults' - The maximum number of results to return with a single call. To retrieve
-- additional results, make another call with the returned token value.
newDescribeSavingsPlansOfferings ::
  DescribeSavingsPlansOfferings
newDescribeSavingsPlansOfferings :: DescribeSavingsPlansOfferings
newDescribeSavingsPlansOfferings =
  DescribeSavingsPlansOfferings' :: Maybe [Text]
-> Maybe SavingsPlanProductType
-> Maybe [SavingsPlanOfferingFilterElement]
-> Maybe [Text]
-> Maybe [CurrencyCode]
-> Maybe Text
-> Maybe [SavingsPlanPaymentOption]
-> Maybe [Text]
-> Maybe [Natural]
-> Maybe [SavingsPlanType]
-> Maybe [Text]
-> Maybe [Text]
-> Maybe Natural
-> DescribeSavingsPlansOfferings
DescribeSavingsPlansOfferings'
    { $sel:serviceCodes:DescribeSavingsPlansOfferings' :: Maybe [Text]
serviceCodes =
        Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
      $sel:productType:DescribeSavingsPlansOfferings' :: Maybe SavingsPlanProductType
productType = Maybe SavingsPlanProductType
forall a. Maybe a
Prelude.Nothing,
      $sel:filters:DescribeSavingsPlansOfferings' :: Maybe [SavingsPlanOfferingFilterElement]
filters = Maybe [SavingsPlanOfferingFilterElement]
forall a. Maybe a
Prelude.Nothing,
      $sel:offeringIds:DescribeSavingsPlansOfferings' :: Maybe [Text]
offeringIds = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
      $sel:currencies:DescribeSavingsPlansOfferings' :: Maybe [CurrencyCode]
currencies = Maybe [CurrencyCode]
forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:DescribeSavingsPlansOfferings' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:paymentOptions:DescribeSavingsPlansOfferings' :: Maybe [SavingsPlanPaymentOption]
paymentOptions = Maybe [SavingsPlanPaymentOption]
forall a. Maybe a
Prelude.Nothing,
      $sel:descriptions:DescribeSavingsPlansOfferings' :: Maybe [Text]
descriptions = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
      $sel:durations:DescribeSavingsPlansOfferings' :: Maybe [Natural]
durations = Maybe [Natural]
forall a. Maybe a
Prelude.Nothing,
      $sel:planTypes:DescribeSavingsPlansOfferings' :: Maybe [SavingsPlanType]
planTypes = Maybe [SavingsPlanType]
forall a. Maybe a
Prelude.Nothing,
      $sel:usageTypes:DescribeSavingsPlansOfferings' :: Maybe [Text]
usageTypes = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
      $sel:operations:DescribeSavingsPlansOfferings' :: Maybe [Text]
operations = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:DescribeSavingsPlansOfferings' :: Maybe Natural
maxResults = Maybe Natural
forall a. Maybe a
Prelude.Nothing
    }

-- | The services.
describeSavingsPlansOfferings_serviceCodes :: Lens.Lens' DescribeSavingsPlansOfferings (Prelude.Maybe [Prelude.Text])
describeSavingsPlansOfferings_serviceCodes :: (Maybe [Text] -> f (Maybe [Text]))
-> DescribeSavingsPlansOfferings -> f DescribeSavingsPlansOfferings
describeSavingsPlansOfferings_serviceCodes = (DescribeSavingsPlansOfferings -> Maybe [Text])
-> (DescribeSavingsPlansOfferings
    -> Maybe [Text] -> DescribeSavingsPlansOfferings)
-> Lens
     DescribeSavingsPlansOfferings
     DescribeSavingsPlansOfferings
     (Maybe [Text])
     (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeSavingsPlansOfferings' {Maybe [Text]
serviceCodes :: Maybe [Text]
$sel:serviceCodes:DescribeSavingsPlansOfferings' :: DescribeSavingsPlansOfferings -> Maybe [Text]
serviceCodes} -> Maybe [Text]
serviceCodes) (\s :: DescribeSavingsPlansOfferings
s@DescribeSavingsPlansOfferings' {} Maybe [Text]
a -> DescribeSavingsPlansOfferings
s {$sel:serviceCodes:DescribeSavingsPlansOfferings' :: Maybe [Text]
serviceCodes = Maybe [Text]
a} :: DescribeSavingsPlansOfferings) ((Maybe [Text] -> f (Maybe [Text]))
 -> DescribeSavingsPlansOfferings
 -> f DescribeSavingsPlansOfferings)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> DescribeSavingsPlansOfferings
-> f DescribeSavingsPlansOfferings
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 product type.
describeSavingsPlansOfferings_productType :: Lens.Lens' DescribeSavingsPlansOfferings (Prelude.Maybe SavingsPlanProductType)
describeSavingsPlansOfferings_productType :: (Maybe SavingsPlanProductType -> f (Maybe SavingsPlanProductType))
-> DescribeSavingsPlansOfferings -> f DescribeSavingsPlansOfferings
describeSavingsPlansOfferings_productType = (DescribeSavingsPlansOfferings -> Maybe SavingsPlanProductType)
-> (DescribeSavingsPlansOfferings
    -> Maybe SavingsPlanProductType -> DescribeSavingsPlansOfferings)
-> Lens
     DescribeSavingsPlansOfferings
     DescribeSavingsPlansOfferings
     (Maybe SavingsPlanProductType)
     (Maybe SavingsPlanProductType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeSavingsPlansOfferings' {Maybe SavingsPlanProductType
productType :: Maybe SavingsPlanProductType
$sel:productType:DescribeSavingsPlansOfferings' :: DescribeSavingsPlansOfferings -> Maybe SavingsPlanProductType
productType} -> Maybe SavingsPlanProductType
productType) (\s :: DescribeSavingsPlansOfferings
s@DescribeSavingsPlansOfferings' {} Maybe SavingsPlanProductType
a -> DescribeSavingsPlansOfferings
s {$sel:productType:DescribeSavingsPlansOfferings' :: Maybe SavingsPlanProductType
productType = Maybe SavingsPlanProductType
a} :: DescribeSavingsPlansOfferings)

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

-- | The IDs of the offerings.
describeSavingsPlansOfferings_offeringIds :: Lens.Lens' DescribeSavingsPlansOfferings (Prelude.Maybe [Prelude.Text])
describeSavingsPlansOfferings_offeringIds :: (Maybe [Text] -> f (Maybe [Text]))
-> DescribeSavingsPlansOfferings -> f DescribeSavingsPlansOfferings
describeSavingsPlansOfferings_offeringIds = (DescribeSavingsPlansOfferings -> Maybe [Text])
-> (DescribeSavingsPlansOfferings
    -> Maybe [Text] -> DescribeSavingsPlansOfferings)
-> Lens
     DescribeSavingsPlansOfferings
     DescribeSavingsPlansOfferings
     (Maybe [Text])
     (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeSavingsPlansOfferings' {Maybe [Text]
offeringIds :: Maybe [Text]
$sel:offeringIds:DescribeSavingsPlansOfferings' :: DescribeSavingsPlansOfferings -> Maybe [Text]
offeringIds} -> Maybe [Text]
offeringIds) (\s :: DescribeSavingsPlansOfferings
s@DescribeSavingsPlansOfferings' {} Maybe [Text]
a -> DescribeSavingsPlansOfferings
s {$sel:offeringIds:DescribeSavingsPlansOfferings' :: Maybe [Text]
offeringIds = Maybe [Text]
a} :: DescribeSavingsPlansOfferings) ((Maybe [Text] -> f (Maybe [Text]))
 -> DescribeSavingsPlansOfferings
 -> f DescribeSavingsPlansOfferings)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> DescribeSavingsPlansOfferings
-> f DescribeSavingsPlansOfferings
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 currencies.
describeSavingsPlansOfferings_currencies :: Lens.Lens' DescribeSavingsPlansOfferings (Prelude.Maybe [CurrencyCode])
describeSavingsPlansOfferings_currencies :: (Maybe [CurrencyCode] -> f (Maybe [CurrencyCode]))
-> DescribeSavingsPlansOfferings -> f DescribeSavingsPlansOfferings
describeSavingsPlansOfferings_currencies = (DescribeSavingsPlansOfferings -> Maybe [CurrencyCode])
-> (DescribeSavingsPlansOfferings
    -> Maybe [CurrencyCode] -> DescribeSavingsPlansOfferings)
-> Lens
     DescribeSavingsPlansOfferings
     DescribeSavingsPlansOfferings
     (Maybe [CurrencyCode])
     (Maybe [CurrencyCode])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeSavingsPlansOfferings' {Maybe [CurrencyCode]
currencies :: Maybe [CurrencyCode]
$sel:currencies:DescribeSavingsPlansOfferings' :: DescribeSavingsPlansOfferings -> Maybe [CurrencyCode]
currencies} -> Maybe [CurrencyCode]
currencies) (\s :: DescribeSavingsPlansOfferings
s@DescribeSavingsPlansOfferings' {} Maybe [CurrencyCode]
a -> DescribeSavingsPlansOfferings
s {$sel:currencies:DescribeSavingsPlansOfferings' :: Maybe [CurrencyCode]
currencies = Maybe [CurrencyCode]
a} :: DescribeSavingsPlansOfferings) ((Maybe [CurrencyCode] -> f (Maybe [CurrencyCode]))
 -> DescribeSavingsPlansOfferings
 -> f DescribeSavingsPlansOfferings)
-> ((Maybe [CurrencyCode] -> f (Maybe [CurrencyCode]))
    -> Maybe [CurrencyCode] -> f (Maybe [CurrencyCode]))
-> (Maybe [CurrencyCode] -> f (Maybe [CurrencyCode]))
-> DescribeSavingsPlansOfferings
-> f DescribeSavingsPlansOfferings
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [CurrencyCode] [CurrencyCode] [CurrencyCode] [CurrencyCode]
-> Iso
     (Maybe [CurrencyCode])
     (Maybe [CurrencyCode])
     (Maybe [CurrencyCode])
     (Maybe [CurrencyCode])
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 [CurrencyCode] [CurrencyCode] [CurrencyCode] [CurrencyCode]
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.
describeSavingsPlansOfferings_nextToken :: Lens.Lens' DescribeSavingsPlansOfferings (Prelude.Maybe Prelude.Text)
describeSavingsPlansOfferings_nextToken :: (Maybe Text -> f (Maybe Text))
-> DescribeSavingsPlansOfferings -> f DescribeSavingsPlansOfferings
describeSavingsPlansOfferings_nextToken = (DescribeSavingsPlansOfferings -> Maybe Text)
-> (DescribeSavingsPlansOfferings
    -> Maybe Text -> DescribeSavingsPlansOfferings)
-> Lens
     DescribeSavingsPlansOfferings
     DescribeSavingsPlansOfferings
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeSavingsPlansOfferings' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:DescribeSavingsPlansOfferings' :: DescribeSavingsPlansOfferings -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: DescribeSavingsPlansOfferings
s@DescribeSavingsPlansOfferings' {} Maybe Text
a -> DescribeSavingsPlansOfferings
s {$sel:nextToken:DescribeSavingsPlansOfferings' :: Maybe Text
nextToken = Maybe Text
a} :: DescribeSavingsPlansOfferings)

-- | The payment options.
describeSavingsPlansOfferings_paymentOptions :: Lens.Lens' DescribeSavingsPlansOfferings (Prelude.Maybe [SavingsPlanPaymentOption])
describeSavingsPlansOfferings_paymentOptions :: (Maybe [SavingsPlanPaymentOption]
 -> f (Maybe [SavingsPlanPaymentOption]))
-> DescribeSavingsPlansOfferings -> f DescribeSavingsPlansOfferings
describeSavingsPlansOfferings_paymentOptions = (DescribeSavingsPlansOfferings -> Maybe [SavingsPlanPaymentOption])
-> (DescribeSavingsPlansOfferings
    -> Maybe [SavingsPlanPaymentOption]
    -> DescribeSavingsPlansOfferings)
-> Lens
     DescribeSavingsPlansOfferings
     DescribeSavingsPlansOfferings
     (Maybe [SavingsPlanPaymentOption])
     (Maybe [SavingsPlanPaymentOption])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeSavingsPlansOfferings' {Maybe [SavingsPlanPaymentOption]
paymentOptions :: Maybe [SavingsPlanPaymentOption]
$sel:paymentOptions:DescribeSavingsPlansOfferings' :: DescribeSavingsPlansOfferings -> Maybe [SavingsPlanPaymentOption]
paymentOptions} -> Maybe [SavingsPlanPaymentOption]
paymentOptions) (\s :: DescribeSavingsPlansOfferings
s@DescribeSavingsPlansOfferings' {} Maybe [SavingsPlanPaymentOption]
a -> DescribeSavingsPlansOfferings
s {$sel:paymentOptions:DescribeSavingsPlansOfferings' :: Maybe [SavingsPlanPaymentOption]
paymentOptions = Maybe [SavingsPlanPaymentOption]
a} :: DescribeSavingsPlansOfferings) ((Maybe [SavingsPlanPaymentOption]
  -> f (Maybe [SavingsPlanPaymentOption]))
 -> DescribeSavingsPlansOfferings
 -> f DescribeSavingsPlansOfferings)
-> ((Maybe [SavingsPlanPaymentOption]
     -> f (Maybe [SavingsPlanPaymentOption]))
    -> Maybe [SavingsPlanPaymentOption]
    -> f (Maybe [SavingsPlanPaymentOption]))
-> (Maybe [SavingsPlanPaymentOption]
    -> f (Maybe [SavingsPlanPaymentOption]))
-> DescribeSavingsPlansOfferings
-> f DescribeSavingsPlansOfferings
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 descriptions.
describeSavingsPlansOfferings_descriptions :: Lens.Lens' DescribeSavingsPlansOfferings (Prelude.Maybe [Prelude.Text])
describeSavingsPlansOfferings_descriptions :: (Maybe [Text] -> f (Maybe [Text]))
-> DescribeSavingsPlansOfferings -> f DescribeSavingsPlansOfferings
describeSavingsPlansOfferings_descriptions = (DescribeSavingsPlansOfferings -> Maybe [Text])
-> (DescribeSavingsPlansOfferings
    -> Maybe [Text] -> DescribeSavingsPlansOfferings)
-> Lens
     DescribeSavingsPlansOfferings
     DescribeSavingsPlansOfferings
     (Maybe [Text])
     (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeSavingsPlansOfferings' {Maybe [Text]
descriptions :: Maybe [Text]
$sel:descriptions:DescribeSavingsPlansOfferings' :: DescribeSavingsPlansOfferings -> Maybe [Text]
descriptions} -> Maybe [Text]
descriptions) (\s :: DescribeSavingsPlansOfferings
s@DescribeSavingsPlansOfferings' {} Maybe [Text]
a -> DescribeSavingsPlansOfferings
s {$sel:descriptions:DescribeSavingsPlansOfferings' :: Maybe [Text]
descriptions = Maybe [Text]
a} :: DescribeSavingsPlansOfferings) ((Maybe [Text] -> f (Maybe [Text]))
 -> DescribeSavingsPlansOfferings
 -> f DescribeSavingsPlansOfferings)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> DescribeSavingsPlansOfferings
-> f DescribeSavingsPlansOfferings
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 durations, in seconds.
describeSavingsPlansOfferings_durations :: Lens.Lens' DescribeSavingsPlansOfferings (Prelude.Maybe [Prelude.Natural])
describeSavingsPlansOfferings_durations :: (Maybe [Natural] -> f (Maybe [Natural]))
-> DescribeSavingsPlansOfferings -> f DescribeSavingsPlansOfferings
describeSavingsPlansOfferings_durations = (DescribeSavingsPlansOfferings -> Maybe [Natural])
-> (DescribeSavingsPlansOfferings
    -> Maybe [Natural] -> DescribeSavingsPlansOfferings)
-> Lens
     DescribeSavingsPlansOfferings
     DescribeSavingsPlansOfferings
     (Maybe [Natural])
     (Maybe [Natural])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeSavingsPlansOfferings' {Maybe [Natural]
durations :: Maybe [Natural]
$sel:durations:DescribeSavingsPlansOfferings' :: DescribeSavingsPlansOfferings -> Maybe [Natural]
durations} -> Maybe [Natural]
durations) (\s :: DescribeSavingsPlansOfferings
s@DescribeSavingsPlansOfferings' {} Maybe [Natural]
a -> DescribeSavingsPlansOfferings
s {$sel:durations:DescribeSavingsPlansOfferings' :: Maybe [Natural]
durations = Maybe [Natural]
a} :: DescribeSavingsPlansOfferings) ((Maybe [Natural] -> f (Maybe [Natural]))
 -> DescribeSavingsPlansOfferings
 -> f DescribeSavingsPlansOfferings)
-> ((Maybe [Natural] -> f (Maybe [Natural]))
    -> Maybe [Natural] -> f (Maybe [Natural]))
-> (Maybe [Natural] -> f (Maybe [Natural]))
-> DescribeSavingsPlansOfferings
-> f DescribeSavingsPlansOfferings
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Natural] [Natural] [Natural] [Natural]
-> Iso
     (Maybe [Natural])
     (Maybe [Natural])
     (Maybe [Natural])
     (Maybe [Natural])
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 [Natural] [Natural] [Natural] [Natural]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The plan type.
describeSavingsPlansOfferings_planTypes :: Lens.Lens' DescribeSavingsPlansOfferings (Prelude.Maybe [SavingsPlanType])
describeSavingsPlansOfferings_planTypes :: (Maybe [SavingsPlanType] -> f (Maybe [SavingsPlanType]))
-> DescribeSavingsPlansOfferings -> f DescribeSavingsPlansOfferings
describeSavingsPlansOfferings_planTypes = (DescribeSavingsPlansOfferings -> Maybe [SavingsPlanType])
-> (DescribeSavingsPlansOfferings
    -> Maybe [SavingsPlanType] -> DescribeSavingsPlansOfferings)
-> Lens
     DescribeSavingsPlansOfferings
     DescribeSavingsPlansOfferings
     (Maybe [SavingsPlanType])
     (Maybe [SavingsPlanType])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeSavingsPlansOfferings' {Maybe [SavingsPlanType]
planTypes :: Maybe [SavingsPlanType]
$sel:planTypes:DescribeSavingsPlansOfferings' :: DescribeSavingsPlansOfferings -> Maybe [SavingsPlanType]
planTypes} -> Maybe [SavingsPlanType]
planTypes) (\s :: DescribeSavingsPlansOfferings
s@DescribeSavingsPlansOfferings' {} Maybe [SavingsPlanType]
a -> DescribeSavingsPlansOfferings
s {$sel:planTypes:DescribeSavingsPlansOfferings' :: Maybe [SavingsPlanType]
planTypes = Maybe [SavingsPlanType]
a} :: DescribeSavingsPlansOfferings) ((Maybe [SavingsPlanType] -> f (Maybe [SavingsPlanType]))
 -> DescribeSavingsPlansOfferings
 -> f DescribeSavingsPlansOfferings)
-> ((Maybe [SavingsPlanType] -> f (Maybe [SavingsPlanType]))
    -> Maybe [SavingsPlanType] -> f (Maybe [SavingsPlanType]))
-> (Maybe [SavingsPlanType] -> f (Maybe [SavingsPlanType]))
-> DescribeSavingsPlansOfferings
-> f DescribeSavingsPlansOfferings
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 usage details of the line item in the billing report.
describeSavingsPlansOfferings_usageTypes :: Lens.Lens' DescribeSavingsPlansOfferings (Prelude.Maybe [Prelude.Text])
describeSavingsPlansOfferings_usageTypes :: (Maybe [Text] -> f (Maybe [Text]))
-> DescribeSavingsPlansOfferings -> f DescribeSavingsPlansOfferings
describeSavingsPlansOfferings_usageTypes = (DescribeSavingsPlansOfferings -> Maybe [Text])
-> (DescribeSavingsPlansOfferings
    -> Maybe [Text] -> DescribeSavingsPlansOfferings)
-> Lens
     DescribeSavingsPlansOfferings
     DescribeSavingsPlansOfferings
     (Maybe [Text])
     (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeSavingsPlansOfferings' {Maybe [Text]
usageTypes :: Maybe [Text]
$sel:usageTypes:DescribeSavingsPlansOfferings' :: DescribeSavingsPlansOfferings -> Maybe [Text]
usageTypes} -> Maybe [Text]
usageTypes) (\s :: DescribeSavingsPlansOfferings
s@DescribeSavingsPlansOfferings' {} Maybe [Text]
a -> DescribeSavingsPlansOfferings
s {$sel:usageTypes:DescribeSavingsPlansOfferings' :: Maybe [Text]
usageTypes = Maybe [Text]
a} :: DescribeSavingsPlansOfferings) ((Maybe [Text] -> f (Maybe [Text]))
 -> DescribeSavingsPlansOfferings
 -> f DescribeSavingsPlansOfferings)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> DescribeSavingsPlansOfferings
-> f DescribeSavingsPlansOfferings
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.
describeSavingsPlansOfferings_operations :: Lens.Lens' DescribeSavingsPlansOfferings (Prelude.Maybe [Prelude.Text])
describeSavingsPlansOfferings_operations :: (Maybe [Text] -> f (Maybe [Text]))
-> DescribeSavingsPlansOfferings -> f DescribeSavingsPlansOfferings
describeSavingsPlansOfferings_operations = (DescribeSavingsPlansOfferings -> Maybe [Text])
-> (DescribeSavingsPlansOfferings
    -> Maybe [Text] -> DescribeSavingsPlansOfferings)
-> Lens
     DescribeSavingsPlansOfferings
     DescribeSavingsPlansOfferings
     (Maybe [Text])
     (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeSavingsPlansOfferings' {Maybe [Text]
operations :: Maybe [Text]
$sel:operations:DescribeSavingsPlansOfferings' :: DescribeSavingsPlansOfferings -> Maybe [Text]
operations} -> Maybe [Text]
operations) (\s :: DescribeSavingsPlansOfferings
s@DescribeSavingsPlansOfferings' {} Maybe [Text]
a -> DescribeSavingsPlansOfferings
s {$sel:operations:DescribeSavingsPlansOfferings' :: Maybe [Text]
operations = Maybe [Text]
a} :: DescribeSavingsPlansOfferings) ((Maybe [Text] -> f (Maybe [Text]))
 -> DescribeSavingsPlansOfferings
 -> f DescribeSavingsPlansOfferings)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> DescribeSavingsPlansOfferings
-> f DescribeSavingsPlansOfferings
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.
describeSavingsPlansOfferings_maxResults :: Lens.Lens' DescribeSavingsPlansOfferings (Prelude.Maybe Prelude.Natural)
describeSavingsPlansOfferings_maxResults :: (Maybe Natural -> f (Maybe Natural))
-> DescribeSavingsPlansOfferings -> f DescribeSavingsPlansOfferings
describeSavingsPlansOfferings_maxResults = (DescribeSavingsPlansOfferings -> Maybe Natural)
-> (DescribeSavingsPlansOfferings
    -> Maybe Natural -> DescribeSavingsPlansOfferings)
-> Lens
     DescribeSavingsPlansOfferings
     DescribeSavingsPlansOfferings
     (Maybe Natural)
     (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeSavingsPlansOfferings' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:DescribeSavingsPlansOfferings' :: DescribeSavingsPlansOfferings -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: DescribeSavingsPlansOfferings
s@DescribeSavingsPlansOfferings' {} Maybe Natural
a -> DescribeSavingsPlansOfferings
s {$sel:maxResults:DescribeSavingsPlansOfferings' :: Maybe Natural
maxResults = Maybe Natural
a} :: DescribeSavingsPlansOfferings)

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

instance Prelude.NFData DescribeSavingsPlansOfferings

instance Core.ToHeaders DescribeSavingsPlansOfferings where
  toHeaders :: DescribeSavingsPlansOfferings -> ResponseHeaders
toHeaders =
    ResponseHeaders -> DescribeSavingsPlansOfferings -> 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 DescribeSavingsPlansOfferings where
  toJSON :: DescribeSavingsPlansOfferings -> Value
toJSON DescribeSavingsPlansOfferings' {Maybe Natural
Maybe [Natural]
Maybe [Text]
Maybe [CurrencyCode]
Maybe [SavingsPlanOfferingFilterElement]
Maybe [SavingsPlanPaymentOption]
Maybe [SavingsPlanType]
Maybe Text
Maybe SavingsPlanProductType
maxResults :: Maybe Natural
operations :: Maybe [Text]
usageTypes :: Maybe [Text]
planTypes :: Maybe [SavingsPlanType]
durations :: Maybe [Natural]
descriptions :: Maybe [Text]
paymentOptions :: Maybe [SavingsPlanPaymentOption]
nextToken :: Maybe Text
currencies :: Maybe [CurrencyCode]
offeringIds :: Maybe [Text]
filters :: Maybe [SavingsPlanOfferingFilterElement]
productType :: Maybe SavingsPlanProductType
serviceCodes :: Maybe [Text]
$sel:maxResults:DescribeSavingsPlansOfferings' :: DescribeSavingsPlansOfferings -> Maybe Natural
$sel:operations:DescribeSavingsPlansOfferings' :: DescribeSavingsPlansOfferings -> Maybe [Text]
$sel:usageTypes:DescribeSavingsPlansOfferings' :: DescribeSavingsPlansOfferings -> Maybe [Text]
$sel:planTypes:DescribeSavingsPlansOfferings' :: DescribeSavingsPlansOfferings -> Maybe [SavingsPlanType]
$sel:durations:DescribeSavingsPlansOfferings' :: DescribeSavingsPlansOfferings -> Maybe [Natural]
$sel:descriptions:DescribeSavingsPlansOfferings' :: DescribeSavingsPlansOfferings -> Maybe [Text]
$sel:paymentOptions:DescribeSavingsPlansOfferings' :: DescribeSavingsPlansOfferings -> Maybe [SavingsPlanPaymentOption]
$sel:nextToken:DescribeSavingsPlansOfferings' :: DescribeSavingsPlansOfferings -> Maybe Text
$sel:currencies:DescribeSavingsPlansOfferings' :: DescribeSavingsPlansOfferings -> Maybe [CurrencyCode]
$sel:offeringIds:DescribeSavingsPlansOfferings' :: DescribeSavingsPlansOfferings -> Maybe [Text]
$sel:filters:DescribeSavingsPlansOfferings' :: DescribeSavingsPlansOfferings
-> Maybe [SavingsPlanOfferingFilterElement]
$sel:productType:DescribeSavingsPlansOfferings' :: DescribeSavingsPlansOfferings -> Maybe SavingsPlanProductType
$sel:serviceCodes:DescribeSavingsPlansOfferings' :: DescribeSavingsPlansOfferings -> Maybe [Text]
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"serviceCodes" 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]
serviceCodes,
            (Text
"productType" 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
productType,
            (Text
"filters" Text -> [SavingsPlanOfferingFilterElement] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) ([SavingsPlanOfferingFilterElement] -> Pair)
-> Maybe [SavingsPlanOfferingFilterElement] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [SavingsPlanOfferingFilterElement]
filters,
            (Text
"offeringIds" 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]
offeringIds,
            (Text
"currencies" Text -> [CurrencyCode] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) ([CurrencyCode] -> Pair) -> Maybe [CurrencyCode] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [CurrencyCode]
currencies,
            (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
"paymentOptions" 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]
paymentOptions,
            (Text
"descriptions" 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]
descriptions,
            (Text
"durations" 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]
durations,
            (Text
"planTypes" 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]
planTypes,
            (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 DescribeSavingsPlansOfferings where
  toPath :: DescribeSavingsPlansOfferings -> ByteString
toPath =
    ByteString -> DescribeSavingsPlansOfferings -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/DescribeSavingsPlansOfferings"

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

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

-- |
-- Create a value of 'DescribeSavingsPlansOfferingsResponse' 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', 'describeSavingsPlansOfferingsResponse_searchResults' - Information about the Savings Plans offerings.
--
-- 'nextToken', 'describeSavingsPlansOfferingsResponse_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', 'describeSavingsPlansOfferingsResponse_httpStatus' - The response's http status code.
newDescribeSavingsPlansOfferingsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  DescribeSavingsPlansOfferingsResponse
newDescribeSavingsPlansOfferingsResponse :: Int -> DescribeSavingsPlansOfferingsResponse
newDescribeSavingsPlansOfferingsResponse Int
pHttpStatus_ =
  DescribeSavingsPlansOfferingsResponse' :: Maybe [SavingsPlanOffering]
-> Maybe Text -> Int -> DescribeSavingsPlansOfferingsResponse
DescribeSavingsPlansOfferingsResponse'
    { $sel:searchResults:DescribeSavingsPlansOfferingsResponse' :: Maybe [SavingsPlanOffering]
searchResults =
        Maybe [SavingsPlanOffering]
forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:DescribeSavingsPlansOfferingsResponse' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:DescribeSavingsPlansOfferingsResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | Information about the Savings Plans offerings.
describeSavingsPlansOfferingsResponse_searchResults :: Lens.Lens' DescribeSavingsPlansOfferingsResponse (Prelude.Maybe [SavingsPlanOffering])
describeSavingsPlansOfferingsResponse_searchResults :: (Maybe [SavingsPlanOffering] -> f (Maybe [SavingsPlanOffering]))
-> DescribeSavingsPlansOfferingsResponse
-> f DescribeSavingsPlansOfferingsResponse
describeSavingsPlansOfferingsResponse_searchResults = (DescribeSavingsPlansOfferingsResponse
 -> Maybe [SavingsPlanOffering])
-> (DescribeSavingsPlansOfferingsResponse
    -> Maybe [SavingsPlanOffering]
    -> DescribeSavingsPlansOfferingsResponse)
-> Lens
     DescribeSavingsPlansOfferingsResponse
     DescribeSavingsPlansOfferingsResponse
     (Maybe [SavingsPlanOffering])
     (Maybe [SavingsPlanOffering])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeSavingsPlansOfferingsResponse' {Maybe [SavingsPlanOffering]
searchResults :: Maybe [SavingsPlanOffering]
$sel:searchResults:DescribeSavingsPlansOfferingsResponse' :: DescribeSavingsPlansOfferingsResponse
-> Maybe [SavingsPlanOffering]
searchResults} -> Maybe [SavingsPlanOffering]
searchResults) (\s :: DescribeSavingsPlansOfferingsResponse
s@DescribeSavingsPlansOfferingsResponse' {} Maybe [SavingsPlanOffering]
a -> DescribeSavingsPlansOfferingsResponse
s {$sel:searchResults:DescribeSavingsPlansOfferingsResponse' :: Maybe [SavingsPlanOffering]
searchResults = Maybe [SavingsPlanOffering]
a} :: DescribeSavingsPlansOfferingsResponse) ((Maybe [SavingsPlanOffering] -> f (Maybe [SavingsPlanOffering]))
 -> DescribeSavingsPlansOfferingsResponse
 -> f DescribeSavingsPlansOfferingsResponse)
-> ((Maybe [SavingsPlanOffering]
     -> f (Maybe [SavingsPlanOffering]))
    -> Maybe [SavingsPlanOffering] -> f (Maybe [SavingsPlanOffering]))
-> (Maybe [SavingsPlanOffering] -> f (Maybe [SavingsPlanOffering]))
-> DescribeSavingsPlansOfferingsResponse
-> f DescribeSavingsPlansOfferingsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [SavingsPlanOffering]
  [SavingsPlanOffering]
  [SavingsPlanOffering]
  [SavingsPlanOffering]
-> Iso
     (Maybe [SavingsPlanOffering])
     (Maybe [SavingsPlanOffering])
     (Maybe [SavingsPlanOffering])
     (Maybe [SavingsPlanOffering])
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
  [SavingsPlanOffering]
  [SavingsPlanOffering]
  [SavingsPlanOffering]
  [SavingsPlanOffering]
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.
describeSavingsPlansOfferingsResponse_nextToken :: Lens.Lens' DescribeSavingsPlansOfferingsResponse (Prelude.Maybe Prelude.Text)
describeSavingsPlansOfferingsResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> DescribeSavingsPlansOfferingsResponse
-> f DescribeSavingsPlansOfferingsResponse
describeSavingsPlansOfferingsResponse_nextToken = (DescribeSavingsPlansOfferingsResponse -> Maybe Text)
-> (DescribeSavingsPlansOfferingsResponse
    -> Maybe Text -> DescribeSavingsPlansOfferingsResponse)
-> Lens
     DescribeSavingsPlansOfferingsResponse
     DescribeSavingsPlansOfferingsResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeSavingsPlansOfferingsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:DescribeSavingsPlansOfferingsResponse' :: DescribeSavingsPlansOfferingsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: DescribeSavingsPlansOfferingsResponse
s@DescribeSavingsPlansOfferingsResponse' {} Maybe Text
a -> DescribeSavingsPlansOfferingsResponse
s {$sel:nextToken:DescribeSavingsPlansOfferingsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: DescribeSavingsPlansOfferingsResponse)

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

instance
  Prelude.NFData
    DescribeSavingsPlansOfferingsResponse