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