module Stratosphere.S3Outposts.Bucket (
        module Exports, Bucket(..), mkBucket
    ) where
import qualified Data.Aeson as JSON
import qualified Stratosphere.Prelude as Prelude
import Stratosphere.Property
import {-# SOURCE #-} Stratosphere.S3Outposts.Bucket.LifecycleConfigurationProperty as Exports
import Stratosphere.ResourceProperties
import Stratosphere.Tag
import Stratosphere.Value
data Bucket
  = -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-s3outposts-bucket.html>
    Bucket {Bucket -> ()
haddock_workaround_ :: (),
            -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-s3outposts-bucket.html#cfn-s3outposts-bucket-bucketname>
            Bucket -> Value Text
bucketName :: (Value Prelude.Text),
            -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-s3outposts-bucket.html#cfn-s3outposts-bucket-lifecycleconfiguration>
            Bucket -> Maybe LifecycleConfigurationProperty
lifecycleConfiguration :: (Prelude.Maybe LifecycleConfigurationProperty),
            -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-s3outposts-bucket.html#cfn-s3outposts-bucket-outpostid>
            Bucket -> Value Text
outpostId :: (Value Prelude.Text),
            -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-s3outposts-bucket.html#cfn-s3outposts-bucket-tags>
            Bucket -> Maybe [Tag]
tags :: (Prelude.Maybe [Tag])}
  deriving stock (Bucket -> Bucket -> Bool
(Bucket -> Bucket -> Bool)
-> (Bucket -> Bucket -> Bool) -> Eq Bucket
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: Bucket -> Bucket -> Bool
== :: Bucket -> Bucket -> Bool
$c/= :: Bucket -> Bucket -> Bool
/= :: Bucket -> Bucket -> Bool
Prelude.Eq, Int -> Bucket -> ShowS
[Bucket] -> ShowS
Bucket -> String
(Int -> Bucket -> ShowS)
-> (Bucket -> String) -> ([Bucket] -> ShowS) -> Show Bucket
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> Bucket -> ShowS
showsPrec :: Int -> Bucket -> ShowS
$cshow :: Bucket -> String
show :: Bucket -> String
$cshowList :: [Bucket] -> ShowS
showList :: [Bucket] -> ShowS
Prelude.Show)
mkBucket :: Value Prelude.Text -> Value Prelude.Text -> Bucket
mkBucket :: Value Text -> Value Text -> Bucket
mkBucket Value Text
bucketName Value Text
outpostId
  = Bucket
      {haddock_workaround_ :: ()
haddock_workaround_ = (), bucketName :: Value Text
bucketName = Value Text
bucketName,
       outpostId :: Value Text
outpostId = Value Text
outpostId, lifecycleConfiguration :: Maybe LifecycleConfigurationProperty
lifecycleConfiguration = Maybe LifecycleConfigurationProperty
forall a. Maybe a
Prelude.Nothing,
       tags :: Maybe [Tag]
tags = Maybe [Tag]
forall a. Maybe a
Prelude.Nothing}
instance ToResourceProperties Bucket where
  toResourceProperties :: Bucket -> ResourceProperties
toResourceProperties Bucket {Maybe [Tag]
Maybe LifecycleConfigurationProperty
()
Value Text
haddock_workaround_ :: Bucket -> ()
bucketName :: Bucket -> Value Text
lifecycleConfiguration :: Bucket -> Maybe LifecycleConfigurationProperty
outpostId :: Bucket -> Value Text
tags :: Bucket -> Maybe [Tag]
haddock_workaround_ :: ()
bucketName :: Value Text
lifecycleConfiguration :: Maybe LifecycleConfigurationProperty
outpostId :: Value Text
tags :: Maybe [Tag]
..}
    = ResourceProperties
        {awsType :: Text
awsType = Text
"AWS::S3Outposts::Bucket", supportsTags :: Bool
supportsTags = Bool
Prelude.True,
         properties :: Object
properties = [Item Object] -> Object
forall l. IsList l => [Item l] -> l
Prelude.fromList
                        ([(Key, Value)] -> [(Key, Value)] -> [(Key, Value)]
forall a. Semigroup a => a -> a -> a
(Prelude.<>)
                           [Key
"BucketName" 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..= Value Text
bucketName, Key
"OutpostId" 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..= Value Text
outpostId]
                           ([Maybe (Key, Value)] -> [(Key, Value)]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
                              [Key -> LifecycleConfigurationProperty -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"LifecycleConfiguration"
                                 (LifecycleConfigurationProperty -> (Key, Value))
-> Maybe LifecycleConfigurationProperty -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe LifecycleConfigurationProperty
lifecycleConfiguration,
                               Key -> [Tag] -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"Tags" ([Tag] -> (Key, Value)) -> Maybe [Tag] -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Tag]
tags]))}
instance JSON.ToJSON Bucket where
  toJSON :: Bucket -> Value
