{-# 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.GetRightsizingRecommendation
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Creates recommendations that help you save cost by identifying idle and
-- underutilized Amazon EC2 instances.
--
-- Recommendations are generated to either downsize or terminate instances,
-- along with providing savings detail and metrics. For more information
-- about calculation and function, see
-- <https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/ce-rightsizing.html Optimizing Your Cost with Rightsizing Recommendations>
-- in the /Billing and Cost Management User Guide/.
module Amazonka.CostExplorer.GetRightsizingRecommendation
  ( -- * Creating a Request
    GetRightsizingRecommendation (..),
    newGetRightsizingRecommendation,

    -- * Request Lenses
    getRightsizingRecommendation_configuration,
    getRightsizingRecommendation_filter,
    getRightsizingRecommendation_nextPageToken,
    getRightsizingRecommendation_pageSize,
    getRightsizingRecommendation_service,

    -- * Destructuring the Response
    GetRightsizingRecommendationResponse (..),
    newGetRightsizingRecommendationResponse,

    -- * Response Lenses
    getRightsizingRecommendationResponse_configuration,
    getRightsizingRecommendationResponse_metadata,
    getRightsizingRecommendationResponse_nextPageToken,
    getRightsizingRecommendationResponse_rightsizingRecommendations,
    getRightsizingRecommendationResponse_summary,
    getRightsizingRecommendationResponse_httpStatus,
  )
where

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

-- | /See:/ 'newGetRightsizingRecommendation' smart constructor.
data GetRightsizingRecommendation = GetRightsizingRecommendation'
  { -- | You can use Configuration to customize recommendations across two
    -- attributes. You can choose to view recommendations for instances within
    -- the same instance families or across different instance families. You
    -- can also choose to view your estimated savings that are associated with
    -- recommendations with consideration of existing Savings Plans or RI
    -- benefits, or neither.
    GetRightsizingRecommendation
-> Maybe RightsizingRecommendationConfiguration
configuration :: Prelude.Maybe RightsizingRecommendationConfiguration,
    GetRightsizingRecommendation -> Maybe Expression
filter' :: Prelude.Maybe Expression,
    -- | The pagination token that indicates the next set of results that you
    -- want to retrieve.
    GetRightsizingRecommendation -> Maybe Text
nextPageToken :: Prelude.Maybe Prelude.Text,
    -- | The number of recommendations that you want returned in a single
    -- response object.
    GetRightsizingRecommendation -> Maybe Natural
pageSize :: Prelude.Maybe Prelude.Natural,
    -- | The specific service that you want recommendations for. The only valid
    -- value for @GetRightsizingRecommendation@ is \"@AmazonEC2@\".
    GetRightsizingRecommendation -> Text
service :: Prelude.Text
  }
  deriving (GetRightsizingRecommendation
-> GetRightsizingRecommendation -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetRightsizingRecommendation
-> GetRightsizingRecommendation -> Bool
$c/= :: GetRightsizingRecommendation
-> GetRightsizingRecommendation -> Bool
== :: GetRightsizingRecommendation
-> GetRightsizingRecommendation -> Bool
$c== :: GetRightsizingRecommendation
-> GetRightsizingRecommendation -> Bool
Prelude.Eq, ReadPrec [GetRightsizingRecommendation]
ReadPrec GetRightsizingRecommendation
Int -> ReadS GetRightsizingRecommendation
ReadS [GetRightsizingRecommendation]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetRightsizingRecommendation]
$creadListPrec :: ReadPrec [GetRightsizingRecommendation]
readPrec :: ReadPrec GetRightsizingRecommendation
$creadPrec :: ReadPrec GetRightsizingRecommendation
readList :: ReadS [GetRightsizingRecommendation]
$creadList :: ReadS [GetRightsizingRecommendation]
readsPrec :: Int -> ReadS GetRightsizingRecommendation
$creadsPrec :: Int -> ReadS GetRightsizingRecommendation
Prelude.Read, Int -> GetRightsizingRecommendation -> ShowS
[GetRightsizingRecommendation] -> ShowS
GetRightsizingRecommendation -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetRightsizingRecommendation] -> ShowS
$cshowList :: [GetRightsizingRecommendation] -> ShowS
show :: GetRightsizingRecommendation -> String
$cshow :: GetRightsizingRecommendation -> String
showsPrec :: Int -> GetRightsizingRecommendation -> ShowS
$cshowsPrec :: Int -> GetRightsizingRecommendation -> ShowS
Prelude.Show, forall x.
Rep GetRightsizingRecommendation x -> GetRightsizingRecommendation
forall x.
GetRightsizingRecommendation -> Rep GetRightsizingRecommendation x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetRightsizingRecommendation x -> GetRightsizingRecommendation
$cfrom :: forall x.
GetRightsizingRecommendation -> Rep GetRightsizingRecommendation x
Prelude.Generic)

