{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.SecurityHub.Types.AwsS3BucketWebsiteConfiguration
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.SecurityHub.Types.AwsS3BucketWebsiteConfiguration where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.SecurityHub.Types.AwsS3BucketWebsiteConfigurationRedirectTo
import Amazonka.SecurityHub.Types.AwsS3BucketWebsiteConfigurationRoutingRule

-- | Website parameters for the S3 bucket.
--
-- /See:/ 'newAwsS3BucketWebsiteConfiguration' smart constructor.
data AwsS3BucketWebsiteConfiguration = AwsS3BucketWebsiteConfiguration'
  { -- | The redirect behavior for requests to the website.
    AwsS3BucketWebsiteConfiguration
-> Maybe AwsS3BucketWebsiteConfigurationRedirectTo
redirectAllRequestsTo :: Prelude.Maybe AwsS3BucketWebsiteConfigurationRedirectTo,
    -- | The name of the index document for the website.
    AwsS3BucketWebsiteConfiguration -> Maybe Text
indexDocumentSuffix :: Prelude.Maybe Prelude.Text,
    -- | The name of the error document for the website.
    AwsS3BucketWebsiteConfiguration -> Maybe Text
errorDocument :: Prelude.Maybe Prelude.Text,
    -- | The rules for applying redirects for requests to the website.
    AwsS3BucketWebsiteConfiguration
-> Maybe [AwsS3BucketWebsiteConfigurationRoutingRule]
routingRules :: Prelude.Maybe [AwsS3BucketWebsiteConfigurationRoutingRule]
  }
  deriving (AwsS3BucketWebsiteConfiguration
-> AwsS3BucketWebsiteConfiguration -> Bool
(AwsS3BucketWebsiteConfiguration
 -> AwsS3BucketWebsiteConfiguration -> Bool)
-> (AwsS3BucketWebsiteConfiguration
    -> AwsS3BucketWebsiteConfiguration -> Bool)
-> Eq AwsS3BucketWebsiteConfiguration
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AwsS3BucketWebsiteConfiguration
-> AwsS3BucketWebsiteConfiguration -> Bool
$c/= :: AwsS3BucketWebsiteConfiguration
-> AwsS3BucketWebsiteConfiguration -> Bool
== :: AwsS3BucketWebsiteConfiguration
-> AwsS3BucketWebsiteConfiguration -> Bool
$c== :: AwsS3BucketWebsiteConfiguration
-> AwsS3BucketWebsiteConfiguration -> Bool
Prelude.Eq, ReadPrec [AwsS3BucketWebsiteConfiguration]
ReadPrec AwsS3BucketWebsiteConfiguration
Int -> ReadS AwsS3BucketWebsiteConfiguration
ReadS [AwsS3BucketWebsiteConfiguration]
(Int -> ReadS AwsS3BucketWebsiteConfiguration)
-> ReadS [AwsS3BucketWebsiteConfiguration]
-> ReadPrec AwsS3BucketWebsiteConfiguration
-> ReadPrec [AwsS3BucketWebsiteConfiguration]
-> Read AwsS3BucketWebsiteConfiguration
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AwsS3BucketWebsiteConfiguration]
$creadListPrec :: ReadPrec [AwsS3BucketWebsiteConfiguration]
readPrec :: ReadPrec AwsS3BucketWebsiteConfiguration
$creadPrec :: ReadPrec AwsS3BucketWebsiteConfiguration
readList :: ReadS [AwsS3BucketWebsiteConfiguration]
$creadList :: ReadS [AwsS3BucketWebsiteConfiguration]
readsPrec :: Int -> ReadS AwsS3BucketWebsiteConfiguration
$creadsPrec :: Int -> ReadS AwsS3BucketWebsiteConfiguration
Prelude.Read, Int -> AwsS3BucketWebsiteConfiguration -> ShowS
[AwsS3BucketWebsiteConfiguration] -> ShowS
AwsS3BucketWebsiteConfiguration -> String
(Int -> AwsS3BucketWebsiteConfiguration -> ShowS)
-> (AwsS3BucketWebsiteConfiguration -> String)
-> ([AwsS3BucketWebsiteConfiguration] -> ShowS)
-> Show AwsS3BucketWebsiteConfiguration
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AwsS3BucketWebsiteConfiguration] -> ShowS
$cshowList :: [AwsS3BucketWebsiteConfiguration] -> ShowS
show :: AwsS3BucketWebsiteConfiguration -> String
$cshow :: AwsS3BucketWebsiteConfiguration -> String
showsPrec :: Int -> AwsS3BucketWebsiteConfiguration -> ShowS
$cshowsPrec :: Int -> AwsS3BucketWebsiteConfiguration -> ShowS
Prelude.Show, (forall x.
 AwsS3BucketWebsiteConfiguration
 -> Rep AwsS3BucketWebsiteConfiguration x)
