DeviceReference
A DeviceReference
is an API abstraction that lets you supply a device argument to a method using one of the following identifier types:
- A numeric API resource ID.
- Real-world hardware IDs, such as IMEI number, belonging to the manufactured device.
Methods that operate on devices take a DeviceReference
as a parameter type because it's more flexible for the caller. To learn more about device identifiers, read Identifiers.
JSON representation |
{
// Union field device can be only one of the following:
"deviceId": string,
"deviceIdentifier": {
object (DeviceIdentifier )
}
// End of list of possible types for union field device .
} |
Fields |
Union field device . Required. The unique identifier for the device. device can be only one of the following: |
deviceId |
string (int64 format)
The ID of the device.
|
deviceIdentifier |
object (DeviceIdentifier )
The hardware IDs of the device.
|
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-08-07 UTC.
[null,null,["Last updated 2024-08-07 UTC."],[[["`DeviceReference` allows methods to accept a device argument using either a numeric API resource ID or real-world hardware IDs."],["Methods use `DeviceReference` as a parameter for flexibility in identifying devices."],["The `device` field in the JSON representation is a union field, accepting either a `deviceId` or `deviceIdentifier`."],["`deviceId` is a string that represents the unique ID of the device, and `deviceIdentifier` refers to an object containing the hardware IDs."]]],[]]