TaskLog

Deliveries API 中的工作資源記錄。

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 是否可貼至 currentRouteSegmentFalse 表示 lastLocationcurrentRouteSegment 不存在。

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)

如果抵達停靠站的預計到達時間 <= durationUntilEstimatedArrivalTimeThreshold,使用者便可看到此資料元素。

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

remainingDrivingDistanceMetersThreshold

integer

如果剩餘的行車距離 (公尺 <= leftDrivingDistanceMetersThreshold),使用者就可以看到此資料元素。

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

雙重輸入屬性值。