packages feed

unkai-storage-0.1.0.1: gen/Unkai/Storage/Buckets/Operations/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.Buckets.Operations.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)
--
-- Lists operations that match the specified filter in the request.
--
-- /See:/ <https://developers.google.com/storage/docs/json_api/ Cloud Storage JSON API Reference> for @storage.buckets.operations.list@.
module Unkai.Storage.Buckets.Operations.List
  ( -- * Resource
    StorageBucketsOperationsListResource,

    -- ** Constructing a Request
    StorageBucketsOperationsList (..),
    newStorageBucketsOperationsList,
  )
where

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

-- | A resource alias for @storage.buckets.operations.list@ method which the
-- 'StorageBucketsOperationsList' request conforms to.
type StorageBucketsOperationsListResource =
  "storage"
    Core.:> "v1"
    Core.:> "b"
    Core.:> Core.Capture "bucket" Core.Text
    Core.:> "operations"
    Core.:> Core.QueryParam "filter" Core.Text
    Core.:> Core.QueryParam "pageSize" Core.Int32
    Core.:> Core.QueryParam "pageToken" Core.Text
    Core.:> Core.QueryParam "alt" Core.AltJSON
    Core.:> Core.Get '[Core.JSON] GoogleLongrunningListOperationsResponse

-- | Lists operations that match the specified filter in the request.
--
-- /See:/ 'newStorageBucketsOperationsList' smart constructor.
data StorageBucketsOperationsList = StorageBucketsOperationsList
  { -- | Name of the bucket in which to look for operations.
    bucket :: Core.Text,
    -- | A filter to narrow down results to a preferred subset. The filtering language is documented in more detail in <https://google.aip.dev/160 AIP-160>.
    filter :: (Core.Maybe Core.Text),
    -- | Maximum number of items to return in a single page of responses. Fewer total results may be returned than requested. The service uses this parameter or 100 items, whichever is smaller.
    pageSize :: (Core.Maybe Core.Int32),
    -- | A previously-returned page token representing part of the larger set of results to view.
    pageToken :: (Core.Maybe Core.Text)
  }
  deriving stock (Core.Eq, Core.Show, Core.Generic)

-- | Creates a value of 'StorageBucketsOperationsList' with the minimum fields required to make a request.
newStorageBucketsOperationsList ::
  -- |  Name of the bucket in which to look for operations. See 'bucket'.
  Core.Text ->
  StorageBucketsOperationsList
newStorageBucketsOperationsList bucket =
  StorageBucketsOperationsList
    { bucket = bucket,
      filter = Core.Nothing,
      pageSize = Core.Nothing,
      pageToken = Core.Nothing
    }

instance Core.GoogleRequest StorageBucketsOperationsList where
  type
    Rs StorageBucketsOperationsList =
      GoogleLongrunningListOperationsResponse
  type
    Scopes StorageBucketsOperationsList =
      '[ CloudPlatform'FullControl,
         CloudPlatform'ReadOnly,
         Devstorage'FullControl,
         Devstorage'ReadOnly,
         Devstorage'ReadWrite
       ]
  requestClient StorageBucketsOperationsList {..} =
    go
      bucket
      filter
      pageSize
      pageToken
      (Core.Just Core.AltJSON)
      storageService
    where
      go =
        Core.buildClient
          (Core.Proxy :: Core.Proxy StorageBucketsOperationsListResource)
          Core.mempty