{-# 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.DeleteObjectTagging
(
DeleteObjectTagging (..),
newDeleteObjectTagging,
deleteObjectTagging_versionId,
deleteObjectTagging_expectedBucketOwner,
deleteObjectTagging_bucket,
deleteObjectTagging_key,
DeleteObjectTaggingResponse (..),
newDeleteObjectTaggingResponse,
deleteObjectTaggingResponse_versionId,
deleteObjectTaggingResponse_httpStatus,
)
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 DeleteObjectTagging = DeleteObjectTagging'
{
DeleteObjectTagging -> Maybe ObjectVersionId
versionId :: Prelude.Maybe ObjectVersionId,
DeleteObjectTagging -> Maybe Text
expectedBucketOwner :: Prelude.Maybe Prelude.Text,
DeleteObjectTagging -> BucketName
bucket :: BucketName,
DeleteObjectTagging -> ObjectKey
key :: ObjectKey
}
deriving (DeleteObjectTagging -> DeleteObjectTagging -> Bool
(DeleteObjectTagging -> DeleteObjectTagging -> Bool)
-> (DeleteObjectTagging -> DeleteObjectTagging -> Bool)
-> Eq DeleteObjectTagging
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteObjectTagging -> DeleteObjectTagging -> Bool
$c/= :: DeleteObjectTagging -> DeleteObjectTagging -> Bool
== :: DeleteObjectTagging -> DeleteObjectTagging -> Bool
$c== :: DeleteObjectTagging -> DeleteObjectTagging -> Bool
Prelude.Eq, ReadPrec [DeleteObjectTagging]
ReadPrec DeleteObjectTagging
Int -> ReadS DeleteObjectTagging
ReadS [DeleteObjectTagging]
(Int -> ReadS DeleteObjectTagging)
-> ReadS [DeleteObjectTagging]
-> ReadPrec DeleteObjectTagging
-> ReadPrec [DeleteObjectTagging]
-> Read DeleteObjectTagging
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteObjectTagging]
$creadListPrec :: ReadPrec [DeleteObjectTagging]
readPrec :: ReadPrec DeleteObjectTagging
$creadPrec :: ReadPrec DeleteObjectTagging
readList :: ReadS [DeleteObjectTagging]
$creadList :: ReadS [DeleteObjectTagging]
readsPrec :: Int -> ReadS DeleteObjectTagging
$creadsPrec :: Int -> ReadS DeleteObjectTagging
Prelude.Read, Int -> DeleteObjectTagging -> ShowS
[DeleteObjectTagging] -> ShowS
DeleteObjectTagging -> String
(Int -> DeleteObjectTagging -> ShowS)
-> (DeleteObjectTagging -> String)
-> ([DeleteObjectTagging] -> ShowS)
-> Show DeleteObjectTagging
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteObjectTagging] -> ShowS
$cshowList :: [DeleteObjectTagging] -> ShowS
show :: DeleteObjectTagging -> String
$cshow :: DeleteObjectTagging -> String
showsPrec :: Int -> DeleteObjectTagging -> ShowS
$cshowsPrec :: Int -> DeleteObjectTagging -> ShowS
Prelude.Show, (forall x. DeleteObjectTagging -> Rep DeleteObjectTagging x)
-> (forall x. Rep DeleteObjectTagging x -> DeleteObjectTagging)
-> Generic DeleteObjectTagging
forall x. Rep DeleteObjectTagging x -> DeleteObjectTagging
forall x. DeleteObjectTagging -> Rep DeleteObjectTagging x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteObjectTagging x -> DeleteObjectTagging
$cfrom :: forall x. DeleteObjectTagging -> Rep DeleteObjectTagging x
Prelude.Generic)
newDeleteObjectTagging ::
BucketName ->
ObjectKey ->
DeleteObjectTagging
newDeleteObjectTagging :: BucketName -> ObjectKey -> DeleteObjectTagging
newDeleteObjectTagging BucketName
pBucket_ ObjectKey
pKey_ =
DeleteObjectTagging' :: Maybe ObjectVersionId
-> Maybe Text -> BucketName -> ObjectKey -> DeleteObjectTagging
DeleteObjectTagging'
{ $sel:versionId:DeleteObjectTagging' :: Maybe ObjectVersionId
versionId = Maybe ObjectVersionId
forall a. Maybe a
Prelude.Nothing,
$sel:expectedBucketOwner:DeleteObjectTagging' :: Maybe Text
expectedBucketOwner = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:bucket:DeleteObjectTagging' :: BucketName
bucket = BucketName
pBucket_,
$sel:key:DeleteObjectTagging' :: ObjectKey
key = ObjectKey
pKey_
}
deleteObjectTagging_versionId :: Lens.Lens' DeleteObjectTagging (Prelude.Maybe ObjectVersionId)
deleteObjectTagging_versionId :: (Maybe ObjectVersionId -> f (Maybe ObjectVersionId))
-> DeleteObjectTagging -> f DeleteObjectTagging
deleteObjectTagging_versionId = (DeleteObjectTagging -> Maybe ObjectVersionId)
-> (DeleteObjectTagging
-> Maybe ObjectVersionId -> DeleteObjectTagging)
-> Lens
DeleteObjectTagging
DeleteObjectTagging
(Maybe ObjectVersionId)
(Maybe ObjectVersionId)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteObjectTagging' {Maybe ObjectVersionId
versionId :: Maybe ObjectVersionId
$sel:versionId:DeleteObjectTagging' :: DeleteObjectTagging -> Maybe ObjectVersionId
versionId} -> Maybe ObjectVersionId
versionId) (\s :: DeleteObjectTagging
s@DeleteObjectTagging' {} Maybe ObjectVersionId
a -> DeleteObjectTagging
s {$sel:versionId:DeleteObjectTagging' :: Maybe ObjectVersionId
versionId = Maybe ObjectVersionId
a} :: DeleteObjectTagging)
deleteObjectTagging_expectedBucketOwner :: Lens.Lens' DeleteObjectTagging (Prelude.Maybe Prelude.Text)
deleteObjectTagging_expectedBucketOwner :: (Maybe Text -> f (Maybe Text))
-> DeleteObjectTagging -> f DeleteObjectTagging
deleteObjectTagging_expectedBucketOwner = (DeleteObjectTagging -> Maybe Text)
-> (DeleteObjectTagging -> Maybe Text -> DeleteObjectTagging)
-> Lens
DeleteObjectTagging DeleteObjectTagging (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteObjectTagging' {Maybe Text
expectedBucketOwner :: Maybe Text
$sel:expectedBucketOwner:DeleteObjectTagging' :: DeleteObjectTagging -> Maybe Text
expectedBucketOwner} -> Maybe Text
expectedBucketOwner) (\s :: DeleteObjectTagging
s@DeleteObjectTagging' {} Maybe Text
a -> DeleteObjectTagging
s {$sel:expectedBucketOwner:DeleteObjectTagging' :: Maybe Text
expectedBucketOwner = Maybe Text
a} :: DeleteObjectTagging)
deleteObjectTagging_bucket :: Lens.Lens' DeleteObjectTagging BucketName
deleteObjectTagging_bucket :: (BucketName -> f BucketName)
-> DeleteObjectTagging -> f DeleteObjectTagging
deleteObjectTagging_bucket = (DeleteObjectTagging -> BucketName)
-> (DeleteObjectTagging -> BucketName -> DeleteObjectTagging)
-> Lens
DeleteObjectTagging DeleteObjectTagging BucketName BucketName
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteObjectTagging' {BucketName
bucket :: BucketName
$sel:bucket:DeleteObjectTagging' :: DeleteObjectTagging -> BucketName
bucket} -> BucketName
bucket) (\s :: DeleteObjectTagging
s@DeleteObjectTagging' {} BucketName
a -> DeleteObjectTagging
s {$sel:bucket:DeleteObjectTagging' :: BucketName
bucket = BucketName
a} :: DeleteObjectTagging)
deleteObjectTagging_key :: Lens.Lens' DeleteObjectTagging ObjectKey
deleteObjectTagging_key :: (ObjectKey -> f ObjectKey)
-> DeleteObjectTagging -> f DeleteObjectTagging
deleteObjectTagging_key = (DeleteObjectTagging -> ObjectKey)
-> (DeleteObjectTagging -> ObjectKey -> DeleteObjectTagging)
-> Lens DeleteObjectTagging DeleteObjectTagging ObjectKey ObjectKey
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteObjectTagging' {ObjectKey
key :: ObjectKey
$sel:key:DeleteObjectTagging' :: DeleteObjectTagging -> ObjectKey
key} -> ObjectKey
key) (\s :: DeleteObjectTagging
s@DeleteObjectTagging' {} ObjectKey
a -> DeleteObjectTagging
s {$sel:key:DeleteObjectTagging' :: ObjectKey
key = ObjectKey
a} :: DeleteObjectTagging)
instance Core.AWSRequest DeleteObjectTagging where
type
AWSResponse DeleteObjectTagging =
DeleteObjectTaggingResponse
request :: DeleteObjectTagging -> Request DeleteObjectTagging
request =
Request DeleteObjectTagging -> Request DeleteObjectTagging
forall a. Request a -> Request a
Request.s3vhost
(Request DeleteObjectTagging -> Request DeleteObjectTagging)
-> (DeleteObjectTagging -> Request DeleteObjectTagging)
-> DeleteObjectTagging
-> Request DeleteObjectTagging
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. Service -> DeleteObjectTagging -> Request DeleteObjectTagging
forall a. ToRequest a => Service -> a -> Request a
Request.delete Service
defaultService
response :: Logger
-> Service
-> Proxy DeleteObjectTagging
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DeleteObjectTagging)))
response =
(Int
-> ResponseHeaders
-> ()
-> Either String (AWSResponse DeleteObjectTagging))
-> Logger
-> Service
-> Proxy DeleteObjectTagging
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DeleteObjectTagging)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> () -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveEmpty
( \Int
s ResponseHeaders
h ()
x ->
Maybe ObjectVersionId -> Int -> DeleteObjectTaggingResponse
DeleteObjectTaggingResponse'
(Maybe ObjectVersionId -> Int -> DeleteObjectTaggingResponse)
-> Either String (Maybe ObjectVersionId)
-> Either String (Int -> DeleteObjectTaggingResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (ResponseHeaders
h ResponseHeaders
-> HeaderName -> Either String (Maybe ObjectVersionId)
forall a.
FromText a =>
ResponseHeaders -> HeaderName -> Either String (Maybe a)
Core..#? HeaderName
"x-amz-version-id")
Either String (Int -> DeleteObjectTaggingResponse)
-> Either String Int -> Either String DeleteObjectTaggingResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Int -> Either String Int
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (Int -> Int
forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
)
instance Prelude.Hashable DeleteObjectTagging
instance Prelude.NFData DeleteObjectTagging
instance Core.ToHeaders DeleteObjectTagging where
toHeaders :: DeleteObjectTagging -> ResponseHeaders
toHeaders DeleteObjectTagging' {Maybe Text
Maybe ObjectVersionId
ObjectKey
BucketName
key :: ObjectKey
bucket :: BucketName
expectedBucketOwner :: Maybe Text
versionId :: Maybe ObjectVersionId
$sel:key:DeleteObjectTagging' :: DeleteObjectTagging -> ObjectKey
$sel:bucket:DeleteObjectTagging' :: DeleteObjectTagging -> BucketName
$sel:expectedBucketOwner:DeleteObjectTagging' :: DeleteObjectTagging -> Maybe Text
$sel:versionId:DeleteObjectTagging' :: DeleteObjectTagging -> Maybe ObjectVersionId
..} =
[ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"x-amz-expected-bucket-owner"
HeaderName -> Maybe Text -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# Maybe Text
expectedBucketOwner
]
instance Core.ToPath DeleteObjectTagging where
toPath :: DeleteObjectTagging -> ByteString
toPath DeleteObjectTagging' {Maybe Text
Maybe ObjectVersionId
ObjectKey
BucketName
key :: ObjectKey
bucket :: BucketName
expectedBucketOwner :: Maybe Text
versionId :: Maybe ObjectVersionId
$sel:key:DeleteObjectTagging' :: DeleteObjectTagging -> ObjectKey
$sel:bucket:DeleteObjectTagging' :: DeleteObjectTagging -> BucketName
$sel:expectedBucketOwner:DeleteObjectTagging' :: DeleteObjectTagging -> Maybe Text
$sel:versionId:DeleteObjectTagging' :: DeleteObjectTagging -> Maybe ObjectVersionId
..} =
[ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ByteString
"/", BucketName -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS BucketName
bucket, ByteString
"/", ObjectKey -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS ObjectKey
key]
instance Core.ToQuery DeleteObjectTagging where
toQuery :: DeleteObjectTagging -> QueryString
toQuery DeleteObjectTagging' {Maybe Text
Maybe ObjectVersionId
ObjectKey
BucketName
key :: ObjectKey
bucket :: BucketName
expectedBucketOwner :: Maybe Text
versionId :: Maybe ObjectVersionId
$sel:key:DeleteObjectTagging' :: DeleteObjectTagging -> ObjectKey
$sel:bucket:DeleteObjectTagging' :: DeleteObjectTagging -> BucketName
$sel:expectedBucketOwner:DeleteObjectTagging' :: DeleteObjectTagging -> Maybe Text
$sel:versionId:DeleteObjectTagging' :: DeleteObjectTagging -> Maybe ObjectVersionId
..} =
[QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ByteString
"versionId" ByteString -> Maybe ObjectVersionId -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe ObjectVersionId
versionId, QueryString
"tagging"]
data DeleteObjectTaggingResponse = DeleteObjectTaggingResponse'
{
DeleteObjectTaggingResponse -> Maybe ObjectVersionId
versionId :: Prelude.Maybe ObjectVersionId,
DeleteObjectTaggingResponse -> Int
httpStatus :: Prelude.Int
}
deriving (DeleteObjectTaggingResponse -> DeleteObjectTaggingResponse -> Bool
(DeleteObjectTaggingResponse
-> DeleteObjectTaggingResponse -> Bool)
-> (DeleteObjectTaggingResponse
-> DeleteObjectTaggingResponse -> Bool)
-> Eq DeleteObjectTaggingResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteObjectTaggingResponse -> DeleteObjectTaggingResponse -> Bool
$c/= :: DeleteObjectTaggingResponse -> DeleteObjectTaggingResponse -> Bool
== :: DeleteObjectTaggingResponse -> DeleteObjectTaggingResponse -> Bool
$c== :: DeleteObjectTaggingResponse -> DeleteObjectTaggingResponse -> Bool
Prelude.Eq, ReadPrec [DeleteObjectTaggingResponse]
ReadPrec DeleteObjectTaggingResponse
Int -> ReadS DeleteObjectTaggingResponse
ReadS [DeleteObjectTaggingResponse]
(Int -> ReadS DeleteObjectTaggingResponse)
-> ReadS [DeleteObjectTaggingResponse]
-> ReadPrec DeleteObjectTaggingResponse
-> ReadPrec [DeleteObjectTaggingResponse]
-> Read DeleteObjectTaggingResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteObjectTaggingResponse]
$creadListPrec :: ReadPrec [DeleteObjectTaggingResponse]
readPrec :: ReadPrec DeleteObjectTaggingResponse
$creadPrec :: ReadPrec DeleteObjectTaggingResponse
readList :: ReadS [DeleteObjectTaggingResponse]
$creadList :: ReadS [DeleteObjectTaggingResponse]
readsPrec :: Int -> ReadS DeleteObjectTaggingResponse
$creadsPrec :: Int -> ReadS DeleteObjectTaggingResponse
Prelude.Read, Int -> DeleteObjectTaggingResponse -> ShowS
[DeleteObjectTaggingResponse] -> ShowS
DeleteObjectTaggingResponse -> String
(Int -> DeleteObjectTaggingResponse -> ShowS)
-> (DeleteObjectTaggingResponse -> String)
-> ([DeleteObjectTaggingResponse] -> ShowS)
-> Show DeleteObjectTaggingResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteObjectTaggingResponse] -> ShowS
$cshowList :: [DeleteObjectTaggingResponse] -> ShowS
show :: DeleteObjectTaggingResponse -> String
$cshow :: DeleteObjectTaggingResponse -> String
showsPrec :: Int -> DeleteObjectTaggingResponse -> ShowS
$cshowsPrec :: Int -> DeleteObjectTaggingResponse -> ShowS
Prelude.Show, (forall x.
DeleteObjectTaggingResponse -> Rep DeleteObjectTaggingResponse x)
-> (forall x.
Rep DeleteObjectTaggingResponse x -> DeleteObjectTaggingResponse)
-> Generic DeleteObjectTaggingResponse
forall x.
Rep DeleteObjectTaggingResponse x -> DeleteObjectTaggingResponse
forall x.
DeleteObjectTaggingResponse -> Rep DeleteObjectTaggingResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DeleteObjectTaggingResponse x -> DeleteObjectTaggingResponse
$cfrom :: forall x.
DeleteObjectTaggingResponse -> Rep DeleteObjectTaggingResponse x
Prelude.Generic)
newDeleteObjectTaggingResponse ::
Prelude.Int ->
DeleteObjectTaggingResponse
newDeleteObjectTaggingResponse :: Int -> DeleteObjectTaggingResponse
newDeleteObjectTaggingResponse Int
pHttpStatus_ =
DeleteObjectTaggingResponse' :: Maybe ObjectVersionId -> Int -> DeleteObjectTaggingResponse
DeleteObjectTaggingResponse'
{ $sel:versionId:DeleteObjectTaggingResponse' :: Maybe ObjectVersionId
versionId =
Maybe ObjectVersionId
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:DeleteObjectTaggingResponse' :: Int
httpStatus = Int
pHttpStatus_
}
deleteObjectTaggingResponse_versionId :: Lens.Lens' DeleteObjectTaggingResponse (Prelude.Maybe ObjectVersionId)
deleteObjectTaggingResponse_versionId :: (Maybe ObjectVersionId -> f (Maybe ObjectVersionId))
-> DeleteObjectTaggingResponse -> f DeleteObjectTaggingResponse
deleteObjectTaggingResponse_versionId = (DeleteObjectTaggingResponse -> Maybe ObjectVersionId)
-> (DeleteObjectTaggingResponse
-> Maybe ObjectVersionId -> DeleteObjectTaggingResponse)
-> Lens
DeleteObjectTaggingResponse
DeleteObjectTaggingResponse
(Maybe ObjectVersionId)
(Maybe ObjectVersionId)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteObjectTaggingResponse' {Maybe ObjectVersionId
versionId :: Maybe ObjectVersionId
$sel:versionId:DeleteObjectTaggingResponse' :: DeleteObjectTaggingResponse -> Maybe ObjectVersionId
versionId} -> Maybe ObjectVersionId
versionId) (\s :: DeleteObjectTaggingResponse
s@DeleteObjectTaggingResponse' {} Maybe ObjectVersionId
a -> DeleteObjectTaggingResponse
s {$sel:versionId:DeleteObjectTaggingResponse' :: Maybe ObjectVersionId
versionId = Maybe ObjectVersionId
a} :: DeleteObjectTaggingResponse)
deleteObjectTaggingResponse_httpStatus :: Lens.Lens' DeleteObjectTaggingResponse Prelude.Int
deleteObjectTaggingResponse_httpStatus :: (Int -> f Int)
-> DeleteObjectTaggingResponse -> f DeleteObjectTaggingResponse
deleteObjectTaggingResponse_httpStatus = (DeleteObjectTaggingResponse -> Int)
-> (DeleteObjectTaggingResponse
-> Int -> DeleteObjectTaggingResponse)
-> Lens
DeleteObjectTaggingResponse DeleteObjectTaggingResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteObjectTaggingResponse' {Int
httpStatus :: Int
$sel:httpStatus:DeleteObjectTaggingResponse' :: DeleteObjectTaggingResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DeleteObjectTaggingResponse
s@DeleteObjectTaggingResponse' {} Int
a -> DeleteObjectTaggingResponse
s {$sel:httpStatus:DeleteObjectTaggingResponse' :: Int
httpStatus = Int
a} :: DeleteObjectTaggingResponse)
instance Prelude.NFData DeleteObjectTaggingResponse