{-# 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.ComputeOptimizer.Types.RecommendationPreferences where
import Amazonka.ComputeOptimizer.Types.CpuVendorArchitecture
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data RecommendationPreferences = RecommendationPreferences'
{
RecommendationPreferences -> Maybe [CpuVendorArchitecture]
cpuVendorArchitectures :: Prelude.Maybe [CpuVendorArchitecture]
}
deriving (RecommendationPreferences -> RecommendationPreferences -> Bool
(RecommendationPreferences -> RecommendationPreferences -> Bool)
-> (RecommendationPreferences -> RecommendationPreferences -> Bool)
-> Eq RecommendationPreferences
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: RecommendationPreferences -> RecommendationPreferences -> Bool
$c/= :: RecommendationPreferences -> RecommendationPreferences -> Bool
== :: RecommendationPreferences -> RecommendationPreferences -> Bool
$c== :: RecommendationPreferences -> RecommendationPreferences -> Bool
Prelude.Eq, ReadPrec [RecommendationPreferences]
ReadPrec RecommendationPreferences
Int -> ReadS RecommendationPreferences
ReadS [RecommendationPreferences]
(Int -> ReadS RecommendationPreferences)
-> ReadS [RecommendationPreferences]
-> ReadPrec RecommendationPreferences
-> ReadPrec [RecommendationPreferences]
-> Read RecommendationPreferences
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [RecommendationPreferences]
$creadListPrec :: ReadPrec [RecommendationPreferences]
readPrec :: ReadPrec RecommendationPreferences
$creadPrec :: ReadPrec RecommendationPreferences
readList :: ReadS [RecommendationPreferences]
$creadList :: ReadS [RecommendationPreferences]
readsPrec :: Int -> ReadS RecommendationPreferences
$creadsPrec :: Int -> ReadS RecommendationPreferences
Prelude.Read, Int -> RecommendationPreferences -> ShowS
[RecommendationPreferences] -> ShowS
RecommendationPreferences -> String
(Int -> RecommendationPreferences -> ShowS)
-> (RecommendationPreferences -> String)
-> ([RecommendationPreferences] -> ShowS)
-> Show RecommendationPreferences
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [RecommendationPreferences] -> ShowS
$cshowList :: [RecommendationPreferences] -> ShowS
show :: RecommendationPreferences -> String
$cshow :: RecommendationPreferences -> String
showsPrec :: Int -> RecommendationPreferences -> ShowS
$cshowsPrec :: Int -> RecommendationPreferences -> ShowS
Prelude.Show, (forall x.
RecommendationPreferences -> Rep RecommendationPreferences x)
-> (forall x.
Rep RecommendationPreferences x -> RecommendationPreferences)
-> Generic RecommendationPreferences
forall x.
Rep RecommendationPreferences x -> RecommendationPreferences
forall x.
RecommendationPreferences -> Rep RecommendationPreferences x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep RecommendationPreferences x -> RecommendationPreferences
$cfrom :: forall x.
RecommendationPreferences -> Rep RecommendationPreferences x
Prelude.Generic)
newRecommendationPreferences ::
RecommendationPreferences
newRecommendationPreferences :: RecommendationPreferences
newRecommendationPreferences =
RecommendationPreferences' :: Maybe [CpuVendorArchitecture] -> RecommendationPreferences
RecommendationPreferences'
{ $sel:cpuVendorArchitectures:RecommendationPreferences' :: Maybe [CpuVendorArchitecture]
cpuVendorArchitectures =
Maybe [CpuVendorArchitecture]
forall a. Maybe a
Prelude.Nothing
}
recommendationPreferences_cpuVendorArchitectures :: Lens.Lens' RecommendationPreferences (Prelude.Maybe [CpuVendorArchitecture])
recommendationPreferences_cpuVendorArchitectures :: (Maybe [CpuVendorArchitecture]
-> f (Maybe [CpuVendorArchitecture]))
-> RecommendationPreferences -> f RecommendationPreferences
recommendationPreferences_cpuVendorArchitectures = (RecommendationPreferences -> Maybe [CpuVendorArchitecture])
-> (RecommendationPreferences
-> Maybe [CpuVendorArchitecture] -> RecommendationPreferences)
-> Lens
RecommendationPreferences
RecommendationPreferences
(Maybe [CpuVendorArchitecture])
(Maybe [CpuVendorArchitecture])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RecommendationPreferences' {Maybe [CpuVendorArchitecture]
cpuVendorArchitectures :: Maybe [CpuVendorArchitecture]
$sel:cpuVendorArchitectures:RecommendationPreferences' :: RecommendationPreferences -> Maybe [CpuVendorArchitecture]
cpuVendorArchitectures} -> Maybe [CpuVendorArchitecture]
cpuVendorArchitectures) (\s :: RecommendationPreferences
s@RecommendationPreferences' {} Maybe [CpuVendorArchitecture]
a -> RecommendationPreferences
s {$sel:cpuVendorArchitectures:RecommendationPreferences' :: Maybe [CpuVendorArchitecture]
cpuVendorArchitectures = Maybe [CpuVendorArchitecture]
a} :: RecommendationPreferences) ((Maybe [CpuVendorArchitecture]
-> f (Maybe [CpuVendorArchitecture]))
-> RecommendationPreferences -> f RecommendationPreferences)
-> ((Maybe [CpuVendorArchitecture]
-> f (Maybe [CpuVendorArchitecture]))
-> Maybe [CpuVendorArchitecture]
-> f (Maybe [CpuVendorArchitecture]))
-> (Maybe [CpuVendorArchitecture]
-> f (Maybe [CpuVendorArchitecture]))
-> RecommendationPreferences
-> f RecommendationPreferences
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
[CpuVendorArchitecture]
[CpuVendorArchitecture]
[CpuVendorArchitecture]
[CpuVendorArchitecture]
-> Iso
(Maybe [CpuVendorArchitecture])
(Maybe [CpuVendorArchitecture])
(Maybe [CpuVendorArchitecture])
(Maybe [CpuVendorArchitecture])
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
[CpuVendorArchitecture]
[CpuVendorArchitecture]
[CpuVendorArchitecture]
[CpuVendorArchitecture]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
instance Prelude.Hashable RecommendationPreferences
instance Prelude.NFData RecommendationPreferences
instance Core.ToJSON RecommendationPreferences where
toJSON :: RecommendationPreferences -> Value
toJSON RecommendationPreferences' {Maybe [CpuVendorArchitecture]
cpuVendorArchitectures :: Maybe [CpuVendorArchitecture]
$sel:cpuVendorArchitectures:RecommendationPreferences' :: RecommendationPreferences -> Maybe [CpuVendorArchitecture]
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"cpuVendorArchitectures" Text -> [CpuVendorArchitecture] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
([CpuVendorArchitecture] -> Pair)
-> Maybe [CpuVendorArchitecture] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [CpuVendorArchitecture]
cpuVendorArchitectures
]
)