{-# 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 #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.Lightsail.UpdateBucket
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Updates an existing Amazon Lightsail bucket.
--
-- Use this action to update the configuration of an existing bucket, such
-- as versioning, public accessibility, and the AWS accounts that can
-- access the bucket.
module Amazonka.Lightsail.UpdateBucket
  ( -- * Creating a Request
    UpdateBucket (..),
    newUpdateBucket,

    -- * Request Lenses
    updateBucket_readonlyAccessAccounts,
    updateBucket_accessRules,
    updateBucket_versioning,
    updateBucket_bucketName,

    -- * Destructuring the Response
    UpdateBucketResponse (..),
    newUpdateBucketResponse,

    -- * Response Lenses
    updateBucketResponse_bucket,
    updateBucketResponse_operations,
    updateBucketResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.Lightsail.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | /See:/ 'newUpdateBucket' smart constructor.
data UpdateBucket = UpdateBucket'
  { -- | An array of strings to specify the AWS account IDs that can access the
    -- bucket.
    --
    -- You can give a maximum of 10 AWS accounts access to a bucket.
    UpdateBucket -> Maybe [Text]
readonlyAccessAccounts :: Prelude.Maybe [Prelude.Text],
    -- | An object that sets the public accessibility of objects in the specified
    -- bucket.
    UpdateBucket -> Maybe AccessRules
accessRules :: Prelude.Maybe AccessRules,
    -- | Specifies whether to enable or suspend versioning of objects in the
    -- bucket.
    --
    -- The following options can be specified:
    --
    -- -   @Enabled@ - Enables versioning of objects in the specified bucket.
    --
    -- -   @Suspended@ - Suspends versioning of objects in the specified
    --     bucket. Existing object versions are retained.
    UpdateBucket -> Maybe Text
versioning :: Prelude.Maybe Prelude.Text,
    -- | The name of the bucket to update.
    UpdateBucket -> Text
bucketName :: Prelude.Text
  }
  deriving (UpdateBucket -> UpdateBucket -> Bool
(UpdateBucket -> UpdateBucket -> Bool)
-> (UpdateBucket -> UpdateBucket -> Bool) -> Eq UpdateBucket
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateBucket -> UpdateBucket -> Bool
$c/= :: UpdateBucket -> UpdateBucket -> Bool
== :: UpdateBucket -> UpdateBucket -> Bool
$c== :: UpdateBucket -> UpdateBucket -> Bool
Prelude.Eq, ReadPrec [UpdateBucket]
ReadPrec UpdateBucket
Int -> ReadS UpdateBucket
ReadS [UpdateBucket]
(Int -> ReadS UpdateBucket)
-> ReadS [UpdateBucket]
-> ReadPrec UpdateBucket
-> ReadPrec [UpdateBucket]
-> Read UpdateBucket
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateBucket]
$creadListPrec :: ReadPrec [UpdateBucket]
readPrec :: ReadPrec UpdateBucket
$creadPrec :: ReadPrec UpdateBucket
readList :: ReadS [UpdateBucket]
$creadList :: ReadS [UpdateBucket]
readsPrec :: Int -> ReadS UpdateBucket
$creadsPrec :: Int -> ReadS UpdateBucket
Prelude.Read, Int -> UpdateBucket -> ShowS
[UpdateBucket] -> ShowS
UpdateBucket -> String
(Int -> UpdateBucket -> ShowS)
-> (UpdateBucket -> String)
-> ([UpdateBucket] -> ShowS)
-> Show UpdateBucket
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateBucket] -> ShowS
$cshowList :: [UpdateBucket] -> ShowS
show :: UpdateBucket -> String
$cshow :: UpdateBucket -> String
showsPrec :: Int -> UpdateBucket -> ShowS
$cshowsPrec :: Int -> UpdateBucket -> ShowS
Prelude.Show, (forall x. UpdateBucket -> Rep UpdateBucket x)
-> (forall x. Rep UpdateBucket x -> UpdateBucket)
-> Generic UpdateBucket
forall x. Rep UpdateBucket x -> UpdateBucket
forall x. UpdateBucket -> Rep UpdateBucket x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdateBucket x -> UpdateBucket
$cfrom :: forall x. UpdateBucket -> Rep UpdateBucket x
Prelude.Generic)

