{-# 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.Config.Types.RetentionConfiguration where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data RetentionConfiguration = RetentionConfiguration'
{
RetentionConfiguration -> Text
name :: Prelude.Text,
RetentionConfiguration -> Natural
retentionPeriodInDays :: Prelude.Natural
}
deriving (RetentionConfiguration -> RetentionConfiguration -> Bool
(RetentionConfiguration -> RetentionConfiguration -> Bool)
-> (RetentionConfiguration -> RetentionConfiguration -> Bool)
-> Eq RetentionConfiguration
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: RetentionConfiguration -> RetentionConfiguration -> Bool
$c/= :: RetentionConfiguration -> RetentionConfiguration -> Bool
== :: RetentionConfiguration -> RetentionConfiguration -> Bool
$c== :: RetentionConfiguration -> RetentionConfiguration -> Bool
Prelude.Eq, ReadPrec [RetentionConfiguration]
ReadPrec RetentionConfiguration
Int -> ReadS RetentionConfiguration
ReadS [RetentionConfiguration]
(Int -> ReadS RetentionConfiguration)
-> ReadS [RetentionConfiguration]
-> ReadPrec RetentionConfiguration
-> ReadPrec [RetentionConfiguration]
-> Read RetentionConfiguration
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [RetentionConfiguration]
$creadListPrec :: ReadPrec [RetentionConfiguration]
readPrec :: ReadPrec RetentionConfiguration
$creadPrec :: ReadPrec RetentionConfiguration
readList :: ReadS [RetentionConfiguration]
$creadList :: ReadS [RetentionConfiguration]
readsPrec :: Int -> ReadS RetentionConfiguration
$creadsPrec :: Int -> ReadS RetentionConfiguration
Prelude.Read, Int -> RetentionConfiguration -> ShowS
[RetentionConfiguration] -> ShowS
RetentionConfiguration -> String
(Int -> RetentionConfiguration -> ShowS)
-> (RetentionConfiguration -> String)
-> ([RetentionConfiguration] -> ShowS)
-> Show RetentionConfiguration
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [RetentionConfiguration] -> ShowS
$cshowList :: [RetentionConfiguration] -> ShowS
show :: RetentionConfiguration -> String
$cshow :: RetentionConfiguration -> String
showsPrec :: Int -> RetentionConfiguration -> ShowS
$cshowsPrec :: Int -> RetentionConfiguration -> ShowS
Prelude.Show, (forall x. RetentionConfiguration -> Rep RetentionConfiguration x)
-> (forall x.
Rep RetentionConfiguration x -> RetentionConfiguration)
-> Generic RetentionConfiguration
forall x. Rep RetentionConfiguration x -> RetentionConfiguration
forall x. RetentionConfiguration -> Rep RetentionConfiguration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep RetentionConfiguration x -> RetentionConfiguration
$cfrom :: forall x. RetentionConfiguration -> Rep RetentionConfiguration x
Prelude.Generic)
newRetentionConfiguration ::
Prelude.Text ->
Prelude.Natural ->
RetentionConfiguration
newRetentionConfiguration :: Text -> Natural -> RetentionConfiguration
newRetentionConfiguration
Text
pName_
Natural
pRetentionPeriodInDays_ =
RetentionConfiguration' :: Text -> Natural -> RetentionConfiguration
RetentionConfiguration'
{ $sel:name:RetentionConfiguration' :: Text
name = Text
pName_,
$sel:retentionPeriodInDays:RetentionConfiguration' :: Natural
retentionPeriodInDays = Natural
pRetentionPeriodInDays_
}
retentionConfiguration_name :: Lens.Lens' RetentionConfiguration Prelude.Text
retentionConfiguration_name :: (Text -> f Text)
-> RetentionConfiguration -> f RetentionConfiguration
retentionConfiguration_name = (RetentionConfiguration -> Text)
-> (RetentionConfiguration -> Text -> RetentionConfiguration)
-> Lens RetentionConfiguration RetentionConfiguration Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RetentionConfiguration' {Text
name :: Text
$sel:name:RetentionConfiguration' :: RetentionConfiguration -> Text
name} -> Text
name) (\s :: RetentionConfiguration
s@RetentionConfiguration' {} Text
a -> RetentionConfiguration
s {$sel:name:RetentionConfiguration' :: Text
name = Text
a} :: RetentionConfiguration)
retentionConfiguration_retentionPeriodInDays :: Lens.Lens' RetentionConfiguration Prelude.Natural
retentionConfiguration_retentionPeriodInDays :: (Natural -> f Natural)
-> RetentionConfiguration -> f RetentionConfiguration
retentionConfiguration_retentionPeriodInDays = (RetentionConfiguration -> Natural)
-> (RetentionConfiguration -> Natural -> RetentionConfiguration)
-> Lens
RetentionConfiguration RetentionConfiguration Natural Natural
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RetentionConfiguration' {Natural
retentionPeriodInDays :: Natural
$sel:retentionPeriodInDays:RetentionConfiguration' :: RetentionConfiguration -> Natural
retentionPeriodInDays} -> Natural
retentionPeriodInDays) (\s :: RetentionConfiguration
s@RetentionConfiguration' {} Natural
a -> RetentionConfiguration
s {$sel:retentionPeriodInDays:RetentionConfiguration' :: Natural
retentionPeriodInDays = Natural
a} :: RetentionConfiguration)
instance Core.FromJSON RetentionConfiguration where
parseJSON :: Value -> Parser RetentionConfiguration
parseJSON =
String
-> (Object -> Parser RetentionConfiguration)
-> Value
-> Parser RetentionConfiguration
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"RetentionConfiguration"
( \Object
x ->
Text -> Natural -> RetentionConfiguration
RetentionConfiguration'
(Text -> Natural -> RetentionConfiguration)
-> Parser Text -> Parser (Natural -> RetentionConfiguration)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"Name")
Parser (Natural -> RetentionConfiguration)
-> Parser Natural -> Parser RetentionConfiguration
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Natural
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"RetentionPeriodInDays")
)
instance Prelude.Hashable RetentionConfiguration
instance Prelude.NFData RetentionConfiguration