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