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