{-# 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.ComputeOptimizer.GetEBSVolumeRecommendations
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Returns Amazon Elastic Block Store (Amazon EBS) volume recommendations.
--
-- Compute Optimizer generates recommendations for Amazon EBS volumes that
-- meet a specific set of requirements. For more information, see the
-- <https://docs.aws.amazon.com/compute-optimizer/latest/ug/requirements.html Supported resources and requirements>
-- in the /Compute Optimizer User Guide/.
module Amazonka.ComputeOptimizer.GetEBSVolumeRecommendations
  ( -- * Creating a Request
    GetEBSVolumeRecommendations (..),
    newGetEBSVolumeRecommendations,

    -- * Request Lenses
    getEBSVolumeRecommendations_accountIds,
    getEBSVolumeRecommendations_filters,
    getEBSVolumeRecommendations_maxResults,
    getEBSVolumeRecommendations_nextToken,
    getEBSVolumeRecommendations_volumeArns,

    -- * Destructuring the Response
    GetEBSVolumeRecommendationsResponse (..),
    newGetEBSVolumeRecommendationsResponse,

    -- * Response Lenses
    getEBSVolumeRecommendationsResponse_errors,
    getEBSVolumeRecommendationsResponse_nextToken,
    getEBSVolumeRecommendationsResponse_volumeRecommendations,
    getEBSVolumeRecommendationsResponse_httpStatus,
  )
where

import Amazonka.ComputeOptimizer.Types
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
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:/ 'newGetEBSVolumeRecommendations' smart constructor.
data GetEBSVolumeRecommendations = GetEBSVolumeRecommendations'
  { -- | The ID of the Amazon Web Services account for which to return volume
    -- recommendations.
    --
    -- If your account is the management account of an organization, use this
    -- parameter to specify the member account for which you want to return
    -- volume recommendations.
    --
    -- Only one account ID can be specified per request.
    GetEBSVolumeRecommendations -> Maybe [Text]
accountIds :: Prelude.Maybe [Prelude.Text],
    -- | An array of objects to specify a filter that returns a more specific
    -- list of volume recommendations.
    GetEBSVolumeRecommendations -> Maybe [EBSFilter]
filters :: Prelude.Maybe [EBSFilter],
    -- | The maximum number of volume recommendations to return with a single
    -- request.
    --
    -- To retrieve the remaining results, make another request with the
    -- returned @nextToken@ value.
    GetEBSVolumeRecommendations -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
    -- | The token to advance to the next page of volume recommendations.
    GetEBSVolumeRecommendations -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The Amazon Resource Name (ARN) of the volumes for which to return
    -- recommendations.
    GetEBSVolumeRecommendations -> Maybe [Text]
volumeArns :: Prelude.Maybe [Prelude.Text]
  }
  deriving (GetEBSVolumeRecommendations -> GetEBSVolumeRecommendations -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetEBSVolumeRecommendations -> GetEBSVolumeRecommendations -> Bool
$c/= :: GetEBSVolumeRecommendations -> GetEBSVolumeRecommendations -> Bool
== :: GetEBSVolumeRecommendations -> GetEBSVolumeRecommendations -> Bool
$c== :: GetEBSVolumeRecommendations -> GetEBSVolumeRecommendations -> Bool
Prelude.Eq, ReadPrec [GetEBSVolumeRecommendations]
ReadPrec GetEBSVolumeRecommendations
Int -> ReadS GetEBSVolumeRecommendations
ReadS [GetEBSVolumeRecommendations]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetEBSVolumeRecommendations]
$creadListPrec :: ReadPrec [GetEBSVolumeRecommendations]
readPrec :: ReadPrec GetEBSVolumeRecommendations
$creadPrec :: ReadPrec GetEBSVolumeRecommendations
readList :: ReadS [GetEBSVolumeRecommendations]
$creadList :: ReadS [GetEBSVolumeRecommendations]
readsPrec :: Int -> ReadS GetEBSVolumeRecommendations
$creadsPrec :: Int -> ReadS GetEBSVolumeRecommendations
Prelude.Read, Int -> GetEBSVolumeRecommendations -> ShowS
[GetEBSVolumeRecommendations] -> ShowS
GetEBSVolumeRecommendations -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetEBSVolumeRecommendations] -> ShowS
$cshowList :: [GetEBSVolumeRecommendations] -> ShowS
show :: GetEBSVolumeRecommendations -> String
$cshow :: GetEBSVolumeRecommendations -> String
showsPrec :: Int -> GetEBSVolumeRecommendations -> ShowS
$cshowsPrec :: Int -> GetEBSVolumeRecommendations -> ShowS
Prelude.Show, forall x.
Rep GetEBSVolumeRecommendations x -> GetEBSVolumeRecommendations
forall x.
GetEBSVolumeRecommendations -> Rep GetEBSVolumeRecommendations x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetEBSVolumeRecommendations x -> GetEBSVolumeRecommendations
$cfrom :: forall x.
GetEBSVolumeRecommendations -> Rep GetEBSVolumeRecommendations x
Prelude.Generic)

