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