toJSON Bucket {Maybe [Tag]
Maybe LifecycleConfigurationProperty
()
Value Text
haddock_workaround_ :: Bucket -> ()
bucketName :: Bucket -> Value Text
lifecycleConfiguration :: Bucket -> Maybe LifecycleConfigurationProperty
outpostId :: Bucket -> Value Text
tags :: Bucket -> Maybe [Tag]
haddock_workaround_ :: ()
bucketName :: Value Text
lifecycleConfiguration :: Maybe LifecycleConfigurationProperty
outpostId :: Value Text
tags :: Maybe [Tag]
..}
    = [(Key, Value)] -> Value
JSON.object
        ([Item [(Key, Value)]] -> [(Key, Value)]
forall l. IsList l => [Item l] -> l
Prelude.fromList
           ([(Key, Value)] -> [(Key, Value)] -> [(Key, Value)]
forall a. Semigroup a => a -> a -> a
(Prelude.<>)
              [Key
"BucketName" 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..= Value Text
bucketName, Key
"OutpostId" 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..= Value Text
outpostId]
              ([Maybe (Key, Value)] -> [(Key, Value)]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
                 [Key -> LifecycleConfigurationProperty -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"LifecycleConfiguration"
                    (LifecycleConfigurationProperty -> (Key, Value))
-> Maybe LifecycleConfigurationProperty -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe LifecycleConfigurationProperty
lifecycleConfiguration,
                  Key -> [Tag] -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"Tags" ([Tag] -> (Key, Value)) -> Maybe [Tag] -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Tag]
tags])))
instance Property "BucketName" Bucket where
  type PropertyType "BucketName" Bucket = Value Prelude.Text
  set :: PropertyType "BucketName" Bucket -> Bucket -> Bucket
set PropertyType "BucketName" Bucket
newValue Bucket {Maybe [Tag]
Maybe LifecycleConfigurationProperty
()
Value Text
haddock_workaround_ :: Bucket -> ()
bucketName :: Bucket -> Value Text
lifecycleConfiguration :: Bucket -> Maybe LifecycleConfigurationProperty
outpostId :: Bucket -> Value Text
tags :: Bucket -> Maybe [Tag]
haddock_workaround_ :: ()
bucketName :: Value Text
lifecycleConfiguration :: Maybe LifecycleConfigurationProperty
outpostId :: Value Text
tags :: Maybe [Tag]
..} = Bucket {bucketName :: Value Text
bucketName = PropertyType "BucketName" Bucket
Value Text
newValue, Maybe [Tag]
Maybe LifecycleConfigurationProperty
()
Value Text
haddock_workaround_ :: ()
lifecycleConfiguration :: Maybe LifecycleConfigurationProperty
outpostId :: Value Text
tags :: Maybe [Tag]
haddock_workaround_ :: ()
lifecycleConfiguration :: Maybe LifecycleConfigurationProperty
outpostId :: Value Text
tags :: Maybe [Tag]
..}
instance Property "LifecycleConfiguration" Bucket where
  type PropertyType "LifecycleConfiguration" Bucket = LifecycleConfigurationProperty
  set :: PropertyType "LifecycleConfiguration" Bucket -> Bucket -> Bucket
