{-# 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.ModifyRecommendationDetail where
import qualified Amazonka.Core as Core
import Amazonka.CostExplorer.Types.TargetInstance
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data ModifyRecommendationDetail = ModifyRecommendationDetail'
{
ModifyRecommendationDetail -> Maybe [TargetInstance]
targetInstances :: Prelude.Maybe [TargetInstance]
}
deriving (ModifyRecommendationDetail -> ModifyRecommendationDetail -> Bool
(ModifyRecommendationDetail -> ModifyRecommendationDetail -> Bool)
-> (ModifyRecommendationDetail
-> ModifyRecommendationDetail -> Bool)
-> Eq ModifyRecommendationDetail
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ModifyRecommendationDetail -> ModifyRecommendationDetail -> Bool
$c/= :: ModifyRecommendationDetail -> ModifyRecommendationDetail -> Bool
== :: ModifyRecommendationDetail -> ModifyRecommendationDetail -> Bool
$c== :: ModifyRecommendationDetail -> ModifyRecommendationDetail -> Bool
Prelude.Eq, ReadPrec [ModifyRecommendationDetail]
ReadPrec ModifyRecommendationDetail
Int -> ReadS ModifyRecommendationDetail
ReadS [ModifyRecommendationDetail]
(Int -> ReadS ModifyRecommendationDetail)
-> ReadS [ModifyRecommendationDetail]
-> ReadPrec ModifyRecommendationDetail
-> ReadPrec [ModifyRecommendationDetail]
-> Read ModifyRecommendationDetail
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ModifyRecommendationDetail]
$creadListPrec :: ReadPrec [ModifyRecommendationDetail]
readPrec :: ReadPrec ModifyRecommendationDetail
$creadPrec :: ReadPrec ModifyRecommendationDetail
readList :: ReadS [ModifyRecommendationDetail]
$creadList :: ReadS [ModifyRecommendationDetail]
readsPrec :: Int -> ReadS ModifyRecommendationDetail
$creadsPrec :: Int -> ReadS ModifyRecommendationDetail
Prelude.Read, Int -> ModifyRecommendationDetail -> ShowS
[ModifyRecommendationDetail] -> ShowS
ModifyRecommendationDetail -> String
(Int -> ModifyRecommendationDetail -> ShowS)
-> (ModifyRecommendationDetail -> String)
-> ([ModifyRecommendationDetail] -> ShowS)
-> Show ModifyRecommendationDetail
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ModifyRecommendationDetail] -> ShowS
$cshowList :: [ModifyRecommendationDetail] -> ShowS
show :: ModifyRecommendationDetail -> String
$cshow :: ModifyRecommendationDetail -> String
showsPrec :: Int -> ModifyRecommendationDetail -> ShowS
$cshowsPrec :: Int -> ModifyRecommendationDetail -> ShowS
Prelude.Show, (forall x.
ModifyRecommendationDetail -> Rep ModifyRecommendationDetail x)
-> (forall x.
Rep ModifyRecommendationDetail x -> ModifyRecommendationDetail)
-> Generic ModifyRecommendationDetail
forall x.
Rep ModifyRecommendationDetail x -> ModifyRecommendationDetail
forall x.
ModifyRecommendationDetail -> Rep ModifyRecommendationDetail x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ModifyRecommendationDetail x -> ModifyRecommendationDetail
$cfrom :: forall x.
ModifyRecommendationDetail -> Rep ModifyRecommendationDetail x
Prelude.Generic)
newModifyRecommendationDetail ::
ModifyRecommendationDetail
newModifyRecommendationDetail :: ModifyRecommendationDetail
newModifyRecommendationDetail =
ModifyRecommendationDetail' :: Maybe [TargetInstance] -> ModifyRecommendationDetail
ModifyRecommendationDetail'
{ $sel:targetInstances:ModifyRecommendationDetail' :: Maybe [TargetInstance]
targetInstances =
Maybe [TargetInstance]
forall a. Maybe a
Prelude.Nothing
}
modifyRecommendationDetail_targetInstances :: Lens.Lens' ModifyRecommendationDetail (Prelude.Maybe [TargetInstance])
modifyRecommendationDetail_targetInstances :: (Maybe [TargetInstance] -> f (Maybe [TargetInstance]))
-> ModifyRecommendationDetail -> f ModifyRecommendationDetail
modifyRecommendationDetail_targetInstances = (ModifyRecommendationDetail -> Maybe [TargetInstance])
-> (ModifyRecommendationDetail
-> Maybe [TargetInstance] -> ModifyRecommendationDetail)
-> Lens
ModifyRecommendationDetail
ModifyRecommendationDetail
(Maybe [TargetInstance])
(Maybe [TargetInstance])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ModifyRecommendationDetail' {Maybe [TargetInstance]
targetInstances :: Maybe [TargetInstance]
$sel:targetInstances:ModifyRecommendationDetail' :: ModifyRecommendationDetail -> Maybe [TargetInstance]
targetInstances} -> Maybe [TargetInstance]
targetInstances) (\s :: ModifyRecommendationDetail
s@ModifyRecommendationDetail' {} Maybe [TargetInstance]
a -> ModifyRecommendationDetail
s {$sel:targetInstances:ModifyRecommendationDetail' :: Maybe [TargetInstance]
targetInstances = Maybe [TargetInstance]
a} :: ModifyRecommendationDetail) ((Maybe [TargetInstance] -> f (Maybe [TargetInstance]))
-> ModifyRecommendationDetail -> f ModifyRecommendationDetail)
-> ((Maybe [TargetInstance] -> f (Maybe [TargetInstance]))
-> Maybe [TargetInstance] -> f (Maybe [TargetInstance]))
-> (Maybe [TargetInstance] -> f (Maybe [TargetInstance]))
-> ModifyRecommendationDetail
-> f ModifyRecommendationDetail
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
[TargetInstance] [TargetInstance] [TargetInstance] [TargetInstance]
-> Iso
(Maybe [TargetInstance])
(Maybe [TargetInstance])
(Maybe [TargetInstance])
(Maybe [TargetInstance])
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
[TargetInstance] [TargetInstance] [TargetInstance] [TargetInstance]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
instance Core.FromJSON ModifyRecommendationDetail where
parseJSON :: Value -> Parser ModifyRecommendationDetail
parseJSON =
String
-> (Object -> Parser ModifyRecommendationDetail)
-> Value
-> Parser ModifyRecommendationDetail
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"ModifyRecommendationDetail"
( \Object
x ->
Maybe [TargetInstance] -> ModifyRecommendationDetail
ModifyRecommendationDetail'
(Maybe [TargetInstance] -> ModifyRecommendationDetail)
-> Parser (Maybe [TargetInstance])
-> Parser ModifyRecommendationDetail
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ( Object
x Object -> Text -> Parser (Maybe (Maybe [TargetInstance]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"TargetInstances"
Parser (Maybe (Maybe [TargetInstance]))
-> Maybe [TargetInstance] -> Parser (Maybe [TargetInstance])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [TargetInstance]
forall a. Monoid a => a
Prelude.mempty
)
)
instance Prelude.Hashable ModifyRecommendationDetail
instance Prelude.NFData ModifyRecommendationDetail