create method

Future<Operation> create(
  1. GoogleAppsCloudidentityDevicesV1Device request, {
  2. String? customer,
  3. String? $fields,
})

Creates a device.

Only company-owned device may be created. Note: This method is available only to customers who have one of the following SKUs: Enterprise Standard, Enterprise Plus, Enterprise for Education, and Cloud Identity Premium

request - The metadata request object.

Request parameters:

customer - Optional. Resource name of the customer. If you're using this API for your own organization, use customers/my_customer If you're using this API to manage another organization, use customers/{customer}, where customer is the customer to whom the device belongs.

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

Completes with a Operation.

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

  const url_ = 'v1/devices';

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