{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}
module Amazonka.CostExplorer.Types.RightsizingRecommendationConfiguration where
import qualified Amazonka.Core as Core
import Amazonka.CostExplorer.Types.RecommendationTarget
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data RightsizingRecommendationConfiguration = RightsizingRecommendationConfiguration'
{
RightsizingRecommendationConfiguration -> RecommendationTarget
recommendationTarget :: RecommendationTarget,
RightsizingRecommendationConfiguration -> Bool
benefitsConsidered :: Prelude.Bool
}
deriving (RightsizingRecommendationConfiguration
-> RightsizingRecommendationConfiguration -> Bool
(RightsizingRecommendationConfiguration
-> RightsizingRecommendationConfiguration -> Bool)
-> (RightsizingRecommendationConfiguration
-> RightsizingRecommendationConfiguration -> Bool)
-> Eq RightsizingRecommendationConfiguration
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: RightsizingRecommendationConfiguration
-> RightsizingRecommendationConfiguration -> Bool
$c/= :: RightsizingRecommendationConfiguration
-> RightsizingRecommendationConfiguration -> Bool
== :: RightsizingRecommendationConfiguration
-> RightsizingRecommendationConfiguration -> Bool
$c== :: RightsizingRecommendationConfiguration
-> RightsizingRecommendationConfiguration -> Bool
Prelude.Eq, ReadPrec [RightsizingRecommendationConfiguration]
ReadPrec RightsizingRecommendationConfiguration
Int -> ReadS RightsizingRecommendationConfiguration
ReadS [RightsizingRecommendationConfiguration]
(Int -> ReadS RightsizingRecommendationConfiguration)
-> ReadS [RightsizingRecommendationConfiguration]
-> ReadPrec RightsizingRecommendationConfiguration
-> ReadPrec [RightsizingRecommendationConfiguration]
-> Read RightsizingRecommendationConfiguration
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [RightsizingRecommendationConfiguration]
$creadListPrec :: ReadPrec [RightsizingRecommendationConfiguration]
readPrec :: ReadPrec RightsizingRecommendationConfiguration
$creadPrec :: ReadPrec RightsizingRecommendationConfiguration
readList :: ReadS [RightsizingRecommendationConfiguration]
$creadList :: ReadS [RightsizingRecommendationConfiguration]
readsPrec :: Int -> ReadS RightsizingRecommendationConfiguration
$creadsPrec :: Int -> ReadS RightsizingRecommendationConfiguration
Prelude.Read, Int -> RightsizingRecommendationConfiguration -> ShowS
[RightsizingRecommendationConfiguration] -> ShowS
RightsizingRecommendationConfiguration -> String
(Int -> RightsizingRecommendationConfiguration -> ShowS)
-> (RightsizingRecommendationConfiguration -> String)
-> ([RightsizingRecommendationConfiguration] -> ShowS)
-> Show RightsizingRecommendationConfiguration
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [RightsizingRecommendationConfiguration] -> ShowS
$cshowList :: [RightsizingRecommendationConfiguration] -> ShowS
show :: RightsizingRecommendationConfiguration -> String
$cshow :: RightsizingRecommendationConfiguration -> String
showsPrec :: Int -> RightsizingRecommendationConfiguration -> ShowS
$cshowsPrec :: Int -> RightsizingRecommendationConfiguration -> ShowS
Prelude.Show, (forall x.
RightsizingRecommendationConfiguration
-> Rep RightsizingRecommendationConfiguration x)
-> (forall x.
Rep RightsizingRecommendationConfiguration x
-> RightsizingRecommendationConfiguration)
-> Generic RightsizingRecommendationConfiguration
forall x.
Rep RightsizingRecommendationConfiguration x
-> RightsizingRecommendationConfiguration
forall x.
RightsizingRecommendationConfiguration
-> Rep RightsizingRecommendationConfiguration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep RightsizingRecommendationConfiguration x
-> RightsizingRecommendationConfiguration
$cfrom :: forall x.
RightsizingRecommendationConfiguration
-> Rep RightsizingRecommendationConfiguration x
Prelude.Generic)
newRightsizingRecommendationConfiguration ::
RecommendationTarget ->
Prelude.Bool ->
RightsizingRecommendationConfiguration
newRightsizingRecommendationConfiguration :: RecommendationTarget
-> Bool -> RightsizingRecommendationConfiguration
newRightsizingRecommendationConfiguration
RecommendationTarget
pRecommendationTarget_
Bool
pBenefitsConsidered_ =
RightsizingRecommendationConfiguration' :: RecommendationTarget
-> Bool -> RightsizingRecommendationConfiguration
RightsizingRecommendationConfiguration'
{ $sel:recommendationTarget:RightsizingRecommendationConfiguration' :: RecommendationTarget
recommendationTarget =
RecommendationTarget
pRecommendationTarget_,
$sel:benefitsConsidered:RightsizingRecommendationConfiguration' :: Bool
benefitsConsidered =
Bool
pBenefitsConsidered_
}
rightsizingRecommendationConfiguration_recommendationTarget :: Lens.Lens' RightsizingRecommendationConfiguration RecommendationTarget
rightsizingRecommendationConfiguration_recommendationTarget :: (RecommendationTarget -> f RecommendationTarget)
-> RightsizingRecommendationConfiguration
-> f RightsizingRecommendationConfiguration
rightsizingRecommendationConfiguration_recommendationTarget = (RightsizingRecommendationConfiguration -> RecommendationTarget)
-> (RightsizingRecommendationConfiguration
-> RecommendationTarget -> RightsizingRecommendationConfiguration)
-> Lens
RightsizingRecommendationConfiguration
RightsizingRecommendationConfiguration
RecommendationTarget
RecommendationTarget
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RightsizingRecommendationConfiguration' {RecommendationTarget
recommendationTarget :: RecommendationTarget
$sel:recommendationTarget:RightsizingRecommendationConfiguration' :: RightsizingRecommendationConfiguration -> RecommendationTarget
recommendationTarget} -> RecommendationTarget
recommendationTarget) (\s :: RightsizingRecommendationConfiguration
s@RightsizingRecommendationConfiguration' {} RecommendationTarget
a -> RightsizingRecommendationConfiguration
s {$sel:recommendationTarget:RightsizingRecommendationConfiguration' :: RecommendationTarget
recommendationTarget = RecommendationTarget
a} :: RightsizingRecommendationConfiguration)
rightsizingRecommendationConfiguration_benefitsConsidered :: Lens.Lens' RightsizingRecommendationConfiguration Prelude.Bool
rightsizingRecommendationConfiguration_benefitsConsidered :: (Bool -> f Bool)
-> RightsizingRecommendationConfiguration
-> f RightsizingRecommendationConfiguration
rightsizingRecommendationConfiguration_benefitsConsidered = (RightsizingRecommendationConfiguration -> Bool)
-> (RightsizingRecommendationConfiguration
-> Bool -> RightsizingRecommendationConfiguration)
-> Lens
RightsizingRecommendationConfiguration
RightsizingRecommendationConfiguration
Bool
Bool
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RightsizingRecommendationConfiguration' {Bool
benefitsConsidered :: Bool
$sel:benefitsConsidered:RightsizingRecommendationConfiguration' :: RightsizingRecommendationConfiguration -> Bool
benefitsConsidered} -> Bool
benefitsConsidered) (\s :: RightsizingRecommendationConfiguration
s@RightsizingRecommendationConfiguration' {} Bool
a -> RightsizingRecommendationConfiguration
s {$sel:benefitsConsidered:RightsizingRecommendationConfiguration' :: Bool
benefitsConsidered = Bool
a} :: RightsizingRecommendationConfiguration)
instance
Core.FromJSON
RightsizingRecommendationConfiguration
where
parseJSON :: Value -> Parser RightsizingRecommendationConfiguration
parseJSON =
String
-> (Object -> Parser RightsizingRecommendationConfiguration)
-> Value
-> Parser RightsizingRecommendationConfiguration
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"RightsizingRecommendationConfiguration"
( \Object
x ->
RecommendationTarget
-> Bool -> RightsizingRecommendationConfiguration
RightsizingRecommendationConfiguration'
(RecommendationTarget
-> Bool -> RightsizingRecommendationConfiguration)
-> Parser RecommendationTarget
-> Parser (Bool -> RightsizingRecommendationConfiguration)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser RecommendationTarget
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"RecommendationTarget")
Parser (Bool -> RightsizingRecommendationConfiguration)
-> Parser Bool -> Parser RightsizingRecommendationConfiguration
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Bool
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"BenefitsConsidered")
)
instance
Prelude.Hashable
RightsizingRecommendationConfiguration
instance
Prelude.NFData
RightsizingRecommendationConfiguration
instance
Core.ToJSON
RightsizingRecommendationConfiguration
where
toJSON :: RightsizingRecommendationConfiguration -> Value
toJSON RightsizingRecommendationConfiguration' {Bool
RecommendationTarget
benefitsConsidered :: Bool
recommendationTarget :: RecommendationTarget
$sel:benefitsConsidered:RightsizingRecommendationConfiguration' :: RightsizingRecommendationConfiguration -> Bool
$sel:recommendationTarget:RightsizingRecommendationConfiguration' :: RightsizingRecommendationConfiguration -> RecommendationTarget
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
( Text
"RecommendationTarget"
Text -> RecommendationTarget -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= RecommendationTarget
recommendationTarget
),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
(Text
"BenefitsConsidered" Text -> Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Bool
benefitsConsidered)
]
)