-- |
-- Create a value of 'GetEBSVolumeRecommendations' 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:
--
-- 'accountIds', 'getEBSVolumeRecommendations_accountIds' - The ID of the Amazon Web Services account for which to return volume
-- recommendations.
--
-- If your account is the management account of an organization, use this
-- parameter to specify the member account for which you want to return
-- volume recommendations.
--
-- Only one account ID can be specified per request.
--
-- 'filters', 'getEBSVolumeRecommendations_filters' - An array of objects to specify a filter that returns a more specific
-- list of volume recommendations.
--
-- 'maxResults', 'getEBSVolumeRecommendations_maxResults' - The maximum number of volume recommendations to return with a single
-- request.
--
-- To retrieve the remaining results, make another request with the
-- returned @nextToken@ value.
--
-- 'nextToken', 'getEBSVolumeRecommendations_nextToken' - The token to advance to the next page of volume recommendations.
--
-- 'volumeArns', 'getEBSVolumeRecommendations_volumeArns' - The Amazon Resource Name (ARN) of the volumes for which to return
-- recommendations.
newGetEBSVolumeRecommendations ::
  GetEBSVolumeRecommendations
newGetEBSVolumeRecommendations :: GetEBSVolumeRecommendations
newGetEBSVolumeRecommendations =
  GetEBSVolumeRecommendations'
    { $sel:accountIds:GetEBSVolumeRecommendations' :: Maybe [Text]
accountIds =
        forall a. Maybe a
Prelude.Nothing,
      $sel:filters:GetEBSVolumeRecommendations' :: Maybe [EBSFilter]
filters = forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:GetEBSVolumeRecommendations' :: Maybe Natural
maxResults = forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:GetEBSVolumeRecommendations' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
      $sel:volumeArns:GetEBSVolumeRecommendations' :: Maybe [Text]
volumeArns = forall a. Maybe a
Prelude.Nothing
    }

-- | The ID of the Amazon Web Services account for which to return volume
-- recommendations.
--
-- If your account is the management account of an organization, use this
-- parameter to specify the member account for which you want to return
-- volume recommendations.
--
-- Only one account ID can be specified per request.
getEBSVolumeRecommendations_accountIds :: Lens.Lens' GetEBSVolumeRecommendations (Prelude.Maybe [Prelude.Text])
getEBSVolumeRecommendations_accountIds :: Lens' GetEBSVolumeRecommendations (Maybe [Text])
getEBSVolumeRecommendations_accountIds = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetEBSVolumeRecommendations' {Maybe [Text]
accountIds :: Maybe [Text]
$sel:accountIds:GetEBSVolumeRecommendations' :: GetEBSVolumeRecommendations -> Maybe [Text]
accountIds} -> Maybe [Text]
accountIds) (\s :: GetEBSVolumeRecommendations
s@GetEBSVolumeRecommendations' {} Maybe [Text]
a -> GetEBSVolumeRecommendations
s {$sel:accountIds:GetEBSVolumeRecommendations' :: Maybe [Text]
accountIds = Maybe [Text]
a} :: GetEBSVolumeRecommendations) 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

