DeviceReference
コレクションでコンテンツを整理
必要に応じて、コンテンツの保存と分類を行います。
DeviceReference
は API 抽象化の一種で、次のいずれかの識別子タイプを使用してメソッドにデバイス引数を渡すことができます。
- 数値の API リソース ID。
- 製造されたデバイスに属する実際のハードウェア ID(IMEI 番号など)。
デバイスで動作するメソッドは、呼び出し元にとって柔軟性が高いため、パラメータ型として DeviceReference
を受け取ります。デバイス ID について詳しくは、ID をご覧ください。
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 および関連会社の登録商標です。
最終更新日 2025-07-25 UTC。
[null,null,["最終更新日 2025-07-25 UTC。"],[],["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"],null,[]]