-- |
-- Create a value of 'GetRightsizingRecommendation' 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:
--
-- 'configuration', 'getRightsizingRecommendation_configuration' - You can use Configuration to customize recommendations across two
-- attributes. You can choose to view recommendations for instances within
-- the same instance families or across different instance families. You
-- can also choose to view your estimated savings that are associated with
-- recommendations with consideration of existing Savings Plans or RI
-- benefits, or neither.
--
-- 'filter'', 'getRightsizingRecommendation_filter' - Undocumented member.
--
-- 'nextPageToken', 'getRightsizingRecommendation_nextPageToken' - The pagination token that indicates the next set of results that you
-- want to retrieve.
--
-- 'pageSize', 'getRightsizingRecommendation_pageSize' - The number of recommendations that you want returned in a single
-- response object.
--
-- 'service', 'getRightsizingRecommendation_service' - The specific service that you want recommendations for. The only valid
-- value for @GetRightsizingRecommendation@ is \"@AmazonEC2@\".
newGetRightsizingRecommendation ::
  -- | 'service'
  Prelude.Text ->
  GetRightsizingRecommendation
newGetRightsizingRecommendation :: Text -> GetRightsizingRecommendation
newGetRightsizingRecommendation Text
pService_ =
  GetRightsizingRecommendation'
    { $sel:configuration:GetRightsizingRecommendation' :: Maybe RightsizingRecommendationConfiguration
configuration =
        forall a. Maybe a
Prelude.Nothing,
      $sel:filter':GetRightsizingRecommendation' :: Maybe Expression
filter' = forall a. Maybe a
Prelude.Nothing,
      $sel:nextPageToken:GetRightsizingRecommendation' :: Maybe Text
nextPageToken = forall a. Maybe a
Prelude.Nothing,
      $sel:pageSize:GetRightsizingRecommendation' :: Maybe Natural
pageSize = forall a. Maybe a
Prelude.Nothing,
      $sel:service:GetRightsizingRecommendation' :: Text
service = Text
pService_
    }

-- | You can use Configuration to customize recommendations across two
-- attributes. You can choose to view recommendations for instances within
-- the same instance families or across different instance families. You
-- can also choose to view your estimated savings that are associated with
-- recommendations with consideration of existing Savings Plans or RI
-- benefits, or neither.
getRightsizingRecommendation_configuration :: Lens.Lens' GetRightsizingRecommendation (Prelude.Maybe RightsizingRecommendationConfiguration)
getRightsizingRecommendation_configuration :: Lens'
  GetRightsizingRecommendation
  (Maybe RightsizingRecommendationConfiguration)
getRightsizingRecommendation_configuration = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetRightsizingRecommendation' {Maybe RightsizingRecommendationConfiguration
configuration :: Maybe RightsizingRecommendationConfiguration
$sel:configuration:GetRightsizingRecommendation' :: GetRightsizingRecommendation
-> Maybe RightsizingRecommendationConfiguration
configuration} -> Maybe RightsizingRecommendationConfiguration
configuration) (\s :: GetRightsizingRecommendation
s@GetRightsizingRecommendation' {} Maybe RightsizingRecommendationConfiguration
a -> GetRightsizingRecommendation
s {$sel:configuration:GetRightsizingRecommendation' :: Maybe RightsizingRecommendationConfiguration
configuration = Maybe RightsizingRecommendationConfiguration
a} :: GetRightsizingRecommendation)

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

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

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

