{-# 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.AppsLicensing.Licensing.LicenseAssignments.ListForProductAndSku
-- 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)
--
-- List all users assigned licenses for a specific product SKU.
--
-- /See:/ <https://developers.google.com/admin-sdk/licensing/ Enterprise License Manager API Reference> for @licensing.licenseAssignments.listForProductAndSku@.
module Gogol.AppsLicensing.Licensing.LicenseAssignments.ListForProductAndSku
  ( -- * Resource
    LicensingLicenseAssignmentsListForProductAndSkuResource,

    -- ** Constructing a Request
    LicensingLicenseAssignmentsListForProductAndSku (..),
    newLicensingLicenseAssignmentsListForProductAndSku,
  )
where

import Gogol.AppsLicensing.Types
import Gogol.Prelude qualified as Core

-- | A resource alias for @licensing.licenseAssignments.listForProductAndSku@ method which the
-- 'LicensingLicenseAssignmentsListForProductAndSku' request conforms to.
type LicensingLicenseAssignmentsListForProductAndSkuResource =
  "apps"
    Core.:> "licensing"
    Core.:> "v1"
    Core.:> "product"
    Core.:> Core.Capture "productId" Core.Text
    Core.:> "sku"
    Core.:> Core.Capture "skuId" Core.Text
    Core.:> "users"
    Core.:> Core.QueryParam "customerId" Core.Text
    Core.:> Core.QueryParam "$.xgafv" Xgafv
    Core.:> Core.QueryParam "access_token" Core.Text
    Core.:> Core.QueryParam "callback" Core.Text
    Core.:> Core.QueryParam "maxResults" Core.Word32
    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] LicenseAssignmentList

