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