insert method
Orders a new customer's account.
Before ordering a new customer account, establish whether the customer
account already exists using the
[customers.get
](/admin-sdk/reseller/v1/reference/customers/get) If the
customer account exists as a direct Google account or as a resold customer
account from another reseller, use the customerAuthToken\
as described
in [order a resold account for an existing
customer](/admin-sdk/reseller/v1/how-tos/manage_customers#create_existing_customer).
For more information about ordering a new customer account, see [order a
new customer
account](/admin-sdk/reseller/v1/how-tos/manage_customers#create_customer).
After creating a new customer account, you must provision a user as an
administrator. The customer's administrator is required to sign in to the
Admin console and sign the G Suite via Reseller agreement to activate the
account. Resellers are prohibited from signing the G Suite via Reseller
agreement on the customer's behalf. For more information, see [order a
new customer
account](/admin-sdk/reseller/v1/how-tos/manage_customers#tos).
request
- The metadata request object.
Request parameters:
customerAuthToken
- The customerAuthToken
query string is required
when creating a resold account that transfers a direct customer's
subscription or transfers another reseller customer's subscription to your
reseller management. This is a hexadecimal authentication token needed to
complete the subscription transfer. For more information, see the
administrator help center.
$fields
- Selector specifying which fields to include in a partial
response.
Completes with a Customer.
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<Customer> insert(
Customer request, {
core.String? customerAuthToken,
core.String? $fields,
}) async {
final body_ = convert.json.encode(request);
final queryParams_ = <core.String, core.List<core.String>>{
if (customerAuthToken != null) 'customerAuthToken': [customerAuthToken],
if ($fields != null) 'fields': [$fields],
};
const url_ = 'apps/reseller/v1/customers';
final response_ = await _requester.request(
url_,
'POST',
body: body_,
queryParams: queryParams_,
);
return Customer.fromJson(response_ as core.Map<core.String, core.dynamic>);
}