module Stratosphere.S3.Bucket.ObjectLockRuleProperty (
        module Exports, ObjectLockRuleProperty(..),
        mkObjectLockRuleProperty
    ) where
import qualified Data.Aeson as JSON
import qualified Stratosphere.Prelude as Prelude
import Stratosphere.Property
import {-# SOURCE #-} Stratosphere.S3.Bucket.DefaultRetentionProperty as Exports
import Stratosphere.ResourceProperties
data ObjectLockRuleProperty
  = -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-objectlockrule.html>
    ObjectLockRuleProperty {ObjectLockRuleProperty -> ()
haddock_workaround_ :: (),
                            -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-objectlockrule.html#cfn-s3-bucket-objectlockrule-defaultretention>
                            ObjectLockRuleProperty -> Maybe DefaultRetentionProperty
defaultRetention :: (Prelude.Maybe DefaultRetentionProperty)}
  deriving stock (ObjectLockRuleProperty -> ObjectLockRuleProperty -> Bool
(ObjectLockRuleProperty -> ObjectLockRuleProperty -> Bool)
-> (ObjectLockRuleProperty -> ObjectLockRuleProperty -> Bool)
-> Eq ObjectLockRuleProperty
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: ObjectLockRuleProperty -> ObjectLockRuleProperty -> Bool
== :: ObjectLockRuleProperty -> ObjectLockRuleProperty -> Bool
$c/= :: ObjectLockRuleProperty -> ObjectLockRuleProperty -> Bool
/= :: ObjectLockRuleProperty -> ObjectLockRuleProperty -> Bool
Prelude.Eq, Int -> ObjectLockRuleProperty -> ShowS
[ObjectLockRuleProperty] -> ShowS
ObjectLockRuleProperty -> String
(Int -> ObjectLockRuleProperty -> ShowS)
-> (ObjectLockRuleProperty -> String)
-> ([ObjectLockRuleProperty] -> ShowS)
-> Show ObjectLockRuleProperty
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> ObjectLockRuleProperty -> ShowS
showsPrec :: Int -> ObjectLockRuleProperty -> ShowS
$cshow :: ObjectLockRuleProperty -> String
show :: ObjectLockRuleProperty -> String
$cshowList :: [ObjectLockRuleProperty] -> ShowS
showList :: [ObjectLockRuleProperty] -> ShowS
Prelude.Show)
mkObjectLockRuleProperty :: ObjectLockRuleProperty
mkObjectLockRuleProperty :: ObjectLockRuleProperty
mkObjectLockRuleProperty
  = ObjectLockRuleProperty
      {haddock_workaround_ :: ()
haddock_workaround_ = (), defaultRetention :: Maybe DefaultRetentionProperty
defaultRetention = Maybe DefaultRetentionProperty
forall a. Maybe a
Prelude.Nothing}
instance ToResourceProperties ObjectLockRuleProperty where
  toResourceProperties :: ObjectLockRuleProperty -> ResourceProperties
toResourceProperties ObjectLockRuleProperty {Maybe DefaultRetentionProperty
()
haddock_workaround_ :: ObjectLockRuleProperty -> ()
defaultRetention :: ObjectLockRuleProperty -> Maybe DefaultRetentionProperty
haddock_workaround_ :: ()
defaultRetention :: Maybe DefaultRetentionProperty
..}
    = ResourceProperties
        {awsType :: Text
awsType = Text
"AWS::S3::Bucket.ObjectLockRule",
         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 -> DefaultRetentionProperty -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"DefaultRetention" (DefaultRetentionProperty -> (Key, Value))
-> Maybe DefaultRetentionProperty -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe DefaultRetentionProperty
defaultRetention])}
instance JSON.ToJSON ObjectLockRuleProperty where
  toJSON :: ObjectLockRuleProperty -> Value
toJSON ObjectLockRuleProperty {Maybe DefaultRetentionProperty
()
haddock_workaround_ :: ObjectLockRuleProperty -> ()
defaultRetention :: ObjectLockRuleProperty -> Maybe DefaultRetentionProperty
haddock_workaround_ :: ()
defaultRetention :: Maybe DefaultRetentionProperty
..}
    = [(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 -> DefaultRetentionProperty -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"DefaultRetention" (DefaultRetentionProperty -> (Key, Value))
-> Maybe DefaultRetentionProperty -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe DefaultRetentionProperty
defaultRetention]))
instance Property "DefaultRetention" ObjectLockRuleProperty where
  type PropertyType "DefaultRetention" ObjectLockRuleProperty = DefaultRetentionProperty
  set :: PropertyType "DefaultRetention" ObjectLockRuleProperty
-> ObjectLockRuleProperty -> ObjectLockRuleProperty
set PropertyType "DefaultRetention" ObjectLockRuleProperty
newValue ObjectLockRuleProperty {Maybe DefaultRetentionProperty
()
haddock_workaround_ :: ObjectLockRuleProperty -> ()
defaultRetention :: ObjectLockRuleProperty -> Maybe DefaultRetentionProperty
haddock_workaround_ :: ()
defaultRetention :: Maybe DefaultRetentionProperty
..}
    = ObjectLockRuleProperty
        {defaultRetention :: Maybe DefaultRetentionProperty
defaultRetention = DefaultRetentionProperty -> Maybe DefaultRetentionProperty
forall a. a -> Maybe a
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure PropertyType "DefaultRetention" ObjectLockRuleProperty
DefaultRetentionProperty
newValue, ()
haddock_workaround_ :: ()
haddock_workaround_ :: ()
..}