-- |
-- Create a value of 'UpdateBucket' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'readonlyAccessAccounts', 'updateBucket_readonlyAccessAccounts' - An array of strings to specify the AWS account IDs that can access the
-- bucket.
--
-- You can give a maximum of 10 AWS accounts access to a bucket.
--
-- 'accessRules', 'updateBucket_accessRules' - An object that sets the public accessibility of objects in the specified
-- bucket.
--
-- 'versioning', 'updateBucket_versioning' - Specifies whether to enable or suspend versioning of objects in the
-- bucket.
--
-- The following options can be specified:
--
-- -   @Enabled@ - Enables versioning of objects in the specified bucket.
--
-- -   @Suspended@ - Suspends versioning of objects in the specified
--     bucket. Existing object versions are retained.
--
-- 'bucketName', 'updateBucket_bucketName' - The name of the bucket to update.
newUpdateBucket ::
  -- | 'bucketName'
  Prelude.Text ->
  UpdateBucket
newUpdateBucket :: Text -> UpdateBucket
newUpdateBucket Text
pBucketName_ =
  UpdateBucket' :: Maybe [Text]
-> Maybe AccessRules -> Maybe Text -> Text -> UpdateBucket
UpdateBucket'
    { $sel:readonlyAccessAccounts:UpdateBucket' :: Maybe [Text]
readonlyAccessAccounts =
        Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
      $sel:accessRules:UpdateBucket' :: Maybe AccessRules
accessRules = Maybe AccessRules
forall a. Maybe a
Prelude.Nothing,
      $sel:versioning:UpdateBucket' :: Maybe Text
versioning = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:bucketName:UpdateBucket' :: Text
bucketName = Text
pBucketName_
    }

-- | An array of strings to specify the AWS account IDs that can access the
-- bucket.
--
-- You can give a maximum of 10 AWS accounts access to a bucket.
updateBucket_readonlyAccessAccounts :: Lens.Lens' UpdateBucket (Prelude.Maybe [Prelude.Text])
updateBucket_readonlyAccessAccounts :: (Maybe [Text] -> f (Maybe [Text]))
-> UpdateBucket -> f UpdateBucket
updateBucket_readonlyAccessAccounts = (UpdateBucket -> Maybe [Text])
-> (UpdateBucket -> Maybe [Text] -> UpdateBucket)
-> Lens UpdateBucket UpdateBucket (Maybe [Text]) (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateBucket' {Maybe [Text]
readonlyAccessAccounts :: Maybe [Text]
$sel:readonlyAccessAccounts:UpdateBucket' :: UpdateBucket -> Maybe [Text]
readonlyAccessAccounts} -> Maybe [Text]
readonlyAccessAccounts) (\s :: UpdateBucket
s@UpdateBucket' {} Maybe [Text]
a -> UpdateBucket
s {$sel:readonlyAccessAccounts:UpdateBucket' :: Maybe [Text]
readonlyAccessAccounts = Maybe [Text]
a} :: UpdateBucket) ((Maybe [Text] -> f (Maybe [Text]))
 -> UpdateBucket -> f UpdateBucket)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> UpdateBucket
-> f UpdateBucket
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [Text]) (Maybe [Text]) (Maybe [Text])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso [Text] [Text] [Text] [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | An object that sets the public accessibility of objects in the specified
-- bucket.
updateBucket_accessRules :: Lens.Lens' UpdateBucket (Prelude.Maybe AccessRules)
updateBucket_accessRules :: (Maybe AccessRules -> f (Maybe AccessRules))
-> UpdateBucket -> f UpdateBucket
updateBucket_accessRules = (UpdateBucket -> Maybe AccessRules)
-> (UpdateBucket -> Maybe AccessRules -> UpdateBucket)
-> Lens
     UpdateBucket UpdateBucket (Maybe AccessRules) (Maybe AccessRules)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateBucket' {Maybe AccessRules
accessRules :: Maybe AccessRules
$sel:accessRules:UpdateBucket' :: UpdateBucket -> Maybe AccessRules
accessRules} -> Maybe AccessRules
accessRules) (\s :: UpdateBucket
s@UpdateBucket' {} Maybe AccessRules
a -> UpdateBucket
s {$sel:accessRules:UpdateBucket' :: Maybe AccessRules
accessRules = Maybe AccessRules
a} :: UpdateBucket)

