module Aws.S3.Commands.DeleteBucket
where

import           Aws.Core
import           Aws.S3.Core
import           Data.ByteString.Char8      ({- IsString -})
import qualified Data.Text.Encoding         as T

data DeleteBucket = DeleteBucket { DeleteBucket -> Bucket
dbBucket :: Bucket }
    deriving (Int -> DeleteBucket -> ShowS
[DeleteBucket] -> ShowS
DeleteBucket -> String
(Int -> DeleteBucket -> ShowS)
-> (DeleteBucket -> String)
-> ([DeleteBucket] -> ShowS)
-> Show DeleteBucket
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteBucket] -> ShowS
$cshowList :: [DeleteBucket] -> ShowS
show :: DeleteBucket -> String
$cshow :: DeleteBucket -> String
showsPrec :: Int -> DeleteBucket -> ShowS
$cshowsPrec :: Int -> DeleteBucket -> ShowS
Show)

data DeleteBucketResponse = DeleteBucketResponse {}
    deriving (Int -> DeleteBucketResponse -> ShowS
[DeleteBucketResponse] -> ShowS
DeleteBucketResponse -> String
(Int -> DeleteBucketResponse -> ShowS)
-> (DeleteBucketResponse -> String)
-> ([DeleteBucketResponse] -> ShowS)
-> Show DeleteBucketResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteBucketResponse] -> ShowS
$cshowList :: [DeleteBucketResponse] -> ShowS
show :: DeleteBucketResponse -> String
$cshow :: DeleteBucketResponse -> String
showsPrec :: Int -> DeleteBucketResponse -> ShowS
$cshowsPrec :: Int -> DeleteBucketResponse -> ShowS
Show)

-- | ServiceConfiguration: 'S3Configuration'
instance SignQuery DeleteBucket where
    type ServiceConfiguration DeleteBucket = S3Configuration
    signQuery :: DeleteBucket
-> ServiceConfiguration DeleteBucket queryType
-> SignatureData
-> SignedQuery
signQuery DeleteBucket {Bucket
dbBucket :: Bucket
dbBucket :: DeleteBucket -> Bucket
..} = S3Query
-> S3Configuration queryType -> SignatureData -> SignedQuery
forall qt.
S3Query -> S3Configuration qt -> SignatureData -> SignedQuery
s3SignQuery S3Query :: Method
-> Maybe ByteString
-> Maybe ByteString
-> Query
-> Query
-> Maybe ByteString
-> Maybe (Digest MD5)
-> RequestHeaders
-> RequestHeaders
-> Maybe RequestBody
-> S3Query
S3Query {
                                 s3QMethod :: Method
s3QMethod = Method
Delete
                               , s3QBucket :: Maybe ByteString
s3QBucket = ByteString -> Maybe ByteString
forall a. a -> Maybe a
Just (ByteString -> Maybe ByteString) -> ByteString -> Maybe ByteString
forall a b. (a -> b) -> a -> b
$ Bucket -> ByteString
T.encodeUtf8 Bucket
dbBucket
                               , s3QSubresources :: Query
s3QSubresources = []
                               , s3QQuery :: Query
s3QQuery = []
                               , s3QContentType :: Maybe ByteString
s3QContentType = Maybe ByteString
forall a. Maybe a
Nothing
                               , s3QContentMd5 :: Maybe (Digest MD5)
s3QContentMd5 = Maybe (Digest MD5)
forall a. Maybe a
Nothing
                               , s3QAmzHeaders :: RequestHeaders
s3QAmzHeaders = []
                               , s3QOtherHeaders :: RequestHeaders
s3QOtherHeaders = []
                               , s3QRequestBody :: Maybe RequestBody
s3QRequestBody = Maybe RequestBody
forall a. Maybe a
Nothing
                               , s3QObject :: Maybe ByteString
s3QObject = Maybe ByteString
forall a. Maybe a
Nothing
                               }

instance ResponseConsumer DeleteBucket DeleteBucketResponse where
    type ResponseMetadata DeleteBucketResponse = S3Metadata
    responseConsumer :: Request
-> DeleteBucket
-> IORef (ResponseMetadata DeleteBucketResponse)
-> HTTPResponseConsumer DeleteBucketResponse
responseConsumer Request
_ DeleteBucket
_ = HTTPResponseConsumer DeleteBucketResponse
-> IORef S3Metadata -> HTTPResponseConsumer DeleteBucketResponse
forall a.
HTTPResponseConsumer a
-> IORef S3Metadata -> HTTPResponseConsumer a
s3ResponseConsumer (HTTPResponseConsumer DeleteBucketResponse
 -> IORef S3Metadata -> HTTPResponseConsumer DeleteBucketResponse)
-> HTTPResponseConsumer DeleteBucketResponse
-> IORef S3Metadata
-> HTTPResponseConsumer DeleteBucketResponse
forall a b. (a -> b) -> a -> b
$ \Response (ConduitM () ByteString (ResourceT IO) ())
_ -> DeleteBucketResponse -> ResourceT IO DeleteBucketResponse
forall (m :: * -> *) a. Monad m => a -> m a
return DeleteBucketResponse
DeleteBucketResponse

instance Transaction DeleteBucket DeleteBucketResponse

instance AsMemoryResponse DeleteBucketResponse where
    type MemoryResponse DeleteBucketResponse = DeleteBucketResponse
    loadToMemory :: DeleteBucketResponse
-> ResourceT IO (MemoryResponse DeleteBucketResponse)
loadToMemory = DeleteBucketResponse
-> ResourceT IO (MemoryResponse DeleteBucketResponse)
forall (m :: * -> *) a. Monad m => a -> m a
return