generateApprovalUrl method

Future<ProductsGenerateApprovalUrlResponse> generateApprovalUrl(
  1. String enterpriseId,
  2. String productId, {
  3. String? languageCode,
  4. String? $fields,
})

Generates a URL that can be rendered in an iframe to display the permissions (if any) of a product.

An enterprise admin must view these permissions and accept them on behalf of their organization in order to approve that product. Admins should accept the displayed permissions by interacting with a separate UI element in the EMM console, which in turn should trigger the use of this URL as the approvalUrlInfo.approvalUrl property in a Products.approve call to approve the product. This URL can only be used to display permissions for up to 1 day. Note: This item has been deprecated. New integrations cannot use this method and can refer to our new recommendations.

Request parameters:

enterpriseId - The ID of the enterprise.

productId - The ID of the product.

languageCode - The BCP 47 language code used for permission names and descriptions in the returned iframe, for instance "en-US".

$fields - Selector specifying which fields to include in a partial response.

Completes with a ProductsGenerateApprovalUrlResponse.

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<ProductsGenerateApprovalUrlResponse> generateApprovalUrl(
  core.String enterpriseId,
  core.String productId, {
  core.String? languageCode,
  core.String? $fields,
}) async {
  final queryParams_ = <core.String, core.List<core.String>>{
    if (languageCode != null) 'languageCode': [languageCode],
    if ($fields != null) 'fields': [$fields],
  };

  final url_ = 'androidenterprise/v1/enterprises/' +
      commons.escapeVariable('$enterpriseId') +
      '/products/' +
      commons.escapeVariable('$productId') +
      '/generateApprovalUrl';

  final response_ = await _requester.request(
    url_,
    'POST',
    queryParams: queryParams_,
  );
  return ProductsGenerateApprovalUrlResponse.fromJson(
      response_ as core.Map<core.String, core.dynamic>);
}