generateEnterpriseUpgradeUrl method

Future<GenerateEnterpriseUpgradeUrlResponse> generateEnterpriseUpgradeUrl(
  1. String enterpriseId, {
  2. String? adminEmail,
  3. List<String>? allowedDomains,
  4. String? $fields,
})

Generates an enterprise upgrade URL to upgrade an existing managed Google Play Accounts enterprise to a managed Google domain.

Note: This feature is not generally available.

Request parameters:

enterpriseId - Required. The ID of the enterprise.

adminEmail - Optional. Email address used to prefill the admin field of the enterprise signup form as part of the upgrade process. This value is a hint only and can be altered by the user. Personal email addresses are not allowed. If allowedDomains is non-empty then this must belong to one of the allowedDomains.

allowedDomains - Optional. A list of domains that are permitted for the admin email. The IT admin cannot enter an email address with a domain name that is not in this list. Subdomains of domains in this list are not allowed but can be allowed by adding a second entry which has *. prefixed to the domain name (e.g. *.example.com). If the field is not present or is an empty list then the IT admin is free to use any valid domain name. Personal email domains are not allowed.

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

Completes with a GenerateEnterpriseUpgradeUrlResponse.

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

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

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