create method

Future<Enterprise> create(
  1. Enterprise request, {
  2. bool? agreementAccepted,
  3. String? enterpriseToken,
  4. String? projectId,
  5. String? signupUrlName,
  6. String? $fields,
})

Creates an enterprise.

This is the last step in the enterprise signup flow. See also: SigninDetail

request - The metadata request object.

Request parameters:

agreementAccepted - Whether the enterprise admin has seen and agreed to the managed Google Play Agreement (https://www.android.com/enterprise/terms/). Do not set this field for any customer-managed enterprise (https://developers.google.com/android/management/create-enterprise#customer-managed_enterprises). Set this to field to true for all EMM-managed enterprises (https://developers.google.com/android/management/create-enterprise#emm-managed_enterprises).

enterpriseToken - The enterprise token appended to the callback URL. Set this when creating a customer-managed enterprise (https://developers.google.com/android/management/create-enterprise#customer-managed_enterprises) and not when creating a deprecated EMM-managed enterprise (https://developers.google.com/android/management/create-enterprise#emm-managed_enterprises).

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

signupUrlName - The name of the SignupUrl used to sign up for the enterprise. Set this when creating a customer-managed enterprise (https://developers.google.com/android/management/create-enterprise#customer-managed_enterprises) and not when creating a deprecated EMM-managed enterprise (https://developers.google.com/android/management/create-enterprise#emm-managed_enterprises).

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

Completes with a Enterprise.

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<Enterprise> create(
  Enterprise request, {
  core.bool? agreementAccepted,
  core.String? enterpriseToken,
  core.String? projectId,
  core.String? signupUrlName,
  core.String? $fields,
}) async {
  final body_ = convert.json.encode(request);
  final queryParams_ = <core.String, core.List<core.String>>{
    if (agreementAccepted != null)
      'agreementAccepted': ['${agreementAccepted}'],
    if (enterpriseToken != null) 'enterpriseToken': [enterpriseToken],
    if (projectId != null) 'projectId': [projectId],
    if (signupUrlName != null) 'signupUrlName': [signupUrlName],
    if ($fields != null) 'fields': [$fields],
  };

  const url_ = 'v1/enterprises';

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