hanzo_client/models/challenge_view.rs
1/*
2 * Hanzo Cloud API
3 *
4 * The Hanzo Cloud API as a customer calls it: every operation under /v1/ except the operator's admin product, relay routes, legacy spellings and capabilities still reached by flag. Tagged by product: the first path segment after /v1/.
5 *
6 * The version of the OpenAPI document: v1
7 *
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
15pub struct ChallengeView {
16 /// ExpiresAt is when the nonce stops being redeemable, as a Unix timestamp.
17 #[serde(rename = "expiresAt", skip_serializing_if = "Option::is_none")]
18 pub expires_at: Option<i32>,
19 /// Message is the EXACT text to personal_sign. It is reconstructed server-side from the validated org, the slot and the nonce at redemption, so signing anything else cannot claim the slot.
20 #[serde(rename = "message", skip_serializing_if = "Option::is_none")]
21 pub message: Option<String>,
22 /// Nonce is the single-use, org-bound challenge value to send back with the signature.
23 #[serde(rename = "nonce", skip_serializing_if = "Option::is_none")]
24 pub nonce: Option<String>,
25 /// TokenID is the slot the challenge was issued for.
26 #[serde(rename = "tokenId", skip_serializing_if = "Option::is_none")]
27 pub token_id: Option<i32>,
28 /// TTLSeconds is the challenge lifetime in seconds.
29 #[serde(rename = "ttlSeconds", skip_serializing_if = "Option::is_none")]
30 pub ttl_seconds: Option<i32>,
31}
32
33impl ChallengeView {
34 pub fn new() -> ChallengeView {
35 ChallengeView {
36 expires_at: None,
37 message: None,
38 nonce: None,
39 token_id: None,
40 ttl_seconds: None,
41 }
42 }
43}
44