-- | Specifies whether to enable or suspend versioning of objects in the
-- bucket.
--
-- The following options can be specified:
--
-- -   @Enabled@ - Enables versioning of objects in the specified bucket.
--
-- -   @Suspended@ - Suspends versioning of objects in the specified
--     bucket. Existing object versions are retained.
updateBucket_versioning :: Lens.Lens' UpdateBucket (Prelude.Maybe Prelude.Text)
updateBucket_versioning :: (Maybe Text -> f (Maybe Text)) -> UpdateBucket -> f UpdateBucket
updateBucket_versioning = (UpdateBucket -> Maybe Text)
-> (UpdateBucket -> Maybe Text -> UpdateBucket)
-> Lens UpdateBucket UpdateBucket (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateBucket' {Maybe Text
versioning :: Maybe Text
$sel:versioning:UpdateBucket' :: UpdateBucket -> Maybe Text
versioning} -> Maybe Text
versioning) (\s :: UpdateBucket
s@UpdateBucket' {} Maybe Text
a -> UpdateBucket
s {$sel:versioning:UpdateBucket' :: Maybe Text
versioning = Maybe Text
a} :: UpdateBucket)

-- | The name of the bucket to update.
updateBucket_bucketName :: Lens.Lens' UpdateBucket Prelude.Text
updateBucket_bucketName :: (Text -> f Text) -> UpdateBucket -> f UpdateBucket
updateBucket_bucketName = (UpdateBucket -> Text)
-> (UpdateBucket -> Text -> UpdateBucket)
-> Lens UpdateBucket UpdateBucket Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateBucket' {Text
bucketName :: Text
$sel:bucketName:UpdateBucket' :: UpdateBucket -> Text
bucketName} -> Text
bucketName) (\s :: UpdateBucket
s@UpdateBucket' {} Text
a -> UpdateBucket
s {$sel:bucketName:UpdateBucket' :: Text
bucketName = Text
a} :: UpdateBucket)

instance Core.AWSRequest UpdateBucket where
  type AWSResponse UpdateBucket = UpdateBucketResponse
  request :: UpdateBucket -> Request UpdateBucket
request = Service -> UpdateBucket -> Request UpdateBucket
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy UpdateBucket
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse UpdateBucket)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse UpdateBucket))
-> Logger
-> Service
-> Proxy UpdateBucket
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse UpdateBucket)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe Bucket -> Maybe [Operation] -> Int -> UpdateBucketResponse
UpdateBucketResponse'
            (Maybe Bucket -> Maybe [Operation] -> Int -> UpdateBucketResponse)
-> Either String (Maybe Bucket)
-> Either String (Maybe [Operation] -> Int -> UpdateBucketResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe Bucket)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"bucket")
            Either String (Maybe [Operation] -> Int -> UpdateBucketResponse)
-> Either String (Maybe [Operation])
-> Either String (Int -> UpdateBucketResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe (Maybe [Operation]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"operations" Either String (Maybe (Maybe [Operation]))
-> Maybe [Operation] -> Either String (Maybe [Operation])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [Operation]
forall a. Monoid a => a
Prelude.mempty)
            Either String (Int -> UpdateBucketResponse)
-> Either String Int -> Either String UpdateBucketResponse
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 UpdateBucket

instance Prelude.NFData UpdateBucket

instance Core.ToHeaders UpdateBucket where
  toHeaders :: UpdateBucket -> ResponseHeaders
toHeaders =
    ResponseHeaders -> UpdateBucket -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
      ( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"X-Amz-Target"
              HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"Lightsail_20161128.UpdateBucket" ::
                          Prelude.ByteString
                      ),
            HeaderName
"Content-Type"
              HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"application/x-amz-json-1.1" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Core.ToJSON UpdateBucket where
  toJSON :: UpdateBucket -> Value
toJSON UpdateBucket' {Maybe [Text]
Maybe Text
Maybe AccessRules
Text
bucketName :: Text
versioning :: Maybe Text
accessRules :: Maybe AccessRules
readonlyAccessAccounts :: Maybe [Text]
$sel:bucketName:UpdateBucket' :: UpdateBucket -> Text
$sel:versioning:UpdateBucket' :: UpdateBucket -> Maybe Text
$sel:accessRules:UpdateBucket' :: UpdateBucket -> Maybe AccessRules
$sel:readonlyAccessAccounts:UpdateBucket' :: UpdateBucket -> Maybe [Text]
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"readonlyAccessAccounts" Text -> [Text] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              ([Text] -> Pair) -> Maybe [Text] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Text]
readonlyAccessAccounts,
            (Text
"accessRules" Text -> AccessRules -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (AccessRules -> Pair) -> Maybe AccessRules -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe AccessRules
accessRules,
            (Text
"versioning" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
versioning,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"bucketName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
bucketName)
          ]
      )

