{-# 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 #-}
module Amazonka.ComputeOptimizer.GetEC2InstanceRecommendations
(
GetEC2InstanceRecommendations (..),
newGetEC2InstanceRecommendations,
getEC2InstanceRecommendations_accountIds,
getEC2InstanceRecommendations_filters,
getEC2InstanceRecommendations_recommendationPreferences,
getEC2InstanceRecommendations_nextToken,
getEC2InstanceRecommendations_instanceArns,
getEC2InstanceRecommendations_maxResults,
GetEC2InstanceRecommendationsResponse (..),
newGetEC2InstanceRecommendationsResponse,
getEC2InstanceRecommendationsResponse_nextToken,
getEC2InstanceRecommendationsResponse_errors,
getEC2InstanceRecommendationsResponse_instanceRecommendations,
getEC2InstanceRecommendationsResponse_httpStatus,
)
where
import Amazonka.ComputeOptimizer.Types
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data GetEC2InstanceRecommendations = GetEC2InstanceRecommendations'
{
GetEC2InstanceRecommendations -> Maybe [Text]
accountIds :: Prelude.Maybe [Prelude.Text],
GetEC2InstanceRecommendations -> Maybe [Filter]
filters :: Prelude.Maybe [Filter],
GetEC2InstanceRecommendations -> Maybe RecommendationPreferences
recommendationPreferences :: Prelude.Maybe RecommendationPreferences,
GetEC2InstanceRecommendations -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
GetEC2InstanceRecommendations -> Maybe [Text]
instanceArns :: Prelude.Maybe [Prelude.Text],
GetEC2InstanceRecommendations -> Maybe Int
maxResults :: Prelude.Maybe Prelude.Int
}
deriving (GetEC2InstanceRecommendations
-> GetEC2InstanceRecommendations -> Bool
(GetEC2InstanceRecommendations
-> GetEC2InstanceRecommendations -> Bool)
-> (GetEC2InstanceRecommendations
-> GetEC2InstanceRecommendations -> Bool)
-> Eq GetEC2InstanceRecommendations
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetEC2InstanceRecommendations
-> GetEC2InstanceRecommendations -> Bool
$c/= :: GetEC2InstanceRecommendations
-> GetEC2InstanceRecommendations -> Bool
== :: GetEC2InstanceRecommendations
-> GetEC2InstanceRecommendations -> Bool
$c== :: GetEC2InstanceRecommendations
-> GetEC2InstanceRecommendations -> Bool
Prelude.Eq, ReadPrec [GetEC2InstanceRecommendations]
ReadPrec GetEC2InstanceRecommendations
Int -> ReadS GetEC2InstanceRecommendations
ReadS [GetEC2InstanceRecommendations]
(Int -> ReadS GetEC2InstanceRecommendations)
-> ReadS [GetEC2InstanceRecommendations]
-> ReadPrec GetEC2InstanceRecommendations
-> ReadPrec [GetEC2InstanceRecommendations]
-> Read GetEC2InstanceRecommendations
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetEC2InstanceRecommendations]
$creadListPrec :: ReadPrec [GetEC2InstanceRecommendations]
readPrec :: ReadPrec GetEC2InstanceRecommendations
$creadPrec :: ReadPrec GetEC2InstanceRecommendations
readList :: ReadS [GetEC2InstanceRecommendations]
$creadList :: ReadS [GetEC2InstanceRecommendations]
readsPrec :: Int -> ReadS GetEC2InstanceRecommendations
$creadsPrec :: Int -> ReadS GetEC2InstanceRecommendations
Prelude.Read, Int -> GetEC2InstanceRecommendations -> ShowS
[GetEC2InstanceRecommendations] -> ShowS
GetEC2InstanceRecommendations -> String
(Int -> GetEC2InstanceRecommendations -> ShowS)
-> (GetEC2InstanceRecommendations -> String)
-> ([GetEC2InstanceRecommendations] -> ShowS)
-> Show GetEC2InstanceRecommendations
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetEC2InstanceRecommendations] -> ShowS
$cshowList :: [GetEC2InstanceRecommendations] -> ShowS
show :: GetEC2InstanceRecommendations -> String
$cshow :: GetEC2InstanceRecommendations -> String
showsPrec :: Int -> GetEC2InstanceRecommendations -> ShowS
$cshowsPrec :: Int -> GetEC2InstanceRecommendations -> ShowS
Prelude.Show, (forall x.
GetEC2InstanceRecommendations
-> Rep GetEC2InstanceRecommendations x)
-> (forall x.
Rep GetEC2InstanceRecommendations x
-> GetEC2InstanceRecommendations)
-> Generic GetEC2InstanceRecommendations
forall x.
Rep GetEC2InstanceRecommendations x
-> GetEC2InstanceRecommendations
forall x.
GetEC2InstanceRecommendations
-> Rep GetEC2InstanceRecommendations x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetEC2InstanceRecommendations x
-> GetEC2InstanceRecommendations
$cfrom :: forall x.
GetEC2InstanceRecommendations
-> Rep GetEC2InstanceRecommendations x
Prelude.Generic)
newGetEC2InstanceRecommendations ::
GetEC2InstanceRecommendations
newGetEC2InstanceRecommendations :: GetEC2InstanceRecommendations
newGetEC2InstanceRecommendations =
GetEC2InstanceRecommendations' :: Maybe [Text]
-> Maybe [Filter]
-> Maybe RecommendationPreferences
-> Maybe Text
-> Maybe [Text]
-> Maybe Int
-> GetEC2InstanceRecommendations
GetEC2InstanceRecommendations'
{ $sel:accountIds:GetEC2InstanceRecommendations' :: Maybe [Text]
accountIds =
Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
$sel:filters:GetEC2InstanceRecommendations' :: Maybe [Filter]
filters = Maybe [Filter]
forall a. Maybe a
Prelude.Nothing,
$sel:recommendationPreferences:GetEC2InstanceRecommendations' :: Maybe RecommendationPreferences
recommendationPreferences = Maybe RecommendationPreferences
forall a. Maybe a
Prelude.Nothing,
$sel:nextToken:GetEC2InstanceRecommendations' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:instanceArns:GetEC2InstanceRecommendations' :: Maybe [Text]
instanceArns = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
$sel:maxResults:GetEC2InstanceRecommendations' :: Maybe Int
maxResults = Maybe Int
forall a. Maybe a
Prelude.Nothing
}
getEC2InstanceRecommendations_accountIds :: Lens.Lens' GetEC2InstanceRecommendations (Prelude.Maybe [Prelude.Text])
getEC2InstanceRecommendations_accountIds :: (Maybe [Text] -> f (Maybe [Text]))
-> GetEC2InstanceRecommendations -> f GetEC2InstanceRecommendations
getEC2InstanceRecommendations_accountIds = (GetEC2InstanceRecommendations -> Maybe [Text])
-> (GetEC2InstanceRecommendations
-> Maybe [Text] -> GetEC2InstanceRecommendations)
-> Lens
GetEC2InstanceRecommendations
GetEC2InstanceRecommendations
(Maybe [Text])
(Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetEC2InstanceRecommendations' {Maybe [Text]
accountIds :: Maybe [Text]
$sel:accountIds:GetEC2InstanceRecommendations' :: GetEC2InstanceRecommendations -> Maybe [Text]
accountIds} -> Maybe [Text]
accountIds) (\s :: GetEC2InstanceRecommendations
s@GetEC2InstanceRecommendations' {} Maybe [Text]
a -> GetEC2InstanceRecommendations
s {$sel:accountIds:GetEC2InstanceRecommendations' :: Maybe [Text]
accountIds = Maybe [Text]
a} :: GetEC2InstanceRecommendations) ((Maybe [Text] -> f (Maybe [Text]))
-> GetEC2InstanceRecommendations
-> f GetEC2InstanceRecommendations)
-> ((Maybe [Text] -> f (Maybe [Text]))
-> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> GetEC2InstanceRecommendations
-> f GetEC2InstanceRecommendations
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [Text]) (Maybe [Text]) (Maybe [Text])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso [Text] [Text] [Text] [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
getEC2InstanceRecommendations_filters :: Lens.Lens' GetEC2InstanceRecommendations (Prelude.Maybe [Filter])
getEC2InstanceRecommendations_filters :: (Maybe [Filter] -> f (Maybe [Filter]))
-> GetEC2InstanceRecommendations -> f GetEC2InstanceRecommendations
getEC2InstanceRecommendations_filters = (GetEC2InstanceRecommendations -> Maybe [Filter])
-> (GetEC2InstanceRecommendations
-> Maybe [Filter] -> GetEC2InstanceRecommendations)
-> Lens
GetEC2InstanceRecommendations
GetEC2InstanceRecommendations
(Maybe [Filter])
(Maybe [Filter])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetEC2InstanceRecommendations' {Maybe [Filter]
filters :: Maybe [Filter]
$sel:filters:GetEC2InstanceRecommendations' :: GetEC2InstanceRecommendations -> Maybe [Filter]
filters} -> Maybe [Filter]
filters) (\s :: GetEC2InstanceRecommendations
s@GetEC2InstanceRecommendations' {} Maybe [Filter]
a -> GetEC2InstanceRecommendations
s {$sel:filters:GetEC2InstanceRecommendations' :: Maybe [Filter]
filters = Maybe [Filter]
a} :: GetEC2InstanceRecommendations) ((Maybe [Filter] -> f (Maybe [Filter]))
-> GetEC2InstanceRecommendations
-> f GetEC2InstanceRecommendations)
-> ((Maybe [Filter] -> f (Maybe [Filter]))
-> Maybe [Filter] -> f (Maybe [Filter]))
-> (Maybe [Filter] -> f (Maybe [Filter]))
-> GetEC2InstanceRecommendations
-> f GetEC2InstanceRecommendations
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Filter] [Filter] [Filter] [Filter]
-> Iso
(Maybe [Filter]) (Maybe [Filter]) (Maybe [Filter]) (Maybe [Filter])
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 [Filter] [Filter] [Filter] [Filter]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
getEC2InstanceRecommendations_recommendationPreferences :: Lens.Lens' GetEC2InstanceRecommendations (Prelude.Maybe RecommendationPreferences)
getEC2InstanceRecommendations_recommendationPreferences :: (Maybe RecommendationPreferences
-> f (Maybe RecommendationPreferences))
-> GetEC2InstanceRecommendations -> f GetEC2InstanceRecommendations
getEC2InstanceRecommendations_recommendationPreferences = (GetEC2InstanceRecommendations -> Maybe RecommendationPreferences)
-> (GetEC2InstanceRecommendations
-> Maybe RecommendationPreferences
-> GetEC2InstanceRecommendations)
-> Lens
GetEC2InstanceRecommendations
GetEC2InstanceRecommendations
(Maybe RecommendationPreferences)
(Maybe RecommendationPreferences)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetEC2InstanceRecommendations' {Maybe RecommendationPreferences
recommendationPreferences :: Maybe RecommendationPreferences
$sel:recommendationPreferences:GetEC2InstanceRecommendations' :: GetEC2InstanceRecommendations -> Maybe RecommendationPreferences
recommendationPreferences} -> Maybe RecommendationPreferences
recommendationPreferences) (\s :: GetEC2InstanceRecommendations
s@GetEC2InstanceRecommendations' {} Maybe RecommendationPreferences
a -> GetEC2InstanceRecommendations
s {$sel:recommendationPreferences:GetEC2InstanceRecommendations' :: Maybe RecommendationPreferences
recommendationPreferences = Maybe RecommendationPreferences
a} :: GetEC2InstanceRecommendations)
getEC2InstanceRecommendations_nextToken :: Lens.Lens' GetEC2InstanceRecommendations (Prelude.Maybe Prelude.Text)
getEC2InstanceRecommendations_nextToken :: (Maybe Text -> f (Maybe Text))
-> GetEC2InstanceRecommendations -> f GetEC2InstanceRecommendations
getEC2InstanceRecommendations_nextToken = (GetEC2InstanceRecommendations -> Maybe Text)
-> (GetEC2InstanceRecommendations
-> Maybe Text -> GetEC2InstanceRecommendations)
-> Lens
GetEC2InstanceRecommendations
GetEC2InstanceRecommendations
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetEC2InstanceRecommendations' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:GetEC2InstanceRecommendations' :: GetEC2InstanceRecommendations -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: GetEC2InstanceRecommendations
s@GetEC2InstanceRecommendations' {} Maybe Text
a -> GetEC2InstanceRecommendations
s {$sel:nextToken:GetEC2InstanceRecommendations' :: Maybe Text
nextToken = Maybe Text
a} :: GetEC2InstanceRecommendations)
getEC2InstanceRecommendations_instanceArns :: Lens.Lens' GetEC2InstanceRecommendations (Prelude.Maybe [Prelude.Text])
getEC2InstanceRecommendations_instanceArns :: (Maybe [Text] -> f (Maybe [Text]))
-> GetEC2InstanceRecommendations -> f GetEC2InstanceRecommendations
getEC2InstanceRecommendations_instanceArns = (GetEC2InstanceRecommendations -> Maybe [Text])
-> (GetEC2InstanceRecommendations
-> Maybe [Text] -> GetEC2InstanceRecommendations)
-> Lens
GetEC2InstanceRecommendations
GetEC2InstanceRecommendations
(Maybe [Text])
(Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetEC2InstanceRecommendations' {Maybe [Text]
instanceArns :: Maybe [Text]
$sel:instanceArns:GetEC2InstanceRecommendations' :: GetEC2InstanceRecommendations -> Maybe [Text]
instanceArns} -> Maybe [Text]
instanceArns) (\s :: GetEC2InstanceRecommendations
s@GetEC2InstanceRecommendations' {} Maybe [Text]
a -> GetEC2InstanceRecommendations
s {$sel:instanceArns:GetEC2InstanceRecommendations' :: Maybe [Text]
instanceArns = Maybe [Text]
a} :: GetEC2InstanceRecommendations) ((Maybe [Text] -> f (Maybe [Text]))
-> GetEC2InstanceRecommendations
-> f GetEC2InstanceRecommendations)
-> ((Maybe [Text] -> f (Maybe [Text]))
-> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> GetEC2InstanceRecommendations
-> f GetEC2InstanceRecommendations
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [Text]) (Maybe [Text]) (Maybe [Text])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso [Text] [Text] [Text] [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
getEC2InstanceRecommendations_maxResults :: Lens.Lens' GetEC2InstanceRecommendations (Prelude.Maybe Prelude.Int)
getEC2InstanceRecommendations_maxResults :: (Maybe Int -> f (Maybe Int))
-> GetEC2InstanceRecommendations -> f GetEC2InstanceRecommendations
getEC2InstanceRecommendations_maxResults = (GetEC2InstanceRecommendations -> Maybe Int)
-> (GetEC2InstanceRecommendations
-> Maybe Int -> GetEC2InstanceRecommendations)
-> Lens
GetEC2InstanceRecommendations
GetEC2InstanceRecommendations
(Maybe Int)
(Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetEC2InstanceRecommendations' {Maybe Int
maxResults :: Maybe Int
$sel:maxResults:GetEC2InstanceRecommendations' :: GetEC2InstanceRecommendations -> Maybe Int
maxResults} -> Maybe Int
maxResults) (\s :: GetEC2InstanceRecommendations
s@GetEC2InstanceRecommendations' {} Maybe Int
a -> GetEC2InstanceRecommendations
s {$sel:maxResults:GetEC2InstanceRecommendations' :: Maybe Int
maxResults = Maybe Int
a} :: GetEC2InstanceRecommendations)
instance
Core.AWSRequest
GetEC2InstanceRecommendations
where
type
AWSResponse GetEC2InstanceRecommendations =
GetEC2InstanceRecommendationsResponse
request :: GetEC2InstanceRecommendations
-> Request GetEC2InstanceRecommendations
request = Service
-> GetEC2InstanceRecommendations
-> Request GetEC2InstanceRecommendations
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy GetEC2InstanceRecommendations
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse GetEC2InstanceRecommendations)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse GetEC2InstanceRecommendations))
-> Logger
-> Service
-> Proxy GetEC2InstanceRecommendations
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse GetEC2InstanceRecommendations)))
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 [GetRecommendationError]
-> Maybe [InstanceRecommendation]
-> Int
-> GetEC2InstanceRecommendationsResponse
GetEC2InstanceRecommendationsResponse'
(Maybe Text
-> Maybe [GetRecommendationError]
-> Maybe [InstanceRecommendation]
-> Int
-> GetEC2InstanceRecommendationsResponse)
-> Either String (Maybe Text)
-> Either
String
(Maybe [GetRecommendationError]
-> Maybe [InstanceRecommendation]
-> Int
-> GetEC2InstanceRecommendationsResponse)
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
"nextToken")
Either
String
(Maybe [GetRecommendationError]
-> Maybe [InstanceRecommendation]
-> Int
-> GetEC2InstanceRecommendationsResponse)
-> Either String (Maybe [GetRecommendationError])
-> Either
String
(Maybe [InstanceRecommendation]
-> Int -> GetEC2InstanceRecommendationsResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object
-> Text -> Either String (Maybe (Maybe [GetRecommendationError]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"errors" Either String (Maybe (Maybe [GetRecommendationError]))
-> Maybe [GetRecommendationError]
-> Either String (Maybe [GetRecommendationError])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [GetRecommendationError]
forall a. Monoid a => a
Prelude.mempty)
Either
String
(Maybe [InstanceRecommendation]
-> Int -> GetEC2InstanceRecommendationsResponse)
-> Either String (Maybe [InstanceRecommendation])
-> Either String (Int -> GetEC2InstanceRecommendationsResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object
-> Text -> Either String (Maybe (Maybe [InstanceRecommendation]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"instanceRecommendations"
Either String (Maybe (Maybe [InstanceRecommendation]))
-> Maybe [InstanceRecommendation]
-> Either String (Maybe [InstanceRecommendation])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [InstanceRecommendation]
forall a. Monoid a => a
Prelude.mempty
)
Either String (Int -> GetEC2InstanceRecommendationsResponse)
-> Either String Int
-> Either String GetEC2InstanceRecommendationsResponse
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
GetEC2InstanceRecommendations
instance Prelude.NFData GetEC2InstanceRecommendations
instance Core.ToHeaders GetEC2InstanceRecommendations where
toHeaders :: GetEC2InstanceRecommendations -> ResponseHeaders
toHeaders =
ResponseHeaders -> GetEC2InstanceRecommendations -> 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
"ComputeOptimizerService.GetEC2InstanceRecommendations" ::
Prelude.ByteString
),
HeaderName
"Content-Type"
HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"application/x-amz-json-1.0" ::
Prelude.ByteString
)
]
)
instance Core.ToJSON GetEC2InstanceRecommendations where
toJSON :: GetEC2InstanceRecommendations -> Value
toJSON GetEC2InstanceRecommendations' {Maybe Int
Maybe [Text]
Maybe [Filter]
Maybe Text
Maybe RecommendationPreferences
maxResults :: Maybe Int
instanceArns :: Maybe [Text]
nextToken :: Maybe Text
recommendationPreferences :: Maybe RecommendationPreferences
filters :: Maybe [Filter]
accountIds :: Maybe [Text]
$sel:maxResults:GetEC2InstanceRecommendations' :: GetEC2InstanceRecommendations -> Maybe Int
$sel:instanceArns:GetEC2InstanceRecommendations' :: GetEC2InstanceRecommendations -> Maybe [Text]
$sel:nextToken:GetEC2InstanceRecommendations' :: GetEC2InstanceRecommendations -> Maybe Text
$sel:recommendationPreferences:GetEC2InstanceRecommendations' :: GetEC2InstanceRecommendations -> Maybe RecommendationPreferences
$sel:filters:GetEC2InstanceRecommendations' :: GetEC2InstanceRecommendations -> Maybe [Filter]
$sel:accountIds:GetEC2InstanceRecommendations' :: GetEC2InstanceRecommendations -> Maybe [Text]
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"accountIds" 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]
accountIds,
(Text
"filters" Text -> [Filter] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) ([Filter] -> Pair) -> Maybe [Filter] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Filter]
filters,
(Text
"recommendationPreferences" Text -> RecommendationPreferences -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(RecommendationPreferences -> Pair)
-> Maybe RecommendationPreferences -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe RecommendationPreferences
recommendationPreferences,
(Text
"nextToken" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
nextToken,
(Text
"instanceArns" 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]
instanceArns,
(Text
"maxResults" Text -> Int -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Int -> Pair) -> Maybe Int -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Int
maxResults
]
)
instance Core.ToPath GetEC2InstanceRecommendations where
toPath :: GetEC2InstanceRecommendations -> ByteString
toPath = ByteString -> GetEC2InstanceRecommendations -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery GetEC2InstanceRecommendations where
toQuery :: GetEC2InstanceRecommendations -> QueryString
toQuery = QueryString -> GetEC2InstanceRecommendations -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data GetEC2InstanceRecommendationsResponse = GetEC2InstanceRecommendationsResponse'
{
GetEC2InstanceRecommendationsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
GetEC2InstanceRecommendationsResponse
-> Maybe [GetRecommendationError]
errors :: Prelude.Maybe [GetRecommendationError],
GetEC2InstanceRecommendationsResponse
-> Maybe [InstanceRecommendation]
instanceRecommendations :: Prelude.Maybe [InstanceRecommendation],
GetEC2InstanceRecommendationsResponse -> Int
httpStatus :: Prelude.Int
}
deriving (GetEC2InstanceRecommendationsResponse
-> GetEC2InstanceRecommendationsResponse -> Bool
(GetEC2InstanceRecommendationsResponse
-> GetEC2InstanceRecommendationsResponse -> Bool)
-> (GetEC2InstanceRecommendationsResponse
-> GetEC2InstanceRecommendationsResponse -> Bool)
-> Eq GetEC2InstanceRecommendationsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetEC2InstanceRecommendationsResponse
-> GetEC2InstanceRecommendationsResponse -> Bool
$c/= :: GetEC2InstanceRecommendationsResponse
-> GetEC2InstanceRecommendationsResponse -> Bool
== :: GetEC2InstanceRecommendationsResponse
-> GetEC2InstanceRecommendationsResponse -> Bool
$c== :: GetEC2InstanceRecommendationsResponse
-> GetEC2InstanceRecommendationsResponse -> Bool
Prelude.Eq, ReadPrec [GetEC2InstanceRecommendationsResponse]
ReadPrec GetEC2InstanceRecommendationsResponse
Int -> ReadS GetEC2InstanceRecommendationsResponse
ReadS [GetEC2InstanceRecommendationsResponse]
(Int -> ReadS GetEC2InstanceRecommendationsResponse)
-> ReadS [GetEC2InstanceRecommendationsResponse]
-> ReadPrec GetEC2InstanceRecommendationsResponse
-> ReadPrec [GetEC2InstanceRecommendationsResponse]
-> Read GetEC2InstanceRecommendationsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetEC2InstanceRecommendationsResponse]
$creadListPrec :: ReadPrec [GetEC2InstanceRecommendationsResponse]
readPrec :: ReadPrec GetEC2InstanceRecommendationsResponse
$creadPrec :: ReadPrec GetEC2InstanceRecommendationsResponse
readList :: ReadS [GetEC2InstanceRecommendationsResponse]
$creadList :: ReadS [GetEC2InstanceRecommendationsResponse]
readsPrec :: Int -> ReadS GetEC2InstanceRecommendationsResponse
$creadsPrec :: Int -> ReadS GetEC2InstanceRecommendationsResponse
Prelude.Read, Int -> GetEC2InstanceRecommendationsResponse -> ShowS
[GetEC2InstanceRecommendationsResponse] -> ShowS
GetEC2InstanceRecommendationsResponse -> String
(Int -> GetEC2InstanceRecommendationsResponse -> ShowS)
-> (GetEC2InstanceRecommendationsResponse -> String)
-> ([GetEC2InstanceRecommendationsResponse] -> ShowS)
-> Show GetEC2InstanceRecommendationsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetEC2InstanceRecommendationsResponse] -> ShowS
$cshowList :: [GetEC2InstanceRecommendationsResponse] -> ShowS
show :: GetEC2InstanceRecommendationsResponse -> String
$cshow :: GetEC2InstanceRecommendationsResponse -> String
showsPrec :: Int -> GetEC2InstanceRecommendationsResponse -> ShowS
$cshowsPrec :: Int -> GetEC2InstanceRecommendationsResponse -> ShowS
Prelude.Show, (forall x.
GetEC2InstanceRecommendationsResponse
-> Rep GetEC2InstanceRecommendationsResponse x)
-> (forall x.
Rep GetEC2InstanceRecommendationsResponse x
-> GetEC2InstanceRecommendationsResponse)
-> Generic GetEC2InstanceRecommendationsResponse
forall x.
Rep GetEC2InstanceRecommendationsResponse x
-> GetEC2InstanceRecommendationsResponse
forall x.
GetEC2InstanceRecommendationsResponse
-> Rep GetEC2InstanceRecommendationsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetEC2InstanceRecommendationsResponse x
-> GetEC2InstanceRecommendationsResponse
$cfrom :: forall x.
GetEC2InstanceRecommendationsResponse
-> Rep GetEC2InstanceRecommendationsResponse x
Prelude.Generic)
newGetEC2InstanceRecommendationsResponse ::
Prelude.Int ->
GetEC2InstanceRecommendationsResponse
newGetEC2InstanceRecommendationsResponse :: Int -> GetEC2InstanceRecommendationsResponse
newGetEC2InstanceRecommendationsResponse Int
pHttpStatus_ =
GetEC2InstanceRecommendationsResponse' :: Maybe Text
-> Maybe [GetRecommendationError]
-> Maybe [InstanceRecommendation]
-> Int
-> GetEC2InstanceRecommendationsResponse
GetEC2InstanceRecommendationsResponse'
{ $sel:nextToken:GetEC2InstanceRecommendationsResponse' :: Maybe Text
nextToken =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:errors:GetEC2InstanceRecommendationsResponse' :: Maybe [GetRecommendationError]
errors = Maybe [GetRecommendationError]
forall a. Maybe a
Prelude.Nothing,
$sel:instanceRecommendations:GetEC2InstanceRecommendationsResponse' :: Maybe [InstanceRecommendation]
instanceRecommendations =
Maybe [InstanceRecommendation]
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:GetEC2InstanceRecommendationsResponse' :: Int
httpStatus = Int
pHttpStatus_
}
getEC2InstanceRecommendationsResponse_nextToken :: Lens.Lens' GetEC2InstanceRecommendationsResponse (Prelude.Maybe Prelude.Text)
getEC2InstanceRecommendationsResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> GetEC2InstanceRecommendationsResponse
-> f GetEC2InstanceRecommendationsResponse
getEC2InstanceRecommendationsResponse_nextToken = (GetEC2InstanceRecommendationsResponse -> Maybe Text)
-> (GetEC2InstanceRecommendationsResponse
-> Maybe Text -> GetEC2InstanceRecommendationsResponse)
-> Lens
GetEC2InstanceRecommendationsResponse
GetEC2InstanceRecommendationsResponse
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetEC2InstanceRecommendationsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:GetEC2InstanceRecommendationsResponse' :: GetEC2InstanceRecommendationsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: GetEC2InstanceRecommendationsResponse
s@GetEC2InstanceRecommendationsResponse' {} Maybe Text
a -> GetEC2InstanceRecommendationsResponse
s {$sel:nextToken:GetEC2InstanceRecommendationsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: GetEC2InstanceRecommendationsResponse)
getEC2InstanceRecommendationsResponse_errors :: Lens.Lens' GetEC2InstanceRecommendationsResponse (Prelude.Maybe [GetRecommendationError])
getEC2InstanceRecommendationsResponse_errors :: (Maybe [GetRecommendationError]
-> f (Maybe [GetRecommendationError]))
-> GetEC2InstanceRecommendationsResponse
-> f GetEC2InstanceRecommendationsResponse
getEC2InstanceRecommendationsResponse_errors = (GetEC2InstanceRecommendationsResponse
-> Maybe [GetRecommendationError])
-> (GetEC2InstanceRecommendationsResponse
-> Maybe [GetRecommendationError]
-> GetEC2InstanceRecommendationsResponse)
-> Lens
GetEC2InstanceRecommendationsResponse
GetEC2InstanceRecommendationsResponse
(Maybe [GetRecommendationError])
(Maybe [GetRecommendationError])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetEC2InstanceRecommendationsResponse' {Maybe [GetRecommendationError]
errors :: Maybe [GetRecommendationError]
$sel:errors:GetEC2InstanceRecommendationsResponse' :: GetEC2InstanceRecommendationsResponse
-> Maybe [GetRecommendationError]
errors} -> Maybe [GetRecommendationError]
errors) (\s :: GetEC2InstanceRecommendationsResponse
s@GetEC2InstanceRecommendationsResponse' {} Maybe [GetRecommendationError]
a -> GetEC2InstanceRecommendationsResponse
s {$sel:errors:GetEC2InstanceRecommendationsResponse' :: Maybe [GetRecommendationError]
errors = Maybe [GetRecommendationError]
a} :: GetEC2InstanceRecommendationsResponse) ((Maybe [GetRecommendationError]
-> f (Maybe [GetRecommendationError]))
-> GetEC2InstanceRecommendationsResponse
-> f GetEC2InstanceRecommendationsResponse)
-> ((Maybe [GetRecommendationError]
-> f (Maybe [GetRecommendationError]))
-> Maybe [GetRecommendationError]
-> f (Maybe [GetRecommendationError]))
-> (Maybe [GetRecommendationError]
-> f (Maybe [GetRecommendationError]))
-> GetEC2InstanceRecommendationsResponse
-> f GetEC2InstanceRecommendationsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
[GetRecommendationError]
[GetRecommendationError]
[GetRecommendationError]
[GetRecommendationError]
-> Iso
(Maybe [GetRecommendationError])
(Maybe [GetRecommendationError])
(Maybe [GetRecommendationError])
(Maybe [GetRecommendationError])
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
[GetRecommendationError]
[GetRecommendationError]
[GetRecommendationError]
[GetRecommendationError]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
getEC2InstanceRecommendationsResponse_instanceRecommendations :: Lens.Lens' GetEC2InstanceRecommendationsResponse (Prelude.Maybe [InstanceRecommendation])
getEC2InstanceRecommendationsResponse_instanceRecommendations :: (Maybe [InstanceRecommendation]
-> f (Maybe [InstanceRecommendation]))
-> GetEC2InstanceRecommendationsResponse
-> f GetEC2InstanceRecommendationsResponse
getEC2InstanceRecommendationsResponse_instanceRecommendations = (GetEC2InstanceRecommendationsResponse
-> Maybe [InstanceRecommendation])
-> (GetEC2InstanceRecommendationsResponse
-> Maybe [InstanceRecommendation]
-> GetEC2InstanceRecommendationsResponse)
-> Lens
GetEC2InstanceRecommendationsResponse
GetEC2InstanceRecommendationsResponse
(Maybe [InstanceRecommendation])
(Maybe [InstanceRecommendation])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetEC2InstanceRecommendationsResponse' {Maybe [InstanceRecommendation]
instanceRecommendations :: Maybe [InstanceRecommendation]
$sel:instanceRecommendations:GetEC2InstanceRecommendationsResponse' :: GetEC2InstanceRecommendationsResponse
-> Maybe [InstanceRecommendation]
instanceRecommendations} -> Maybe [InstanceRecommendation]
instanceRecommendations) (\s :: GetEC2InstanceRecommendationsResponse
s@GetEC2InstanceRecommendationsResponse' {} Maybe [InstanceRecommendation]
a -> GetEC2InstanceRecommendationsResponse
s {$sel:instanceRecommendations:GetEC2InstanceRecommendationsResponse' :: Maybe [InstanceRecommendation]
instanceRecommendations = Maybe [InstanceRecommendation]
a} :: GetEC2InstanceRecommendationsResponse) ((Maybe [InstanceRecommendation]
-> f (Maybe [InstanceRecommendation]))
-> GetEC2InstanceRecommendationsResponse
-> f GetEC2InstanceRecommendationsResponse)
-> ((Maybe [InstanceRecommendation]
-> f (Maybe [InstanceRecommendation]))
-> Maybe [InstanceRecommendation]
-> f (Maybe [InstanceRecommendation]))
-> (Maybe [InstanceRecommendation]
-> f (Maybe [InstanceRecommendation]))
-> GetEC2InstanceRecommendationsResponse
-> f GetEC2InstanceRecommendationsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
[InstanceRecommendation]
[InstanceRecommendation]
[InstanceRecommendation]
[InstanceRecommendation]
-> Iso
(Maybe [InstanceRecommendation])
(Maybe [InstanceRecommendation])
(Maybe [InstanceRecommendation])
(Maybe [InstanceRecommendation])
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
[InstanceRecommendation]
[InstanceRecommendation]
[InstanceRecommendation]
[InstanceRecommendation]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
getEC2InstanceRecommendationsResponse_httpStatus :: Lens.Lens' GetEC2InstanceRecommendationsResponse Prelude.Int
getEC2InstanceRecommendationsResponse_httpStatus :: (Int -> f Int)
-> GetEC2InstanceRecommendationsResponse
-> f GetEC2InstanceRecommendationsResponse
getEC2InstanceRecommendationsResponse_httpStatus = (GetEC2InstanceRecommendationsResponse -> Int)
-> (GetEC2InstanceRecommendationsResponse
-> Int -> GetEC2InstanceRecommendationsResponse)
-> Lens
GetEC2InstanceRecommendationsResponse
GetEC2InstanceRecommendationsResponse
Int
Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetEC2InstanceRecommendationsResponse' {Int
httpStatus :: Int
$sel:httpStatus:GetEC2InstanceRecommendationsResponse' :: GetEC2InstanceRecommendationsResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: GetEC2InstanceRecommendationsResponse
s@GetEC2InstanceRecommendationsResponse' {} Int
a -> GetEC2InstanceRecommendationsResponse
s {$sel:httpStatus:GetEC2InstanceRecommendationsResponse' :: Int
httpStatus = Int
a} :: GetEC2InstanceRecommendationsResponse)
instance
Prelude.NFData
GetEC2InstanceRecommendationsResponse