{-# 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.EdgeOutputConfig 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.EdgePresetDeploymentType
data EdgeOutputConfig = EdgeOutputConfig'
{
EdgeOutputConfig -> Maybe Text
kmsKeyId :: Prelude.Maybe Prelude.Text,
EdgeOutputConfig -> Maybe Text
presetDeploymentConfig :: Prelude.Maybe Prelude.Text,
EdgeOutputConfig -> Maybe EdgePresetDeploymentType
presetDeploymentType :: Prelude.Maybe EdgePresetDeploymentType,
EdgeOutputConfig -> Text
s3OutputLocation :: Prelude.Text
}
deriving (EdgeOutputConfig -> EdgeOutputConfig -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: EdgeOutputConfig -> EdgeOutputConfig -> Bool
$c/= :: EdgeOutputConfig -> EdgeOutputConfig -> Bool
== :: EdgeOutputConfig -> EdgeOutputConfig -> Bool
$c== :: EdgeOutputConfig -> EdgeOutputConfig -> Bool
Prelude.Eq, ReadPrec [EdgeOutputConfig]
ReadPrec EdgeOutputConfig
Int -> ReadS EdgeOutputConfig
ReadS [EdgeOutputConfig]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [EdgeOutputConfig]
$creadListPrec :: ReadPrec [EdgeOutputConfig]
readPrec :: ReadPrec EdgeOutputConfig
$creadPrec :: ReadPrec EdgeOutputConfig
readList :: ReadS [EdgeOutputConfig]
$creadList :: ReadS [EdgeOutputConfig]
readsPrec :: Int -> ReadS EdgeOutputConfig
$creadsPrec :: Int -> ReadS EdgeOutputConfig
Prelude.Read, Int -> EdgeOutputConfig -> ShowS
[EdgeOutputConfig] -> ShowS
EdgeOutputConfig -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [EdgeOutputConfig] -> ShowS
$cshowList :: [EdgeOutputConfig] -> ShowS
show :: EdgeOutputConfig -> String
$cshow :: EdgeOutputConfig -> String
showsPrec :: Int -> EdgeOutputConfig -> ShowS
$cshowsPrec :: Int -> EdgeOutputConfig -> ShowS
Prelude.Show, forall x. Rep EdgeOutputConfig x -> EdgeOutputConfig
forall x. EdgeOutputConfig -> Rep EdgeOutputConfig x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep EdgeOutputConfig x -> EdgeOutputConfig
$cfrom :: forall x. EdgeOutputConfig -> Rep EdgeOutputConfig x
Prelude.Generic)
newEdgeOutputConfig ::
Prelude.Text ->
EdgeOutputConfig
newEdgeOutputConfig :: Text -> EdgeOutputConfig
newEdgeOutputConfig Text
pS3OutputLocation_ =
EdgeOutputConfig'
{ $sel:kmsKeyId:EdgeOutputConfig' :: Maybe Text
kmsKeyId = forall a. Maybe a
Prelude.Nothing,
$sel:presetDeploymentConfig:EdgeOutputConfig' :: Maybe Text
presetDeploymentConfig = forall a. Maybe a
Prelude.Nothing,
$sel:presetDeploymentType:EdgeOutputConfig' :: Maybe EdgePresetDeploymentType
presetDeploymentType = forall a. Maybe a
Prelude.Nothing,
$sel:s3OutputLocation:EdgeOutputConfig' :: Text
s3OutputLocation = Text
pS3OutputLocation_
}
edgeOutputConfig_kmsKeyId :: Lens.Lens' EdgeOutputConfig (Prelude.Maybe Prelude.Text)
edgeOutputConfig_kmsKeyId :: Lens' EdgeOutputConfig (Maybe Text)
edgeOutputConfig_kmsKeyId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EdgeOutputConfig' {Maybe Text
kmsKeyId :: Maybe Text
$sel:kmsKeyId:EdgeOutputConfig' :: EdgeOutputConfig -> Maybe Text
kmsKeyId} -> Maybe Text
kmsKeyId) (\s :: EdgeOutputConfig
s@EdgeOutputConfig' {} Maybe Text
a -> EdgeOutputConfig
s {$sel:kmsKeyId:EdgeOutputConfig' :: Maybe Text
kmsKeyId = Maybe Text
a} :: EdgeOutputConfig)
edgeOutputConfig_presetDeploymentConfig :: Lens.Lens' EdgeOutputConfig (Prelude.Maybe Prelude.Text)
edgeOutputConfig_presetDeploymentConfig :: Lens' EdgeOutputConfig (Maybe Text)
edgeOutputConfig_presetDeploymentConfig = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EdgeOutputConfig' {Maybe Text
presetDeploymentConfig :: Maybe Text
$sel:presetDeploymentConfig:EdgeOutputConfig' :: EdgeOutputConfig -> Maybe Text
presetDeploymentConfig} -> Maybe Text
presetDeploymentConfig) (\s :: EdgeOutputConfig
s@EdgeOutputConfig' {} Maybe Text
a -> EdgeOutputConfig
s {$sel:presetDeploymentConfig:EdgeOutputConfig' :: Maybe Text
presetDeploymentConfig = Maybe Text
a} :: EdgeOutputConfig)
edgeOutputConfig_presetDeploymentType :: Lens.Lens' EdgeOutputConfig (Prelude.Maybe EdgePresetDeploymentType)
edgeOutputConfig_presetDeploymentType :: Lens' EdgeOutputConfig (Maybe EdgePresetDeploymentType)
edgeOutputConfig_presetDeploymentType = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EdgeOutputConfig' {Maybe EdgePresetDeploymentType
presetDeploymentType :: Maybe EdgePresetDeploymentType
$sel:presetDeploymentType:EdgeOutputConfig' :: EdgeOutputConfig -> Maybe EdgePresetDeploymentType
presetDeploymentType} -> Maybe EdgePresetDeploymentType
presetDeploymentType) (\s :: EdgeOutputConfig
s@EdgeOutputConfig' {} Maybe EdgePresetDeploymentType
a -> EdgeOutputConfig
s {$sel:presetDeploymentType:EdgeOutputConfig' :: Maybe EdgePresetDeploymentType
presetDeploymentType = Maybe EdgePresetDeploymentType
a} :: EdgeOutputConfig)
edgeOutputConfig_s3OutputLocation :: Lens.Lens' EdgeOutputConfig Prelude.Text
edgeOutputConfig_s3OutputLocation :: Lens' EdgeOutputConfig Text
edgeOutputConfig_s3OutputLocation = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EdgeOutputConfig' {Text
s3OutputLocation :: Text
$sel:s3OutputLocation:EdgeOutputConfig' :: EdgeOutputConfig -> Text
s3OutputLocation} -> Text
s3OutputLocation) (\s :: EdgeOutputConfig
s@EdgeOutputConfig' {} Text
a -> EdgeOutputConfig
s {$sel:s3OutputLocation:EdgeOutputConfig' :: Text
s3OutputLocation = Text
a} :: EdgeOutputConfig)
instance Data.FromJSON EdgeOutputConfig where
parseJSON :: Value -> Parser EdgeOutputConfig
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"EdgeOutputConfig"
( \Object
x ->
Maybe Text
-> Maybe Text
-> Maybe EdgePresetDeploymentType
-> Text
-> EdgeOutputConfig
EdgeOutputConfig'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"KmsKeyId")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"PresetDeploymentConfig")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"PresetDeploymentType")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"S3OutputLocation")
)
instance Prelude.Hashable EdgeOutputConfig where
hashWithSalt :: Int -> EdgeOutputConfig -> Int
hashWithSalt Int
_salt EdgeOutputConfig' {Maybe Text
Maybe EdgePresetDeploymentType
Text
s3OutputLocation :: Text
presetDeploymentType :: Maybe EdgePresetDeploymentType
presetDeploymentConfig :: Maybe Text
kmsKeyId :: Maybe Text
$sel:s3OutputLocation:EdgeOutputConfig' :: EdgeOutputConfig -> Text
$sel:presetDeploymentType:EdgeOutputConfig' :: EdgeOutputConfig -> Maybe EdgePresetDeploymentType
$sel:presetDeploymentConfig:EdgeOutputConfig' :: EdgeOutputConfig -> Maybe Text
$sel:kmsKeyId:EdgeOutputConfig' :: EdgeOutputConfig -> Maybe Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
kmsKeyId
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
presetDeploymentConfig
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe EdgePresetDeploymentType
presetDeploymentType
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
s3OutputLocation
instance Prelude.NFData EdgeOutputConfig where
rnf :: EdgeOutputConfig -> ()
rnf EdgeOutputConfig' {Maybe Text
Maybe EdgePresetDeploymentType
Text
s3OutputLocation :: Text
presetDeploymentType :: Maybe EdgePresetDeploymentType
presetDeploymentConfig :: Maybe Text
kmsKeyId :: Maybe Text
$sel:s3OutputLocation:EdgeOutputConfig' :: EdgeOutputConfig -> Text
$sel:presetDeploymentType:EdgeOutputConfig' :: EdgeOutputConfig -> Maybe EdgePresetDeploymentType
$sel:presetDeploymentConfig:EdgeOutputConfig' :: EdgeOutputConfig -> Maybe Text
$sel:kmsKeyId:EdgeOutputConfig' :: EdgeOutputConfig -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
kmsKeyId
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
presetDeploymentConfig
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe EdgePresetDeploymentType
presetDeploymentType
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
s3OutputLocation
instance Data.ToJSON EdgeOutputConfig where
toJSON :: EdgeOutputConfig -> Value
toJSON EdgeOutputConfig' {Maybe Text
Maybe EdgePresetDeploymentType
Text
s3OutputLocation :: Text
presetDeploymentType :: Maybe EdgePresetDeploymentType
presetDeploymentConfig :: Maybe Text
kmsKeyId :: Maybe Text
$sel:s3OutputLocation:EdgeOutputConfig' :: EdgeOutputConfig -> Text
$sel:presetDeploymentType:EdgeOutputConfig' :: EdgeOutputConfig -> Maybe EdgePresetDeploymentType
$sel:presetDeploymentConfig:EdgeOutputConfig' :: EdgeOutputConfig -> Maybe Text
$sel:kmsKeyId:EdgeOutputConfig' :: EdgeOutputConfig -> Maybe Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"KmsKeyId" 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 Text
kmsKeyId,
(Key
"PresetDeploymentConfig" 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 Text
presetDeploymentConfig,
(Key
"PresetDeploymentType" 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 EdgePresetDeploymentType
presetDeploymentType,
forall a. a -> Maybe a
Prelude.Just
(Key
"S3OutputLocation" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
s3OutputLocation)
]
)