unkai-storage-0.1.0.1: gen/Unkai/Storage/ManagedFolders/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.ManagedFolders.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 a managed folder using patch semantics.
--
-- /See:/ <https://developers.google.com/storage/docs/json_api/ Cloud Storage JSON API Reference> for @storage.managedFolders.update@.
module Unkai.Storage.ManagedFolders.Update
( -- * Resource
StorageManagedFoldersUpdateResource,
-- ** Constructing a Request
StorageManagedFoldersUpdate (..),
newStorageManagedFoldersUpdate,
)
where
import Unkai.Prelude qualified as Core
import Unkai.Storage.Types
-- | A resource alias for @storage.managedFolders.update@ method which the
-- 'StorageManagedFoldersUpdate' request conforms to.
type StorageManagedFoldersUpdateResource =
"storage"
Core.:> "v1"
Core.:> "b"
Core.:> Core.Capture "bucket" Core.Text
Core.:> "managedFolders"
Core.:> Core.Capture "managedFolder" Core.Text
Core.:> Core.QueryParam "ifMetagenerationMatch" Core.Int64
Core.:> Core.QueryParam "ifMetagenerationNotMatch" Core.Int64
Core.:> Core.QueryParam "alt" Core.AltJSON
Core.:> Core.ReqBody '[Core.JSON] ManagedFolderPatch
Core.:> Core.Patch '[Core.JSON] ManagedFolder
-- | Updates a managed folder using patch semantics.
--
-- /See:/ 'newStorageManagedFoldersUpdate' smart constructor.
data StorageManagedFoldersUpdate = StorageManagedFoldersUpdate
{ -- | The name of the bucket containing the managed folder.
bucket :: Core.Text,
-- | Makes the operation conditional on whether the metageneration of the managed folder matches the specified value.
ifMetagenerationMatch :: (Core.Maybe Core.Int64),
-- | Makes the operation conditional on whether the metageneration of the managed folder doesn\'t match the specified value.
ifMetagenerationNotMatch :: (Core.Maybe Core.Int64),
-- | The name of the managed folder.
managedFolder :: Core.Text,
-- | Request body.
payload :: ManagedFolderPatch
}
deriving stock (Core.Eq, Core.Show, Core.Generic)
-- | Creates a value of 'StorageManagedFoldersUpdate' with the minimum fields required to make a request.
newStorageManagedFoldersUpdate ::
-- | The name of the bucket containing the managed folder. See 'bucket'.
Core.Text ->
-- | The name of the managed folder. See 'managedFolder'.
Core.Text ->
-- | Request body. See 'payload'.
ManagedFolderPatch ->
StorageManagedFoldersUpdate
newStorageManagedFoldersUpdate bucket managedFolder payload =
StorageManagedFoldersUpdate
{ bucket = bucket,
ifMetagenerationMatch = Core.Nothing,
ifMetagenerationNotMatch = Core.Nothing,
managedFolder = managedFolder,
payload = payload
}
instance Core.GoogleRequest StorageManagedFoldersUpdate where
type Rs StorageManagedFoldersUpdate = ManagedFolder
type
Scopes StorageManagedFoldersUpdate =
'[ CloudPlatform'FullControl,
Devstorage'FullControl,
Devstorage'ReadWrite
]
requestClient StorageManagedFoldersUpdate {..} =
go
bucket
managedFolder
ifMetagenerationMatch
ifMetagenerationNotMatch
(Core.Just Core.AltJSON)
payload
storageService
where
go =
Core.buildClient
(Core.Proxy :: Core.Proxy StorageManagedFoldersUpdateResource)
Core.mempty