{-# 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.PutBucketTagging
(
PutBucketTagging (..),
newPutBucketTagging,
putBucketTagging_contentMD5,
putBucketTagging_expectedBucketOwner,
putBucketTagging_bucket,
putBucketTagging_tagging,
PutBucketTaggingResponse (..),
newPutBucketTaggingResponse,
)
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 PutBucketTagging = PutBucketTagging'
{
PutBucketTagging -> Maybe Text
contentMD5 :: Prelude.Maybe Prelude.Text,
PutBucketTagging -> Maybe Text
expectedBucketOwner :: Prelude.Maybe Prelude.Text,
PutBucketTagging -> BucketName
bucket :: BucketName,
PutBucketTagging -> Tagging
tagging :: Tagging
}
deriving (PutBucketTagging -> PutBucketTagging -> Bool
(PutBucketTagging -> PutBucketTagging -> Bool)
-> (PutBucketTagging -> PutBucketTagging -> Bool)
-> Eq PutBucketTagging
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PutBucketTagging -> PutBucketTagging -> Bool
$c/= :: PutBucketTagging -> PutBucketTagging -> Bool
== :: PutBucketTagging -> PutBucketTagging -> Bool
$c== :: PutBucketTagging -> PutBucketTagging -> Bool
Prelude.Eq, ReadPrec [PutBucketTagging]
ReadPrec PutBucketTagging
Int -> ReadS PutBucketTagging
ReadS [PutBucketTagging]
(Int -> ReadS PutBucketTagging)
-> ReadS [PutBucketTagging]
-> ReadPrec PutBucketTagging
-> ReadPrec [PutBucketTagging]
-> Read PutBucketTagging
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PutBucketTagging]
$creadListPrec :: ReadPrec [PutBucketTagging]
readPrec :: ReadPrec PutBucketTagging
$creadPrec :: ReadPrec PutBucketTagging
readList :: ReadS [PutBucketTagging]
$creadList :: ReadS [PutBucketTagging]
readsPrec :: Int -> ReadS PutBucketTagging
$creadsPrec :: Int -> ReadS PutBucketTagging
Prelude.Read, Int -> PutBucketTagging -> ShowS
[PutBucketTagging] -> ShowS
PutBucketTagging -> String
(Int -> PutBucketTagging -> ShowS)
-> (PutBucketTagging -> String)
-> ([PutBucketTagging] -> ShowS)
-> Show PutBucketTagging
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PutBucketTagging] -> ShowS
$cshowList :: [PutBucketTagging] -> ShowS
show :: PutBucketTagging -> String
$cshow :: PutBucketTagging -> String
showsPrec :: Int -> PutBucketTagging -> ShowS
$cshowsPrec :: Int -> PutBucketTagging -> ShowS
Prelude.Show, (forall x. PutBucketTagging -> Rep PutBucketTagging x)
-> (forall x. Rep PutBucketTagging x -> PutBucketTagging)
-> Generic PutBucketTagging
forall x. Rep PutBucketTagging x -> PutBucketTagging
forall x. PutBucketTagging -> Rep PutBucketTagging x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep PutBucketTagging x -> PutBucketTagging
$cfrom :: forall x. PutBucketTagging -> Rep PutBucketTagging x
Prelude.Generic)
newPutBucketTagging ::
BucketName ->
Tagging ->
PutBucketTagging
newPutBucketTagging :: BucketName -> Tagging -> PutBucketTagging
newPutBucketTagging BucketName
pBucket_ Tagging
pTagging_ =
PutBucketTagging' :: Maybe Text
-> Maybe Text -> BucketName -> Tagging -> PutBucketTagging
PutBucketTagging'
{ $sel:contentMD5:PutBucketTagging' :: Maybe Text
contentMD5 = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:expectedBucketOwner:PutBucketTagging' :: Maybe Text
expectedBucketOwner = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:bucket:PutBucketTagging' :: BucketName
bucket = BucketName
pBucket_,
$sel:tagging:PutBucketTagging' :: Tagging
tagging = Tagging
pTagging_
}
putBucketTagging_contentMD5 :: Lens.Lens' PutBucketTagging (Prelude.Maybe Prelude.Text)
putBucketTagging_contentMD5 :: (Maybe Text -> f (Maybe Text))
-> PutBucketTagging -> f PutBucketTagging
putBucketTagging_contentMD5 = (PutBucketTagging -> Maybe Text)
-> (PutBucketTagging -> Maybe Text -> PutBucketTagging)
-> Lens PutBucketTagging PutBucketTagging (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutBucketTagging' {Maybe Text
contentMD5 :: Maybe Text
$sel:contentMD5:PutBucketTagging' :: PutBucketTagging -> Maybe Text
contentMD5} -> Maybe Text
contentMD5) (\s :: PutBucketTagging
s@PutBucketTagging' {} Maybe Text
a -> PutBucketTagging
s {$sel:contentMD5:PutBucketTagging' :: Maybe Text
contentMD5 = Maybe Text
a} :: PutBucketTagging)
putBucketTagging_expectedBucketOwner :: Lens.Lens' PutBucketTagging (Prelude.Maybe Prelude.Text)
putBucketTagging_expectedBucketOwner :: (Maybe Text -> f (Maybe Text))
-> PutBucketTagging -> f PutBucketTagging
putBucketTagging_expectedBucketOwner = (PutBucketTagging -> Maybe Text)
-> (PutBucketTagging -> Maybe Text -> PutBucketTagging)
-> Lens PutBucketTagging PutBucketTagging (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutBucketTagging' {Maybe Text
expectedBucketOwner :: Maybe Text
$sel:expectedBucketOwner:PutBucketTagging' :: PutBucketTagging -> Maybe Text
expectedBucketOwner} -> Maybe Text
expectedBucketOwner) (\s :: PutBucketTagging
s@PutBucketTagging' {} Maybe Text
a -> PutBucketTagging
s {$sel:expectedBucketOwner:PutBucketTagging' :: Maybe Text
expectedBucketOwner = Maybe Text
a} :: PutBucketTagging)
putBucketTagging_bucket :: Lens.Lens' PutBucketTagging BucketName
putBucketTagging_bucket :: (BucketName -> f BucketName)
-> PutBucketTagging -> f PutBucketTagging
putBucketTagging_bucket = (PutBucketTagging -> BucketName)
-> (PutBucketTagging -> BucketName -> PutBucketTagging)
-> Lens PutBucketTagging PutBucketTagging BucketName BucketName
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutBucketTagging' {BucketName
bucket :: BucketName
$sel:bucket:PutBucketTagging' :: PutBucketTagging -> BucketName
bucket} -> BucketName
bucket) (\s :: PutBucketTagging
s@PutBucketTagging' {} BucketName
a -> PutBucketTagging
s {$sel:bucket:PutBucketTagging' :: BucketName
bucket = BucketName
a} :: PutBucketTagging)
putBucketTagging_tagging :: Lens.Lens' PutBucketTagging Tagging
putBucketTagging_tagging :: (Tagging -> f Tagging) -> PutBucketTagging -> f PutBucketTagging
putBucketTagging_tagging = (PutBucketTagging -> Tagging)
-> (PutBucketTagging -> Tagging -> PutBucketTagging)
-> Lens PutBucketTagging PutBucketTagging Tagging Tagging
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutBucketTagging' {Tagging
tagging :: Tagging
$sel:tagging:PutBucketTagging' :: PutBucketTagging -> Tagging
tagging} -> Tagging
tagging) (\s :: PutBucketTagging
s@PutBucketTagging' {} Tagging
a -> PutBucketTagging
s {$sel:tagging:PutBucketTagging' :: Tagging
tagging = Tagging
a} :: PutBucketTagging)
instance Core.AWSRequest PutBucketTagging where
type
AWSResponse PutBucketTagging =
PutBucketTaggingResponse
request :: PutBucketTagging -> Request PutBucketTagging
request =
Request PutBucketTagging -> Request PutBucketTagging
forall a. Request a -> Request a
Request.contentMD5Header
(Request PutBucketTagging -> Request PutBucketTagging)
-> (PutBucketTagging -> Request PutBucketTagging)
-> PutBucketTagging
-> Request PutBucketTagging
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. Request PutBucketTagging -> Request PutBucketTagging
forall a. Request a -> Request a
Request.s3vhost
(Request PutBucketTagging -> Request PutBucketTagging)
-> (PutBucketTagging -> Request PutBucketTagging)
-> PutBucketTagging
-> Request PutBucketTagging
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. Service -> PutBucketTagging -> Request PutBucketTagging
forall a. (ToRequest a, ToElement a) => Service -> a -> Request a
Request.putXML Service
defaultService
response :: Logger
-> Service
-> Proxy PutBucketTagging
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse PutBucketTagging)))
response =
AWSResponse PutBucketTagging
-> Logger
-> Service
-> Proxy PutBucketTagging
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse PutBucketTagging)))
forall (m :: * -> *) a.
MonadResource m =>
AWSResponse a
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveNull AWSResponse PutBucketTagging
PutBucketTaggingResponse
PutBucketTaggingResponse'
instance Prelude.Hashable PutBucketTagging
instance Prelude.NFData PutBucketTagging
instance Core.ToElement PutBucketTagging where
toElement :: PutBucketTagging -> Element
toElement PutBucketTagging' {Maybe Text
BucketName
Tagging
tagging :: Tagging
bucket :: BucketName
expectedBucketOwner :: Maybe Text
contentMD5 :: Maybe Text
$sel:tagging:PutBucketTagging' :: PutBucketTagging -> Tagging
$sel:bucket:PutBucketTagging' :: PutBucketTagging -> BucketName
$sel:expectedBucketOwner:PutBucketTagging' :: PutBucketTagging -> Maybe Text
$sel:contentMD5:PutBucketTagging' :: PutBucketTagging -> Maybe Text
..} =
Name -> Tagging -> Element
forall a. ToXML a => Name -> a -> Element
Core.mkElement
Name
"{http://s3.amazonaws.com/doc/2006-03-01/}Tagging"
Tagging
tagging
instance Core.ToHeaders PutBucketTagging where
toHeaders :: PutBucketTagging -> [Header]
toHeaders PutBucketTagging' {Maybe Text
BucketName
Tagging
tagging :: Tagging
bucket :: BucketName
expectedBucketOwner :: Maybe Text
contentMD5 :: Maybe Text
$sel:tagging:PutBucketTagging' :: PutBucketTagging -> Tagging
$sel:bucket:PutBucketTagging' :: PutBucketTagging -> BucketName
$sel:expectedBucketOwner:PutBucketTagging' :: PutBucketTagging -> Maybe Text
$sel:contentMD5:PutBucketTagging' :: PutBucketTagging -> Maybe Text
..} =
[[Header]] -> [Header]
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"Content-MD5" HeaderName -> Maybe Text -> [Header]
forall a. ToHeader a => HeaderName -> a -> [Header]
Core.=# Maybe Text
contentMD5,
HeaderName
"x-amz-expected-bucket-owner"
HeaderName -> Maybe Text -> [Header]
forall a. ToHeader a => HeaderName -> a -> [Header]
Core.=# Maybe Text
expectedBucketOwner
]
instance Core.ToPath PutBucketTagging where
toPath :: PutBucketTagging -> ByteString
toPath PutBucketTagging' {Maybe Text
BucketName
Tagging
tagging :: Tagging
bucket :: BucketName
expectedBucketOwner :: Maybe Text
contentMD5 :: Maybe Text
$sel:tagging:PutBucketTagging' :: PutBucketTagging -> Tagging
$sel:bucket:PutBucketTagging' :: PutBucketTagging -> BucketName
$sel:expectedBucketOwner:PutBucketTagging' :: PutBucketTagging -> Maybe Text
$sel:contentMD5:PutBucketTagging' :: PutBucketTagging -> 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 PutBucketTagging where
toQuery :: PutBucketTagging -> QueryString
toQuery = QueryString -> PutBucketTagging -> QueryString
forall a b. a -> b -> a
Prelude.const ([QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat [QueryString
"tagging"])
data PutBucketTaggingResponse = PutBucketTaggingResponse'
{
}
deriving (PutBucketTaggingResponse -> PutBucketTaggingResponse -> Bool
(PutBucketTaggingResponse -> PutBucketTaggingResponse -> Bool)
-> (PutBucketTaggingResponse -> PutBucketTaggingResponse -> Bool)
-> Eq PutBucketTaggingResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PutBucketTaggingResponse -> PutBucketTaggingResponse -> Bool
$c/= :: PutBucketTaggingResponse -> PutBucketTaggingResponse -> Bool
== :: PutBucketTaggingResponse -> PutBucketTaggingResponse -> Bool
$c== :: PutBucketTaggingResponse -> PutBucketTaggingResponse -> Bool
Prelude.Eq, ReadPrec [PutBucketTaggingResponse]
ReadPrec PutBucketTaggingResponse
Int -> ReadS PutBucketTaggingResponse
ReadS [PutBucketTaggingResponse]
(Int -> ReadS PutBucketTaggingResponse)
-> ReadS [PutBucketTaggingResponse]
-> ReadPrec PutBucketTaggingResponse
-> ReadPrec [PutBucketTaggingResponse]
-> Read PutBucketTaggingResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PutBucketTaggingResponse]
$creadListPrec :: ReadPrec [PutBucketTaggingResponse]
readPrec :: ReadPrec PutBucketTaggingResponse
$creadPrec :: ReadPrec PutBucketTaggingResponse
readList :: ReadS [PutBucketTaggingResponse]
$creadList :: ReadS [PutBucketTaggingResponse]
readsPrec :: Int -> ReadS PutBucketTaggingResponse
$creadsPrec :: Int -> ReadS PutBucketTaggingResponse
Prelude.Read, Int -> PutBucketTaggingResponse -> ShowS
[PutBucketTaggingResponse] -> ShowS
PutBucketTaggingResponse -> String
(Int -> PutBucketTaggingResponse -> ShowS)
-> (PutBucketTaggingResponse -> String)
-> ([PutBucketTaggingResponse] -> ShowS)
-> Show PutBucketTaggingResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PutBucketTaggingResponse] -> ShowS
$cshowList :: [PutBucketTaggingResponse] -> ShowS
show :: PutBucketTaggingResponse -> String
$cshow :: PutBucketTaggingResponse -> String
showsPrec :: Int -> PutBucketTaggingResponse -> ShowS
$cshowsPrec :: Int -> PutBucketTaggingResponse -> ShowS
Prelude.Show, (forall x.
PutBucketTaggingResponse -> Rep PutBucketTaggingResponse x)
-> (forall x.
Rep PutBucketTaggingResponse x -> PutBucketTaggingResponse)
-> Generic PutBucketTaggingResponse
forall x.
Rep PutBucketTaggingResponse x -> PutBucketTaggingResponse
forall x.
PutBucketTaggingResponse -> Rep PutBucketTaggingResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep PutBucketTaggingResponse x -> PutBucketTaggingResponse
$cfrom :: forall x.
PutBucketTaggingResponse -> Rep PutBucketTaggingResponse x
Prelude.Generic)
newPutBucketTaggingResponse ::
PutBucketTaggingResponse
newPutBucketTaggingResponse :: PutBucketTaggingResponse
newPutBucketTaggingResponse =
PutBucketTaggingResponse
PutBucketTaggingResponse'
instance Prelude.NFData PutBucketTaggingResponse