{-# 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.GetBucketAnalyticsConfiguration
(
GetBucketAnalyticsConfiguration (..),
newGetBucketAnalyticsConfiguration,
getBucketAnalyticsConfiguration_expectedBucketOwner,
getBucketAnalyticsConfiguration_bucket,
getBucketAnalyticsConfiguration_id,
GetBucketAnalyticsConfigurationResponse (..),
newGetBucketAnalyticsConfigurationResponse,
getBucketAnalyticsConfigurationResponse_analyticsConfiguration,
getBucketAnalyticsConfigurationResponse_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 GetBucketAnalyticsConfiguration = GetBucketAnalyticsConfiguration'
{
GetBucketAnalyticsConfiguration -> Maybe Text
expectedBucketOwner :: Prelude.Maybe Prelude.Text,
GetBucketAnalyticsConfiguration -> BucketName
bucket :: BucketName,
GetBucketAnalyticsConfiguration -> Text
id :: Prelude.Text
}
deriving (GetBucketAnalyticsConfiguration
-> GetBucketAnalyticsConfiguration -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetBucketAnalyticsConfiguration
-> GetBucketAnalyticsConfiguration -> Bool
$c/= :: GetBucketAnalyticsConfiguration
-> GetBucketAnalyticsConfiguration -> Bool
== :: GetBucketAnalyticsConfiguration
-> GetBucketAnalyticsConfiguration -> Bool
$c== :: GetBucketAnalyticsConfiguration
-> GetBucketAnalyticsConfiguration -> Bool
Prelude.Eq, ReadPrec [GetBucketAnalyticsConfiguration]
ReadPrec GetBucketAnalyticsConfiguration
Int -> ReadS GetBucketAnalyticsConfiguration
ReadS [GetBucketAnalyticsConfiguration]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetBucketAnalyticsConfiguration]
$creadListPrec :: ReadPrec [GetBucketAnalyticsConfiguration]
readPrec :: ReadPrec GetBucketAnalyticsConfiguration
$creadPrec :: ReadPrec GetBucketAnalyticsConfiguration
readList :: ReadS [GetBucketAnalyticsConfiguration]
$creadList :: ReadS [GetBucketAnalyticsConfiguration]
readsPrec :: Int -> ReadS GetBucketAnalyticsConfiguration
$creadsPrec :: Int -> ReadS GetBucketAnalyticsConfiguration
Prelude.Read, Int -> GetBucketAnalyticsConfiguration -> ShowS
[GetBucketAnalyticsConfiguration] -> ShowS
GetBucketAnalyticsConfiguration -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetBucketAnalyticsConfiguration] -> ShowS
$cshowList :: [GetBucketAnalyticsConfiguration] -> ShowS
show :: GetBucketAnalyticsConfiguration -> String
$cshow :: GetBucketAnalyticsConfiguration -> String
showsPrec :: Int -> GetBucketAnalyticsConfiguration -> ShowS
$cshowsPrec :: Int -> GetBucketAnalyticsConfiguration -> ShowS
Prelude.Show, forall x.
Rep GetBucketAnalyticsConfiguration x
-> GetBucketAnalyticsConfiguration
forall x.
GetBucketAnalyticsConfiguration
-> Rep GetBucketAnalyticsConfiguration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetBucketAnalyticsConfiguration x
-> GetBucketAnalyticsConfiguration
$cfrom :: forall x.
GetBucketAnalyticsConfiguration
-> Rep GetBucketAnalyticsConfiguration x
Prelude.Generic)
newGetBucketAnalyticsConfiguration ::
BucketName ->
Prelude.Text ->
GetBucketAnalyticsConfiguration
newGetBucketAnalyticsConfiguration :: BucketName -> Text -> GetBucketAnalyticsConfiguration
newGetBucketAnalyticsConfiguration BucketName
pBucket_ Text
pId_ =
GetBucketAnalyticsConfiguration'
{ $sel:expectedBucketOwner:GetBucketAnalyticsConfiguration' :: Maybe Text
expectedBucketOwner =
forall a. Maybe a
Prelude.Nothing,
$sel:bucket:GetBucketAnalyticsConfiguration' :: BucketName
bucket = BucketName
pBucket_,
$sel:id:GetBucketAnalyticsConfiguration' :: Text
id = Text
pId_
}
getBucketAnalyticsConfiguration_expectedBucketOwner :: Lens.Lens' GetBucketAnalyticsConfiguration (Prelude.Maybe Prelude.Text)
getBucketAnalyticsConfiguration_expectedBucketOwner :: Lens' GetBucketAnalyticsConfiguration (Maybe Text)
getBucketAnalyticsConfiguration_expectedBucketOwner = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetBucketAnalyticsConfiguration' {Maybe Text
expectedBucketOwner :: Maybe Text
$sel:expectedBucketOwner:GetBucketAnalyticsConfiguration' :: GetBucketAnalyticsConfiguration -> Maybe Text
expectedBucketOwner} -> Maybe Text
expectedBucketOwner) (\s :: GetBucketAnalyticsConfiguration
s@GetBucketAnalyticsConfiguration' {} Maybe Text
a -> GetBucketAnalyticsConfiguration
s {$sel:expectedBucketOwner:GetBucketAnalyticsConfiguration' :: Maybe Text
expectedBucketOwner = Maybe Text
a} :: GetBucketAnalyticsConfiguration)
getBucketAnalyticsConfiguration_bucket :: Lens.Lens' GetBucketAnalyticsConfiguration BucketName
getBucketAnalyticsConfiguration_bucket :: Lens' GetBucketAnalyticsConfiguration BucketName
getBucketAnalyticsConfiguration_bucket = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetBucketAnalyticsConfiguration' {BucketName
bucket :: BucketName
$sel:bucket:GetBucketAnalyticsConfiguration' :: GetBucketAnalyticsConfiguration -> BucketName
bucket} -> BucketName
bucket) (\s :: GetBucketAnalyticsConfiguration
s@GetBucketAnalyticsConfiguration' {} BucketName
a -> GetBucketAnalyticsConfiguration
s {$sel:bucket:GetBucketAnalyticsConfiguration' :: BucketName
bucket = BucketName
a} :: GetBucketAnalyticsConfiguration)
getBucketAnalyticsConfiguration_id :: Lens.Lens' GetBucketAnalyticsConfiguration Prelude.Text
getBucketAnalyticsConfiguration_id :: Lens' GetBucketAnalyticsConfiguration Text
getBucketAnalyticsConfiguration_id = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetBucketAnalyticsConfiguration' {Text
id :: Text
$sel:id:GetBucketAnalyticsConfiguration' :: GetBucketAnalyticsConfiguration -> Text
id} -> Text
id) (\s :: GetBucketAnalyticsConfiguration
s@GetBucketAnalyticsConfiguration' {} Text
a -> GetBucketAnalyticsConfiguration
s {$sel:id:GetBucketAnalyticsConfiguration' :: Text
id = Text
a} :: GetBucketAnalyticsConfiguration)
instance
Core.AWSRequest
GetBucketAnalyticsConfiguration
where
type
AWSResponse GetBucketAnalyticsConfiguration =
GetBucketAnalyticsConfigurationResponse
request :: (Service -> Service)
-> GetBucketAnalyticsConfiguration
-> Request GetBucketAnalyticsConfiguration
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 GetBucketAnalyticsConfiguration
-> ClientResponse ClientBody
-> m (Either
Error
(ClientResponse (AWSResponse GetBucketAnalyticsConfiguration)))
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 AnalyticsConfiguration
-> Int -> GetBucketAnalyticsConfigurationResponse
GetBucketAnalyticsConfigurationResponse'
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
GetBucketAnalyticsConfiguration
where
hashWithSalt :: Int -> GetBucketAnalyticsConfiguration -> Int
hashWithSalt
Int
_salt
GetBucketAnalyticsConfiguration' {Maybe Text
Text
BucketName
id :: Text
bucket :: BucketName
expectedBucketOwner :: Maybe Text
$sel:id:GetBucketAnalyticsConfiguration' :: GetBucketAnalyticsConfiguration -> Text
$sel:bucket:GetBucketAnalyticsConfiguration' :: GetBucketAnalyticsConfiguration -> BucketName
$sel:expectedBucketOwner:GetBucketAnalyticsConfiguration' :: GetBucketAnalyticsConfiguration -> 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
GetBucketAnalyticsConfiguration
where
rnf :: GetBucketAnalyticsConfiguration -> ()
rnf GetBucketAnalyticsConfiguration' {Maybe Text
Text
BucketName
id :: Text
bucket :: BucketName
expectedBucketOwner :: Maybe Text
$sel:id:GetBucketAnalyticsConfiguration' :: GetBucketAnalyticsConfiguration -> Text
$sel:bucket:GetBucketAnalyticsConfiguration' :: GetBucketAnalyticsConfiguration -> BucketName
$sel:expectedBucketOwner:GetBucketAnalyticsConfiguration' :: GetBucketAnalyticsConfiguration -> 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
GetBucketAnalyticsConfiguration
where
toHeaders :: GetBucketAnalyticsConfiguration -> ResponseHeaders
toHeaders GetBucketAnalyticsConfiguration' {Maybe Text
Text
BucketName
id :: Text
bucket :: BucketName
expectedBucketOwner :: Maybe Text
$sel:id:GetBucketAnalyticsConfiguration' :: GetBucketAnalyticsConfiguration -> Text
$sel:bucket:GetBucketAnalyticsConfiguration' :: GetBucketAnalyticsConfiguration -> BucketName
$sel:expectedBucketOwner:GetBucketAnalyticsConfiguration' :: GetBucketAnalyticsConfiguration -> 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 GetBucketAnalyticsConfiguration where
toPath :: GetBucketAnalyticsConfiguration -> ByteString
toPath GetBucketAnalyticsConfiguration' {Maybe Text
Text
BucketName
id :: Text
bucket :: BucketName
expectedBucketOwner :: Maybe Text
$sel:id:GetBucketAnalyticsConfiguration' :: GetBucketAnalyticsConfiguration -> Text
$sel:bucket:GetBucketAnalyticsConfiguration' :: GetBucketAnalyticsConfiguration -> BucketName
$sel:expectedBucketOwner:GetBucketAnalyticsConfiguration' :: GetBucketAnalyticsConfiguration -> Maybe Text
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat [ByteString
"/", forall a. ToByteString a => a -> ByteString
Data.toBS BucketName
bucket]
instance Data.ToQuery GetBucketAnalyticsConfiguration where
toQuery :: GetBucketAnalyticsConfiguration -> QueryString
toQuery GetBucketAnalyticsConfiguration' {Maybe Text
Text
BucketName
id :: Text
bucket :: BucketName
expectedBucketOwner :: Maybe Text
$sel:id:GetBucketAnalyticsConfiguration' :: GetBucketAnalyticsConfiguration -> Text
$sel:bucket:GetBucketAnalyticsConfiguration' :: GetBucketAnalyticsConfiguration -> BucketName
$sel:expectedBucketOwner:GetBucketAnalyticsConfiguration' :: GetBucketAnalyticsConfiguration -> Maybe Text
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat [ByteString
"id" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Text
id, QueryString
"analytics"]
data GetBucketAnalyticsConfigurationResponse = GetBucketAnalyticsConfigurationResponse'
{
GetBucketAnalyticsConfigurationResponse
-> Maybe AnalyticsConfiguration
analyticsConfiguration :: Prelude.Maybe AnalyticsConfiguration,
GetBucketAnalyticsConfigurationResponse -> Int
httpStatus :: Prelude.Int
}
deriving (GetBucketAnalyticsConfigurationResponse
-> GetBucketAnalyticsConfigurationResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetBucketAnalyticsConfigurationResponse
-> GetBucketAnalyticsConfigurationResponse -> Bool
$c/= :: GetBucketAnalyticsConfigurationResponse
-> GetBucketAnalyticsConfigurationResponse -> Bool
== :: GetBucketAnalyticsConfigurationResponse
-> GetBucketAnalyticsConfigurationResponse -> Bool
$c== :: GetBucketAnalyticsConfigurationResponse
-> GetBucketAnalyticsConfigurationResponse -> Bool
Prelude.Eq, ReadPrec [GetBucketAnalyticsConfigurationResponse]
ReadPrec GetBucketAnalyticsConfigurationResponse
Int -> ReadS GetBucketAnalyticsConfigurationResponse
ReadS [GetBucketAnalyticsConfigurationResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetBucketAnalyticsConfigurationResponse]
$creadListPrec :: ReadPrec [GetBucketAnalyticsConfigurationResponse]
readPrec :: ReadPrec GetBucketAnalyticsConfigurationResponse
$creadPrec :: ReadPrec GetBucketAnalyticsConfigurationResponse
readList :: ReadS [GetBucketAnalyticsConfigurationResponse]
$creadList :: ReadS [GetBucketAnalyticsConfigurationResponse]
readsPrec :: Int -> ReadS GetBucketAnalyticsConfigurationResponse
$creadsPrec :: Int -> ReadS GetBucketAnalyticsConfigurationResponse
Prelude.Read, Int -> GetBucketAnalyticsConfigurationResponse -> ShowS
[GetBucketAnalyticsConfigurationResponse] -> ShowS
GetBucketAnalyticsConfigurationResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetBucketAnalyticsConfigurationResponse] -> ShowS
$cshowList :: [GetBucketAnalyticsConfigurationResponse] -> ShowS
show :: GetBucketAnalyticsConfigurationResponse -> String
$cshow :: GetBucketAnalyticsConfigurationResponse -> String
showsPrec :: Int -> GetBucketAnalyticsConfigurationResponse -> ShowS
$cshowsPrec :: Int -> GetBucketAnalyticsConfigurationResponse -> ShowS
Prelude.Show, forall x.
Rep GetBucketAnalyticsConfigurationResponse x
-> GetBucketAnalyticsConfigurationResponse
forall x.
GetBucketAnalyticsConfigurationResponse
-> Rep GetBucketAnalyticsConfigurationResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetBucketAnalyticsConfigurationResponse x
-> GetBucketAnalyticsConfigurationResponse
$cfrom :: forall x.
GetBucketAnalyticsConfigurationResponse
-> Rep GetBucketAnalyticsConfigurationResponse x
Prelude.Generic)
newGetBucketAnalyticsConfigurationResponse ::
Prelude.Int ->
GetBucketAnalyticsConfigurationResponse
newGetBucketAnalyticsConfigurationResponse :: Int -> GetBucketAnalyticsConfigurationResponse
newGetBucketAnalyticsConfigurationResponse
Int
pHttpStatus_ =
GetBucketAnalyticsConfigurationResponse'
{ $sel:analyticsConfiguration:GetBucketAnalyticsConfigurationResponse' :: Maybe AnalyticsConfiguration
analyticsConfiguration =
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:GetBucketAnalyticsConfigurationResponse' :: Int
httpStatus = Int
pHttpStatus_
}
getBucketAnalyticsConfigurationResponse_analyticsConfiguration :: Lens.Lens' GetBucketAnalyticsConfigurationResponse (Prelude.Maybe AnalyticsConfiguration)
getBucketAnalyticsConfigurationResponse_analyticsConfiguration :: Lens'
GetBucketAnalyticsConfigurationResponse
(Maybe AnalyticsConfiguration)
getBucketAnalyticsConfigurationResponse_analyticsConfiguration = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetBucketAnalyticsConfigurationResponse' {Maybe AnalyticsConfiguration
analyticsConfiguration :: Maybe AnalyticsConfiguration
$sel:analyticsConfiguration:GetBucketAnalyticsConfigurationResponse' :: GetBucketAnalyticsConfigurationResponse
-> Maybe AnalyticsConfiguration
analyticsConfiguration} -> Maybe AnalyticsConfiguration
analyticsConfiguration) (\s :: GetBucketAnalyticsConfigurationResponse
s@GetBucketAnalyticsConfigurationResponse' {} Maybe AnalyticsConfiguration
a -> GetBucketAnalyticsConfigurationResponse
s {$sel:analyticsConfiguration:GetBucketAnalyticsConfigurationResponse' :: Maybe AnalyticsConfiguration
analyticsConfiguration = Maybe AnalyticsConfiguration
a} :: GetBucketAnalyticsConfigurationResponse)
getBucketAnalyticsConfigurationResponse_httpStatus :: Lens.Lens' GetBucketAnalyticsConfigurationResponse Prelude.Int
getBucketAnalyticsConfigurationResponse_httpStatus :: Lens' GetBucketAnalyticsConfigurationResponse Int
getBucketAnalyticsConfigurationResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetBucketAnalyticsConfigurationResponse' {Int
httpStatus :: Int
$sel:httpStatus:GetBucketAnalyticsConfigurationResponse' :: GetBucketAnalyticsConfigurationResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: GetBucketAnalyticsConfigurationResponse
s@GetBucketAnalyticsConfigurationResponse' {} Int
a -> GetBucketAnalyticsConfigurationResponse
s {$sel:httpStatus:GetBucketAnalyticsConfigurationResponse' :: Int
httpStatus = Int
a} :: GetBucketAnalyticsConfigurationResponse)
instance
Prelude.NFData
GetBucketAnalyticsConfigurationResponse
where
rnf :: GetBucketAnalyticsConfigurationResponse -> ()
rnf GetBucketAnalyticsConfigurationResponse' {Int
Maybe AnalyticsConfiguration
httpStatus :: Int
analyticsConfiguration :: Maybe AnalyticsConfiguration
$sel:httpStatus:GetBucketAnalyticsConfigurationResponse' :: GetBucketAnalyticsConfigurationResponse -> Int
$sel:analyticsConfiguration:GetBucketAnalyticsConfigurationResponse' :: GetBucketAnalyticsConfigurationResponse
-> Maybe AnalyticsConfiguration
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe AnalyticsConfiguration
analyticsConfiguration
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus