{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}

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

-- |
-- Module      : Amazonka.CostExplorer.GetReservationPurchaseRecommendation
-- 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)
--
-- Gets recommendations for which reservations to purchase. These
-- recommendations could help you reduce your costs. Reservations provide a
-- discounted hourly rate (up to 75%) compared to On-Demand pricing.
--
-- Amazon Web Services generates your recommendations by identifying your
-- On-Demand usage during a specific time period and collecting your usage
-- into categories that are eligible for a reservation. After Amazon Web
-- Services has these categories, it simulates every combination of
-- reservations in each category of usage to identify the best number of
-- each type of RI to purchase to maximize your estimated savings.
--
-- For example, Amazon Web Services automatically aggregates your Amazon
-- EC2 Linux, shared tenancy, and c4 family usage in the US West (Oregon)
-- Region and recommends that you buy size-flexible regional reservations
-- to apply to the c4 family usage. Amazon Web Services recommends the
-- smallest size instance in an instance family. This makes it easier to
-- purchase a size-flexible RI. Amazon Web Services also shows the equal
-- number of normalized units so that you can purchase any instance size
-- that you want. For this example, your RI recommendation would be for
-- @c4.large@ because that is the smallest size instance in the c4 instance
-- family.
module Amazonka.CostExplorer.GetReservationPurchaseRecommendation
  ( -- * Creating a Request
    GetReservationPurchaseRecommendation (..),
    newGetReservationPurchaseRecommendation,

    -- * Request Lenses
    getReservationPurchaseRecommendation_nextPageToken,
    getReservationPurchaseRecommendation_termInYears,
    getReservationPurchaseRecommendation_serviceSpecification,
    getReservationPurchaseRecommendation_accountScope,
    getReservationPurchaseRecommendation_accountId,
    getReservationPurchaseRecommendation_filter,
    getReservationPurchaseRecommendation_pageSize,
    getReservationPurchaseRecommendation_lookbackPeriodInDays,
    getReservationPurchaseRecommendation_paymentOption,
    getReservationPurchaseRecommendation_service,

    -- * Destructuring the Response
    GetReservationPurchaseRecommendationResponse (..),
    newGetReservationPurchaseRecommendationResponse,

    -- * Response Lenses
    getReservationPurchaseRecommendationResponse_nextPageToken,
    getReservationPurchaseRecommendationResponse_recommendations,
    getReservationPurchaseRecommendationResponse_metadata,
    getReservationPurchaseRecommendationResponse_httpStatus,
  )
where

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

-- | /See:/ 'newGetReservationPurchaseRecommendation' smart constructor.
data GetReservationPurchaseRecommendation = GetReservationPurchaseRecommendation'
  { -- | The pagination token that indicates the next set of results that you
    -- want to retrieve.
    GetReservationPurchaseRecommendation -> Maybe Text
nextPageToken :: Prelude.Maybe Prelude.Text,
    -- | The reservation term that you want recommendations for.
    GetReservationPurchaseRecommendation -> Maybe TermInYears
termInYears :: Prelude.Maybe TermInYears,
    -- | The hardware specifications for the service instances that you want
    -- recommendations for, such as standard or convertible Amazon EC2
    -- instances.
    GetReservationPurchaseRecommendation -> Maybe ServiceSpecification
serviceSpecification :: Prelude.Maybe ServiceSpecification,
    -- | The account scope that you want your recommendations for. Amazon Web
    -- Services calculates recommendations including the management account and
    -- member accounts if the value is set to @PAYER@. If the value is
    -- @LINKED@, recommendations are calculated for individual member accounts
    -- only.
    GetReservationPurchaseRecommendation -> Maybe AccountScope
accountScope :: Prelude.Maybe AccountScope,
    -- | The account ID that is associated with the recommendation.
    GetReservationPurchaseRecommendation -> Maybe Text
accountId :: Prelude.Maybe Prelude.Text,
    GetReservationPurchaseRecommendation -> Maybe Expression
filter' :: Prelude.Maybe Expression,
    -- | The number of recommendations that you want returned in a single
    -- response object.
    GetReservationPurchaseRecommendation -> Maybe Natural
pageSize :: Prelude.Maybe Prelude.Natural,
    -- | The number of previous days that you want Amazon Web Services to
    -- consider when it calculates your recommendations.
    GetReservationPurchaseRecommendation -> Maybe LookbackPeriodInDays
lookbackPeriodInDays :: Prelude.Maybe LookbackPeriodInDays,
    -- | The reservation purchase option that you want recommendations for.
    GetReservationPurchaseRecommendation -> Maybe PaymentOption
paymentOption :: Prelude.Maybe PaymentOption,
    -- | The specific service that you want recommendations for.
    GetReservationPurchaseRecommendation -> Text
service :: Prelude.Text
  }
  deriving (GetReservationPurchaseRecommendation
-> GetReservationPurchaseRecommendation -> Bool
(GetReservationPurchaseRecommendation
 -> GetReservationPurchaseRecommendation -> Bool)
-> (GetReservationPurchaseRecommendation
    -> GetReservationPurchaseRecommendation -> Bool)
-> Eq GetReservationPurchaseRecommendation
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetReservationPurchaseRecommendation
-> GetReservationPurchaseRecommendation -> Bool
$c/= :: GetReservationPurchaseRecommendation
-> GetReservationPurchaseRecommendation -> Bool
== :: GetReservationPurchaseRecommendation
-> GetReservationPurchaseRecommendation -> Bool
$c== :: GetReservationPurchaseRecommendation
-> GetReservationPurchaseRecommendation -> Bool
Prelude.Eq, ReadPrec [GetReservationPurchaseRecommendation]
ReadPrec GetReservationPurchaseRecommendation
Int -> ReadS GetReservationPurchaseRecommendation
ReadS [GetReservationPurchaseRecommendation]
(Int -> ReadS GetReservationPurchaseRecommendation)
-> ReadS [GetReservationPurchaseRecommendation]
-> ReadPrec GetReservationPurchaseRecommendation
-> ReadPrec [GetReservationPurchaseRecommendation]
-> Read GetReservationPurchaseRecommendation
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetReservationPurchaseRecommendation]
$creadListPrec :: ReadPrec [GetReservationPurchaseRecommendation]
readPrec :: ReadPrec GetReservationPurchaseRecommendation
$creadPrec :: ReadPrec GetReservationPurchaseRecommendation
readList :: ReadS [GetReservationPurchaseRecommendation]
$creadList :: ReadS [GetReservationPurchaseRecommendation]
readsPrec :: Int -> ReadS GetReservationPurchaseRecommendation
$creadsPrec :: Int -> ReadS GetReservationPurchaseRecommendation
Prelude.Read, Int -> GetReservationPurchaseRecommendation -> ShowS
[GetReservationPurchaseRecommendation] -> ShowS
GetReservationPurchaseRecommendation -> String
(Int -> GetReservationPurchaseRecommendation -> ShowS)
-> (GetReservationPurchaseRecommendation -> String)
-> ([GetReservationPurchaseRecommendation] -> ShowS)
-> Show GetReservationPurchaseRecommendation
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetReservationPurchaseRecommendation] -> ShowS
$cshowList :: [GetReservationPurchaseRecommendation] -> ShowS
show :: GetReservationPurchaseRecommendation -> String
$cshow :: GetReservationPurchaseRecommendation -> String
showsPrec :: Int -> GetReservationPurchaseRecommendation -> ShowS
$cshowsPrec :: Int -> GetReservationPurchaseRecommendation -> ShowS
Prelude.Show, (forall x.
 GetReservationPurchaseRecommendation
 -> Rep GetReservationPurchaseRecommendation x)
