{-# 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.GetEffectiveRecommendationPreferences
(
GetEffectiveRecommendationPreferences (..),
newGetEffectiveRecommendationPreferences,
getEffectiveRecommendationPreferences_resourceArn,
GetEffectiveRecommendationPreferencesResponse (..),
newGetEffectiveRecommendationPreferencesResponse,
getEffectiveRecommendationPreferencesResponse_enhancedInfrastructureMetrics,
getEffectiveRecommendationPreferencesResponse_externalMetricsPreference,
getEffectiveRecommendationPreferencesResponse_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
data GetEffectiveRecommendationPreferences = GetEffectiveRecommendationPreferences'
{
GetEffectiveRecommendationPreferences -> Text
resourceArn :: Prelude.Text
}
deriving (GetEffectiveRecommendationPreferences
-> GetEffectiveRecommendationPreferences -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetEffectiveRecommendationPreferences
-> GetEffectiveRecommendationPreferences -> Bool
$c/= :: GetEffectiveRecommendationPreferences
-> GetEffectiveRecommendationPreferences -> Bool
== :: GetEffectiveRecommendationPreferences
-> GetEffectiveRecommendationPreferences -> Bool
$c== :: GetEffectiveRecommendationPreferences
-> GetEffectiveRecommendationPreferences -> Bool
Prelude.Eq, ReadPrec [GetEffectiveRecommendationPreferences]
ReadPrec GetEffectiveRecommendationPreferences
Int -> ReadS GetEffectiveRecommendationPreferences
ReadS [GetEffectiveRecommendationPreferences]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetEffectiveRecommendationPreferences]
$creadListPrec :: ReadPrec [GetEffectiveRecommendationPreferences]
readPrec :: ReadPrec GetEffectiveRecommendationPreferences
$creadPrec :: ReadPrec GetEffectiveRecommendationPreferences
readList :: ReadS [GetEffectiveRecommendationPreferences]
$creadList :: ReadS [GetEffectiveRecommendationPreferences]
readsPrec :: Int -> ReadS GetEffectiveRecommendationPreferences
$creadsPrec :: Int -> ReadS GetEffectiveRecommendationPreferences
Prelude.Read, Int -> GetEffectiveRecommendationPreferences -> ShowS
[GetEffectiveRecommendationPreferences] -> ShowS
GetEffectiveRecommendationPreferences -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetEffectiveRecommendationPreferences] -> ShowS
$cshowList :: [GetEffectiveRecommendationPreferences] -> ShowS
show :: GetEffectiveRecommendationPreferences -> String
$cshow :: GetEffectiveRecommendationPreferences -> String
showsPrec :: Int -> GetEffectiveRecommendationPreferences -> ShowS
$cshowsPrec :: Int -> GetEffectiveRecommendationPreferences -> ShowS
Prelude.Show, forall x.
Rep GetEffectiveRecommendationPreferences x
-> GetEffectiveRecommendationPreferences
forall x.
GetEffectiveRecommendationPreferences
-> Rep GetEffectiveRecommendationPreferences x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetEffectiveRecommendationPreferences x
-> GetEffectiveRecommendationPreferences
$cfrom :: forall x.
GetEffectiveRecommendationPreferences
-> Rep GetEffectiveRecommendationPreferences x
Prelude.Generic)
newGetEffectiveRecommendationPreferences ::
Prelude.Text ->
GetEffectiveRecommendationPreferences
newGetEffectiveRecommendationPreferences :: Text -> GetEffectiveRecommendationPreferences
newGetEffectiveRecommendationPreferences
Text
pResourceArn_ =
GetEffectiveRecommendationPreferences'
{ $sel:resourceArn:GetEffectiveRecommendationPreferences' :: Text
resourceArn =
Text
pResourceArn_
}
getEffectiveRecommendationPreferences_resourceArn :: Lens.Lens' GetEffectiveRecommendationPreferences Prelude.Text
getEffectiveRecommendationPreferences_resourceArn :: Lens' GetEffectiveRecommendationPreferences Text
getEffectiveRecommendationPreferences_resourceArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetEffectiveRecommendationPreferences' {Text
resourceArn :: Text
$sel:resourceArn:GetEffectiveRecommendationPreferences' :: GetEffectiveRecommendationPreferences -> Text
resourceArn} -> Text
resourceArn) (\s :: GetEffectiveRecommendationPreferences
s@GetEffectiveRecommendationPreferences' {} Text
a -> GetEffectiveRecommendationPreferences
s {$sel:resourceArn:GetEffectiveRecommendationPreferences' :: Text
resourceArn = Text
a} :: GetEffectiveRecommendationPreferences)
instance
Core.AWSRequest
GetEffectiveRecommendationPreferences
where
type
AWSResponse
GetEffectiveRecommendationPreferences =
GetEffectiveRecommendationPreferencesResponse
request :: (Service -> Service)
-> GetEffectiveRecommendationPreferences
-> Request GetEffectiveRecommendationPreferences
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 GetEffectiveRecommendationPreferences
-> ClientResponse ClientBody
-> m (Either
Error
(ClientResponse
(AWSResponse GetEffectiveRecommendationPreferences)))
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 EnhancedInfrastructureMetrics
-> Maybe ExternalMetricsPreference
-> Int
-> GetEffectiveRecommendationPreferencesResponse
GetEffectiveRecommendationPreferencesResponse'
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
"enhancedInfrastructureMetrics")
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
"externalMetricsPreference")
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
GetEffectiveRecommendationPreferences
where
hashWithSalt :: Int -> GetEffectiveRecommendationPreferences -> Int
hashWithSalt
Int
_salt
GetEffectiveRecommendationPreferences' {Text
resourceArn :: Text
$sel:resourceArn:GetEffectiveRecommendationPreferences' :: GetEffectiveRecommendationPreferences -> Text
..} =
Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
resourceArn
instance
Prelude.NFData
GetEffectiveRecommendationPreferences
where
rnf :: GetEffectiveRecommendationPreferences -> ()
rnf GetEffectiveRecommendationPreferences' {Text
resourceArn :: Text
$sel:resourceArn:GetEffectiveRecommendationPreferences' :: GetEffectiveRecommendationPreferences -> Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Text
resourceArn
instance
Data.ToHeaders
GetEffectiveRecommendationPreferences
where
toHeaders :: GetEffectiveRecommendationPreferences -> 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.GetEffectiveRecommendationPreferences" ::
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
GetEffectiveRecommendationPreferences
where
toJSON :: GetEffectiveRecommendationPreferences -> Value
toJSON GetEffectiveRecommendationPreferences' {Text
resourceArn :: Text
$sel:resourceArn:GetEffectiveRecommendationPreferences' :: GetEffectiveRecommendationPreferences -> Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[forall a. a -> Maybe a
Prelude.Just (Key
"resourceArn" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
resourceArn)]
)
instance
Data.ToPath
GetEffectiveRecommendationPreferences
where
toPath :: GetEffectiveRecommendationPreferences -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance
Data.ToQuery
GetEffectiveRecommendationPreferences
where
toQuery :: GetEffectiveRecommendationPreferences -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data GetEffectiveRecommendationPreferencesResponse = GetEffectiveRecommendationPreferencesResponse'
{
GetEffectiveRecommendationPreferencesResponse
-> Maybe EnhancedInfrastructureMetrics
enhancedInfrastructureMetrics :: Prelude.Maybe EnhancedInfrastructureMetrics,
GetEffectiveRecommendationPreferencesResponse
-> Maybe ExternalMetricsPreference
externalMetricsPreference :: Prelude.Maybe ExternalMetricsPreference,
GetEffectiveRecommendationPreferencesResponse -> Int
httpStatus :: Prelude.Int
}
deriving (GetEffectiveRecommendationPreferencesResponse
-> GetEffectiveRecommendationPreferencesResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetEffectiveRecommendationPreferencesResponse
-> GetEffectiveRecommendationPreferencesResponse -> Bool
$c/= :: GetEffectiveRecommendationPreferencesResponse
-> GetEffectiveRecommendationPreferencesResponse -> Bool
== :: GetEffectiveRecommendationPreferencesResponse
-> GetEffectiveRecommendationPreferencesResponse -> Bool
$c== :: GetEffectiveRecommendationPreferencesResponse
-> GetEffectiveRecommendationPreferencesResponse -> Bool
Prelude.Eq, ReadPrec [GetEffectiveRecommendationPreferencesResponse]
ReadPrec GetEffectiveRecommendationPreferencesResponse
Int -> ReadS GetEffectiveRecommendationPreferencesResponse
ReadS [GetEffectiveRecommendationPreferencesResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetEffectiveRecommendationPreferencesResponse]
$creadListPrec :: ReadPrec [GetEffectiveRecommendationPreferencesResponse]
readPrec :: ReadPrec GetEffectiveRecommendationPreferencesResponse
$creadPrec :: ReadPrec GetEffectiveRecommendationPreferencesResponse
readList :: ReadS [GetEffectiveRecommendationPreferencesResponse]
$creadList :: ReadS [GetEffectiveRecommendationPreferencesResponse]
readsPrec :: Int -> ReadS GetEffectiveRecommendationPreferencesResponse
$creadsPrec :: Int -> ReadS GetEffectiveRecommendationPreferencesResponse
Prelude.Read, Int -> GetEffectiveRecommendationPreferencesResponse -> ShowS
[GetEffectiveRecommendationPreferencesResponse] -> ShowS
GetEffectiveRecommendationPreferencesResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetEffectiveRecommendationPreferencesResponse] -> ShowS
$cshowList :: [GetEffectiveRecommendationPreferencesResponse] -> ShowS
show :: GetEffectiveRecommendationPreferencesResponse -> String
$cshow :: GetEffectiveRecommendationPreferencesResponse -> String
showsPrec :: Int -> GetEffectiveRecommendationPreferencesResponse -> ShowS
$cshowsPrec :: Int -> GetEffectiveRecommendationPreferencesResponse -> ShowS
Prelude.Show, forall x.
Rep GetEffectiveRecommendationPreferencesResponse x
-> GetEffectiveRecommendationPreferencesResponse
forall x.
GetEffectiveRecommendationPreferencesResponse
-> Rep GetEffectiveRecommendationPreferencesResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetEffectiveRecommendationPreferencesResponse x
-> GetEffectiveRecommendationPreferencesResponse
$cfrom :: forall x.
GetEffectiveRecommendationPreferencesResponse
-> Rep GetEffectiveRecommendationPreferencesResponse x
Prelude.Generic)
newGetEffectiveRecommendationPreferencesResponse ::
Prelude.Int ->
GetEffectiveRecommendationPreferencesResponse
newGetEffectiveRecommendationPreferencesResponse :: Int -> GetEffectiveRecommendationPreferencesResponse
newGetEffectiveRecommendationPreferencesResponse
Int
pHttpStatus_ =
GetEffectiveRecommendationPreferencesResponse'
{ $sel:enhancedInfrastructureMetrics:GetEffectiveRecommendationPreferencesResponse' :: Maybe EnhancedInfrastructureMetrics
enhancedInfrastructureMetrics =
forall a. Maybe a
Prelude.Nothing,
$sel:externalMetricsPreference:GetEffectiveRecommendationPreferencesResponse' :: Maybe ExternalMetricsPreference
externalMetricsPreference =
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:GetEffectiveRecommendationPreferencesResponse' :: Int
httpStatus = Int
pHttpStatus_
}
getEffectiveRecommendationPreferencesResponse_enhancedInfrastructureMetrics :: Lens.Lens' GetEffectiveRecommendationPreferencesResponse (Prelude.Maybe EnhancedInfrastructureMetrics)
getEffectiveRecommendationPreferencesResponse_enhancedInfrastructureMetrics :: Lens'
GetEffectiveRecommendationPreferencesResponse
(Maybe EnhancedInfrastructureMetrics)
getEffectiveRecommendationPreferencesResponse_enhancedInfrastructureMetrics = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetEffectiveRecommendationPreferencesResponse' {Maybe EnhancedInfrastructureMetrics
enhancedInfrastructureMetrics :: Maybe EnhancedInfrastructureMetrics
$sel:enhancedInfrastructureMetrics:GetEffectiveRecommendationPreferencesResponse' :: GetEffectiveRecommendationPreferencesResponse
-> Maybe EnhancedInfrastructureMetrics
enhancedInfrastructureMetrics} -> Maybe EnhancedInfrastructureMetrics
enhancedInfrastructureMetrics) (\s :: GetEffectiveRecommendationPreferencesResponse
s@GetEffectiveRecommendationPreferencesResponse' {} Maybe EnhancedInfrastructureMetrics
a -> GetEffectiveRecommendationPreferencesResponse
s {$sel:enhancedInfrastructureMetrics:GetEffectiveRecommendationPreferencesResponse' :: Maybe EnhancedInfrastructureMetrics
enhancedInfrastructureMetrics = Maybe EnhancedInfrastructureMetrics
a} :: GetEffectiveRecommendationPreferencesResponse)
getEffectiveRecommendationPreferencesResponse_externalMetricsPreference :: Lens.Lens' GetEffectiveRecommendationPreferencesResponse (Prelude.Maybe ExternalMetricsPreference)
getEffectiveRecommendationPreferencesResponse_externalMetricsPreference :: Lens'
GetEffectiveRecommendationPreferencesResponse
(Maybe ExternalMetricsPreference)
getEffectiveRecommendationPreferencesResponse_externalMetricsPreference = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetEffectiveRecommendationPreferencesResponse' {Maybe ExternalMetricsPreference
externalMetricsPreference :: Maybe ExternalMetricsPreference
$sel:externalMetricsPreference:GetEffectiveRecommendationPreferencesResponse' :: GetEffectiveRecommendationPreferencesResponse
-> Maybe ExternalMetricsPreference
externalMetricsPreference} -> Maybe ExternalMetricsPreference
externalMetricsPreference) (\s :: GetEffectiveRecommendationPreferencesResponse
s@GetEffectiveRecommendationPreferencesResponse' {} Maybe ExternalMetricsPreference
a -> GetEffectiveRecommendationPreferencesResponse
s {$sel:externalMetricsPreference:GetEffectiveRecommendationPreferencesResponse' :: Maybe ExternalMetricsPreference
externalMetricsPreference = Maybe ExternalMetricsPreference
a} :: GetEffectiveRecommendationPreferencesResponse)
getEffectiveRecommendationPreferencesResponse_httpStatus :: Lens.Lens' GetEffectiveRecommendationPreferencesResponse Prelude.Int
getEffectiveRecommendationPreferencesResponse_httpStatus :: Lens' GetEffectiveRecommendationPreferencesResponse Int
getEffectiveRecommendationPreferencesResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetEffectiveRecommendationPreferencesResponse' {Int
httpStatus :: Int
$sel:httpStatus:GetEffectiveRecommendationPreferencesResponse' :: GetEffectiveRecommendationPreferencesResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: GetEffectiveRecommendationPreferencesResponse
s@GetEffectiveRecommendationPreferencesResponse' {} Int
a -> GetEffectiveRecommendationPreferencesResponse
s {$sel:httpStatus:GetEffectiveRecommendationPreferencesResponse' :: Int
httpStatus = Int
a} :: GetEffectiveRecommendationPreferencesResponse)
instance
Prelude.NFData
GetEffectiveRecommendationPreferencesResponse
where
rnf :: GetEffectiveRecommendationPreferencesResponse -> ()
rnf
GetEffectiveRecommendationPreferencesResponse' {Int
Maybe EnhancedInfrastructureMetrics
Maybe ExternalMetricsPreference
httpStatus :: Int
externalMetricsPreference :: Maybe ExternalMetricsPreference
enhancedInfrastructureMetrics :: Maybe EnhancedInfrastructureMetrics
$sel:httpStatus:GetEffectiveRecommendationPreferencesResponse' :: GetEffectiveRecommendationPreferencesResponse -> Int
$sel:externalMetricsPreference:GetEffectiveRecommendationPreferencesResponse' :: GetEffectiveRecommendationPreferencesResponse
-> Maybe ExternalMetricsPreference
$sel:enhancedInfrastructureMetrics:GetEffectiveRecommendationPreferencesResponse' :: GetEffectiveRecommendationPreferencesResponse
-> Maybe EnhancedInfrastructureMetrics
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe EnhancedInfrastructureMetrics
enhancedInfrastructureMetrics
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ExternalMetricsPreference
externalMetricsPreference
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus