{-# 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.CreateBucket
(
CreateBucket (..),
newCreateBucket,
createBucket_grantReadACP,
createBucket_objectLockEnabledForBucket,
createBucket_grantWriteACP,
createBucket_grantRead,
createBucket_grantFullControl,
createBucket_createBucketConfiguration,
createBucket_grantWrite,
createBucket_acl,
createBucket_bucket,
CreateBucketResponse (..),
newCreateBucketResponse,
createBucketResponse_location,
createBucketResponse_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 CreateBucket = CreateBucket'
{
CreateBucket -> Maybe Text
grantReadACP :: Prelude.Maybe Prelude.Text,
CreateBucket -> Maybe Bool
objectLockEnabledForBucket :: Prelude.Maybe Prelude.Bool,
CreateBucket -> Maybe Text
grantWriteACP :: Prelude.Maybe Prelude.Text,
CreateBucket -> Maybe Text
grantRead :: Prelude.Maybe Prelude.Text,
CreateBucket -> Maybe Text
grantFullControl :: Prelude.Maybe Prelude.Text,
CreateBucket -> Maybe CreateBucketConfiguration
createBucketConfiguration :: Prelude.Maybe CreateBucketConfiguration,
CreateBucket -> Maybe Text
grantWrite :: Prelude.Maybe Prelude.Text,
CreateBucket -> Maybe BucketCannedACL
acl :: Prelude.Maybe BucketCannedACL,
CreateBucket -> BucketName
bucket :: BucketName
}
deriving (CreateBucket -> CreateBucket -> Bool
(CreateBucket -> CreateBucket -> Bool)
-> (CreateBucket -> CreateBucket -> Bool) -> Eq CreateBucket
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateBucket -> CreateBucket -> Bool
$c/= :: CreateBucket -> CreateBucket -> Bool
== :: CreateBucket -> CreateBucket -> Bool
$c== :: CreateBucket -> CreateBucket -> Bool
Prelude.Eq, ReadPrec [CreateBucket]
ReadPrec CreateBucket
Int -> ReadS CreateBucket
ReadS [CreateBucket]
(Int -> ReadS CreateBucket)
-> ReadS [CreateBucket]
-> ReadPrec CreateBucket
-> ReadPrec [CreateBucket]
-> Read CreateBucket
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateBucket]
$creadListPrec :: ReadPrec [CreateBucket]
readPrec :: ReadPrec CreateBucket
$creadPrec :: ReadPrec CreateBucket
readList :: ReadS [CreateBucket]
$creadList :: ReadS [CreateBucket]
readsPrec :: Int -> ReadS CreateBucket
$creadsPrec :: Int -> ReadS CreateBucket
Prelude.Read, Int -> CreateBucket -> ShowS
[CreateBucket] -> ShowS
CreateBucket -> String
(Int -> CreateBucket -> ShowS)
-> (CreateBucket -> String)
-> ([CreateBucket] -> ShowS)
-> Show CreateBucket
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateBucket] -> ShowS
$cshowList :: [CreateBucket] -> ShowS
show :: CreateBucket -> String
$cshow :: CreateBucket -> String
showsPrec :: Int -> CreateBucket -> ShowS
$cshowsPrec :: Int -> CreateBucket -> ShowS
Prelude.Show, (forall x. CreateBucket -> Rep CreateBucket x)
-> (forall x. Rep CreateBucket x -> CreateBucket)
-> Generic CreateBucket
forall x. Rep CreateBucket x -> CreateBucket
forall x. CreateBucket -> Rep CreateBucket x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateBucket x -> CreateBucket
$cfrom :: forall x. CreateBucket -> Rep CreateBucket x
Prelude.Generic)
newCreateBucket ::
BucketName ->
CreateBucket
newCreateBucket :: BucketName -> CreateBucket
newCreateBucket BucketName
pBucket_ =
CreateBucket' :: Maybe Text
-> Maybe Bool
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe CreateBucketConfiguration
-> Maybe Text
-> Maybe BucketCannedACL
-> BucketName
-> CreateBucket
CreateBucket'
{ $sel:grantReadACP:CreateBucket' :: Maybe Text
grantReadACP = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:objectLockEnabledForBucket:CreateBucket' :: Maybe Bool
objectLockEnabledForBucket = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
$sel:grantWriteACP:CreateBucket' :: Maybe Text
grantWriteACP = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:grantRead:CreateBucket' :: Maybe Text
grantRead = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:grantFullControl:CreateBucket' :: Maybe Text
grantFullControl = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:createBucketConfiguration:CreateBucket' :: Maybe CreateBucketConfiguration
createBucketConfiguration = Maybe CreateBucketConfiguration
forall a. Maybe a
Prelude.Nothing,
$sel:grantWrite:CreateBucket' :: Maybe Text
grantWrite = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:acl:CreateBucket' :: Maybe BucketCannedACL
acl = Maybe BucketCannedACL
forall a. Maybe a
Prelude.Nothing,
$sel:bucket:CreateBucket' :: BucketName
bucket = BucketName
pBucket_
}
createBucket_grantReadACP :: Lens.Lens' CreateBucket (Prelude.Maybe Prelude.Text)
createBucket_grantReadACP :: (Maybe Text -> f (Maybe Text)) -> CreateBucket -> f CreateBucket
createBucket_grantReadACP = (CreateBucket -> Maybe Text)
-> (CreateBucket -> Maybe Text -> CreateBucket)
-> Lens CreateBucket CreateBucket (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateBucket' {Maybe Text
grantReadACP :: Maybe Text
$sel:grantReadACP:CreateBucket' :: CreateBucket -> Maybe Text
grantReadACP} -> Maybe Text
grantReadACP) (\s :: CreateBucket
s@CreateBucket' {} Maybe Text
a -> CreateBucket
s {$sel:grantReadACP:CreateBucket' :: Maybe Text
grantReadACP = Maybe Text
a} :: CreateBucket)
createBucket_objectLockEnabledForBucket :: Lens.Lens' CreateBucket (Prelude.Maybe Prelude.Bool)
createBucket_objectLockEnabledForBucket :: (Maybe Bool -> f (Maybe Bool)) -> CreateBucket -> f CreateBucket
createBucket_objectLockEnabledForBucket = (CreateBucket -> Maybe Bool)
-> (CreateBucket -> Maybe Bool -> CreateBucket)
-> Lens CreateBucket CreateBucket (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateBucket' {Maybe Bool
objectLockEnabledForBucket :: Maybe Bool
$sel:objectLockEnabledForBucket:CreateBucket' :: CreateBucket -> Maybe Bool
objectLockEnabledForBucket} -> Maybe Bool
objectLockEnabledForBucket) (\s :: CreateBucket
s@CreateBucket' {} Maybe Bool
a -> CreateBucket
s {$sel:objectLockEnabledForBucket:CreateBucket' :: Maybe Bool
objectLockEnabledForBucket = Maybe Bool
a} :: CreateBucket)
createBucket_grantWriteACP :: Lens.Lens' CreateBucket (Prelude.Maybe Prelude.Text)
createBucket_grantWriteACP :: (Maybe Text -> f (Maybe Text)) -> CreateBucket -> f CreateBucket
createBucket_grantWriteACP = (CreateBucket -> Maybe Text)
-> (CreateBucket -> Maybe Text -> CreateBucket)
-> Lens CreateBucket CreateBucket (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateBucket' {Maybe Text
grantWriteACP :: Maybe Text
$sel:grantWriteACP:CreateBucket' :: CreateBucket -> Maybe Text
grantWriteACP} -> Maybe Text
grantWriteACP) (\s :: CreateBucket
s@CreateBucket' {} Maybe Text
a -> CreateBucket
s {$sel:grantWriteACP:CreateBucket' :: Maybe Text
grantWriteACP = Maybe Text
a} :: CreateBucket)
createBucket_grantRead :: Lens.Lens' CreateBucket (Prelude.Maybe Prelude.Text)
createBucket_grantRead :: (Maybe Text -> f (Maybe Text)) -> CreateBucket -> f CreateBucket
createBucket_grantRead = (CreateBucket -> Maybe Text)
-> (CreateBucket -> Maybe Text -> CreateBucket)
-> Lens CreateBucket CreateBucket (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateBucket' {Maybe Text
grantRead :: Maybe Text
$sel:grantRead:CreateBucket' :: CreateBucket -> Maybe Text
grantRead} -> Maybe Text
grantRead) (\s :: CreateBucket
s@CreateBucket' {} Maybe Text
a -> CreateBucket
s {$sel:grantRead:CreateBucket' :: Maybe Text
grantRead = Maybe Text
a} :: CreateBucket)
createBucket_grantFullControl :: Lens.Lens' CreateBucket (Prelude.Maybe Prelude.Text)
createBucket_grantFullControl :: (Maybe Text -> f (Maybe Text)) -> CreateBucket -> f CreateBucket
createBucket_grantFullControl = (CreateBucket -> Maybe Text)
-> (CreateBucket -> Maybe Text -> CreateBucket)
-> Lens CreateBucket CreateBucket (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateBucket' {Maybe Text
grantFullControl :: Maybe Text
$sel:grantFullControl:CreateBucket' :: CreateBucket -> Maybe Text
grantFullControl} -> Maybe Text
grantFullControl) (\s :: CreateBucket
s@CreateBucket' {} Maybe Text
a -> CreateBucket
s {$sel:grantFullControl:CreateBucket' :: Maybe Text
grantFullControl = Maybe Text
a} :: CreateBucket)
createBucket_createBucketConfiguration :: Lens.Lens' CreateBucket (Prelude.Maybe CreateBucketConfiguration)
createBucket_createBucketConfiguration :: (Maybe CreateBucketConfiguration
-> f (Maybe CreateBucketConfiguration))
-> CreateBucket -> f CreateBucket
createBucket_createBucketConfiguration = (CreateBucket -> Maybe CreateBucketConfiguration)
-> (CreateBucket
-> Maybe CreateBucketConfiguration -> CreateBucket)
-> Lens
CreateBucket
CreateBucket
(Maybe CreateBucketConfiguration)
(Maybe CreateBucketConfiguration)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateBucket' {Maybe CreateBucketConfiguration
createBucketConfiguration :: Maybe CreateBucketConfiguration
$sel:createBucketConfiguration:CreateBucket' :: CreateBucket -> Maybe CreateBucketConfiguration
createBucketConfiguration} -> Maybe CreateBucketConfiguration
createBucketConfiguration) (\s :: CreateBucket
s@CreateBucket' {} Maybe CreateBucketConfiguration
a -> CreateBucket
s {$sel:createBucketConfiguration:CreateBucket' :: Maybe CreateBucketConfiguration
createBucketConfiguration = Maybe CreateBucketConfiguration
a} :: CreateBucket)
createBucket_grantWrite :: Lens.Lens' CreateBucket (Prelude.Maybe Prelude.Text)
createBucket_grantWrite :: (Maybe Text -> f (Maybe Text)) -> CreateBucket -> f CreateBucket
createBucket_grantWrite = (CreateBucket -> Maybe Text)
-> (CreateBucket -> Maybe Text -> CreateBucket)
-> Lens CreateBucket CreateBucket (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateBucket' {Maybe Text
grantWrite :: Maybe Text
$sel:grantWrite:CreateBucket' :: CreateBucket -> Maybe Text
grantWrite} -> Maybe Text
grantWrite) (\s :: CreateBucket
s@CreateBucket' {} Maybe Text
a -> CreateBucket
s {$sel:grantWrite:CreateBucket' :: Maybe Text
grantWrite = Maybe Text
a} :: CreateBucket)
createBucket_acl :: Lens.Lens' CreateBucket (Prelude.Maybe BucketCannedACL)
createBucket_acl :: (Maybe BucketCannedACL -> f (Maybe BucketCannedACL))
-> CreateBucket -> f CreateBucket
createBucket_acl = (CreateBucket -> Maybe BucketCannedACL)
-> (CreateBucket -> Maybe BucketCannedACL -> CreateBucket)
-> Lens
CreateBucket
CreateBucket
(Maybe BucketCannedACL)
(Maybe BucketCannedACL)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateBucket' {Maybe BucketCannedACL
acl :: Maybe BucketCannedACL
$sel:acl:CreateBucket' :: CreateBucket -> Maybe BucketCannedACL
acl} -> Maybe BucketCannedACL
acl) (\s :: CreateBucket
s@CreateBucket' {} Maybe BucketCannedACL
a -> CreateBucket
s {$sel:acl:CreateBucket' :: Maybe BucketCannedACL
acl = Maybe BucketCannedACL
a} :: CreateBucket)
createBucket_bucket :: Lens.Lens' CreateBucket BucketName
createBucket_bucket :: (BucketName -> f BucketName) -> CreateBucket -> f CreateBucket
createBucket_bucket = (CreateBucket -> BucketName)
-> (CreateBucket -> BucketName -> CreateBucket)
-> Lens CreateBucket CreateBucket BucketName BucketName
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateBucket' {BucketName
bucket :: BucketName
$sel:bucket:CreateBucket' :: CreateBucket -> BucketName
bucket} -> BucketName
bucket) (\s :: CreateBucket
s@CreateBucket' {} BucketName
a -> CreateBucket
s {$sel:bucket:CreateBucket' :: BucketName
bucket = BucketName
a} :: CreateBucket)
instance Core.AWSRequest CreateBucket where
type AWSResponse CreateBucket = CreateBucketResponse
request :: CreateBucket -> Request CreateBucket
request =
Request CreateBucket -> Request CreateBucket
forall a. Request a -> Request a
Request.s3vhost
(Request CreateBucket -> Request CreateBucket)
-> (CreateBucket -> Request CreateBucket)
-> CreateBucket
-> Request CreateBucket
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. Service -> CreateBucket -> Request CreateBucket
forall a. (ToRequest a, ToElement a) => Service -> a -> Request a
Request.putXML Service
defaultService
response :: Logger
-> Service
-> Proxy CreateBucket
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse CreateBucket)))
response =
(Int
-> ResponseHeaders
-> ()
-> Either String (AWSResponse CreateBucket))
-> Logger
-> Service
-> Proxy CreateBucket
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse CreateBucket)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> () -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveEmpty
( \Int
s ResponseHeaders
h ()
x ->
Maybe Text -> Int -> CreateBucketResponse
CreateBucketResponse'
(Maybe Text -> Int -> CreateBucketResponse)
-> Either String (Maybe Text)
-> Either String (Int -> CreateBucketResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (ResponseHeaders
h ResponseHeaders -> HeaderName -> Either String (Maybe Text)
forall a.
FromText a =>
ResponseHeaders -> HeaderName -> Either String (Maybe a)
Core..#? HeaderName
"Location")
Either String (Int -> CreateBucketResponse)
-> Either String Int -> Either String CreateBucketResponse
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 CreateBucket
instance Prelude.NFData CreateBucket
instance Core.ToElement CreateBucket where
toElement :: CreateBucket -> Element
toElement CreateBucket' {Maybe Bool
Maybe Text
Maybe BucketCannedACL
Maybe CreateBucketConfiguration
BucketName
bucket :: BucketName
acl :: Maybe BucketCannedACL
grantWrite :: Maybe Text
createBucketConfiguration :: Maybe CreateBucketConfiguration
grantFullControl :: Maybe Text
grantRead :: Maybe Text
grantWriteACP :: Maybe Text
objectLockEnabledForBucket :: Maybe Bool
grantReadACP :: Maybe Text
$sel:bucket:CreateBucket' :: CreateBucket -> BucketName
$sel:acl:CreateBucket' :: CreateBucket -> Maybe BucketCannedACL
$sel:grantWrite:CreateBucket' :: CreateBucket -> Maybe Text
$sel:createBucketConfiguration:CreateBucket' :: CreateBucket -> Maybe CreateBucketConfiguration
$sel:grantFullControl:CreateBucket' :: CreateBucket -> Maybe Text
$sel:grantRead:CreateBucket' :: CreateBucket -> Maybe Text
$sel:grantWriteACP:CreateBucket' :: CreateBucket -> Maybe Text
$sel:objectLockEnabledForBucket:CreateBucket' :: CreateBucket -> Maybe Bool
$sel:grantReadACP:CreateBucket' :: CreateBucket -> Maybe Text
..} =
Name -> Maybe CreateBucketConfiguration -> Element
forall a. ToXML a => Name -> a -> Element
Core.mkElement
Name
"{http://s3.amazonaws.com/doc/2006-03-01/}CreateBucketConfiguration"
Maybe CreateBucketConfiguration
createBucketConfiguration
instance Core.ToHeaders CreateBucket where
toHeaders :: CreateBucket -> ResponseHeaders
toHeaders CreateBucket' {Maybe Bool
Maybe Text
Maybe BucketCannedACL
Maybe CreateBucketConfiguration
BucketName
bucket :: BucketName
acl :: Maybe BucketCannedACL
grantWrite :: Maybe Text
createBucketConfiguration :: Maybe CreateBucketConfiguration
grantFullControl :: Maybe Text
grantRead :: Maybe Text
grantWriteACP :: Maybe Text
objectLockEnabledForBucket :: Maybe Bool
grantReadACP :: Maybe Text
$sel:bucket:CreateBucket' :: CreateBucket -> BucketName
$sel:acl:CreateBucket' :: CreateBucket -> Maybe BucketCannedACL
$sel:grantWrite:CreateBucket' :: CreateBucket -> Maybe Text
$sel:createBucketConfiguration:CreateBucket' :: CreateBucket -> Maybe CreateBucketConfiguration
$sel:grantFullControl:CreateBucket' :: CreateBucket -> Maybe Text
$sel:grantRead:CreateBucket' :: CreateBucket -> Maybe Text
$sel:grantWriteACP:CreateBucket' :: CreateBucket -> Maybe Text
$sel:objectLockEnabledForBucket:CreateBucket' :: CreateBucket -> Maybe Bool
$sel:grantReadACP:CreateBucket' :: CreateBucket -> Maybe Text
..} =
[ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"x-amz-grant-read-acp" HeaderName -> Maybe Text -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# Maybe Text
grantReadACP,
HeaderName
"x-amz-bucket-object-lock-enabled"
HeaderName -> Maybe Bool -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# Maybe Bool
objectLockEnabledForBucket,
HeaderName
"x-amz-grant-write-acp" HeaderName -> Maybe Text -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# Maybe Text
grantWriteACP,
HeaderName
"x-amz-grant-read" HeaderName -> Maybe Text -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# Maybe Text
grantRead,
HeaderName
"x-amz-grant-full-control" HeaderName -> Maybe Text -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# Maybe Text
grantFullControl,
HeaderName
"x-amz-grant-write" HeaderName -> Maybe Text -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# Maybe Text
grantWrite,
HeaderName
"x-amz-acl" HeaderName -> Maybe BucketCannedACL -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# Maybe BucketCannedACL
acl
]
instance Core.ToPath CreateBucket where
toPath :: CreateBucket -> ByteString
toPath CreateBucket' {Maybe Bool
Maybe Text
Maybe BucketCannedACL
Maybe CreateBucketConfiguration
BucketName
bucket :: BucketName
acl :: Maybe BucketCannedACL
grantWrite :: Maybe Text
createBucketConfiguration :: Maybe CreateBucketConfiguration
grantFullControl :: Maybe Text
grantRead :: Maybe Text
grantWriteACP :: Maybe Text
objectLockEnabledForBucket :: Maybe Bool
grantReadACP :: Maybe Text
$sel:bucket:CreateBucket' :: CreateBucket -> BucketName
$sel:acl:CreateBucket' :: CreateBucket -> Maybe BucketCannedACL
$sel:grantWrite:CreateBucket' :: CreateBucket -> Maybe Text
$sel:createBucketConfiguration:CreateBucket' :: CreateBucket -> Maybe CreateBucketConfiguration
$sel:grantFullControl:CreateBucket' :: CreateBucket -> Maybe Text
$sel:grantRead:CreateBucket' :: CreateBucket -> Maybe Text
$sel:grantWriteACP:CreateBucket' :: CreateBucket -> Maybe Text
$sel:objectLockEnabledForBucket:CreateBucket' :: CreateBucket -> Maybe Bool
$sel:grantReadACP:CreateBucket' :: CreateBucket -> 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 CreateBucket where
toQuery :: CreateBucket -> QueryString
toQuery = QueryString -> CreateBucket -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data CreateBucketResponse = CreateBucketResponse'
{
CreateBucketResponse -> Maybe Text
location :: Prelude.Maybe Prelude.Text,
CreateBucketResponse -> Int
httpStatus :: Prelude.Int
}
deriving (CreateBucketResponse -> CreateBucketResponse -> Bool
(CreateBucketResponse -> CreateBucketResponse -> Bool)
-> (CreateBucketResponse -> CreateBucketResponse -> Bool)
-> Eq CreateBucketResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateBucketResponse -> CreateBucketResponse -> Bool
$c/= :: CreateBucketResponse -> CreateBucketResponse -> Bool
== :: CreateBucketResponse -> CreateBucketResponse -> Bool
$c== :: CreateBucketResponse -> CreateBucketResponse -> Bool
Prelude.Eq, ReadPrec [CreateBucketResponse]
ReadPrec CreateBucketResponse
Int -> ReadS CreateBucketResponse
ReadS [CreateBucketResponse]
(Int -> ReadS CreateBucketResponse)
-> ReadS [CreateBucketResponse]
-> ReadPrec CreateBucketResponse
-> ReadPrec [CreateBucketResponse]
-> Read CreateBucketResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateBucketResponse]
$creadListPrec :: ReadPrec [CreateBucketResponse]
readPrec :: ReadPrec CreateBucketResponse
$creadPrec :: ReadPrec CreateBucketResponse
readList :: ReadS [CreateBucketResponse]
$creadList :: ReadS [CreateBucketResponse]
readsPrec :: Int -> ReadS CreateBucketResponse
$creadsPrec :: Int -> ReadS CreateBucketResponse
Prelude.Read, Int -> CreateBucketResponse -> ShowS
[CreateBucketResponse] -> ShowS
CreateBucketResponse -> String
(Int -> CreateBucketResponse -> ShowS)
-> (CreateBucketResponse -> String)
-> ([CreateBucketResponse] -> ShowS)
-> Show CreateBucketResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateBucketResponse] -> ShowS
$cshowList :: [CreateBucketResponse] -> ShowS
show :: CreateBucketResponse -> String
$cshow :: CreateBucketResponse -> String
showsPrec :: Int -> CreateBucketResponse -> ShowS
$cshowsPrec :: Int -> CreateBucketResponse -> ShowS
Prelude.Show, (forall x. CreateBucketResponse -> Rep CreateBucketResponse x)
-> (forall x. Rep CreateBucketResponse x -> CreateBucketResponse)
-> Generic CreateBucketResponse
forall x. Rep CreateBucketResponse x -> CreateBucketResponse
forall x. CreateBucketResponse -> Rep CreateBucketResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateBucketResponse x -> CreateBucketResponse
$cfrom :: forall x. CreateBucketResponse -> Rep CreateBucketResponse x
Prelude.Generic)
newCreateBucketResponse ::
Prelude.Int ->
CreateBucketResponse
newCreateBucketResponse :: Int -> CreateBucketResponse
newCreateBucketResponse Int
pHttpStatus_ =
CreateBucketResponse' :: Maybe Text -> Int -> CreateBucketResponse
CreateBucketResponse'
{ $sel:location:CreateBucketResponse' :: Maybe Text
location = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:CreateBucketResponse' :: Int
httpStatus = Int
pHttpStatus_
}
createBucketResponse_location :: Lens.Lens' CreateBucketResponse (Prelude.Maybe Prelude.Text)
createBucketResponse_location :: (Maybe Text -> f (Maybe Text))
-> CreateBucketResponse -> f CreateBucketResponse
createBucketResponse_location = (CreateBucketResponse -> Maybe Text)
-> (CreateBucketResponse -> Maybe Text -> CreateBucketResponse)
-> Lens
CreateBucketResponse CreateBucketResponse (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateBucketResponse' {Maybe Text
location :: Maybe Text
$sel:location:CreateBucketResponse' :: CreateBucketResponse -> Maybe Text
location} -> Maybe Text
location) (\s :: CreateBucketResponse
s@CreateBucketResponse' {} Maybe Text
a -> CreateBucketResponse
s {$sel:location:CreateBucketResponse' :: Maybe Text
location = Maybe Text
a} :: CreateBucketResponse)
createBucketResponse_httpStatus :: Lens.Lens' CreateBucketResponse Prelude.Int
createBucketResponse_httpStatus :: (Int -> f Int) -> CreateBucketResponse -> f CreateBucketResponse
createBucketResponse_httpStatus = (CreateBucketResponse -> Int)
-> (CreateBucketResponse -> Int -> CreateBucketResponse)
-> Lens CreateBucketResponse CreateBucketResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateBucketResponse' {Int
httpStatus :: Int
$sel:httpStatus:CreateBucketResponse' :: CreateBucketResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: CreateBucketResponse
s@CreateBucketResponse' {} Int
a -> CreateBucketResponse
s {$sel:httpStatus:CreateBucketResponse' :: Int
httpStatus = Int
a} :: CreateBucketResponse)
instance Prelude.NFData CreateBucketResponse