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