谷歌眼镜--参考文档

 参考文档

在用户的时间轴上的每个项目作为JSON 一个TimelineItem结构表示,如下所述。

{
  "kind": "mirror#timelineItem",
  "id": string,
  "sourceItemId": string,
  "canonicalUrl": string,
  "bundleId": string,
  "isBundleCover": boolean,
  "selfLink": string,
  "created": datetime,
  "updated": datetime,
  "displayTime": datetime,
  "isPinned": boolean,
  "pinScore": integer,
  "isDeleted": boolean,
  "etag": etag,
  "creator": contacts Resource,
  "recipients": [
    contacts Resource
  ],
  "inReplyTo": string,
  "title": string,
  "text": string,
  "html": string,
  "htmlPages": [
    string
  ],
  "speakableText": string,
  "attachments": [
    {
      "id": string,
      "contentType": string,
      "contentUrl": string,
      "isProcessingContent": boolean
    }
  ],
  "location": locations Resource,
  "menuItems": [
    {
      "id": string,
      "action": string,
      "values": [
        {
          "state": string,
          "displayName": string,
          "iconUrl": string
        }
      ],
      "removeWhenSelected": boolean
    }
  ],
  "notification": {
    "level": string,
    "deliveryTime": datetime
  }
}
Property nameValueDescriptionNotes
kindstringThe type of resource. This is always mirror#timelineItem. 
idstringThe ID of the timeline item. This is unique within a user's timeline. 
sourceItemIdstringOpaque string you can use to map a timeline item to data in your own service.writable
canonicalUrlstringA canonical URL pointing to the canonical/high quality version of the data represented by the timeline item.writable
bundleIdstringThe bundle ID for this item. Services can specify a bundleId to group many items together. They appear under a single top-level item on the device.writable
isBundleCoverbooleanWhether this item is a bundle cover.

If an item is marked as a bundle cover, it will be the entry point to the bundle of items that have the samebundleId as that item. It will be shown only on the main timeline — not within the opened bundle.

On the main timeline, items that are shown are:
  • Items that have isBundleCover set to true
  • Items that do not have a bundleId
In a bundle sub-timeline, items that are shown are:
  • Items that have the bundleId in question AND isBundleCover set to false
writable
createddatetimeThe time at which this item was created, formatted according to RFC 3339. 
updateddatetimeThe time at which this item was last modified, formatted according to RFC 3339. 
displayTimedatetimeThe time that should be displayed when this item is viewed in the timeline, formatted according to RFC 3339. This user's timeline is sorted chronologically on display time, so this will also determine where the item is displayed in the timeline. If not set by the service, the display time defaults to the updated time.writable
isPinnedbooleanWhen true, indicates this item is pinned, which means it's grouped alongside "active" items like navigation and hangouts, on the opposite side of the home screen from historical (non-pinned) timeline items. You can allow the user to toggle the value of this property with the TOGGLE_PINNED built-in menu item. 
pinScoreintegerFor pinned items, this determines the order in which the item is displayed in the timeline, with a higher score appearing closer to the clock. Note: setting this field is currently not supported. 
isDeletedbooleanWhen true, indicates this item is deleted, and only the ID property is set. 
etagetagETag for this item. 
creatornested objectThe user or group that created this item.writable
recipients[]listA list of users or groups that this item has been shared with.writable
inReplyTostringIf this item was generated as a reply to another item, this field will be set to the ID of the item being replied to. This can be used to attach a reply to the appropriate conversation or post. 
titlestringThe title of this item.writable
textstringText content of this item.writable
htmlstringHTML content for this item. If both text and html are provided for an item, the html will be rendered in the timeline. 

Allowed HTML elements - You can use these elements in your timeline cards.

  • Headers: h1, h2, h3, h4, h5, h6
  • Images: img
  • Lists: li, ol, ul
  • HTML5 semantics: article, aside, details, figure, figcaption, footer, header, nav, section, summary, time
  • Structural: blockquote, br, div, hr, p, span
  • Style: b, big, center, em, i, u, s, small, strike, strong, style, sub, sup
  • Tables: table, tbody, td, tfoot, th, thead, tr

Blocked HTML elements: These elements and their contents are removed from HTML payloads.

  • Document headers: head, title
  • Embeds: audio, embed, object, source, video
  • Frames: frame, frameset
  • Scripting: applet, script

Other elements: Any elements that aren't listed are removed, but their contents are preserved.

writable
htmlPages[]listAdditional pages of HTML content associated with this item. If this field is specified, the item will be displayed as a bundle, with the html field as the cover. It is an error to specify this field without specifying the html field.writable
speakableTextstringThe speakable version of the content of this item. Along with the READ_ALOUD menu item, use this field to provide text that would be clearer when read aloud, or to provide extended information to what is displayed visually on Glass. If you specified html content, use this property instead of text to specify the text to read aloud.writable
attachments[]listA list of media attachments associated with this item. As a convenience, you can refer to attachments in your HTML payloads with the attachment or cid scheme. For example:
  • attachment: <img src="attachment:attachment_index"> where attachment_index is the 0-based index of this array.
  • cid: <img src="cid:attachment_id"> where attachment_id is the ID of the attachment.
 
attachments[].idstringThe ID of the attachment. 
attachments[].contentTypestringThe MIME type of the attachment. 
attachments[].contentUrlstringThe URL for the content. 
attachments[].isProcessingContentbooleanIndicates that the contentUrl is not available because the attachment content is still being processed. If the caller wishes to retrieve the content, it should try again later. 
locationnested objectThe geographic location associated with this item.writable
notificationnested objectControls how notifications for this item are presented on the device. If this is missing, no notification will be generated.writable
notification.levelstringDescribes how important the notification is. Allowed values are:
  • DEFAULT - Notifications of default importance. A chime will be played to alert users.
writable
notification.deliveryTimedatetimeThe time at which the notification should be delivered.writable

Methods

delete
Deletes a timeline item.
get
Gets a single timeline item by ID.
insert
Inserts a new item into the timeline.
list
Retrieves a list of timeline items for the authenticated user.
patch
Updates a timeline item in place. This method supports  patch semantics.
update
Updates a timeline item in place.

转载于:https://www.cnblogs.com/tinytiny/p/3140885.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值