{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}
module Amazonka.S3.PutBucketWebsite
(
PutBucketWebsite (..),
newPutBucketWebsite,
putBucketWebsite_contentMD5,
putBucketWebsite_expectedBucketOwner,
putBucketWebsite_bucket,
putBucketWebsite_websiteConfiguration,
PutBucketWebsiteResponse (..),
newPutBucketWebsiteResponse,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
import Amazonka.S3.Types
data PutBucketWebsite = PutBucketWebsite'
{
PutBucketWebsite -> Maybe Text
contentMD5 :: Prelude.Maybe Prelude.Text,
PutBucketWebsite -> Maybe Text
expectedBucketOwner :: Prelude.Maybe Prelude.Text,
PutBucketWebsite -> BucketName
bucket :: BucketName,
PutBucketWebsite -> WebsiteConfiguration
websiteConfiguration :: WebsiteConfiguration
}
deriving (PutBucketWebsite -> PutBucketWebsite -> Bool
(PutBucketWebsite -> PutBucketWebsite -> Bool)
-> (PutBucketWebsite -> PutBucketWebsite -> Bool)
-> Eq PutBucketWebsite
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PutBucketWebsite -> PutBucketWebsite -> Bool
$c/= :: PutBucketWebsite -> PutBucketWebsite -> Bool
== :: PutBucketWebsite -> PutBucketWebsite -> Bool
$c== :: PutBucketWebsite -> PutBucketWebsite -> Bool
Prelude.Eq, ReadPrec [PutBucketWebsite]
ReadPrec PutBucketWebsite
Int -> ReadS PutBucketWebsite
ReadS [PutBucketWebsite]
(Int -> ReadS PutBucketWebsite)
-> ReadS [PutBucketWebsite]
-> ReadPrec PutBucketWebsite
-> ReadPrec [PutBucketWebsite]
-> Read PutBucketWebsite
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PutBucketWebsite]
$creadListPrec :: ReadPrec [PutBucketWebsite]
readPrec :: ReadPrec PutBucketWebsite
$creadPrec :: ReadPrec PutBucketWebsite
readList :: ReadS [PutBucketWebsite]
$creadList :: ReadS [PutBucketWebsite]
readsPrec :: Int -> ReadS PutBucketWebsite
$creadsPrec :: Int -> ReadS PutBucketWebsite
Prelude.Read, Int -> PutBucketWebsite -> ShowS
[PutBucketWebsite] -> ShowS
PutBucketWebsite -> String
(Int -> PutBucketWebsite -> ShowS)
-> (PutBucketWebsite -> String)
-> ([PutBucketWebsite] -> ShowS)
-> Show PutBucketWebsite
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PutBucketWebsite] -> ShowS
$cshowList :: [PutBucketWebsite] -> ShowS
show :: PutBucketWebsite -> String
$cshow :: PutBucketWebsite -> String
showsPrec :: Int -> PutBucketWebsite -> ShowS
$cshowsPrec :: Int -> PutBucketWebsite -> ShowS
Prelude.Show, (forall x. PutBucketWebsite -> Rep PutBucketWebsite x)
-> (forall x. Rep PutBucketWebsite x -> PutBucketWebsite)
-> Generic PutBucketWebsite
forall x. Rep PutBucketWebsite x -> PutBucketWebsite
forall x. PutBucketWebsite -> Rep PutBucketWebsite x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep PutBucketWebsite x -> PutBucketWebsite
$cfrom :: forall x. PutBucketWebsite -> Rep PutBucketWebsite x
Prelude.Generic)
newPutBucketWebsite ::
BucketName ->
WebsiteConfiguration ->
PutBucketWebsite
newPutBucketWebsite :: BucketName -> WebsiteConfiguration -> PutBucketWebsite
newPutBucketWebsite BucketName
pBucket_ WebsiteConfiguration
pWebsiteConfiguration_ =
PutBucketWebsite' :: Maybe Text
-> Maybe Text
-> BucketName
-> WebsiteConfiguration
-> PutBucketWebsite
PutBucketWebsite'
{ $sel:contentMD5:PutBucketWebsite' :: Maybe Text
contentMD5 = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:expectedBucketOwner:PutBucketWebsite' :: Maybe Text
expectedBucketOwner = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:bucket:PutBucketWebsite' :: BucketName
bucket = BucketName
pBucket_,
$sel:websiteConfiguration:PutBucketWebsite' :: WebsiteConfiguration
websiteConfiguration = WebsiteConfiguration
pWebsiteConfiguration_
}
putBucketWebsite_contentMD5 :: Lens.Lens' PutBucketWebsite (Prelude.Maybe Prelude.Text)
putBucketWebsite_contentMD5 :: (Maybe Text -> f (Maybe Text))
-> PutBucketWebsite -> f PutBucketWebsite
putBucketWebsite_contentMD5 = (PutBucketWebsite -> Maybe Text)
-> (PutBucketWebsite -> Maybe Text -> PutBucketWebsite)
-> Lens PutBucketWebsite PutBucketWebsite (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutBucketWebsite' {Maybe Text
contentMD5 :: Maybe Text
$sel:contentMD5:PutBucketWebsite' :: PutBucketWebsite -> Maybe Text
contentMD5} -> Maybe Text
contentMD5) (\s :: PutBucketWebsite
s@PutBucketWebsite' {} Maybe Text
a -> PutBucketWebsite
s {$sel:contentMD5:PutBucketWebsite' :: Maybe Text
contentMD5 = Maybe Text
a} :: PutBucketWebsite)
putBucketWebsite_expectedBucketOwner :: Lens.Lens' PutBucketWebsite (Prelude.Maybe Prelude.Text)
putBucketWebsite_expectedBucketOwner :: (Maybe Text -> f (Maybe Text))
-> PutBucketWebsite -> f PutBucketWebsite
putBucketWebsite_expectedBucketOwner = (PutBucketWebsite -> Maybe Text)
-> (PutBucketWebsite -> Maybe Text -> PutBucketWebsite)
-> Lens PutBucketWebsite PutBucketWebsite (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutBucketWebsite' {Maybe Text
expectedBucketOwner :: Maybe Text
$sel:expectedBucketOwner:PutBucketWebsite' :: PutBucketWebsite -> Maybe Text
expectedBucketOwner} -> Maybe Text
expectedBucketOwner) (\s :: PutBucketWebsite
s@PutBucketWebsite' {} Maybe Text
a -> PutBucketWebsite
s {$sel:expectedBucketOwner:PutBucketWebsite' :: Maybe Text
expectedBucketOwner = Maybe Text
a} :: PutBucketWebsite)
putBucketWebsite_bucket :: Lens.Lens' PutBucketWebsite BucketName
putBucketWebsite_bucket :: (BucketName -> f BucketName)
-> PutBucketWebsite -> f PutBucketWebsite
putBucketWebsite_bucket = (PutBucketWebsite -> BucketName)
-> (PutBucketWebsite -> BucketName -> PutBucketWebsite)
-> Lens PutBucketWebsite PutBucketWebsite BucketName BucketName
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutBucketWebsite' {BucketName
bucket :: BucketName
$sel:bucket:PutBucketWebsite' :: PutBucketWebsite -> BucketName
bucket} -> BucketName
bucket) (\s :: PutBucketWebsite
s@PutBucketWebsite' {} BucketName
a -> PutBucketWebsite
s {$sel:bucket:PutBucketWebsite' :: BucketName
bucket = BucketName
a} :: PutBucketWebsite)
putBucketWebsite_websiteConfiguration :: Lens.Lens' PutBucketWebsite WebsiteConfiguration
putBucketWebsite_websiteConfiguration :: (WebsiteConfiguration -> f WebsiteConfiguration)
-> PutBucketWebsite -> f PutBucketWebsite
putBucketWebsite_websiteConfiguration = (PutBucketWebsite -> WebsiteConfiguration)
-> (PutBucketWebsite -> WebsiteConfiguration -> PutBucketWebsite)
-> Lens
PutBucketWebsite
PutBucketWebsite
WebsiteConfiguration
WebsiteConfiguration
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutBucketWebsite' {WebsiteConfiguration
websiteConfiguration :: WebsiteConfiguration
$sel:websiteConfiguration:PutBucketWebsite' :: PutBucketWebsite -> WebsiteConfiguration
websiteConfiguration} -> WebsiteConfiguration
websiteConfiguration) (\s :: PutBucketWebsite
s@PutBucketWebsite' {} WebsiteConfiguration
a -> PutBucketWebsite
s {$sel:websiteConfiguration:PutBucketWebsite' :: WebsiteConfiguration
websiteConfiguration = WebsiteConfiguration
a} :: PutBucketWebsite)
instance Core.AWSRequest PutBucketWebsite where
type
AWSResponse PutBucketWebsite =
PutBucketWebsiteResponse
request :: PutBucketWebsite -> Request PutBucketWebsite
request =
Request PutBucketWebsite -> Request PutBucketWebsite
forall a. Request a -> Request a
Request.s3vhost
(Request PutBucketWebsite -> Request PutBucketWebsite)
-> (PutBucketWebsite -> Request PutBucketWebsite)
-> PutBucketWebsite
-> Request PutBucketWebsite
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. Service -> PutBucketWebsite -> Request PutBucketWebsite
forall a. (ToRequest a, ToElement a) => Service -> a -> Request a
Request.putXML Service
defaultService
response :: Logger
-> Service
-> Proxy PutBucketWebsite
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse PutBucketWebsite)))
response =
AWSResponse PutBucketWebsite
-> Logger
-> Service
-> Proxy PutBucketWebsite
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse PutBucketWebsite)))
forall (m :: * -> *) a.
MonadResource m =>
AWSResponse a
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveNull AWSResponse PutBucketWebsite
PutBucketWebsiteResponse
PutBucketWebsiteResponse'
instance Prelude.Hashable PutBucketWebsite
instance Prelude.NFData PutBucketWebsite
instance Core.ToElement PutBucketWebsite where
toElement :: PutBucketWebsite -> Element
toElement PutBucketWebsite' {Maybe Text
BucketName
WebsiteConfiguration
websiteConfiguration :: WebsiteConfiguration
bucket :: BucketName
expectedBucketOwner :: Maybe Text
contentMD5 :: Maybe Text
$sel:websiteConfiguration:PutBucketWebsite' :: PutBucketWebsite -> WebsiteConfiguration
$sel:bucket:PutBucketWebsite' :: PutBucketWebsite -> BucketName
$sel:expectedBucketOwner:PutBucketWebsite' :: PutBucketWebsite -> Maybe Text
$sel:contentMD5:PutBucketWebsite' :: PutBucketWebsite -> Maybe Text
..} =
Name -> WebsiteConfiguration -> Element
forall a. ToXML a => Name -> a -> Element
Core.mkElement
Name
"{http://s3.amazonaws.com/doc/2006-03-01/}WebsiteConfiguration"
WebsiteConfiguration
websiteConfiguration
instance Core.ToHeaders PutBucketWebsite where
toHeaders :: PutBucketWebsite -> [Header]
toHeaders PutBucketWebsite' {Maybe Text
BucketName
WebsiteConfiguration
websiteConfiguration :: WebsiteConfiguration
bucket :: BucketName
expectedBucketOwner :: Maybe Text
contentMD5 :: Maybe Text
$sel:websiteConfiguration:PutBucketWebsite' :: PutBucketWebsite -> WebsiteConfiguration
$sel:bucket:PutBucketWebsite' :: PutBucketWebsite -> BucketName
$sel:expectedBucketOwner:PutBucketWebsite' :: PutBucketWebsite -> Maybe Text
$sel:contentMD5:PutBucketWebsite' :: PutBucketWebsite -> Maybe Text
..} =
[[Header]] -> [Header]
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"Content-MD5" HeaderName -> Maybe Text -> [Header]
forall a. ToHeader a => HeaderName -> a -> [Header]
Core.=# Maybe Text
contentMD5,
HeaderName
"x-amz-expected-bucket-owner"
HeaderName -> Maybe Text -> [Header]
forall a. ToHeader a => HeaderName -> a -> [Header]
Core.=# Maybe Text
expectedBucketOwner
]
instance Core.ToPath PutBucketWebsite where
toPath :: PutBucketWebsite -> ByteString
toPath PutBucketWebsite' {Maybe Text
BucketName
WebsiteConfiguration
websiteConfiguration :: WebsiteConfiguration
bucket :: BucketName
expectedBucketOwner :: Maybe Text
contentMD5 :: Maybe Text
$sel:websiteConfiguration:PutBucketWebsite' :: PutBucketWebsite -> WebsiteConfiguration
$sel:bucket:PutBucketWebsite' :: PutBucketWebsite -> BucketName
$sel:expectedBucketOwner:PutBucketWebsite' :: PutBucketWebsite -> Maybe Text
$sel:contentMD5:PutBucketWebsite' :: PutBucketWebsite -> Maybe Text
..} =
[ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat [ByteString
"/", BucketName -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS BucketName
bucket]
instance Core.ToQuery PutBucketWebsite where
toQuery :: PutBucketWebsite -> QueryString
toQuery = QueryString -> PutBucketWebsite -> QueryString
forall a b. a -> b -> a
Prelude.const ([QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat [QueryString
"website"])
data PutBucketWebsiteResponse = PutBucketWebsiteResponse'
{
}
deriving (PutBucketWebsiteResponse -> PutBucketWebsiteResponse -> Bool
(PutBucketWebsiteResponse -> PutBucketWebsiteResponse -> Bool)
-> (PutBucketWebsiteResponse -> PutBucketWebsiteResponse -> Bool)
-> Eq PutBucketWebsiteResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PutBucketWebsiteResponse -> PutBucketWebsiteResponse -> Bool
$c/= :: PutBucketWebsiteResponse -> PutBucketWebsiteResponse -> Bool
== :: PutBucketWebsiteResponse -> PutBucketWebsiteResponse -> Bool
$c== :: PutBucketWebsiteResponse -> PutBucketWebsiteResponse -> Bool
Prelude.Eq, ReadPrec [PutBucketWebsiteResponse]
ReadPrec PutBucketWebsiteResponse
Int -> ReadS PutBucketWebsiteResponse
ReadS [PutBucketWebsiteResponse]
(Int -> ReadS PutBucketWebsiteResponse)
-> ReadS [PutBucketWebsiteResponse]
-> ReadPrec PutBucketWebsiteResponse
-> ReadPrec [PutBucketWebsiteResponse]
-> Read PutBucketWebsiteResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PutBucketWebsiteResponse]
$creadListPrec :: ReadPrec [PutBucketWebsiteResponse]
readPrec :: ReadPrec PutBucketWebsiteResponse
$creadPrec :: ReadPrec PutBucketWebsiteResponse
readList :: ReadS [PutBucketWebsiteResponse]
$creadList :: ReadS [PutBucketWebsiteResponse]
readsPrec :: Int -> ReadS PutBucketWebsiteResponse
$creadsPrec :: Int -> ReadS PutBucketWebsiteResponse
Prelude.Read, Int -> PutBucketWebsiteResponse -> ShowS
[PutBucketWebsiteResponse] -> ShowS
PutBucketWebsiteResponse -> String
(Int -> PutBucketWebsiteResponse -> ShowS)
-> (PutBucketWebsiteResponse -> String)
-> ([PutBucketWebsiteResponse] -> ShowS)
-> Show PutBucketWebsiteResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PutBucketWebsiteResponse] -> ShowS
$cshowList :: [PutBucketWebsiteResponse] -> ShowS
show :: PutBucketWebsiteResponse -> String
$cshow :: PutBucketWebsiteResponse -> String
showsPrec :: Int -> PutBucketWebsiteResponse -> ShowS
$cshowsPrec :: Int -> PutBucketWebsiteResponse -> ShowS
Prelude.Show, (forall x.
PutBucketWebsiteResponse -> Rep PutBucketWebsiteResponse x)
-> (forall x.
Rep PutBucketWebsiteResponse x -> PutBucketWebsiteResponse)
-> Generic PutBucketWebsiteResponse
forall x.
Rep PutBucketWebsiteResponse x -> PutBucketWebsiteResponse
forall x.
PutBucketWebsiteResponse -> Rep PutBucketWebsiteResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep PutBucketWebsiteResponse x -> PutBucketWebsiteResponse
$cfrom :: forall x.
PutBucketWebsiteResponse -> Rep PutBucketWebsiteResponse x
Prelude.Generic)
newPutBucketWebsiteResponse ::
PutBucketWebsiteResponse
newPutBucketWebsiteResponse :: PutBucketWebsiteResponse
newPutBucketWebsiteResponse =
PutBucketWebsiteResponse
PutBucketWebsiteResponse'
instance Prelude.NFData PutBucketWebsiteResponse