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