instance Core.ToPath UpdateBucket where
  toPath :: UpdateBucket -> ByteString
toPath = ByteString -> UpdateBucket -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"

instance Core.ToQuery UpdateBucket where
  toQuery :: UpdateBucket -> QueryString
toQuery = QueryString -> UpdateBucket -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty

-- | /See:/ 'newUpdateBucketResponse' smart constructor.
data UpdateBucketResponse = UpdateBucketResponse'
  { -- | An object that describes the bucket that is updated.
    UpdateBucketResponse -> Maybe Bucket
bucket :: Prelude.Maybe Bucket,
    -- | An array of objects that describe the result of the action, such as the
    -- status of the request, the timestamp of the request, and the resources
    -- affected by the request.
    UpdateBucketResponse -> Maybe [Operation]
operations :: Prelude.Maybe [Operation],
    -- | The response's http status code.
    UpdateBucketResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (UpdateBucketResponse -> UpdateBucketResponse -> Bool
(UpdateBucketResponse -> UpdateBucketResponse -> Bool)
-> (UpdateBucketResponse -> UpdateBucketResponse -> Bool)
-> Eq UpdateBucketResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateBucketResponse -> UpdateBucketResponse -> Bool
$c/= :: UpdateBucketResponse -> UpdateBucketResponse -> Bool
== :: UpdateBucketResponse -> UpdateBucketResponse -> Bool
$c== :: UpdateBucketResponse -> UpdateBucketResponse -> Bool
Prelude.Eq, ReadPrec [UpdateBucketResponse]
ReadPrec UpdateBucketResponse
Int -> ReadS UpdateBucketResponse
ReadS [UpdateBucketResponse]
(Int -> ReadS UpdateBucketResponse)
-> ReadS [UpdateBucketResponse]
-> ReadPrec UpdateBucketResponse
-> ReadPrec [UpdateBucketResponse]
-> Read UpdateBucketResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateBucketResponse]
$creadListPrec :: ReadPrec [UpdateBucketResponse]
readPrec :: ReadPrec UpdateBucketResponse
$creadPrec :: ReadPrec UpdateBucketResponse
readList :: ReadS [UpdateBucketResponse]
$creadList :: ReadS [UpdateBucketResponse]
readsPrec :: Int -> ReadS UpdateBucketResponse
$creadsPrec :: Int -> ReadS UpdateBucketResponse
Prelude.Read, Int -> UpdateBucketResponse -> ShowS
[UpdateBucketResponse] -> ShowS
UpdateBucketResponse -> String
(Int -> UpdateBucketResponse -> ShowS)
-> (UpdateBucketResponse -> String)
-> ([UpdateBucketResponse] -> ShowS)
-> Show UpdateBucketResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateBucketResponse] -> ShowS
$cshowList :: [UpdateBucketResponse] -> ShowS
show :: UpdateBucketResponse -> String
$cshow :: UpdateBucketResponse -> String
showsPrec :: Int -> UpdateBucketResponse -> ShowS
$cshowsPrec :: Int -> UpdateBucketResponse -> ShowS
Prelude.Show, (forall x. UpdateBucketResponse -> Rep UpdateBucketResponse x)
-> (forall x. Rep UpdateBucketResponse x -> UpdateBucketResponse)
-> Generic UpdateBucketResponse
forall x. Rep UpdateBucketResponse x -> UpdateBucketResponse
forall x. UpdateBucketResponse -> Rep UpdateBucketResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdateBucketResponse x -> UpdateBucketResponse
$cfrom :: forall x. UpdateBucketResponse -> Rep UpdateBucketResponse x
Prelude.Generic)

-- |
-- Create a value of 'UpdateBucketResponse' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'bucket', 'updateBucketResponse_bucket' - An object that describes the bucket that is updated.
--
-- 'operations', 'updateBucketResponse_operations' - An array of objects that describe the result of the action, such as the
-- status of the request, the timestamp of the request, and the resources
-- affected by the request.
--
-- 'httpStatus', 'updateBucketResponse_httpStatus' - The response's http status code.
newUpdateBucketResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  UpdateBucketResponse
newUpdateBucketResponse :: Int -> UpdateBucketResponse
newUpdateBucketResponse Int
pHttpStatus_ =
  UpdateBucketResponse' :: Maybe Bucket -> Maybe [Operation] -> Int -> UpdateBucketResponse
