{-# 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.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.SageMaker.Types.EdgePresetDeploymentType
data EdgeOutputConfig = EdgeOutputConfig'
{
EdgeOutputConfig -> Maybe EdgePresetDeploymentType
presetDeploymentType :: Prelude.Maybe EdgePresetDeploymentType,
EdgeOutputConfig -> Maybe Text
kmsKeyId :: Prelude.Maybe Prelude.Text,
EdgeOutputConfig -> Maybe Text
presetDeploymentConfig :: Prelude.Maybe Prelude.Text,
EdgeOutputConfig -> Text
s3OutputLocation :: Prelude.Text
}
deriving (EdgeOutputConfig -> EdgeOutputConfig -> Bool
(EdgeOutputConfig -> EdgeOutputConfig -> Bool)
-> (EdgeOutputConfig -> EdgeOutputConfig -> Bool)
-> Eq EdgeOutputConfig
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]
(Int -> ReadS EdgeOutputConfig)
-> ReadS [EdgeOutputConfig]
-> ReadPrec EdgeOutputConfig
-> ReadPrec [EdgeOutputConfig]
-> Read 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
(Int -> EdgeOutputConfig -> ShowS)
-> (EdgeOutputConfig -> String)
-> ([EdgeOutputConfig] -> ShowS)
-> Show EdgeOutputConfig
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. EdgeOutputConfig -> Rep EdgeOutputConfig x)
-> (forall x. Rep EdgeOutputConfig x -> EdgeOutputConfig)
-> Generic EdgeOutputConfig
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' :: Maybe EdgePresetDeploymentType
-> Maybe Text -> Maybe Text -> Text -> EdgeOutputConfig
EdgeOutputConfig'
{ $sel:presetDeploymentType:EdgeOutputConfig' :: Maybe EdgePresetDeploymentType
presetDeploymentType =
Maybe EdgePresetDeploymentType
forall a. Maybe a
Prelude.Nothing,
$sel:kmsKeyId:EdgeOutputConfig' :: Maybe Text
kmsKeyId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:presetDeploymentConfig:EdgeOutputConfig' :: Maybe Text
presetDeploymentConfig = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:s3OutputLocation:EdgeOutputConfig' :: Text
s3OutputLocation = Text
pS3OutputLocation_
}
edgeOutputConfig_presetDeploymentType :: Lens.Lens' EdgeOutputConfig (Prelude.Maybe EdgePresetDeploymentType)
edgeOutputConfig_presetDeploymentType :: (Maybe EdgePresetDeploymentType
-> f (Maybe EdgePresetDeploymentType))
-> EdgeOutputConfig -> f EdgeOutputConfig
edgeOutputConfig_presetDeploymentType = (EdgeOutputConfig -> Maybe EdgePresetDeploymentType)
-> (EdgeOutputConfig
-> Maybe EdgePresetDeploymentType -> EdgeOutputConfig)
-> Lens
EdgeOutputConfig
EdgeOutputConfig
(Maybe EdgePresetDeploymentType)
(Maybe EdgePresetDeploymentType)
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_kmsKeyId :: Lens.Lens' EdgeOutputConfig (Prelude.Maybe Prelude.Text)
edgeOutputConfig_kmsKeyId :: (Maybe Text -> f (Maybe Text))
-> EdgeOutputConfig -> f EdgeOutputConfig
edgeOutputConfig_kmsKeyId = (EdgeOutputConfig -> Maybe Text)
-> (EdgeOutputConfig -> Maybe Text -> EdgeOutputConfig)
-> Lens EdgeOutputConfig EdgeOutputConfig (Maybe Text) (Maybe Text)
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 :: (Maybe Text -> f (Maybe Text))
-> EdgeOutputConfig -> f EdgeOutputConfig
edgeOutputConfig_presetDeploymentConfig = (EdgeOutputConfig -> Maybe Text)
-> (EdgeOutputConfig -> Maybe Text -> EdgeOutputConfig)
-> Lens EdgeOutputConfig EdgeOutputConfig (Maybe Text) (Maybe Text)
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_s3OutputLocation :: Lens.Lens' EdgeOutputConfig Prelude.Text
edgeOutputConfig_s3OutputLocation :: (Text -> f Text) -> EdgeOutputConfig -> f EdgeOutputConfig
edgeOutputConfig_s3OutputLocation = (EdgeOutputConfig -> Text)
-> (EdgeOutputConfig -> Text -> EdgeOutputConfig)
-> Lens EdgeOutputConfig EdgeOutputConfig Text Text
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 Core.FromJSON EdgeOutputConfig where
parseJSON :: Value -> Parser EdgeOutputConfig
parseJSON =
String
-> (Object -> Parser EdgeOutputConfig)
-> Value
-> Parser EdgeOutputConfig
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"EdgeOutputConfig"
( \Object
x ->
Maybe EdgePresetDeploymentType
-> Maybe Text -> Maybe Text -> Text -> EdgeOutputConfig
EdgeOutputConfig'
(Maybe EdgePresetDeploymentType
-> Maybe Text -> Maybe Text -> Text -> EdgeOutputConfig)
-> Parser (Maybe EdgePresetDeploymentType)
-> Parser (Maybe Text -> Maybe Text -> Text -> EdgeOutputConfig)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe EdgePresetDeploymentType)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"PresetDeploymentType")
Parser (Maybe Text -> Maybe Text -> Text -> EdgeOutputConfig)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Text -> EdgeOutputConfig)
forall (f :: * -> *) a b. Applicative f => 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
"KmsKeyId")
Parser (Maybe Text -> Text -> EdgeOutputConfig)
-> Parser (Maybe Text) -> Parser (Text -> EdgeOutputConfig)
forall (f :: * -> *) a b. Applicative f => 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
"PresetDeploymentConfig")
Parser (Text -> EdgeOutputConfig)
-> Parser Text -> Parser EdgeOutputConfig
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"S3OutputLocation")
)
instance Prelude.Hashable EdgeOutputConfig
instance Prelude.NFData EdgeOutputConfig
instance Core.ToJSON EdgeOutputConfig where
toJSON :: EdgeOutputConfig -> Value
toJSON EdgeOutputConfig' {Maybe Text
Maybe EdgePresetDeploymentType
Text
s3OutputLocation :: Text
presetDeploymentConfig :: Maybe Text
kmsKeyId :: Maybe Text
presetDeploymentType :: Maybe EdgePresetDeploymentType
$sel:s3OutputLocation:EdgeOutputConfig' :: EdgeOutputConfig -> Text
$sel:presetDeploymentConfig:EdgeOutputConfig' :: EdgeOutputConfig -> Maybe Text
$sel:kmsKeyId:EdgeOutputConfig' :: EdgeOutputConfig -> Maybe Text
$sel:presetDeploymentType:EdgeOutputConfig' :: EdgeOutputConfig -> Maybe EdgePresetDeploymentType
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"PresetDeploymentType" Text -> EdgePresetDeploymentType -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(EdgePresetDeploymentType -> Pair)
-> Maybe EdgePresetDeploymentType -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe EdgePresetDeploymentType
presetDeploymentType,
(Text
"KmsKeyId" 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
kmsKeyId,
(Text
"PresetDeploymentConfig" 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
presetDeploymentConfig,
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
(Text
"S3OutputLocation" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
s3OutputLocation)
]
)