-> (forall x.
    Rep GetReservationPurchaseRecommendation x
    -> GetReservationPurchaseRecommendation)
-> Generic GetReservationPurchaseRecommendation
forall x.
Rep GetReservationPurchaseRecommendation x
-> GetReservationPurchaseRecommendation
forall x.
GetReservationPurchaseRecommendation
-> Rep GetReservationPurchaseRecommendation x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetReservationPurchaseRecommendation x
-> GetReservationPurchaseRecommendation
$cfrom :: forall x.
GetReservationPurchaseRecommendation
-> Rep GetReservationPurchaseRecommendation x
Prelude.Generic)

-- |
-- Create a value of 'GetReservationPurchaseRecommendation' 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:
--
-- 'nextPageToken', 'getReservationPurchaseRecommendation_nextPageToken' - The pagination token that indicates the next set of results that you
-- want to retrieve.
--
-- 'termInYears', 'getReservationPurchaseRecommendation_termInYears' - The reservation term that you want recommendations for.
--
-- 'serviceSpecification', 'getReservationPurchaseRecommendation_serviceSpecification' - The hardware specifications for the service instances that you want
-- recommendations for, such as standard or convertible Amazon EC2
-- instances.
--
-- 'accountScope', 'getReservationPurchaseRecommendation_accountScope' - The account scope that you want your recommendations for. Amazon Web
-- Services calculates recommendations including the management account and
-- member accounts if the value is set to @PAYER@. If the value is
-- @LINKED@, recommendations are calculated for individual member accounts
-- only.
--
-- 'accountId', 'getReservationPurchaseRecommendation_accountId' - The account ID that is associated with the recommendation.
--
-- 'filter'', 'getReservationPurchaseRecommendation_filter' - Undocumented member.
--
-- 'pageSize', 'getReservationPurchaseRecommendation_pageSize' - The number of recommendations that you want returned in a single
-- response object.
--
-- 'lookbackPeriodInDays', 'getReservationPurchaseRecommendation_lookbackPeriodInDays' - The number of previous days that you want Amazon Web Services to
-- consider when it calculates your recommendations.
--
-- 'paymentOption', 'getReservationPurchaseRecommendation_paymentOption' - The reservation purchase option that you want recommendations for.
--
-- 'service', 'getReservationPurchaseRecommendation_service' - The specific service that you want recommendations for.
newGetReservationPurchaseRecommendation ::
  -- | 'service'
  Prelude.Text ->
  GetReservationPurchaseRecommendation
newGetReservationPurchaseRecommendation :: Text -> GetReservationPurchaseRecommendation
newGetReservationPurchaseRecommendation Text
pService_ =
  GetReservationPurchaseRecommendation' :: Maybe Text
-> Maybe TermInYears
-> Maybe ServiceSpecification
-> Maybe AccountScope
-> Maybe Text
-> Maybe Expression
-> Maybe Natural
-> Maybe LookbackPeriodInDays
-> Maybe PaymentOption
-> Text
-> GetReservationPurchaseRecommendation
GetReservationPurchaseRecommendation'
    { $sel:nextPageToken:GetReservationPurchaseRecommendation' :: Maybe Text
nextPageToken =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:termInYears:GetReservationPurchaseRecommendation' :: Maybe TermInYears
termInYears = Maybe TermInYears
forall a. Maybe a
Prelude.Nothing,
      $sel:serviceSpecification:GetReservationPurchaseRecommendation' :: Maybe ServiceSpecification
serviceSpecification =
        Maybe ServiceSpecification
forall a. Maybe a
Prelude.Nothing,
      $sel:accountScope:GetReservationPurchaseRecommendation' :: Maybe AccountScope
accountScope = Maybe AccountScope
forall a. Maybe a
Prelude.Nothing,
      $sel:accountId:GetReservationPurchaseRecommendation' :: Maybe Text
accountId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:filter':GetReservationPurchaseRecommendation' :: Maybe Expression
filter' = Maybe Expression
forall a. Maybe a
Prelude.Nothing,
      $sel:pageSize:GetReservationPurchaseRecommendation' :: Maybe Natural
pageSize = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:lookbackPeriodInDays:GetReservationPurchaseRecommendation' :: Maybe LookbackPeriodInDays
lookbackPeriodInDays =
        Maybe LookbackPeriodInDays
forall a. Maybe a
Prelude.Nothing,
      $sel:paymentOption:GetReservationPurchaseRecommendation' :: Maybe PaymentOption
paymentOption = Maybe PaymentOption
forall a. Maybe a
Prelude.Nothing,
      $sel:service:GetReservationPurchaseRecommendation' :: Text
service = Text
pService_
    }

