- JSON 表示法
- TotpDetails
          <ph type="x-smartling-placeholder">- </ph>
            
- JSON 表示法
 
- TotpAlgorithm
- TotpParameters
          <ph type="x-smartling-placeholder">- </ph>
            
- JSON 表示法
 
- RotatingBarcodeValues
          <ph type="x-smartling-placeholder">- </ph>
            
- JSON 表示法
 
| 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 | 采用 SHA1 哈希函数的 RFC 6238 标准 TOTP 算法 | 
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 | 
 必需。每个条形码的有效期。 | 
