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