module Stratosphere.MediaStore.Container.CorsRuleProperty (
        CorsRuleProperty(..), mkCorsRuleProperty
    ) where
import qualified Data.Aeson as JSON
import qualified Stratosphere.Prelude as Prelude
import Stratosphere.Property
import Stratosphere.ResourceProperties
import Stratosphere.Value
data CorsRuleProperty
  = -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-mediastore-container-corsrule.html>
    CorsRuleProperty {CorsRuleProperty -> ()
haddock_workaround_ :: (),
                      -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-mediastore-container-corsrule.html#cfn-mediastore-container-corsrule-allowedheaders>
                      CorsRuleProperty -> Maybe (ValueList Text)
allowedHeaders :: (Prelude.Maybe (ValueList Prelude.Text)),
                      -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-mediastore-container-corsrule.html#cfn-mediastore-container-corsrule-allowedmethods>
                      CorsRuleProperty -> Maybe (ValueList Text)
allowedMethods :: (Prelude.Maybe (ValueList Prelude.Text)),
                      -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-mediastore-container-corsrule.html#cfn-mediastore-container-corsrule-allowedorigins>
                      CorsRuleProperty -> Maybe (ValueList Text)
allowedOrigins :: (Prelude.Maybe (ValueList Prelude.Text)),
                      -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-mediastore-container-corsrule.html#cfn-mediastore-container-corsrule-exposeheaders>
                      CorsRuleProperty -> Maybe (ValueList Text)
exposeHeaders :: (Prelude.Maybe (ValueList Prelude.Text)),
                      -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-mediastore-container-corsrule.html#cfn-mediastore-container-corsrule-maxageseconds>
                      CorsRuleProperty -> Maybe (Value Integer)
maxAgeSeconds :: (Prelude.Maybe (Value Prelude.Integer))}
  deriving stock (CorsRuleProperty -> CorsRuleProperty -> Bool
(CorsRuleProperty -> CorsRuleProperty -> Bool)
-> (CorsRuleProperty -> CorsRuleProperty -> Bool)
-> Eq CorsRuleProperty
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: CorsRuleProperty -> CorsRuleProperty -> Bool
== :: CorsRuleProperty -> CorsRuleProperty -> Bool
$c/= :: CorsRuleProperty -> CorsRuleProperty -> Bool
/= :: CorsRuleProperty -> CorsRuleProperty -> Bool
Prelude.Eq, Int -> CorsRuleProperty -> ShowS
[CorsRuleProperty] -> ShowS
CorsRuleProperty -> String
(Int -> CorsRuleProperty -> ShowS)
-> (CorsRuleProperty -> String)
-> ([CorsRuleProperty] -> ShowS)
-> Show CorsRuleProperty
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> CorsRuleProperty -> ShowS
showsPrec :: Int -> CorsRuleProperty -> ShowS
$cshow :: CorsRuleProperty -> String
show :: CorsRuleProperty -> String
$cshowList :: [CorsRuleProperty] -> ShowS
showList :: [CorsRuleProperty] -> ShowS
Prelude.Show)
mkCorsRuleProperty :: CorsRuleProperty
mkCorsRuleProperty :: CorsRuleProperty
mkCorsRuleProperty
  = CorsRuleProperty
      {haddock_workaround_ :: ()
haddock_workaround_ = (), allowedHeaders :: Maybe (ValueList Text)
allowedHeaders = Maybe (ValueList Text)
forall a. Maybe a
Prelude.Nothing,
       allowedMethods :: Maybe (ValueList Text)
allowedMethods = Maybe (ValueList Text)
forall a. Maybe a
Prelude.Nothing, allowedOrigins :: Maybe (ValueList Text)
allowedOrigins = Maybe (ValueList Text)
forall a. Maybe a
Prelude.Nothing,
       exposeHeaders :: Maybe (ValueList Text)
exposeHeaders = Maybe (ValueList Text)
forall a. Maybe a
Prelude.Nothing, maxAgeSeconds :: Maybe (Value Integer)
maxAgeSeconds = Maybe (Value Integer)
forall a. Maybe a
Prelude.Nothing}
instance ToResourceProperties CorsRuleProperty where
  toResourceProperties :: CorsRuleProperty -> ResourceProperties
