module Stratosphere.S3.Bucket.RedirectRuleProperty (
        RedirectRuleProperty(..), mkRedirectRuleProperty
    ) where
import qualified Data.Aeson as JSON
import qualified Stratosphere.Prelude as Prelude
import Stratosphere.Property
import Stratosphere.ResourceProperties
import Stratosphere.Value
data RedirectRuleProperty
  = -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-redirectrule.html>
    RedirectRuleProperty {RedirectRuleProperty -> ()
haddock_workaround_ :: (),
                          -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-redirectrule.html#cfn-s3-bucket-redirectrule-hostname>
                          RedirectRuleProperty -> Maybe (Value Text)
hostName :: (Prelude.Maybe (Value Prelude.Text)),
                          -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-redirectrule.html#cfn-s3-bucket-redirectrule-httpredirectcode>
                          RedirectRuleProperty -> Maybe (Value Text)
httpRedirectCode :: (Prelude.Maybe (Value Prelude.Text)),
                          -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-redirectrule.html#cfn-s3-bucket-redirectrule-protocol>
                          RedirectRuleProperty -> Maybe (Value Text)
protocol :: (Prelude.Maybe (Value Prelude.Text)),
                          -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-redirectrule.html#cfn-s3-bucket-redirectrule-replacekeyprefixwith>
                          RedirectRuleProperty -> Maybe (Value Text)
replaceKeyPrefixWith :: (Prelude.Maybe (Value Prelude.Text)),
                          -- | See: <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-redirectrule.html#cfn-s3-bucket-redirectrule-replacekeywith>
                          RedirectRuleProperty -> Maybe (Value Text)
replaceKeyWith :: (Prelude.Maybe (Value Prelude.Text))}
  deriving stock (RedirectRuleProperty -> RedirectRuleProperty -> Bool
(RedirectRuleProperty -> RedirectRuleProperty -> Bool)
-> (RedirectRuleProperty -> RedirectRuleProperty -> Bool)
-> Eq RedirectRuleProperty
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: RedirectRuleProperty -> RedirectRuleProperty -> Bool
== :: RedirectRuleProperty -> RedirectRuleProperty -> Bool
$c/= :: RedirectRuleProperty -> RedirectRuleProperty -> Bool
/= :: RedirectRuleProperty -> RedirectRuleProperty -> Bool
Prelude.Eq, Int -> RedirectRuleProperty -> ShowS
[RedirectRuleProperty] -> ShowS
RedirectRuleProperty -> String
(Int -> RedirectRuleProperty -> ShowS)
-> (RedirectRuleProperty -> String)
-> ([RedirectRuleProperty] -> ShowS)
-> Show RedirectRuleProperty
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> RedirectRuleProperty -> ShowS
showsPrec :: Int -> RedirectRuleProperty -> ShowS
$cshow :: RedirectRuleProperty -> String
show :: RedirectRuleProperty -> String
$cshowList :: [RedirectRuleProperty] -> ShowS
showList :: [RedirectRuleProperty] -> ShowS
Prelude.Show)
mkRedirectRuleProperty :: RedirectRuleProperty
mkRedirectRuleProperty :: RedirectRuleProperty
mkRedirectRuleProperty
  = RedirectRuleProperty
      {haddock_workaround_ :: ()
haddock_workaround_ = (), hostName :: Maybe (Value Text)
hostName = Maybe (Value Text)
forall a. Maybe a
Prelude.Nothing,
       httpRedirectCode :: Maybe (Value Text)
httpRedirectCode = Maybe (Value Text)
forall a. Maybe a
Prelude.Nothing, protocol :: Maybe (Value Text)
protocol = Maybe (Value Text)
forall a. Maybe a
Prelude.Nothing,
       replaceKeyPrefixWith :: Maybe (Value Text)
replaceKeyPrefixWith = Maybe (Value Text)
forall a. Maybe a
Prelude.Nothing,
       replaceKeyWith :: Maybe (Value Text)
replaceKeyWith = Maybe (Value Text)
forall a. Maybe a
Prelude.Nothing}
instance ToResourceProperties RedirectRuleProperty where
  toResourceProperties :: RedirectRuleProperty -> ResourceProperties
