{-# 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 #-}
module Amazonka.SecurityHub.Types.AwsS3BucketWebsiteConfigurationRedirectTo where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data AwsS3BucketWebsiteConfigurationRedirectTo = AwsS3BucketWebsiteConfigurationRedirectTo'
{
AwsS3BucketWebsiteConfigurationRedirectTo -> Maybe Text
hostname :: Prelude.Maybe Prelude.Text,
AwsS3BucketWebsiteConfigurationRedirectTo -> Maybe Text
protocol :: Prelude.Maybe Prelude.Text
}
deriving (AwsS3BucketWebsiteConfigurationRedirectTo
-> AwsS3BucketWebsiteConfigurationRedirectTo -> Bool
(AwsS3BucketWebsiteConfigurationRedirectTo
-> AwsS3BucketWebsiteConfigurationRedirectTo -> Bool)
-> (AwsS3BucketWebsiteConfigurationRedirectTo
-> AwsS3BucketWebsiteConfigurationRedirectTo -> Bool)
-> Eq AwsS3BucketWebsiteConfigurationRedirectTo
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AwsS3BucketWebsiteConfigurationRedirectTo
-> AwsS3BucketWebsiteConfigurationRedirectTo -> Bool
$c/= :: AwsS3BucketWebsiteConfigurationRedirectTo
-> AwsS3BucketWebsiteConfigurationRedirectTo -> Bool
== :: AwsS3BucketWebsiteConfigurationRedirectTo
-> AwsS3BucketWebsiteConfigurationRedirectTo -> Bool
$c== :: AwsS3BucketWebsiteConfigurationRedirectTo
-> AwsS3BucketWebsiteConfigurationRedirectTo -> Bool
Prelude.Eq, ReadPrec [AwsS3BucketWebsiteConfigurationRedirectTo]
ReadPrec AwsS3BucketWebsiteConfigurationRedirectTo
Int -> ReadS AwsS3BucketWebsiteConfigurationRedirectTo
ReadS [AwsS3BucketWebsiteConfigurationRedirectTo]
(Int -> ReadS AwsS3BucketWebsiteConfigurationRedirectTo)
-> ReadS [AwsS3BucketWebsiteConfigurationRedirectTo]
-> ReadPrec AwsS3BucketWebsiteConfigurationRedirectTo
-> ReadPrec [AwsS3BucketWebsiteConfigurationRedirectTo]
-> Read AwsS3BucketWebsiteConfigurationRedirectTo
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AwsS3BucketWebsiteConfigurationRedirectTo]
$creadListPrec :: ReadPrec [AwsS3BucketWebsiteConfigurationRedirectTo]
readPrec :: ReadPrec AwsS3BucketWebsiteConfigurationRedirectTo
$creadPrec :: ReadPrec AwsS3BucketWebsiteConfigurationRedirectTo
readList :: ReadS [AwsS3BucketWebsiteConfigurationRedirectTo]
$creadList :: ReadS [AwsS3BucketWebsiteConfigurationRedirectTo]
readsPrec :: Int -> ReadS AwsS3BucketWebsiteConfigurationRedirectTo
$creadsPrec :: Int -> ReadS AwsS3BucketWebsiteConfigurationRedirectTo
Prelude.Read, Int -> AwsS3BucketWebsiteConfigurationRedirectTo -> ShowS
[AwsS3BucketWebsiteConfigurationRedirectTo] -> ShowS
AwsS3BucketWebsiteConfigurationRedirectTo -> String
(Int -> AwsS3BucketWebsiteConfigurationRedirectTo -> ShowS)
-> (AwsS3BucketWebsiteConfigurationRedirectTo -> String)
-> ([AwsS3BucketWebsiteConfigurationRedirectTo] -> ShowS)
-> Show AwsS3BucketWebsiteConfigurationRedirectTo
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AwsS3BucketWebsiteConfigurationRedirectTo] -> ShowS
$cshowList :: [AwsS3BucketWebsiteConfigurationRedirectTo] -> ShowS
show :: AwsS3BucketWebsiteConfigurationRedirectTo -> String
$cshow :: AwsS3BucketWebsiteConfigurationRedirectTo -> String
showsPrec :: Int -> AwsS3BucketWebsiteConfigurationRedirectTo -> ShowS
$cshowsPrec :: Int -> AwsS3BucketWebsiteConfigurationRedirectTo -> ShowS
Prelude.Show, (forall x.
AwsS3BucketWebsiteConfigurationRedirectTo
-> Rep AwsS3BucketWebsiteConfigurationRedirectTo x)
-> (forall x.
Rep AwsS3BucketWebsiteConfigurationRedirectTo x
-> AwsS3BucketWebsiteConfigurationRedirectTo)
-> Generic AwsS3BucketWebsiteConfigurationRedirectTo
forall x.
Rep AwsS3BucketWebsiteConfigurationRedirectTo x
-> AwsS3BucketWebsiteConfigurationRedirectTo
forall x.
AwsS3BucketWebsiteConfigurationRedirectTo
-> Rep AwsS3BucketWebsiteConfigurationRedirectTo x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep AwsS3BucketWebsiteConfigurationRedirectTo x
-> AwsS3BucketWebsiteConfigurationRedirectTo
$cfrom :: forall x.
AwsS3BucketWebsiteConfigurationRedirectTo
-> Rep AwsS3BucketWebsiteConfigurationRedirectTo x
Prelude.Generic)
newAwsS3BucketWebsiteConfigurationRedirectTo ::
AwsS3BucketWebsiteConfigurationRedirectTo
newAwsS3BucketWebsiteConfigurationRedirectTo :: AwsS3BucketWebsiteConfigurationRedirectTo
newAwsS3BucketWebsiteConfigurationRedirectTo =
AwsS3BucketWebsiteConfigurationRedirectTo' :: Maybe Text
-> Maybe Text -> AwsS3BucketWebsiteConfigurationRedirectTo
AwsS3BucketWebsiteConfigurationRedirectTo'
{ $sel:hostname:AwsS3BucketWebsiteConfigurationRedirectTo' :: Maybe Text
hostname =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:protocol:AwsS3BucketWebsiteConfigurationRedirectTo' :: Maybe Text
protocol = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
awsS3BucketWebsiteConfigurationRedirectTo_hostname :: Lens.Lens' AwsS3BucketWebsiteConfigurationRedirectTo (Prelude.Maybe Prelude.Text)
awsS3BucketWebsiteConfigurationRedirectTo_hostname :: (Maybe Text -> f (Maybe Text))
-> AwsS3BucketWebsiteConfigurationRedirectTo
-> f AwsS3BucketWebsiteConfigurationRedirectTo
awsS3BucketWebsiteConfigurationRedirectTo_hostname = (AwsS3BucketWebsiteConfigurationRedirectTo -> Maybe Text)
-> (AwsS3BucketWebsiteConfigurationRedirectTo
-> Maybe Text -> AwsS3BucketWebsiteConfigurationRedirectTo)
-> Lens
AwsS3BucketWebsiteConfigurationRedirectTo
AwsS3BucketWebsiteConfigurationRedirectTo
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AwsS3BucketWebsiteConfigurationRedirectTo' {Maybe Text
hostname :: Maybe Text
$sel:hostname:AwsS3BucketWebsiteConfigurationRedirectTo' :: AwsS3BucketWebsiteConfigurationRedirectTo -> Maybe Text
hostname} -> Maybe Text
hostname) (\s :: AwsS3BucketWebsiteConfigurationRedirectTo
s@AwsS3BucketWebsiteConfigurationRedirectTo' {} Maybe Text
a -> AwsS3BucketWebsiteConfigurationRedirectTo
s {$sel:hostname:AwsS3BucketWebsiteConfigurationRedirectTo' :: Maybe Text
hostname = Maybe Text
a} :: AwsS3BucketWebsiteConfigurationRedirectTo)
awsS3BucketWebsiteConfigurationRedirectTo_protocol :: Lens.Lens' AwsS3BucketWebsiteConfigurationRedirectTo (Prelude.Maybe Prelude.Text)
awsS3BucketWebsiteConfigurationRedirectTo_protocol :: (Maybe Text -> f (Maybe Text))
-> AwsS3BucketWebsiteConfigurationRedirectTo
-> f AwsS3BucketWebsiteConfigurationRedirectTo
awsS3BucketWebsiteConfigurationRedirectTo_protocol = (AwsS3BucketWebsiteConfigurationRedirectTo -> Maybe Text)
-> (AwsS3BucketWebsiteConfigurationRedirectTo
-> Maybe Text -> AwsS3BucketWebsiteConfigurationRedirectTo)
-> Lens
AwsS3BucketWebsiteConfigurationRedirectTo
AwsS3BucketWebsiteConfigurationRedirectTo
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AwsS3BucketWebsiteConfigurationRedirectTo' {Maybe Text
protocol :: Maybe Text
$sel:protocol:AwsS3BucketWebsiteConfigurationRedirectTo' :: AwsS3BucketWebsiteConfigurationRedirectTo -> Maybe Text
protocol} -> Maybe Text
protocol) (\s :: AwsS3BucketWebsiteConfigurationRedirectTo
s@AwsS3BucketWebsiteConfigurationRedirectTo' {} Maybe Text
a -> AwsS3BucketWebsiteConfigurationRedirectTo
s {$sel:protocol:AwsS3BucketWebsiteConfigurationRedirectTo' :: Maybe Text
protocol = Maybe Text
a} :: AwsS3BucketWebsiteConfigurationRedirectTo)
instance
Core.FromJSON
AwsS3BucketWebsiteConfigurationRedirectTo
where
parseJSON :: Value -> Parser AwsS3BucketWebsiteConfigurationRedirectTo
parseJSON =
String
-> (Object -> Parser AwsS3BucketWebsiteConfigurationRedirectTo)
-> Value
-> Parser AwsS3BucketWebsiteConfigurationRedirectTo
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"AwsS3BucketWebsiteConfigurationRedirectTo"
( \Object
x ->
Maybe Text
-> Maybe Text -> AwsS3BucketWebsiteConfigurationRedirectTo
AwsS3BucketWebsiteConfigurationRedirectTo'
(Maybe Text
-> Maybe Text -> AwsS3BucketWebsiteConfigurationRedirectTo)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> AwsS3BucketWebsiteConfigurationRedirectTo)
forall (f :: * -> *) a b. Functor 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
"Hostname")
Parser (Maybe Text -> AwsS3BucketWebsiteConfigurationRedirectTo)
-> Parser (Maybe Text)
-> Parser AwsS3BucketWebsiteConfigurationRedirectTo
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
"Protocol")
)
instance
Prelude.Hashable
AwsS3BucketWebsiteConfigurationRedirectTo
instance
Prelude.NFData
AwsS3BucketWebsiteConfigurationRedirectTo
instance
Core.ToJSON
AwsS3BucketWebsiteConfigurationRedirectTo
where
toJSON :: AwsS3BucketWebsiteConfigurationRedirectTo -> Value
toJSON AwsS3BucketWebsiteConfigurationRedirectTo' {Maybe Text
protocol :: Maybe Text
hostname :: Maybe Text
$sel:protocol:AwsS3BucketWebsiteConfigurationRedirectTo' :: AwsS3BucketWebsiteConfigurationRedirectTo -> Maybe Text
$sel:hostname:AwsS3BucketWebsiteConfigurationRedirectTo' :: AwsS3BucketWebsiteConfigurationRedirectTo -> Maybe Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"Hostname" 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
hostname,
(Text
"Protocol" 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
protocol
]
)