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