toResourceProperties RedirectRuleProperty {Maybe (Value Text)
()
haddock_workaround_ :: RedirectRuleProperty -> ()
hostName :: RedirectRuleProperty -> Maybe (Value Text)
httpRedirectCode :: RedirectRuleProperty -> Maybe (Value Text)
protocol :: RedirectRuleProperty -> Maybe (Value Text)
replaceKeyPrefixWith :: RedirectRuleProperty -> Maybe (Value Text)
replaceKeyWith :: RedirectRuleProperty -> Maybe (Value Text)
haddock_workaround_ :: ()
hostName :: Maybe (Value Text)
httpRedirectCode :: Maybe (Value Text)
protocol :: Maybe (Value Text)
replaceKeyPrefixWith :: Maybe (Value Text)
replaceKeyWith :: Maybe (Value Text)
..}
    = ResourceProperties
        {awsType :: Text
awsType = Text
"AWS::S3::Bucket.RedirectRule",
         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
"HostName" (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)
hostName,
                            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
"HttpRedirectCode" (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)
httpRedirectCode,
                            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
"Protocol" (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)
protocol,
                            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
"ReplaceKeyPrefixWith" (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)
replaceKeyPrefixWith,
                            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
"ReplaceKeyWith" (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)
replaceKeyWith])}
instance JSON.ToJSON RedirectRuleProperty where
  toJSON :: RedirectRuleProperty -> Value
toJSON RedirectRuleProperty {Maybe (Value Text)
()
haddock_workaround_ :: RedirectRuleProperty -> ()
hostName :: RedirectRuleProperty -> Maybe (Value Text)
httpRedirectCode :: RedirectRuleProperty -> Maybe (Value Text)
protocol :: RedirectRuleProperty -> Maybe (Value Text)
replaceKeyPrefixWith :: RedirectRuleProperty -> Maybe (Value Text)
replaceKeyWith :: RedirectRuleProperty -> Maybe (Value Text)
haddock_workaround_ :: ()
hostName :: Maybe (Value Text)
httpRedirectCode :: Maybe (Value Text)
protocol :: Maybe (Value Text)
replaceKeyPrefixWith :: Maybe (Value Text)
replaceKeyWith :: 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
"HostName" (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)
hostName,
               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
"HttpRedirectCode" (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)
httpRedirectCode,
               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
"Protocol" (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)
protocol,
               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
"ReplaceKeyPrefixWith" (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)
replaceKeyPrefixWith,
               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
"ReplaceKeyWith" (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)
replaceKeyWith]))
instance Property "HostName" RedirectRuleProperty where
  type PropertyType "HostName" RedirectRuleProperty = Value Prelude.Text
  set :: PropertyType "HostName" RedirectRuleProperty
-> RedirectRuleProperty -> RedirectRuleProperty
set PropertyType "HostName" RedirectRuleProperty
newValue RedirectRuleProperty {Maybe (Value Text)
()
haddock_workaround_ :: RedirectRuleProperty -> ()
hostName :: RedirectRuleProperty -> Maybe (Value Text)
httpRedirectCode :: RedirectRuleProperty -> Maybe (Value Text)
protocol :: RedirectRuleProperty -> Maybe (Value Text)
replaceKeyPrefixWith :: RedirectRuleProperty -> Maybe (Value Text)
replaceKeyWith :: RedirectRuleProperty -> Maybe (Value Text)
haddock_workaround_ :: ()
hostName :: Maybe (Value Text)
httpRedirectCode :: Maybe (Value Text)
protocol :: Maybe (Value Text)
replaceKeyPrefixWith :: Maybe (Value Text)
replaceKeyWith :: Maybe (Value Text)
..}
    = RedirectRuleProperty {hostName :: Maybe (Value Text)
hostName = Value Text -> Maybe (Value Text)
forall a. a -> Maybe a
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure PropertyType "HostName" RedirectRuleProperty
Value Text
newValue, Maybe (Value Text)
()
haddock_workaround_ :: ()
httpRedirectCode :: Maybe (Value Text)
protocol :: Maybe (Value Text)
replaceKeyPrefixWith :: Maybe (Value Text)
replaceKeyWith :: Maybe (Value Text)
haddock_workaround_ :: ()
httpRedirectCode :: Maybe (Value Text)
protocol :: Maybe (Value Text)
replaceKeyPrefixWith :: Maybe (Value Text)
replaceKeyWith :: Maybe (Value Text)
..}
instance Property "HttpRedirectCode" RedirectRuleProperty where
  type PropertyType "HttpRedirectCode" RedirectRuleProperty = Value Prelude.Text
  set :: PropertyType "HttpRedirectCode" RedirectRuleProperty
