TaskLog

Deliveries API 中 Task 資源的記錄。

JSON 表示法
{
  "name": string,
  "type": enum (TaskTypeLog),
  "state": enum (TaskStateLog),
  "taskOutcome": enum (TaskOutcomeLog),
  "taskOutcomeTime": string,
  "taskOutcomeLocation": {
    object (LocationInfoLog)
  },
  "taskOutcomeLocationSource": enum (TaskOutcomeLocationSourceLog),
  "trackingId": string,
  "deliveryVehicleId": string,
  "plannedLocation": {
    object (LocationInfoLog)
  },
  "taskDuration": string,
  "targetTimeWindow": {
    object (TimeWindowLog)
  },
  "journeySharingInfo": {
    object (JourneySharingInfoLog)
  },
  "taskTrackingViewConfig": {
    object (TaskTrackingViewConfigLog)
  },
  "attributes": [
    {
      object (TaskAttributeLog)
    }
  ]
}
欄位
name

string

任務資源名稱,格式為 providers/{providerId}/tasks/{taskId}

type

enum (TaskTypeLog)

工作類型。

state

enum (TaskStateLog)

工作狀態,表示工作進度。

taskOutcome

enum (TaskOutcomeLog)

嘗試執行工作時的結果。當 TaskState 關閉時,這會指出該 TaskState 是否已順利完成。

taskOutcomeTime

string (Timestamp format)

設定工作結果的時間戳記 (來自供應器)。

使用 RFC 3339,產生的輸出內容一律會經過 Z 規格化,並使用 0、3、6 或 9 小數位數。系統也接受「Z」以外的偏移值。例如:"2014-10-02T15:01:23Z""2014-10-02T15:01:23.045123456Z""2014-10-02T15:01:23+05:30"

taskOutcomeLocation

object (LocationInfoLog)

設定工作結果的位置。

taskOutcomeLocationSource

enum (TaskOutcomeLocationSourceLog)

指明 taskOutcomeLocation 的值來源。

trackingId

string

這個欄位可讓您為客戶儲存 ID,避免不必要或複雜的對應。

deliveryVehicleId

string

執行此工作的車輛 ID。

plannedLocation

object (LocationInfoLog)

工作完成的位置。

taskDuration

string (Duration format)

在這個地點執行動作的額外時間。

時間長度以秒為單位,最多可有 9 個小數位數,並應以「s」結尾,例如:"3.5s"

targetTimeWindow

object (TimeWindowLog)

應完成工作時段。

journeySharingInfo

object (JourneySharingInfoLog)

旅程分享特定欄位。

taskTrackingViewConfig

object (TaskTrackingViewConfigLog)

工作追蹤的設定,可指定在何種情況下向使用者顯示哪些資料元素。

attributes[]

object (TaskAttributeLog)

自訂工作屬性清單。每個屬性都必須有專屬鍵。

JourneySharingInfoLog

旅程分享特定欄位。

JSON 表示法
{
  "remainingVehicleJourneySegments": [
    {
      object (VehicleJourneySegmentLog)
    }
  ],
  "lastLocation": {
    object (DeliveryVehicleLocationLog)
  },
  "lastLocationSnappable": boolean
}
欄位
remainingVehicleJourneySegments[]

object (VehicleJourneySegmentLog)

指派車輛在完成這項任務前,會前往的每個停靠站的追蹤資訊。這份清單可能包含其他任務的停靠站。

lastLocation

object (DeliveryVehicleLocationLog)

車輛上次回報的位置。

lastLocationSnappable

boolean

指出車輛的 lastLocation 是否可以對齊 currentRouteSegment。如果 lastLocationcurrentRouteSegment 不存在,則使用 False

TaskTrackingViewConfigLog

設定訊息,定義使用者可查看任務資料元素的時間。

