unkai-storage-0.1.0.1: gen/Unkai/Storage/Projects/HmacKeys/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.Projects.HmacKeys.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 the state of an HMAC key. See the <https://cloud.google.com/storage/docs/json_api/v1/projects/hmacKeys/update#request-body HMAC Key resource descriptor> for valid states.
--
-- /See:/ <https://developers.google.com/storage/docs/json_api/ Cloud Storage JSON API Reference> for @storage.projects.hmacKeys.update@.
module Unkai.Storage.Projects.HmacKeys.Update
( -- * Resource
StorageProjectsHmacKeysUpdateResource,
-- ** Constructing a Request
StorageProjectsHmacKeysUpdate (..),
newStorageProjectsHmacKeysUpdate,
)
where
import Unkai.Prelude qualified as Core
import Unkai.Storage.Types
-- | A resource alias for @storage.projects.hmacKeys.update@ method which the
-- 'StorageProjectsHmacKeysUpdate' request conforms to.
type StorageProjectsHmacKeysUpdateResource =
"storage"
Core.:> "v1"
Core.:> "projects"
Core.:> Core.Capture "projectId" Core.Text
Core.:> "hmacKeys"
Core.:> Core.Capture "accessId" Core.Text
Core.:> Core.QueryParam "userProject" Core.Text
Core.:> Core.QueryParam "alt" Core.AltJSON
Core.:> Core.ReqBody '[Core.JSON] HmacKeyMetadata
Core.:> Core.Put '[Core.JSON] HmacKeyMetadata
-- | Updates the state of an HMAC key. See the <https://cloud.google.com/storage/docs/json_api/v1/projects/hmacKeys/update#request-body HMAC Key resource descriptor> for valid states.
--
-- /See:/ 'newStorageProjectsHmacKeysUpdate' smart constructor.
data StorageProjectsHmacKeysUpdate = StorageProjectsHmacKeysUpdate
{ -- | Name of the HMAC key being updated.
accessId :: Core.Text,
-- | Request body.
payload :: HmacKeyMetadata,
-- | Project ID owning the service account of the updated key.
projectId :: Core.Text,
-- | The project to be billed for this request.
userProject :: (Core.Maybe Core.Text)
}
deriving stock (Core.Eq, Core.Show, Core.Generic)
-- | Creates a value of 'StorageProjectsHmacKeysUpdate' with the minimum fields required to make a request.
newStorageProjectsHmacKeysUpdate ::
-- | Project ID owning the service account of the updated key. See 'projectId'.
Core.Text ->
-- | Name of the HMAC key being updated. See 'accessId'.
Core.Text ->
-- | Request body. See 'payload'.
HmacKeyMetadata ->
StorageProjectsHmacKeysUpdate
newStorageProjectsHmacKeysUpdate projectId accessId payload =
StorageProjectsHmacKeysUpdate
{ accessId = accessId,
payload = payload,
projectId = projectId,
userProject = Core.Nothing
}
instance Core.GoogleRequest StorageProjectsHmacKeysUpdate where
type Rs StorageProjectsHmacKeysUpdate = HmacKeyMetadata
type
Scopes StorageProjectsHmacKeysUpdate =
'[CloudPlatform'FullControl, Devstorage'FullControl]
requestClient StorageProjectsHmacKeysUpdate {..} =
go
projectId
accessId
userProject
(Core.Just Core.AltJSON)
payload
storageService
where
go =
Core.buildClient
(Core.Proxy :: Core.Proxy StorageProjectsHmacKeysUpdateResource)
Core.mempty