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