{-# 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.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
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
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]
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
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.
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'
{ $sel:expectedBucketOwner:GetBucketInventoryConfiguration' :: Maybe Text
expectedBucketOwner =
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 :: Lens' GetBucketInventoryConfiguration (Maybe Text)
getBucketInventoryConfiguration_expectedBucketOwner = 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 :: Lens' GetBucketInventoryConfiguration BucketName
getBucketInventoryConfiguration_bucket = 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 :: Lens' GetBucketInventoryConfiguration Text
getBucketInventoryConfiguration_id = 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 :: (Service -> Service)
-> GetBucketInventoryConfiguration
-> Request GetBucketInventoryConfiguration
request Service -> Service
overrides =
forall a. Request a -> Request a
Request.s3vhost
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a. ToRequest a => Service -> a -> Request a
Request.get (Service -> Service
overrides Service
defaultService)
response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy GetBucketInventoryConfiguration
-> ClientResponse ClientBody
-> m (Either
Error
(ClientResponse (AWSResponse GetBucketInventoryConfiguration)))
response =
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> [Node] -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveXML
( \Int
s ResponseHeaders
h [Node]
x ->
Maybe InventoryConfiguration
-> Int -> GetBucketInventoryConfigurationResponse
GetBucketInventoryConfigurationResponse'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (forall a. FromXML a => [Node] -> Either String a
Data.parseXML [Node]
x)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
)
instance
Prelude.Hashable
GetBucketInventoryConfiguration
where
hashWithSalt :: Int -> GetBucketInventoryConfiguration -> Int
hashWithSalt
Int
_salt
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
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
expectedBucketOwner
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` BucketName
bucket
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
id
instance
Prelude.NFData
GetBucketInventoryConfiguration
where
rnf :: GetBucketInventoryConfiguration -> ()
rnf 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
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
expectedBucketOwner
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf BucketName
bucket
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
id
instance
Data.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
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"x-amz-expected-bucket-owner"
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# Maybe Text
expectedBucketOwner
]
instance Data.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
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat [ByteString
"/", forall a. ToByteString a => a -> ByteString
Data.toBS BucketName
bucket]
instance Data.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
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat [ByteString
"id" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Text
id, QueryString
"inventory"]
data GetBucketInventoryConfigurationResponse = GetBucketInventoryConfigurationResponse'
{
GetBucketInventoryConfigurationResponse
-> Maybe InventoryConfiguration
inventoryConfiguration :: Prelude.Maybe InventoryConfiguration,
GetBucketInventoryConfigurationResponse -> Int
httpStatus :: Prelude.Int
}
deriving (GetBucketInventoryConfigurationResponse
-> GetBucketInventoryConfigurationResponse -> Bool
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
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.
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'
{ $sel:inventoryConfiguration:GetBucketInventoryConfigurationResponse' :: Maybe InventoryConfiguration
inventoryConfiguration =
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:GetBucketInventoryConfigurationResponse' :: Int
httpStatus = Int
pHttpStatus_
}
getBucketInventoryConfigurationResponse_inventoryConfiguration :: Lens.Lens' GetBucketInventoryConfigurationResponse (Prelude.Maybe InventoryConfiguration)
getBucketInventoryConfigurationResponse_inventoryConfiguration :: Lens'
GetBucketInventoryConfigurationResponse
(Maybe InventoryConfiguration)
getBucketInventoryConfigurationResponse_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 :: Lens' GetBucketInventoryConfigurationResponse Int
getBucketInventoryConfigurationResponse_httpStatus = 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
where
rnf :: GetBucketInventoryConfigurationResponse -> ()
rnf GetBucketInventoryConfigurationResponse' {Int
Maybe InventoryConfiguration
httpStatus :: Int
inventoryConfiguration :: Maybe InventoryConfiguration
$sel:httpStatus:GetBucketInventoryConfigurationResponse' :: GetBucketInventoryConfigurationResponse -> Int
$sel:inventoryConfiguration:GetBucketInventoryConfigurationResponse' :: GetBucketInventoryConfigurationResponse
-> Maybe InventoryConfiguration
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe InventoryConfiguration
inventoryConfiguration
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus