RotatingBarcode

JSON 表示法
{
  "type": enum (BarcodeType),
  "renderEncoding": enum (BarcodeRenderEncoding),
  "valuePattern": string,
  "totpDetails": {
    object (TotpDetails)
  },
  "alternateText": string,
  "showCodeText": {
    object (LocalizedString)
  },
  "initialRotatingBarcodeValues": {
    object (RotatingBarcodeValues)
  }
}
欄位
type

enum (BarcodeType)

此條碼的類型。

renderEncoding

enum (BarcodeRenderEncoding)

條碼的轉譯編碼。如有指定,則會以指定的編碼轉譯條碼。如未指定,則由 Google 選擇最已知的編碼。

valuePattern

string

字串編碼條碼值。這個字串支援下列替代字元:* {totp_value_n}:已替換為 TOTP 值 (請參閱 TotpDetails.parameters)。* {totp_timestamp_millis}:替換為產生條碼時的時間戳記 (毫秒)。* {totp_timestamp_seconds}:替換為產生條碼時的時間戳記 (自 Epoch 紀元時間起算的秒數)。

totpDetails

object (TotpDetails)

用於評估 {totp_value_n} 替換值的詳細資料。

alternateText

string

選用文字,會覆寫條碼下方顯示的預設文字。這個欄位旨在提供使用者能夠理解的條碼值對應內容,條碼無法掃描時即可使用。

showCodeText

object (LocalizedString)

執行點選動作後隱藏條碼時顯示的選填文字。如果票證啟用智慧感應功能,就會發生這種情形。如未指定,則由 Google 選擇預設值。

initialRotatingBarcodeValues

object (RotatingBarcodeValues)

僅限輸入。注意:這項功能僅適用於大眾運輸類別。一組選用的初始旋轉條碼值。這可讓物件加入一小部分的條碼。必須透過 UploadRotatingBarcodeValues 端點上傳其他輪替條碼值。

TotpDetails

以時間為準的 OTP 替代項目設定。詳情請參閱 https://tools.ietf.org/html/rfc6238

JSON 表示法
{
  "periodMillis": string,
  "algorithm": enum (TotpAlgorithm),
  "parameters": [
    {
      object (TotpParameters)
    }
  ]
}
欄位
periodMillis

string (int64 format)

產生 TOTP 值時使用的時間間隔 (以毫秒為單位)。

algorithm

enum (TotpAlgorithm)

用於產生動態密碼的 TOTP 演算法。

parameters[]

object (TotpParameters)

每個 {totp_value_*} 替代變數的 TOTP 參數。位於索引 n 的 TotpParameters 用於取代 {totp_value_n}。

TotpAlgorithm

列舉
TOTP_ALGORITHM_UNSPECIFIED
TOTP_SHA1 RFC 6238 與 SHA1 雜湊函式具有的 TOTP 演算法

TotpParameters

鍵/值長度的設定。詳情請參閱 https://www.rfc-editor.org/rfc/rfc4226#section-5.3

JSON 表示法
{
  "key": string,
  "valueLength": integer
}
欄位
key

string

用於產生 TOTP 值的密鑰,並編碼為 Base16 字串。

valueLength

integer

以十進位數字表示的 TOTP 值長度。

RotatingBarcodeValues

包含許多條碼值和開始日期/時間的酬載。

JSON 表示法
{
  "startDateTime": string,
  "values": [
    string
  ],
  "periodMillis": string
}
欄位
startDateTime

string

必要欄位。第一個條碼的有效日期/時間。條碼將使用在物件的 RotatingBarcodeValueInfo 上所定義的 sessionMillis 進行旋轉。

日期/時間採用 ISO 8601 擴充格式,採用偏移量。時間的精確度可以指定到奈秒。偏移量可以指定秒精確度 (雖然偏移秒數並非 ISO 8601 的一部分)。

例如:

1985-04-12T23:20:50.52Z 是世界標準時間 1985 年 4 月 12 日 23 時 20 分 50.52 秒。

1985-04-12T19:20:50.52-04:00 是 1985 年 4 月 12 日 19 時 20 分 50.52 秒,比世界標準時間慢 4 個小時 (與上述範例為同一時間)。如果活動是在紐約舉行,則等同於美東夏令時間 (EDT)。請注意,偏移量可能會因當地時段而異。

values[]

string

必要欄位。要在條碼中編碼的值。至少須輸入一個值。

periodMillis

string (int64 format)

必要欄位。每個條碼的有效時間長度。