UpdateBucketResponse'
    { $sel:bucket:UpdateBucketResponse' :: Maybe Bucket
bucket = Maybe Bucket
forall a. Maybe a
Prelude.Nothing,
      $sel:operations:UpdateBucketResponse' :: Maybe [Operation]
operations = Maybe [Operation]
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:UpdateBucketResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | An object that describes the bucket that is updated.
updateBucketResponse_bucket :: Lens.Lens' UpdateBucketResponse (Prelude.Maybe Bucket)
updateBucketResponse_bucket :: (Maybe Bucket -> f (Maybe Bucket))
-> UpdateBucketResponse -> f UpdateBucketResponse
updateBucketResponse_bucket = (UpdateBucketResponse -> Maybe Bucket)
-> (UpdateBucketResponse -> Maybe Bucket -> UpdateBucketResponse)
-> Lens
     UpdateBucketResponse
     UpdateBucketResponse
     (Maybe Bucket)
     (Maybe Bucket)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateBucketResponse' {Maybe Bucket
bucket :: Maybe Bucket
$sel:bucket:UpdateBucketResponse' :: UpdateBucketResponse -> Maybe Bucket
bucket} -> Maybe Bucket
bucket) (\s :: UpdateBucketResponse
s@UpdateBucketResponse' {} Maybe Bucket
a -> UpdateBucketResponse
s {$sel:bucket:UpdateBucketResponse' :: Maybe Bucket
bucket = Maybe Bucket
a} :: UpdateBucketResponse)

-- | An array of objects that describe the result of the action, such as the
-- status of the request, the timestamp of the request, and the resources
-- affected by the request.
updateBucketResponse_operations :: Lens.Lens' UpdateBucketResponse (Prelude.Maybe [Operation])
updateBucketResponse_operations :: (Maybe [Operation] -> f (Maybe [Operation]))
-> UpdateBucketResponse -> f UpdateBucketResponse
updateBucketResponse_operations = (UpdateBucketResponse -> Maybe [Operation])
-> (UpdateBucketResponse
    -> Maybe [Operation] -> UpdateBucketResponse)
-> Lens
     UpdateBucketResponse
     UpdateBucketResponse
     (Maybe [Operation])
     (Maybe [Operation])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateBucketResponse' {Maybe [Operation]
operations :: Maybe [Operation]
$sel:operations:UpdateBucketResponse' :: UpdateBucketResponse -> Maybe [Operation]
operations} -> Maybe [Operation]
operations) (\s :: UpdateBucketResponse
s@UpdateBucketResponse' {} Maybe [Operation]
a -> UpdateBucketResponse
s {$sel:operations:UpdateBucketResponse' :: Maybe [Operation]
operations = Maybe [Operation]
a} :: UpdateBucketResponse) ((Maybe [Operation] -> f (Maybe [Operation]))
 -> UpdateBucketResponse -> f UpdateBucketResponse)
-> ((Maybe [Operation] -> f (Maybe [Operation]))
    -> Maybe [Operation] -> f (Maybe [Operation]))
-> (Maybe [Operation] -> f (Maybe [Operation]))
-> UpdateBucketResponse
-> f UpdateBucketResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Operation] [Operation] [Operation] [Operation]
-> Iso
     (Maybe [Operation])
     (Maybe [Operation])
     (Maybe [Operation])
     (Maybe [Operation])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso [Operation] [Operation] [Operation] [Operation]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The response's http status code.
updateBucketResponse_httpStatus :: Lens.Lens' UpdateBucketResponse Prelude.Int
updateBucketResponse_httpStatus :: (Int -> f Int) -> UpdateBucketResponse -> f UpdateBucketResponse
updateBucketResponse_httpStatus = (UpdateBucketResponse -> Int)
-> (UpdateBucketResponse -> Int -> UpdateBucketResponse)
-> Lens UpdateBucketResponse UpdateBucketResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateBucketResponse' {Int
httpStatus :: Int
$sel:httpStatus:UpdateBucketResponse' :: UpdateBucketResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: UpdateBucketResponse
s@UpdateBucketResponse' {} Int
a -> UpdateBucketResponse
s {$sel:httpStatus:UpdateBucketResponse' :: Int
httpStatus = Int
a} :: UpdateBucketResponse)

instance Prelude.NFData UpdateBucketResponse