insert method
Future<LicenseAssignment>
insert(
- LicenseAssignmentInsert request,
- String productId,
- String skuId, {
- String? $fields,
Assign a license.
request
- The metadata request object.
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.
$fields
- Selector specifying which fields to include in a partial
response.
Completes with a LicenseAssignment.
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<LicenseAssignment> insert(
LicenseAssignmentInsert request,
core.String productId,
core.String skuId, {
core.String? $fields,
}) async {
final body_ = convert.json.encode(request);
final queryParams_ = <core.String, core.List<core.String>>{
if ($fields != null) 'fields': [$fields],
};
final url_ = 'apps/licensing/v1/product/' +
commons.escapeVariable('$productId') +
'/sku/' +
commons.escapeVariable('$skuId') +
'/user';
final response_ = await _requester.request(
url_,
'POST',
body: body_,
queryParams: queryParams_,
);
return LicenseAssignment.fromJson(
response_ as core.Map<core.String, core.dynamic>);
}