create method

Future<SignupUrl> create({
  1. String? adminEmail,
  2. List<String>? allowedDomains,
  3. String? callbackUrl,
  4. String? projectId,
  5. String? $fields,
})

Creates an enterprise signup 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 that the admin will be redirected to after successfully creating an enterprise. Before redirecting there the system will add a query parameter to this URL named enterpriseToken which will contain an opaque token to be used for the create enterprise request. The URL will be parsed then reformatted in order to add the enterpriseToken parameter, so there may be some minor formatting changes.

projectId - The ID of the Google Cloud Platform project which will own the enterprise.

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

Completes with a SignupUrl.

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

  const url_ = 'v1/signupUrls';

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