module Stratosphere.S3.Bucket.OwnershipControlsRuleProperty (
        OwnershipControlsRuleProperty(..), mkOwnershipControlsRuleProperty
    ) where
import qualified Data.Aeson as JSON
import qualified Stratosphere.Prelude as Prelude
import Stratosphere.Property
import Stratosphere.ResourceProperties
import Stratosphere.Value
data OwnershipControlsRuleProperty
  = -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-ownershipcontrolsrule.html>
    OwnershipControlsRuleProperty {OwnershipControlsRuleProperty -> ()
haddock_workaround_ :: (),
                                   -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-ownershipcontrolsrule.html#cfn-s3-bucket-ownershipcontrolsrule-objectownership>
                                   OwnershipControlsRuleProperty -> Maybe (Value Text)
objectOwnership :: (Prelude.Maybe (Value Prelude.Text))}
  deriving stock (OwnershipControlsRuleProperty
-> OwnershipControlsRuleProperty -> Bool
(OwnershipControlsRuleProperty
 -> OwnershipControlsRuleProperty -> Bool)
-> (OwnershipControlsRuleProperty
    -> OwnershipControlsRuleProperty -> Bool)
-> Eq OwnershipControlsRuleProperty
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: OwnershipControlsRuleProperty
-> OwnershipControlsRuleProperty -> Bool
== :: OwnershipControlsRuleProperty
-> OwnershipControlsRuleProperty -> Bool
$c/= :: OwnershipControlsRuleProperty
-> OwnershipControlsRuleProperty -> Bool
/= :: OwnershipControlsRuleProperty
-> OwnershipControlsRuleProperty -> Bool
Prelude.Eq, Int -> OwnershipControlsRuleProperty -> ShowS
[OwnershipControlsRuleProperty] -> ShowS
OwnershipControlsRuleProperty -> String
(Int -> OwnershipControlsRuleProperty -> ShowS)
-> (OwnershipControlsRuleProperty -> String)
-> ([OwnershipControlsRuleProperty] -> ShowS)
-> Show OwnershipControlsRuleProperty
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> OwnershipControlsRuleProperty -> ShowS
showsPrec :: Int -> OwnershipControlsRuleProperty -> ShowS
$cshow :: OwnershipControlsRuleProperty -> String
show :: OwnershipControlsRuleProperty -> String
$cshowList :: [OwnershipControlsRuleProperty] -> ShowS
showList :: [OwnershipControlsRuleProperty] -> ShowS
Prelude.Show)
mkOwnershipControlsRuleProperty :: OwnershipControlsRuleProperty
mkOwnershipControlsRuleProperty :: OwnershipControlsRuleProperty
mkOwnershipControlsRuleProperty
  = OwnershipControlsRuleProperty
      {haddock_workaround_ :: ()
haddock_workaround_ = (), objectOwnership :: Maybe (Value Text)
objectOwnership = Maybe (Value Text)
forall a. Maybe a
Prelude.Nothing}
instance ToResourceProperties OwnershipControlsRuleProperty where
  toResourceProperties :: OwnershipControlsRuleProperty -> ResourceProperties
toResourceProperties OwnershipControlsRuleProperty {Maybe (Value Text)
()
haddock_workaround_ :: OwnershipControlsRuleProperty -> ()
objectOwnership :: OwnershipControlsRuleProperty -> Maybe (Value Text)
haddock_workaround_ :: ()
objectOwnership :: Maybe (Value Text)
..}
    = ResourceProperties
        {awsType :: Text
awsType = Text
"AWS::S3::Bucket.OwnershipControlsRule",
         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 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
"ObjectOwnership" (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)
objectOwnership])}
instance JSON.ToJSON OwnershipControlsRuleProperty where
  toJSON :: OwnershipControlsRuleProperty -> Value
toJSON OwnershipControlsRuleProperty {Maybe (Value Text)
()
haddock_workaround_ :: OwnershipControlsRuleProperty -> ()
objectOwnership :: OwnershipControlsRuleProperty -> Maybe (Value Text)
haddock_workaround_ :: ()
objectOwnership :: 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 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
"ObjectOwnership" (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)
objectOwnership]))
instance Property "ObjectOwnership" OwnershipControlsRuleProperty where
  type PropertyType "ObjectOwnership" OwnershipControlsRuleProperty = Value Prelude.Text
  set :: PropertyType "ObjectOwnership" OwnershipControlsRuleProperty
-> OwnershipControlsRuleProperty -> OwnershipControlsRuleProperty
set PropertyType "ObjectOwnership" OwnershipControlsRuleProperty
newValue OwnershipControlsRuleProperty {Maybe (Value Text)
()
haddock_workaround_ :: OwnershipControlsRuleProperty -> ()
objectOwnership :: OwnershipControlsRuleProperty -> Maybe (Value Text)
haddock_workaround_ :: ()
objectOwnership :: Maybe (Value Text)
..}
    = OwnershipControlsRuleProperty
        {objectOwnership :: Maybe (Value Text)
objectOwnership = Value Text -> Maybe (Value Text)
forall a. a -> Maybe a
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure PropertyType "ObjectOwnership" OwnershipControlsRuleProperty
Value Text
newValue, ()
haddock_workaround_ :: ()
haddock_workaround_ :: ()
..}