-- | The specific service that you want recommendations for. The only valid
-- value for @GetRightsizingRecommendation@ is \"@AmazonEC2@\".
getRightsizingRecommendation_service :: Lens.Lens' GetRightsizingRecommendation Prelude.Text
getRightsizingRecommendation_service :: Lens' GetRightsizingRecommendation Text
getRightsizingRecommendation_service = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetRightsizingRecommendation' {Text
service :: Text
$sel:service:GetRightsizingRecommendation' :: GetRightsizingRecommendation -> Text
service} -> Text
service) (\s :: GetRightsizingRecommendation
s@GetRightsizingRecommendation' {} Text
a -> GetRightsizingRecommendation
s {$sel:service:GetRightsizingRecommendation' :: Text
service = Text
a} :: GetRightsizingRecommendation)

instance Core.AWSRequest GetRightsizingRecommendation where
  type
    AWSResponse GetRightsizingRecommendation =
      GetRightsizingRecommendationResponse
  request :: (Service -> Service)
-> GetRightsizingRecommendation
-> Request GetRightsizingRecommendation
request Service -> Service
overrides =
    forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy GetRightsizingRecommendation
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse GetRightsizingRecommendation)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe RightsizingRecommendationConfiguration
-> Maybe RightsizingRecommendationMetadata
-> Maybe Text
-> Maybe [RightsizingRecommendation]
-> Maybe RightsizingRecommendationSummary
-> Int
-> GetRightsizingRecommendationResponse
GetRightsizingRecommendationResponse'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"Configuration")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"Metadata")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"NextPageToken")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x
                            forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"RightsizingRecommendations"
                            forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty
                        )
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"Summary")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance
  Prelude.Hashable
    GetRightsizingRecommendation
  where
  hashWithSalt :: Int -> GetRightsizingRecommendation -> Int
hashWithSalt Int
_salt GetRightsizingRecommendation' {Maybe Natural
Maybe Text
Maybe RightsizingRecommendationConfiguration
Maybe Expression
Text
service :: Text
pageSize :: Maybe Natural
nextPageToken :: Maybe Text
filter' :: Maybe Expression
configuration :: Maybe RightsizingRecommendationConfiguration
$sel:service:GetRightsizingRecommendation' :: GetRightsizingRecommendation -> Text
$sel:pageSize:GetRightsizingRecommendation' :: GetRightsizingRecommendation -> Maybe Natural
$sel:nextPageToken:GetRightsizingRecommendation' :: GetRightsizingRecommendation -> Maybe Text
$sel:filter':GetRightsizingRecommendation' :: GetRightsizingRecommendation -> Maybe Expression
$sel:configuration:GetRightsizingRecommendation' :: GetRightsizingRecommendation
-> Maybe RightsizingRecommendationConfiguration
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe RightsizingRecommendationConfiguration
configuration
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Expression
filter'
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
nextPageToken
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
pageSize
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
service

instance Prelude.NFData GetRightsizingRecommendation where
  rnf :: GetRightsizingRecommendation -> ()
rnf GetRightsizingRecommendation' {Maybe Natural
Maybe Text
Maybe RightsizingRecommendationConfiguration
Maybe Expression
Text
service :: Text
pageSize :: Maybe Natural
nextPageToken :: Maybe Text
filter' :: Maybe Expression
configuration :: Maybe RightsizingRecommendationConfiguration
$sel:service:GetRightsizingRecommendation' :: GetRightsizingRecommendation -> Text
$sel:pageSize:GetRightsizingRecommendation' :: GetRightsizingRecommendation -> Maybe Natural
$sel:nextPageToken:GetRightsizingRecommendation' :: GetRightsizingRecommendation -> Maybe Text
$sel:filter':GetRightsizingRecommendation' :: GetRightsizingRecommendation -> Maybe Expression
$sel:configuration:GetRightsizingRecommendation' :: GetRightsizingRecommendation
-> Maybe RightsizingRecommendationConfiguration
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe RightsizingRecommendationConfiguration
configuration
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Expression
filter'
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
nextPageToken
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
pageSize
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
service

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

