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