{-# 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.FileSystemDataSource where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.SageMaker.Types.FileSystemAccessMode
import Amazonka.SageMaker.Types.FileSystemType
data FileSystemDataSource = FileSystemDataSource'
{
FileSystemDataSource -> Text
fileSystemId :: Prelude.Text,
FileSystemDataSource -> FileSystemAccessMode
fileSystemAccessMode :: FileSystemAccessMode,
FileSystemDataSource -> FileSystemType
fileSystemType :: FileSystemType,
FileSystemDataSource -> Text
directoryPath :: Prelude.Text
}
deriving (FileSystemDataSource -> FileSystemDataSource -> Bool
(FileSystemDataSource -> FileSystemDataSource -> Bool)
-> (FileSystemDataSource -> FileSystemDataSource -> Bool)
-> Eq FileSystemDataSource
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: FileSystemDataSource -> FileSystemDataSource -> Bool
$c/= :: FileSystemDataSource -> FileSystemDataSource -> Bool
== :: FileSystemDataSource -> FileSystemDataSource -> Bool
$c== :: FileSystemDataSource -> FileSystemDataSource -> Bool
Prelude.Eq, ReadPrec [FileSystemDataSource]
ReadPrec FileSystemDataSource
Int -> ReadS FileSystemDataSource
ReadS [FileSystemDataSource]
(Int -> ReadS FileSystemDataSource)
-> ReadS [FileSystemDataSource]
-> ReadPrec FileSystemDataSource
-> ReadPrec [FileSystemDataSource]
-> Read FileSystemDataSource
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [FileSystemDataSource]
$creadListPrec :: ReadPrec [FileSystemDataSource]
readPrec :: ReadPrec FileSystemDataSource
$creadPrec :: ReadPrec FileSystemDataSource
readList :: ReadS [FileSystemDataSource]
$creadList :: ReadS [FileSystemDataSource]
readsPrec :: Int -> ReadS FileSystemDataSource
$creadsPrec :: Int -> ReadS FileSystemDataSource
Prelude.Read, Int -> FileSystemDataSource -> ShowS
[FileSystemDataSource] -> ShowS
FileSystemDataSource -> String
(Int -> FileSystemDataSource -> ShowS)
-> (FileSystemDataSource -> String)
-> ([FileSystemDataSource] -> ShowS)
-> Show FileSystemDataSource
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [FileSystemDataSource] -> ShowS
$cshowList :: [FileSystemDataSource] -> ShowS
show :: FileSystemDataSource -> String
$cshow :: FileSystemDataSource -> String
showsPrec :: Int -> FileSystemDataSource -> ShowS
$cshowsPrec :: Int -> FileSystemDataSource -> ShowS
Prelude.Show, (forall x. FileSystemDataSource -> Rep FileSystemDataSource x)
-> (forall x. Rep FileSystemDataSource x -> FileSystemDataSource)
-> Generic FileSystemDataSource
forall x. Rep FileSystemDataSource x -> FileSystemDataSource
forall x. FileSystemDataSource -> Rep FileSystemDataSource x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep FileSystemDataSource x -> FileSystemDataSource
$cfrom :: forall x. FileSystemDataSource -> Rep FileSystemDataSource x
Prelude.Generic)
newFileSystemDataSource ::
Prelude.Text ->
FileSystemAccessMode ->
FileSystemType ->
Prelude.Text ->
FileSystemDataSource
newFileSystemDataSource :: Text
-> FileSystemAccessMode
-> FileSystemType
-> Text
-> FileSystemDataSource
newFileSystemDataSource
Text
pFileSystemId_
FileSystemAccessMode
pFileSystemAccessMode_
FileSystemType
pFileSystemType_
Text
pDirectoryPath_ =
FileSystemDataSource' :: Text
-> FileSystemAccessMode
-> FileSystemType
-> Text
-> FileSystemDataSource
FileSystemDataSource'
{ $sel:fileSystemId:FileSystemDataSource' :: Text
fileSystemId =
Text
pFileSystemId_,
$sel:fileSystemAccessMode:FileSystemDataSource' :: FileSystemAccessMode
fileSystemAccessMode = FileSystemAccessMode
pFileSystemAccessMode_,
$sel:fileSystemType:FileSystemDataSource' :: FileSystemType
fileSystemType = FileSystemType
pFileSystemType_,
$sel:directoryPath:FileSystemDataSource' :: Text
directoryPath = Text
pDirectoryPath_
}
fileSystemDataSource_fileSystemId :: Lens.Lens' FileSystemDataSource Prelude.Text
fileSystemDataSource_fileSystemId :: (Text -> f Text) -> FileSystemDataSource -> f FileSystemDataSource
fileSystemDataSource_fileSystemId = (FileSystemDataSource -> Text)
-> (FileSystemDataSource -> Text -> FileSystemDataSource)
-> Lens FileSystemDataSource FileSystemDataSource Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FileSystemDataSource' {Text
fileSystemId :: Text
$sel:fileSystemId:FileSystemDataSource' :: FileSystemDataSource -> Text
fileSystemId} -> Text
fileSystemId) (\s :: FileSystemDataSource
s@FileSystemDataSource' {} Text
a -> FileSystemDataSource
s {$sel:fileSystemId:FileSystemDataSource' :: Text
fileSystemId = Text
a} :: FileSystemDataSource)
fileSystemDataSource_fileSystemAccessMode :: Lens.Lens' FileSystemDataSource FileSystemAccessMode
fileSystemDataSource_fileSystemAccessMode :: (FileSystemAccessMode -> f FileSystemAccessMode)
-> FileSystemDataSource -> f FileSystemDataSource
fileSystemDataSource_fileSystemAccessMode = (FileSystemDataSource -> FileSystemAccessMode)
-> (FileSystemDataSource
-> FileSystemAccessMode -> FileSystemDataSource)
-> Lens
FileSystemDataSource
FileSystemDataSource
FileSystemAccessMode
FileSystemAccessMode
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FileSystemDataSource' {FileSystemAccessMode
fileSystemAccessMode :: FileSystemAccessMode
$sel:fileSystemAccessMode:FileSystemDataSource' :: FileSystemDataSource -> FileSystemAccessMode
fileSystemAccessMode} -> FileSystemAccessMode
fileSystemAccessMode) (\s :: FileSystemDataSource
s@FileSystemDataSource' {} FileSystemAccessMode
a -> FileSystemDataSource
s {$sel:fileSystemAccessMode:FileSystemDataSource' :: FileSystemAccessMode
fileSystemAccessMode = FileSystemAccessMode
a} :: FileSystemDataSource)
fileSystemDataSource_fileSystemType :: Lens.Lens' FileSystemDataSource FileSystemType
fileSystemDataSource_fileSystemType :: (FileSystemType -> f FileSystemType)
-> FileSystemDataSource -> f FileSystemDataSource
fileSystemDataSource_fileSystemType = (FileSystemDataSource -> FileSystemType)
-> (FileSystemDataSource -> FileSystemType -> FileSystemDataSource)
-> Lens
FileSystemDataSource
FileSystemDataSource
FileSystemType
FileSystemType
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FileSystemDataSource' {FileSystemType
fileSystemType :: FileSystemType
$sel:fileSystemType:FileSystemDataSource' :: FileSystemDataSource -> FileSystemType
fileSystemType} -> FileSystemType
fileSystemType) (\s :: FileSystemDataSource
s@FileSystemDataSource' {} FileSystemType
a -> FileSystemDataSource
s {$sel:fileSystemType:FileSystemDataSource' :: FileSystemType
fileSystemType = FileSystemType
a} :: FileSystemDataSource)
fileSystemDataSource_directoryPath :: Lens.Lens' FileSystemDataSource Prelude.Text
fileSystemDataSource_directoryPath :: (Text -> f Text) -> FileSystemDataSource -> f FileSystemDataSource
fileSystemDataSource_directoryPath = (FileSystemDataSource -> Text)
-> (FileSystemDataSource -> Text -> FileSystemDataSource)
-> Lens FileSystemDataSource FileSystemDataSource Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FileSystemDataSource' {Text
directoryPath :: Text
$sel:directoryPath:FileSystemDataSource' :: FileSystemDataSource -> Text
directoryPath} -> Text
directoryPath) (\s :: FileSystemDataSource
s@FileSystemDataSource' {} Text
a -> FileSystemDataSource
s {$sel:directoryPath:FileSystemDataSource' :: Text
directoryPath = Text
a} :: FileSystemDataSource)
instance Core.FromJSON FileSystemDataSource where
parseJSON :: Value -> Parser FileSystemDataSource
parseJSON =
String
-> (Object -> Parser FileSystemDataSource)
-> Value
-> Parser FileSystemDataSource
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"FileSystemDataSource"
( \Object
x ->
Text
-> FileSystemAccessMode
-> FileSystemType
-> Text
-> FileSystemDataSource
FileSystemDataSource'
(Text
-> FileSystemAccessMode
-> FileSystemType
-> Text
-> FileSystemDataSource)
-> Parser Text
-> Parser
(FileSystemAccessMode
-> FileSystemType -> Text -> FileSystemDataSource)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"FileSystemId")
Parser
(FileSystemAccessMode
-> FileSystemType -> Text -> FileSystemDataSource)
-> Parser FileSystemAccessMode
-> Parser (FileSystemType -> Text -> FileSystemDataSource)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser FileSystemAccessMode
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"FileSystemAccessMode")
Parser (FileSystemType -> Text -> FileSystemDataSource)
-> Parser FileSystemType -> Parser (Text -> FileSystemDataSource)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser FileSystemType
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"FileSystemType")
Parser (Text -> FileSystemDataSource)
-> Parser Text -> Parser FileSystemDataSource
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
"DirectoryPath")
)
instance Prelude.Hashable FileSystemDataSource
instance Prelude.NFData FileSystemDataSource
instance Core.ToJSON FileSystemDataSource where
toJSON :: FileSystemDataSource -> Value
toJSON FileSystemDataSource' {Text
FileSystemAccessMode
FileSystemType
directoryPath :: Text
fileSystemType :: FileSystemType
fileSystemAccessMode :: FileSystemAccessMode
fileSystemId :: Text
$sel:directoryPath:FileSystemDataSource' :: FileSystemDataSource -> Text
$sel:fileSystemType:FileSystemDataSource' :: FileSystemDataSource -> FileSystemType
$sel:fileSystemAccessMode:FileSystemDataSource' :: FileSystemDataSource -> FileSystemAccessMode
$sel:fileSystemId:FileSystemDataSource' :: FileSystemDataSource -> Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"FileSystemId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
fileSystemId),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
( Text
"FileSystemAccessMode"
Text -> FileSystemAccessMode -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= FileSystemAccessMode
fileSystemAccessMode
),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
(Text
"FileSystemType" Text -> FileSystemType -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= FileSystemType
fileSystemType),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
(Text
"DirectoryPath" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
directoryPath)
]
)