toResourceProperties CorsRuleProperty {Maybe (ValueList Text)
Maybe (Value Integer)
()
haddock_workaround_ :: CorsRuleProperty -> ()
allowedHeaders :: CorsRuleProperty -> Maybe (ValueList Text)
allowedMethods :: CorsRuleProperty -> Maybe (ValueList Text)
allowedOrigins :: CorsRuleProperty -> Maybe (ValueList Text)
exposeHeaders :: CorsRuleProperty -> Maybe (ValueList Text)
maxAgeSeconds :: CorsRuleProperty -> Maybe (Value Integer)
haddock_workaround_ :: ()
allowedHeaders :: Maybe (ValueList Text)
allowedMethods :: Maybe (ValueList Text)
allowedOrigins :: Maybe (ValueList Text)
exposeHeaders :: Maybe (ValueList Text)
maxAgeSeconds :: Maybe (Value Integer)
..}
    = ResourceProperties
        {awsType :: Text
awsType = Text
"AWS::MediaStore::Container.CorsRule",
         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 -> ValueList 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
"AllowedHeaders" (ValueList Text -> (Key, Value))
-> Maybe (ValueList Text) -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (ValueList Text)
allowedHeaders,
                            Key -> ValueList 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
"AllowedMethods" (ValueList Text -> (Key, Value))
-> Maybe (ValueList Text) -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (ValueList Text)
allowedMethods,
                            Key -> ValueList 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
"AllowedOrigins" (ValueList Text -> (Key, Value))
-> Maybe (ValueList Text) -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (ValueList Text)
allowedOrigins,
                            Key -> ValueList 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
"ExposeHeaders" (ValueList Text -> (Key, Value))
-> Maybe (ValueList Text) -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (ValueList Text)
exposeHeaders,
                            Key -> Value Integer -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"MaxAgeSeconds" (Value Integer -> (Key, Value))
-> Maybe (Value Integer) -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (Value Integer)
maxAgeSeconds])}
instance JSON.ToJSON CorsRuleProperty where
  toJSON :: CorsRuleProperty -> Value
toJSON CorsRuleProperty {Maybe (ValueList Text)
Maybe (Value Integer)
()
haddock_workaround_ :: CorsRuleProperty -> ()
allowedHeaders :: CorsRuleProperty -> Maybe (ValueList Text)
allowedMethods :: CorsRuleProperty -> Maybe (ValueList Text)
allowedOrigins :: CorsRuleProperty -> Maybe (ValueList Text)
exposeHeaders :: CorsRuleProperty -> Maybe (ValueList Text)
maxAgeSeconds :: CorsRuleProperty -> Maybe (Value Integer)
haddock_workaround_ :: ()
allowedHeaders :: Maybe (ValueList Text)
allowedMethods :: Maybe (ValueList Text)
allowedOrigins :: Maybe (ValueList Text)
exposeHeaders :: Maybe (ValueList Text)
maxAgeSeconds :: Maybe (Value Integer)
..}
    = [(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 -> ValueList 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
"AllowedHeaders" (ValueList Text -> (Key, Value))
-> Maybe (ValueList Text) -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (ValueList Text)
allowedHeaders,
               Key -> ValueList 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
"AllowedMethods" (ValueList Text -> (Key, Value))
-> Maybe (ValueList Text) -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (ValueList Text)
allowedMethods,
               Key -> ValueList 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
"AllowedOrigins" (ValueList Text -> (Key, Value))
-> Maybe (ValueList Text) -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (ValueList Text)
allowedOrigins,
               Key -> ValueList 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
"ExposeHeaders" (ValueList Text -> (Key, Value))
-> Maybe (ValueList Text) -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (ValueList Text)
exposeHeaders,
               Key -> Value Integer -> (Key, Value)
forall v. ToJSON v => Key -> v -> (Key, Value)
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
(JSON..=) Key
"MaxAgeSeconds" (Value Integer -> (Key, Value))
-> Maybe (Value Integer) -> Maybe (Key, Value)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (Value Integer)
maxAgeSeconds]))
instance Property "AllowedHeaders" CorsRuleProperty where
  type PropertyType "AllowedHeaders" CorsRuleProperty = ValueList Prelude.Text
  set :: PropertyType "AllowedHeaders" CorsRuleProperty
