packages feed

unkai-storage-0.1.0.1: gen/Unkai/Storage/Projects/HmacKeys/List.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.List
-- 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)
--
-- Retrieves a list of HMAC keys matching the criteria.
--
-- /See:/ <https://developers.google.com/storage/docs/json_api/ Cloud Storage JSON API Reference> for @storage.projects.hmacKeys.list@.
module Unkai.Storage.Projects.HmacKeys.List
  ( -- * Resource
    StorageProjectsHmacKeysListResource,

    -- ** Constructing a Request
    StorageProjectsHmacKeysList (..),
    newStorageProjectsHmacKeysList,
  )
where

import Unkai.Prelude qualified as Core
import Unkai.Storage.Types

-- | A resource alias for @storage.projects.hmacKeys.list@ method which the
-- 'StorageProjectsHmacKeysList' request conforms to.
type StorageProjectsHmacKeysListResource =
  "storage"
    Core.:> "v1"
    Core.:> "projects"
    Core.:> Core.Capture "projectId" Core.Text
    Core.:> "hmacKeys"
    Core.:> Core.QueryParam "maxResults" Core.Word32
    Core.:> Core.QueryParam "pageToken" Core.Text
    Core.:> Core.QueryParam "serviceAccountEmail" Core.Text
    Core.:> Core.QueryParam "showDeletedKeys" Core.Bool
    Core.:> Core.QueryParam "userProject" Core.Text
    Core.:> Core.QueryParam "alt" Core.AltJSON
    Core.:> Core.Get '[Core.JSON] HmacKeysMetadata

-- | Retrieves a list of HMAC keys matching the criteria.
--
-- /See:/ 'newStorageProjectsHmacKeysList' smart constructor.
data StorageProjectsHmacKeysList = StorageProjectsHmacKeysList
  { -- | Maximum number of items to return in a single page of responses. The service uses this parameter or 250 items, whichever is smaller. The max number of items per page will also be limited by the number of distinct service accounts in the response. If the number of service accounts in a single response is too high, the page will truncated and a next page token will be returned.
    maxResults :: Core.Word32,
    -- | A previously-returned page token representing part of the larger set of results to view.
    pageToken :: (Core.Maybe Core.Text),
    -- | Name of the project in which to look for HMAC keys.
    projectId :: Core.Text,
    -- | If present, only keys for the given service account are returned.
    serviceAccountEmail :: (Core.Maybe Core.Text),
    -- | Whether or not to show keys in the DELETED state.
    showDeletedKeys :: (Core.Maybe Core.Bool),
    -- | 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 'StorageProjectsHmacKeysList' with the minimum fields required to make a request.
newStorageProjectsHmacKeysList ::
  -- |  Name of the project in which to look for HMAC keys. See 'projectId'.
  Core.Text ->
  StorageProjectsHmacKeysList
newStorageProjectsHmacKeysList projectId =
  StorageProjectsHmacKeysList
    { maxResults = 250,
      pageToken = Core.Nothing,
      projectId = projectId,
      serviceAccountEmail = Core.Nothing,
      showDeletedKeys = Core.Nothing,
      userProject = Core.Nothing
    }

instance Core.GoogleRequest StorageProjectsHmacKeysList where
  type Rs StorageProjectsHmacKeysList = HmacKeysMetadata
  type
    Scopes StorageProjectsHmacKeysList =
      '[ CloudPlatform'FullControl,
         CloudPlatform'ReadOnly,
         Devstorage'FullControl,
         Devstorage'ReadOnly
       ]
  requestClient StorageProjectsHmacKeysList {..} =
    go
      projectId
      (Core.Just maxResults)
      pageToken
      serviceAccountEmail
      showDeletedKeys
      userProject
      (Core.Just Core.AltJSON)
      storageService
    where
      go =
        Core.buildClient
          (Core.Proxy :: Core.Proxy StorageProjectsHmacKeysListResource)
          Core.mempty