JSON 表示法
{
  "routePolylinePointsVisibility": {
    object (VisibilityOptionLog)
  },
  "estimatedArrivalTimeVisibility": {
    object (VisibilityOptionLog)
  },
  "estimatedTaskCompletionTimeVisibility": {
    object (VisibilityOptionLog)
  },
  "remainingDrivingDistanceVisibility": {
    object (VisibilityOptionLog)
  },
  "remainingStopCountVisibility": {
    object (VisibilityOptionLog)
  },
  "vehicleLocationVisibility": {
    object (VisibilityOptionLog)
  }
}
欄位
routePolylinePointsVisibility

object (VisibilityOptionLog)

這個欄位會指定路線折線點可見的時間。如果未指定這個欄位,系統會使用這項資料的專案層級預設顯示設定。

estimatedArrivalTimeVisibility

object (VisibilityOptionLog)

這個欄位會指定可顯示預估到達時間的時間點。如果未指定這個欄位,系統會使用這項資料的專案層級預設顯示設定。

estimatedTaskCompletionTimeVisibility

object (VisibilityOptionLog)

指定預估工作完成時間可供查看的欄位。如果未指定這個欄位,系統會使用這項資料的專案層級預設顯示設定。

remainingDrivingDistanceVisibility

object (VisibilityOptionLog)

這個欄位可指定顯示剩餘行駛距離的時間。如果未指定這個欄位,系統會使用這項資料的專案層級預設顯示設定。

remainingStopCountVisibility

object (VisibilityOptionLog)

這個欄位可指定可顯示剩餘停靠站數的時間。如果未指定這個欄位,系統會使用這項資料的專案層級預設顯示設定。

vehicleLocationVisibility

object (VisibilityOptionLog)

這個欄位可指定車輛位置資訊可供查看的時間。如果未指定這個欄位,系統會使用這項資料的專案層級預設顯示設定。

VisibilityOptionLog

選用訊息,定義使用者可查看資料元素的時間。

JSON 表示法
{

  // Union field visibility_option can be only one of the following:
  "remainingStopCountThreshold": integer,
  "durationUntilEstimatedArrivalTimeThreshold": string,
  "remainingDrivingDistanceMetersThreshold": integer,
  "always": boolean,
  "never": boolean
  // End of list of possible types for union field visibility_option.
}
欄位

聯集欄位 visibility_option

visibility_option 只能是下列其中一項:

remainingStopCountThreshold

integer

如果剩餘停靠站數小於 remainingStopCountThreshold,使用者就會看到這個資料元素。

durationUntilEstimatedArrivalTimeThreshold

string (Duration format)

如果到站預估時間 <= 到達時間前所需時間上限,使用者就會看到這個資料元素。

時間長度以秒為單位,最多可有 9 個小數位數,並應以「s」結尾,例如:"3.5s"

remainingDrivingDistanceMetersThreshold

integer

如果剩餘行駛距離 (以公尺為單位) 小於 remainingDrivingDistanceMetersThreshold,使用者就會看到這個資料元素。

always

boolean

如果設為 true,則系統一律會向使用者顯示這個資料元素,且沒有設定門檻。

never

boolean

如果設為 true,系統就會一律向使用者隱藏這個資料元素,且不設門檻。

TaskAttributeLog

以鍵/值組合的方式說明工作屬性。「key:value」字串長度不得超過 256 個半形字元。

JSON 表示法
{
  "key": string,

  // Union field task_attribute_value can be only one of the following:
  "stringValue": string,
  "boolValue": boolean,
  "numberValue": number
  // End of list of possible types for union field task_attribute_value.
}
欄位
key

string

屬性鍵。索引鍵不得包含冒號字元 (:)。

聯集欄位 task_attribute_value。屬性的值可以是字串、布林值或雙精度型別。如果未設定任何值,TaskAttribute 的 string_value 會儲存為空字串「"」。task_attribute_value 只能是下列任一值:
stringValue

string

字串型屬性值。

boolValue

boolean

布林型屬性值。

numberValue

number

雙精度浮點型屬性值。