DeviceReference एक एपीआई एब्स्ट्रैक्शन है. इसकी मदद से, किसी तरीके में डिवाइस आर्ग्युमेंट दिया जा सकता है. इसके लिए, इनमें से किसी एक तरह के आइडेंटिफ़ायर का इस्तेमाल किया जा सकता है:
एपीआई का अंकों वाला रिसॉर्स आईडी.
डिवाइस बनाए गए डिवाइस के रीयल-वर्ल्ड हार्डवेयर आईडी, जैसे कि IMEI नंबर.
डिवाइसों पर काम करने वाले तरीके, पैरामीटर टाइप के तौर पर DeviceReference लेते हैं, क्योंकि यह कॉलर के लिए ज़्यादा सुविधाजनक होता है. डिवाइस आइडेंटिफ़ायर के बारे में ज़्यादा जानने के लिए, आइडेंटिफ़ायर पढ़ें.
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.}
फ़ील्ड
यूनियन फ़ील्ड device. ज़रूरी है. डिवाइस का यूनीक आइडेंटिफ़ायर. device इनमें से सिर्फ़ एक हो सकता है:
[[["समझने में आसान है","easyToUnderstand","thumb-up"],["मेरी समस्या हल हो गई","solvedMyProblem","thumb-up"],["अन्य","otherUp","thumb-up"]],[["वह जानकारी मौजूद नहीं है जो मुझे चाहिए","missingTheInformationINeed","thumb-down"],["बहुत मुश्किल है / बहुत सारे चरण हैं","tooComplicatedTooManySteps","thumb-down"],["पुराना","outOfDate","thumb-down"],["अनुवाद से जुड़ी समस्या","translationIssue","thumb-down"],["सैंपल / कोड से जुड़ी समस्या","samplesCodeIssue","thumb-down"],["अन्य","otherDown","thumb-down"]],["आखिरी बार 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."]]],[]]