Un DeviceReference es una abstracción de API que te permite proporcionar un argumento device a un método usando uno de los siguientes tipos de identificadores:
Es un ID numérico de recurso de la API.
IDs de hardware del mundo real, como el número de IMEI, que pertenecen al dispositivo fabricado
Los métodos que funcionan en dispositivos toman un DeviceReference como tipo de parámetro porque es más flexible para el llamador. Para obtener más información sobre los identificadores de dispositivos, consulta Identificadores.
Representación JSON
{// 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.}
Campos
Campo de unión device. Obligatorio. Es el identificador único del dispositivo. Las direcciones (device) solo pueden ser una de las siguientes opciones:
[[["Fácil de comprender","easyToUnderstand","thumb-up"],["Resolvió mi problema","solvedMyProblem","thumb-up"],["Otro","otherUp","thumb-up"]],[["Falta la información que necesito","missingTheInformationINeed","thumb-down"],["Muy complicado o demasiados pasos","tooComplicatedTooManySteps","thumb-down"],["Desactualizado","outOfDate","thumb-down"],["Problema de traducción","translationIssue","thumb-down"],["Problema con las muestras o los códigos","samplesCodeIssue","thumb-down"],["Otro","otherDown","thumb-down"]],["Última actualización: 2024-11-08 (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."]]],["A `DeviceReference` is used as a device argument in methods, accepting either a numeric API resource ID (`deviceId`) or real-world hardware IDs (`deviceIdentifier`) like IMEI. The JSON representation uses a union field named `device` that contains either a `deviceId` string (int64 format) or a `deviceIdentifier` object, which holds the device's hardware IDs. Methods use this type for increased flexibility in identifying devices.\n"]]