-- | The pagination token that indicates the next set of results that you
-- want to retrieve.
getReservationPurchaseRecommendation_nextPageToken :: Lens.Lens' GetReservationPurchaseRecommendation (Prelude.Maybe Prelude.Text)
getReservationPurchaseRecommendation_nextPageToken :: (Maybe Text -> f (Maybe Text))
-> GetReservationPurchaseRecommendation
-> f GetReservationPurchaseRecommendation
getReservationPurchaseRecommendation_nextPageToken = (GetReservationPurchaseRecommendation -> Maybe Text)
-> (GetReservationPurchaseRecommendation
    -> Maybe Text -> GetReservationPurchaseRecommendation)
-> Lens
     GetReservationPurchaseRecommendation
     GetReservationPurchaseRecommendation
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetReservationPurchaseRecommendation' {Maybe Text
nextPageToken :: Maybe Text
$sel:nextPageToken:GetReservationPurchaseRecommendation' :: GetReservationPurchaseRecommendation -> Maybe Text
nextPageToken} -> Maybe Text
nextPageToken) (\s :: GetReservationPurchaseRecommendation
s@GetReservationPurchaseRecommendation' {} Maybe Text
a -> GetReservationPurchaseRecommendation
s {$sel:nextPageToken:GetReservationPurchaseRecommendation' :: Maybe Text
nextPageToken = Maybe Text
a} :: GetReservationPurchaseRecommendation)

-- | The reservation term that you want recommendations for.
getReservationPurchaseRecommendation_termInYears :: Lens.Lens' GetReservationPurchaseRecommendation (Prelude.Maybe TermInYears)
getReservationPurchaseRecommendation_termInYears :: (Maybe TermInYears -> f (Maybe TermInYears))
-> GetReservationPurchaseRecommendation
-> f GetReservationPurchaseRecommendation
getReservationPurchaseRecommendation_termInYears = (GetReservationPurchaseRecommendation -> Maybe TermInYears)
-> (GetReservationPurchaseRecommendation
    -> Maybe TermInYears -> GetReservationPurchaseRecommendation)
-> Lens
     GetReservationPurchaseRecommendation
     GetReservationPurchaseRecommendation
     (Maybe TermInYears)
     (Maybe TermInYears)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetReservationPurchaseRecommendation' {Maybe TermInYears
termInYears :: Maybe TermInYears
$sel:termInYears:GetReservationPurchaseRecommendation' :: GetReservationPurchaseRecommendation -> Maybe TermInYears
termInYears} -> Maybe TermInYears
termInYears) (\s :: GetReservationPurchaseRecommendation
s@GetReservationPurchaseRecommendation' {} Maybe TermInYears
a -> GetReservationPurchaseRecommendation
s {$sel:termInYears:GetReservationPurchaseRecommendation' :: Maybe TermInYears
termInYears = Maybe TermInYears
a} :: GetReservationPurchaseRecommendation)

-- | The hardware specifications for the service instances that you want
-- recommendations for, such as standard or convertible Amazon EC2
-- instances.
getReservationPurchaseRecommendation_serviceSpecification :: Lens.Lens' GetReservationPurchaseRecommendation (Prelude.Maybe ServiceSpecification)
getReservationPurchaseRecommendation_serviceSpecification :: (Maybe ServiceSpecification -> f (Maybe ServiceSpecification))
-> GetReservationPurchaseRecommendation
-> f GetReservationPurchaseRecommendation
getReservationPurchaseRecommendation_serviceSpecification = (GetReservationPurchaseRecommendation
 -> Maybe ServiceSpecification)
-> (GetReservationPurchaseRecommendation
    -> Maybe ServiceSpecification
    -> GetReservationPurchaseRecommendation)
-> Lens
     GetReservationPurchaseRecommendation
     GetReservationPurchaseRecommendation
     (Maybe ServiceSpecification)
     (Maybe ServiceSpecification)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetReservationPurchaseRecommendation' {Maybe ServiceSpecification
serviceSpecification :: Maybe ServiceSpecification
$sel:serviceSpecification:GetReservationPurchaseRecommendation' :: GetReservationPurchaseRecommendation -> Maybe ServiceSpecification
serviceSpecification} -> Maybe ServiceSpecification
serviceSpecification) (\s :: GetReservationPurchaseRecommendation
s@GetReservationPurchaseRecommendation' {} Maybe ServiceSpecification
a -> GetReservationPurchaseRecommendation
s {$sel:serviceSpecification:GetReservationPurchaseRecommendation' :: Maybe ServiceSpecification
serviceSpecification = Maybe ServiceSpecification
a} :: GetReservationPurchaseRecommendation)

-- | The account scope that you want your recommendations for. Amazon Web
-- Services calculates recommendations including the management account and
-- member accounts if the value is set to @PAYER@. If the value is
-- @LINKED@, recommendations are calculated for individual member accounts
-- only.
getReservationPurchaseRecommendation_accountScope :: Lens.Lens' GetReservationPurchaseRecommendation (Prelude.Maybe AccountScope)
getReservationPurchaseRecommendation_accountScope :: (Maybe AccountScope -> f (Maybe AccountScope))
-> GetReservationPurchaseRecommendation
-> f GetReservationPurchaseRecommendation
getReservationPurchaseRecommendation_accountScope = (GetReservationPurchaseRecommendation -> Maybe AccountScope)
-> (GetReservationPurchaseRecommendation
    -> Maybe AccountScope -> GetReservationPurchaseRecommendation)
