JSON 表示法 | |
---|---|
{ "name": string, "rawText": string, "textValue": string, "status": { object ( |
欄位 | ||
---|---|---|
name |
為輸入提供的引數名稱。 |
|
rawText |
為引數提供值的原始文字、輸入或朗讀的文字。 |
|
textValue |
當查詢模式包含 |
|
status |
指定在計算引數時發生錯誤的時間。例如內建意圖「actions.intent.PLACE」如果使用者拒絕授予裝置位置資訊存取權限,則會傳回錯誤狀態。 |
|
聯集欄位 value 。指定了下列其中一項:value 只能是下列其中一項: |
||
intValue |
當查詢模式包含 $org.schema.type.Number 類型,或預期的輸入內容含有內建意圖時,可指定為「assistant.intent.action.NUMBER」。 |
|
floatValue |
為內建意圖指定「actions.intent.NUMBER」 |
|
boolValue |
查詢模式包含 |
|
datetimeValue |
為內建意圖指定: |
|
placeValue |
當查詢模式包含 $org.schema.type.Location 類型,或預期的輸入內容含有內建意圖時,可指定為「actions.intent.PLACE」。 |
|
extension |
類型取決於引數的擴充功能。例如,如果 含有任意類型欄位的物件。額外的 |
|
structuredValue |
指定在 Google 需要以 JSON 格式傳遞資料值時指定的值。 |
狀態
Status
類型會定義適用於不同程式設計環境 (包含 REST API 和遠端程序呼叫 (RPC) API) 的邏輯錯誤模型。gRPC 會使用這個模型。每個 Status
訊息包含三部分的資料:錯誤代碼、錯誤訊息和錯誤詳細資料。
如要進一步瞭解這個錯誤模型,以及如何使用這個錯誤模型,請參閱 API 設計指南。
JSON 表示法 | |
---|---|
{ "code": integer, "message": string, "details": [ { "@type": string, field1: ..., ... } ] } |
欄位 | |
---|---|
code |
狀態碼,應為 |
message |
向開發人員顯示的錯誤訊息,應以英文呈現。凡是向使用者顯示的錯誤訊息,都應透過 |
details[] |
附有錯誤詳細資料的訊息清單。這是供 API 使用的一組常用訊息類型。 包含任意類型欄位的物件。額外的 |
DateTime
從使用者輸入內容剖析出的日期和時間引數值。但不含時區資訊。
JSON 表示法 | |
---|---|
{ "date": { object ( |
欄位 | |
---|---|
date |
日期值 |
time |
時間值 |
日期
表示完整或部分的日曆日期,例如生日。您可以視重要性決定是否要在別處指定時段和時區。日期以西曆為主,可用來表示:
- 完整日期,具有非零的年、月和日值
- 月和日值,年值為零。例如:週年紀念日
- 只有年,月和日值為零
- 年和月值,日值為零。例如:信用卡到期日
相關類型為 google.type.TimeOfDay
和 google.protobuf.Timestamp
。
JSON 表示法 | |
---|---|
{ "year": integer, "month": integer, "day": integer } |
欄位 | |
---|---|
year |
日期。必須為 1 到 9999;如要指定不含年份的日期,請輸入 0。 |
month |
月份。必須為 1 到 12;如要指定不含日期的年份,請輸入 0。 |
day |
日期。必須為 1 到 31,並屬於有效的年和月;如果只指定年份,或只指定年份和月份,而不指定當月第幾日的話,請輸入 0。 |
TimeOfDay
代表一天中的時間。日期和時區並不需要指定,或是在其他位置上指定。API 可選擇允許閏秒。相關類型為 google.type.Date
和 google.protobuf.Timestamp
。
JSON 表示法 | |
---|---|
{ "hours": integer, "minutes": integer, "seconds": integer, "nanos": integer } |
欄位 | |
---|---|
hours |
一天的營業時間,以 24 小時製表示。值應介於 0 到 23 之間。API 可選擇允許使用「24:00:00」這類的值來表示營業打烊時間等情況。 |
minutes |
一天內的分鐘數。值必須介於 0 到 59 之間。 |
seconds |
時間的秒數。正常情況下,值必須介於 0 到 59 之間。如果 API 允許閏秒,則可允許值為 60。 |
nanos |
秒數的小數,以奈秒表示。值必須介於 0 到 999,999,999 之間。 |