{-# 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.PutBucketInventoryConfiguration
(
PutBucketInventoryConfiguration (..),
newPutBucketInventoryConfiguration,
putBucketInventoryConfiguration_expectedBucketOwner,
putBucketInventoryConfiguration_bucket,
putBucketInventoryConfiguration_id,
putBucketInventoryConfiguration_inventoryConfiguration,
PutBucketInventoryConfigurationResponse (..),
newPutBucketInventoryConfigurationResponse,
)
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 PutBucketInventoryConfiguration = PutBucketInventoryConfiguration'
{
PutBucketInventoryConfiguration -> Maybe Text
expectedBucketOwner :: Prelude.Maybe Prelude.Text,
PutBucketInventoryConfiguration -> BucketName
bucket :: BucketName,
PutBucketInventoryConfiguration -> Text
id :: Prelude.Text,
PutBucketInventoryConfiguration -> InventoryConfiguration
inventoryConfiguration :: InventoryConfiguration
}
deriving (PutBucketInventoryConfiguration
-> PutBucketInventoryConfiguration -> Bool
(PutBucketInventoryConfiguration
-> PutBucketInventoryConfiguration -> Bool)
-> (PutBucketInventoryConfiguration
-> PutBucketInventoryConfiguration -> Bool)
-> Eq PutBucketInventoryConfiguration
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PutBucketInventoryConfiguration
-> PutBucketInventoryConfiguration -> Bool
$c/= :: PutBucketInventoryConfiguration
-> PutBucketInventoryConfiguration -> Bool
== :: PutBucketInventoryConfiguration
-> PutBucketInventoryConfiguration -> Bool
$c== :: PutBucketInventoryConfiguration
-> PutBucketInventoryConfiguration -> Bool
Prelude.Eq, Int -> PutBucketInventoryConfiguration -> ShowS
[PutBucketInventoryConfiguration] -> ShowS
PutBucketInventoryConfiguration -> String
(Int -> PutBucketInventoryConfiguration -> ShowS)
-> (PutBucketInventoryConfiguration -> String)
-> ([PutBucketInventoryConfiguration] -> ShowS)
-> Show PutBucketInventoryConfiguration
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PutBucketInventoryConfiguration] -> ShowS
$cshowList :: [PutBucketInventoryConfiguration] -> ShowS
show :: PutBucketInventoryConfiguration -> String
$cshow :: PutBucketInventoryConfiguration -> String
showsPrec :: Int -> PutBucketInventoryConfiguration -> ShowS
$cshowsPrec :: Int -> PutBucketInventoryConfiguration -> ShowS
Prelude.Show, (forall x.
PutBucketInventoryConfiguration
-> Rep PutBucketInventoryConfiguration x)
-> (forall x.
Rep PutBucketInventoryConfiguration x
-> PutBucketInventoryConfiguration)
-> Generic PutBucketInventoryConfiguration
forall x.
Rep PutBucketInventoryConfiguration x
-> PutBucketInventoryConfiguration
forall x.
PutBucketInventoryConfiguration
-> Rep PutBucketInventoryConfiguration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep PutBucketInventoryConfiguration x
-> PutBucketInventoryConfiguration
$cfrom :: forall x.
PutBucketInventoryConfiguration
-> Rep PutBucketInventoryConfiguration x
Prelude.Generic)
newPutBucketInventoryConfiguration ::
BucketName ->
Prelude.Text ->
InventoryConfiguration ->
PutBucketInventoryConfiguration
newPutBucketInventoryConfiguration :: BucketName
-> Text
-> InventoryConfiguration
-> PutBucketInventoryConfiguration
newPutBucketInventoryConfiguration
BucketName
pBucket_
Text
pId_
InventoryConfiguration
pInventoryConfiguration_ =
PutBucketInventoryConfiguration' :: Maybe Text
-> BucketName
-> Text
-> InventoryConfiguration
-> PutBucketInventoryConfiguration
PutBucketInventoryConfiguration'
{ $sel:expectedBucketOwner:PutBucketInventoryConfiguration' :: Maybe Text
expectedBucketOwner =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:bucket:PutBucketInventoryConfiguration' :: BucketName
bucket = BucketName
pBucket_,
$sel:id:PutBucketInventoryConfiguration' :: Text
id = Text
pId_,
$sel:inventoryConfiguration:PutBucketInventoryConfiguration' :: InventoryConfiguration
inventoryConfiguration =
InventoryConfiguration
pInventoryConfiguration_
}
putBucketInventoryConfiguration_expectedBucketOwner :: Lens.Lens' PutBucketInventoryConfiguration (Prelude.Maybe Prelude.Text)
putBucketInventoryConfiguration_expectedBucketOwner :: (Maybe Text -> f (Maybe Text))
-> PutBucketInventoryConfiguration
-> f PutBucketInventoryConfiguration
putBucketInventoryConfiguration_expectedBucketOwner = (PutBucketInventoryConfiguration -> Maybe Text)
-> (PutBucketInventoryConfiguration
-> Maybe Text -> PutBucketInventoryConfiguration)
-> Lens
PutBucketInventoryConfiguration
PutBucketInventoryConfiguration
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutBucketInventoryConfiguration' {Maybe Text
expectedBucketOwner :: Maybe Text
$sel:expectedBucketOwner:PutBucketInventoryConfiguration' :: PutBucketInventoryConfiguration -> Maybe Text
expectedBucketOwner} -> Maybe Text
expectedBucketOwner) (\s :: PutBucketInventoryConfiguration
s@PutBucketInventoryConfiguration' {} Maybe Text
a -> PutBucketInventoryConfiguration
s {$sel:expectedBucketOwner:PutBucketInventoryConfiguration' :: Maybe Text
expectedBucketOwner = Maybe Text
a} :: PutBucketInventoryConfiguration)
putBucketInventoryConfiguration_bucket :: Lens.Lens' PutBucketInventoryConfiguration BucketName
putBucketInventoryConfiguration_bucket :: (BucketName -> f BucketName)
-> PutBucketInventoryConfiguration
-> f PutBucketInventoryConfiguration
putBucketInventoryConfiguration_bucket = (PutBucketInventoryConfiguration -> BucketName)
-> (PutBucketInventoryConfiguration
-> BucketName -> PutBucketInventoryConfiguration)
-> Lens
PutBucketInventoryConfiguration
PutBucketInventoryConfiguration
BucketName
BucketName
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutBucketInventoryConfiguration' {BucketName
bucket :: BucketName
$sel:bucket:PutBucketInventoryConfiguration' :: PutBucketInventoryConfiguration -> BucketName
bucket} -> BucketName
bucket) (\s :: PutBucketInventoryConfiguration
s@PutBucketInventoryConfiguration' {} BucketName
a -> PutBucketInventoryConfiguration
s {$sel:bucket:PutBucketInventoryConfiguration' :: BucketName
bucket = BucketName
a} :: PutBucketInventoryConfiguration)
putBucketInventoryConfiguration_id :: Lens.Lens' PutBucketInventoryConfiguration Prelude.Text
putBucketInventoryConfiguration_id :: (Text -> f Text)
-> PutBucketInventoryConfiguration
-> f PutBucketInventoryConfiguration
putBucketInventoryConfiguration_id = (PutBucketInventoryConfiguration -> Text)
-> (PutBucketInventoryConfiguration
-> Text -> PutBucketInventoryConfiguration)
-> Lens
PutBucketInventoryConfiguration
PutBucketInventoryConfiguration
Text
Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutBucketInventoryConfiguration' {Text
id :: Text
$sel:id:PutBucketInventoryConfiguration' :: PutBucketInventoryConfiguration -> Text
id} -> Text
id) (\s :: PutBucketInventoryConfiguration
s@PutBucketInventoryConfiguration' {} Text
a -> PutBucketInventoryConfiguration
s {$sel:id:PutBucketInventoryConfiguration' :: Text
id = Text
a} :: PutBucketInventoryConfiguration)
putBucketInventoryConfiguration_inventoryConfiguration :: Lens.Lens' PutBucketInventoryConfiguration InventoryConfiguration
putBucketInventoryConfiguration_inventoryConfiguration :: (InventoryConfiguration -> f InventoryConfiguration)
-> PutBucketInventoryConfiguration
-> f PutBucketInventoryConfiguration
putBucketInventoryConfiguration_inventoryConfiguration = (PutBucketInventoryConfiguration -> InventoryConfiguration)
-> (PutBucketInventoryConfiguration
-> InventoryConfiguration -> PutBucketInventoryConfiguration)
-> Lens
PutBucketInventoryConfiguration
PutBucketInventoryConfiguration
InventoryConfiguration
InventoryConfiguration
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutBucketInventoryConfiguration' {InventoryConfiguration
inventoryConfiguration :: InventoryConfiguration
$sel:inventoryConfiguration:PutBucketInventoryConfiguration' :: PutBucketInventoryConfiguration -> InventoryConfiguration
inventoryConfiguration} -> InventoryConfiguration
inventoryConfiguration) (\s :: PutBucketInventoryConfiguration
s@PutBucketInventoryConfiguration' {} InventoryConfiguration
a -> PutBucketInventoryConfiguration
s {$sel:inventoryConfiguration:PutBucketInventoryConfiguration' :: InventoryConfiguration
inventoryConfiguration = InventoryConfiguration
a} :: PutBucketInventoryConfiguration)
instance
Core.AWSRequest
PutBucketInventoryConfiguration
where
type
AWSResponse PutBucketInventoryConfiguration =
PutBucketInventoryConfigurationResponse
request :: PutBucketInventoryConfiguration
-> Request PutBucketInventoryConfiguration
request =
Request PutBucketInventoryConfiguration
-> Request PutBucketInventoryConfiguration
forall a. Request a -> Request a
Request.s3vhost
(Request PutBucketInventoryConfiguration
-> Request PutBucketInventoryConfiguration)
-> (PutBucketInventoryConfiguration
-> Request PutBucketInventoryConfiguration)
-> PutBucketInventoryConfiguration
-> Request PutBucketInventoryConfiguration
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. Service
-> PutBucketInventoryConfiguration
-> Request PutBucketInventoryConfiguration
forall a. (ToRequest a, ToElement a) => Service -> a -> Request a
Request.putXML Service
defaultService
response :: Logger
-> Service
-> Proxy PutBucketInventoryConfiguration
-> ClientResponse ClientBody
-> m (Either
Error
(ClientResponse (AWSResponse PutBucketInventoryConfiguration)))
response =
AWSResponse PutBucketInventoryConfiguration
-> Logger
-> Service
-> Proxy PutBucketInventoryConfiguration
-> ClientResponse ClientBody
-> m (Either
Error
(ClientResponse (AWSResponse PutBucketInventoryConfiguration)))
forall (m :: * -> *) a.
MonadResource m =>
AWSResponse a
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveNull
AWSResponse PutBucketInventoryConfiguration
PutBucketInventoryConfigurationResponse
PutBucketInventoryConfigurationResponse'
instance
Prelude.Hashable
PutBucketInventoryConfiguration
instance
Prelude.NFData
PutBucketInventoryConfiguration
instance
Core.ToElement
PutBucketInventoryConfiguration
where
toElement :: PutBucketInventoryConfiguration -> Element
toElement PutBucketInventoryConfiguration' {Maybe Text
Text
BucketName
InventoryConfiguration
inventoryConfiguration :: InventoryConfiguration
id :: Text
bucket :: BucketName
expectedBucketOwner :: Maybe Text
$sel:inventoryConfiguration:PutBucketInventoryConfiguration' :: PutBucketInventoryConfiguration -> InventoryConfiguration
$sel:id:PutBucketInventoryConfiguration' :: PutBucketInventoryConfiguration -> Text
$sel:bucket:PutBucketInventoryConfiguration' :: PutBucketInventoryConfiguration -> BucketName
$sel:expectedBucketOwner:PutBucketInventoryConfiguration' :: PutBucketInventoryConfiguration -> Maybe Text
..} =
Name -> InventoryConfiguration -> Element
forall a. ToXML a => Name -> a -> Element
Core.mkElement
Name
"{http://s3.amazonaws.com/doc/2006-03-01/}InventoryConfiguration"
InventoryConfiguration
inventoryConfiguration
instance
Core.ToHeaders
PutBucketInventoryConfiguration
where
toHeaders :: PutBucketInventoryConfiguration -> [Header]
toHeaders PutBucketInventoryConfiguration' {Maybe Text
Text
BucketName
InventoryConfiguration
inventoryConfiguration :: InventoryConfiguration
id :: Text
bucket :: BucketName
expectedBucketOwner :: Maybe Text
$sel:inventoryConfiguration:PutBucketInventoryConfiguration' :: PutBucketInventoryConfiguration -> InventoryConfiguration
$sel:id:PutBucketInventoryConfiguration' :: PutBucketInventoryConfiguration -> Text
$sel:bucket:PutBucketInventoryConfiguration' :: PutBucketInventoryConfiguration -> BucketName
$sel:expectedBucketOwner:PutBucketInventoryConfiguration' :: PutBucketInventoryConfiguration -> 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 PutBucketInventoryConfiguration where
toPath :: PutBucketInventoryConfiguration -> ByteString
toPath PutBucketInventoryConfiguration' {Maybe Text
Text
BucketName
InventoryConfiguration
inventoryConfiguration :: InventoryConfiguration
id :: Text
bucket :: BucketName
expectedBucketOwner :: Maybe Text
$sel:inventoryConfiguration:PutBucketInventoryConfiguration' :: PutBucketInventoryConfiguration -> InventoryConfiguration
$sel:id:PutBucketInventoryConfiguration' :: PutBucketInventoryConfiguration -> Text
$sel:bucket:PutBucketInventoryConfiguration' :: PutBucketInventoryConfiguration -> BucketName
$sel:expectedBucketOwner:PutBucketInventoryConfiguration' :: PutBucketInventoryConfiguration -> 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 PutBucketInventoryConfiguration where
toQuery :: PutBucketInventoryConfiguration -> QueryString
toQuery PutBucketInventoryConfiguration' {Maybe Text
Text
BucketName
InventoryConfiguration
inventoryConfiguration :: InventoryConfiguration
id :: Text
bucket :: BucketName
expectedBucketOwner :: Maybe Text
$sel:inventoryConfiguration:PutBucketInventoryConfiguration' :: PutBucketInventoryConfiguration -> InventoryConfiguration
$sel:id:PutBucketInventoryConfiguration' :: PutBucketInventoryConfiguration -> Text
$sel:bucket:PutBucketInventoryConfiguration' :: PutBucketInventoryConfiguration -> BucketName
$sel:expectedBucketOwner:PutBucketInventoryConfiguration' :: PutBucketInventoryConfiguration -> 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
"inventory"]
data PutBucketInventoryConfigurationResponse = PutBucketInventoryConfigurationResponse'
{
}
deriving (PutBucketInventoryConfigurationResponse
-> PutBucketInventoryConfigurationResponse -> Bool
(PutBucketInventoryConfigurationResponse
-> PutBucketInventoryConfigurationResponse -> Bool)
-> (PutBucketInventoryConfigurationResponse
-> PutBucketInventoryConfigurationResponse -> Bool)
-> Eq PutBucketInventoryConfigurationResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PutBucketInventoryConfigurationResponse
-> PutBucketInventoryConfigurationResponse -> Bool
$c/= :: PutBucketInventoryConfigurationResponse
-> PutBucketInventoryConfigurationResponse -> Bool
== :: PutBucketInventoryConfigurationResponse
-> PutBucketInventoryConfigurationResponse -> Bool
$c== :: PutBucketInventoryConfigurationResponse
-> PutBucketInventoryConfigurationResponse -> Bool
Prelude.Eq, ReadPrec [PutBucketInventoryConfigurationResponse]
ReadPrec PutBucketInventoryConfigurationResponse
Int -> ReadS PutBucketInventoryConfigurationResponse
ReadS [PutBucketInventoryConfigurationResponse]
(Int -> ReadS PutBucketInventoryConfigurationResponse)
-> ReadS [PutBucketInventoryConfigurationResponse]
-> ReadPrec PutBucketInventoryConfigurationResponse
-> ReadPrec [PutBucketInventoryConfigurationResponse]
-> Read PutBucketInventoryConfigurationResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PutBucketInventoryConfigurationResponse]
$creadListPrec :: ReadPrec [PutBucketInventoryConfigurationResponse]
readPrec :: ReadPrec PutBucketInventoryConfigurationResponse
$creadPrec :: ReadPrec PutBucketInventoryConfigurationResponse
readList :: ReadS [PutBucketInventoryConfigurationResponse]
$creadList :: ReadS [PutBucketInventoryConfigurationResponse]
readsPrec :: Int -> ReadS PutBucketInventoryConfigurationResponse
$creadsPrec :: Int -> ReadS PutBucketInventoryConfigurationResponse
Prelude.Read, Int -> PutBucketInventoryConfigurationResponse -> ShowS
[PutBucketInventoryConfigurationResponse] -> ShowS
PutBucketInventoryConfigurationResponse -> String
(Int -> PutBucketInventoryConfigurationResponse -> ShowS)
-> (PutBucketInventoryConfigurationResponse -> String)
-> ([PutBucketInventoryConfigurationResponse] -> ShowS)
-> Show PutBucketInventoryConfigurationResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PutBucketInventoryConfigurationResponse] -> ShowS
$cshowList :: [PutBucketInventoryConfigurationResponse] -> ShowS
show :: PutBucketInventoryConfigurationResponse -> String
$cshow :: PutBucketInventoryConfigurationResponse -> String
showsPrec :: Int -> PutBucketInventoryConfigurationResponse -> ShowS
$cshowsPrec :: Int -> PutBucketInventoryConfigurationResponse -> ShowS
Prelude.Show, (forall x.
PutBucketInventoryConfigurationResponse
-> Rep PutBucketInventoryConfigurationResponse x)
-> (forall x.
Rep PutBucketInventoryConfigurationResponse x
-> PutBucketInventoryConfigurationResponse)
-> Generic PutBucketInventoryConfigurationResponse
forall x.
Rep PutBucketInventoryConfigurationResponse x
-> PutBucketInventoryConfigurationResponse
forall x.
PutBucketInventoryConfigurationResponse
-> Rep PutBucketInventoryConfigurationResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep PutBucketInventoryConfigurationResponse x
-> PutBucketInventoryConfigurationResponse
$cfrom :: forall x.
PutBucketInventoryConfigurationResponse
-> Rep PutBucketInventoryConfigurationResponse x
Prelude.Generic)
newPutBucketInventoryConfigurationResponse ::
PutBucketInventoryConfigurationResponse
newPutBucketInventoryConfigurationResponse :: PutBucketInventoryConfigurationResponse
newPutBucketInventoryConfigurationResponse =
PutBucketInventoryConfigurationResponse
PutBucketInventoryConfigurationResponse'
instance
Prelude.NFData
PutBucketInventoryConfigurationResponse