{-# 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.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
data RetentionConfiguration = RetentionConfiguration'
{
RetentionConfiguration -> Text
name :: Prelude.Text,
RetentionConfiguration -> Natural
retentionPeriodInDays :: Prelude.Natural
}
deriving (RetentionConfiguration -> RetentionConfiguration -> Bool
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]
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
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. 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'
{ $sel:name:RetentionConfiguration' :: Text
name = Text
pName_,
$sel:retentionPeriodInDays:RetentionConfiguration' :: Natural
retentionPeriodInDays = Natural
pRetentionPeriodInDays_
}
retentionConfiguration_name :: Lens.Lens' RetentionConfiguration Prelude.Text
retentionConfiguration_name :: Lens' RetentionConfiguration Text
retentionConfiguration_name = 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 :: Lens' RetentionConfiguration Natural
retentionConfiguration_retentionPeriodInDays = 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 Data.FromJSON RetentionConfiguration where
parseJSON :: Value -> Parser RetentionConfiguration
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"RetentionConfiguration"
( \Object
x ->
Text -> Natural -> RetentionConfiguration
RetentionConfiguration'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"Name")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"RetentionPeriodInDays")
)
instance Prelude.Hashable RetentionConfiguration where
hashWithSalt :: Int -> RetentionConfiguration -> Int
hashWithSalt Int
_salt RetentionConfiguration' {Natural
Text
retentionPeriodInDays :: Natural
name :: Text
$sel:retentionPeriodInDays:RetentionConfiguration' :: RetentionConfiguration -> Natural
$sel:name:RetentionConfiguration' :: RetentionConfiguration -> Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
name
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Natural
retentionPeriodInDays
instance Prelude.NFData RetentionConfiguration where
rnf :: RetentionConfiguration -> ()
rnf RetentionConfiguration' {Natural
Text
retentionPeriodInDays :: Natural
name :: Text
$sel:retentionPeriodInDays:RetentionConfiguration' :: RetentionConfiguration -> Natural
$sel:name:RetentionConfiguration' :: RetentionConfiguration -> Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Text
name
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Natural
retentionPeriodInDays