-> CorsRuleProperty -> CorsRuleProperty
set PropertyType "AllowedHeaders" CorsRuleProperty
newValue CorsRuleProperty {Maybe (ValueList Text)
Maybe (Value Integer)
()
haddock_workaround_ :: CorsRuleProperty -> ()
allowedHeaders :: CorsRuleProperty -> Maybe (ValueList Text)
allowedMethods :: CorsRuleProperty -> Maybe (ValueList Text)
allowedOrigins :: CorsRuleProperty -> Maybe (ValueList Text)
exposeHeaders :: CorsRuleProperty -> Maybe (ValueList Text)
maxAgeSeconds :: CorsRuleProperty -> Maybe (Value Integer)
haddock_workaround_ :: ()
allowedHeaders :: Maybe (ValueList Text)
allowedMethods :: Maybe (ValueList Text)
allowedOrigins :: Maybe (ValueList Text)
exposeHeaders :: Maybe (ValueList Text)
maxAgeSeconds :: Maybe (Value Integer)
..}
    = CorsRuleProperty {allowedHeaders :: Maybe (ValueList Text)
allowedHeaders = ValueList Text -> Maybe (ValueList Text)
forall a. a -> Maybe a
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure PropertyType "AllowedHeaders" CorsRuleProperty
ValueList Text
newValue, Maybe (ValueList Text)
Maybe (Value Integer)
()
haddock_workaround_ :: ()
allowedMethods :: Maybe (ValueList Text)
allowedOrigins :: Maybe (ValueList Text)
exposeHeaders :: Maybe (ValueList Text)
maxAgeSeconds :: Maybe (Value Integer)
haddock_workaround_ :: ()
allowedMethods :: Maybe (ValueList Text)
allowedOrigins :: Maybe (ValueList Text)
exposeHeaders :: Maybe (ValueList Text)
maxAgeSeconds :: Maybe (Value Integer)
..}
instance Property "AllowedMethods" CorsRuleProperty where
  type PropertyType "AllowedMethods" CorsRuleProperty = ValueList Prelude.Text
  set :: PropertyType "AllowedMethods" CorsRuleProperty
-> CorsRuleProperty -> CorsRuleProperty
set PropertyType "AllowedMethods" CorsRuleProperty
newValue CorsRuleProperty {Maybe (ValueList Text)
Maybe (Value Integer)
()
haddock_workaround_ :: CorsRuleProperty -> ()
allowedHeaders :: CorsRuleProperty -> Maybe (ValueList Text)
allowedMethods :: CorsRuleProperty -> Maybe (ValueList Text)
allowedOrigins :: CorsRuleProperty -> Maybe (ValueList Text)
exposeHeaders :: CorsRuleProperty -> Maybe (ValueList Text)
maxAgeSeconds :: CorsRuleProperty -> Maybe (Value Integer)
haddock_workaround_ :: ()
allowedHeaders :: Maybe (ValueList Text)
allowedMethods :: Maybe (ValueList Text)
allowedOrigins :: Maybe (ValueList Text)
exposeHeaders :: Maybe (ValueList Text)
maxAgeSeconds :: Maybe (Value Integer)
..}
    = CorsRuleProperty {allowedMethods :: Maybe (ValueList Text)
allowedMethods = ValueList Text -> Maybe (ValueList Text)
forall a. a -> Maybe a
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure PropertyType "AllowedMethods" CorsRuleProperty
ValueList Text
newValue, Maybe (ValueList Text)
Maybe (Value Integer)
()
haddock_workaround_ :: ()
allowedHeaders :: Maybe (ValueList Text)
allowedOrigins :: Maybe (ValueList Text)
exposeHeaders :: Maybe (ValueList Text)
maxAgeSeconds :: Maybe (Value Integer)
haddock_workaround_ :: ()
allowedHeaders :: Maybe (ValueList Text)
allowedOrigins :: Maybe (ValueList Text)
exposeHeaders :: Maybe (ValueList Text)
maxAgeSeconds :: Maybe (Value Integer)
..}
instance Property "AllowedOrigins" CorsRuleProperty where
  type PropertyType "AllowedOrigins" CorsRuleProperty = ValueList Prelude.Text
  set :: PropertyType "AllowedOrigins" CorsRuleProperty
-> CorsRuleProperty -> CorsRuleProperty
set PropertyType "AllowedOrigins" CorsRuleProperty
newValue CorsRuleProperty {Maybe (ValueList Text)
Maybe (Value Integer)
()
haddock_workaround_ :: CorsRuleProperty -> ()
allowedHeaders :: CorsRuleProperty -> Maybe (ValueList Text)
allowedMethods :: CorsRuleProperty -> Maybe (ValueList Text)
allowedOrigins :: CorsRuleProperty -> Maybe (ValueList Text)
exposeHeaders :: CorsRuleProperty -> Maybe (ValueList Text)
maxAgeSeconds :: CorsRuleProperty -> Maybe (Value Integer)
haddock_workaround_ :: ()
allowedHeaders :: Maybe (ValueList Text)
allowedMethods :: Maybe (ValueList Text)
allowedOrigins :: Maybe (ValueList Text)
exposeHeaders :: Maybe (ValueList Text)
maxAgeSeconds :: Maybe (Value Integer)
..}
    = CorsRuleProperty {allowedOrigins :: Maybe (ValueList Text)
allowedOrigins = ValueList Text -> Maybe (ValueList Text)
forall a. a -> Maybe a
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure PropertyType "AllowedOrigins" CorsRuleProperty
ValueList Text
newValue, Maybe (ValueList Text)
Maybe (Value Integer)
()
haddock_workaround_ :: ()
allowedHeaders :: Maybe (ValueList Text)
allowedMethods :: Maybe (ValueList Text)
exposeHeaders :: Maybe (ValueList Text)
maxAgeSeconds :: Maybe (Value Integer)
haddock_workaround_ :: ()
allowedHeaders :: Maybe (ValueList Text)
allowedMethods :: Maybe (ValueList Text)
exposeHeaders :: Maybe (ValueList Text)
maxAgeSeconds :: Maybe (Value Integer)
..}
instance Property "ExposeHeaders" CorsRuleProperty where
  type PropertyType "ExposeHeaders" CorsRuleProperty = ValueList Prelude.Text
  set :: PropertyType "ExposeHeaders" CorsRuleProperty
