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