instance Data.ToJSON GetRightsizingRecommendation where
  toJSON :: GetRightsizingRecommendation -> Value
toJSON GetRightsizingRecommendation' {Maybe Natural
Maybe Text
Maybe RightsizingRecommendationConfiguration
Maybe Expression
Text
service :: Text
pageSize :: Maybe Natural
nextPageToken :: Maybe Text
filter' :: Maybe Expression
configuration :: Maybe RightsizingRecommendationConfiguration
$sel:service:GetRightsizingRecommendation' :: GetRightsizingRecommendation -> Text
$sel:pageSize:GetRightsizingRecommendation' :: GetRightsizingRecommendation -> Maybe Natural
$sel:nextPageToken:GetRightsizingRecommendation' :: GetRightsizingRecommendation -> Maybe Text
$sel:filter':GetRightsizingRecommendation' :: GetRightsizingRecommendation -> Maybe Expression
$sel:configuration:GetRightsizingRecommendation' :: GetRightsizingRecommendation
-> Maybe RightsizingRecommendationConfiguration
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"Configuration" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe RightsizingRecommendationConfiguration
configuration,
            (Key
"Filter" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Expression
filter',
            (Key
"NextPageToken" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
nextPageToken,
            (Key
"PageSize" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
pageSize,
            forall a. a -> Maybe a
Prelude.Just (Key
"Service" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
service)
          ]
      )

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

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

-- | /See:/ 'newGetRightsizingRecommendationResponse' smart constructor.
data GetRightsizingRecommendationResponse = GetRightsizingRecommendationResponse'
  { -- | You can use Configuration to customize recommendations across two
    -- attributes. You can choose to view recommendations for instances within
    -- the same instance families or across different instance families. You
    -- can also choose to view your estimated savings that are associated with
    -- recommendations with consideration of existing Savings Plans or RI
    -- benefits, or neither.
    GetRightsizingRecommendationResponse
-> Maybe RightsizingRecommendationConfiguration
configuration :: Prelude.Maybe RightsizingRecommendationConfiguration,
    -- | Information regarding this specific recommendation set.
    GetRightsizingRecommendationResponse
-> Maybe RightsizingRecommendationMetadata
metadata :: Prelude.Maybe RightsizingRecommendationMetadata,
    -- | The token to retrieve the next set of results.
    GetRightsizingRecommendationResponse -> Maybe Text
nextPageToken :: Prelude.Maybe Prelude.Text,
    -- | Recommendations to rightsize resources.
    GetRightsizingRecommendationResponse
-> Maybe [RightsizingRecommendation]
rightsizingRecommendations :: Prelude.Maybe [RightsizingRecommendation],
    -- | Summary of this recommendation set.
    GetRightsizingRecommendationResponse
-> Maybe RightsizingRecommendationSummary
summary :: Prelude.Maybe RightsizingRecommendationSummary,
    -- | The response's http status code.
    GetRightsizingRecommendationResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (GetRightsizingRecommendationResponse
-> GetRightsizingRecommendationResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetRightsizingRecommendationResponse
-> GetRightsizingRecommendationResponse -> Bool
$c/= :: GetRightsizingRecommendationResponse
-> GetRightsizingRecommendationResponse -> Bool
== :: GetRightsizingRecommendationResponse
-> GetRightsizingRecommendationResponse -> Bool
$c== :: GetRightsizingRecommendationResponse
-> GetRightsizingRecommendationResponse -> Bool
Prelude.Eq, ReadPrec [GetRightsizingRecommendationResponse]
ReadPrec GetRightsizingRecommendationResponse
Int -> ReadS GetRightsizingRecommendationResponse
ReadS [GetRightsizingRecommendationResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetRightsizingRecommendationResponse]
$creadListPrec :: ReadPrec [GetRightsizingRecommendationResponse]
readPrec :: ReadPrec GetRightsizingRecommendationResponse
$creadPrec :: ReadPrec GetRightsizingRecommendationResponse
readList :: ReadS [GetRightsizingRecommendationResponse]
$creadList :: ReadS [GetRightsizingRecommendationResponse]
readsPrec :: Int -> ReadS GetRightsizingRecommendationResponse
$creadsPrec :: Int -> ReadS GetRightsizingRecommendationResponse
Prelude.Read, Int -> GetRightsizingRecommendationResponse -> ShowS
[GetRightsizingRecommendationResponse] -> ShowS
GetRightsizingRecommendationResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetRightsizingRecommendationResponse] -> ShowS
$cshowList :: [GetRightsizingRecommendationResponse] -> ShowS
show :: GetRightsizingRecommendationResponse -> String
$cshow :: GetRightsizingRecommendationResponse -> String
showsPrec :: Int -> GetRightsizingRecommendationResponse -> ShowS
$cshowsPrec :: Int -> GetRightsizingRecommendationResponse -> ShowS
Prelude.Show, forall x.
Rep GetRightsizingRecommendationResponse x
-> GetRightsizingRecommendationResponse
forall x.
GetRightsizingRecommendationResponse
-> Rep GetRightsizingRecommendationResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetRightsizingRecommendationResponse x
-> GetRightsizingRecommendationResponse
$cfrom :: forall x.
GetRightsizingRecommendationResponse
-> Rep GetRightsizingRecommendationResponse x
Prelude.Generic)

-- |
-- Create a value of 'GetRightsizingRecommendationResponse' 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:
--
-- 'configuration', 'getRightsizingRecommendationResponse_configuration' - You can use Configuration to customize recommendations across two
-- attributes. You can choose to view recommendations for instances within
-- the same instance families or across different instance families. You
-- can also choose to view your estimated savings that are associated with
-- recommendations with consideration of existing Savings Plans or RI
-- benefits, or neither.
--
-- 'metadata', 'getRightsizingRecommendationResponse_metadata' - Information regarding this specific recommendation set.
--
-- 'nextPageToken', 'getRightsizingRecommendationResponse_nextPageToken' - The token to retrieve the next set of results.
--
-- 'rightsizingRecommendations', 'getRightsizingRecommendationResponse_rightsizingRecommendations' - Recommendations to rightsize resources.
--
-- 'summary', 'getRightsizingRecommendationResponse_summary' - Summary of this recommendation set.
--
-- 'httpStatus', 'getRightsizingRecommendationResponse_httpStatus' - The response's http status code.
newGetRightsizingRecommendationResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  GetRightsizingRecommendationResponse
newGetRightsizingRecommendationResponse :: Int -> GetRightsizingRecommendationResponse
newGetRightsizingRecommendationResponse Int
pHttpStatus_ =
  GetRightsizingRecommendationResponse'
    { $sel:configuration:GetRightsizingRecommendationResponse' :: Maybe RightsizingRecommendationConfiguration
configuration =
        forall a. Maybe a
Prelude.Nothing,
      $sel:metadata:GetRightsizingRecommendationResponse' :: Maybe RightsizingRecommendationMetadata
metadata = forall a. Maybe a
Prelude.Nothing,
      $sel:nextPageToken:GetRightsizingRecommendationResponse' :: Maybe Text
nextPageToken = forall a. Maybe a
Prelude.Nothing,
      $sel:rightsizingRecommendations:GetRightsizingRecommendationResponse' :: Maybe [RightsizingRecommendation]
rightsizingRecommendations =
        forall a. Maybe a
Prelude.Nothing,
      $sel:summary:GetRightsizingRecommendationResponse' :: Maybe RightsizingRecommendationSummary
summary = forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:GetRightsizingRecommendationResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | You can use Configuration to customize recommendations across two
-- attributes. You can choose to view recommendations for instances within
-- the same instance families or across different instance families. You
-- can also choose to view your estimated savings that are associated with
-- recommendations with consideration of existing Savings Plans or RI
-- benefits, or neither.
getRightsizingRecommendationResponse_configuration :: Lens.Lens' GetRightsizingRecommendationResponse (Prelude.Maybe RightsizingRecommendationConfiguration)
getRightsizingRecommendationResponse_configuration :: Lens'
  GetRightsizingRecommendationResponse
  (Maybe RightsizingRecommendationConfiguration)
getRightsizingRecommendationResponse_configuration = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetRightsizingRecommendationResponse' {Maybe RightsizingRecommendationConfiguration
configuration :: Maybe RightsizingRecommendationConfiguration
$sel:configuration:GetRightsizingRecommendationResponse' :: GetRightsizingRecommendationResponse
-> Maybe RightsizingRecommendationConfiguration
configuration} -> Maybe RightsizingRecommendationConfiguration
configuration) (\s :: GetRightsizingRecommendationResponse
s@GetRightsizingRecommendationResponse' {} Maybe RightsizingRecommendationConfiguration
a -> GetRightsizingRecommendationResponse
s {$sel:configuration:GetRightsizingRecommendationResponse' :: Maybe RightsizingRecommendationConfiguration
configuration = Maybe RightsizingRecommendationConfiguration
a} :: GetRightsizingRecommendationResponse)