-- | An array of objects to specify a filter that returns a more specific
-- list of volume recommendations.
getEBSVolumeRecommendations_filters :: Lens.Lens' GetEBSVolumeRecommendations (Prelude.Maybe [EBSFilter])
getEBSVolumeRecommendations_filters :: Lens' GetEBSVolumeRecommendations (Maybe [EBSFilter])
getEBSVolumeRecommendations_filters = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetEBSVolumeRecommendations' {Maybe [EBSFilter]
filters :: Maybe [EBSFilter]
$sel:filters:GetEBSVolumeRecommendations' :: GetEBSVolumeRecommendations -> Maybe [EBSFilter]
filters} -> Maybe [EBSFilter]
filters) (\s :: GetEBSVolumeRecommendations
s@GetEBSVolumeRecommendations' {} Maybe [EBSFilter]
a -> GetEBSVolumeRecommendations
s {$sel:filters:GetEBSVolumeRecommendations' :: Maybe [EBSFilter]
filters = Maybe [EBSFilter]
a} :: GetEBSVolumeRecommendations) 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

-- | The maximum number of volume recommendations to return with a single
-- request.
--
-- To retrieve the remaining results, make another request with the
-- returned @nextToken@ value.
getEBSVolumeRecommendations_maxResults :: Lens.Lens' GetEBSVolumeRecommendations (Prelude.Maybe Prelude.Natural)
getEBSVolumeRecommendations_maxResults :: Lens' GetEBSVolumeRecommendations (Maybe Natural)
getEBSVolumeRecommendations_maxResults = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetEBSVolumeRecommendations' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:GetEBSVolumeRecommendations' :: GetEBSVolumeRecommendations -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: GetEBSVolumeRecommendations
s@GetEBSVolumeRecommendations' {} Maybe Natural
a -> GetEBSVolumeRecommendations
s {$sel:maxResults:GetEBSVolumeRecommendations' :: Maybe Natural
maxResults = Maybe Natural
a} :: GetEBSVolumeRecommendations)

-- | The token to advance to the next page of volume recommendations.
getEBSVolumeRecommendations_nextToken :: Lens.Lens' GetEBSVolumeRecommendations (Prelude.Maybe Prelude.Text)
getEBSVolumeRecommendations_nextToken :: Lens' GetEBSVolumeRecommendations (Maybe Text)
getEBSVolumeRecommendations_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetEBSVolumeRecommendations' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:GetEBSVolumeRecommendations' :: GetEBSVolumeRecommendations -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: GetEBSVolumeRecommendations
s@GetEBSVolumeRecommendations' {} Maybe Text
a -> GetEBSVolumeRecommendations
s {$sel:nextToken:GetEBSVolumeRecommendations' :: Maybe Text
nextToken = Maybe Text
a} :: GetEBSVolumeRecommendations)

-- | The Amazon Resource Name (ARN) of the volumes for which to return
-- recommendations.
getEBSVolumeRecommendations_volumeArns :: Lens.Lens' GetEBSVolumeRecommendations (Prelude.Maybe [Prelude.Text])
getEBSVolumeRecommendations_volumeArns :: Lens' GetEBSVolumeRecommendations (Maybe [Text])
getEBSVolumeRecommendations_volumeArns = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetEBSVolumeRecommendations' {Maybe [Text]
volumeArns :: Maybe [Text]
$sel:volumeArns:GetEBSVolumeRecommendations' :: GetEBSVolumeRecommendations -> Maybe [Text]
volumeArns} -> Maybe [Text]
volumeArns) (\s :: GetEBSVolumeRecommendations
s@GetEBSVolumeRecommendations' {} Maybe [Text]
a -> GetEBSVolumeRecommendations
s {$sel:volumeArns:GetEBSVolumeRecommendations' :: Maybe [Text]
volumeArns = Maybe [Text]
a} :: GetEBSVolumeRecommendations) 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

instance Core.AWSRequest GetEBSVolumeRecommendations where
  type
    AWSResponse GetEBSVolumeRecommendations =
      GetEBSVolumeRecommendationsResponse
  request :: (Service -> Service)
-> GetEBSVolumeRecommendations
-> Request GetEBSVolumeRecommendations
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 GetEBSVolumeRecommendations
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse GetEBSVolumeRecommendations)))
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 [GetRecommendationError]
-> Maybe Text
-> Maybe [VolumeRecommendation]
-> Int
-> GetEBSVolumeRecommendationsResponse
GetEBSVolumeRecommendationsResponse'
            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
"errors" 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
"nextToken")
            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
"volumeRecommendations"
                            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.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance Prelude.Hashable GetEBSVolumeRecommendations where
  hashWithSalt :: Int -> GetEBSVolumeRecommendations -> Int
