Authentication

AuthToken 介面

google.maps.journeySharing.AuthToken 介面

權杖擷取工具傳回的驗證權杖。

expiresInSeconds
類型:  number
到期時間,以秒為單位。權杖的擷取時間過後會失效。
token
類型:  string
權杖。

AuthTokenContext 介面

google.maps.journeySharing.AuthTokenContext 介面

包含擷取 JSON Web Token 所需的其他資訊。

deliveryVehicleId optional
類型:  string optional
提供憑證後,最少的權杖會針對提供的 deliveryVehicleId 提供私人 DeliveryVehicleId 憑證附加資訊。
taskId optional
類型:  string optional
如已提供憑證,則提供憑證的不公開 TaskId 憑證應用於提供的 tasksId。
trackingId optional
類型:  string optional
如已提供憑證,則提供憑證的不公開 TrackingId 憑證應用於提供的追蹤 ID。
tripId optional
類型:  string optional
提供權杖後,指定權杖的不公開 TripId 憑證應用於提供的 tripId。
vehicleId optional
類型:  string optional
如已提供憑證,則提供憑證的不公開 VehicleId 憑證應用於提供的 carId。

AuthTokenFetcher typedef

google.maps.journeySharing.AuthTokenFetcher typedef

驗證權杖函式類型。

接受 AuthTokenFetcherOptions 物件的函式,其中包含要驗證的驗證權杖詳細資料。這個函式應會縮短權杖,並傳回包含權杖及其到期時間的 AuthToken

function(AuthTokenFetcherOptions): Promise<AuthToken>

AuthTokenFetcherOptions 介面

google.maps.journeySharing.AuthTokenFetcherOptions 介面

驗證權杖擷取工具的選項。

context
類型:  AuthTokenContext
驗證權杖內容。結構定義中指定的 ID 應新增至傳送至 JSON Web Token 採集端點的要求。
serviceType
Fleet Engine 服務類型。

FleetEngineServiceType 常數

google.maps.journeySharing.FleetEngineServiceType 常數

Fleet Engine 服務的類型。

呼叫 const {FleetEngineServiceType} = await google.maps.importLibrary("journeySharing") 即可存取。請參閱 Maps JavaScript API 中的程式庫

DELIVERY_VEHICLE_SERVICE 用於存取配送車輛的 Fleet Engine 服務。
TASK_SERVICE 用於存取工作資訊的 Fleet Engine 服務。
TRIP_SERVICE 用於存取行程資訊的 Fleet Engine 服務。
UNKNOWN_SERVICE 不明的 Fleet Engine 服務。