-> RedirectRuleProperty -> RedirectRuleProperty
set PropertyType "HttpRedirectCode" RedirectRuleProperty
newValue RedirectRuleProperty {Maybe (Value Text)
()
haddock_workaround_ :: RedirectRuleProperty -> ()
hostName :: RedirectRuleProperty -> Maybe (Value Text)
httpRedirectCode :: RedirectRuleProperty -> Maybe (Value Text)
protocol :: RedirectRuleProperty -> Maybe (Value Text)
replaceKeyPrefixWith :: RedirectRuleProperty -> Maybe (Value Text)
replaceKeyWith :: RedirectRuleProperty -> Maybe (Value Text)
haddock_workaround_ :: ()
hostName :: Maybe (Value Text)
httpRedirectCode :: Maybe (Value Text)
protocol :: Maybe (Value Text)
replaceKeyPrefixWith :: Maybe (Value Text)
replaceKeyWith :: Maybe (Value Text)
..}
    = RedirectRuleProperty
        {httpRedirectCode :: Maybe (Value Text)
httpRedirectCode = Value Text -> Maybe (Value Text)
forall a. a -> Maybe a
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure PropertyType "HttpRedirectCode" RedirectRuleProperty
Value Text
newValue, Maybe (Value Text)
()
haddock_workaround_ :: ()
hostName :: Maybe (Value Text)
protocol :: Maybe (Value Text)
replaceKeyPrefixWith :: Maybe (Value Text)
replaceKeyWith :: Maybe (Value Text)
haddock_workaround_ :: ()
hostName :: Maybe (Value Text)
protocol :: Maybe (Value Text)
replaceKeyPrefixWith :: Maybe (Value Text)
replaceKeyWith :: Maybe (Value Text)
..}
instance Property "Protocol" RedirectRuleProperty where
  type PropertyType "Protocol" RedirectRuleProperty = Value Prelude.Text
  set :: PropertyType "Protocol" RedirectRuleProperty
-> RedirectRuleProperty -> RedirectRuleProperty
set PropertyType "Protocol" RedirectRuleProperty
newValue RedirectRuleProperty {Maybe (Value Text)
()
haddock_workaround_ :: RedirectRuleProperty -> ()
hostName :: RedirectRuleProperty -> Maybe (Value Text)
httpRedirectCode :: RedirectRuleProperty -> Maybe (Value Text)
protocol :: RedirectRuleProperty -> Maybe (Value Text)
replaceKeyPrefixWith :: RedirectRuleProperty -> Maybe (Value Text)
replaceKeyWith :: RedirectRuleProperty -> Maybe (Value Text)
haddock_workaround_ :: ()
hostName :: Maybe (Value Text)
httpRedirectCode :: Maybe (Value Text)
protocol :: Maybe (Value Text)
replaceKeyPrefixWith :: Maybe (Value Text)
replaceKeyWith :: Maybe (Value Text)
..}
    = RedirectRuleProperty {protocol :: Maybe (Value Text)
protocol = Value Text -> Maybe (Value Text)
forall a. a -> Maybe a
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure PropertyType "Protocol" RedirectRuleProperty
Value Text
newValue, Maybe (Value Text)
()
haddock_workaround_ :: ()
hostName :: Maybe (Value Text)
httpRedirectCode :: Maybe (Value Text)
replaceKeyPrefixWith :: Maybe (Value Text)
replaceKeyWith :: Maybe (Value Text)
haddock_workaround_ :: ()
hostName :: Maybe (Value Text)
httpRedirectCode :: Maybe (Value Text)
replaceKeyPrefixWith :: Maybe (Value Text)
replaceKeyWith :: Maybe (Value Text)
..}
instance Property "ReplaceKeyPrefixWith" RedirectRuleProperty where
  type PropertyType "ReplaceKeyPrefixWith" RedirectRuleProperty = Value Prelude.Text
  set :: PropertyType "ReplaceKeyPrefixWith" RedirectRuleProperty