-- | Information regarding this specific recommendation set.
getRightsizingRecommendationResponse_metadata :: Lens.Lens' GetRightsizingRecommendationResponse (Prelude.Maybe RightsizingRecommendationMetadata)
getRightsizingRecommendationResponse_metadata :: Lens'
  GetRightsizingRecommendationResponse
  (Maybe RightsizingRecommendationMetadata)
getRightsizingRecommendationResponse_metadata = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetRightsizingRecommendationResponse' {Maybe RightsizingRecommendationMetadata
metadata :: Maybe RightsizingRecommendationMetadata
$sel:metadata:GetRightsizingRecommendationResponse' :: GetRightsizingRecommendationResponse
-> Maybe RightsizingRecommendationMetadata
metadata} -> Maybe RightsizingRecommendationMetadata
metadata) (\s :: GetRightsizingRecommendationResponse
s@GetRightsizingRecommendationResponse' {} Maybe RightsizingRecommendationMetadata
a -> GetRightsizingRecommendationResponse
s {$sel:metadata:GetRightsizingRecommendationResponse' :: Maybe RightsizingRecommendationMetadata
metadata = Maybe RightsizingRecommendationMetadata
a} :: GetRightsizingRecommendationResponse)

-- | The token to retrieve the next set of results.
getRightsizingRecommendationResponse_nextPageToken :: Lens.Lens' GetRightsizingRecommendationResponse (Prelude.Maybe Prelude.Text)
getRightsizingRecommendationResponse_nextPageToken :: Lens' GetRightsizingRecommendationResponse (Maybe Text)
getRightsizingRecommendationResponse_nextPageToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetRightsizingRecommendationResponse' {Maybe Text
nextPageToken :: Maybe Text
$sel:nextPageToken:GetRightsizingRecommendationResponse' :: GetRightsizingRecommendationResponse -> Maybe Text
nextPageToken} -> Maybe Text
nextPageToken) (\s :: GetRightsizingRecommendationResponse
s@GetRightsizingRecommendationResponse' {} Maybe Text
a -> GetRightsizingRecommendationResponse
s {$sel:nextPageToken:GetRightsizingRecommendationResponse' :: Maybe Text
nextPageToken = Maybe Text
a} :: GetRightsizingRecommendationResponse)