set PropertyType "LifecycleConfiguration" Bucket
newValue Bucket {Maybe [Tag]
Maybe LifecycleConfigurationProperty
()
Value Text
haddock_workaround_ :: Bucket -> ()
bucketName :: Bucket -> Value Text
lifecycleConfiguration :: Bucket -> Maybe LifecycleConfigurationProperty
outpostId :: Bucket -> Value Text
tags :: Bucket -> Maybe [Tag]
haddock_workaround_ :: ()
bucketName :: Value Text
lifecycleConfiguration :: Maybe LifecycleConfigurationProperty
outpostId :: Value Text
tags :: Maybe [Tag]
..}
    = Bucket {lifecycleConfiguration :: Maybe LifecycleConfigurationProperty
lifecycleConfiguration = LifecycleConfigurationProperty
-> Maybe LifecycleConfigurationProperty
forall a. a -> Maybe a
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure PropertyType "LifecycleConfiguration" Bucket
LifecycleConfigurationProperty
newValue, Maybe [Tag]
()
Value Text
haddock_workaround_ :: ()
bucketName :: Value Text
outpostId :: Value Text
tags :: Maybe [Tag]
haddock_workaround_ :: ()
bucketName :: Value Text
outpostId :: Value Text
tags :: Maybe [Tag]
..}
instance Property "OutpostId" Bucket where
  type PropertyType "OutpostId" Bucket = Value Prelude.Text
  set :: PropertyType "OutpostId" Bucket -> Bucket -> Bucket
set PropertyType "OutpostId" Bucket
newValue Bucket {Maybe [Tag]
Maybe LifecycleConfigurationProperty
()
Value Text
haddock_workaround_ :: Bucket -> ()
bucketName :: Bucket -> Value Text
lifecycleConfiguration :: Bucket -> Maybe LifecycleConfigurationProperty
outpostId :: Bucket -> Value Text
tags :: Bucket -> Maybe [Tag]
haddock_workaround_ :: ()
bucketName :: Value Text
lifecycleConfiguration :: Maybe LifecycleConfigurationProperty
outpostId :: Value Text
tags :: Maybe [Tag]
..} = Bucket {outpostId :: Value Text
outpostId = PropertyType "OutpostId" Bucket
Value Text
newValue, Maybe [Tag]
Maybe LifecycleConfigurationProperty
()
Value Text
haddock_workaround_ :: ()
bucketName :: Value Text
lifecycleConfiguration :: Maybe LifecycleConfigurationProperty
tags :: Maybe [Tag]
haddock_workaround_ :: ()
bucketName :: Value Text
lifecycleConfiguration :: Maybe LifecycleConfigurationProperty
tags :: Maybe [Tag]
..}
instance Property "Tags" Bucket where
  type PropertyType "Tags" Bucket = [Tag]
  set :: PropertyType "Tags" Bucket -> Bucket -> Bucket
set PropertyType "Tags" Bucket
newValue Bucket {Maybe [Tag]
Maybe LifecycleConfigurationProperty
()
Value Text
haddock_workaround_ :: Bucket -> ()
bucketName :: Bucket -> Value Text
lifecycleConfiguration :: Bucket -> Maybe LifecycleConfigurationProperty
outpostId :: Bucket -> Value Text
tags :: Bucket -> Maybe [Tag]
haddock_workaround_ :: ()
bucketName :: Value Text
lifecycleConfiguration :: Maybe LifecycleConfigurationProperty
outpostId :: Value Text
tags :: Maybe [Tag]
..}
    = Bucket {tags :: Maybe [Tag]
tags = [Tag] -> Maybe [Tag]
forall a. a -> Maybe a
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure [Tag]
PropertyType "Tags" Bucket
newValue, Maybe LifecycleConfigurationProperty
()
Value Text
haddock_workaround_ :: ()
bucketName :: Value Text
lifecycleConfiguration :: Maybe LifecycleConfigurationProperty
outpostId :: Value Text
haddock_workaround_ :: ()
bucketName :: Value Text
lifecycleConfiguration :: Maybe LifecycleConfigurationProperty
outpostId :: Value Text
..}