JSON 表示法 |
---|
{ "type": enum ( |
字段 | |
---|---|
type |
此条形码的类型。 |
renderEncoding |
条形码的呈现编码。指定后,条形码以给定编码呈现。否则,Google 将选择最佳已知编码。 |
valuePattern |
字符串编码的条形码值。此字符串支持以下替换:* {totp_value_n}:替换为 TOTP 值(请参阅 TotpDetails.parameters)。* {totp_timestamp_millis}:替换为生成条形码的时间戳(自纪元以来的毫秒数)。* {totp_timestamp_seconds}:替换为生成条形码的时间戳(自纪元起经过的秒数)。 |
totpDetails |
用于评估 {totp_value_n} 替换项的详细信息。 |
alternateText |
可选文本,将替换条形码下显示的默认文本。此字段适用于条形码值的人类可读等效项,在无法扫描条形码时使用。 |
showCodeText |
当条形码隐藏在点击操作后时显示的可选文本。如果卡券启用了智能触碰功能,就会发生这种情况。如果未指定,则由 Google 选择默认值。 |
initialRotatingBarcodeValues |
仅限输入。注意:此功能仅适用于公交类别。一组可选的初始轮替条形码值。这样就能在对象中包含一小部分条形码。必须使用 UploadRotatingBarcodeValues 端点上传后续旋转的条形码值。 |
TotpDetails
基于时间的动态密码替换的配置。请参阅 https://tools.ietf.org/html/rfc6238
JSON 表示法 |
---|
{ "periodMillis": string, "algorithm": enum ( |
字段 | |
---|---|
periodMillis |
用于生成 TOTP 值的时间间隔,以毫秒为单位。 |
algorithm |
用于生成动态密码的 TOTP 算法。 |
parameters[] |
每个 {totp_value_*} 替换的 TOTP 参数。索引 n 处的 TotpParameters 用于 {totp_value_n} 替换。 |
TotpAlgorithm
枚举 | |
---|---|
TOTP_ALGORITHM_UNSPECIFIED |
|
TOTP_SHA1 |
RFC 6238 中的 TOTP 算法,带 SHA1 哈希函数 |
TotpParameters
键和值长度的配置。请参阅 https://www.rfc-editor.org/rfc/rfc4226#section-5.3
JSON 表示法 |
---|
{ "key": string, "valueLength": integer } |
字段 | |
---|---|
key |
用于生成 TOTP 值的密钥,以 Base16 字符串编码。 |
valueLength |
TOTP 值的长度(以十进制数表示)。 |
RotatingBarcodeValues
包含许多条形码值和开始日期/时间的载荷。
JSON 表示法 |
---|
{ "startDateTime": string, "values": [ string ], "periodMillis": string } |
字段 | |
---|---|
startDateTime |
必需。第一个条形码的生效日期/时间。系统将使用对象的 RotatingBarcodeValueInfo 上定义的 periodMillis 来旋转条形码。 这是 ISO 8601 扩展格式的日期/时间,带有偏移量。时间最高可指定到纳秒级精度。偏移可以按秒精度指定(即使 ISO 8601 中不包含偏移秒数)。 例如:
|
values[] |
必需。要在条形码中编码的值。必须至少提供一个值。 |
periodMillis |
必需。每个条形码的有效期。 |