-> Lens
     GetReservationPurchaseRecommendation
     GetReservationPurchaseRecommendation
     (Maybe AccountScope)
     (Maybe AccountScope)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetReservationPurchaseRecommendation' {Maybe AccountScope
accountScope :: Maybe AccountScope
$sel:accountScope:GetReservationPurchaseRecommendation' :: GetReservationPurchaseRecommendation -> Maybe AccountScope
accountScope} -> Maybe AccountScope
accountScope) (\s :: GetReservationPurchaseRecommendation
s@GetReservationPurchaseRecommendation' {} Maybe AccountScope
a -> GetReservationPurchaseRecommendation
s {$sel:accountScope:GetReservationPurchaseRecommendation' :: Maybe AccountScope
accountScope = Maybe AccountScope
a} :: GetReservationPurchaseRecommendation)

-- | The account ID that is associated with the recommendation.
getReservationPurchaseRecommendation_accountId :: Lens.Lens' GetReservationPurchaseRecommendation (Prelude.Maybe Prelude.Text)
getReservationPurchaseRecommendation_accountId :: (Maybe Text -> f (Maybe Text))
-> GetReservationPurchaseRecommendation
-> f GetReservationPurchaseRecommendation
getReservationPurchaseRecommendation_accountId = (GetReservationPurchaseRecommendation -> Maybe Text)
-> (GetReservationPurchaseRecommendation
    -> Maybe Text -> GetReservationPurchaseRecommendation)
-> Lens
     GetReservationPurchaseRecommendation
     GetReservationPurchaseRecommendation
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetReservationPurchaseRecommendation' {Maybe Text
accountId :: Maybe Text
$sel:accountId:GetReservationPurchaseRecommendation' :: GetReservationPurchaseRecommendation -> Maybe Text
accountId} -> Maybe Text
accountId) (\s :: GetReservationPurchaseRecommendation
s@GetReservationPurchaseRecommendation' {} Maybe Text
a -> GetReservationPurchaseRecommendation
s {$sel:accountId:GetReservationPurchaseRecommendation' :: Maybe Text
accountId = Maybe Text
a} :: GetReservationPurchaseRecommendation)

-- | Undocumented member.
getReservationPurchaseRecommendation_filter :: Lens.Lens' GetReservationPurchaseRecommendation (Prelude.Maybe Expression)
getReservationPurchaseRecommendation_filter :: (Maybe Expression -> f (Maybe Expression))
-> GetReservationPurchaseRecommendation
-> f GetReservationPurchaseRecommendation
getReservationPurchaseRecommendation_filter = (GetReservationPurchaseRecommendation -> Maybe Expression)
-> (GetReservationPurchaseRecommendation
    -> Maybe Expression -> GetReservationPurchaseRecommendation)
-> Lens
     GetReservationPurchaseRecommendation
     GetReservationPurchaseRecommendation
     (Maybe Expression)
     (Maybe Expression)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetReservationPurchaseRecommendation' {Maybe Expression
filter' :: Maybe Expression
$sel:filter':GetReservationPurchaseRecommendation' :: GetReservationPurchaseRecommendation -> Maybe Expression
filter'} -> Maybe Expression
filter') (\s :: GetReservationPurchaseRecommendation
s@GetReservationPurchaseRecommendation' {} Maybe Expression
a -> GetReservationPurchaseRecommendation
s {$sel:filter':GetReservationPurchaseRecommendation' :: Maybe Expression
filter' = Maybe Expression
a} :: GetReservationPurchaseRecommendation)

-- | The number of recommendations that you want returned in a single
-- response object.
getReservationPurchaseRecommendation_pageSize :: Lens.Lens' GetReservationPurchaseRecommendation (Prelude.Maybe Prelude.Natural)
getReservationPurchaseRecommendation_pageSize :: (Maybe Natural -> f (Maybe Natural))
-> GetReservationPurchaseRecommendation
-> f GetReservationPurchaseRecommendation
getReservationPurchaseRecommendation_pageSize = (GetReservationPurchaseRecommendation -> Maybe Natural)
-> (GetReservationPurchaseRecommendation
    -> Maybe Natural -> GetReservationPurchaseRecommendation)
-> Lens
     GetReservationPurchaseRecommendation
     GetReservationPurchaseRecommendation
     (Maybe Natural)
     (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetReservationPurchaseRecommendation' {Maybe Natural
pageSize :: Maybe Natural
$sel:pageSize:GetReservationPurchaseRecommendation' :: GetReservationPurchaseRecommendation -> Maybe Natural
pageSize} -> Maybe Natural
pageSize) (\s :: GetReservationPurchaseRecommendation
s@GetReservationPurchaseRecommendation' {} Maybe Natural
a -> GetReservationPurchaseRecommendation
s {$sel:pageSize:GetReservationPurchaseRecommendation' :: Maybe Natural
pageSize = Maybe Natural
a} :: GetReservationPurchaseRecommendation)

-- | The number of previous days that you want Amazon Web Services to
-- consider when it calculates your recommendations.
getReservationPurchaseRecommendation_lookbackPeriodInDays :: Lens.Lens' GetReservationPurchaseRecommendation (Prelude.Maybe LookbackPeriodInDays)
getReservationPurchaseRecommendation_lookbackPeriodInDays :: (Maybe LookbackPeriodInDays -> f (Maybe LookbackPeriodInDays))
-> GetReservationPurchaseRecommendation
-> f GetReservationPurchaseRecommendation
getReservationPurchaseRecommendation_lookbackPeriodInDays = (GetReservationPurchaseRecommendation
 -> Maybe LookbackPeriodInDays)
-> (GetReservationPurchaseRecommendation
    -> Maybe LookbackPeriodInDays
    -> GetReservationPurchaseRecommendation)
-> Lens
     GetReservationPurchaseRecommendation
     GetReservationPurchaseRecommendation
     (Maybe LookbackPeriodInDays)
     (Maybe LookbackPeriodInDays)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetReservationPurchaseRecommendation' {Maybe LookbackPeriodInDays
