generateSignupUrl method

Future<SignupInfo> generateSignupUrl({
  1. String? adminEmail,
  2. List<String>? allowedDomains,
  3. String? callbackUrl,
  4. String? $fields,
})

Generates a sign-up URL.

Request parameters:

adminEmail - Optional. Email address used to prefill the admin field of the enterprise signup form. This value is a hint only and can be altered by the user. 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 always allowed, but will result in the creation of a managed Google Play Accounts enterprise.

callbackUrl - The callback URL to which the Admin will be redirected after successfully creating an enterprise. Before redirecting there the system will add a single query parameter to this URL named "enterpriseToken" which will contain an opaque token to be used for the CompleteSignup request. Beware that this means that the URL will be parsed, the parameter added and then a new URL formatted, i.e. there may be some minor formatting changes and, more importantly, the URL must be well-formed so that it can be parsed.

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

Completes with a SignupInfo.

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

  const url_ = 'androidenterprise/v1/enterprises/signupUrl';

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