module Stratosphere.SecretsManager.RotationSchedule.RotationRulesProperty (
        RotationRulesProperty(..), mkRotationRulesProperty
    ) where
import qualified Data.Aeson as JSON
import qualified Stratosphere.Prelude as Prelude
import Stratosphere.Property
import Stratosphere.ResourceProperties
import Stratosphere.Value
data RotationRulesProperty
  = -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-secretsmanager-rotationschedule-rotationrules.html>
    RotationRulesProperty {RotationRulesProperty -> ()
haddock_workaround_ :: (),
                           -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-secretsmanager-rotationschedule-rotationrules.html#cfn-secretsmanager-rotationschedule-rotationrules-automaticallyafterdays>
                           RotationRulesProperty -> Maybe (Value Integer)
automaticallyAfterDays :: (Prelude.Maybe (Value Prelude.Integer)),
                           -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-secretsmanager-rotationschedule-rotationrules.html#cfn-secretsmanager-rotationschedule-rotationrules-duration>
                           RotationRulesProperty -> Maybe (Value Text)
duration :: (Prelude.Maybe (Value Prelude.Text)),
                           -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-secretsmanager-rotationschedule-rotationrules.html#cfn-secretsmanager-rotationschedule-rotationrules-scheduleexpression>
                           RotationRulesProperty -> Maybe (Value Text)
scheduleExpression :: (Prelude.Maybe (Value Prelude.Text))}
  deriving stock (RotationRulesProperty -> RotationRulesProperty -> Bool
(RotationRulesProperty -> RotationRulesProperty -> Bool)
-> (RotationRulesProperty -> RotationRulesProperty -> Bool)
-> Eq RotationRulesProperty
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: RotationRulesProperty -> RotationRulesProperty -> Bool
== :: RotationRulesProperty -> RotationRulesProperty -> Bool
$c/= :: RotationRulesProperty -> RotationRulesProperty -> Bool
/= :: RotationRulesProperty -> RotationRulesProperty -> Bool
Prelude.Eq, Int -> RotationRulesProperty -> ShowS
[RotationRulesProperty] -> ShowS
RotationRulesProperty -> String
(Int -> RotationRulesProperty -> ShowS)
-> (RotationRulesProperty -> String)
-> ([RotationRulesProperty] -> ShowS)
-> Show RotationRulesProperty
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> RotationRulesProperty -> ShowS
showsPrec :: Int -> RotationRulesProperty -> ShowS
$cshow :: RotationRulesProperty -> String
show :: RotationRulesProperty -> String
$cshowList :: [RotationRulesProperty] -> ShowS
showList :: [RotationRulesProperty] -> ShowS
Prelude.Show)
mkRotationRulesProperty :: RotationRulesProperty
mkRotationRulesProperty :: RotationRulesProperty
mkRotationRulesProperty
  = RotationRulesProperty
      {haddock_workaround_ :: ()
haddock_workaround_ = (),
       automaticallyAfterDays :: Maybe (Value Integer)
automaticallyAfterDays = Maybe (Value Integer)
forall a. Maybe a
Prelude.Nothing,
       duration :: Maybe (Value Text)
duration = Maybe (Value Text)
forall a. Maybe a
Prelude.Nothing, scheduleExpression :: Maybe (Value Text)
scheduleExpression = Maybe (Value Text)
forall a. Maybe a
Prelude.Nothing}
instance ToResourceProperties RotationRulesProperty where
  toResourceProperties :: RotationRulesProperty -> ResourceProperties
toResourceProperties RotationRulesProperty {Maybe (Value Integer)
Maybe (Value Text)
()
haddock_workaround_ :: RotationRulesProperty -> ()
automaticallyAfterDays :: RotationRulesProperty -> Maybe (Value Integer)
duration :: RotationRulesProperty -> Maybe (Value Text)
scheduleExpression :: RotationRulesProperty -> Maybe (Value Text)
haddock_workaround_ :: ()
automaticallyAfterDays :: Maybe (Value Integer)
duration :: Maybe (Value Text)
scheduleExpression :: Maybe (Value Text)
..}
    = ResourceProperties
        {awsType :: Text
awsType = Text
"AWS::SecretsManager::RotationSchedule.RotationRules",
         supportsTags :: Bool
supportsTags = Bool
Prelude.False,
         properties :: Object
properties = [Item Object] -> Object
forall l. IsList l => [Item l] -> l
Prelude.fromList
                        ([Maybe (Key, Value)] -> [(Key, Value)]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
                           [Key -> Value Integer -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"AutomaticallyAfterDays"
                              (Value Integer -> (Key, Value))
-> Maybe (Value Integer) -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (Value Integer)
automaticallyAfterDays,
                            Key -> Value Text -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"Duration" (Value Text -> (Key, Value))
-> Maybe (Value Text) -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (Value Text)
duration,
                            Key -> Value Text -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"ScheduleExpression" (Value Text -> (Key, Value))
-> Maybe (Value Text) -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (Value Text)
scheduleExpression])}
instance JSON.ToJSON RotationRulesProperty where
  toJSON :: RotationRulesProperty -> Value
toJSON RotationRulesProperty {Maybe (Value Integer)
Maybe (Value Text)
()
haddock_workaround_ :: RotationRulesProperty -> ()
automaticallyAfterDays :: RotationRulesProperty -> Maybe (Value Integer)
duration :: RotationRulesProperty -> Maybe (Value Text)
scheduleExpression :: RotationRulesProperty -> Maybe (Value Text)
haddock_workaround_ :: ()
automaticallyAfterDays :: Maybe (Value Integer)
duration :: Maybe (Value Text)
scheduleExpression :: Maybe (Value Text)
..}
    = [(Key, Value)] -> Value
