2025 年 4 月 1 日,Library API 中的部分範圍已遭到移除。
詳情請參閱這篇文章。
AlbumPosition
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
JSON 表示法 |
{
"position": enum (PositionType ),
// Union field relative_item can be only one of the following:
"relativeMediaItemId": string,
"relativeEnrichmentItemId": string
// End of list of possible types for union field relative_item .
} |
欄位 |
position |
enum (PositionType )
媒體或擴充項目的位置類型。
|
聯集欄位 relative_item 。與位置相關的項目。只有在使用位置類型 AFTER_MEDIA_ITEM 或 AFTER_ENRICHMENT_ITEM 時,才需要設定這個屬性。relative_item 只能採用下列其中一種設定: |
relativeMediaItemId |
string
相對於該位置的媒體項目。僅適用於位置類型為 AFTER_MEDIA_ITEM 的情況。
|
relativeEnrichmentItemId |
string
與位置相關的強化項目。僅適用於位置類型為 AFTER_ENRICHMENT_ITEM 的情況。
|
PositionType
列舉 |
POSITION_TYPE_UNSPECIFIED |
未設定這個列舉時的預設值。 |
FIRST_IN_ALBUM |
專輯開頭。 |
LAST_IN_ALBUM |
專輯結束時。 |
AFTER_MEDIA_ITEM |
在媒體項目後方。 |
AFTER_ENRICHMENT_ITEM |
在擴充項目之後。 |
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2025-07-25 (世界標準時間)。
[null,null,["上次更新時間:2025-07-25 (世界標準時間)。"],[[["\u003cp\u003e\u003ccode\u003eAlbumPosition\u003c/code\u003e defines the position of media or enrichment items within a Google Photos album.\u003c/p\u003e\n"],["\u003cp\u003eIt offers five position types: \u003ccode\u003ePOSITION_TYPE_UNSPECIFIED\u003c/code\u003e, \u003ccode\u003eFIRST_IN_ALBUM\u003c/code\u003e, \u003ccode\u003eLAST_IN_ALBUM\u003c/code\u003e, \u003ccode\u003eAFTER_MEDIA_ITEM\u003c/code\u003e, and \u003ccode\u003eAFTER_ENRICHMENT_ITEM\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eFor positions relative to other items (\u003ccode\u003eAFTER_MEDIA_ITEM\u003c/code\u003e, \u003ccode\u003eAFTER_ENRICHMENT_ITEM\u003c/code\u003e), you must specify the ID of the relative media or enrichment item.\u003c/p\u003e\n"],["\u003cp\u003eThe JSON representation includes the \u003ccode\u003eposition\u003c/code\u003e type and, if necessary, the ID of the relative item (\u003ccode\u003erelativeMediaItemId\u003c/code\u003e or \u003ccode\u003erelativeEnrichmentItemId\u003c/code\u003e).\u003c/p\u003e\n"]]],["The content defines how to specify a position within an album using a JSON structure. It uses a `position` field with an enumerated type (`PositionType`) that can be `FIRST_IN_ALBUM`, `LAST_IN_ALBUM`, `AFTER_MEDIA_ITEM`, or `AFTER_ENRICHMENT_ITEM`. If positioning after an item, either `relativeMediaItemId` or `relativeEnrichmentItemId` must be specified in the `relative_item` union field to identify the referenced media or enrichment item.\n"],null,["# AlbumPosition\n\n- [JSON representation](#SCHEMA_REPRESENTATION)\n- [PositionType](#PositionType)\n\nSpecifies a position in an album.\n\n| JSON representation |\n|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ``` { \"position\": enum (/photos/library/reference/rest/v1/AlbumPosition#PositionType), // Union field `relative_item` can be only one of the following: \"relativeMediaItemId\": string, \"relativeEnrichmentItemId\": string // End of list of possible types for union field `relative_item`. } ``` |\n\n| Fields ||\n|----------------------------|-------------------------------------------------------------------------------------------------------------------------------------------|\n| `position` | `enum (`[PositionType](/photos/library/reference/rest/v1/AlbumPosition#PositionType)`)` Type of position, for a media or enrichment item. |\n| Union field `relative_item`. The item to which the position is relative to. This must be set only if using position type `AFTER_MEDIA_ITEM` or `AFTER_ENRICHMENT_ITEM`. `relative_item` can be only one of the following: ||\n| `relativeMediaItemId` | `string` The media item to which the position is relative to. Only used when position type is AFTER_MEDIA_ITEM. |\n| `relativeEnrichmentItemId` | `string` The enrichment item to which the position is relative to. Only used when position type is AFTER_ENRICHMENT_ITEM. |\n\nPositionType\n------------\n\nPossible positions in an album.\n\n| Enums ||\n|-----------------------------|---------------------------------------|\n| `POSITION_TYPE_UNSPECIFIED` | Default value if this enum isn't set. |\n| `FIRST_IN_ALBUM` | At the beginning of the album. |\n| `LAST_IN_ALBUM` | At the end of the album. |\n| `AFTER_MEDIA_ITEM` | After a media item. |\n| `AFTER_ENRICHMENT_ITEM` | After an enrichment item. |"]]