-> RedirectRuleProperty -> RedirectRuleProperty
set PropertyType "ReplaceKeyPrefixWith" RedirectRuleProperty
newValue RedirectRuleProperty {Maybe (Value Text)
()
haddock_workaround_ :: RedirectRuleProperty -> ()
hostName :: RedirectRuleProperty -> Maybe (Value Text)
httpRedirectCode :: RedirectRuleProperty -> Maybe (Value Text)
protocol :: RedirectRuleProperty -> Maybe (Value Text)
replaceKeyPrefixWith :: RedirectRuleProperty -> Maybe (Value Text)
replaceKeyWith :: RedirectRuleProperty -> Maybe (Value Text)
haddock_workaround_ :: ()
hostName :: Maybe (Value Text)
httpRedirectCode :: Maybe (Value Text)
protocol :: Maybe (Value Text)
replaceKeyPrefixWith :: Maybe (Value Text)
replaceKeyWith :: Maybe (Value Text)
..}
    = RedirectRuleProperty
        {replaceKeyPrefixWith :: Maybe (Value Text)
replaceKeyPrefixWith = Value Text -> Maybe (Value Text)
forall a. a -> Maybe a
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure PropertyType "ReplaceKeyPrefixWith" RedirectRuleProperty
Value Text
newValue, Maybe (Value Text)
()
haddock_workaround_ :: ()
hostName :: Maybe (Value Text)
httpRedirectCode :: Maybe (Value Text)
protocol :: Maybe (Value Text)
replaceKeyWith :: Maybe (Value Text)
haddock_workaround_ :: ()
hostName :: Maybe (Value Text)
httpRedirectCode :: Maybe (Value Text)
protocol :: Maybe (Value Text)
replaceKeyWith :: Maybe (Value Text)
..}
instance Property "ReplaceKeyWith" RedirectRuleProperty where
  type PropertyType "ReplaceKeyWith" RedirectRuleProperty = Value Prelude.Text
  set :: PropertyType "ReplaceKeyWith" RedirectRuleProperty
-> RedirectRuleProperty -> RedirectRuleProperty
set PropertyType "ReplaceKeyWith" RedirectRuleProperty
newValue RedirectRuleProperty {Maybe (Value Text)
()
haddock_workaround_ :: RedirectRuleProperty -> ()
hostName :: RedirectRuleProperty -> Maybe (Value Text)
httpRedirectCode :: RedirectRuleProperty -> Maybe (Value Text)
protocol :: RedirectRuleProperty -> Maybe (Value Text)
replaceKeyPrefixWith :: RedirectRuleProperty -> Maybe (Value Text)
replaceKeyWith :: RedirectRuleProperty -> Maybe (Value Text)
haddock_workaround_ :: ()
hostName :: Maybe (Value Text)
httpRedirectCode :: Maybe (Value Text)
protocol :: Maybe (Value Text)
replaceKeyPrefixWith :: Maybe (Value Text)
replaceKeyWith :: Maybe (Value Text)
..}
    = RedirectRuleProperty {replaceKeyWith :: Maybe (Value Text)
replaceKeyWith = Value Text -> Maybe (Value Text)
forall a. a -> Maybe a
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure PropertyType "ReplaceKeyWith" RedirectRuleProperty
Value Text
newValue, Maybe (Value Text)
()
haddock_workaround_ :: ()
hostName :: Maybe (Value Text)
httpRedirectCode :: Maybe (Value Text)
protocol :: Maybe (Value Text)
replaceKeyPrefixWith :: Maybe (Value Text)
haddock_workaround_ :: ()
hostName :: Maybe (Value Text)
httpRedirectCode :: Maybe (Value Text)
protocol :: Maybe (Value Text)
replaceKeyPrefixWith :: Maybe (Value Text)
..}