hashWithSalt Int
_salt GetEBSVolumeRecommendations' {Maybe Natural
Maybe [Text]
Maybe [EBSFilter]
Maybe Text
volumeArns :: Maybe [Text]
nextToken :: Maybe Text
maxResults :: Maybe Natural
filters :: Maybe [EBSFilter]
accountIds :: Maybe [Text]
$sel:volumeArns:GetEBSVolumeRecommendations' :: GetEBSVolumeRecommendations -> Maybe [Text]
$sel:nextToken:GetEBSVolumeRecommendations' :: GetEBSVolumeRecommendations -> Maybe Text
$sel:maxResults:GetEBSVolumeRecommendations' :: GetEBSVolumeRecommendations -> Maybe Natural
$sel:filters:GetEBSVolumeRecommendations' :: GetEBSVolumeRecommendations -> Maybe [EBSFilter]
$sel:accountIds:GetEBSVolumeRecommendations' :: GetEBSVolumeRecommendations -> Maybe [Text]
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Text]
accountIds
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [EBSFilter]
filters
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
maxResults
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
nextToken
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Text]
volumeArns

instance Prelude.NFData GetEBSVolumeRecommendations where
  rnf :: GetEBSVolumeRecommendations -> ()
rnf GetEBSVolumeRecommendations' {Maybe Natural
Maybe [Text]
Maybe [EBSFilter]
Maybe Text
volumeArns :: Maybe [Text]
nextToken :: Maybe Text
maxResults :: Maybe Natural
filters :: Maybe [EBSFilter]
accountIds :: Maybe [Text]
$sel:volumeArns:GetEBSVolumeRecommendations' :: GetEBSVolumeRecommendations -> Maybe [Text]
$sel:nextToken:GetEBSVolumeRecommendations' :: GetEBSVolumeRecommendations -> Maybe Text
$sel:maxResults:GetEBSVolumeRecommendations' :: GetEBSVolumeRecommendations -> Maybe Natural
$sel:filters:GetEBSVolumeRecommendations' :: GetEBSVolumeRecommendations -> Maybe [EBSFilter]
$sel:accountIds:GetEBSVolumeRecommendations' :: GetEBSVolumeRecommendations -> Maybe [Text]
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe [Text]
accountIds
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [EBSFilter]
filters
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
maxResults
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
nextToken
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Text]
volumeArns

instance Data.ToHeaders GetEBSVolumeRecommendations where
  toHeaders :: GetEBSVolumeRecommendations -> 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
"ComputeOptimizerService.GetEBSVolumeRecommendations" ::
                          Prelude.ByteString
                      ),
            HeaderName
"Content-Type"
              forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.0" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Data.ToJSON GetEBSVolumeRecommendations where
  toJSON :: GetEBSVolumeRecommendations -> Value
