{-# 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.DeleteBucketCors
(
DeleteBucketCors (..),
newDeleteBucketCors,
deleteBucketCors_expectedBucketOwner,
deleteBucketCors_bucket,
DeleteBucketCorsResponse (..),
newDeleteBucketCorsResponse,
)
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 DeleteBucketCors = DeleteBucketCors'
{
DeleteBucketCors -> Maybe Text
expectedBucketOwner :: Prelude.Maybe Prelude.Text,
DeleteBucketCors -> BucketName
bucket :: BucketName
}
deriving (DeleteBucketCors -> DeleteBucketCors -> Bool
(DeleteBucketCors -> DeleteBucketCors -> Bool)
-> (DeleteBucketCors -> DeleteBucketCors -> Bool)
-> Eq DeleteBucketCors
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteBucketCors -> DeleteBucketCors -> Bool
$c/= :: DeleteBucketCors -> DeleteBucketCors -> Bool
== :: DeleteBucketCors -> DeleteBucketCors -> Bool
$c== :: DeleteBucketCors -> DeleteBucketCors -> Bool
Prelude.Eq, ReadPrec [DeleteBucketCors]
ReadPrec DeleteBucketCors
Int -> ReadS DeleteBucketCors
ReadS [DeleteBucketCors]
(Int -> ReadS DeleteBucketCors)
-> ReadS [DeleteBucketCors]
-> ReadPrec DeleteBucketCors
-> ReadPrec [DeleteBucketCors]
-> Read DeleteBucketCors
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteBucketCors]
$creadListPrec :: ReadPrec [DeleteBucketCors]
readPrec :: ReadPrec DeleteBucketCors
$creadPrec :: ReadPrec DeleteBucketCors
readList :: ReadS [DeleteBucketCors]
$creadList :: ReadS [DeleteBucketCors]
readsPrec :: Int -> ReadS DeleteBucketCors
$creadsPrec :: Int -> ReadS DeleteBucketCors
Prelude.Read, Int -> DeleteBucketCors -> ShowS
[DeleteBucketCors] -> ShowS
DeleteBucketCors -> String
(Int -> DeleteBucketCors -> ShowS)
-> (DeleteBucketCors -> String)
-> ([DeleteBucketCors] -> ShowS)
-> Show DeleteBucketCors
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteBucketCors] -> ShowS
$cshowList :: [DeleteBucketCors] -> ShowS
show :: DeleteBucketCors -> String
$cshow :: DeleteBucketCors -> String
showsPrec :: Int -> DeleteBucketCors -> ShowS
$cshowsPrec :: Int -> DeleteBucketCors -> ShowS
Prelude.Show, (forall x. DeleteBucketCors -> Rep DeleteBucketCors x)
-> (forall x. Rep DeleteBucketCors x -> DeleteBucketCors)
-> Generic DeleteBucketCors
forall x. Rep DeleteBucketCors x -> DeleteBucketCors
forall x. DeleteBucketCors -> Rep DeleteBucketCors x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteBucketCors x -> DeleteBucketCors
$cfrom :: forall x. DeleteBucketCors -> Rep DeleteBucketCors x
Prelude.Generic)
newDeleteBucketCors ::
BucketName ->
DeleteBucketCors
newDeleteBucketCors :: BucketName -> DeleteBucketCors
newDeleteBucketCors BucketName
pBucket_ =
DeleteBucketCors' :: Maybe Text -> BucketName -> DeleteBucketCors
DeleteBucketCors'
{ $sel:expectedBucketOwner:DeleteBucketCors' :: Maybe Text
expectedBucketOwner =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:bucket:DeleteBucketCors' :: BucketName
bucket = BucketName
pBucket_
}
deleteBucketCors_expectedBucketOwner :: Lens.Lens' DeleteBucketCors (Prelude.Maybe Prelude.Text)
deleteBucketCors_expectedBucketOwner :: (Maybe Text -> f (Maybe Text))
-> DeleteBucketCors -> f DeleteBucketCors
deleteBucketCors_expectedBucketOwner = (DeleteBucketCors -> Maybe Text)
-> (DeleteBucketCors -> Maybe Text -> DeleteBucketCors)
-> Lens DeleteBucketCors DeleteBucketCors (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteBucketCors' {Maybe Text
expectedBucketOwner :: Maybe Text
$sel:expectedBucketOwner:DeleteBucketCors' :: DeleteBucketCors -> Maybe Text
expectedBucketOwner} -> Maybe Text
expectedBucketOwner) (\s :: DeleteBucketCors
s@DeleteBucketCors' {} Maybe Text
a -> DeleteBucketCors
s {$sel:expectedBucketOwner:DeleteBucketCors' :: Maybe Text
expectedBucketOwner = Maybe Text
a} :: DeleteBucketCors)
deleteBucketCors_bucket :: Lens.Lens' DeleteBucketCors BucketName
deleteBucketCors_bucket :: (BucketName -> f BucketName)
-> DeleteBucketCors -> f DeleteBucketCors
deleteBucketCors_bucket = (DeleteBucketCors -> BucketName)
-> (DeleteBucketCors -> BucketName -> DeleteBucketCors)
-> Lens DeleteBucketCors DeleteBucketCors BucketName BucketName
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteBucketCors' {BucketName
bucket :: BucketName
$sel:bucket:DeleteBucketCors' :: DeleteBucketCors -> BucketName
bucket} -> BucketName
bucket) (\s :: DeleteBucketCors
s@DeleteBucketCors' {} BucketName
a -> DeleteBucketCors
s {$sel:bucket:DeleteBucketCors' :: BucketName
bucket = BucketName
a} :: DeleteBucketCors)
instance Core.AWSRequest DeleteBucketCors where
type
AWSResponse DeleteBucketCors =
DeleteBucketCorsResponse
request :: DeleteBucketCors -> Request DeleteBucketCors
request =
Request DeleteBucketCors -> Request DeleteBucketCors
forall a. Request a -> Request a
Request.s3vhost
(Request DeleteBucketCors -> Request DeleteBucketCors)
-> (DeleteBucketCors -> Request DeleteBucketCors)
-> DeleteBucketCors
-> Request DeleteBucketCors
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. Service -> DeleteBucketCors -> Request DeleteBucketCors
forall a. ToRequest a => Service -> a -> Request a
Request.delete Service
defaultService
response :: Logger
-> Service
-> Proxy DeleteBucketCors
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DeleteBucketCors)))
response =
AWSResponse DeleteBucketCors
-> Logger
-> Service
-> Proxy DeleteBucketCors
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DeleteBucketCors)))
forall (m :: * -> *) a.
MonadResource m =>
AWSResponse a
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveNull AWSResponse DeleteBucketCors
DeleteBucketCorsResponse
DeleteBucketCorsResponse'
instance Prelude.Hashable DeleteBucketCors
instance Prelude.NFData DeleteBucketCors
instance Core.ToHeaders DeleteBucketCors where
toHeaders :: DeleteBucketCors -> [Header]
toHeaders DeleteBucketCors' {Maybe Text
BucketName
bucket :: BucketName
expectedBucketOwner :: Maybe Text
$sel:bucket:DeleteBucketCors' :: DeleteBucketCors -> BucketName
$sel:expectedBucketOwner:DeleteBucketCors' :: DeleteBucketCors -> Maybe Text
..} =
[[Header]] -> [Header]
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"x-amz-expected-bucket-owner"
HeaderName -> Maybe Text -> [Header]
forall a. ToHeader a => HeaderName -> a -> [Header]
Core.=# Maybe Text
expectedBucketOwner
]
instance Core.ToPath DeleteBucketCors where
toPath :: DeleteBucketCors -> ByteString
toPath DeleteBucketCors' {Maybe Text
BucketName
bucket :: BucketName
expectedBucketOwner :: Maybe Text
$sel:bucket:DeleteBucketCors' :: DeleteBucketCors -> BucketName
$sel:expectedBucketOwner:DeleteBucketCors' :: DeleteBucketCors -> 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 DeleteBucketCors where
toQuery :: DeleteBucketCors -> QueryString
toQuery = QueryString -> DeleteBucketCors -> QueryString
forall a b. a -> b -> a
Prelude.const ([QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat [QueryString
"cors"])
data DeleteBucketCorsResponse = DeleteBucketCorsResponse'
{
}
deriving (DeleteBucketCorsResponse -> DeleteBucketCorsResponse -> Bool
(DeleteBucketCorsResponse -> DeleteBucketCorsResponse -> Bool)
-> (DeleteBucketCorsResponse -> DeleteBucketCorsResponse -> Bool)
-> Eq DeleteBucketCorsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteBucketCorsResponse -> DeleteBucketCorsResponse -> Bool
$c/= :: DeleteBucketCorsResponse -> DeleteBucketCorsResponse -> Bool
== :: DeleteBucketCorsResponse -> DeleteBucketCorsResponse -> Bool
$c== :: DeleteBucketCorsResponse -> DeleteBucketCorsResponse -> Bool
Prelude.Eq, ReadPrec [DeleteBucketCorsResponse]
ReadPrec DeleteBucketCorsResponse
Int -> ReadS DeleteBucketCorsResponse
ReadS [DeleteBucketCorsResponse]
(Int -> ReadS DeleteBucketCorsResponse)
-> ReadS [DeleteBucketCorsResponse]
-> ReadPrec DeleteBucketCorsResponse
-> ReadPrec [DeleteBucketCorsResponse]
-> Read DeleteBucketCorsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteBucketCorsResponse]
$creadListPrec :: ReadPrec [DeleteBucketCorsResponse]
readPrec :: ReadPrec DeleteBucketCorsResponse
$creadPrec :: ReadPrec DeleteBucketCorsResponse
readList :: ReadS [DeleteBucketCorsResponse]
$creadList :: ReadS [DeleteBucketCorsResponse]
readsPrec :: Int -> ReadS DeleteBucketCorsResponse
$creadsPrec :: Int -> ReadS DeleteBucketCorsResponse
Prelude.Read, Int -> DeleteBucketCorsResponse -> ShowS
[DeleteBucketCorsResponse] -> ShowS
DeleteBucketCorsResponse -> String
(Int -> DeleteBucketCorsResponse -> ShowS)
-> (DeleteBucketCorsResponse -> String)
-> ([DeleteBucketCorsResponse] -> ShowS)
-> Show DeleteBucketCorsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteBucketCorsResponse] -> ShowS
$cshowList :: [DeleteBucketCorsResponse] -> ShowS
show :: DeleteBucketCorsResponse -> String
$cshow :: DeleteBucketCorsResponse -> String
showsPrec :: Int -> DeleteBucketCorsResponse -> ShowS
$cshowsPrec :: Int -> DeleteBucketCorsResponse -> ShowS
Prelude.Show, (forall x.
DeleteBucketCorsResponse -> Rep DeleteBucketCorsResponse x)
-> (forall x.
Rep DeleteBucketCorsResponse x -> DeleteBucketCorsResponse)
-> Generic DeleteBucketCorsResponse
forall x.
Rep DeleteBucketCorsResponse x -> DeleteBucketCorsResponse
forall x.
DeleteBucketCorsResponse -> Rep DeleteBucketCorsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DeleteBucketCorsResponse x -> DeleteBucketCorsResponse
$cfrom :: forall x.
DeleteBucketCorsResponse -> Rep DeleteBucketCorsResponse x
Prelude.Generic)
newDeleteBucketCorsResponse ::
DeleteBucketCorsResponse
newDeleteBucketCorsResponse :: DeleteBucketCorsResponse
newDeleteBucketCorsResponse =
DeleteBucketCorsResponse
DeleteBucketCorsResponse'
instance Prelude.NFData DeleteBucketCorsResponse