-> (forall x.
    Rep AwsS3BucketWebsiteConfiguration x
    -> AwsS3BucketWebsiteConfiguration)
-> Generic AwsS3BucketWebsiteConfiguration
forall x.
Rep AwsS3BucketWebsiteConfiguration x
-> AwsS3BucketWebsiteConfiguration
forall x.
AwsS3BucketWebsiteConfiguration
-> Rep AwsS3BucketWebsiteConfiguration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep AwsS3BucketWebsiteConfiguration x
-> AwsS3BucketWebsiteConfiguration
$cfrom :: forall x.
AwsS3BucketWebsiteConfiguration
-> Rep AwsS3BucketWebsiteConfiguration x
Prelude.Generic)

-- |
-- Create a value of 'AwsS3BucketWebsiteConfiguration' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'redirectAllRequestsTo', 'awsS3BucketWebsiteConfiguration_redirectAllRequestsTo' - The redirect behavior for requests to the website.
--
-- 'indexDocumentSuffix', 'awsS3BucketWebsiteConfiguration_indexDocumentSuffix' - The name of the index document for the website.
--
-- 'errorDocument', 'awsS3BucketWebsiteConfiguration_errorDocument' - The name of the error document for the website.
--
-- 'routingRules', 'awsS3BucketWebsiteConfiguration_routingRules' - The rules for applying redirects for requests to the website.
newAwsS3BucketWebsiteConfiguration ::
  AwsS3BucketWebsiteConfiguration
newAwsS3BucketWebsiteConfiguration :: AwsS3BucketWebsiteConfiguration
newAwsS3BucketWebsiteConfiguration =
  AwsS3BucketWebsiteConfiguration' :: Maybe AwsS3BucketWebsiteConfigurationRedirectTo
-> Maybe Text
-> Maybe Text
-> Maybe [AwsS3BucketWebsiteConfigurationRoutingRule]
-> AwsS3BucketWebsiteConfiguration
AwsS3BucketWebsiteConfiguration'
    { $sel:redirectAllRequestsTo:AwsS3BucketWebsiteConfiguration' :: Maybe AwsS3BucketWebsiteConfigurationRedirectTo
redirectAllRequestsTo =
        Maybe AwsS3BucketWebsiteConfigurationRedirectTo
forall a. Maybe a
Prelude.Nothing,
      $sel:indexDocumentSuffix:AwsS3BucketWebsiteConfiguration' :: Maybe Text
indexDocumentSuffix = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:errorDocument:AwsS3BucketWebsiteConfiguration' :: Maybe Text
errorDocument = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:routingRules:AwsS3BucketWebsiteConfiguration' :: Maybe [AwsS3BucketWebsiteConfigurationRoutingRule]
routingRules = Maybe [AwsS3BucketWebsiteConfigurationRoutingRule]
forall a. Maybe a
Prelude.Nothing
    }

-- | The redirect behavior for requests to the website.
awsS3BucketWebsiteConfiguration_redirectAllRequestsTo :: Lens.Lens' AwsS3BucketWebsiteConfiguration (Prelude.Maybe AwsS3BucketWebsiteConfigurationRedirectTo)
awsS3BucketWebsiteConfiguration_redirectAllRequestsTo :: (Maybe AwsS3BucketWebsiteConfigurationRedirectTo
 -> f (Maybe AwsS3BucketWebsiteConfigurationRedirectTo))
-> AwsS3BucketWebsiteConfiguration
-> f AwsS3BucketWebsiteConfiguration
awsS3BucketWebsiteConfiguration_redirectAllRequestsTo = (AwsS3BucketWebsiteConfiguration
 -> Maybe AwsS3BucketWebsiteConfigurationRedirectTo)
-> (AwsS3BucketWebsiteConfiguration
    -> Maybe AwsS3BucketWebsiteConfigurationRedirectTo
    -> AwsS3BucketWebsiteConfiguration)
-> Lens
     AwsS3BucketWebsiteConfiguration
     AwsS3BucketWebsiteConfiguration
     (Maybe AwsS3BucketWebsiteConfigurationRedirectTo)
     (Maybe AwsS3BucketWebsiteConfigurationRedirectTo)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AwsS3BucketWebsiteConfiguration' {Maybe AwsS3BucketWebsiteConfigurationRedirectTo
