blob: c8c78611b3238bfe108f219a6589ba1e5877c8fc [file] [log] [blame]
// This is a generated file (see the discoveryapis_generator project).
library googleapis.androiddeviceprovisioning.v1;
import 'dart:core' as core;
import 'dart:async' as async;
import 'dart:convert' as convert;
import 'package:_discoveryapis_commons/_discoveryapis_commons.dart' as commons;
import 'package:http/http.dart' as http;
export 'package:_discoveryapis_commons/_discoveryapis_commons.dart'
show ApiRequestError, DetailedApiRequestError;
const core.String USER_AGENT = 'dart-api-client androiddeviceprovisioning/v1';
/// Automates reseller integration into zero-touch enrollment by assigning
/// devices to customers and creating device reports.
class AndroiddeviceprovisioningApi {
final commons.ApiRequester _requester;
OperationsResourceApi get operations => new OperationsResourceApi(_requester);
PartnersResourceApi get partners => new PartnersResourceApi(_requester);
AndroiddeviceprovisioningApi(http.Client client,
{core.String rootUrl: "https://androiddeviceprovisioning.googleapis.com/",
core.String servicePath: ""})
: _requester =
new commons.ApiRequester(client, rootUrl, servicePath, USER_AGENT);
}
class OperationsResourceApi {
final commons.ApiRequester _requester;
OperationsResourceApi(commons.ApiRequester client) : _requester = client;
/// Gets the latest state of a long-running operation. Clients can use this
/// method to poll the operation result at intervals as recommended by the API
/// service.
///
/// Request parameters:
///
/// [name] - The name of the operation resource.
/// Value must have pattern "^operations/.+$".
///
/// [$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.
async.Future<Operation> get(core.String name, {core.String $fields}) {
var _url = null;
var _queryParams = new core.Map();
var _uploadMedia = null;
var _uploadOptions = null;
var _downloadOptions = commons.DownloadOptions.Metadata;
var _body = null;
if (name == null) {
throw new core.ArgumentError("Parameter name is required.");
}
if ($fields != null) {
_queryParams["fields"] = [$fields];
}
_url = 'v1/' + commons.Escaper.ecapeVariableReserved('$name');
var _response = _requester.request(_url, "GET",
body: _body,
queryParams: _queryParams,
uploadOptions: _uploadOptions,
uploadMedia: _uploadMedia,
downloadOptions: _downloadOptions);
return _response.then((data) => new Operation.fromJson(data));
}
}
class PartnersResourceApi {
final commons.ApiRequester _requester;
PartnersCustomersResourceApi get customers =>
new PartnersCustomersResourceApi(_requester);
PartnersDevicesResourceApi get devices =>
new PartnersDevicesResourceApi(_requester);
PartnersResourceApi(commons.ApiRequester client) : _requester = client;
}
class PartnersCustomersResourceApi {
final commons.ApiRequester _requester;
PartnersCustomersResourceApi(commons.ApiRequester client)
: _requester = client;
/// Creates a customer for zero-touch enrollment. After the method returns
/// successfully, admin and owner roles can manage devices and EMM configs
/// by calling API methods or using their zero-touch enrollment portal. The
/// API
/// doesn't notify the customer that they have access.
///
/// [request] - The metadata request object.
///
/// Request parameters:
///
/// [parent] - Required. The parent resource ID in format
/// `partners/[PARTNER_ID]` that
/// identifies the reseller.
/// Value must have pattern "^partners/[^/]+$".
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [Company].
///
/// 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.
async.Future<Company> create(
CreateCustomerRequest request, core.String parent,
{core.String $fields}) {
var _url = null;
var _queryParams = new core.Map();
var _uploadMedia = null;
var _uploadOptions = null;
var _downloadOptions = commons.DownloadOptions.Metadata;
var _body = null;
if (request != null) {
_body = convert.JSON.encode((request).toJson());
}
if (parent == null) {
throw new core.ArgumentError("Parameter parent is required.");
}
if ($fields != null) {
_queryParams["fields"] = [$fields];
}
_url =
'v1/' + commons.Escaper.ecapeVariableReserved('$parent') + '/customers';
var _response = _requester.request(_url, "POST",
body: _body,
queryParams: _queryParams,
uploadOptions: _uploadOptions,
uploadMedia: _uploadMedia,
downloadOptions: _downloadOptions);
return _response.then((data) => new Company.fromJson(data));
}
/// Lists the customers that are enrolled to the reseller identified by the
/// `partnerId` argument. This list includes customers that the reseller
/// created and customers that enrolled themselves using the portal.
///
/// Request parameters:
///
/// [partnerId] - The ID of the partner.
/// Value must have pattern "^[^/]+$".
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [ListCustomersResponse].
///
/// 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.
async.Future<ListCustomersResponse> list(core.String partnerId,
{core.String $fields}) {
var _url = null;
var _queryParams = new core.Map();
var _uploadMedia = null;
var _uploadOptions = null;
var _downloadOptions = commons.DownloadOptions.Metadata;
var _body = null;
if (partnerId == null) {
throw new core.ArgumentError("Parameter partnerId is required.");
}
if ($fields != null) {
_queryParams["fields"] = [$fields];
}
_url = 'v1/partners/' +
commons.Escaper.ecapeVariableReserved('$partnerId') +
'/customers';
var _response = _requester.request(_url, "GET",
body: _body,
queryParams: _queryParams,
uploadOptions: _uploadOptions,
uploadMedia: _uploadMedia,
downloadOptions: _downloadOptions);
return _response.then((data) => new ListCustomersResponse.fromJson(data));
}
}
class PartnersDevicesResourceApi {
final commons.ApiRequester _requester;
PartnersDevicesResourceApi(commons.ApiRequester client) : _requester = client;
/// Claim the device identified by device identifier.
///
/// [request] - The metadata request object.
///
/// Request parameters:
///
/// [partnerId] - ID of the partner.
/// Value must have pattern "^[^/]+$".
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [ClaimDeviceResponse].
///
/// 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.
async.Future<ClaimDeviceResponse> claim(
ClaimDeviceRequest request, core.String partnerId,
{core.String $fields}) {
var _url = null;
var _queryParams = new core.Map();
var _uploadMedia = null;
var _uploadOptions = null;
var _downloadOptions = commons.DownloadOptions.Metadata;
var _body = null;
if (request != null) {
_body = convert.JSON.encode((request).toJson());
}
if (partnerId == null) {
throw new core.ArgumentError("Parameter partnerId is required.");
}
if ($fields != null) {
_queryParams["fields"] = [$fields];
}
_url = 'v1/partners/' +
commons.Escaper.ecapeVariableReserved('$partnerId') +
'/devices:claim';
var _response = _requester.request(_url, "POST",
body: _body,
queryParams: _queryParams,
uploadOptions: _uploadOptions,
uploadMedia: _uploadMedia,
downloadOptions: _downloadOptions);
return _response.then((data) => new ClaimDeviceResponse.fromJson(data));
}
/// Claim devices asynchronously.
///
/// [request] - The metadata request object.
///
/// Request parameters:
///
/// [partnerId] - Partner ID.
/// Value must have pattern "^[^/]+$".
///
/// [$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.
async.Future<Operation> claimAsync(
ClaimDevicesRequest request, core.String partnerId,
{core.String $fields}) {
var _url = null;
var _queryParams = new core.Map();
var _uploadMedia = null;
var _uploadOptions = null;
var _downloadOptions = commons.DownloadOptions.Metadata;
var _body = null;
if (request != null) {
_body = convert.JSON.encode((request).toJson());
}
if (partnerId == null) {
throw new core.ArgumentError("Parameter partnerId is required.");
}
if ($fields != null) {
_queryParams["fields"] = [$fields];
}
_url = 'v1/partners/' +
commons.Escaper.ecapeVariableReserved('$partnerId') +
'/devices:claimAsync';
var _response = _requester.request(_url, "POST",
body: _body,
queryParams: _queryParams,
uploadOptions: _uploadOptions,
uploadMedia: _uploadMedia,
downloadOptions: _downloadOptions);
return _response.then((data) => new Operation.fromJson(data));
}
/// Find devices by device identifier.
///
/// [request] - The metadata request object.
///
/// Request parameters:
///
/// [partnerId] - ID of the partner.
/// Value must have pattern "^[^/]+$".
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [FindDevicesByDeviceIdentifierResponse].
///
/// 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.
async.Future<FindDevicesByDeviceIdentifierResponse> findByIdentifier(
FindDevicesByDeviceIdentifierRequest request, core.String partnerId,
{core.String $fields}) {
var _url = null;
var _queryParams = new core.Map();
var _uploadMedia = null;
var _uploadOptions = null;
var _downloadOptions = commons.DownloadOptions.Metadata;
var _body = null;
if (request != null) {
_body = convert.JSON.encode((request).toJson());
}
if (partnerId == null) {
throw new core.ArgumentError("Parameter partnerId is required.");
}
if ($fields != null) {
_queryParams["fields"] = [$fields];
}
_url = 'v1/partners/' +
commons.Escaper.ecapeVariableReserved('$partnerId') +
'/devices:findByIdentifier';
var _response = _requester.request(_url, "POST",
body: _body,
queryParams: _queryParams,
uploadOptions: _uploadOptions,
uploadMedia: _uploadMedia,
downloadOptions: _downloadOptions);
return _response.then(
(data) => new FindDevicesByDeviceIdentifierResponse.fromJson(data));
}
/// Find devices by ownership.
///
/// [request] - The metadata request object.
///
/// Request parameters:
///
/// [partnerId] - ID of the partner.
/// Value must have pattern "^[^/]+$".
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [FindDevicesByOwnerResponse].
///
/// 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.
async.Future<FindDevicesByOwnerResponse> findByOwner(
FindDevicesByOwnerRequest request, core.String partnerId,
{core.String $fields}) {
var _url = null;
var _queryParams = new core.Map();
var _uploadMedia = null;
var _uploadOptions = null;
var _downloadOptions = commons.DownloadOptions.Metadata;
var _body = null;
if (request != null) {
_body = convert.JSON.encode((request).toJson());
}
if (partnerId == null) {
throw new core.ArgumentError("Parameter partnerId is required.");
}
if ($fields != null) {
_queryParams["fields"] = [$fields];
}
_url = 'v1/partners/' +
commons.Escaper.ecapeVariableReserved('$partnerId') +
'/devices:findByOwner';
var _response = _requester.request(_url, "POST",
body: _body,
queryParams: _queryParams,
uploadOptions: _uploadOptions,
uploadMedia: _uploadMedia,
downloadOptions: _downloadOptions);
return _response
.then((data) => new FindDevicesByOwnerResponse.fromJson(data));
}
/// Get a device.
///
/// Request parameters:
///
/// [name] - Resource name in `partners/[PARTNER_ID]/devices/[DEVICE_ID]`.
/// Value must have pattern "^partners/[^/]+/devices/[^/]+$".
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [Device].
///
/// 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.
async.Future<Device> get(core.String name, {core.String $fields}) {
var _url = null;
var _queryParams = new core.Map();
var _uploadMedia = null;
var _uploadOptions = null;
var _downloadOptions = commons.DownloadOptions.Metadata;
var _body = null;
if (name == null) {
throw new core.ArgumentError("Parameter name is required.");
}
if ($fields != null) {
_queryParams["fields"] = [$fields];
}
_url = 'v1/' + commons.Escaper.ecapeVariableReserved('$name');
var _response = _requester.request(_url, "GET",
body: _body,
queryParams: _queryParams,
uploadOptions: _uploadOptions,
uploadMedia: _uploadMedia,
downloadOptions: _downloadOptions);
return _response.then((data) => new Device.fromJson(data));
}
/// Update the metadata.
///
/// [request] - The metadata request object.
///
/// Request parameters:
///
/// [metadataOwnerId] - The owner of the newly set metadata. Set this to the
/// partner ID.
/// Value must have pattern "^[^/]+$".
///
/// [deviceId] - ID of the partner.
/// Value must have pattern "^[^/]+$".
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [DeviceMetadata].
///
/// 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.
async.Future<DeviceMetadata> metadata(UpdateDeviceMetadataRequest request,
core.String metadataOwnerId, core.String deviceId,
{core.String $fields}) {
var _url = null;
var _queryParams = new core.Map();
var _uploadMedia = null;
var _uploadOptions = null;
var _downloadOptions = commons.DownloadOptions.Metadata;
var _body = null;
if (request != null) {
_body = convert.JSON.encode((request).toJson());
}
if (metadataOwnerId == null) {
throw new core.ArgumentError("Parameter metadataOwnerId is required.");
}
if (deviceId == null) {
throw new core.ArgumentError("Parameter deviceId is required.");
}
if ($fields != null) {
_queryParams["fields"] = [$fields];
}
_url = 'v1/partners/' +
commons.Escaper.ecapeVariableReserved('$metadataOwnerId') +
'/devices/' +
commons.Escaper.ecapeVariableReserved('$deviceId') +
'/metadata';
var _response = _requester.request(_url, "POST",
body: _body,
queryParams: _queryParams,
uploadOptions: _uploadOptions,
uploadMedia: _uploadMedia,
downloadOptions: _downloadOptions);
return _response.then((data) => new DeviceMetadata.fromJson(data));
}
/// Unclaim the device identified by the `device_id` or the
/// `deviceIdentifier`.
///
/// [request] - The metadata request object.
///
/// Request parameters:
///
/// [partnerId] - ID of the partner.
/// Value must have pattern "^[^/]+$".
///
/// [$fields] - Selector specifying which fields to include in a partial
/// response.
///
/// Completes with a [Empty].
///
/// 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.
async.Future<Empty> unclaim(
UnclaimDeviceRequest request, core.String partnerId,
{core.String $fields}) {
var _url = null;
var _queryParams = new core.Map();
var _uploadMedia = null;
var _uploadOptions = null;
var _downloadOptions = commons.DownloadOptions.Metadata;
var _body = null;
if (request != null) {
_body = convert.JSON.encode((request).toJson());
}
if (partnerId == null) {
throw new core.ArgumentError("Parameter partnerId is required.");
}
if ($fields != null) {
_queryParams["fields"] = [$fields];
}
_url = 'v1/partners/' +
commons.Escaper.ecapeVariableReserved('$partnerId') +
'/devices:unclaim';
var _response = _requester.request(_url, "POST",
body: _body,
queryParams: _queryParams,
uploadOptions: _uploadOptions,
uploadMedia: _uploadMedia,
downloadOptions: _downloadOptions);
return _response.then((data) => new Empty.fromJson(data));
}
/// Unclaim devices asynchronously.
///
/// [request] - The metadata request object.
///
/// Request parameters:
///
/// [partnerId] - Partner ID.
/// Value must have pattern "^[^/]+$".
///
/// [$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.
async.Future<Operation> unclaimAsync(
UnclaimDevicesRequest request, core.String partnerId,
{core.String $fields}) {
var _url = null;
var _queryParams = new core.Map();
var _uploadMedia = null;
var _uploadOptions = null;
var _downloadOptions = commons.DownloadOptions.Metadata;
var _body = null;
if (request != null) {
_body = convert.JSON.encode((request).toJson());
}
if (partnerId == null) {
throw new core.ArgumentError("Parameter partnerId is required.");
}
if ($fields != null) {
_queryParams["fields"] = [$fields];
}
_url = 'v1/partners/' +
commons.Escaper.ecapeVariableReserved('$partnerId') +
'/devices:unclaimAsync';
var _response = _requester.request(_url, "POST",
body: _body,
queryParams: _queryParams,
uploadOptions: _uploadOptions,
uploadMedia: _uploadMedia,
downloadOptions: _downloadOptions);
return _response.then((data) => new Operation.fromJson(data));
}
/// Set metadata in batch asynchronously.
///
/// [request] - The metadata request object.
///
/// Request parameters:
///
/// [partnerId] - Partner ID.
/// Value must have pattern "^[^/]+$".
///
/// [$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.
async.Future<Operation> updateMetadataAsync(
UpdateDeviceMetadataInBatchRequest request, core.String partnerId,
{core.String $fields}) {
var _url = null;
var _queryParams = new core.Map();
var _uploadMedia = null;
var _uploadOptions = null;
var _downloadOptions = commons.DownloadOptions.Metadata;
var _body = null;
if (request != null) {
_body = convert.JSON.encode((request).toJson());
}
if (partnerId == null) {
throw new core.ArgumentError("Parameter partnerId is required.");
}
if ($fields != null) {
_queryParams["fields"] = [$fields];
}
_url = 'v1/partners/' +
commons.Escaper.ecapeVariableReserved('$partnerId') +
'/devices:updateMetadataAsync';
var _response = _requester.request(_url, "POST",
body: _body,
queryParams: _queryParams,
uploadOptions: _uploadOptions,
uploadMedia: _uploadMedia,
downloadOptions: _downloadOptions);
return _response.then((data) => new Operation.fromJson(data));
}
}
/// Request message to claim a device on behalf of a customer.
class ClaimDeviceRequest {
/// The customer to claim for.
core.String customerId;
/// The device identifier of the device to claim.
DeviceIdentifier deviceIdentifier;
/// The section to claim.
/// Possible string values are:
/// - "SECTION_TYPE_UNSPECIFIED" : Unspecified section type.
/// - "SECTION_TYPE_ZERO_TOUCH" : Zero touch section type.
core.String sectionType;
ClaimDeviceRequest();
ClaimDeviceRequest.fromJson(core.Map _json) {
if (_json.containsKey("customerId")) {
customerId = _json["customerId"];
}
if (_json.containsKey("deviceIdentifier")) {
deviceIdentifier =
new DeviceIdentifier.fromJson(_json["deviceIdentifier"]);
}
if (_json.containsKey("sectionType")) {
sectionType = _json["sectionType"];
}
}
core.Map<core.String, core.Object> toJson() {
final core.Map<core.String, core.Object> _json =
new core.Map<core.String, core.Object>();
if (customerId != null) {
_json["customerId"] = customerId;
}
if (deviceIdentifier != null) {
_json["deviceIdentifier"] = (deviceIdentifier).toJson();
}
if (sectionType != null) {
_json["sectionType"] = sectionType;
}
return _json;
}
}
/// Response message containing device id of the claim.
class ClaimDeviceResponse {
/// The device ID of the claimed device.
core.String deviceId;
/// The resource name of the device in the format
/// `partners/[PARTNER_ID]/devices/[DEVICE_ID]`.
core.String deviceName;
ClaimDeviceResponse();
ClaimDeviceResponse.fromJson(core.Map _json) {
if (_json.containsKey("deviceId")) {
deviceId = _json["deviceId"];
}
if (_json.containsKey("deviceName")) {
deviceName = _json["deviceName"];
}
}
core.Map<core.String, core.Object> toJson() {
final core.Map<core.String, core.Object> _json =
new core.Map<core.String, core.Object>();
if (deviceId != null) {
_json["deviceId"] = deviceId;
}
if (deviceName != null) {
_json["deviceName"] = deviceName;
}
return _json;
}
}
/// Request to claim devices asynchronously in batch.
class ClaimDevicesRequest {
/// List of claims.
core.List<PartnerClaim> claims;
ClaimDevicesRequest();
ClaimDevicesRequest.fromJson(core.Map _json) {
if (_json.containsKey("claims")) {
claims = _json["claims"]
.map((value) => new PartnerClaim.fromJson(value))
.toList();
}
}
core.Map<core.String, core.Object> toJson() {
final core.Map<core.String, core.Object> _json =
new core.Map<core.String, core.Object>();
if (claims != null) {
_json["claims"] = claims.map((value) => (value).toJson()).toList();
}
return _json;
}
}
/// A customer resource in the zero-touch enrollment API.
class Company {
/// Input only. Optional. Email address of customer's users in the admin role.
/// Each email address must be associated with a Google Account.
core.List<core.String> adminEmails;
/// Output only. The ID of the company. Assigned by the server.
core.String companyId;
/// Required. The name of the company. For example _XYZ Corp_. Characters
/// allowed are: Latin letters, numerals, hyphens, and spaces. Displayed to
/// the
/// customer's employees in the zero-touch enrollment portal.
core.String companyName;
/// Output only. The API resource name of the company in the format
/// `partners/[PARTNER_ID]/customers/[CUSTOMER_ID]`. Assigned by the server.
core.String name;
/// Input only. Email address of customer's users in the owner role. At least
/// one `owner_email` is required. Each email address must be associated with
/// a
/// Google Account. Owners share the same access as admins but can also add,
/// delete, and edit your organization's portal users.
core.List<core.String> ownerEmails;
Company();
Company.fromJson(core.Map _json) {
if (_json.containsKey("adminEmails")) {
adminEmails = _json["adminEmails"];
}
if (_json.containsKey("companyId")) {
companyId = _json["companyId"];
}
if (_json.containsKey("companyName")) {
companyName = _json["companyName"];
}
if (_json.containsKey("name")) {
name = _json["name"];
}
if (_json.containsKey("ownerEmails")) {
ownerEmails = _json["ownerEmails"];
}
}
core.Map<core.String, core.Object> toJson() {
final core.Map<core.String, core.Object> _json =
new core.Map<core.String, core.Object>();
if (adminEmails != null) {
_json["adminEmails"] = adminEmails;
}
if (companyId != null) {
_json["companyId"] = companyId;
}
if (companyName != null) {
_json["companyName"] = companyName;
}
if (name != null) {
_json["name"] = name;
}
if (ownerEmails != null) {
_json["ownerEmails"] = ownerEmails;
}
return _json;
}
}
/// Request message to create a customer.
class CreateCustomerRequest {
/// Required. The company data to populate the new customer. Must contain a
/// value for `companyName` and at least one `owner_email` that's associated
/// with a Google Account. The values for `companyId` and `name` must be
/// empty.
Company customer;
CreateCustomerRequest();
CreateCustomerRequest.fromJson(core.Map _json) {
if (_json.containsKey("customer")) {
customer = new Company.fromJson(_json["customer"]);
}
}
core.Map<core.String, core.Object> toJson() {
final core.Map<core.String, core.Object> _json =
new core.Map<core.String, core.Object>();
if (customer != null) {
_json["customer"] = (customer).toJson();
}
return _json;
}
}
/// An Android device.
class Device {
/// Claims.
core.List<DeviceClaim> claims;
/// The resource name of the configuration.
/// Only set for customers.
core.String configuration;
/// Device ID.
core.String deviceId;
/// Device identifier.
DeviceIdentifier deviceIdentifier;
/// Device metadata.
DeviceMetadata deviceMetadata;
/// Resource name in `partners/[PARTNER_ID]/devices/[DEVICE_ID]`.
core.String name;
Device();
Device.fromJson(core.Map _json) {
if (_json.containsKey("claims")) {
claims = _json["claims"]
.map((value) => new DeviceClaim.fromJson(value))
.toList();
}
if (_json.containsKey("configuration")) {
configuration = _json["configuration"];
}
if (_json.containsKey("deviceId")) {
deviceId = _json["deviceId"];
}
if (_json.containsKey("deviceIdentifier")) {
deviceIdentifier =
new DeviceIdentifier.fromJson(_json["deviceIdentifier"]);
}
if (_json.containsKey("deviceMetadata")) {
deviceMetadata = new DeviceMetadata.fromJson(_json["deviceMetadata"]);
}
if (_json.containsKey("name")) {
name = _json["name"];
}
}
core.Map<core.String, core.Object> toJson() {
final core.Map<core.String, core.Object> _json =
new core.Map<core.String, core.Object>();
if (claims != null) {
_json["claims"] = claims.map((value) => (value).toJson()).toList();
}
if (configuration != null) {
_json["configuration"] = configuration;
}
if (deviceId != null) {
_json["deviceId"] = deviceId;
}
if (deviceIdentifier != null) {
_json["deviceIdentifier"] = (deviceIdentifier).toJson();
}
if (deviceMetadata != null) {
_json["deviceMetadata"] = (deviceMetadata).toJson();
}
if (name != null) {
_json["name"] = name;
}
return _json;
}
}
/// Information about a device claimed for a partner.
class DeviceClaim {
/// Owner ID.
core.String ownerCompanyId;
/// Section type of the device claim.
/// Possible string values are:
/// - "SECTION_TYPE_UNSPECIFIED" : Unspecified section type.
/// - "SECTION_TYPE_ZERO_TOUCH" : Zero touch section type.
core.String sectionType;
DeviceClaim();
DeviceClaim.fromJson(core.Map _json) {
if (_json.containsKey("ownerCompanyId")) {
ownerCompanyId = _json["ownerCompanyId"];
}
if (_json.containsKey("sectionType")) {
sectionType = _json["sectionType"];
}
}
core.Map<core.String, core.Object> toJson() {
final core.Map<core.String, core.Object> _json =
new core.Map<core.String, core.Object>();
if (ownerCompanyId != null) {
_json["ownerCompanyId"] = ownerCompanyId;
}
if (sectionType != null) {
_json["sectionType"] = sectionType;
}
return _json;
}
}
/// Identifies a unique device.
class DeviceIdentifier {
/// IMEI number.
core.String imei;
/// Manufacturer name to match `android.os.Build.MANUFACTURER` (required).
/// Allowed values listed in
/// [manufacturer names](/zero-touch/resources/manufacturer-names).
core.String manufacturer;
/// MEID number.
core.String meid;
/// Serial number (optional).
core.String serialNumber;
DeviceIdentifier();
DeviceIdentifier.fromJson(core.Map _json) {
if (_json.containsKey("imei")) {
imei = _json["imei"];
}
if (_json.containsKey("manufacturer")) {
manufacturer = _json["manufacturer"];
}
if (_json.containsKey("meid")) {
meid = _json["meid"];
}
if (_json.containsKey("serialNumber")) {
serialNumber = _json["serialNumber"];
}
}
core.Map<core.String, core.Object> toJson() {
final core.Map<core.String, core.Object> _json =
new core.Map<core.String, core.Object>();
if (imei != null) {
_json["imei"] = imei;
}
if (manufacturer != null) {
_json["manufacturer"] = manufacturer;
}
if (meid != null) {
_json["meid"] = meid;
}
if (serialNumber != null) {
_json["serialNumber"] = serialNumber;
}
return _json;
}
}
/// A key-value pair of the device metadata.
class DeviceMetadata {
/// Metadata entries
core.Map<core.String, core.String> entries;
DeviceMetadata();
DeviceMetadata.fromJson(core.Map _json) {
if (_json.containsKey("entries")) {
entries = _json["entries"];
}
}
core.Map<core.String, core.Object> toJson() {
final core.Map<core.String, core.Object> _json =
new core.Map<core.String, core.Object>();
if (entries != null) {
_json["entries"] = entries;
}
return _json;
}
}
/// Long running operation metadata.
class DevicesLongRunningOperationMetadata {
/// Number of devices parsed in your requests.
core.int devicesCount;
/// The overall processing status.
/// Possible string values are:
/// - "BATCH_PROCESS_STATUS_UNSPECIFIED" : Invalid code. Shouldn't be used.
/// - "BATCH_PROCESS_PENDING" : Pending.
/// - "BATCH_PROCESS_IN_PROGRESS" : In progress.
/// - "BATCH_PROCESS_PROCESSED" : Processed.
/// This doesn't mean all items were processed sucessfully, you should
/// check the `response` field for the result of every item.
core.String processingStatus;
/// Processing progress from 0 to 100.
core.int progress;
DevicesLongRunningOperationMetadata();
DevicesLongRunningOperationMetadata.fromJson(core.Map _json) {
if (_json.containsKey("devicesCount")) {
devicesCount = _json["devicesCount"];
}
if (_json.containsKey("processingStatus")) {
processingStatus = _json["processingStatus"];
}
if (_json.containsKey("progress")) {
progress = _json["progress"];
}
}
core.Map<core.String, core.Object> toJson() {
final core.Map<core.String, core.Object> _json =
new core.Map<core.String, core.Object>();
if (devicesCount != null) {
_json["devicesCount"] = devicesCount;
}
if (processingStatus != null) {
_json["processingStatus"] = processingStatus;
}
if (progress != null) {
_json["progress"] = progress;
}
return _json;
}
}
/// Long running operation response.
class DevicesLongRunningOperationResponse {
/// Processing status for each device.
/// One `PerDeviceStatus` per device. The order is the same as in your
/// requests.
core.List<OperationPerDevice> perDeviceStatus;
/// Number of succeesfully processed ones.
core.int successCount;
DevicesLongRunningOperationResponse();
DevicesLongRunningOperationResponse.fromJson(core.Map _json) {
if (_json.containsKey("perDeviceStatus")) {
perDeviceStatus = _json["perDeviceStatus"]
.map((value) => new OperationPerDevice.fromJson(value))
.toList();
}
if (_json.containsKey("successCount")) {
successCount = _json["successCount"];
}
}
core.Map<core.String, core.Object> toJson() {
final core.Map<core.String, core.Object> _json =
new core.Map<core.String, core.Object>();
if (perDeviceStatus != null) {
_json["perDeviceStatus"] =
perDeviceStatus.map((value) => (value).toJson()).toList();
}
if (successCount != null) {
_json["successCount"] = successCount;
}
return _json;
}
}
/// A generic empty message that you can re-use to avoid defining duplicated
/// empty messages in your APIs. A typical example is to use it as the request
/// or the response type of an API method. For instance:
///
/// service Foo {
/// rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty);
/// }
///
/// The JSON representation for `Empty` is empty JSON object `{}`.
class Empty {
Empty();
Empty.fromJson(core.Map _json) {}
core.Map<core.String, core.Object> toJson() {
final core.Map<core.String, core.Object> _json =
new core.Map<core.String, core.Object>();
return _json;
}
}
/// Request to find devices.
class FindDevicesByDeviceIdentifierRequest {
/// The device identifier to search.
DeviceIdentifier deviceIdentifier;
/// Number of devices to show.
core.String limit;
/// Page token.
core.String pageToken;
FindDevicesByDeviceIdentifierRequest();
FindDevicesByDeviceIdentifierRequest.fromJson(core.Map _json) {
if (_json.containsKey("deviceIdentifier")) {
deviceIdentifier =
new DeviceIdentifier.fromJson(_json["deviceIdentifier"]);
}
if (_json.containsKey("limit")) {
limit = _json["limit"];
}
if (_json.containsKey("pageToken")) {
pageToken = _json["pageToken"];
}
}
core.Map<core.String, core.Object> toJson() {
final core.Map<core.String, core.Object> _json =
new core.Map<core.String, core.Object>();
if (deviceIdentifier != null) {
_json["deviceIdentifier"] = (deviceIdentifier).toJson();
}
if (limit != null) {
_json["limit"] = limit;
}
if (pageToken != null) {
_json["pageToken"] = pageToken;
}
return _json;
}
}
/// Response containing found devices.
class FindDevicesByDeviceIdentifierResponse {
/// Found devices.
core.List<Device> devices;
/// Page token of the next page.
core.String nextPageToken;
FindDevicesByDeviceIdentifierResponse();
FindDevicesByDeviceIdentifierResponse.fromJson(core.Map _json) {
if (_json.containsKey("devices")) {
devices =
_json["devices"].map((value) => new Device.fromJson(value)).toList();
}
if (_json.containsKey("nextPageToken")) {
nextPageToken = _json["nextPageToken"];
}
}
core.Map<core.String, core.Object> toJson() {
final core.Map<core.String, core.Object> _json =
new core.Map<core.String, core.Object>();
if (devices != null) {
_json["devices"] = devices.map((value) => (value).toJson()).toList();
}
if (nextPageToken != null) {
_json["nextPageToken"] = nextPageToken;
}
return _json;
}
}
/// Request to find devices by customers.
class FindDevicesByOwnerRequest {
/// List of customer IDs to search for.
core.List<core.String> customerId;
/// The number of devices to show in the result.
core.String limit;
/// Page token.
core.String pageToken;
/// The section type.
/// Possible string values are:
/// - "SECTION_TYPE_UNSPECIFIED" : Unspecified section type.
/// - "SECTION_TYPE_ZERO_TOUCH" : Zero touch section type.
core.String sectionType;
FindDevicesByOwnerRequest();
FindDevicesByOwnerRequest.fromJson(core.Map _json) {
if (_json.containsKey("customerId")) {
customerId = _json["customerId"];
}
if (_json.containsKey("limit")) {
limit = _json["limit"];
}
if (_json.containsKey("pageToken")) {
pageToken = _json["pageToken"];
}
if (_json.containsKey("sectionType")) {
sectionType = _json["sectionType"];
}
}
core.Map<core.String, core.Object> toJson() {
final core.Map<core.String, core.Object> _json =
new core.Map<core.String, core.Object>();
if (customerId != null) {
_json["customerId"] = customerId;
}
if (limit != null) {
_json["limit"] = limit;
}
if (pageToken != null) {
_json["pageToken"] = pageToken;
}
if (sectionType != null) {
_json["sectionType"] = sectionType;
}
return _json;
}
}
/// Response containing found devices.
class FindDevicesByOwnerResponse {
/// Devices found.
core.List<Device> devices;
/// Page token of the next page.
core.String nextPageToken;
FindDevicesByOwnerResponse();
FindDevicesByOwnerResponse.fromJson(core.Map _json) {
if (_json.containsKey("devices")) {
devices =
_json["devices"].map((value) => new Device.fromJson(value)).toList();
}
if (_json.containsKey("nextPageToken")) {
nextPageToken = _json["nextPageToken"];
}
}
core.Map<core.String, core.Object> toJson() {
final core.Map<core.String, core.Object> _json =
new core.Map<core.String, core.Object>();
if (devices != null) {
_json["devices"] = devices.map((value) => (value).toJson()).toList();
}
if (nextPageToken != null) {
_json["nextPageToken"] = nextPageToken;
}
return _json;
}
}
/// Response message of all customers related to this partner.
class ListCustomersResponse {
/// List of customers related to this partner.
core.List<Company> customers;
ListCustomersResponse();
ListCustomersResponse.fromJson(core.Map _json) {
if (_json.containsKey("customers")) {
customers = _json["customers"]
.map((value) => new Company.fromJson(value))
.toList();
}
}
core.Map<core.String, core.Object> toJson() {
final core.Map<core.String, core.Object> _json =
new core.Map<core.String, core.Object>();
if (customers != null) {
_json["customers"] = customers.map((value) => (value).toJson()).toList();
}
return _json;
}
}
/// This resource represents a long-running operation that is the result of a
/// network API call.
class Operation {
/// If the value is `false`, it means the operation is still in progress.
/// If `true`, the operation is completed, and either `error` or `response` is
/// available.
core.bool done;
/// This field will always be not set if the operation is created by
/// `claimAsync`, `unclaimAsync`, or `updateMetadataAsync`. In this case,
/// error information for each device is set in
/// `response.perDeviceStatus.result.status`.
Status error;
/// This field will contain a `DevicesLongRunningOperationMetadata` object if
/// the operation is created by `claimAsync`, `unclaimAsync`, or
/// `updateMetadataAsync`.
///
/// The values for Object must be JSON objects. It can consist of `num`,
/// `String`, `bool` and `null` as well as `Map` and `List` values.
core.Map<core.String, core.Object> metadata;
/// The server-assigned name, which is only unique within the same service
/// that
/// originally returns it. If you use the default HTTP mapping, the
/// `name` should have the format of `operations/some/unique/name`.
core.String name;
/// This field will contain a `DevicesLongRunningOperationResponse` object if
/// the operation is created by `claimAsync`, `unclaimAsync`, or
/// `updateMetadataAsync`.
///
/// The values for Object must be JSON objects. It can consist of `num`,
/// `String`, `bool` and `null` as well as `Map` and `List` values.
core.Map<core.String, core.Object> response;
Operation();
Operation.fromJson(core.Map _json) {
if (_json.containsKey("done")) {
done = _json["done"];
}
if (_json.containsKey("error")) {
error = new Status.fromJson(_json["error"]);
}
if (_json.containsKey("metadata")) {
metadata = _json["metadata"];
}
if (_json.containsKey("name")) {
name = _json["name"];
}
if (_json.containsKey("response")) {
response = _json["response"];
}
}
core.Map<core.String, core.Object> toJson() {
final core.Map<core.String, core.Object> _json =
new core.Map<core.String, core.Object>();
if (done != null) {
_json["done"] = done;
}
if (error != null) {
_json["error"] = (error).toJson();
}
if (metadata != null) {
_json["metadata"] = metadata;
}
if (name != null) {
_json["name"] = name;
}
if (response != null) {
_json["response"] = response;
}
return _json;
}
}
/// Operation the server received for every device.
class OperationPerDevice {
/// Request to claim a device.
PartnerClaim claim;
/// Processing result for every device.
PerDeviceStatusInBatch result;
/// Request to unclaim a device.
PartnerUnclaim unclaim;
/// Request to set metadata for a device.
UpdateMetadataArguments updateMetadata;
OperationPerDevice();
OperationPerDevice.fromJson(core.Map _json) {
if (_json.containsKey("claim")) {
claim = new PartnerClaim.fromJson(_json["claim"]);
}
if (_json.containsKey("result")) {
result = new PerDeviceStatusInBatch.fromJson(_json["result"]);
}
if (_json.containsKey("unclaim")) {
unclaim = new PartnerUnclaim.fromJson(_json["unclaim"]);
}
if (_json.containsKey("updateMetadata")) {
updateMetadata =
new UpdateMetadataArguments.fromJson(_json["updateMetadata"]);
}
}
core.Map<core.String, core.Object> toJson() {
final core.Map<core.String, core.Object> _json =
new core.Map<core.String, core.Object>();
if (claim != null) {
_json["claim"] = (claim).toJson();
}
if (result != null) {
_json["result"] = (result).toJson();
}
if (unclaim != null) {
_json["unclaim"] = (unclaim).toJson();
}
if (updateMetadata != null) {
_json["updateMetadata"] = (updateMetadata).toJson();
}
return _json;
}
}
/// Identifies one claim request.
class PartnerClaim {
/// Customer ID to claim for.
core.String customerId;
/// Device identifier of the device.
DeviceIdentifier deviceIdentifier;
/// Metadata to set at claim.
DeviceMetadata deviceMetadata;
/// Section type to claim.
/// Possible string values are:
/// - "SECTION_TYPE_UNSPECIFIED" : Unspecified section type.
/// - "SECTION_TYPE_ZERO_TOUCH" : Zero touch section type.
core.String sectionType;
PartnerClaim();
PartnerClaim.fromJson(core.Map _json) {
if (_json.containsKey("customerId")) {
customerId = _json["customerId"];
}
if (_json.containsKey("deviceIdentifier")) {
deviceIdentifier =
new DeviceIdentifier.fromJson(_json["deviceIdentifier"]);
}
if (_json.containsKey("deviceMetadata")) {
deviceMetadata = new DeviceMetadata.fromJson(_json["deviceMetadata"]);
}
if (_json.containsKey("sectionType")) {
sectionType = _json["sectionType"];
}
}
core.Map<core.String, core.Object> toJson() {
final core.Map<core.String, core.Object> _json =
new core.Map<core.String, core.Object>();
if (customerId != null) {
_json["customerId"] = customerId;
}
if (deviceIdentifier != null) {
_json["deviceIdentifier"] = (deviceIdentifier).toJson();
}
if (deviceMetadata != null) {
_json["deviceMetadata"] = (deviceMetadata).toJson();
}
if (sectionType != null) {
_json["sectionType"] = sectionType;
}
return _json;
}
}
/// Identifies one unclaim request.
class PartnerUnclaim {
/// Device ID of the device.
core.String deviceId;
/// Device identifier of the device.
DeviceIdentifier deviceIdentifier;
/// Section type to unclaim.
/// Possible string values are:
/// - "SECTION_TYPE_UNSPECIFIED" : Unspecified section type.
/// - "SECTION_TYPE_ZERO_TOUCH" : Zero touch section type.
core.String sectionType;
PartnerUnclaim();
PartnerUnclaim.fromJson(core.Map _json) {
if (_json.containsKey("deviceId")) {
deviceId = _json["deviceId"];
}
if (_json.containsKey("deviceIdentifier")) {
deviceIdentifier =
new DeviceIdentifier.fromJson(_json["deviceIdentifier"]);
}
if (_json.containsKey("sectionType")) {
sectionType = _json["sectionType"];
}
}
core.Map<core.String, core.Object> toJson() {
final core.Map<core.String, core.Object> _json =
new core.Map<core.String, core.Object>();
if (deviceId != null) {
_json["deviceId"] = deviceId;
}
if (deviceIdentifier != null) {
_json["deviceIdentifier"] = (deviceIdentifier).toJson();
}
if (sectionType != null) {
_json["sectionType"] = sectionType;
}
return _json;
}
}
/// Stores the processing result for each device.
class PerDeviceStatusInBatch {
/// Device ID of the device if process succeeds.
core.String deviceId;
/// Error identifier.
core.String errorIdentifier;
/// Error message.
core.String errorMessage;
/// Process result.
/// Possible string values are:
/// - "SINGLE_DEVICE_STATUS_UNSPECIFIED" : Invalid code. Shouldn't be used.
/// - "SINGLE_DEVICE_STATUS_UNKNOWN_ERROR" : Unknown error.
/// We don't expect this error to occur here.
/// - "SINGLE_DEVICE_STATUS_OTHER_ERROR" : Other error.
/// We know/expect this error, but there's no defined error code for the
/// error.
/// - "SINGLE_DEVICE_STATUS_SUCCESS" : Success.
/// - "SINGLE_DEVICE_STATUS_PERMISSION_DENIED" : Permission denied.
/// - "SINGLE_DEVICE_STATUS_INVALID_DEVICE_IDENTIFIER" : Invalid device
/// identifier.
/// - "SINGLE_DEVICE_STATUS_INVALID_SECTION_TYPE" : Invalid section type.
/// - "SINGLE_DEVICE_STATUS_SECTION_NOT_YOURS" : This section is claimed by
/// another company.
core.String status;
PerDeviceStatusInBatch();
PerDeviceStatusInBatch.fromJson(core.Map _json) {
if (_json.containsKey("deviceId")) {
deviceId = _json["deviceId"];
}
if (_json.containsKey("errorIdentifier")) {
errorIdentifier = _json["errorIdentifier"];
}
if (_json.containsKey("errorMessage")) {
errorMessage = _json["errorMessage"];
}
if (_json.containsKey("status")) {
status = _json["status"];
}
}
core.Map<core.String, core.Object> toJson() {
final core.Map<core.String, core.Object> _json =
new core.Map<core.String, core.Object>();
if (deviceId != null) {
_json["deviceId"] = deviceId;
}
if (errorIdentifier != null) {
_json["errorIdentifier"] = errorIdentifier;
}
if (errorMessage != null) {
_json["errorMessage"] = errorMessage;
}
if (status != null) {
_json["status"] = status;
}
return _json;
}
}
/// The `Status` type defines a logical error model that is suitable for
/// different
/// programming environments, including REST APIs and RPC APIs. It is used by
/// [gRPC](https://github.com/grpc). The error model is designed to be:
///
/// - Simple to use and understand for most users
/// - Flexible enough to meet unexpected needs
///
/// # Overview
///
/// The `Status` message contains three pieces of data: error code, error
/// message,
/// and error details. The error code should be an enum value of
/// google.rpc.Code, but it may accept additional error codes if needed. The
/// error message should be a developer-facing English message that helps
/// developers *understand* and *resolve* the error. If a localized user-facing
/// error message is needed, put the localized message in the error details or
/// localize it in the client. The optional error details may contain arbitrary
/// information about the error. There is a predefined set of error detail types
/// in the package `google.rpc` that can be used for common error conditions.
///
/// # Language mapping
///
/// The `Status` message is the logical representation of the error model, but
/// it
/// is not necessarily the actual wire format. When the `Status` message is
/// exposed in different client libraries and different wire protocols, it can
/// be
/// mapped differently. For example, it will likely be mapped to some exceptions
/// in Java, but more likely mapped to some error codes in C.
///
/// # Other uses
///
/// The error model and the `Status` message can be used in a variety of
/// environments, either with or without APIs, to provide a
/// consistent developer experience across different environments.
///
/// Example uses of this error model include:
///
/// - Partial errors. If a service needs to return partial errors to the client,
/// it may embed the `Status` in the normal response to indicate the partial
/// errors.
///
/// - Workflow errors. A typical workflow has multiple steps. Each step may
/// have a `Status` message for error reporting.
///
/// - Batch operations. If a client uses batch request and batch response, the
/// `Status` message should be used directly inside batch response, one for
/// each error sub-response.
///
/// - Asynchronous operations. If an API call embeds asynchronous operation
/// results in its response, the status of those operations should be
/// represented directly using the `Status` message.
///
/// - Logging. If some API errors are stored in logs, the message `Status` could
/// be used directly after any stripping needed for security/privacy reasons.
class Status {
/// The status code, which should be an enum value of google.rpc.Code.
core.int code;
/// A list of messages that carry the error details. There is a common set of
/// message types for APIs to use.
///
/// The values for Object must be JSON objects. It can consist of `num`,
/// `String`, `bool` and `null` as well as `Map` and `List` values.
core.List<core.Map<core.String, core.Object>> details;
/// A developer-facing error message, which should be in English. Any
/// user-facing error message should be localized and sent in the
/// google.rpc.Status.details field, or localized by the client.
core.String message;
Status();
Status.fromJson(core.Map _json) {
if (_json.containsKey("code")) {
code = _json["code"];
}
if (_json.containsKey("details")) {
details = _json["details"];
}
if (_json.containsKey("message")) {
message = _json["message"];
}
}
core.Map<core.String, core.Object> toJson() {
final core.Map<core.String, core.Object> _json =
new core.Map<core.String, core.Object>();
if (code != null) {
_json["code"] = code;
}
if (details != null) {
_json["details"] = details;
}
if (message != null) {
_json["message"] = message;
}
return _json;
}
}
/// Request message to unclaim a device.
class UnclaimDeviceRequest {
/// The device ID returned by `ClaimDevice`.
core.String deviceId;
/// The device identifier you used when you claimed this device.
DeviceIdentifier deviceIdentifier;
/// The section type to unclaim for.
/// Possible string values are:
/// - "SECTION_TYPE_UNSPECIFIED" : Unspecified section type.
/// - "SECTION_TYPE_ZERO_TOUCH" : Zero touch section type.
core.String sectionType;
UnclaimDeviceRequest();
UnclaimDeviceRequest.fromJson(core.Map _json) {
if (_json.containsKey("deviceId")) {
deviceId = _json["deviceId"];
}
if (_json.containsKey("deviceIdentifier")) {
deviceIdentifier =
new DeviceIdentifier.fromJson(_json["deviceIdentifier"]);
}
if (_json.containsKey("sectionType")) {
sectionType = _json["sectionType"];
}
}
core.Map<core.String, core.Object> toJson() {
final core.Map<core.String, core.Object> _json =
new core.Map<core.String, core.Object>();
if (deviceId != null) {
_json["deviceId"] = deviceId;
}
if (deviceIdentifier != null) {
_json["deviceIdentifier"] = (deviceIdentifier).toJson();
}
if (sectionType != null) {
_json["sectionType"] = sectionType;
}
return _json;
}
}
/// Request to unclaim devices asynchronously in batch.
class UnclaimDevicesRequest {
/// List of devices to unclaim.
core.List<PartnerUnclaim> unclaims;
UnclaimDevicesRequest();
UnclaimDevicesRequest.fromJson(core.Map _json) {
if (_json.containsKey("unclaims")) {
unclaims = _json["unclaims"]
.map((value) => new PartnerUnclaim.fromJson(value))
.toList();
}
}
core.Map<core.String, core.Object> toJson() {
final core.Map<core.String, core.Object> _json =
new core.Map<core.String, core.Object>();
if (unclaims != null) {
_json["unclaims"] = unclaims.map((value) => (value).toJson()).toList();
}
return _json;
}
}
/// Request to update device metadata in batch.
class UpdateDeviceMetadataInBatchRequest {
/// List of metadata updates.
core.List<UpdateMetadataArguments> updates;
UpdateDeviceMetadataInBatchRequest();
UpdateDeviceMetadataInBatchRequest.fromJson(core.Map _json) {
if (_json.containsKey("updates")) {
updates = _json["updates"]
.map((value) => new UpdateMetadataArguments.fromJson(value))
.toList();
}
}
core.Map<core.String, core.Object> toJson() {
final core.Map<core.String, core.Object> _json =
new core.Map<core.String, core.Object>();
if (updates != null) {
_json["updates"] = updates.map((value) => (value).toJson()).toList();
}
return _json;
}
}
/// Request to set metadata for a device.
class UpdateDeviceMetadataRequest {
/// The metdata to set.
DeviceMetadata deviceMetadata;
UpdateDeviceMetadataRequest();
UpdateDeviceMetadataRequest.fromJson(core.Map _json) {
if (_json.containsKey("deviceMetadata")) {
deviceMetadata = new DeviceMetadata.fromJson(_json["deviceMetadata"]);
}
}
core.Map<core.String, core.Object> toJson() {
final core.Map<core.String, core.Object> _json =
new core.Map<core.String, core.Object>();
if (deviceMetadata != null) {
_json["deviceMetadata"] = (deviceMetadata).toJson();
}
return _json;
}
}
/// Identifies metdata updates to one device.
class UpdateMetadataArguments {
/// Device ID of the device.
core.String deviceId;
/// Device identifier.
DeviceIdentifier deviceIdentifier;
/// The metadata to update.
DeviceMetadata deviceMetadata;
UpdateMetadataArguments();
UpdateMetadataArguments.fromJson(core.Map _json) {
if (_json.containsKey("deviceId")) {
deviceId = _json["deviceId"];
}
if (_json.containsKey("deviceIdentifier")) {
deviceIdentifier =
new DeviceIdentifier.fromJson(_json["deviceIdentifier"]);
}
if (_json.containsKey("deviceMetadata")) {
deviceMetadata = new DeviceMetadata.fromJson(_json["deviceMetadata"]);
}
}
core.Map<core.String, core.Object> toJson() {
final core.Map<core.String, core.Object> _json =
new core.Map<core.String, core.Object>();
if (deviceId != null) {
_json["deviceId"] = deviceId;
}
if (deviceIdentifier != null) {
_json["deviceIdentifier"] = (deviceIdentifier).toJson();
}
if (deviceMetadata != null) {
_json["deviceMetadata"] = (deviceMetadata).toJson();
}
return _json;
}
}