{-# 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.PutBucketMetricsConfiguration
(
PutBucketMetricsConfiguration (..),
newPutBucketMetricsConfiguration,
putBucketMetricsConfiguration_expectedBucketOwner,
putBucketMetricsConfiguration_bucket,
putBucketMetricsConfiguration_id,
putBucketMetricsConfiguration_metricsConfiguration,
PutBucketMetricsConfigurationResponse (..),
newPutBucketMetricsConfigurationResponse,
)
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 PutBucketMetricsConfiguration = PutBucketMetricsConfiguration'
{
PutBucketMetricsConfiguration -> Maybe Text
expectedBucketOwner :: Prelude.Maybe Prelude.Text,
PutBucketMetricsConfiguration -> BucketName
bucket :: BucketName,
PutBucketMetricsConfiguration -> Text
id :: Prelude.Text,
PutBucketMetricsConfiguration -> MetricsConfiguration
metricsConfiguration :: MetricsConfiguration
}
deriving (PutBucketMetricsConfiguration
-> PutBucketMetricsConfiguration -> Bool
(PutBucketMetricsConfiguration
-> PutBucketMetricsConfiguration -> Bool)
-> (PutBucketMetricsConfiguration
-> PutBucketMetricsConfiguration -> Bool)
-> Eq PutBucketMetricsConfiguration
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PutBucketMetricsConfiguration
-> PutBucketMetricsConfiguration -> Bool
$c/= :: PutBucketMetricsConfiguration
-> PutBucketMetricsConfiguration -> Bool
== :: PutBucketMetricsConfiguration
-> PutBucketMetricsConfiguration -> Bool
$c== :: PutBucketMetricsConfiguration
-> PutBucketMetricsConfiguration -> Bool
Prelude.Eq, ReadPrec [PutBucketMetricsConfiguration]
ReadPrec PutBucketMetricsConfiguration
Int -> ReadS PutBucketMetricsConfiguration
ReadS [PutBucketMetricsConfiguration]
(Int -> ReadS PutBucketMetricsConfiguration)
-> ReadS [PutBucketMetricsConfiguration]
-> ReadPrec PutBucketMetricsConfiguration
-> ReadPrec [PutBucketMetricsConfiguration]
-> Read PutBucketMetricsConfiguration
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PutBucketMetricsConfiguration]
$creadListPrec :: ReadPrec [PutBucketMetricsConfiguration]
readPrec :: ReadPrec PutBucketMetricsConfiguration
$creadPrec :: ReadPrec PutBucketMetricsConfiguration
readList :: ReadS [PutBucketMetricsConfiguration]
$creadList :: ReadS [PutBucketMetricsConfiguration]
readsPrec :: Int -> ReadS PutBucketMetricsConfiguration
$creadsPrec :: Int -> ReadS PutBucketMetricsConfiguration
Prelude.Read, Int -> PutBucketMetricsConfiguration -> ShowS
[PutBucketMetricsConfiguration] -> ShowS
PutBucketMetricsConfiguration -> String
(Int -> PutBucketMetricsConfiguration -> ShowS)
-> (PutBucketMetricsConfiguration -> String)
-> ([PutBucketMetricsConfiguration] -> ShowS)
-> Show PutBucketMetricsConfiguration
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PutBucketMetricsConfiguration] -> ShowS
$cshowList :: [PutBucketMetricsConfiguration] -> ShowS
show :: PutBucketMetricsConfiguration -> String
$cshow :: PutBucketMetricsConfiguration -> String
showsPrec :: Int -> PutBucketMetricsConfiguration -> ShowS
$cshowsPrec :: Int -> PutBucketMetricsConfiguration -> ShowS
Prelude.Show, (forall x.
PutBucketMetricsConfiguration
-> Rep PutBucketMetricsConfiguration x)
-> (forall x.
Rep PutBucketMetricsConfiguration x
-> PutBucketMetricsConfiguration)
-> Generic PutBucketMetricsConfiguration
forall x.
Rep PutBucketMetricsConfiguration x
-> PutBucketMetricsConfiguration
forall x.
PutBucketMetricsConfiguration
-> Rep PutBucketMetricsConfiguration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep PutBucketMetricsConfiguration x
-> PutBucketMetricsConfiguration
$cfrom :: forall x.
PutBucketMetricsConfiguration
-> Rep PutBucketMetricsConfiguration x
Prelude.Generic)
newPutBucketMetricsConfiguration ::
BucketName ->
Prelude.Text ->
MetricsConfiguration ->
PutBucketMetricsConfiguration
newPutBucketMetricsConfiguration :: BucketName
-> Text -> MetricsConfiguration -> PutBucketMetricsConfiguration
newPutBucketMetricsConfiguration
BucketName
pBucket_
Text
pId_
MetricsConfiguration
pMetricsConfiguration_ =
PutBucketMetricsConfiguration' :: Maybe Text
-> BucketName
-> Text
-> MetricsConfiguration
-> PutBucketMetricsConfiguration
PutBucketMetricsConfiguration'
{ $sel:expectedBucketOwner:PutBucketMetricsConfiguration' :: Maybe Text
expectedBucketOwner =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:bucket:PutBucketMetricsConfiguration' :: BucketName
bucket = BucketName
pBucket_,
$sel:id:PutBucketMetricsConfiguration' :: Text
id = Text
pId_,
$sel:metricsConfiguration:PutBucketMetricsConfiguration' :: MetricsConfiguration
metricsConfiguration =
MetricsConfiguration
pMetricsConfiguration_
}
putBucketMetricsConfiguration_expectedBucketOwner :: Lens.Lens' PutBucketMetricsConfiguration (Prelude.Maybe Prelude.Text)
putBucketMetricsConfiguration_expectedBucketOwner :: (Maybe Text -> f (Maybe Text))
-> PutBucketMetricsConfiguration -> f PutBucketMetricsConfiguration
putBucketMetricsConfiguration_expectedBucketOwner = (PutBucketMetricsConfiguration -> Maybe Text)
-> (PutBucketMetricsConfiguration
-> Maybe Text -> PutBucketMetricsConfiguration)
-> Lens
PutBucketMetricsConfiguration
PutBucketMetricsConfiguration
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutBucketMetricsConfiguration' {Maybe Text
expectedBucketOwner :: Maybe Text
$sel:expectedBucketOwner:PutBucketMetricsConfiguration' :: PutBucketMetricsConfiguration -> Maybe Text
expectedBucketOwner} -> Maybe Text
expectedBucketOwner) (\s :: PutBucketMetricsConfiguration
s@PutBucketMetricsConfiguration' {} Maybe Text
a -> PutBucketMetricsConfiguration
s {$sel:expectedBucketOwner:PutBucketMetricsConfiguration' :: Maybe Text
expectedBucketOwner = Maybe Text
a} :: PutBucketMetricsConfiguration)
putBucketMetricsConfiguration_bucket :: Lens.Lens' PutBucketMetricsConfiguration BucketName
putBucketMetricsConfiguration_bucket :: (BucketName -> f BucketName)
-> PutBucketMetricsConfiguration -> f PutBucketMetricsConfiguration
putBucketMetricsConfiguration_bucket = (PutBucketMetricsConfiguration -> BucketName)
-> (PutBucketMetricsConfiguration
-> BucketName -> PutBucketMetricsConfiguration)
-> Lens
PutBucketMetricsConfiguration
PutBucketMetricsConfiguration
BucketName
BucketName
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutBucketMetricsConfiguration' {BucketName
bucket :: BucketName
$sel:bucket:PutBucketMetricsConfiguration' :: PutBucketMetricsConfiguration -> BucketName
bucket} -> BucketName
bucket) (\s :: PutBucketMetricsConfiguration
s@PutBucketMetricsConfiguration' {} BucketName
a -> PutBucketMetricsConfiguration
s {$sel:bucket:PutBucketMetricsConfiguration' :: BucketName
bucket = BucketName
a} :: PutBucketMetricsConfiguration)
putBucketMetricsConfiguration_id :: Lens.Lens' PutBucketMetricsConfiguration Prelude.Text
putBucketMetricsConfiguration_id :: (Text -> f Text)
-> PutBucketMetricsConfiguration -> f PutBucketMetricsConfiguration
putBucketMetricsConfiguration_id = (PutBucketMetricsConfiguration -> Text)
-> (PutBucketMetricsConfiguration
-> Text -> PutBucketMetricsConfiguration)
-> Lens
PutBucketMetricsConfiguration
PutBucketMetricsConfiguration
Text
Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutBucketMetricsConfiguration' {Text
id :: Text
$sel:id:PutBucketMetricsConfiguration' :: PutBucketMetricsConfiguration -> Text
id} -> Text
id) (\s :: PutBucketMetricsConfiguration
s@PutBucketMetricsConfiguration' {} Text
a -> PutBucketMetricsConfiguration
s {$sel:id:PutBucketMetricsConfiguration' :: Text
id = Text
a} :: PutBucketMetricsConfiguration)
putBucketMetricsConfiguration_metricsConfiguration :: Lens.Lens' PutBucketMetricsConfiguration MetricsConfiguration
putBucketMetricsConfiguration_metricsConfiguration :: (MetricsConfiguration -> f MetricsConfiguration)
-> PutBucketMetricsConfiguration -> f PutBucketMetricsConfiguration
putBucketMetricsConfiguration_metricsConfiguration = (PutBucketMetricsConfiguration -> MetricsConfiguration)
-> (PutBucketMetricsConfiguration
-> MetricsConfiguration -> PutBucketMetricsConfiguration)
-> Lens
PutBucketMetricsConfiguration
PutBucketMetricsConfiguration
MetricsConfiguration
MetricsConfiguration
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutBucketMetricsConfiguration' {MetricsConfiguration
metricsConfiguration :: MetricsConfiguration
$sel:metricsConfiguration:PutBucketMetricsConfiguration' :: PutBucketMetricsConfiguration -> MetricsConfiguration
metricsConfiguration} -> MetricsConfiguration
metricsConfiguration) (\s :: PutBucketMetricsConfiguration
s@PutBucketMetricsConfiguration' {} MetricsConfiguration
a -> PutBucketMetricsConfiguration
s {$sel:metricsConfiguration:PutBucketMetricsConfiguration' :: MetricsConfiguration
metricsConfiguration = MetricsConfiguration
a} :: PutBucketMetricsConfiguration)
instance
Core.AWSRequest
PutBucketMetricsConfiguration
where
type
AWSResponse PutBucketMetricsConfiguration =
PutBucketMetricsConfigurationResponse
request :: PutBucketMetricsConfiguration
-> Request PutBucketMetricsConfiguration
request =
Request PutBucketMetricsConfiguration
-> Request PutBucketMetricsConfiguration
forall a. Request a -> Request a
Request.s3vhost
(Request PutBucketMetricsConfiguration
-> Request PutBucketMetricsConfiguration)
-> (PutBucketMetricsConfiguration
-> Request PutBucketMetricsConfiguration)
-> PutBucketMetricsConfiguration
-> Request PutBucketMetricsConfiguration
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. Service
-> PutBucketMetricsConfiguration
-> Request PutBucketMetricsConfiguration
forall a. (ToRequest a, ToElement a) => Service -> a -> Request a
Request.putXML Service
defaultService
response :: Logger
-> Service
-> Proxy PutBucketMetricsConfiguration
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse PutBucketMetricsConfiguration)))
response =
AWSResponse PutBucketMetricsConfiguration
-> Logger
-> Service
-> Proxy PutBucketMetricsConfiguration
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse PutBucketMetricsConfiguration)))
forall (m :: * -> *) a.
MonadResource m =>
AWSResponse a
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveNull
AWSResponse PutBucketMetricsConfiguration
PutBucketMetricsConfigurationResponse
PutBucketMetricsConfigurationResponse'
instance
Prelude.Hashable
PutBucketMetricsConfiguration
instance Prelude.NFData PutBucketMetricsConfiguration
instance Core.ToElement PutBucketMetricsConfiguration where
toElement :: PutBucketMetricsConfiguration -> Element
toElement PutBucketMetricsConfiguration' {Maybe Text
Text
BucketName
MetricsConfiguration
metricsConfiguration :: MetricsConfiguration
id :: Text
bucket :: BucketName
expectedBucketOwner :: Maybe Text
$sel:metricsConfiguration:PutBucketMetricsConfiguration' :: PutBucketMetricsConfiguration -> MetricsConfiguration
$sel:id:PutBucketMetricsConfiguration' :: PutBucketMetricsConfiguration -> Text
$sel:bucket:PutBucketMetricsConfiguration' :: PutBucketMetricsConfiguration -> BucketName
$sel:expectedBucketOwner:PutBucketMetricsConfiguration' :: PutBucketMetricsConfiguration -> Maybe Text
..} =
Name -> MetricsConfiguration -> Element
forall a. ToXML a => Name -> a -> Element
Core.mkElement
Name
"{http://s3.amazonaws.com/doc/2006-03-01/}MetricsConfiguration"
MetricsConfiguration
metricsConfiguration
instance Core.ToHeaders PutBucketMetricsConfiguration where
toHeaders :: PutBucketMetricsConfiguration -> [Header]
toHeaders PutBucketMetricsConfiguration' {Maybe Text
Text
BucketName
MetricsConfiguration
metricsConfiguration :: MetricsConfiguration
id :: Text
bucket :: BucketName
expectedBucketOwner :: Maybe Text
$sel:metricsConfiguration:PutBucketMetricsConfiguration' :: PutBucketMetricsConfiguration -> MetricsConfiguration
$sel:id:PutBucketMetricsConfiguration' :: PutBucketMetricsConfiguration -> Text
$sel:bucket:PutBucketMetricsConfiguration' :: PutBucketMetricsConfiguration -> BucketName
$sel:expectedBucketOwner:PutBucketMetricsConfiguration' :: PutBucketMetricsConfiguration -> Maybe Text
..} =
[[Header]] -> [Header]
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"x-amz-expected-bucket-owner"
HeaderName -> Maybe Text -> [Header]
forall a. ToHeader a => HeaderName -> a -> [Header]
Core.=# Maybe Text
expectedBucketOwner
]
instance Core.ToPath PutBucketMetricsConfiguration where
toPath :: PutBucketMetricsConfiguration -> ByteString
toPath PutBucketMetricsConfiguration' {Maybe Text
Text
BucketName
MetricsConfiguration
metricsConfiguration :: MetricsConfiguration
id :: Text
bucket :: BucketName
expectedBucketOwner :: Maybe Text
$sel:metricsConfiguration:PutBucketMetricsConfiguration' :: PutBucketMetricsConfiguration -> MetricsConfiguration
$sel:id:PutBucketMetricsConfiguration' :: PutBucketMetricsConfiguration -> Text
$sel:bucket:PutBucketMetricsConfiguration' :: PutBucketMetricsConfiguration -> BucketName
$sel:expectedBucketOwner:PutBucketMetricsConfiguration' :: PutBucketMetricsConfiguration -> 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 PutBucketMetricsConfiguration where
toQuery :: PutBucketMetricsConfiguration -> QueryString
toQuery PutBucketMetricsConfiguration' {Maybe Text
Text
BucketName
MetricsConfiguration
metricsConfiguration :: MetricsConfiguration
id :: Text
bucket :: BucketName
expectedBucketOwner :: Maybe Text
$sel:metricsConfiguration:PutBucketMetricsConfiguration' :: PutBucketMetricsConfiguration -> MetricsConfiguration
$sel:id:PutBucketMetricsConfiguration' :: PutBucketMetricsConfiguration -> Text
$sel:bucket:PutBucketMetricsConfiguration' :: PutBucketMetricsConfiguration -> BucketName
$sel:expectedBucketOwner:PutBucketMetricsConfiguration' :: PutBucketMetricsConfiguration -> 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
"metrics"]
data PutBucketMetricsConfigurationResponse = PutBucketMetricsConfigurationResponse'
{
}
deriving (PutBucketMetricsConfigurationResponse
-> PutBucketMetricsConfigurationResponse -> Bool
(PutBucketMetricsConfigurationResponse
-> PutBucketMetricsConfigurationResponse -> Bool)
-> (PutBucketMetricsConfigurationResponse
-> PutBucketMetricsConfigurationResponse -> Bool)
-> Eq PutBucketMetricsConfigurationResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PutBucketMetricsConfigurationResponse
-> PutBucketMetricsConfigurationResponse -> Bool
$c/= :: PutBucketMetricsConfigurationResponse
-> PutBucketMetricsConfigurationResponse -> Bool
== :: PutBucketMetricsConfigurationResponse
-> PutBucketMetricsConfigurationResponse -> Bool
$c== :: PutBucketMetricsConfigurationResponse
-> PutBucketMetricsConfigurationResponse -> Bool
Prelude.Eq, ReadPrec [PutBucketMetricsConfigurationResponse]
ReadPrec PutBucketMetricsConfigurationResponse
Int -> ReadS PutBucketMetricsConfigurationResponse
ReadS [PutBucketMetricsConfigurationResponse]
(Int -> ReadS PutBucketMetricsConfigurationResponse)
-> ReadS [PutBucketMetricsConfigurationResponse]
-> ReadPrec PutBucketMetricsConfigurationResponse
-> ReadPrec [PutBucketMetricsConfigurationResponse]
-> Read PutBucketMetricsConfigurationResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PutBucketMetricsConfigurationResponse]
$creadListPrec :: ReadPrec [PutBucketMetricsConfigurationResponse]
readPrec :: ReadPrec PutBucketMetricsConfigurationResponse
$creadPrec :: ReadPrec PutBucketMetricsConfigurationResponse
readList :: ReadS [PutBucketMetricsConfigurationResponse]
$creadList :: ReadS [PutBucketMetricsConfigurationResponse]
readsPrec :: Int -> ReadS PutBucketMetricsConfigurationResponse
$creadsPrec :: Int -> ReadS PutBucketMetricsConfigurationResponse
Prelude.Read, Int -> PutBucketMetricsConfigurationResponse -> ShowS
[PutBucketMetricsConfigurationResponse] -> ShowS
PutBucketMetricsConfigurationResponse -> String
(Int -> PutBucketMetricsConfigurationResponse -> ShowS)
-> (PutBucketMetricsConfigurationResponse -> String)
-> ([PutBucketMetricsConfigurationResponse] -> ShowS)
-> Show PutBucketMetricsConfigurationResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PutBucketMetricsConfigurationResponse] -> ShowS
$cshowList :: [PutBucketMetricsConfigurationResponse] -> ShowS
show :: PutBucketMetricsConfigurationResponse -> String
$cshow :: PutBucketMetricsConfigurationResponse -> String
showsPrec :: Int -> PutBucketMetricsConfigurationResponse -> ShowS
$cshowsPrec :: Int -> PutBucketMetricsConfigurationResponse -> ShowS
Prelude.Show, (forall x.
PutBucketMetricsConfigurationResponse
-> Rep PutBucketMetricsConfigurationResponse x)
-> (forall x.
Rep PutBucketMetricsConfigurationResponse x
-> PutBucketMetricsConfigurationResponse)
-> Generic PutBucketMetricsConfigurationResponse
forall x.
Rep PutBucketMetricsConfigurationResponse x
-> PutBucketMetricsConfigurationResponse
forall x.
PutBucketMetricsConfigurationResponse
-> Rep PutBucketMetricsConfigurationResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep PutBucketMetricsConfigurationResponse x
-> PutBucketMetricsConfigurationResponse
$cfrom :: forall x.
PutBucketMetricsConfigurationResponse
-> Rep PutBucketMetricsConfigurationResponse x
Prelude.Generic)
newPutBucketMetricsConfigurationResponse ::
PutBucketMetricsConfigurationResponse
newPutBucketMetricsConfigurationResponse :: PutBucketMetricsConfigurationResponse
newPutBucketMetricsConfigurationResponse =
PutBucketMetricsConfigurationResponse
PutBucketMetricsConfigurationResponse'
instance
Prelude.NFData
PutBucketMetricsConfigurationResponse