redirectAllRequestsTo :: Maybe AwsS3BucketWebsiteConfigurationRedirectTo
$sel:redirectAllRequestsTo:AwsS3BucketWebsiteConfiguration' :: AwsS3BucketWebsiteConfiguration
-> Maybe AwsS3BucketWebsiteConfigurationRedirectTo
redirectAllRequestsTo} -> Maybe AwsS3BucketWebsiteConfigurationRedirectTo
redirectAllRequestsTo) (\s :: AwsS3BucketWebsiteConfiguration
s@AwsS3BucketWebsiteConfiguration' {} Maybe AwsS3BucketWebsiteConfigurationRedirectTo
a -> AwsS3BucketWebsiteConfiguration
s {$sel:redirectAllRequestsTo:AwsS3BucketWebsiteConfiguration' :: Maybe AwsS3BucketWebsiteConfigurationRedirectTo
redirectAllRequestsTo = Maybe AwsS3BucketWebsiteConfigurationRedirectTo
a} :: AwsS3BucketWebsiteConfiguration)

-- | The name of the index document for the website.
awsS3BucketWebsiteConfiguration_indexDocumentSuffix :: Lens.Lens' AwsS3BucketWebsiteConfiguration (Prelude.Maybe Prelude.Text)
awsS3BucketWebsiteConfiguration_indexDocumentSuffix :: (Maybe Text -> f (Maybe Text))
-> AwsS3BucketWebsiteConfiguration
-> f AwsS3BucketWebsiteConfiguration
awsS3BucketWebsiteConfiguration_indexDocumentSuffix = (AwsS3BucketWebsiteConfiguration -> Maybe Text)
-> (AwsS3BucketWebsiteConfiguration
    -> Maybe Text -> AwsS3BucketWebsiteConfiguration)
-> Lens
     AwsS3BucketWebsiteConfiguration
     AwsS3BucketWebsiteConfiguration
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AwsS3BucketWebsiteConfiguration' {Maybe Text
indexDocumentSuffix :: Maybe Text
$sel:indexDocumentSuffix:AwsS3BucketWebsiteConfiguration' :: AwsS3BucketWebsiteConfiguration -> Maybe Text
indexDocumentSuffix} -> Maybe Text
indexDocumentSuffix) (\s :: AwsS3BucketWebsiteConfiguration
s@AwsS3BucketWebsiteConfiguration' {} Maybe Text
a -> AwsS3BucketWebsiteConfiguration
s {$sel:indexDocumentSuffix:AwsS3BucketWebsiteConfiguration' :: Maybe Text
indexDocumentSuffix = Maybe Text
a} :: AwsS3BucketWebsiteConfiguration)

-- | The name of the error document for the website.
awsS3BucketWebsiteConfiguration_errorDocument :: Lens.Lens' AwsS3BucketWebsiteConfiguration (Prelude.Maybe Prelude.Text)
awsS3BucketWebsiteConfiguration_errorDocument :: (Maybe Text -> f (Maybe Text))
-> AwsS3BucketWebsiteConfiguration
-> f AwsS3BucketWebsiteConfiguration
awsS3BucketWebsiteConfiguration_errorDocument = (AwsS3BucketWebsiteConfiguration -> Maybe Text)
-> (AwsS3BucketWebsiteConfiguration
    -> Maybe Text -> AwsS3BucketWebsiteConfiguration)
-> Lens
     AwsS3BucketWebsiteConfiguration
     AwsS3BucketWebsiteConfiguration
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AwsS3BucketWebsiteConfiguration' {Maybe Text
errorDocument :: Maybe Text
$sel:errorDocument:AwsS3BucketWebsiteConfiguration' :: AwsS3BucketWebsiteConfiguration -> Maybe Text
errorDocument} -> Maybe Text
errorDocument) (\s :: AwsS3BucketWebsiteConfiguration
s@AwsS3BucketWebsiteConfiguration' {} Maybe Text
a -> AwsS3BucketWebsiteConfiguration
s {$sel:errorDocument:AwsS3BucketWebsiteConfiguration' :: Maybe Text
errorDocument = Maybe Text
a} :: AwsS3BucketWebsiteConfiguration)

-- | The rules for applying redirects for requests to the website.
awsS3BucketWebsiteConfiguration_routingRules :: Lens.Lens' AwsS3BucketWebsiteConfiguration (Prelude.Maybe [AwsS3BucketWebsiteConfigurationRoutingRule])
awsS3BucketWebsiteConfiguration_routingRules :: (Maybe [AwsS3BucketWebsiteConfigurationRoutingRule]
 -> f (Maybe [AwsS3BucketWebsiteConfigurationRoutingRule]))