-- | List all users assigned licenses for a specific product SKU.
--
-- /See:/ 'newLicensingLicenseAssignmentsListForProductAndSku' smart constructor.
data LicensingLicenseAssignmentsListForProductAndSku = LicensingLicenseAssignmentsListForProductAndSku
  { -- | V1 error format.
    LicensingLicenseAssignmentsListForProductAndSku -> Maybe Xgafv
xgafv :: (Core.Maybe Xgafv),
    -- | OAuth access token.
    LicensingLicenseAssignmentsListForProductAndSku -> Maybe Text
accessToken :: (Core.Maybe Core.Text),
    -- | JSONP
    LicensingLicenseAssignmentsListForProductAndSku -> Maybe Text
callback :: (Core.Maybe Core.Text),
    -- | The customer\'s unique ID as defined in the Admin console, such as @C00000000@. If the customer is suspended, the server returns an error.
    LicensingLicenseAssignmentsListForProductAndSku -> Text
customerId :: Core.Text,
    -- | The @maxResults@ query string determines how many entries are returned on each page of a large response. This is an optional parameter. The value must be a positive number.
    LicensingLicenseAssignmentsListForProductAndSku -> Word32
maxResults :: Core.Word32,
    -- | Token to fetch the next page of data. The @maxResults@ query string is related to the @pageToken@ since @maxResults@ determines how many entries are returned on each page. This is an optional query string. If not specified, the server returns the first page.
    LicensingLicenseAssignmentsListForProductAndSku -> Text
pageToken :: Core.Text,
    -- | A product\'s unique identifier. For more information about products in this version of the API, see Products and SKUs.
    LicensingLicenseAssignmentsListForProductAndSku -> Text
productId :: Core.Text,
    -- | A product SKU\'s unique identifier. For more information about available SKUs in this version of the API, see Products and SKUs.
    LicensingLicenseAssignmentsListForProductAndSku -> Text
skuId :: Core.Text,
    -- | Legacy upload protocol for media (e.g. \"media\", \"multipart\").
    LicensingLicenseAssignmentsListForProductAndSku -> Maybe Text
uploadType :: (Core.Maybe Core.Text),
    -- | Upload protocol for media (e.g. \"raw\", \"multipart\").
    LicensingLicenseAssignmentsListForProductAndSku -> Maybe Text
uploadProtocol :: (Core.Maybe Core.Text)
  }
  deriving (LicensingLicenseAssignmentsListForProductAndSku
-> LicensingLicenseAssignmentsListForProductAndSku -> Bool
(LicensingLicenseAssignmentsListForProductAndSku
 -> LicensingLicenseAssignmentsListForProductAndSku -> Bool)
-> (LicensingLicenseAssignmentsListForProductAndSku
    -> LicensingLicenseAssignmentsListForProductAndSku -> Bool)
-> Eq LicensingLicenseAssignmentsListForProductAndSku
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: LicensingLicenseAssignmentsListForProductAndSku
-> LicensingLicenseAssignmentsListForProductAndSku -> Bool
== :: LicensingLicenseAssignmentsListForProductAndSku
-> LicensingLicenseAssignmentsListForProductAndSku -> Bool
$c/= :: LicensingLicenseAssignmentsListForProductAndSku
-> LicensingLicenseAssignmentsListForProductAndSku -> Bool
/= :: LicensingLicenseAssignmentsListForProductAndSku
-> LicensingLicenseAssignmentsListForProductAndSku -> Bool
Core.Eq, Int -> LicensingLicenseAssignmentsListForProductAndSku -> ShowS
[LicensingLicenseAssignmentsListForProductAndSku] -> ShowS
LicensingLicenseAssignmentsListForProductAndSku -> String
(Int -> LicensingLicenseAssignmentsListForProductAndSku -> ShowS)
-> (LicensingLicenseAssignmentsListForProductAndSku -> String)
-> ([LicensingLicenseAssignmentsListForProductAndSku] -> ShowS)
-> Show LicensingLicenseAssignmentsListForProductAndSku
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> LicensingLicenseAssignmentsListForProductAndSku -> ShowS
showsPrec :: Int -> LicensingLicenseAssignmentsListForProductAndSku -> ShowS
$cshow :: LicensingLicenseAssignmentsListForProductAndSku -> String
show :: LicensingLicenseAssignmentsListForProductAndSku -> String
$cshowList :: [LicensingLicenseAssignmentsListForProductAndSku] -> ShowS
showList :: [LicensingLicenseAssignmentsListForProductAndSku] -> ShowS
Core.Show, (forall x.
 LicensingLicenseAssignmentsListForProductAndSku
 -> Rep LicensingLicenseAssignmentsListForProductAndSku x)
-> (forall x.
    Rep LicensingLicenseAssignmentsListForProductAndSku x
    -> LicensingLicenseAssignmentsListForProductAndSku)
-> Generic LicensingLicenseAssignmentsListForProductAndSku
forall x.
Rep LicensingLicenseAssignmentsListForProductAndSku x
-> LicensingLicenseAssignmentsListForProductAndSku
forall x.
LicensingLicenseAssignmentsListForProductAndSku
-> Rep LicensingLicenseAssignmentsListForProductAndSku x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x.
LicensingLicenseAssignmentsListForProductAndSku
-> Rep LicensingLicenseAssignmentsListForProductAndSku x
from :: forall x.
LicensingLicenseAssignmentsListForProductAndSku
-> Rep LicensingLicenseAssignmentsListForProductAndSku x
$cto :: forall x.
Rep LicensingLicenseAssignmentsListForProductAndSku x
-> LicensingLicenseAssignmentsListForProductAndSku
to :: forall x.
Rep LicensingLicenseAssignmentsListForProductAndSku x
-> LicensingLicenseAssignmentsListForProductAndSku
Core.Generic)

-- | Creates a value of 'LicensingLicenseAssignmentsListForProductAndSku' with the minimum fields required to make a request.
newLicensingLicenseAssignmentsListForProductAndSku ::
  -- |  The customer\'s unique ID as defined in the Admin console, such as @C00000000@. If the customer is suspended, the server returns an error. See 'customerId'.
  Core.Text ->
  -- |  A product\'s unique identifier. For more information about products in this version of the API, see Products and SKUs. See 'productId'.
  Core.Text ->
  -- |  A product SKU\'s unique identifier. For more information about available SKUs in this version of the API, see Products and SKUs. See 'skuId'.
  Core.Text ->
  LicensingLicenseAssignmentsListForProductAndSku
newLicensingLicenseAssignmentsListForProductAndSku :: Text
-> Text -> Text -> LicensingLicenseAssignmentsListForProductAndSku
newLicensingLicenseAssignmentsListForProductAndSku
  Text
customerId
  Text
productId
  Text
skuId =
    LicensingLicenseAssignmentsListForProductAndSku
      { xgafv :: Maybe Xgafv
xgafv =
          Maybe Xgafv
forall a. Maybe a
Core.Nothing,
        accessToken :: Maybe Text
accessToken = Maybe Text
forall a. Maybe a
Core.Nothing,
        callback :: Maybe Text
callback = Maybe Text
forall a. Maybe a
Core.Nothing,
        customerId :: Text
customerId = Text
customerId,
        maxResults :: Word32
maxResults = Word32
100,
        pageToken :: Text
pageToken = Text
"",
        productId :: Text
productId = Text
productId,
        skuId :: Text
skuId = Text
skuId,
        uploadType :: Maybe Text
uploadType = Maybe Text
forall a. Maybe a
Core.Nothing,
        uploadProtocol :: Maybe Text
uploadProtocol = Maybe Text
forall a. Maybe a
Core.Nothing
      }

instance
  Core.GoogleRequest
    LicensingLicenseAssignmentsListForProductAndSku
  where
  type
    Rs LicensingLicenseAssignmentsListForProductAndSku =
      LicenseAssignmentList
  type
    Scopes LicensingLicenseAssignmentsListForProductAndSku =
      '[Apps'Licensing]
  requestClient :: LicensingLicenseAssignmentsListForProductAndSku
-> GClient (Rs LicensingLicenseAssignmentsListForProductAndSku)
requestClient LicensingLicenseAssignmentsListForProductAndSku {Maybe Text
Maybe Xgafv
Word32
Text
xgafv :: LicensingLicenseAssignmentsListForProductAndSku -> Maybe Xgafv
accessToken :: LicensingLicenseAssignmentsListForProductAndSku -> Maybe Text
callback :: LicensingLicenseAssignmentsListForProductAndSku -> Maybe Text
customerId :: LicensingLicenseAssignmentsListForProductAndSku -> Text
maxResults :: LicensingLicenseAssignmentsListForProductAndSku -> Word32
pageToken :: LicensingLicenseAssignmentsListForProductAndSku -> Text
productId :: LicensingLicenseAssignmentsListForProductAndSku -> Text
skuId :: LicensingLicenseAssignmentsListForProductAndSku -> Text
uploadType :: LicensingLicenseAssignmentsListForProductAndSku -> Maybe Text
uploadProtocol :: LicensingLicenseAssignmentsListForProductAndSku -> Maybe Text
xgafv :: Maybe Xgafv
accessToken :: Maybe Text
callback :: Maybe Text
customerId :: Text
maxResults :: Word32
pageToken :: Text
productId :: Text
skuId :: Text
uploadType :: Maybe Text
uploadProtocol :: Maybe Text
..} =
    Text
-> Text
-> Maybe Text
-> Maybe Xgafv
-> Maybe Text
-> Maybe Text
-> Maybe Word32
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe AltJSON
-> ServiceConfig
-> GClient LicenseAssignmentList
go
      Text
productId
      Text
skuId
      (Text -> Maybe Text
forall a. a -> Maybe a
Core.Just Text
customerId)
      Maybe Xgafv
xgafv
      Maybe Text
accessToken
      Maybe Text
callback
      (Word32 -> Maybe Word32
forall a. a -> Maybe a
Core.Just Word32
maxResults)
      (Text -> Maybe Text
forall a. a -> Maybe a
Core.Just Text
pageToken)
      Maybe Text
uploadType
      Maybe Text
uploadProtocol
      (AltJSON -> Maybe AltJSON
forall a. a -> Maybe a
Core.Just AltJSON
Core.AltJSON)
      ServiceConfig
appsLicensingService
    where
      go :: Fn LicensingLicenseAssignmentsListForProductAndSkuResource
go =
        Proxy LicensingLicenseAssignmentsListForProductAndSkuResource
-> Request
-> Fn LicensingLicenseAssignmentsListForProductAndSkuResource
forall {k} (fn :: k).
GoogleClient fn =>
Proxy fn -> Request -> Fn fn
Core.buildClient
          ( Proxy LicensingLicenseAssignmentsListForProductAndSkuResource
forall {k} (t :: k). Proxy t
Core.Proxy ::
              Core.Proxy LicensingLicenseAssignmentsListForProductAndSkuResource
          )
          Request
forall a. Monoid a => a
Core.mempty