-> CorsRuleProperty -> CorsRuleProperty
set PropertyType "ExposeHeaders" CorsRuleProperty
newValue CorsRuleProperty {Maybe (ValueList Text)
Maybe (Value Integer)
()
haddock_workaround_ :: CorsRuleProperty -> ()
allowedHeaders :: CorsRuleProperty -> Maybe (ValueList Text)
allowedMethods :: CorsRuleProperty -> Maybe (ValueList Text)
allowedOrigins :: CorsRuleProperty -> Maybe (ValueList Text)
exposeHeaders :: CorsRuleProperty -> Maybe (ValueList Text)
maxAgeSeconds :: CorsRuleProperty -> Maybe (Value Integer)
haddock_workaround_ :: ()
allowedHeaders :: Maybe (ValueList Text)
allowedMethods :: Maybe (ValueList Text)
allowedOrigins :: Maybe (ValueList Text)
exposeHeaders :: Maybe (ValueList Text)
maxAgeSeconds :: Maybe (Value Integer)
..}
    = CorsRuleProperty {exposeHeaders :: Maybe (ValueList Text)
exposeHeaders = ValueList Text -> Maybe (ValueList Text)
forall a. a -> Maybe a
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure PropertyType "ExposeHeaders" CorsRuleProperty
ValueList Text
newValue, Maybe (ValueList Text)
Maybe (Value Integer)
()
haddock_workaround_ :: ()
allowedHeaders :: Maybe (ValueList Text)
allowedMethods :: Maybe (ValueList Text)
allowedOrigins :: Maybe (ValueList Text)
maxAgeSeconds :: Maybe (Value Integer)
haddock_workaround_ :: ()
allowedHeaders :: Maybe (ValueList Text)
allowedMethods :: Maybe (ValueList Text)
allowedOrigins :: Maybe (ValueList Text)
maxAgeSeconds :: Maybe (Value Integer)
..}
instance Property "MaxAgeSeconds" CorsRuleProperty where
  type PropertyType "MaxAgeSeconds" CorsRuleProperty = Value Prelude.Integer
  set :: PropertyType "MaxAgeSeconds" CorsRuleProperty
-> CorsRuleProperty -> CorsRuleProperty
set PropertyType "MaxAgeSeconds" CorsRuleProperty
newValue CorsRuleProperty {Maybe (ValueList Text)
Maybe (Value Integer)
()
haddock_workaround_ :: CorsRuleProperty -> ()
allowedHeaders :: CorsRuleProperty -> Maybe (ValueList Text)
allowedMethods :: CorsRuleProperty -> Maybe (ValueList Text)
allowedOrigins :: CorsRuleProperty -> Maybe (ValueList Text)
exposeHeaders :: CorsRuleProperty -> Maybe (ValueList Text)
maxAgeSeconds :: CorsRuleProperty -> Maybe (Value Integer)
haddock_workaround_ :: ()
allowedHeaders :: Maybe (ValueList Text)
allowedMethods :: Maybe (ValueList Text)
allowedOrigins :: Maybe (ValueList Text)
exposeHeaders :: Maybe (ValueList Text)
maxAgeSeconds :: Maybe (Value Integer)
..}
    = CorsRuleProperty {maxAgeSeconds :: Maybe (Value Integer)
maxAgeSeconds = Value Integer -> Maybe (Value Integer)
forall a. a -> Maybe a
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure PropertyType "MaxAgeSeconds" CorsRuleProperty
Value Integer
newValue, Maybe (ValueList Text)
()
haddock_workaround_ :: ()
allowedHeaders :: Maybe (ValueList Text)
allowedMethods :: Maybe (ValueList Text)
allowedOrigins :: Maybe (ValueList Text)
exposeHeaders :: Maybe (ValueList Text)
haddock_workaround_ :: ()
allowedHeaders :: Maybe (ValueList Text)
allowedMethods :: Maybe (ValueList Text)
allowedOrigins :: Maybe (ValueList Text)
exposeHeaders :: Maybe (ValueList Text)
..}