{-# 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.UserSettings where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.SageMaker.Types.JupyterServerAppSettings
import Amazonka.SageMaker.Types.KernelGatewayAppSettings
import Amazonka.SageMaker.Types.SharingSettings
import Amazonka.SageMaker.Types.TensorBoardAppSettings
data UserSettings = UserSettings'
{
UserSettings -> Maybe TensorBoardAppSettings
tensorBoardAppSettings :: Prelude.Maybe TensorBoardAppSettings,
UserSettings -> Maybe KernelGatewayAppSettings
kernelGatewayAppSettings :: Prelude.Maybe KernelGatewayAppSettings,
UserSettings -> Maybe [Text]
securityGroups :: Prelude.Maybe [Prelude.Text],
UserSettings -> Maybe JupyterServerAppSettings
jupyterServerAppSettings :: Prelude.Maybe JupyterServerAppSettings,
UserSettings -> Maybe SharingSettings
sharingSettings :: Prelude.Maybe SharingSettings,
UserSettings -> Maybe Text
executionRole :: Prelude.Maybe Prelude.Text
}
deriving (UserSettings -> UserSettings -> Bool
(UserSettings -> UserSettings -> Bool)
-> (UserSettings -> UserSettings -> Bool) -> Eq UserSettings
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UserSettings -> UserSettings -> Bool
$c/= :: UserSettings -> UserSettings -> Bool
== :: UserSettings -> UserSettings -> Bool
$c== :: UserSettings -> UserSettings -> Bool
Prelude.Eq, ReadPrec [UserSettings]
ReadPrec UserSettings
Int -> ReadS UserSettings
ReadS [UserSettings]
(Int -> ReadS UserSettings)
-> ReadS [UserSettings]
-> ReadPrec UserSettings
-> ReadPrec [UserSettings]
-> Read UserSettings
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UserSettings]
$creadListPrec :: ReadPrec [UserSettings]
readPrec :: ReadPrec UserSettings
$creadPrec :: ReadPrec UserSettings
readList :: ReadS [UserSettings]
$creadList :: ReadS [UserSettings]
readsPrec :: Int -> ReadS UserSettings
$creadsPrec :: Int -> ReadS UserSettings
Prelude.Read, Int -> UserSettings -> ShowS
[UserSettings] -> ShowS
UserSettings -> String
(Int -> UserSettings -> ShowS)
-> (UserSettings -> String)
-> ([UserSettings] -> ShowS)
-> Show UserSettings
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UserSettings] -> ShowS
$cshowList :: [UserSettings] -> ShowS
show :: UserSettings -> String
$cshow :: UserSettings -> String
showsPrec :: Int -> UserSettings -> ShowS
$cshowsPrec :: Int -> UserSettings -> ShowS
Prelude.Show, (forall x. UserSettings -> Rep UserSettings x)
-> (forall x. Rep UserSettings x -> UserSettings)
-> Generic UserSettings
forall x. Rep UserSettings x -> UserSettings
forall x. UserSettings -> Rep UserSettings x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UserSettings x -> UserSettings
$cfrom :: forall x. UserSettings -> Rep UserSettings x
Prelude.Generic)
newUserSettings ::
UserSettings
newUserSettings :: UserSettings
newUserSettings =
UserSettings' :: Maybe TensorBoardAppSettings
-> Maybe KernelGatewayAppSettings
-> Maybe [Text]
-> Maybe JupyterServerAppSettings
-> Maybe SharingSettings
-> Maybe Text
-> UserSettings
UserSettings'
{ $sel:tensorBoardAppSettings:UserSettings' :: Maybe TensorBoardAppSettings
tensorBoardAppSettings =
Maybe TensorBoardAppSettings
forall a. Maybe a
Prelude.Nothing,
$sel:kernelGatewayAppSettings:UserSettings' :: Maybe KernelGatewayAppSettings
kernelGatewayAppSettings = Maybe KernelGatewayAppSettings
forall a. Maybe a
Prelude.Nothing,
$sel:securityGroups:UserSettings' :: Maybe [Text]
securityGroups = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
$sel:jupyterServerAppSettings:UserSettings' :: Maybe JupyterServerAppSettings
jupyterServerAppSettings = Maybe JupyterServerAppSettings
forall a. Maybe a
Prelude.Nothing,
$sel:sharingSettings:UserSettings' :: Maybe SharingSettings
sharingSettings = Maybe SharingSettings
forall a. Maybe a
Prelude.Nothing,
$sel:executionRole:UserSettings' :: Maybe Text
executionRole = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
userSettings_tensorBoardAppSettings :: Lens.Lens' UserSettings (Prelude.Maybe TensorBoardAppSettings)
userSettings_tensorBoardAppSettings :: (Maybe TensorBoardAppSettings -> f (Maybe TensorBoardAppSettings))
-> UserSettings -> f UserSettings
userSettings_tensorBoardAppSettings = (UserSettings -> Maybe TensorBoardAppSettings)
-> (UserSettings -> Maybe TensorBoardAppSettings -> UserSettings)
-> Lens
UserSettings
UserSettings
(Maybe TensorBoardAppSettings)
(Maybe TensorBoardAppSettings)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UserSettings' {Maybe TensorBoardAppSettings
tensorBoardAppSettings :: Maybe TensorBoardAppSettings
$sel:tensorBoardAppSettings:UserSettings' :: UserSettings -> Maybe TensorBoardAppSettings
tensorBoardAppSettings} -> Maybe TensorBoardAppSettings
tensorBoardAppSettings) (\s :: UserSettings
s@UserSettings' {} Maybe TensorBoardAppSettings
a -> UserSettings
s {$sel:tensorBoardAppSettings:UserSettings' :: Maybe TensorBoardAppSettings
tensorBoardAppSettings = Maybe TensorBoardAppSettings
a} :: UserSettings)
userSettings_kernelGatewayAppSettings :: Lens.Lens' UserSettings (Prelude.Maybe KernelGatewayAppSettings)
userSettings_kernelGatewayAppSettings :: (Maybe KernelGatewayAppSettings
-> f (Maybe KernelGatewayAppSettings))
-> UserSettings -> f UserSettings
userSettings_kernelGatewayAppSettings = (UserSettings -> Maybe KernelGatewayAppSettings)
-> (UserSettings -> Maybe KernelGatewayAppSettings -> UserSettings)
-> Lens
UserSettings
UserSettings
(Maybe KernelGatewayAppSettings)
(Maybe KernelGatewayAppSettings)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UserSettings' {Maybe KernelGatewayAppSettings
kernelGatewayAppSettings :: Maybe KernelGatewayAppSettings
$sel:kernelGatewayAppSettings:UserSettings' :: UserSettings -> Maybe KernelGatewayAppSettings
kernelGatewayAppSettings} -> Maybe KernelGatewayAppSettings
kernelGatewayAppSettings) (\s :: UserSettings
s@UserSettings' {} Maybe KernelGatewayAppSettings
a -> UserSettings
s {$sel:kernelGatewayAppSettings:UserSettings' :: Maybe KernelGatewayAppSettings
kernelGatewayAppSettings = Maybe KernelGatewayAppSettings
a} :: UserSettings)
userSettings_securityGroups :: Lens.Lens' UserSettings (Prelude.Maybe [Prelude.Text])
userSettings_securityGroups :: (Maybe [Text] -> f (Maybe [Text]))
-> UserSettings -> f UserSettings
userSettings_securityGroups = (UserSettings -> Maybe [Text])
-> (UserSettings -> Maybe [Text] -> UserSettings)
-> Lens UserSettings UserSettings (Maybe [Text]) (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UserSettings' {Maybe [Text]
securityGroups :: Maybe [Text]
$sel:securityGroups:UserSettings' :: UserSettings -> Maybe [Text]
securityGroups} -> Maybe [Text]
securityGroups) (\s :: UserSettings
s@UserSettings' {} Maybe [Text]
a -> UserSettings
s {$sel:securityGroups:UserSettings' :: Maybe [Text]
securityGroups = Maybe [Text]
a} :: UserSettings) ((Maybe [Text] -> f (Maybe [Text]))
-> UserSettings -> f UserSettings)
-> ((Maybe [Text] -> f (Maybe [Text]))
-> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> UserSettings
-> f UserSettings
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [Text]) (Maybe [Text]) (Maybe [Text])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso [Text] [Text] [Text] [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
userSettings_jupyterServerAppSettings :: Lens.Lens' UserSettings (Prelude.Maybe JupyterServerAppSettings)
userSettings_jupyterServerAppSettings :: (Maybe JupyterServerAppSettings
-> f (Maybe JupyterServerAppSettings))
-> UserSettings -> f UserSettings
userSettings_jupyterServerAppSettings = (UserSettings -> Maybe JupyterServerAppSettings)
-> (UserSettings -> Maybe JupyterServerAppSettings -> UserSettings)
-> Lens
UserSettings
UserSettings
(Maybe JupyterServerAppSettings)
(Maybe JupyterServerAppSettings)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UserSettings' {Maybe JupyterServerAppSettings
jupyterServerAppSettings :: Maybe JupyterServerAppSettings
$sel:jupyterServerAppSettings:UserSettings' :: UserSettings -> Maybe JupyterServerAppSettings
jupyterServerAppSettings} -> Maybe JupyterServerAppSettings
jupyterServerAppSettings) (\s :: UserSettings
s@UserSettings' {} Maybe JupyterServerAppSettings
a -> UserSettings
s {$sel:jupyterServerAppSettings:UserSettings' :: Maybe JupyterServerAppSettings
jupyterServerAppSettings = Maybe JupyterServerAppSettings
a} :: UserSettings)
userSettings_sharingSettings :: Lens.Lens' UserSettings (Prelude.Maybe SharingSettings)
userSettings_sharingSettings :: (Maybe SharingSettings -> f (Maybe SharingSettings))
-> UserSettings -> f UserSettings
userSettings_sharingSettings = (UserSettings -> Maybe SharingSettings)
-> (UserSettings -> Maybe SharingSettings -> UserSettings)
-> Lens
UserSettings
UserSettings
(Maybe SharingSettings)
(Maybe SharingSettings)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UserSettings' {Maybe SharingSettings
sharingSettings :: Maybe SharingSettings
$sel:sharingSettings:UserSettings' :: UserSettings -> Maybe SharingSettings
sharingSettings} -> Maybe SharingSettings
sharingSettings) (\s :: UserSettings
s@UserSettings' {} Maybe SharingSettings
a -> UserSettings
s {$sel:sharingSettings:UserSettings' :: Maybe SharingSettings
sharingSettings = Maybe SharingSettings
a} :: UserSettings)
userSettings_executionRole :: Lens.Lens' UserSettings (Prelude.Maybe Prelude.Text)
userSettings_executionRole :: (Maybe Text -> f (Maybe Text)) -> UserSettings -> f UserSettings
userSettings_executionRole = (UserSettings -> Maybe Text)
-> (UserSettings -> Maybe Text -> UserSettings)
-> Lens UserSettings UserSettings (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UserSettings' {Maybe Text
executionRole :: Maybe Text
$sel:executionRole:UserSettings' :: UserSettings -> Maybe Text
executionRole} -> Maybe Text
executionRole) (\s :: UserSettings
s@UserSettings' {} Maybe Text
a -> UserSettings
s {$sel:executionRole:UserSettings' :: Maybe Text
executionRole = Maybe Text
a} :: UserSettings)
instance Core.FromJSON UserSettings where
parseJSON :: Value -> Parser UserSettings
parseJSON =
String
-> (Object -> Parser UserSettings) -> Value -> Parser UserSettings
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"UserSettings"
( \Object
x ->
Maybe TensorBoardAppSettings
-> Maybe KernelGatewayAppSettings
-> Maybe [Text]
-> Maybe JupyterServerAppSettings
-> Maybe SharingSettings
-> Maybe Text
-> UserSettings
UserSettings'
(Maybe TensorBoardAppSettings
-> Maybe KernelGatewayAppSettings
-> Maybe [Text]
-> Maybe JupyterServerAppSettings
-> Maybe SharingSettings
-> Maybe Text
-> UserSettings)
-> Parser (Maybe TensorBoardAppSettings)
-> Parser
(Maybe KernelGatewayAppSettings
-> Maybe [Text]
-> Maybe JupyterServerAppSettings
-> Maybe SharingSettings
-> Maybe Text
-> UserSettings)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe TensorBoardAppSettings)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"TensorBoardAppSettings")
Parser
(Maybe KernelGatewayAppSettings
-> Maybe [Text]
-> Maybe JupyterServerAppSettings
-> Maybe SharingSettings
-> Maybe Text
-> UserSettings)
-> Parser (Maybe KernelGatewayAppSettings)
-> Parser
(Maybe [Text]
-> Maybe JupyterServerAppSettings
-> Maybe SharingSettings
-> Maybe Text
-> UserSettings)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe KernelGatewayAppSettings)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"KernelGatewayAppSettings")
Parser
(Maybe [Text]
-> Maybe JupyterServerAppSettings
-> Maybe SharingSettings
-> Maybe Text
-> UserSettings)
-> Parser (Maybe [Text])
-> Parser
(Maybe JupyterServerAppSettings
-> Maybe SharingSettings -> Maybe Text -> UserSettings)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (Maybe [Text]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"SecurityGroups" Parser (Maybe (Maybe [Text]))
-> Maybe [Text] -> Parser (Maybe [Text])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [Text]
forall a. Monoid a => a
Prelude.mempty)
Parser
(Maybe JupyterServerAppSettings
-> Maybe SharingSettings -> Maybe Text -> UserSettings)
-> Parser (Maybe JupyterServerAppSettings)
-> Parser (Maybe SharingSettings -> Maybe Text -> UserSettings)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe JupyterServerAppSettings)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"JupyterServerAppSettings")
Parser (Maybe SharingSettings -> Maybe Text -> UserSettings)
-> Parser (Maybe SharingSettings)
-> Parser (Maybe Text -> UserSettings)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe SharingSettings)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"SharingSettings")
Parser (Maybe Text -> UserSettings)
-> Parser (Maybe Text) -> Parser UserSettings
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
"ExecutionRole")
)
instance Prelude.Hashable UserSettings
instance Prelude.NFData UserSettings
instance Core.ToJSON UserSettings where
toJSON :: UserSettings -> Value
toJSON UserSettings' {Maybe [Text]
Maybe Text
Maybe KernelGatewayAppSettings
Maybe JupyterServerAppSettings
Maybe SharingSettings
Maybe TensorBoardAppSettings
executionRole :: Maybe Text
sharingSettings :: Maybe SharingSettings
jupyterServerAppSettings :: Maybe JupyterServerAppSettings
securityGroups :: Maybe [Text]
kernelGatewayAppSettings :: Maybe KernelGatewayAppSettings
tensorBoardAppSettings :: Maybe TensorBoardAppSettings
$sel:executionRole:UserSettings' :: UserSettings -> Maybe Text
$sel:sharingSettings:UserSettings' :: UserSettings -> Maybe SharingSettings
$sel:jupyterServerAppSettings:UserSettings' :: UserSettings -> Maybe JupyterServerAppSettings
$sel:securityGroups:UserSettings' :: UserSettings -> Maybe [Text]
$sel:kernelGatewayAppSettings:UserSettings' :: UserSettings -> Maybe KernelGatewayAppSettings
$sel:tensorBoardAppSettings:UserSettings' :: UserSettings -> Maybe TensorBoardAppSettings
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"TensorBoardAppSettings" Text -> TensorBoardAppSettings -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(TensorBoardAppSettings -> Pair)
-> Maybe TensorBoardAppSettings -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe TensorBoardAppSettings
tensorBoardAppSettings,
(Text
"KernelGatewayAppSettings" Text -> KernelGatewayAppSettings -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(KernelGatewayAppSettings -> Pair)
-> Maybe KernelGatewayAppSettings -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe KernelGatewayAppSettings
kernelGatewayAppSettings,
(Text
"SecurityGroups" 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]
securityGroups,
(Text
"JupyterServerAppSettings" Text -> JupyterServerAppSettings -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(JupyterServerAppSettings -> Pair)
-> Maybe JupyterServerAppSettings -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe JupyterServerAppSettings
jupyterServerAppSettings,
(Text
"SharingSettings" Text -> SharingSettings -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(SharingSettings -> Pair) -> Maybe SharingSettings -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe SharingSettings
sharingSettings,
(Text
"ExecutionRole" 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
executionRole
]
)