lookbackPeriodInDays :: Maybe LookbackPeriodInDays
$sel:lookbackPeriodInDays:GetReservationPurchaseRecommendation' :: GetReservationPurchaseRecommendation -> Maybe LookbackPeriodInDays
lookbackPeriodInDays} -> Maybe LookbackPeriodInDays
lookbackPeriodInDays) (\s :: GetReservationPurchaseRecommendation
s@GetReservationPurchaseRecommendation' {} Maybe LookbackPeriodInDays
a -> GetReservationPurchaseRecommendation
s {$sel:lookbackPeriodInDays:GetReservationPurchaseRecommendation' :: Maybe LookbackPeriodInDays
lookbackPeriodInDays = Maybe LookbackPeriodInDays
a} :: GetReservationPurchaseRecommendation)

-- | The reservation purchase option that you want recommendations for.
getReservationPurchaseRecommendation_paymentOption :: Lens.Lens' GetReservationPurchaseRecommendation (Prelude.Maybe PaymentOption)
getReservationPurchaseRecommendation_paymentOption :: (Maybe PaymentOption -> f (Maybe PaymentOption))
-> GetReservationPurchaseRecommendation
-> f GetReservationPurchaseRecommendation
getReservationPurchaseRecommendation_paymentOption = (GetReservationPurchaseRecommendation -> Maybe PaymentOption)
-> (GetReservationPurchaseRecommendation
    -> Maybe PaymentOption -> GetReservationPurchaseRecommendation)
-> Lens
     GetReservationPurchaseRecommendation
     GetReservationPurchaseRecommendation
     (Maybe PaymentOption)
     (Maybe PaymentOption)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetReservationPurchaseRecommendation' {Maybe PaymentOption
paymentOption :: Maybe PaymentOption
$sel:paymentOption:GetReservationPurchaseRecommendation' :: GetReservationPurchaseRecommendation -> Maybe PaymentOption
paymentOption} -> Maybe PaymentOption
paymentOption) (\s :: GetReservationPurchaseRecommendation
s@GetReservationPurchaseRecommendation' {} Maybe PaymentOption
a -> GetReservationPurchaseRecommendation
s {$sel:paymentOption:GetReservationPurchaseRecommendation' :: Maybe PaymentOption
paymentOption = Maybe PaymentOption
a} :: GetReservationPurchaseRecommendation)

-- | The specific service that you want recommendations for.
getReservationPurchaseRecommendation_service :: Lens.Lens' GetReservationPurchaseRecommendation Prelude.Text
getReservationPurchaseRecommendation_service :: (Text -> f Text)
-> GetReservationPurchaseRecommendation
-> f GetReservationPurchaseRecommendation
getReservationPurchaseRecommendation_service = (GetReservationPurchaseRecommendation -> Text)
-> (GetReservationPurchaseRecommendation
    -> Text -> GetReservationPurchaseRecommendation)
-> Lens
     GetReservationPurchaseRecommendation
     GetReservationPurchaseRecommendation
     Text
     Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetReservationPurchaseRecommendation' {Text
service :: Text
$sel:service:GetReservationPurchaseRecommendation' :: GetReservationPurchaseRecommendation -> Text
service} -> Text
service) (\s :: GetReservationPurchaseRecommendation
s@GetReservationPurchaseRecommendation' {} Text
a -> GetReservationPurchaseRecommendation
s {$sel:service:GetReservationPurchaseRecommendation' :: Text
service = Text
a} :: GetReservationPurchaseRecommendation)

instance
  Core.AWSRequest
    GetReservationPurchaseRecommendation
  where
  type
    AWSResponse GetReservationPurchaseRecommendation =
      GetReservationPurchaseRecommendationResponse
  request :: GetReservationPurchaseRecommendation
-> Request GetReservationPurchaseRecommendation
request = Service
-> GetReservationPurchaseRecommendation
-> Request GetReservationPurchaseRecommendation
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy GetReservationPurchaseRecommendation
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse
           (AWSResponse GetReservationPurchaseRecommendation)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either
      String (AWSResponse GetReservationPurchaseRecommendation))
-> Logger
-> Service
-> Proxy GetReservationPurchaseRecommendation
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse
           (AWSResponse GetReservationPurchaseRecommendation)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe Text
-> Maybe [ReservationPurchaseRecommendation]
-> Maybe ReservationPurchaseRecommendationMetadata
-> Int
-> GetReservationPurchaseRecommendationResponse
GetReservationPurchaseRecommendationResponse'
            (Maybe Text
 -> Maybe [ReservationPurchaseRecommendation]
 -> Maybe ReservationPurchaseRecommendationMetadata
 -> Int
 -> GetReservationPurchaseRecommendationResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe [ReservationPurchaseRecommendation]
      -> Maybe ReservationPurchaseRecommendationMetadata
      -> Int
      -> GetReservationPurchaseRecommendationResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"NextPageToken")
              Either
  String
  (Maybe [ReservationPurchaseRecommendation]
   -> Maybe ReservationPurchaseRecommendationMetadata
   -> Int
   -> GetReservationPurchaseRecommendationResponse)