-- | Recommendations to rightsize resources.
getRightsizingRecommendationResponse_rightsizingRecommendations :: Lens.Lens' GetRightsizingRecommendationResponse (Prelude.Maybe [RightsizingRecommendation])
getRightsizingRecommendationResponse_rightsizingRecommendations :: Lens'
  GetRightsizingRecommendationResponse
  (Maybe [RightsizingRecommendation])
getRightsizingRecommendationResponse_rightsizingRecommendations = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetRightsizingRecommendationResponse' {Maybe [RightsizingRecommendation]
rightsizingRecommendations :: Maybe [RightsizingRecommendation]
$sel:rightsizingRecommendations:GetRightsizingRecommendationResponse' :: GetRightsizingRecommendationResponse
-> Maybe [RightsizingRecommendation]
rightsizingRecommendations} -> Maybe [RightsizingRecommendation]
rightsizingRecommendations) (\s :: GetRightsizingRecommendationResponse
s@GetRightsizingRecommendationResponse' {} Maybe [RightsizingRecommendation]
a -> GetRightsizingRecommendationResponse
s {$sel:rightsizingRecommendations:GetRightsizingRecommendationResponse' :: Maybe [RightsizingRecommendation]
rightsizingRecommendations = Maybe [RightsizingRecommendation]
a} :: GetRightsizingRecommendationResponse) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | Summary of this recommendation set.
getRightsizingRecommendationResponse_summary :: Lens.Lens' GetRightsizingRecommendationResponse (Prelude.Maybe RightsizingRecommendationSummary)
getRightsizingRecommendationResponse_summary :: Lens'
  GetRightsizingRecommendationResponse
  (Maybe RightsizingRecommendationSummary)
