{-# 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.DeploymentStage where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
import Amazonka.SageMaker.Types.DeviceSelectionConfig
import Amazonka.SageMaker.Types.EdgeDeploymentConfig
data DeploymentStage = DeploymentStage'
{
DeploymentStage -> Maybe EdgeDeploymentConfig
deploymentConfig :: Prelude.Maybe EdgeDeploymentConfig,
DeploymentStage -> Text
stageName :: Prelude.Text,
DeploymentStage -> DeviceSelectionConfig
deviceSelectionConfig :: DeviceSelectionConfig
}
deriving (DeploymentStage -> DeploymentStage -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeploymentStage -> DeploymentStage -> Bool
$c/= :: DeploymentStage -> DeploymentStage -> Bool
== :: DeploymentStage -> DeploymentStage -> Bool
$c== :: DeploymentStage -> DeploymentStage -> Bool
Prelude.Eq, ReadPrec [DeploymentStage]
ReadPrec DeploymentStage
Int -> ReadS DeploymentStage
ReadS [DeploymentStage]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeploymentStage]
$creadListPrec :: ReadPrec [DeploymentStage]
readPrec :: ReadPrec DeploymentStage
$creadPrec :: ReadPrec DeploymentStage
readList :: ReadS [DeploymentStage]
$creadList :: ReadS [DeploymentStage]
readsPrec :: Int -> ReadS DeploymentStage
$creadsPrec :: Int -> ReadS DeploymentStage
Prelude.Read, Int -> DeploymentStage -> ShowS
[DeploymentStage] -> ShowS
DeploymentStage -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeploymentStage] -> ShowS
$cshowList :: [DeploymentStage] -> ShowS
show :: DeploymentStage -> String
$cshow :: DeploymentStage -> String
showsPrec :: Int -> DeploymentStage -> ShowS
$cshowsPrec :: Int -> DeploymentStage -> ShowS
Prelude.Show, forall x. Rep DeploymentStage x -> DeploymentStage
forall x. DeploymentStage -> Rep DeploymentStage x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeploymentStage x -> DeploymentStage
$cfrom :: forall x. DeploymentStage -> Rep DeploymentStage x
Prelude.Generic)
newDeploymentStage ::
Prelude.Text ->
DeviceSelectionConfig ->
DeploymentStage
newDeploymentStage :: Text -> DeviceSelectionConfig -> DeploymentStage
newDeploymentStage
Text
pStageName_
DeviceSelectionConfig
pDeviceSelectionConfig_ =
DeploymentStage'
{ $sel:deploymentConfig:DeploymentStage' :: Maybe EdgeDeploymentConfig
deploymentConfig =
forall a. Maybe a
Prelude.Nothing,
$sel:stageName:DeploymentStage' :: Text
stageName = Text
pStageName_,
$sel:deviceSelectionConfig:DeploymentStage' :: DeviceSelectionConfig
deviceSelectionConfig = DeviceSelectionConfig
pDeviceSelectionConfig_
}
deploymentStage_deploymentConfig :: Lens.Lens' DeploymentStage (Prelude.Maybe EdgeDeploymentConfig)
deploymentStage_deploymentConfig :: Lens' DeploymentStage (Maybe EdgeDeploymentConfig)
deploymentStage_deploymentConfig = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeploymentStage' {Maybe EdgeDeploymentConfig
deploymentConfig :: Maybe EdgeDeploymentConfig
$sel:deploymentConfig:DeploymentStage' :: DeploymentStage -> Maybe EdgeDeploymentConfig
deploymentConfig} -> Maybe EdgeDeploymentConfig
deploymentConfig) (\s :: DeploymentStage
s@DeploymentStage' {} Maybe EdgeDeploymentConfig
a -> DeploymentStage
s {$sel:deploymentConfig:DeploymentStage' :: Maybe EdgeDeploymentConfig
deploymentConfig = Maybe EdgeDeploymentConfig
a} :: DeploymentStage)
deploymentStage_stageName :: Lens.Lens' DeploymentStage Prelude.Text
deploymentStage_stageName :: Lens' DeploymentStage Text
deploymentStage_stageName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeploymentStage' {Text
stageName :: Text
$sel:stageName:DeploymentStage' :: DeploymentStage -> Text
stageName} -> Text
stageName) (\s :: DeploymentStage
s@DeploymentStage' {} Text
a -> DeploymentStage
s {$sel:stageName:DeploymentStage' :: Text
stageName = Text
a} :: DeploymentStage)
deploymentStage_deviceSelectionConfig :: Lens.Lens' DeploymentStage DeviceSelectionConfig
deploymentStage_deviceSelectionConfig :: Lens' DeploymentStage DeviceSelectionConfig
deploymentStage_deviceSelectionConfig = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeploymentStage' {DeviceSelectionConfig
deviceSelectionConfig :: DeviceSelectionConfig
$sel:deviceSelectionConfig:DeploymentStage' :: DeploymentStage -> DeviceSelectionConfig
deviceSelectionConfig} -> DeviceSelectionConfig
deviceSelectionConfig) (\s :: DeploymentStage
s@DeploymentStage' {} DeviceSelectionConfig
a -> DeploymentStage
s {$sel:deviceSelectionConfig:DeploymentStage' :: DeviceSelectionConfig
deviceSelectionConfig = DeviceSelectionConfig
a} :: DeploymentStage)
instance Prelude.Hashable DeploymentStage where
hashWithSalt :: Int -> DeploymentStage -> Int
hashWithSalt Int
_salt DeploymentStage' {Maybe EdgeDeploymentConfig
Text
DeviceSelectionConfig
deviceSelectionConfig :: DeviceSelectionConfig
stageName :: Text
deploymentConfig :: Maybe EdgeDeploymentConfig
$sel:deviceSelectionConfig:DeploymentStage' :: DeploymentStage -> DeviceSelectionConfig
$sel:stageName:DeploymentStage' :: DeploymentStage -> Text
$sel:deploymentConfig:DeploymentStage' :: DeploymentStage -> Maybe EdgeDeploymentConfig
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe EdgeDeploymentConfig
deploymentConfig
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
stageName
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` DeviceSelectionConfig
deviceSelectionConfig
instance Prelude.NFData DeploymentStage where
rnf :: DeploymentStage -> ()
rnf DeploymentStage' {Maybe EdgeDeploymentConfig
Text
DeviceSelectionConfig
deviceSelectionConfig :: DeviceSelectionConfig
stageName :: Text
deploymentConfig :: Maybe EdgeDeploymentConfig
$sel:deviceSelectionConfig:DeploymentStage' :: DeploymentStage -> DeviceSelectionConfig
$sel:stageName:DeploymentStage' :: DeploymentStage -> Text
$sel:deploymentConfig:DeploymentStage' :: DeploymentStage -> Maybe EdgeDeploymentConfig
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe EdgeDeploymentConfig
deploymentConfig
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
stageName
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf DeviceSelectionConfig
deviceSelectionConfig
instance Data.ToJSON DeploymentStage where
toJSON :: DeploymentStage -> Value
toJSON DeploymentStage' {Maybe EdgeDeploymentConfig
Text
DeviceSelectionConfig
deviceSelectionConfig :: DeviceSelectionConfig
stageName :: Text
deploymentConfig :: Maybe EdgeDeploymentConfig
$sel:deviceSelectionConfig:DeploymentStage' :: DeploymentStage -> DeviceSelectionConfig
$sel:stageName:DeploymentStage' :: DeploymentStage -> Text
$sel:deploymentConfig:DeploymentStage' :: DeploymentStage -> Maybe EdgeDeploymentConfig
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"DeploymentConfig" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe EdgeDeploymentConfig
deploymentConfig,
forall a. a -> Maybe a
Prelude.Just (Key
"StageName" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
stageName),
forall a. a -> Maybe a
Prelude.Just
( Key
"DeviceSelectionConfig"
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= DeviceSelectionConfig
deviceSelectionConfig
)
]
)