{-# 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.GetBucketInventoryConfiguration
(
GetBucketInventoryConfiguration (..),
newGetBucketInventoryConfiguration,
getBucketInventoryConfiguration_expectedBucketOwner,
getBucketInventoryConfiguration_bucket,
getBucketInventoryConfiguration_id,
GetBucketInventoryConfigurationResponse (..),
newGetBucketInventoryConfigurationResponse,
getBucketInventoryConfigurationResponse_inventoryConfiguration,
getBucketInventoryConfigurationResponse_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 GetBucketInventoryConfiguration = GetBucketInventoryConfiguration'
{
GetBucketInventoryConfiguration -> Maybe Text
expectedBucketOwner :: Prelude.Maybe Prelude.Text,
GetBucketInventoryConfiguration -> BucketName
bucket :: BucketName,
GetBucketInventoryConfiguration -> Text
id :: Prelude.Text
}
deriving (GetBucketInventoryConfiguration
-> GetBucketInventoryConfiguration -> Bool
(GetBucketInventoryConfiguration
-> GetBucketInventoryConfiguration -> Bool)
-> (GetBucketInventoryConfiguration
-> GetBucketInventoryConfiguration -> Bool)
-> Eq GetBucketInventoryConfiguration
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetBucketInventoryConfiguration
-> GetBucketInventoryConfiguration -> Bool
$c/= :: GetBucketInventoryConfiguration
-> GetBucketInventoryConfiguration -> Bool
== :: GetBucketInventoryConfiguration
-> GetBucketInventoryConfiguration -> Bool
$c== :: GetBucketInventoryConfiguration
-> GetBucketInventoryConfiguration -> Bool
Prelude.Eq, ReadPrec [GetBucketInventoryConfiguration]
ReadPrec GetBucketInventoryConfiguration
Int -> ReadS GetBucketInventoryConfiguration
ReadS [GetBucketInventoryConfiguration]
(Int -> ReadS GetBucketInventoryConfiguration)
-> ReadS [GetBucketInventoryConfiguration]
-> ReadPrec GetBucketInventoryConfiguration
-> ReadPrec [GetBucketInventoryConfiguration]
-> Read GetBucketInventoryConfiguration
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetBucketInventoryConfiguration]
$creadListPrec :: ReadPrec [GetBucketInventoryConfiguration]
readPrec :: ReadPrec GetBucketInventoryConfiguration
$creadPrec :: ReadPrec GetBucketInventoryConfiguration
readList :: ReadS [GetBucketInventoryConfiguration]
$creadList :: ReadS [GetBucketInventoryConfiguration]
readsPrec :: Int -> ReadS GetBucketInventoryConfiguration
$creadsPrec :: Int -> ReadS GetBucketInventoryConfiguration
Prelude.Read, Int -> GetBucketInventoryConfiguration -> ShowS
[GetBucketInventoryConfiguration] -> ShowS
GetBucketInventoryConfiguration -> String
(Int -> GetBucketInventoryConfiguration -> ShowS)
-> (GetBucketInventoryConfiguration -> String)
-> ([GetBucketInventoryConfiguration] -> ShowS)
-> Show GetBucketInventoryConfiguration
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetBucketInventoryConfiguration] -> ShowS
$cshowList :: [GetBucketInventoryConfiguration] -> ShowS
show :: GetBucketInventoryConfiguration -> String
$cshow :: GetBucketInventoryConfiguration -> String
showsPrec :: Int -> GetBucketInventoryConfiguration -> ShowS
$cshowsPrec :: Int -> GetBucketInventoryConfiguration -> ShowS
Prelude.Show, (forall x.
GetBucketInventoryConfiguration
-> Rep GetBucketInventoryConfiguration x)
-> (forall x.
Rep GetBucketInventoryConfiguration x
-> GetBucketInventoryConfiguration)
-> Generic GetBucketInventoryConfiguration
forall x.
Rep GetBucketInventoryConfiguration x
-> GetBucketInventoryConfiguration
forall x.
GetBucketInventoryConfiguration
-> Rep GetBucketInventoryConfiguration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetBucketInventoryConfiguration x
-> GetBucketInventoryConfiguration
$cfrom :: forall x.
GetBucketInventoryConfiguration
-> Rep GetBucketInventoryConfiguration x
Prelude.Generic)
newGetBucketInventoryConfiguration ::
BucketName ->
Prelude.Text ->
GetBucketInventoryConfiguration
newGetBucketInventoryConfiguration :: BucketName -> Text -> GetBucketInventoryConfiguration
newGetBucketInventoryConfiguration BucketName
pBucket_ Text
pId_ =
GetBucketInventoryConfiguration' :: Maybe Text -> BucketName -> Text -> GetBucketInventoryConfiguration
GetBucketInventoryConfiguration'
{ $sel:expectedBucketOwner:GetBucketInventoryConfiguration' :: Maybe Text
expectedBucketOwner =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:bucket:GetBucketInventoryConfiguration' :: BucketName
bucket = BucketName
pBucket_,
$sel:id:GetBucketInventoryConfiguration' :: Text
id = Text
pId_
}
getBucketInventoryConfiguration_expectedBucketOwner :: Lens.Lens' GetBucketInventoryConfiguration (Prelude.Maybe Prelude.Text)
getBucketInventoryConfiguration_expectedBucketOwner :: (Maybe Text -> f (Maybe Text))
-> GetBucketInventoryConfiguration
-> f GetBucketInventoryConfiguration
getBucketInventoryConfiguration_expectedBucketOwner = (GetBucketInventoryConfiguration -> Maybe Text)
-> (GetBucketInventoryConfiguration
-> Maybe Text -> GetBucketInventoryConfiguration)
-> Lens
GetBucketInventoryConfiguration
GetBucketInventoryConfiguration
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetBucketInventoryConfiguration' {Maybe Text
expectedBucketOwner :: Maybe Text
$sel:expectedBucketOwner:GetBucketInventoryConfiguration' :: GetBucketInventoryConfiguration -> Maybe Text
expectedBucketOwner} -> Maybe Text
expectedBucketOwner) (\s :: GetBucketInventoryConfiguration
s@GetBucketInventoryConfiguration' {} Maybe Text
a -> GetBucketInventoryConfiguration
s {$sel:expectedBucketOwner:GetBucketInventoryConfiguration' :: Maybe Text
expectedBucketOwner = Maybe Text
a} :: GetBucketInventoryConfiguration)
getBucketInventoryConfiguration_bucket :: Lens.Lens' GetBucketInventoryConfiguration BucketName
getBucketInventoryConfiguration_bucket :: (BucketName -> f BucketName)
-> GetBucketInventoryConfiguration
-> f GetBucketInventoryConfiguration
getBucketInventoryConfiguration_bucket = (GetBucketInventoryConfiguration -> BucketName)
-> (GetBucketInventoryConfiguration
-> BucketName -> GetBucketInventoryConfiguration)
-> Lens
GetBucketInventoryConfiguration
GetBucketInventoryConfiguration
BucketName
BucketName
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetBucketInventoryConfiguration' {BucketName
bucket :: BucketName
$sel:bucket:GetBucketInventoryConfiguration' :: GetBucketInventoryConfiguration -> BucketName
bucket} -> BucketName
bucket) (\s :: GetBucketInventoryConfiguration
s@GetBucketInventoryConfiguration' {} BucketName
a -> GetBucketInventoryConfiguration
s {$sel:bucket:GetBucketInventoryConfiguration' :: BucketName
bucket = BucketName
a} :: GetBucketInventoryConfiguration)
getBucketInventoryConfiguration_id :: Lens.Lens' GetBucketInventoryConfiguration Prelude.Text
getBucketInventoryConfiguration_id :: (Text -> f Text)
-> GetBucketInventoryConfiguration
-> f GetBucketInventoryConfiguration
getBucketInventoryConfiguration_id = (GetBucketInventoryConfiguration -> Text)
-> (GetBucketInventoryConfiguration
-> Text -> GetBucketInventoryConfiguration)
-> Lens
GetBucketInventoryConfiguration
GetBucketInventoryConfiguration
Text
Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetBucketInventoryConfiguration' {Text
id :: Text
$sel:id:GetBucketInventoryConfiguration' :: GetBucketInventoryConfiguration -> Text
id} -> Text
id) (\s :: GetBucketInventoryConfiguration
s@GetBucketInventoryConfiguration' {} Text
a -> GetBucketInventoryConfiguration
s {$sel:id:GetBucketInventoryConfiguration' :: Text
id = Text
a} :: GetBucketInventoryConfiguration)
instance
Core.AWSRequest
GetBucketInventoryConfiguration
where
type
AWSResponse GetBucketInventoryConfiguration =
GetBucketInventoryConfigurationResponse
request :: GetBucketInventoryConfiguration
-> Request GetBucketInventoryConfiguration
request =
Request GetBucketInventoryConfiguration
-> Request GetBucketInventoryConfiguration
forall a. Request a -> Request a
Request.s3vhost
(Request GetBucketInventoryConfiguration
-> Request GetBucketInventoryConfiguration)
-> (GetBucketInventoryConfiguration
-> Request GetBucketInventoryConfiguration)
-> GetBucketInventoryConfiguration
-> Request GetBucketInventoryConfiguration
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. Service
-> GetBucketInventoryConfiguration
-> Request GetBucketInventoryConfiguration
forall a. ToRequest a => Service -> a -> Request a
Request.get Service
defaultService
response :: Logger
-> Service
-> Proxy GetBucketInventoryConfiguration
-> ClientResponse ClientBody
-> m (Either
Error
(ClientResponse (AWSResponse GetBucketInventoryConfiguration)))
response =
(Int
-> ResponseHeaders
-> [Node]
-> Either String (AWSResponse GetBucketInventoryConfiguration))
-> Logger
-> Service
-> Proxy GetBucketInventoryConfiguration
-> ClientResponse ClientBody
-> m (Either
Error
(ClientResponse (AWSResponse GetBucketInventoryConfiguration)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> [Node] -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveXML
( \Int
s ResponseHeaders
h [Node]
x ->
Maybe InventoryConfiguration
-> Int -> GetBucketInventoryConfigurationResponse
GetBucketInventoryConfigurationResponse'
(Maybe InventoryConfiguration
-> Int -> GetBucketInventoryConfigurationResponse)
-> Either String (Maybe InventoryConfiguration)
-> Either String (Int -> GetBucketInventoryConfigurationResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node] -> Either String (Maybe InventoryConfiguration)
forall a. FromXML a => [Node] -> Either String a
Core.parseXML [Node]
x)
Either String (Int -> GetBucketInventoryConfigurationResponse)
-> Either String Int
-> Either String GetBucketInventoryConfigurationResponse
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
GetBucketInventoryConfiguration
instance
Prelude.NFData
GetBucketInventoryConfiguration
instance
Core.ToHeaders
GetBucketInventoryConfiguration
where
toHeaders :: GetBucketInventoryConfiguration -> ResponseHeaders
toHeaders GetBucketInventoryConfiguration' {Maybe Text
Text
BucketName
id :: Text
bucket :: BucketName
expectedBucketOwner :: Maybe Text
$sel:id:GetBucketInventoryConfiguration' :: GetBucketInventoryConfiguration -> Text
$sel:bucket:GetBucketInventoryConfiguration' :: GetBucketInventoryConfiguration -> BucketName
$sel:expectedBucketOwner:GetBucketInventoryConfiguration' :: GetBucketInventoryConfiguration -> Maybe Text
..} =
[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 GetBucketInventoryConfiguration where
toPath :: GetBucketInventoryConfiguration -> ByteString
toPath GetBucketInventoryConfiguration' {Maybe Text
Text
BucketName
id :: Text
bucket :: BucketName
expectedBucketOwner :: Maybe Text
$sel:id:GetBucketInventoryConfiguration' :: GetBucketInventoryConfiguration -> Text
$sel:bucket:GetBucketInventoryConfiguration' :: GetBucketInventoryConfiguration -> BucketName
$sel:expectedBucketOwner:GetBucketInventoryConfiguration' :: GetBucketInventoryConfiguration -> 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 GetBucketInventoryConfiguration where
toQuery :: GetBucketInventoryConfiguration -> QueryString
toQuery GetBucketInventoryConfiguration' {Maybe Text
Text
BucketName
id :: Text
bucket :: BucketName
expectedBucketOwner :: Maybe Text
$sel:id:GetBucketInventoryConfiguration' :: GetBucketInventoryConfiguration -> Text
$sel:bucket:GetBucketInventoryConfiguration' :: GetBucketInventoryConfiguration -> BucketName
$sel:expectedBucketOwner:GetBucketInventoryConfiguration' :: GetBucketInventoryConfiguration -> 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 GetBucketInventoryConfigurationResponse = GetBucketInventoryConfigurationResponse'
{
GetBucketInventoryConfigurationResponse
-> Maybe InventoryConfiguration
inventoryConfiguration :: Prelude.Maybe InventoryConfiguration,
GetBucketInventoryConfigurationResponse -> Int
httpStatus :: Prelude.Int
}
deriving (GetBucketInventoryConfigurationResponse
-> GetBucketInventoryConfigurationResponse -> Bool
(GetBucketInventoryConfigurationResponse
-> GetBucketInventoryConfigurationResponse -> Bool)
-> (GetBucketInventoryConfigurationResponse
-> GetBucketInventoryConfigurationResponse -> Bool)
-> Eq GetBucketInventoryConfigurationResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetBucketInventoryConfigurationResponse
-> GetBucketInventoryConfigurationResponse -> Bool
$c/= :: GetBucketInventoryConfigurationResponse
-> GetBucketInventoryConfigurationResponse -> Bool
== :: GetBucketInventoryConfigurationResponse
-> GetBucketInventoryConfigurationResponse -> Bool
$c== :: GetBucketInventoryConfigurationResponse
-> GetBucketInventoryConfigurationResponse -> Bool
Prelude.Eq, Int -> GetBucketInventoryConfigurationResponse -> ShowS
[GetBucketInventoryConfigurationResponse] -> ShowS
GetBucketInventoryConfigurationResponse -> String
(Int -> GetBucketInventoryConfigurationResponse -> ShowS)
-> (GetBucketInventoryConfigurationResponse -> String)
-> ([GetBucketInventoryConfigurationResponse] -> ShowS)
-> Show GetBucketInventoryConfigurationResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetBucketInventoryConfigurationResponse] -> ShowS
$cshowList :: [GetBucketInventoryConfigurationResponse] -> ShowS
show :: GetBucketInventoryConfigurationResponse -> String
$cshow :: GetBucketInventoryConfigurationResponse -> String
showsPrec :: Int -> GetBucketInventoryConfigurationResponse -> ShowS
$cshowsPrec :: Int -> GetBucketInventoryConfigurationResponse -> ShowS
Prelude.Show, (forall x.
GetBucketInventoryConfigurationResponse
-> Rep GetBucketInventoryConfigurationResponse x)
-> (forall x.
Rep GetBucketInventoryConfigurationResponse x
-> GetBucketInventoryConfigurationResponse)
-> Generic GetBucketInventoryConfigurationResponse
forall x.
Rep GetBucketInventoryConfigurationResponse x
-> GetBucketInventoryConfigurationResponse
forall x.
GetBucketInventoryConfigurationResponse
-> Rep GetBucketInventoryConfigurationResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetBucketInventoryConfigurationResponse x
-> GetBucketInventoryConfigurationResponse
$cfrom :: forall x.
GetBucketInventoryConfigurationResponse
-> Rep GetBucketInventoryConfigurationResponse x
Prelude.Generic)
newGetBucketInventoryConfigurationResponse ::
Prelude.Int ->
GetBucketInventoryConfigurationResponse
newGetBucketInventoryConfigurationResponse :: Int -> GetBucketInventoryConfigurationResponse
newGetBucketInventoryConfigurationResponse
Int
pHttpStatus_ =
GetBucketInventoryConfigurationResponse' :: Maybe InventoryConfiguration
-> Int -> GetBucketInventoryConfigurationResponse
GetBucketInventoryConfigurationResponse'
{ $sel:inventoryConfiguration:GetBucketInventoryConfigurationResponse' :: Maybe InventoryConfiguration
inventoryConfiguration =
Maybe InventoryConfiguration
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:GetBucketInventoryConfigurationResponse' :: Int
httpStatus = Int
pHttpStatus_
}
getBucketInventoryConfigurationResponse_inventoryConfiguration :: Lens.Lens' GetBucketInventoryConfigurationResponse (Prelude.Maybe InventoryConfiguration)
getBucketInventoryConfigurationResponse_inventoryConfiguration :: (Maybe InventoryConfiguration -> f (Maybe InventoryConfiguration))
-> GetBucketInventoryConfigurationResponse
-> f GetBucketInventoryConfigurationResponse
getBucketInventoryConfigurationResponse_inventoryConfiguration = (GetBucketInventoryConfigurationResponse
-> Maybe InventoryConfiguration)
-> (GetBucketInventoryConfigurationResponse
-> Maybe InventoryConfiguration
-> GetBucketInventoryConfigurationResponse)
-> Lens
GetBucketInventoryConfigurationResponse
GetBucketInventoryConfigurationResponse
(Maybe InventoryConfiguration)
(Maybe InventoryConfiguration)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetBucketInventoryConfigurationResponse' {Maybe InventoryConfiguration
inventoryConfiguration :: Maybe InventoryConfiguration
$sel:inventoryConfiguration:GetBucketInventoryConfigurationResponse' :: GetBucketInventoryConfigurationResponse
-> Maybe InventoryConfiguration
inventoryConfiguration} -> Maybe InventoryConfiguration
inventoryConfiguration) (\s :: GetBucketInventoryConfigurationResponse
s@GetBucketInventoryConfigurationResponse' {} Maybe InventoryConfiguration
a -> GetBucketInventoryConfigurationResponse
s {$sel:inventoryConfiguration:GetBucketInventoryConfigurationResponse' :: Maybe InventoryConfiguration
inventoryConfiguration = Maybe InventoryConfiguration
a} :: GetBucketInventoryConfigurationResponse)
getBucketInventoryConfigurationResponse_httpStatus :: Lens.Lens' GetBucketInventoryConfigurationResponse Prelude.Int
getBucketInventoryConfigurationResponse_httpStatus :: (Int -> f Int)
-> GetBucketInventoryConfigurationResponse
-> f GetBucketInventoryConfigurationResponse
getBucketInventoryConfigurationResponse_httpStatus = (GetBucketInventoryConfigurationResponse -> Int)
-> (GetBucketInventoryConfigurationResponse
-> Int -> GetBucketInventoryConfigurationResponse)
-> Lens
GetBucketInventoryConfigurationResponse
GetBucketInventoryConfigurationResponse
Int
Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetBucketInventoryConfigurationResponse' {Int
httpStatus :: Int
$sel:httpStatus:GetBucketInventoryConfigurationResponse' :: GetBucketInventoryConfigurationResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: GetBucketInventoryConfigurationResponse
s@GetBucketInventoryConfigurationResponse' {} Int
a -> GetBucketInventoryConfigurationResponse
s {$sel:httpStatus:GetBucketInventoryConfigurationResponse' :: Int
httpStatus = Int
a} :: GetBucketInventoryConfigurationResponse)
instance
Prelude.NFData
GetBucketInventoryConfigurationResponse