{-# 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.OfflineStoreConfig where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.SageMaker.Types.DataCatalogConfig
import Amazonka.SageMaker.Types.S3StorageConfig
data OfflineStoreConfig = OfflineStoreConfig'
{
OfflineStoreConfig -> Maybe Bool
disableGlueTableCreation :: Prelude.Maybe Prelude.Bool,
OfflineStoreConfig -> Maybe DataCatalogConfig
dataCatalogConfig :: Prelude.Maybe DataCatalogConfig,
OfflineStoreConfig -> S3StorageConfig
s3StorageConfig :: S3StorageConfig
}
deriving (OfflineStoreConfig -> OfflineStoreConfig -> Bool
(OfflineStoreConfig -> OfflineStoreConfig -> Bool)
-> (OfflineStoreConfig -> OfflineStoreConfig -> Bool)
-> Eq OfflineStoreConfig
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: OfflineStoreConfig -> OfflineStoreConfig -> Bool
$c/= :: OfflineStoreConfig -> OfflineStoreConfig -> Bool
== :: OfflineStoreConfig -> OfflineStoreConfig -> Bool
$c== :: OfflineStoreConfig -> OfflineStoreConfig -> Bool
Prelude.Eq, ReadPrec [OfflineStoreConfig]
ReadPrec OfflineStoreConfig
Int -> ReadS OfflineStoreConfig
ReadS [OfflineStoreConfig]
(Int -> ReadS OfflineStoreConfig)
-> ReadS [OfflineStoreConfig]
-> ReadPrec OfflineStoreConfig
-> ReadPrec [OfflineStoreConfig]
-> Read OfflineStoreConfig
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [OfflineStoreConfig]
$creadListPrec :: ReadPrec [OfflineStoreConfig]
readPrec :: ReadPrec OfflineStoreConfig
$creadPrec :: ReadPrec OfflineStoreConfig
readList :: ReadS [OfflineStoreConfig]
$creadList :: ReadS [OfflineStoreConfig]
readsPrec :: Int -> ReadS OfflineStoreConfig
$creadsPrec :: Int -> ReadS OfflineStoreConfig
Prelude.Read, Int -> OfflineStoreConfig -> ShowS
[OfflineStoreConfig] -> ShowS
OfflineStoreConfig -> String
(Int -> OfflineStoreConfig -> ShowS)
-> (OfflineStoreConfig -> String)
-> ([OfflineStoreConfig] -> ShowS)
-> Show OfflineStoreConfig
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [OfflineStoreConfig] -> ShowS
$cshowList :: [OfflineStoreConfig] -> ShowS
show :: OfflineStoreConfig -> String
$cshow :: OfflineStoreConfig -> String
showsPrec :: Int -> OfflineStoreConfig -> ShowS
$cshowsPrec :: Int -> OfflineStoreConfig -> ShowS
Prelude.Show, (forall x. OfflineStoreConfig -> Rep OfflineStoreConfig x)
-> (forall x. Rep OfflineStoreConfig x -> OfflineStoreConfig)
-> Generic OfflineStoreConfig
forall x. Rep OfflineStoreConfig x -> OfflineStoreConfig
forall x. OfflineStoreConfig -> Rep OfflineStoreConfig x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep OfflineStoreConfig x -> OfflineStoreConfig
$cfrom :: forall x. OfflineStoreConfig -> Rep OfflineStoreConfig x
Prelude.Generic)
newOfflineStoreConfig ::
S3StorageConfig ->
OfflineStoreConfig
newOfflineStoreConfig :: S3StorageConfig -> OfflineStoreConfig
newOfflineStoreConfig S3StorageConfig
pS3StorageConfig_ =
OfflineStoreConfig' :: Maybe Bool
-> Maybe DataCatalogConfig -> S3StorageConfig -> OfflineStoreConfig
OfflineStoreConfig'
{ $sel:disableGlueTableCreation:OfflineStoreConfig' :: Maybe Bool
disableGlueTableCreation =
Maybe Bool
forall a. Maybe a
Prelude.Nothing,
$sel:dataCatalogConfig:OfflineStoreConfig' :: Maybe DataCatalogConfig
dataCatalogConfig = Maybe DataCatalogConfig
forall a. Maybe a
Prelude.Nothing,
$sel:s3StorageConfig:OfflineStoreConfig' :: S3StorageConfig
s3StorageConfig = S3StorageConfig
pS3StorageConfig_
}
offlineStoreConfig_disableGlueTableCreation :: Lens.Lens' OfflineStoreConfig (Prelude.Maybe Prelude.Bool)
offlineStoreConfig_disableGlueTableCreation :: (Maybe Bool -> f (Maybe Bool))
-> OfflineStoreConfig -> f OfflineStoreConfig
offlineStoreConfig_disableGlueTableCreation = (OfflineStoreConfig -> Maybe Bool)
-> (OfflineStoreConfig -> Maybe Bool -> OfflineStoreConfig)
-> Lens
OfflineStoreConfig OfflineStoreConfig (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\OfflineStoreConfig' {Maybe Bool
disableGlueTableCreation :: Maybe Bool
$sel:disableGlueTableCreation:OfflineStoreConfig' :: OfflineStoreConfig -> Maybe Bool
disableGlueTableCreation} -> Maybe Bool
disableGlueTableCreation) (\s :: OfflineStoreConfig
s@OfflineStoreConfig' {} Maybe Bool
a -> OfflineStoreConfig
s {$sel:disableGlueTableCreation:OfflineStoreConfig' :: Maybe Bool
disableGlueTableCreation = Maybe Bool
a} :: OfflineStoreConfig)
offlineStoreConfig_dataCatalogConfig :: Lens.Lens' OfflineStoreConfig (Prelude.Maybe DataCatalogConfig)
offlineStoreConfig_dataCatalogConfig :: (Maybe DataCatalogConfig -> f (Maybe DataCatalogConfig))
-> OfflineStoreConfig -> f OfflineStoreConfig
offlineStoreConfig_dataCatalogConfig = (OfflineStoreConfig -> Maybe DataCatalogConfig)
-> (OfflineStoreConfig
-> Maybe DataCatalogConfig -> OfflineStoreConfig)
-> Lens
OfflineStoreConfig
OfflineStoreConfig
(Maybe DataCatalogConfig)
(Maybe DataCatalogConfig)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\OfflineStoreConfig' {Maybe DataCatalogConfig
dataCatalogConfig :: Maybe DataCatalogConfig
$sel:dataCatalogConfig:OfflineStoreConfig' :: OfflineStoreConfig -> Maybe DataCatalogConfig
dataCatalogConfig} -> Maybe DataCatalogConfig
dataCatalogConfig) (\s :: OfflineStoreConfig
s@OfflineStoreConfig' {} Maybe DataCatalogConfig
a -> OfflineStoreConfig
s {$sel:dataCatalogConfig:OfflineStoreConfig' :: Maybe DataCatalogConfig
dataCatalogConfig = Maybe DataCatalogConfig
a} :: OfflineStoreConfig)
offlineStoreConfig_s3StorageConfig :: Lens.Lens' OfflineStoreConfig S3StorageConfig
offlineStoreConfig_s3StorageConfig :: (S3StorageConfig -> f S3StorageConfig)
-> OfflineStoreConfig -> f OfflineStoreConfig
offlineStoreConfig_s3StorageConfig = (OfflineStoreConfig -> S3StorageConfig)
-> (OfflineStoreConfig -> S3StorageConfig -> OfflineStoreConfig)
-> Lens
OfflineStoreConfig
OfflineStoreConfig
S3StorageConfig
S3StorageConfig
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\OfflineStoreConfig' {S3StorageConfig
s3StorageConfig :: S3StorageConfig
$sel:s3StorageConfig:OfflineStoreConfig' :: OfflineStoreConfig -> S3StorageConfig
s3StorageConfig} -> S3StorageConfig
s3StorageConfig) (\s :: OfflineStoreConfig
s@OfflineStoreConfig' {} S3StorageConfig
a -> OfflineStoreConfig
s {$sel:s3StorageConfig:OfflineStoreConfig' :: S3StorageConfig
s3StorageConfig = S3StorageConfig
a} :: OfflineStoreConfig)
instance Core.FromJSON OfflineStoreConfig where
parseJSON :: Value -> Parser OfflineStoreConfig
parseJSON =
String
-> (Object -> Parser OfflineStoreConfig)
-> Value
-> Parser OfflineStoreConfig
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"OfflineStoreConfig"
( \Object
x ->
Maybe Bool
-> Maybe DataCatalogConfig -> S3StorageConfig -> OfflineStoreConfig
OfflineStoreConfig'
(Maybe Bool
-> Maybe DataCatalogConfig
-> S3StorageConfig
-> OfflineStoreConfig)
-> Parser (Maybe Bool)
-> Parser
(Maybe DataCatalogConfig -> S3StorageConfig -> OfflineStoreConfig)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"DisableGlueTableCreation")
Parser
(Maybe DataCatalogConfig -> S3StorageConfig -> OfflineStoreConfig)
-> Parser (Maybe DataCatalogConfig)
-> Parser (S3StorageConfig -> OfflineStoreConfig)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe DataCatalogConfig)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"DataCatalogConfig")
Parser (S3StorageConfig -> OfflineStoreConfig)
-> Parser S3StorageConfig -> Parser OfflineStoreConfig
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser S3StorageConfig
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"S3StorageConfig")
)
instance Prelude.Hashable OfflineStoreConfig
instance Prelude.NFData OfflineStoreConfig
instance Core.ToJSON OfflineStoreConfig where
toJSON :: OfflineStoreConfig -> Value
toJSON OfflineStoreConfig' {Maybe Bool
Maybe DataCatalogConfig
S3StorageConfig
s3StorageConfig :: S3StorageConfig
dataCatalogConfig :: Maybe DataCatalogConfig
disableGlueTableCreation :: Maybe Bool
$sel:s3StorageConfig:OfflineStoreConfig' :: OfflineStoreConfig -> S3StorageConfig
$sel:dataCatalogConfig:OfflineStoreConfig' :: OfflineStoreConfig -> Maybe DataCatalogConfig
$sel:disableGlueTableCreation:OfflineStoreConfig' :: OfflineStoreConfig -> Maybe Bool
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"DisableGlueTableCreation" Text -> Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(Bool -> Pair) -> Maybe Bool -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Bool
disableGlueTableCreation,
(Text
"DataCatalogConfig" Text -> DataCatalogConfig -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(DataCatalogConfig -> Pair)
-> Maybe DataCatalogConfig -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe DataCatalogConfig
dataCatalogConfig,
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
(Text
"S3StorageConfig" Text -> S3StorageConfig -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= S3StorageConfig
s3StorageConfig)
]
)