-> Either String (Maybe [ReservationPurchaseRecommendation])
-> Either
     String
     (Maybe ReservationPurchaseRecommendationMetadata
      -> Int -> GetReservationPurchaseRecommendationResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object
-> Text
-> Either
     String (Maybe (Maybe [ReservationPurchaseRecommendation]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"Recommendations"
                              Either String (Maybe (Maybe [ReservationPurchaseRecommendation]))
-> Maybe [ReservationPurchaseRecommendation]
-> Either String (Maybe [ReservationPurchaseRecommendation])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [ReservationPurchaseRecommendation]
forall a. Monoid a => a
Prelude.mempty
                          )
              Either
  String
  (Maybe ReservationPurchaseRecommendationMetadata
   -> Int -> GetReservationPurchaseRecommendationResponse)
-> Either String (Maybe ReservationPurchaseRecommendationMetadata)
-> Either
     String (Int -> GetReservationPurchaseRecommendationResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object
-> Text
-> Either String (Maybe ReservationPurchaseRecommendationMetadata)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"Metadata")
              Either String (Int -> GetReservationPurchaseRecommendationResponse)
-> Either String Int
-> Either String GetReservationPurchaseRecommendationResponse
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
    GetReservationPurchaseRecommendation

instance
  Prelude.NFData
    GetReservationPurchaseRecommendation

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

instance
  Core.ToJSON
    GetReservationPurchaseRecommendation
  where
  toJSON :: GetReservationPurchaseRecommendation -> Value
toJSON GetReservationPurchaseRecommendation' {Maybe Natural
Maybe Text
Maybe AccountScope
Maybe LookbackPeriodInDays
Maybe PaymentOption
Maybe ServiceSpecification
Maybe Expression
Maybe TermInYears
Text
service :: Text
paymentOption :: Maybe PaymentOption
lookbackPeriodInDays :: Maybe LookbackPeriodInDays
pageSize :: Maybe Natural
filter' :: Maybe Expression
accountId :: Maybe Text
accountScope :: Maybe AccountScope
serviceSpecification :: Maybe ServiceSpecification
termInYears :: Maybe TermInYears
nextPageToken :: Maybe Text
$sel:service:GetReservationPurchaseRecommendation' :: GetReservationPurchaseRecommendation -> Text
$sel:paymentOption:GetReservationPurchaseRecommendation' :: GetReservationPurchaseRecommendation -> Maybe PaymentOption
$sel:lookbackPeriodInDays:GetReservationPurchaseRecommendation' :: GetReservationPurchaseRecommendation -> Maybe LookbackPeriodInDays
$sel:pageSize:GetReservationPurchaseRecommendation' :: GetReservationPurchaseRecommendation -> Maybe Natural
$sel:filter':GetReservationPurchaseRecommendation' :: GetReservationPurchaseRecommendation -> Maybe Expression
$sel:accountId:GetReservationPurchaseRecommendation' :: GetReservationPurchaseRecommendation -> Maybe Text
$sel:accountScope:GetReservationPurchaseRecommendation' :: GetReservationPurchaseRecommendation -> Maybe AccountScope
$sel:serviceSpecification:GetReservationPurchaseRecommendation' :: GetReservationPurchaseRecommendation -> Maybe ServiceSpecification
$sel:termInYears:GetReservationPurchaseRecommendation' :: GetReservationPurchaseRecommendation -> Maybe TermInYears
$sel:nextPageToken:GetReservationPurchaseRecommendation' :: GetReservationPurchaseRecommendation -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"NextPageToken" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
nextPageToken,
            (Text
"TermInYears" Text -> TermInYears -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (TermInYears -> Pair) -> Maybe TermInYears -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe TermInYears
termInYears,
            (Text
"ServiceSpecification" Text -> ServiceSpecification -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (ServiceSpecification -> Pair)
-> Maybe ServiceSpecification -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe ServiceSpecification
serviceSpecification,
            (Text
"AccountScope" Text -> AccountScope -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (AccountScope -> Pair) -> Maybe AccountScope -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe AccountScope
accountScope,
            (Text
"AccountId" 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
accountId,
            (Text
"Filter" Text -> Expression -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Expression -> Pair) -> Maybe Expression -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Expression
filter',
            (Text
"PageSize" 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
pageSize,
            (Text
"LookbackPeriodInDays" Text -> LookbackPeriodInDays -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (LookbackPeriodInDays -> Pair)
-> Maybe LookbackPeriodInDays -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe LookbackPeriodInDays
lookbackPeriodInDays,
            (Text
"PaymentOption" Text -> PaymentOption -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (PaymentOption -> Pair) -> Maybe PaymentOption -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe PaymentOption
paymentOption,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Service" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
service)
          ]
      )

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

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

-- | /See:/ 'newGetReservationPurchaseRecommendationResponse' smart constructor.
data GetReservationPurchaseRecommendationResponse = GetReservationPurchaseRecommendationResponse'
  { -- | The pagination token for the next set of retrievable results.
    GetReservationPurchaseRecommendationResponse -> Maybe Text
nextPageToken :: Prelude.Maybe Prelude.Text,
    -- | Recommendations for reservations to purchase.
    GetReservationPurchaseRecommendationResponse
-> Maybe [ReservationPurchaseRecommendation]
recommendations :: Prelude.Maybe [ReservationPurchaseRecommendation],
    -- | Information about this specific recommendation call, such as the time
    -- stamp for when Cost Explorer generated this recommendation.
    GetReservationPurchaseRecommendationResponse
-> Maybe ReservationPurchaseRecommendationMetadata
metadata :: Prelude.Maybe ReservationPurchaseRecommendationMetadata,
    -- | The response's http status code.
    GetReservationPurchaseRecommendationResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (GetReservationPurchaseRecommendationResponse
-> GetReservationPurchaseRecommendationResponse -> Bool
(GetReservationPurchaseRecommendationResponse
 -> GetReservationPurchaseRecommendationResponse -> Bool)
-> (GetReservationPurchaseRecommendationResponse
    -> GetReservationPurchaseRecommendationResponse -> Bool)
-> Eq GetReservationPurchaseRecommendationResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetReservationPurchaseRecommendationResponse
-> GetReservationPurchaseRecommendationResponse -> Bool
$c/= :: GetReservationPurchaseRecommendationResponse
-> GetReservationPurchaseRecommendationResponse -> Bool
== :: GetReservationPurchaseRecommendationResponse
-> GetReservationPurchaseRecommendationResponse -> Bool
$c== :: GetReservationPurchaseRecommendationResponse
-> GetReservationPurchaseRecommendationResponse -> Bool
Prelude.Eq, ReadPrec [GetReservationPurchaseRecommendationResponse]
ReadPrec GetReservationPurchaseRecommendationResponse
Int -> ReadS GetReservationPurchaseRecommendationResponse
ReadS [GetReservationPurchaseRecommendationResponse]
(Int -> ReadS GetReservationPurchaseRecommendationResponse)
-> ReadS [GetReservationPurchaseRecommendationResponse]
-> ReadPrec GetReservationPurchaseRecommendationResponse
-> ReadPrec [GetReservationPurchaseRecommendationResponse]
-> Read GetReservationPurchaseRecommendationResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetReservationPurchaseRecommendationResponse]
$creadListPrec :: ReadPrec [GetReservationPurchaseRecommendationResponse]
readPrec :: ReadPrec GetReservationPurchaseRecommendationResponse
$creadPrec :: ReadPrec GetReservationPurchaseRecommendationResponse
readList :: ReadS [GetReservationPurchaseRecommendationResponse]
$creadList :: ReadS [GetReservationPurchaseRecommendationResponse]
readsPrec :: Int -> ReadS GetReservationPurchaseRecommendationResponse
$creadsPrec :: Int -> ReadS GetReservationPurchaseRecommendationResponse
Prelude.Read, Int -> GetReservationPurchaseRecommendationResponse -> ShowS
[GetReservationPurchaseRecommendationResponse] -> ShowS
GetReservationPurchaseRecommendationResponse -> String
(Int -> GetReservationPurchaseRecommendationResponse -> ShowS)
-> (GetReservationPurchaseRecommendationResponse -> String)
-> ([GetReservationPurchaseRecommendationResponse] -> ShowS)
-> Show GetReservationPurchaseRecommendationResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetReservationPurchaseRecommendationResponse] -> ShowS
$cshowList :: [GetReservationPurchaseRecommendationResponse] -> ShowS
show :: GetReservationPurchaseRecommendationResponse -> String
$cshow :: GetReservationPurchaseRecommendationResponse -> String
showsPrec :: Int -> GetReservationPurchaseRecommendationResponse -> ShowS
$cshowsPrec :: Int -> GetReservationPurchaseRecommendationResponse -> ShowS
Prelude.Show, (forall x.
 GetReservationPurchaseRecommendationResponse
 -> Rep GetReservationPurchaseRecommendationResponse x)
-> (forall x.
    Rep GetReservationPurchaseRecommendationResponse x
    -> GetReservationPurchaseRecommendationResponse)
-> Generic GetReservationPurchaseRecommendationResponse
forall x.
Rep GetReservationPurchaseRecommendationResponse x
-> GetReservationPurchaseRecommendationResponse
forall x.
GetReservationPurchaseRecommendationResponse
-> Rep GetReservationPurchaseRecommendationResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetReservationPurchaseRecommendationResponse x
-> GetReservationPurchaseRecommendationResponse
$cfrom :: forall x.
GetReservationPurchaseRecommendationResponse
-> Rep GetReservationPurchaseRecommendationResponse x
Prelude.Generic)

-- |
-- Create a value of 'GetReservationPurchaseRecommendationResponse' 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:
--
-- 'nextPageToken', 'getReservationPurchaseRecommendationResponse_nextPageToken' - The pagination token for the next set of retrievable results.
--
-- 'recommendations', 'getReservationPurchaseRecommendationResponse_recommendations' - Recommendations for reservations to purchase.
--
-- 'metadata', 'getReservationPurchaseRecommendationResponse_metadata' - Information about this specific recommendation call, such as the time
-- stamp for when Cost Explorer generated this recommendation.
--
-- 'httpStatus', 'getReservationPurchaseRecommendationResponse_httpStatus' - The response's http status code.
newGetReservationPurchaseRecommendationResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  GetReservationPurchaseRecommendationResponse
newGetReservationPurchaseRecommendationResponse :: Int -> GetReservationPurchaseRecommendationResponse
newGetReservationPurchaseRecommendationResponse
  Int
pHttpStatus_ =
    GetReservationPurchaseRecommendationResponse' :: Maybe Text
-> Maybe [ReservationPurchaseRecommendation]
-> Maybe ReservationPurchaseRecommendationMetadata
-> Int
-> GetReservationPurchaseRecommendationResponse
GetReservationPurchaseRecommendationResponse'
      { $sel:nextPageToken:GetReservationPurchaseRecommendationResponse' :: Maybe Text
nextPageToken =
          Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:recommendations:GetReservationPurchaseRecommendationResponse' :: Maybe [ReservationPurchaseRecommendation]
recommendations =
          Maybe [ReservationPurchaseRecommendation]
forall a. Maybe a
Prelude.Nothing,
        $sel:metadata:GetReservationPurchaseRecommendationResponse' :: Maybe ReservationPurchaseRecommendationMetadata
metadata = Maybe ReservationPurchaseRecommendationMetadata
forall a. Maybe a
Prelude.Nothing,
        $sel:httpStatus:GetReservationPurchaseRecommendationResponse' :: Int
httpStatus = Int
pHttpStatus_
      }

-- | The pagination token for the next set of retrievable results.
getReservationPurchaseRecommendationResponse_nextPageToken :: Lens.Lens' GetReservationPurchaseRecommendationResponse (Prelude.Maybe Prelude.Text)
getReservationPurchaseRecommendationResponse_nextPageToken :: (Maybe Text -> f (Maybe Text))
-> GetReservationPurchaseRecommendationResponse
-> f GetReservationPurchaseRecommendationResponse
getReservationPurchaseRecommendationResponse_nextPageToken = (GetReservationPurchaseRecommendationResponse -> Maybe Text)
-> (GetReservationPurchaseRecommendationResponse
    -> Maybe Text -> GetReservationPurchaseRecommendationResponse)
-> Lens
     GetReservationPurchaseRecommendationResponse
     GetReservationPurchaseRecommendationResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetReservationPurchaseRecommendationResponse' {Maybe Text
nextPageToken :: Maybe Text
$sel:nextPageToken:GetReservationPurchaseRecommendationResponse' :: GetReservationPurchaseRecommendationResponse -> Maybe Text
nextPageToken} -> Maybe Text
nextPageToken) (\s :: GetReservationPurchaseRecommendationResponse
s@GetReservationPurchaseRecommendationResponse' {} Maybe Text
a -> GetReservationPurchaseRecommendationResponse
s {$sel:nextPageToken:GetReservationPurchaseRecommendationResponse' :: Maybe Text
nextPageToken = Maybe Text
a} :: GetReservationPurchaseRecommendationResponse)

-- | Recommendations for reservations to purchase.
getReservationPurchaseRecommendationResponse_recommendations :: Lens.Lens' GetReservationPurchaseRecommendationResponse (Prelude.Maybe [ReservationPurchaseRecommendation])
getReservationPurchaseRecommendationResponse_recommendations :: (Maybe [ReservationPurchaseRecommendation]
 -> f (Maybe [ReservationPurchaseRecommendation]))
-> GetReservationPurchaseRecommendationResponse
-> f GetReservationPurchaseRecommendationResponse
getReservationPurchaseRecommendationResponse_recommendations = (GetReservationPurchaseRecommendationResponse
 -> Maybe [ReservationPurchaseRecommendation])
-> (GetReservationPurchaseRecommendationResponse
    -> Maybe [ReservationPurchaseRecommendation]
    -> GetReservationPurchaseRecommendationResponse)
-> Lens
     GetReservationPurchaseRecommendationResponse
     GetReservationPurchaseRecommendationResponse
     (Maybe [ReservationPurchaseRecommendation])
     (Maybe [ReservationPurchaseRecommendation])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetReservationPurchaseRecommendationResponse' {Maybe [ReservationPurchaseRecommendation]
recommendations :: Maybe [ReservationPurchaseRecommendation]
$sel:recommendations:GetReservationPurchaseRecommendationResponse' :: GetReservationPurchaseRecommendationResponse
-> Maybe [ReservationPurchaseRecommendation]
recommendations} -> Maybe [ReservationPurchaseRecommendation]
recommendations) (\s :: GetReservationPurchaseRecommendationResponse
s@GetReservationPurchaseRecommendationResponse' {} Maybe [ReservationPurchaseRecommendation]
a -> GetReservationPurchaseRecommendationResponse
s {$sel:recommendations:GetReservationPurchaseRecommendationResponse' :: Maybe [ReservationPurchaseRecommendation]
recommendations = Maybe [ReservationPurchaseRecommendation]
a} :: GetReservationPurchaseRecommendationResponse) ((Maybe [ReservationPurchaseRecommendation]
  -> f (Maybe [ReservationPurchaseRecommendation]))
 -> GetReservationPurchaseRecommendationResponse
 -> f GetReservationPurchaseRecommendationResponse)
-> ((Maybe [ReservationPurchaseRecommendation]
     -> f (Maybe [ReservationPurchaseRecommendation]))
    -> Maybe [ReservationPurchaseRecommendation]
    -> f (Maybe [ReservationPurchaseRecommendation]))
-> (Maybe [ReservationPurchaseRecommendation]
    -> f (Maybe [ReservationPurchaseRecommendation]))
-> GetReservationPurchaseRecommendationResponse
-> f GetReservationPurchaseRecommendationResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [ReservationPurchaseRecommendation]
  [ReservationPurchaseRecommendation]
  [ReservationPurchaseRecommendation]
  [ReservationPurchaseRecommendation]
-> Iso
     (Maybe [ReservationPurchaseRecommendation])
     (Maybe [ReservationPurchaseRecommendation])
     (Maybe [ReservationPurchaseRecommendation])
     (Maybe [ReservationPurchaseRecommendation])
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
  [ReservationPurchaseRecommendation]
  [ReservationPurchaseRecommendation]
  [ReservationPurchaseRecommendation]
  [ReservationPurchaseRecommendation]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | Information about this specific recommendation call, such as the time
-- stamp for when Cost Explorer generated this recommendation.
getReservationPurchaseRecommendationResponse_metadata :: Lens.Lens' GetReservationPurchaseRecommendationResponse (Prelude.Maybe ReservationPurchaseRecommendationMetadata)
getReservationPurchaseRecommendationResponse_metadata :: (Maybe ReservationPurchaseRecommendationMetadata
 -> f (Maybe ReservationPurchaseRecommendationMetadata))
-> GetReservationPurchaseRecommendationResponse
-> f GetReservationPurchaseRecommendationResponse
getReservationPurchaseRecommendationResponse_metadata = (GetReservationPurchaseRecommendationResponse
 -> Maybe ReservationPurchaseRecommendationMetadata)
-> (GetReservationPurchaseRecommendationResponse
    -> Maybe ReservationPurchaseRecommendationMetadata
    -> GetReservationPurchaseRecommendationResponse)
-> Lens
     GetReservationPurchaseRecommendationResponse
     GetReservationPurchaseRecommendationResponse
     (Maybe ReservationPurchaseRecommendationMetadata)
     (Maybe ReservationPurchaseRecommendationMetadata)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetReservationPurchaseRecommendationResponse' {Maybe ReservationPurchaseRecommendationMetadata
metadata :: Maybe ReservationPurchaseRecommendationMetadata
$sel:metadata:GetReservationPurchaseRecommendationResponse' :: GetReservationPurchaseRecommendationResponse
-> Maybe ReservationPurchaseRecommendationMetadata
metadata} -> Maybe ReservationPurchaseRecommendationMetadata
metadata) (\s :: GetReservationPurchaseRecommendationResponse
s@GetReservationPurchaseRecommendationResponse' {} Maybe ReservationPurchaseRecommendationMetadata
a -> GetReservationPurchaseRecommendationResponse
s {$sel:metadata:GetReservationPurchaseRecommendationResponse' :: Maybe ReservationPurchaseRecommendationMetadata
metadata = Maybe ReservationPurchaseRecommendationMetadata
a} :: GetReservationPurchaseRecommendationResponse)

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

instance
  Prelude.NFData
    GetReservationPurchaseRecommendationResponse