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