module Stratosphere.S3.StorageLens (
        module Exports, StorageLens(..), mkStorageLens
    ) where
import qualified Data.Aeson as JSON
import qualified Stratosphere.Prelude as Prelude
import Stratosphere.Property
import {-# SOURCE #-} Stratosphere.S3.StorageLens.StorageLensConfigurationProperty as Exports
import Stratosphere.ResourceProperties
import Stratosphere.Tag
data StorageLens
  = -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-s3-storagelens.html>
    StorageLens {StorageLens -> ()
haddock_workaround_ :: (),
                 -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-s3-storagelens.html#cfn-s3-storagelens-storagelensconfiguration>
                 StorageLens -> StorageLensConfigurationProperty
storageLensConfiguration :: StorageLensConfigurationProperty,
                 -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-s3-storagelens.html#cfn-s3-storagelens-tags>
                 StorageLens -> Maybe [Tag]
tags :: (Prelude.Maybe [Tag])}
  deriving stock (StorageLens -> StorageLens -> Bool
(StorageLens -> StorageLens -> Bool)
-> (StorageLens -> StorageLens -> Bool) -> Eq StorageLens
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: StorageLens -> StorageLens -> Bool
== :: StorageLens -> StorageLens -> Bool
$c/= :: StorageLens -> StorageLens -> Bool
/= :: StorageLens -> StorageLens -> Bool
Prelude.Eq, Int -> StorageLens -> ShowS
[StorageLens] -> ShowS
StorageLens -> String
(Int -> StorageLens -> ShowS)
-> (StorageLens -> String)
-> ([StorageLens] -> ShowS)
-> Show StorageLens
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> StorageLens -> ShowS
showsPrec :: Int -> StorageLens -> ShowS
$cshow :: StorageLens -> String
show :: StorageLens -> String
$cshowList :: [StorageLens] -> ShowS
showList :: [StorageLens] -> ShowS
Prelude.Show)
mkStorageLens :: StorageLensConfigurationProperty -> StorageLens
mkStorageLens :: StorageLensConfigurationProperty -> StorageLens
mkStorageLens StorageLensConfigurationProperty
storageLensConfiguration
  = StorageLens
      {haddock_workaround_ :: ()
haddock_workaround_ = (),
       storageLensConfiguration :: StorageLensConfigurationProperty
storageLensConfiguration = StorageLensConfigurationProperty
storageLensConfiguration,
       tags :: Maybe [Tag]
tags = Maybe [Tag]
forall a. Maybe a
Prelude.Nothing}
instance ToResourceProperties StorageLens where
  toResourceProperties :: StorageLens -> ResourceProperties
toResourceProperties StorageLens {Maybe [Tag]
()
StorageLensConfigurationProperty
haddock_workaround_ :: StorageLens -> ()
storageLensConfiguration :: StorageLens -> StorageLensConfigurationProperty
tags :: StorageLens -> Maybe [Tag]
haddock_workaround_ :: ()
storageLensConfiguration :: StorageLensConfigurationProperty
tags :: Maybe [Tag]
..}
    = ResourceProperties
        {awsType :: Text
awsType = Text
"AWS::S3::StorageLens", 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
"StorageLensConfiguration" Key -> StorageLensConfigurationProperty -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
JSON..= StorageLensConfigurationProperty
storageLensConfiguration]
                           ([Maybe (Key, Value)] -> [(Key, Value)]
forall a. [Maybe a] -> [a]
Prelude.catMaybes [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 StorageLens where
  toJSON :: StorageLens -> Value
toJSON StorageLens {Maybe [Tag]
()
StorageLensConfigurationProperty
haddock_workaround_ :: StorageLens -> ()
storageLensConfiguration :: StorageLens -> StorageLensConfigurationProperty
tags :: StorageLens -> Maybe [Tag]
haddock_workaround_ :: ()
storageLensConfiguration :: StorageLensConfigurationProperty
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
"StorageLensConfiguration" Key -> StorageLensConfigurationProperty -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
JSON..= StorageLensConfigurationProperty
storageLensConfiguration]
              ([Maybe (Key, Value)] -> [(Key, Value)]
forall a. [Maybe a] -> [a]
Prelude.catMaybes [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 "StorageLensConfiguration" StorageLens where
  type PropertyType "StorageLensConfiguration" StorageLens = StorageLensConfigurationProperty
  set :: PropertyType "StorageLensConfiguration" StorageLens
-> StorageLens -> StorageLens
set PropertyType "StorageLensConfiguration" StorageLens
newValue StorageLens {Maybe [Tag]
()
StorageLensConfigurationProperty
haddock_workaround_ :: StorageLens -> ()
storageLensConfiguration :: StorageLens -> StorageLensConfigurationProperty
tags :: StorageLens -> Maybe [Tag]
haddock_workaround_ :: ()
storageLensConfiguration :: StorageLensConfigurationProperty
tags :: Maybe [Tag]
..}
    = StorageLens {storageLensConfiguration :: StorageLensConfigurationProperty
storageLensConfiguration = PropertyType "StorageLensConfiguration" StorageLens
StorageLensConfigurationProperty
newValue, Maybe [Tag]
()
haddock_workaround_ :: ()
tags :: Maybe [Tag]
haddock_workaround_ :: ()
tags :: Maybe [Tag]
..}
instance Property "Tags" StorageLens where
  type PropertyType "Tags" StorageLens = [Tag]
  set :: PropertyType "Tags" StorageLens -> StorageLens -> StorageLens
set PropertyType "Tags" StorageLens
newValue StorageLens {Maybe [Tag]
()
StorageLensConfigurationProperty
haddock_workaround_ :: StorageLens -> ()
storageLensConfiguration :: StorageLens -> StorageLensConfigurationProperty
tags :: StorageLens -> Maybe [Tag]
haddock_workaround_ :: ()
storageLensConfiguration :: StorageLensConfigurationProperty
tags :: Maybe [Tag]
..}
    = StorageLens {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" StorageLens
newValue, ()
StorageLensConfigurationProperty
haddock_workaround_ :: ()
storageLensConfiguration :: StorageLensConfigurationProperty
haddock_workaround_ :: ()
storageLensConfiguration :: StorageLensConfigurationProperty
..}