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