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