toJSON GetEBSVolumeRecommendations' {Maybe Natural
Maybe [Text]
Maybe [EBSFilter]
Maybe Text
volumeArns :: Maybe [Text]
nextToken :: Maybe Text
maxResults :: Maybe Natural
filters :: Maybe [EBSFilter]
accountIds :: Maybe [Text]
$sel:volumeArns:GetEBSVolumeRecommendations' :: GetEBSVolumeRecommendations -> Maybe [Text]
$sel:nextToken:GetEBSVolumeRecommendations' :: GetEBSVolumeRecommendations -> Maybe Text
$sel:maxResults:GetEBSVolumeRecommendations' :: GetEBSVolumeRecommendations -> Maybe Natural
$sel:filters:GetEBSVolumeRecommendations' :: GetEBSVolumeRecommendations -> Maybe [EBSFilter]
$sel:accountIds:GetEBSVolumeRecommendations' :: GetEBSVolumeRecommendations -> Maybe [Text]
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"accountIds" 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]
accountIds,
            (Key
"filters" 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 [EBSFilter]
filters,
            (Key
"maxResults" 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
maxResults,
            (Key
"nextToken" 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
nextToken,
            (Key
"volumeArns" 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]
volumeArns
          ]
      )

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

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

-- | /See:/ 'newGetEBSVolumeRecommendationsResponse' smart constructor.
data GetEBSVolumeRecommendationsResponse = GetEBSVolumeRecommendationsResponse'
  { -- | An array of objects that describe errors of the request.
    --
    -- For example, an error is returned if you request recommendations for an
    -- unsupported volume.
    GetEBSVolumeRecommendationsResponse
-> Maybe [GetRecommendationError]
errors :: Prelude.Maybe [GetRecommendationError],
    -- | The token to use to advance to the next page of volume recommendations.
    --
    -- This value is null when there are no more pages of volume
    -- recommendations to return.
    GetEBSVolumeRecommendationsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | An array of objects that describe volume recommendations.
    GetEBSVolumeRecommendationsResponse -> Maybe [VolumeRecommendation]
volumeRecommendations :: Prelude.Maybe [VolumeRecommendation],
    -- | The response's http status code.
    GetEBSVolumeRecommendationsResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (GetEBSVolumeRecommendationsResponse
-> GetEBSVolumeRecommendationsResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetEBSVolumeRecommendationsResponse
-> GetEBSVolumeRecommendationsResponse -> Bool
$c/= :: GetEBSVolumeRecommendationsResponse
-> GetEBSVolumeRecommendationsResponse -> Bool
== :: GetEBSVolumeRecommendationsResponse
-> GetEBSVolumeRecommendationsResponse -> Bool
$c== :: GetEBSVolumeRecommendationsResponse
-> GetEBSVolumeRecommendationsResponse -> Bool
Prelude.Eq, ReadPrec [GetEBSVolumeRecommendationsResponse]
ReadPrec GetEBSVolumeRecommendationsResponse
Int -> ReadS GetEBSVolumeRecommendationsResponse
ReadS [GetEBSVolumeRecommendationsResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetEBSVolumeRecommendationsResponse]
$creadListPrec :: ReadPrec [GetEBSVolumeRecommendationsResponse]
readPrec :: ReadPrec GetEBSVolumeRecommendationsResponse
$creadPrec :: ReadPrec GetEBSVolumeRecommendationsResponse
readList :: ReadS [GetEBSVolumeRecommendationsResponse]
$creadList :: ReadS [GetEBSVolumeRecommendationsResponse]
readsPrec :: Int -> ReadS GetEBSVolumeRecommendationsResponse
$creadsPrec :: Int -> ReadS GetEBSVolumeRecommendationsResponse
Prelude.Read, Int -> GetEBSVolumeRecommendationsResponse -> ShowS
[GetEBSVolumeRecommendationsResponse] -> ShowS
GetEBSVolumeRecommendationsResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetEBSVolumeRecommendationsResponse] -> ShowS
$cshowList :: [GetEBSVolumeRecommendationsResponse] -> ShowS
show :: GetEBSVolumeRecommendationsResponse -> String
$cshow :: GetEBSVolumeRecommendationsResponse -> String
showsPrec :: Int -> GetEBSVolumeRecommendationsResponse -> ShowS
$cshowsPrec :: Int -> GetEBSVolumeRecommendationsResponse -> ShowS
Prelude.Show, forall x.
Rep GetEBSVolumeRecommendationsResponse x
-> GetEBSVolumeRecommendationsResponse
forall x.
GetEBSVolumeRecommendationsResponse
-> Rep GetEBSVolumeRecommendationsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetEBSVolumeRecommendationsResponse x
-> GetEBSVolumeRecommendationsResponse
$cfrom :: forall x.
GetEBSVolumeRecommendationsResponse
-> Rep GetEBSVolumeRecommendationsResponse x
Prelude.Generic)

-- |
-- Create a value of 'GetEBSVolumeRecommendationsResponse' 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:
--
-- 'errors', 'getEBSVolumeRecommendationsResponse_errors' - An array of objects that describe errors of the request.
--
-- For example, an error is returned if you request recommendations for an
-- unsupported volume.
--
-- 'nextToken', 'getEBSVolumeRecommendationsResponse_nextToken' - The token to use to advance to the next page of volume recommendations.
--
-- This value is null when there are no more pages of volume
-- recommendations to return.
--
-- 'volumeRecommendations', 'getEBSVolumeRecommendationsResponse_volumeRecommendations' - An array of objects that describe volume recommendations.
--
-- 'httpStatus', 'getEBSVolumeRecommendationsResponse_httpStatus' - The response's http status code.
newGetEBSVolumeRecommendationsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  GetEBSVolumeRecommendationsResponse
newGetEBSVolumeRecommendationsResponse :: Int -> GetEBSVolumeRecommendationsResponse
newGetEBSVolumeRecommendationsResponse Int
pHttpStatus_ =
  GetEBSVolumeRecommendationsResponse'
    { $sel:errors:GetEBSVolumeRecommendationsResponse' :: Maybe [GetRecommendationError]
errors =
        forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:GetEBSVolumeRecommendationsResponse' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
      $sel:volumeRecommendations:GetEBSVolumeRecommendationsResponse' :: Maybe [VolumeRecommendation]
volumeRecommendations =
        forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:GetEBSVolumeRecommendationsResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | An array of objects that describe errors of the request.
--
-- For example, an error is returned if you request recommendations for an
-- unsupported volume.
getEBSVolumeRecommendationsResponse_errors :: Lens.Lens' GetEBSVolumeRecommendationsResponse (Prelude.Maybe [GetRecommendationError])
getEBSVolumeRecommendationsResponse_errors :: Lens'
  GetEBSVolumeRecommendationsResponse
  (Maybe [GetRecommendationError])
getEBSVolumeRecommendationsResponse_errors = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetEBSVolumeRecommendationsResponse' {Maybe [GetRecommendationError]
errors :: Maybe [GetRecommendationError]
$sel:errors:GetEBSVolumeRecommendationsResponse' :: GetEBSVolumeRecommendationsResponse
-> Maybe [GetRecommendationError]
errors} -> Maybe [GetRecommendationError]
errors) (\s :: GetEBSVolumeRecommendationsResponse
s@GetEBSVolumeRecommendationsResponse' {} Maybe [GetRecommendationError]
a -> GetEBSVolumeRecommendationsResponse
s {$sel:errors:GetEBSVolumeRecommendationsResponse' :: Maybe [GetRecommendationError]
errors = Maybe [GetRecommendationError]
a} :: GetEBSVolumeRecommendationsResponse) 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

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

