unkai-storage-0.1.0.1: gen/Unkai/Storage/ObjectAccessControls/Update.hs
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DerivingStrategies #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE ImportQualifiedPost #-}
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE PatternSynonyms #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-duplicate-exports #-}
{-# OPTIONS_GHC -fno-warn-name-shadowing #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}
-- |
-- Module : Unkai.Storage.ObjectAccessControls.Update
-- Copyright : (c) 2015-2025 Brendan Hay
-- License : Mozilla Public License, v. 2.0.
-- Maintainer : Nadeem Bitar <nadeem@gmail.com>
-- Stability : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Updates an ACL entry on the specified object.
--
-- /See:/ <https://developers.google.com/storage/docs/json_api/ Cloud Storage JSON API Reference> for @storage.objectAccessControls.update@.
module Unkai.Storage.ObjectAccessControls.Update
( -- * Resource
StorageObjectAccessControlsUpdateResource,
-- ** Constructing a Request
StorageObjectAccessControlsUpdate (..),
newStorageObjectAccessControlsUpdate,
)
where
import Unkai.Prelude qualified as Core
import Unkai.Storage.Types
-- | A resource alias for @storage.objectAccessControls.update@ method which the
-- 'StorageObjectAccessControlsUpdate' request conforms to.
type StorageObjectAccessControlsUpdateResource =
"storage"
Core.:> "v1"
Core.:> "b"
Core.:> Core.Capture "bucket" Core.Text
Core.:> "o"
Core.:> Core.Capture "object" Core.Text
Core.:> "acl"
Core.:> Core.Capture "entity" Core.Text
Core.:> Core.QueryParam "generation" Core.Int64
Core.:> Core.QueryParam "userProject" Core.Text
Core.:> Core.QueryParam "alt" Core.AltJSON
Core.:> Core.ReqBody '[Core.JSON] ObjectAccessControl
Core.:> Core.Put '[Core.JSON] ObjectAccessControl
-- | Updates an ACL entry on the specified object.
--
-- /See:/ 'newStorageObjectAccessControlsUpdate' smart constructor.
data StorageObjectAccessControlsUpdate = StorageObjectAccessControlsUpdate
{ -- | Name of a bucket.
bucket :: Core.Text,
-- | The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.
entity :: Core.Text,
-- | If present, selects a specific revision of this object (as opposed to the latest version, the default).
generation :: (Core.Maybe Core.Int64),
-- | Name of the object. For information about how to URL encode object names to be path safe, see <https://cloud.google.com/storage/docs/request-endpoints#encoding Encoding URI Path Parts>.
object :: Core.Text,
-- | Request body.
payload :: ObjectAccessControl,
-- | The project to be billed for this request. Required for Requester Pays buckets.
userProject :: (Core.Maybe Core.Text)
}
deriving stock (Core.Eq, Core.Show, Core.Generic)
-- | Creates a value of 'StorageObjectAccessControlsUpdate' with the minimum fields required to make a request.
newStorageObjectAccessControlsUpdate ::
-- | Name of a bucket. See 'bucket'.
Core.Text ->
-- | Name of the object. For information about how to URL encode object names to be path safe, see <https://cloud.google.com/storage/docs/request-endpoints#encoding Encoding URI Path Parts>. See 'object'.
Core.Text ->
-- | The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers. See 'entity'.
Core.Text ->
-- | Request body. See 'payload'.
ObjectAccessControl ->
StorageObjectAccessControlsUpdate
newStorageObjectAccessControlsUpdate bucket object entity payload =
StorageObjectAccessControlsUpdate
{ bucket = bucket,
entity = entity,
generation = Core.Nothing,
object = object,
payload = payload,
userProject = Core.Nothing
}
instance Core.GoogleRequest StorageObjectAccessControlsUpdate where
type Rs StorageObjectAccessControlsUpdate = ObjectAccessControl
type
Scopes StorageObjectAccessControlsUpdate =
'[CloudPlatform'FullControl, Devstorage'FullControl]
requestClient StorageObjectAccessControlsUpdate {..} =
go
bucket
object
entity
generation
userProject
(Core.Just Core.AltJSON)
payload
storageService
where
go =
Core.buildClient
( Core.Proxy ::
Core.Proxy StorageObjectAccessControlsUpdateResource
)
Core.mempty