{-# 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.ProfilerConfig where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
data ProfilerConfig = ProfilerConfig'
{
ProfilerConfig -> Maybe Bool
disableProfiler :: Prelude.Maybe Prelude.Bool,
ProfilerConfig -> Maybe Integer
profilingIntervalInMilliseconds :: Prelude.Maybe Prelude.Integer,
ProfilerConfig -> Maybe (HashMap Text Text)
profilingParameters :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
ProfilerConfig -> Maybe Text
s3OutputPath :: Prelude.Maybe Prelude.Text
}
deriving (ProfilerConfig -> ProfilerConfig -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ProfilerConfig -> ProfilerConfig -> Bool
$c/= :: ProfilerConfig -> ProfilerConfig -> Bool
== :: ProfilerConfig -> ProfilerConfig -> Bool
$c== :: ProfilerConfig -> ProfilerConfig -> Bool
Prelude.Eq, ReadPrec [ProfilerConfig]
ReadPrec ProfilerConfig
Int -> ReadS ProfilerConfig
ReadS [ProfilerConfig]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ProfilerConfig]
$creadListPrec :: ReadPrec [ProfilerConfig]
readPrec :: ReadPrec ProfilerConfig
$creadPrec :: ReadPrec ProfilerConfig
readList :: ReadS [ProfilerConfig]
$creadList :: ReadS [ProfilerConfig]
readsPrec :: Int -> ReadS ProfilerConfig
$creadsPrec :: Int -> ReadS ProfilerConfig
Prelude.Read, Int -> ProfilerConfig -> ShowS
[ProfilerConfig] -> ShowS
ProfilerConfig -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ProfilerConfig] -> ShowS
$cshowList :: [ProfilerConfig] -> ShowS
show :: ProfilerConfig -> String
$cshow :: ProfilerConfig -> String
showsPrec :: Int -> ProfilerConfig -> ShowS
$cshowsPrec :: Int -> ProfilerConfig -> ShowS
Prelude.Show, forall x. Rep ProfilerConfig x -> ProfilerConfig
forall x. ProfilerConfig -> Rep ProfilerConfig x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ProfilerConfig x -> ProfilerConfig
$cfrom :: forall x. ProfilerConfig -> Rep ProfilerConfig x
Prelude.Generic)
newProfilerConfig ::
ProfilerConfig
newProfilerConfig :: ProfilerConfig
newProfilerConfig =
ProfilerConfig'
{ $sel:disableProfiler:ProfilerConfig' :: Maybe Bool
disableProfiler = forall a. Maybe a
Prelude.Nothing,
$sel:profilingIntervalInMilliseconds:ProfilerConfig' :: Maybe Integer
profilingIntervalInMilliseconds = forall a. Maybe a
Prelude.Nothing,
$sel:profilingParameters:ProfilerConfig' :: Maybe (HashMap Text Text)
profilingParameters = forall a. Maybe a
Prelude.Nothing,
$sel:s3OutputPath:ProfilerConfig' :: Maybe Text
s3OutputPath = forall a. Maybe a
Prelude.Nothing
}
profilerConfig_disableProfiler :: Lens.Lens' ProfilerConfig (Prelude.Maybe Prelude.Bool)
profilerConfig_disableProfiler :: Lens' ProfilerConfig (Maybe Bool)
profilerConfig_disableProfiler = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ProfilerConfig' {Maybe Bool
disableProfiler :: Maybe Bool
$sel:disableProfiler:ProfilerConfig' :: ProfilerConfig -> Maybe Bool
disableProfiler} -> Maybe Bool
disableProfiler) (\s :: ProfilerConfig
s@ProfilerConfig' {} Maybe Bool
a -> ProfilerConfig
s {$sel:disableProfiler:ProfilerConfig' :: Maybe Bool
disableProfiler = Maybe Bool
a} :: ProfilerConfig)
profilerConfig_profilingIntervalInMilliseconds :: Lens.Lens' ProfilerConfig (Prelude.Maybe Prelude.Integer)
profilerConfig_profilingIntervalInMilliseconds :: Lens' ProfilerConfig (Maybe Integer)
profilerConfig_profilingIntervalInMilliseconds = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ProfilerConfig' {Maybe Integer
profilingIntervalInMilliseconds :: Maybe Integer
$sel:profilingIntervalInMilliseconds:ProfilerConfig' :: ProfilerConfig -> Maybe Integer
profilingIntervalInMilliseconds} -> Maybe Integer
profilingIntervalInMilliseconds) (\s :: ProfilerConfig
s@ProfilerConfig' {} Maybe Integer
a -> ProfilerConfig
s {$sel:profilingIntervalInMilliseconds:ProfilerConfig' :: Maybe Integer
profilingIntervalInMilliseconds = Maybe Integer
a} :: ProfilerConfig)
profilerConfig_profilingParameters :: Lens.Lens' ProfilerConfig (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
profilerConfig_profilingParameters :: Lens' ProfilerConfig (Maybe (HashMap Text Text))
profilerConfig_profilingParameters = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ProfilerConfig' {Maybe (HashMap Text Text)
profilingParameters :: Maybe (HashMap Text Text)
$sel:profilingParameters:ProfilerConfig' :: ProfilerConfig -> Maybe (HashMap Text Text)
profilingParameters} -> Maybe (HashMap Text Text)
profilingParameters) (\s :: ProfilerConfig
s@ProfilerConfig' {} Maybe (HashMap Text Text)
a -> ProfilerConfig
s {$sel:profilingParameters:ProfilerConfig' :: Maybe (HashMap Text Text)
profilingParameters = Maybe (HashMap Text Text)
a} :: ProfilerConfig) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
profilerConfig_s3OutputPath :: Lens.Lens' ProfilerConfig (Prelude.Maybe Prelude.Text)
profilerConfig_s3OutputPath :: Lens' ProfilerConfig (Maybe Text)
profilerConfig_s3OutputPath = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ProfilerConfig' {Maybe Text
s3OutputPath :: Maybe Text
$sel:s3OutputPath:ProfilerConfig' :: ProfilerConfig -> Maybe Text
s3OutputPath} -> Maybe Text
s3OutputPath) (\s :: ProfilerConfig
s@ProfilerConfig' {} Maybe Text
a -> ProfilerConfig
s {$sel:s3OutputPath:ProfilerConfig' :: Maybe Text
s3OutputPath = Maybe Text
a} :: ProfilerConfig)
instance Data.FromJSON ProfilerConfig where
parseJSON :: Value -> Parser ProfilerConfig
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"ProfilerConfig"
( \Object
x ->
Maybe Bool
-> Maybe Integer
-> Maybe (HashMap Text Text)
-> Maybe Text
-> ProfilerConfig
ProfilerConfig'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"DisableProfiler")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"ProfilingIntervalInMilliseconds")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"ProfilingParameters"
forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty
)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"S3OutputPath")
)
instance Prelude.Hashable ProfilerConfig where
hashWithSalt :: Int -> ProfilerConfig -> Int
hashWithSalt Int
_salt ProfilerConfig' {Maybe Bool
Maybe Integer
Maybe Text
Maybe (HashMap Text Text)
s3OutputPath :: Maybe Text
profilingParameters :: Maybe (HashMap Text Text)
profilingIntervalInMilliseconds :: Maybe Integer
disableProfiler :: Maybe Bool
$sel:s3OutputPath:ProfilerConfig' :: ProfilerConfig -> Maybe Text
$sel:profilingParameters:ProfilerConfig' :: ProfilerConfig -> Maybe (HashMap Text Text)
$sel:profilingIntervalInMilliseconds:ProfilerConfig' :: ProfilerConfig -> Maybe Integer
$sel:disableProfiler:ProfilerConfig' :: ProfilerConfig -> Maybe Bool
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
disableProfiler
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Integer
profilingIntervalInMilliseconds
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (HashMap Text Text)
profilingParameters
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
s3OutputPath
instance Prelude.NFData ProfilerConfig where
rnf :: ProfilerConfig -> ()
rnf ProfilerConfig' {Maybe Bool
Maybe Integer
Maybe Text
Maybe (HashMap Text Text)
s3OutputPath :: Maybe Text
profilingParameters :: Maybe (HashMap Text Text)
profilingIntervalInMilliseconds :: Maybe Integer
disableProfiler :: Maybe Bool
$sel:s3OutputPath:ProfilerConfig' :: ProfilerConfig -> Maybe Text
$sel:profilingParameters:ProfilerConfig' :: ProfilerConfig -> Maybe (HashMap Text Text)
$sel:profilingIntervalInMilliseconds:ProfilerConfig' :: ProfilerConfig -> Maybe Integer
$sel:disableProfiler:ProfilerConfig' :: ProfilerConfig -> Maybe Bool
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
disableProfiler
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Integer
profilingIntervalInMilliseconds
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe (HashMap Text Text)
profilingParameters
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
s3OutputPath
instance Data.ToJSON ProfilerConfig where
toJSON :: ProfilerConfig -> Value
toJSON ProfilerConfig' {Maybe Bool
Maybe Integer
Maybe Text
Maybe (HashMap Text Text)
s3OutputPath :: Maybe Text
profilingParameters :: Maybe (HashMap Text Text)
profilingIntervalInMilliseconds :: Maybe Integer
disableProfiler :: Maybe Bool
$sel:s3OutputPath:ProfilerConfig' :: ProfilerConfig -> Maybe Text
$sel:profilingParameters:ProfilerConfig' :: ProfilerConfig -> Maybe (HashMap Text Text)
$sel:profilingIntervalInMilliseconds:ProfilerConfig' :: ProfilerConfig -> Maybe Integer
$sel:disableProfiler:ProfilerConfig' :: ProfilerConfig -> Maybe Bool
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"DisableProfiler" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Bool
disableProfiler,
(Key
"ProfilingIntervalInMilliseconds" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Integer
profilingIntervalInMilliseconds,
(Key
"ProfilingParameters" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (HashMap Text Text)
profilingParameters,
(Key
"S3OutputPath" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
s3OutputPath
]
)