-- | An array of objects that describe volume recommendations.
getEBSVolumeRecommendationsResponse_volumeRecommendations :: Lens.Lens' GetEBSVolumeRecommendationsResponse (Prelude.Maybe [VolumeRecommendation])
getEBSVolumeRecommendationsResponse_volumeRecommendations :: Lens'
  GetEBSVolumeRecommendationsResponse (Maybe [VolumeRecommendation])
getEBSVolumeRecommendationsResponse_volumeRecommendations = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetEBSVolumeRecommendationsResponse' {Maybe [VolumeRecommendation]
volumeRecommendations :: Maybe [VolumeRecommendation]
$sel:volumeRecommendations:GetEBSVolumeRecommendationsResponse' :: GetEBSVolumeRecommendationsResponse -> Maybe [VolumeRecommendation]
volumeRecommendations} -> Maybe [VolumeRecommendation]
volumeRecommendations) (\s :: GetEBSVolumeRecommendationsResponse
s@GetEBSVolumeRecommendationsResponse' {} Maybe [VolumeRecommendation]
a -> GetEBSVolumeRecommendationsResponse
s {$sel:volumeRecommendations:GetEBSVolumeRecommendationsResponse' :: Maybe [VolumeRecommendation]
volumeRecommendations = Maybe [VolumeRecommendation]
a} :: GetEBSVolumeRecommendationsResponse) 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

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

instance
  Prelude.NFData
    GetEBSVolumeRecommendationsResponse
  where
  rnf :: GetEBSVolumeRecommendationsResponse -> ()
rnf GetEBSVolumeRecommendationsResponse' {Int
Maybe [GetRecommendationError]
Maybe [VolumeRecommendation]
Maybe Text
httpStatus :: Int
volumeRecommendations :: Maybe [VolumeRecommendation]
nextToken :: Maybe Text
errors :: Maybe [GetRecommendationError]
$sel:httpStatus:GetEBSVolumeRecommendationsResponse' :: GetEBSVolumeRecommendationsResponse -> Int
$sel:volumeRecommendations:GetEBSVolumeRecommendationsResponse' :: GetEBSVolumeRecommendationsResponse -> Maybe [VolumeRecommendation]
$sel:nextToken:GetEBSVolumeRecommendationsResponse' :: GetEBSVolumeRecommendationsResponse -> Maybe Text
$sel:errors:GetEBSVolumeRecommendationsResponse' :: GetEBSVolumeRecommendationsResponse
-> Maybe [GetRecommendationError]
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe [GetRecommendationError]
errors
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
nextToken
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [VolumeRecommendation]
volumeRecommendations
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus