listForProductAndSku method
List all users assigned licenses for a specific product SKU.
Request parameters:
productId
- A product's unique identifier. For more information about
products in this version of the API, see Products and SKUs.
skuId
- A product SKU's unique identifier. For more information about
available SKUs in this version of the API, see Products and SKUs.
customerId
- The customer's unique ID as defined in the Admin console,
such as C00000000
. If the customer is suspended, the server returns an
error.
maxResults
- 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.
Value must be between "1" and "1000".
pageToken
- 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.
$fields
- Selector specifying which fields to include in a partial
response.
Completes with a LicenseAssignmentList.
Completes with a commons.ApiRequestError if the API endpoint returned an error.
If the used http.Client
completes with an error when making a REST call,
this method will complete with the same error.
Implementation
async.Future<LicenseAssignmentList> listForProductAndSku(
core.String productId,
core.String skuId,
core.String customerId, {
core.int? maxResults,
core.String? pageToken,
core.String? $fields,
}) async {
final queryParams_ = <core.String, core.List<core.String>>{
'customerId': [customerId],
if (maxResults != null) 'maxResults': ['${maxResults}'],
if (pageToken != null) 'pageToken': [pageToken],
if ($fields != null) 'fields': [$fields],
};
final url_ = 'apps/licensing/v1/product/' +
commons.escapeVariable('$productId') +
'/sku/' +
commons.escapeVariable('$skuId') +
'/users';
final response_ = await _requester.request(
url_,
'GET',
queryParams: queryParams_,
);
return LicenseAssignmentList.fromJson(
response_ as core.Map<core.String, core.dynamic>);
}