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