{-# 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.GetBucketAccelerateConfiguration
(
GetBucketAccelerateConfiguration (..),
newGetBucketAccelerateConfiguration,
getBucketAccelerateConfiguration_expectedBucketOwner,
getBucketAccelerateConfiguration_bucket,
GetBucketAccelerateConfigurationResponse (..),
newGetBucketAccelerateConfigurationResponse,
getBucketAccelerateConfigurationResponse_status,
getBucketAccelerateConfigurationResponse_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 GetBucketAccelerateConfiguration = GetBucketAccelerateConfiguration'
{
GetBucketAccelerateConfiguration -> Maybe Text
expectedBucketOwner :: Prelude.Maybe Prelude.Text,
GetBucketAccelerateConfiguration -> BucketName
bucket :: BucketName
}
deriving (GetBucketAccelerateConfiguration
-> GetBucketAccelerateConfiguration -> Bool
(GetBucketAccelerateConfiguration
-> GetBucketAccelerateConfiguration -> Bool)
-> (GetBucketAccelerateConfiguration
-> GetBucketAccelerateConfiguration -> Bool)
-> Eq GetBucketAccelerateConfiguration
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetBucketAccelerateConfiguration
-> GetBucketAccelerateConfiguration -> Bool
$c/= :: GetBucketAccelerateConfiguration
-> GetBucketAccelerateConfiguration -> Bool
== :: GetBucketAccelerateConfiguration
-> GetBucketAccelerateConfiguration -> Bool
$c== :: GetBucketAccelerateConfiguration
-> GetBucketAccelerateConfiguration -> Bool
Prelude.Eq, ReadPrec [GetBucketAccelerateConfiguration]
ReadPrec GetBucketAccelerateConfiguration
Int -> ReadS GetBucketAccelerateConfiguration
ReadS [GetBucketAccelerateConfiguration]
(Int -> ReadS GetBucketAccelerateConfiguration)
-> ReadS [GetBucketAccelerateConfiguration]
-> ReadPrec GetBucketAccelerateConfiguration
-> ReadPrec [GetBucketAccelerateConfiguration]
-> Read GetBucketAccelerateConfiguration
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetBucketAccelerateConfiguration]
$creadListPrec :: ReadPrec [GetBucketAccelerateConfiguration]
readPrec :: ReadPrec GetBucketAccelerateConfiguration
$creadPrec :: ReadPrec GetBucketAccelerateConfiguration
readList :: ReadS [GetBucketAccelerateConfiguration]
$creadList :: ReadS [GetBucketAccelerateConfiguration]
readsPrec :: Int -> ReadS GetBucketAccelerateConfiguration
$creadsPrec :: Int -> ReadS GetBucketAccelerateConfiguration
Prelude.Read, Int -> GetBucketAccelerateConfiguration -> ShowS
[GetBucketAccelerateConfiguration] -> ShowS
GetBucketAccelerateConfiguration -> String
(Int -> GetBucketAccelerateConfiguration -> ShowS)
-> (GetBucketAccelerateConfiguration -> String)
-> ([GetBucketAccelerateConfiguration] -> ShowS)
-> Show GetBucketAccelerateConfiguration
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetBucketAccelerateConfiguration] -> ShowS
$cshowList :: [GetBucketAccelerateConfiguration] -> ShowS
show :: GetBucketAccelerateConfiguration -> String
$cshow :: GetBucketAccelerateConfiguration -> String
showsPrec :: Int -> GetBucketAccelerateConfiguration -> ShowS
$cshowsPrec :: Int -> GetBucketAccelerateConfiguration -> ShowS
Prelude.Show, (forall x.
GetBucketAccelerateConfiguration
-> Rep GetBucketAccelerateConfiguration x)
-> (forall x.
Rep GetBucketAccelerateConfiguration x
-> GetBucketAccelerateConfiguration)
-> Generic GetBucketAccelerateConfiguration
forall x.
Rep GetBucketAccelerateConfiguration x
-> GetBucketAccelerateConfiguration
forall x.
GetBucketAccelerateConfiguration
-> Rep GetBucketAccelerateConfiguration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetBucketAccelerateConfiguration x
-> GetBucketAccelerateConfiguration
$cfrom :: forall x.
GetBucketAccelerateConfiguration
-> Rep GetBucketAccelerateConfiguration x
Prelude.Generic)
newGetBucketAccelerateConfiguration ::
BucketName ->
GetBucketAccelerateConfiguration
newGetBucketAccelerateConfiguration :: BucketName -> GetBucketAccelerateConfiguration
newGetBucketAccelerateConfiguration BucketName
pBucket_ =
GetBucketAccelerateConfiguration' :: Maybe Text -> BucketName -> GetBucketAccelerateConfiguration
GetBucketAccelerateConfiguration'
{ $sel:expectedBucketOwner:GetBucketAccelerateConfiguration' :: Maybe Text
expectedBucketOwner =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:bucket:GetBucketAccelerateConfiguration' :: BucketName
bucket = BucketName
pBucket_
}
getBucketAccelerateConfiguration_expectedBucketOwner :: Lens.Lens' GetBucketAccelerateConfiguration (Prelude.Maybe Prelude.Text)
getBucketAccelerateConfiguration_expectedBucketOwner :: (Maybe Text -> f (Maybe Text))
-> GetBucketAccelerateConfiguration
-> f GetBucketAccelerateConfiguration
getBucketAccelerateConfiguration_expectedBucketOwner = (GetBucketAccelerateConfiguration -> Maybe Text)
-> (GetBucketAccelerateConfiguration
-> Maybe Text -> GetBucketAccelerateConfiguration)
-> Lens
GetBucketAccelerateConfiguration
GetBucketAccelerateConfiguration
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetBucketAccelerateConfiguration' {Maybe Text
expectedBucketOwner :: Maybe Text
$sel:expectedBucketOwner:GetBucketAccelerateConfiguration' :: GetBucketAccelerateConfiguration -> Maybe Text
expectedBucketOwner} -> Maybe Text
expectedBucketOwner) (\s :: GetBucketAccelerateConfiguration
s@GetBucketAccelerateConfiguration' {} Maybe Text
a -> GetBucketAccelerateConfiguration
s {$sel:expectedBucketOwner:GetBucketAccelerateConfiguration' :: Maybe Text
expectedBucketOwner = Maybe Text
a} :: GetBucketAccelerateConfiguration)
getBucketAccelerateConfiguration_bucket :: Lens.Lens' GetBucketAccelerateConfiguration BucketName
getBucketAccelerateConfiguration_bucket :: (BucketName -> f BucketName)
-> GetBucketAccelerateConfiguration
-> f GetBucketAccelerateConfiguration
getBucketAccelerateConfiguration_bucket = (GetBucketAccelerateConfiguration -> BucketName)
-> (GetBucketAccelerateConfiguration
-> BucketName -> GetBucketAccelerateConfiguration)
-> Lens
GetBucketAccelerateConfiguration
GetBucketAccelerateConfiguration
BucketName
BucketName
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetBucketAccelerateConfiguration' {BucketName
bucket :: BucketName
$sel:bucket:GetBucketAccelerateConfiguration' :: GetBucketAccelerateConfiguration -> BucketName
bucket} -> BucketName
bucket) (\s :: GetBucketAccelerateConfiguration
s@GetBucketAccelerateConfiguration' {} BucketName
a -> GetBucketAccelerateConfiguration
s {$sel:bucket:GetBucketAccelerateConfiguration' :: BucketName
bucket = BucketName
a} :: GetBucketAccelerateConfiguration)
instance
Core.AWSRequest
GetBucketAccelerateConfiguration
where
type
AWSResponse GetBucketAccelerateConfiguration =
GetBucketAccelerateConfigurationResponse
request :: GetBucketAccelerateConfiguration
-> Request GetBucketAccelerateConfiguration
request =
Request GetBucketAccelerateConfiguration
-> Request GetBucketAccelerateConfiguration
forall a. Request a -> Request a
Request.s3vhost
(Request GetBucketAccelerateConfiguration
-> Request GetBucketAccelerateConfiguration)
-> (GetBucketAccelerateConfiguration
-> Request GetBucketAccelerateConfiguration)
-> GetBucketAccelerateConfiguration
-> Request GetBucketAccelerateConfiguration
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. Service
-> GetBucketAccelerateConfiguration
-> Request GetBucketAccelerateConfiguration
forall a. ToRequest a => Service -> a -> Request a
Request.get Service
defaultService
response :: Logger
-> Service
-> Proxy GetBucketAccelerateConfiguration
-> ClientResponse ClientBody
-> m (Either
Error
(ClientResponse (AWSResponse GetBucketAccelerateConfiguration)))
response =
(Int
-> ResponseHeaders
-> [Node]
-> Either String (AWSResponse GetBucketAccelerateConfiguration))
-> Logger
-> Service
-> Proxy GetBucketAccelerateConfiguration
-> ClientResponse ClientBody
-> m (Either
Error
(ClientResponse (AWSResponse GetBucketAccelerateConfiguration)))
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 BucketAccelerateStatus
-> Int -> GetBucketAccelerateConfigurationResponse
GetBucketAccelerateConfigurationResponse'
(Maybe BucketAccelerateStatus
-> Int -> GetBucketAccelerateConfigurationResponse)
-> Either String (Maybe BucketAccelerateStatus)
-> Either String (Int -> GetBucketAccelerateConfigurationResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x [Node] -> Text -> Either String (Maybe BucketAccelerateStatus)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"Status")
Either String (Int -> GetBucketAccelerateConfigurationResponse)
-> Either String Int
-> Either String GetBucketAccelerateConfigurationResponse
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
GetBucketAccelerateConfiguration
instance
Prelude.NFData
GetBucketAccelerateConfiguration
instance
Core.ToHeaders
GetBucketAccelerateConfiguration
where
toHeaders :: GetBucketAccelerateConfiguration -> ResponseHeaders
toHeaders GetBucketAccelerateConfiguration' {Maybe Text
BucketName
bucket :: BucketName
expectedBucketOwner :: Maybe Text
$sel:bucket:GetBucketAccelerateConfiguration' :: GetBucketAccelerateConfiguration -> BucketName
$sel:expectedBucketOwner:GetBucketAccelerateConfiguration' :: GetBucketAccelerateConfiguration -> 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 GetBucketAccelerateConfiguration where
toPath :: GetBucketAccelerateConfiguration -> ByteString
toPath GetBucketAccelerateConfiguration' {Maybe Text
BucketName
bucket :: BucketName
expectedBucketOwner :: Maybe Text
$sel:bucket:GetBucketAccelerateConfiguration' :: GetBucketAccelerateConfiguration -> BucketName
$sel:expectedBucketOwner:GetBucketAccelerateConfiguration' :: GetBucketAccelerateConfiguration -> 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
GetBucketAccelerateConfiguration
where
toQuery :: GetBucketAccelerateConfiguration -> QueryString
toQuery =
QueryString -> GetBucketAccelerateConfiguration -> QueryString
forall a b. a -> b -> a
Prelude.const ([QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat [QueryString
"accelerate"])
data GetBucketAccelerateConfigurationResponse = GetBucketAccelerateConfigurationResponse'
{
GetBucketAccelerateConfigurationResponse
-> Maybe BucketAccelerateStatus
status :: Prelude.Maybe BucketAccelerateStatus,
GetBucketAccelerateConfigurationResponse -> Int
httpStatus :: Prelude.Int
}
deriving (GetBucketAccelerateConfigurationResponse
-> GetBucketAccelerateConfigurationResponse -> Bool
(GetBucketAccelerateConfigurationResponse
-> GetBucketAccelerateConfigurationResponse -> Bool)
-> (GetBucketAccelerateConfigurationResponse
-> GetBucketAccelerateConfigurationResponse -> Bool)
-> Eq GetBucketAccelerateConfigurationResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetBucketAccelerateConfigurationResponse
-> GetBucketAccelerateConfigurationResponse -> Bool
$c/= :: GetBucketAccelerateConfigurationResponse
-> GetBucketAccelerateConfigurationResponse -> Bool
== :: GetBucketAccelerateConfigurationResponse
-> GetBucketAccelerateConfigurationResponse -> Bool
$c== :: GetBucketAccelerateConfigurationResponse
-> GetBucketAccelerateConfigurationResponse -> Bool
Prelude.Eq, ReadPrec [GetBucketAccelerateConfigurationResponse]
ReadPrec GetBucketAccelerateConfigurationResponse
Int -> ReadS GetBucketAccelerateConfigurationResponse
ReadS [GetBucketAccelerateConfigurationResponse]
(Int -> ReadS GetBucketAccelerateConfigurationResponse)
-> ReadS [GetBucketAccelerateConfigurationResponse]
-> ReadPrec GetBucketAccelerateConfigurationResponse
-> ReadPrec [GetBucketAccelerateConfigurationResponse]
-> Read GetBucketAccelerateConfigurationResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetBucketAccelerateConfigurationResponse]
$creadListPrec :: ReadPrec [GetBucketAccelerateConfigurationResponse]
readPrec :: ReadPrec GetBucketAccelerateConfigurationResponse
$creadPrec :: ReadPrec GetBucketAccelerateConfigurationResponse
readList :: ReadS [GetBucketAccelerateConfigurationResponse]
$creadList :: ReadS [GetBucketAccelerateConfigurationResponse]
readsPrec :: Int -> ReadS GetBucketAccelerateConfigurationResponse
$creadsPrec :: Int -> ReadS GetBucketAccelerateConfigurationResponse
Prelude.Read, Int -> GetBucketAccelerateConfigurationResponse -> ShowS
[GetBucketAccelerateConfigurationResponse] -> ShowS
GetBucketAccelerateConfigurationResponse -> String
(Int -> GetBucketAccelerateConfigurationResponse -> ShowS)
-> (GetBucketAccelerateConfigurationResponse -> String)
-> ([GetBucketAccelerateConfigurationResponse] -> ShowS)
-> Show GetBucketAccelerateConfigurationResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetBucketAccelerateConfigurationResponse] -> ShowS
$cshowList :: [GetBucketAccelerateConfigurationResponse] -> ShowS
show :: GetBucketAccelerateConfigurationResponse -> String
$cshow :: GetBucketAccelerateConfigurationResponse -> String
showsPrec :: Int -> GetBucketAccelerateConfigurationResponse -> ShowS
$cshowsPrec :: Int -> GetBucketAccelerateConfigurationResponse -> ShowS
Prelude.Show, (forall x.
GetBucketAccelerateConfigurationResponse
-> Rep GetBucketAccelerateConfigurationResponse x)
-> (forall x.
Rep GetBucketAccelerateConfigurationResponse x
-> GetBucketAccelerateConfigurationResponse)
-> Generic GetBucketAccelerateConfigurationResponse
forall x.
Rep GetBucketAccelerateConfigurationResponse x
-> GetBucketAccelerateConfigurationResponse
forall x.
GetBucketAccelerateConfigurationResponse
-> Rep GetBucketAccelerateConfigurationResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetBucketAccelerateConfigurationResponse x
-> GetBucketAccelerateConfigurationResponse
$cfrom :: forall x.
GetBucketAccelerateConfigurationResponse
-> Rep GetBucketAccelerateConfigurationResponse x
Prelude.Generic)
newGetBucketAccelerateConfigurationResponse ::
Prelude.Int ->
GetBucketAccelerateConfigurationResponse
newGetBucketAccelerateConfigurationResponse :: Int -> GetBucketAccelerateConfigurationResponse
newGetBucketAccelerateConfigurationResponse
Int
pHttpStatus_ =
GetBucketAccelerateConfigurationResponse' :: Maybe BucketAccelerateStatus
-> Int -> GetBucketAccelerateConfigurationResponse
GetBucketAccelerateConfigurationResponse'
{ $sel:status:GetBucketAccelerateConfigurationResponse' :: Maybe BucketAccelerateStatus
status =
Maybe BucketAccelerateStatus
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:GetBucketAccelerateConfigurationResponse' :: Int
httpStatus = Int
pHttpStatus_
}
getBucketAccelerateConfigurationResponse_status :: Lens.Lens' GetBucketAccelerateConfigurationResponse (Prelude.Maybe BucketAccelerateStatus)
getBucketAccelerateConfigurationResponse_status :: (Maybe BucketAccelerateStatus -> f (Maybe BucketAccelerateStatus))
-> GetBucketAccelerateConfigurationResponse
-> f GetBucketAccelerateConfigurationResponse
getBucketAccelerateConfigurationResponse_status = (GetBucketAccelerateConfigurationResponse
-> Maybe BucketAccelerateStatus)
-> (GetBucketAccelerateConfigurationResponse
-> Maybe BucketAccelerateStatus
-> GetBucketAccelerateConfigurationResponse)
-> Lens
GetBucketAccelerateConfigurationResponse
GetBucketAccelerateConfigurationResponse
(Maybe BucketAccelerateStatus)
(Maybe BucketAccelerateStatus)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetBucketAccelerateConfigurationResponse' {Maybe BucketAccelerateStatus
status :: Maybe BucketAccelerateStatus
$sel:status:GetBucketAccelerateConfigurationResponse' :: GetBucketAccelerateConfigurationResponse
-> Maybe BucketAccelerateStatus
status} -> Maybe BucketAccelerateStatus
status) (\s :: GetBucketAccelerateConfigurationResponse
s@GetBucketAccelerateConfigurationResponse' {} Maybe BucketAccelerateStatus
a -> GetBucketAccelerateConfigurationResponse
s {$sel:status:GetBucketAccelerateConfigurationResponse' :: Maybe BucketAccelerateStatus
status = Maybe BucketAccelerateStatus
a} :: GetBucketAccelerateConfigurationResponse)
getBucketAccelerateConfigurationResponse_httpStatus :: Lens.Lens' GetBucketAccelerateConfigurationResponse Prelude.Int
getBucketAccelerateConfigurationResponse_httpStatus :: (Int -> f Int)
-> GetBucketAccelerateConfigurationResponse
-> f GetBucketAccelerateConfigurationResponse
getBucketAccelerateConfigurationResponse_httpStatus = (GetBucketAccelerateConfigurationResponse -> Int)
-> (GetBucketAccelerateConfigurationResponse
-> Int -> GetBucketAccelerateConfigurationResponse)
-> Lens
GetBucketAccelerateConfigurationResponse
GetBucketAccelerateConfigurationResponse
Int
Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetBucketAccelerateConfigurationResponse' {Int
httpStatus :: Int
$sel:httpStatus:GetBucketAccelerateConfigurationResponse' :: GetBucketAccelerateConfigurationResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: GetBucketAccelerateConfigurationResponse
s@GetBucketAccelerateConfigurationResponse' {} Int
a -> GetBucketAccelerateConfigurationResponse
s {$sel:httpStatus:GetBucketAccelerateConfigurationResponse' :: Int
httpStatus = Int
a} :: GetBucketAccelerateConfigurationResponse)
instance
Prelude.NFData
GetBucketAccelerateConfigurationResponse