getRightsizingRecommendationResponse_summary = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetRightsizingRecommendationResponse' {Maybe RightsizingRecommendationSummary
summary :: Maybe RightsizingRecommendationSummary
$sel:summary:GetRightsizingRecommendationResponse' :: GetRightsizingRecommendationResponse
-> Maybe RightsizingRecommendationSummary
summary} -> Maybe RightsizingRecommendationSummary
summary) (\s :: GetRightsizingRecommendationResponse
s@GetRightsizingRecommendationResponse' {} Maybe RightsizingRecommendationSummary
a -> GetRightsizingRecommendationResponse
s {$sel:summary:GetRightsizingRecommendationResponse' :: Maybe RightsizingRecommendationSummary
summary = Maybe RightsizingRecommendationSummary
a} :: GetRightsizingRecommendationResponse)

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

instance
  Prelude.NFData
    GetRightsizingRecommendationResponse
  where
  rnf :: GetRightsizingRecommendationResponse -> ()
rnf GetRightsizingRecommendationResponse' {Int
Maybe [RightsizingRecommendation]
Maybe Text
Maybe RightsizingRecommendationConfiguration
Maybe RightsizingRecommendationMetadata
Maybe RightsizingRecommendationSummary
httpStatus :: Int
summary :: Maybe RightsizingRecommendationSummary
rightsizingRecommendations :: Maybe [RightsizingRecommendation]
nextPageToken :: Maybe Text
metadata :: Maybe RightsizingRecommendationMetadata
configuration :: Maybe RightsizingRecommendationConfiguration
$sel:httpStatus:GetRightsizingRecommendationResponse' :: GetRightsizingRecommendationResponse -> Int
$sel:summary:GetRightsizingRecommendationResponse' :: GetRightsizingRecommendationResponse
-> Maybe RightsizingRecommendationSummary
$sel:rightsizingRecommendations:GetRightsizingRecommendationResponse' :: GetRightsizingRecommendationResponse
-> Maybe [RightsizingRecommendation]
$sel:nextPageToken:GetRightsizingRecommendationResponse' :: GetRightsizingRecommendationResponse -> Maybe Text
$sel:metadata:GetRightsizingRecommendationResponse' :: GetRightsizingRecommendationResponse
-> Maybe RightsizingRecommendationMetadata
$sel:configuration:GetRightsizingRecommendationResponse' :: GetRightsizingRecommendationResponse
-> Maybe RightsizingRecommendationConfiguration
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe RightsizingRecommendationConfiguration
configuration
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe RightsizingRecommendationMetadata
metadata
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
nextPageToken
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [RightsizingRecommendation]
rightsizingRecommendations
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe RightsizingRecommendationSummary
summary
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus