DeviceReference
DeviceReference
は API 抽象化の一種で、次のいずれかの識別子型を使用してメソッドにデバイス引数を渡すことができます。
- 数値の API リソース ID。
- 製造されたデバイスに属する実際のハードウェア ID(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 は次のいずれかになります。 |
deviceId |
string (int64 format)
デバイスの ID。
|
deviceIdentifier |
object (DeviceIdentifier )
デバイスのハードウェア ID。
|
特に記載のない限り、このページのコンテンツはクリエイティブ・コモンズの表示 4.0 ライセンスにより使用許諾されます。コードサンプルは Apache 2.0 ライセンスにより使用許諾されます。詳しくは、Google Developers サイトのポリシーをご覧ください。Java は Oracle および関連会社の登録商標です。
最終更新日 2024-11-08 UTC。
[null,null,["最終更新日 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"]]