{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DerivingStrategies #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE UndecidableInstances #-}
module Network.DO.Spaces.Actions.DeleteBucketCORS
( DeleteBucketCORS(..)
, DeleteBucketCORSResponse
) where
import Control.Monad.Reader ( MonadReader(ask) )
import Data.ByteString ( ByteString )
import GHC.Generics ( Generic )
import Network.DO.Spaces.Types
import qualified Network.HTTP.Types as H
newtype DeleteBucketCORS = DeleteBucketCORS { DeleteBucketCORS -> Bucket
bucket :: Bucket }
deriving stock ( 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
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
Generic )
deriving newtype ( 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
Eq )
type DeleteBucketCORSResponse = ()
instance MonadSpaces m => Action m DeleteBucketCORS where
type ConsumedResponse DeleteBucketCORS = DeleteBucketCORSResponse
buildRequest :: DeleteBucketCORS -> m SpacesRequestBuilder
buildRequest DeleteBucketCORS { Bucket
bucket :: Bucket
$sel:bucket:DeleteBucketCORS :: DeleteBucketCORS -> Bucket
.. } = do
Spaces
spaces <- m Spaces
forall r (m :: * -> *). MonadReader r m => m r
ask
SpacesRequestBuilder -> m SpacesRequestBuilder
forall (f :: * -> *) a. Applicative f => a -> f a
pure SpacesRequestBuilder :: Spaces
-> Maybe RequestBody
-> Maybe Method
-> [Header]
-> Maybe Bucket
-> Maybe Object
-> Maybe Query
-> Maybe Query
-> Maybe Region
-> SpacesRequestBuilder
SpacesRequestBuilder
{ $sel:bucket:SpacesRequestBuilder :: Maybe Bucket
bucket = Bucket -> Maybe Bucket
forall a. a -> Maybe a
Just Bucket
bucket
, $sel:method:SpacesRequestBuilder :: Maybe Method
method = Method -> Maybe Method
forall a. a -> Maybe a
Just Method
DELETE
, $sel:body:SpacesRequestBuilder :: Maybe RequestBody
body = Maybe RequestBody
forall a. Maybe a
Nothing
, $sel:object:SpacesRequestBuilder :: Maybe Object
object = Maybe Object
forall a. Maybe a
Nothing
, $sel:overrideRegion:SpacesRequestBuilder :: Maybe Region
overrideRegion = Maybe Region
forall a. Maybe a
Nothing
, $sel:queryString:SpacesRequestBuilder :: Maybe Query
queryString = Maybe Query
forall a. Maybe a
Nothing
, $sel:headers:SpacesRequestBuilder :: [Header]
headers = [Header]
forall a. Monoid a => a
mempty
, $sel:subresources:SpacesRequestBuilder :: Maybe Query
subresources = Query -> Maybe Query
forall a. a -> Maybe a
Just
(Query -> Maybe Query) -> Query -> Maybe Query
forall a b. (a -> b) -> a -> b
$ Query -> Query
forall a. QueryLike a => a -> Query
H.toQuery [ ( ByteString
"cors" :: ByteString
, Maybe ByteString
forall a. Maybe a
Nothing :: Maybe ByteString
)
]
, Spaces
$sel:spaces:SpacesRequestBuilder :: Spaces
spaces :: Spaces
..
}
consumeResponse :: RawResponse m -> m (ConsumedResponse DeleteBucketCORS)
consumeResponse RawResponse m
_ = () -> m ()
forall (f :: * -> *) a. Applicative f => a -> f a
pure ()