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