-> AwsS3BucketWebsiteConfiguration
-> f AwsS3BucketWebsiteConfiguration
awsS3BucketWebsiteConfiguration_routingRules = (AwsS3BucketWebsiteConfiguration
 -> Maybe [AwsS3BucketWebsiteConfigurationRoutingRule])
-> (AwsS3BucketWebsiteConfiguration
    -> Maybe [AwsS3BucketWebsiteConfigurationRoutingRule]
    -> AwsS3BucketWebsiteConfiguration)
-> Lens
     AwsS3BucketWebsiteConfiguration
     AwsS3BucketWebsiteConfiguration
     (Maybe [AwsS3BucketWebsiteConfigurationRoutingRule])
     (Maybe [AwsS3BucketWebsiteConfigurationRoutingRule])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AwsS3BucketWebsiteConfiguration' {Maybe [AwsS3BucketWebsiteConfigurationRoutingRule]
routingRules :: Maybe [AwsS3BucketWebsiteConfigurationRoutingRule]
$sel:routingRules:AwsS3BucketWebsiteConfiguration' :: AwsS3BucketWebsiteConfiguration
-> Maybe [AwsS3BucketWebsiteConfigurationRoutingRule]
routingRules} -> Maybe [AwsS3BucketWebsiteConfigurationRoutingRule]
routingRules) (\s :: AwsS3BucketWebsiteConfiguration
s@AwsS3BucketWebsiteConfiguration' {} Maybe [AwsS3BucketWebsiteConfigurationRoutingRule]
a -> AwsS3BucketWebsiteConfiguration
s {$sel:routingRules:AwsS3BucketWebsiteConfiguration' :: Maybe [AwsS3BucketWebsiteConfigurationRoutingRule]
routingRules = Maybe [AwsS3BucketWebsiteConfigurationRoutingRule]
a} :: AwsS3BucketWebsiteConfiguration) ((Maybe [AwsS3BucketWebsiteConfigurationRoutingRule]
  -> f (Maybe [AwsS3BucketWebsiteConfigurationRoutingRule]))
 -> AwsS3BucketWebsiteConfiguration
 -> f AwsS3BucketWebsiteConfiguration)
-> ((Maybe [AwsS3BucketWebsiteConfigurationRoutingRule]
     -> f (Maybe [AwsS3BucketWebsiteConfigurationRoutingRule]))
    -> Maybe [AwsS3BucketWebsiteConfigurationRoutingRule]
    -> f (Maybe [AwsS3BucketWebsiteConfigurationRoutingRule]))
-> (Maybe [AwsS3BucketWebsiteConfigurationRoutingRule]
    -> f (Maybe [AwsS3BucketWebsiteConfigurationRoutingRule]))
-> AwsS3BucketWebsiteConfiguration
-> f AwsS3BucketWebsiteConfiguration
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [AwsS3BucketWebsiteConfigurationRoutingRule]
  [AwsS3BucketWebsiteConfigurationRoutingRule]
  [AwsS3BucketWebsiteConfigurationRoutingRule]
  [AwsS3BucketWebsiteConfigurationRoutingRule]
-> Iso
     (Maybe [AwsS3BucketWebsiteConfigurationRoutingRule])
     (Maybe [AwsS3BucketWebsiteConfigurationRoutingRule])
     (Maybe [AwsS3BucketWebsiteConfigurationRoutingRule])
     (Maybe [AwsS3BucketWebsiteConfigurationRoutingRule])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso
  [AwsS3BucketWebsiteConfigurationRoutingRule]
  [AwsS3BucketWebsiteConfigurationRoutingRule]
  [AwsS3BucketWebsiteConfigurationRoutingRule]
  [AwsS3BucketWebsiteConfigurationRoutingRule]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance
  Core.FromJSON
    AwsS3BucketWebsiteConfiguration
  where
  parseJSON :: Value -> Parser AwsS3BucketWebsiteConfiguration
parseJSON =
    String
-> (Object -> Parser AwsS3BucketWebsiteConfiguration)
-> Value
-> Parser AwsS3BucketWebsiteConfiguration
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"AwsS3BucketWebsiteConfiguration"
      ( \Object
x ->
          Maybe AwsS3BucketWebsiteConfigurationRedirectTo
-> Maybe Text
-> Maybe Text
-> Maybe [AwsS3BucketWebsiteConfigurationRoutingRule]
-> AwsS3BucketWebsiteConfiguration
AwsS3BucketWebsiteConfiguration'
            (Maybe AwsS3BucketWebsiteConfigurationRedirectTo
 -> Maybe Text
 -> Maybe Text
 -> Maybe [AwsS3BucketWebsiteConfigurationRoutingRule]
 -> AwsS3BucketWebsiteConfiguration)
-> Parser (Maybe AwsS3BucketWebsiteConfigurationRedirectTo)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe [AwsS3BucketWebsiteConfigurationRoutingRule]
      -> AwsS3BucketWebsiteConfiguration)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object
