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 關閉時,會指出工作是否順利完成。

taskOutcomeTime

string (Timestamp format)

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

RFC3339 世界標準時間「Zulu」的時間戳記格式,解析度為奈秒,且最多 9 個小數位數。範例:"2014-10-02T15:01:23Z""2014-10-02T15:01:23.045123456Z"

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

如果剩餘的停靠站計數 <= leftStopCountThreshold ,使用者可以看見這個資料元素。

durationUntilEstimatedArrivalTimeThreshold

string (Duration format)

如果到達停靠站的預計到達時間 <= timeUntil 預估 ArrivalTimeThreshold,使用者可以看見此資料元素。

持續時間以秒為單位,最多 9 個小數位數,結尾為「s」。範例:"3.5s"

remainingDrivingDistanceMetersThreshold

integer

如果剩餘的行車距離 (以公尺 <= leftoptimizeDistanceMetersThreshold) 顯示,使用者可以看見這個資料元素。

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

雙重輸入的屬性值。