gogol-drive-1.0.0: gen/Gogol/Drive/Files/ListLabels.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 : Gogol.Drive.Files.ListLabels
-- Copyright : (c) 2015-2025 Brendan Hay
-- License : Mozilla Public License, v. 2.0.
-- Maintainer : Brendan Hay <brendan.g.hay+gogol@gmail.com>
-- Toni Cebrián <toni@tonicebrian.com>
-- Stability : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Lists the labels on a file.
--
-- /See:/ <https://developers.google.com/drive/ Google Drive API Reference> for @drive.files.listLabels@.
module Gogol.Drive.Files.ListLabels
( -- * Resource
DriveFilesListLabelsResource,
-- ** Constructing a Request
DriveFilesListLabels (..),
newDriveFilesListLabels,
)
where
import Gogol.Drive.Types
import Gogol.Prelude qualified as Core
-- | A resource alias for @drive.files.listLabels@ method which the
-- 'DriveFilesListLabels' request conforms to.
type DriveFilesListLabelsResource =
"drive"
Core.:> "v3"
Core.:> "files"
Core.:> Core.Capture "fileId" Core.Text
Core.:> "listLabels"
Core.:> Core.QueryParam "$.xgafv" Xgafv
Core.:> Core.QueryParam "access_token" Core.Text
Core.:> Core.QueryParam "callback" Core.Text
Core.:> Core.QueryParam "maxResults" Core.Int32
Core.:> Core.QueryParam "pageToken" Core.Text
Core.:> Core.QueryParam "uploadType" Core.Text
Core.:> Core.QueryParam "upload_protocol" Core.Text
Core.:> Core.QueryParam "alt" Core.AltJSON
Core.:> Core.Get '[Core.JSON] LabelList
-- | Lists the labels on a file.
--
-- /See:/ 'newDriveFilesListLabels' smart constructor.
data DriveFilesListLabels = DriveFilesListLabels
{ -- | V1 error format.
xgafv :: (Core.Maybe Xgafv),
-- | OAuth access token.
accessToken :: (Core.Maybe Core.Text),
-- | JSONP
callback :: (Core.Maybe Core.Text),
-- | The ID for the file.
fileId :: Core.Text,
-- | The maximum number of labels to return per page. When not set, defaults to 100.
maxResults :: Core.Int32,
-- | The token for continuing a previous list request on the next page. This should be set to the value of \'nextPageToken\' from the previous response.
pageToken :: (Core.Maybe Core.Text),
-- | Legacy upload protocol for media (e.g. \"media\", \"multipart\").
uploadType :: (Core.Maybe Core.Text),
-- | Upload protocol for media (e.g. \"raw\", \"multipart\").
uploadProtocol :: (Core.Maybe Core.Text)
}
deriving (Core.Eq, Core.Show, Core.Generic)
-- | Creates a value of 'DriveFilesListLabels' with the minimum fields required to make a request.
newDriveFilesListLabels ::
-- | The ID for the file. See 'fileId'.
Core.Text ->
DriveFilesListLabels
newDriveFilesListLabels fileId =
DriveFilesListLabels
{ xgafv = Core.Nothing,
accessToken = Core.Nothing,
callback = Core.Nothing,
fileId = fileId,
maxResults = 100,
pageToken = Core.Nothing,
uploadType = Core.Nothing,
uploadProtocol = Core.Nothing
}
instance Core.GoogleRequest DriveFilesListLabels where
type Rs DriveFilesListLabels = LabelList
type
Scopes DriveFilesListLabels =
'[ Drive'FullControl,
Drive'File,
Drive'Meet'Readonly,
Drive'Metadata,
Drive'Metadata'Readonly,
Drive'Readonly
]
requestClient DriveFilesListLabels {..} =
go
fileId
xgafv
accessToken
callback
(Core.Just maxResults)
pageToken
uploadType
uploadProtocol
(Core.Just Core.AltJSON)
driveService
where
go =
Core.buildClient
(Core.Proxy :: Core.Proxy DriveFilesListLabelsResource)
Core.mempty