-> Text -> Parser (Maybe AwsS3BucketWebsiteConfigurationRedirectTo)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"RedirectAllRequestsTo")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe [AwsS3BucketWebsiteConfigurationRoutingRule]
   -> AwsS3BucketWebsiteConfiguration)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe [AwsS3BucketWebsiteConfigurationRoutingRule]
      -> AwsS3BucketWebsiteConfiguration)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"IndexDocumentSuffix")
            Parser
  (Maybe Text
   -> Maybe [AwsS3BucketWebsiteConfigurationRoutingRule]
   -> AwsS3BucketWebsiteConfiguration)
-> Parser (Maybe Text)
-> Parser
     (Maybe [AwsS3BucketWebsiteConfigurationRoutingRule]
      -> AwsS3BucketWebsiteConfiguration)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ErrorDocument")
            Parser
  (Maybe [AwsS3BucketWebsiteConfigurationRoutingRule]
   -> AwsS3BucketWebsiteConfiguration)
-> Parser (Maybe [AwsS3BucketWebsiteConfigurationRoutingRule])
-> Parser AwsS3BucketWebsiteConfiguration
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object
-> Text
-> Parser
     (Maybe (Maybe [AwsS3BucketWebsiteConfigurationRoutingRule]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"RoutingRules" Parser (Maybe (Maybe [AwsS3BucketWebsiteConfigurationRoutingRule]))
-> Maybe [AwsS3BucketWebsiteConfigurationRoutingRule]
-> Parser (Maybe [AwsS3BucketWebsiteConfigurationRoutingRule])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [AwsS3BucketWebsiteConfigurationRoutingRule]
forall a. Monoid a => a
Prelude.mempty)
      )

instance
  Prelude.Hashable
    AwsS3BucketWebsiteConfiguration

instance
  Prelude.NFData
    AwsS3BucketWebsiteConfiguration

instance Core.ToJSON AwsS3BucketWebsiteConfiguration where
  toJSON :: AwsS3BucketWebsiteConfiguration -> Value
toJSON AwsS3BucketWebsiteConfiguration' {Maybe [AwsS3BucketWebsiteConfigurationRoutingRule]
Maybe Text
Maybe AwsS3BucketWebsiteConfigurationRedirectTo
routingRules :: Maybe [AwsS3BucketWebsiteConfigurationRoutingRule]
errorDocument :: Maybe Text
indexDocumentSuffix :: Maybe Text
redirectAllRequestsTo :: Maybe AwsS3BucketWebsiteConfigurationRedirectTo
$sel:routingRules:AwsS3BucketWebsiteConfiguration' :: AwsS3BucketWebsiteConfiguration
-> Maybe [AwsS3BucketWebsiteConfigurationRoutingRule]
$sel:errorDocument:AwsS3BucketWebsiteConfiguration' :: AwsS3BucketWebsiteConfiguration -> Maybe Text
$sel:indexDocumentSuffix:AwsS3BucketWebsiteConfiguration' :: AwsS3BucketWebsiteConfiguration -> Maybe Text
$sel:redirectAllRequestsTo:AwsS3BucketWebsiteConfiguration' :: AwsS3BucketWebsiteConfiguration
-> Maybe AwsS3BucketWebsiteConfigurationRedirectTo
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"RedirectAllRequestsTo" Text -> AwsS3BucketWebsiteConfigurationRedirectTo -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (AwsS3BucketWebsiteConfigurationRedirectTo -> Pair)
-> Maybe AwsS3BucketWebsiteConfigurationRedirectTo -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe AwsS3BucketWebsiteConfigurationRedirectTo
redirectAllRequestsTo,
            (Text
"IndexDocumentSuffix" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
indexDocumentSuffix,
            (Text
"ErrorDocument" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
errorDocument,
            (Text
"RoutingRules" Text -> [AwsS3BucketWebsiteConfigurationRoutingRule] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) ([AwsS3BucketWebsiteConfigurationRoutingRule] -> Pair)
-> Maybe [AwsS3BucketWebsiteConfigurationRoutingRule] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [AwsS3BucketWebsiteConfigurationRoutingRule]
routingRules
          ]
      )