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