JSON.object
        ([Item [(Key, Value)]] -> [(Key, Value)]
forall l. IsList l => [Item l] -> l
Prelude.fromList
           ([Maybe (Key, Value)] -> [(Key, Value)]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
              [Key -> Value Integer -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"AutomaticallyAfterDays"
                 (Value Integer -> (Key, Value))
-> Maybe (Value Integer) -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (Value Integer)
automaticallyAfterDays,
               Key -> Value Text -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"Duration" (Value Text -> (Key, Value))
-> Maybe (Value Text) -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (Value Text)
duration,
               Key -> Value Text -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"ScheduleExpression" (Value Text -> (Key, Value))
-> Maybe (Value Text) -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (Value Text)
scheduleExpression]))
instance Property "AutomaticallyAfterDays" RotationRulesProperty where
  type PropertyType "AutomaticallyAfterDays" RotationRulesProperty = Value Prelude.Integer
  set :: PropertyType "AutomaticallyAfterDays" RotationRulesProperty
-> RotationRulesProperty -> RotationRulesProperty
set PropertyType "AutomaticallyAfterDays" RotationRulesProperty
newValue RotationRulesProperty {Maybe (Value Integer)
Maybe (Value Text)
()
haddock_workaround_ :: RotationRulesProperty -> ()
automaticallyAfterDays :: RotationRulesProperty -> Maybe (Value Integer)
duration :: RotationRulesProperty -> Maybe (Value Text)
scheduleExpression :: RotationRulesProperty -> Maybe (Value Text)
haddock_workaround_ :: ()
automaticallyAfterDays :: Maybe (Value Integer)
duration :: Maybe (Value Text)
scheduleExpression :: Maybe (Value Text)
..}
    = RotationRulesProperty
        {automaticallyAfterDays :: Maybe (Value Integer)
automaticallyAfterDays = Value Integer -> Maybe (Value Integer)
forall a. a -> Maybe a
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure PropertyType "AutomaticallyAfterDays" RotationRulesProperty
Value Integer
newValue, Maybe (Value Text)
()
haddock_workaround_ :: ()
duration :: Maybe (Value Text)
scheduleExpression :: Maybe (Value Text)
haddock_workaround_ :: ()
duration :: Maybe (Value Text)
scheduleExpression :: Maybe (Value Text)
..}
instance Property "Duration" RotationRulesProperty where
  type PropertyType "Duration" RotationRulesProperty = Value Prelude.Text
  set :: PropertyType "Duration" RotationRulesProperty
-> RotationRulesProperty -> RotationRulesProperty
set PropertyType "Duration" RotationRulesProperty
newValue RotationRulesProperty {Maybe (Value Integer)
Maybe (Value Text)
()
haddock_workaround_ :: RotationRulesProperty -> ()
automaticallyAfterDays :: RotationRulesProperty -> Maybe (Value Integer)
duration :: RotationRulesProperty -> Maybe (Value Text)
scheduleExpression :: RotationRulesProperty -> Maybe (Value Text)
haddock_workaround_ :: ()
automaticallyAfterDays :: Maybe (Value Integer)
duration :: Maybe (Value Text)
scheduleExpression :: Maybe (Value Text)
..}
    = RotationRulesProperty {duration :: Maybe (Value Text)
duration = Value Text -> Maybe (Value Text)
forall a. a -> Maybe a
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure PropertyType "Duration" RotationRulesProperty
Value Text
newValue, Maybe (Value Integer)
Maybe (Value Text)
()
haddock_workaround_ :: ()
automaticallyAfterDays :: Maybe (Value Integer)
scheduleExpression :: Maybe (Value Text)
haddock_workaround_ :: ()
automaticallyAfterDays :: Maybe (Value Integer)
scheduleExpression :: Maybe (Value Text)
..}
instance Property "ScheduleExpression" RotationRulesProperty where
  type PropertyType "ScheduleExpression" RotationRulesProperty = Value Prelude.Text
  set :: PropertyType "ScheduleExpression" RotationRulesProperty
-> RotationRulesProperty -> RotationRulesProperty
set PropertyType "ScheduleExpression" RotationRulesProperty
newValue RotationRulesProperty {Maybe (Value Integer)
Maybe (Value Text)
()
haddock_workaround_ :: RotationRulesProperty -> ()
automaticallyAfterDays :: RotationRulesProperty -> Maybe (Value Integer)
duration :: RotationRulesProperty -> Maybe (Value Text)
scheduleExpression :: RotationRulesProperty -> Maybe (Value Text)
haddock_workaround_ :: ()
automaticallyAfterDays :: Maybe (Value Integer)
duration :: Maybe (Value Text)
scheduleExpression :: Maybe (Value Text)
..}
    = RotationRulesProperty
        {scheduleExpression :: Maybe (Value Text)
scheduleExpression = Value Text -> Maybe (Value Text)
forall a. a -> Maybe a
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure PropertyType "ScheduleExpression" RotationRulesProperty
Value Text
newValue, Maybe (Value Integer)
Maybe (Value Text)
()
haddock_workaround_ :: ()
automaticallyAfterDays :: Maybe (Value Integer)
duration :: Maybe (Value Text)
haddock_workaround_ :: ()
automaticallyAfterDays :: Maybe (Value Integer)
duration :: Maybe (Value Text)
..}