{-# 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.ECS.Types.RuntimePlatform where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.ECS.Types.CPUArchitecture
import Amazonka.ECS.Types.OSFamily
import qualified Amazonka.Prelude as Prelude
data RuntimePlatform = RuntimePlatform'
{
RuntimePlatform -> Maybe CPUArchitecture
cpuArchitecture :: Prelude.Maybe CPUArchitecture,
RuntimePlatform -> Maybe OSFamily
operatingSystemFamily :: Prelude.Maybe OSFamily
}
deriving (RuntimePlatform -> RuntimePlatform -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: RuntimePlatform -> RuntimePlatform -> Bool
$c/= :: RuntimePlatform -> RuntimePlatform -> Bool
== :: RuntimePlatform -> RuntimePlatform -> Bool
$c== :: RuntimePlatform -> RuntimePlatform -> Bool
Prelude.Eq, ReadPrec [RuntimePlatform]
ReadPrec RuntimePlatform
Int -> ReadS RuntimePlatform
ReadS [RuntimePlatform]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [RuntimePlatform]
$creadListPrec :: ReadPrec [RuntimePlatform]
readPrec :: ReadPrec RuntimePlatform
$creadPrec :: ReadPrec RuntimePlatform
readList :: ReadS [RuntimePlatform]
$creadList :: ReadS [RuntimePlatform]
readsPrec :: Int -> ReadS RuntimePlatform
$creadsPrec :: Int -> ReadS RuntimePlatform
Prelude.Read, Int -> RuntimePlatform -> ShowS
[RuntimePlatform] -> ShowS
RuntimePlatform -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [RuntimePlatform] -> ShowS
$cshowList :: [RuntimePlatform] -> ShowS
show :: RuntimePlatform -> String
$cshow :: RuntimePlatform -> String
showsPrec :: Int -> RuntimePlatform -> ShowS
$cshowsPrec :: Int -> RuntimePlatform -> ShowS
Prelude.Show, forall x. Rep RuntimePlatform x -> RuntimePlatform
forall x. RuntimePlatform -> Rep RuntimePlatform x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep RuntimePlatform x -> RuntimePlatform
$cfrom :: forall x. RuntimePlatform -> Rep RuntimePlatform x
Prelude.Generic)
newRuntimePlatform ::
RuntimePlatform
newRuntimePlatform :: RuntimePlatform
newRuntimePlatform =
RuntimePlatform'
{ $sel:cpuArchitecture:RuntimePlatform' :: Maybe CPUArchitecture
cpuArchitecture = forall a. Maybe a
Prelude.Nothing,
$sel:operatingSystemFamily:RuntimePlatform' :: Maybe OSFamily
operatingSystemFamily = forall a. Maybe a
Prelude.Nothing
}
runtimePlatform_cpuArchitecture :: Lens.Lens' RuntimePlatform (Prelude.Maybe CPUArchitecture)
runtimePlatform_cpuArchitecture :: Lens' RuntimePlatform (Maybe CPUArchitecture)
runtimePlatform_cpuArchitecture = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RuntimePlatform' {Maybe CPUArchitecture
cpuArchitecture :: Maybe CPUArchitecture
$sel:cpuArchitecture:RuntimePlatform' :: RuntimePlatform -> Maybe CPUArchitecture
cpuArchitecture} -> Maybe CPUArchitecture
cpuArchitecture) (\s :: RuntimePlatform
s@RuntimePlatform' {} Maybe CPUArchitecture
a -> RuntimePlatform
s {$sel:cpuArchitecture:RuntimePlatform' :: Maybe CPUArchitecture
cpuArchitecture = Maybe CPUArchitecture
a} :: RuntimePlatform)
runtimePlatform_operatingSystemFamily :: Lens.Lens' RuntimePlatform (Prelude.Maybe OSFamily)
runtimePlatform_operatingSystemFamily :: Lens' RuntimePlatform (Maybe OSFamily)
runtimePlatform_operatingSystemFamily = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RuntimePlatform' {Maybe OSFamily
operatingSystemFamily :: Maybe OSFamily
$sel:operatingSystemFamily:RuntimePlatform' :: RuntimePlatform -> Maybe OSFamily
operatingSystemFamily} -> Maybe OSFamily
operatingSystemFamily) (\s :: RuntimePlatform
s@RuntimePlatform' {} Maybe OSFamily
a -> RuntimePlatform
s {$sel:operatingSystemFamily:RuntimePlatform' :: Maybe OSFamily
operatingSystemFamily = Maybe OSFamily
a} :: RuntimePlatform)
instance Data.FromJSON RuntimePlatform where
parseJSON :: Value -> Parser RuntimePlatform
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"RuntimePlatform"
( \Object
x ->
Maybe CPUArchitecture -> Maybe OSFamily -> RuntimePlatform
RuntimePlatform'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"cpuArchitecture")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"operatingSystemFamily")
)
instance Prelude.Hashable RuntimePlatform where
hashWithSalt :: Int -> RuntimePlatform -> Int
hashWithSalt Int
_salt RuntimePlatform' {Maybe CPUArchitecture
Maybe OSFamily
operatingSystemFamily :: Maybe OSFamily
cpuArchitecture :: Maybe CPUArchitecture
$sel:operatingSystemFamily:RuntimePlatform' :: RuntimePlatform -> Maybe OSFamily
$sel:cpuArchitecture:RuntimePlatform' :: RuntimePlatform -> Maybe CPUArchitecture
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe CPUArchitecture
cpuArchitecture
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe OSFamily
operatingSystemFamily
instance Prelude.NFData RuntimePlatform where
rnf :: RuntimePlatform -> ()
rnf RuntimePlatform' {Maybe CPUArchitecture
Maybe OSFamily
operatingSystemFamily :: Maybe OSFamily
cpuArchitecture :: Maybe CPUArchitecture
$sel:operatingSystemFamily:RuntimePlatform' :: RuntimePlatform -> Maybe OSFamily
$sel:cpuArchitecture:RuntimePlatform' :: RuntimePlatform -> Maybe CPUArchitecture
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe CPUArchitecture
cpuArchitecture
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe OSFamily
operatingSystemFamily
instance Data.ToJSON RuntimePlatform where
toJSON :: RuntimePlatform -> Value
toJSON RuntimePlatform' {Maybe CPUArchitecture
Maybe OSFamily
operatingSystemFamily :: Maybe OSFamily
cpuArchitecture :: Maybe CPUArchitecture
$sel:operatingSystemFamily:RuntimePlatform' :: RuntimePlatform -> Maybe OSFamily
$sel:cpuArchitecture:RuntimePlatform' :: RuntimePlatform -> Maybe CPUArchitecture
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"cpuArchitecture" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe CPUArchitecture
cpuArchitecture,
(Key
"operatingSystemFamily" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe OSFamily
operatingSystemFamily
]
)