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