sindri_openapi/models/
proof_info_response.rs

1/*
2 * Sindri Labs API
3 *
4 *  ## About [Sindri Labs](https://www.sindri.app/)' API simplifies the developer experience to enable fast and scalable zero-knowledge proof generation.  Front-End Dashboard: [https://sindri.app/login](https://sindri.app/login)  ## Documentation The [Sindri Documentation](https://sindri.app/docs) contains everything you need to get started!  ## Sindri Resources The [sindri-resources GitHub repo](https://github.com/Sindri-Labs/sindri-resources) contains contains resources and sample data for the Sindri API.  ## Using this Page This is a standard [OpenAPI (Swagger)](https://swagger.io/specification/) API documentation page. It provides detailed documentation for each endpoint.  This page enables easy prototyping via the \"Try it out\" feature!  Since all Sindri endpoints require a valid API Key, in order to use the \"Try it out\" feature for any endpoint in this documentation you must first obtain an API key. Do this in one of two ways: 1. Enter your username and password in the `/api/apikey/generate` endpoint of the **Authorization** section below. Use the API key returned in the `access` field of the response. 2. Obtain an API key from the Sindri Dashboard team \"Account Settings\".  After obtaining your API key, authorize your page session by entering your API Key in the `SindriAPIKeyBearerAuth` section, reached by clicking \"Authorize\" below.  Proving Backend Version: v1.2.4
5 *
6 * The version of the OpenAPI document: v1.17.8
7 *
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14/// ProofInfoResponse : Response for getting proof info.
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct ProofInfoResponse {
17    /// A unique identifier generated for the proof. UUID4 format.
18    #[serde(rename = "proof_id")]
19    pub proof_id: String,
20    #[serde(rename = "circuit_name")]
21    pub circuit_name: String,
22    /// The name of the project associated with this proof.
23    #[serde(rename = "project_name")]
24    pub project_name: String,
25    /// The circuit_id of the circuit associated with this proof. UUID4 format.
26    #[serde(rename = "circuit_id")]
27    pub circuit_id: String,
28    /// The development framework used to write the circuit. This is specified during creation in the included sindri.json file.
29    #[serde(rename = "circuit_type")]
30    pub circuit_type: models::CircuitType,
31    /// The UTC datetime the circuit was uploaded in ISO8601 format.
32    #[serde(rename = "date_created")]
33    pub date_created: String,
34    /// Metadata keys and values for the proof that were specified at creation time.
35    #[serde(rename = "meta")]
36    pub meta: std::collections::HashMap<String, String>,
37    /// A boolean indicating whether an internal verification check occurred during the proof creation.
38    #[serde(rename = "perform_verify")]
39    pub perform_verify: bool,
40    /// The status of the proof job.
41    #[serde(rename = "status")]
42    pub status: models::JobStatus,
43    /// The job is finished processing and waiting/polling can be terminated.
44    #[serde(rename = "finished_processing")]
45    pub finished_processing: bool,
46    #[serde(rename = "verified", deserialize_with = "Option::deserialize")]
47    pub verified: Option<bool>,
48    /// The name of the team that owns this proof.
49    #[serde(rename = "team")]
50    pub team: String,
51    /// URL for the avatar image of the team that owns this proof.
52    #[serde(rename = "team_avatar_url")]
53    pub team_avatar_url: String,
54    /// The name of the team that owns this proof.
55    #[serde(rename = "team_name")]
56    pub team_name: String,
57    /// The slug of the team that owns this proof.
58    #[serde(rename = "team_slug")]
59    pub team_slug: String,
60    /// The name of the team that owns the circuit associated with this proof.
61    #[serde(rename = "circuit_team")]
62    pub circuit_team: String,
63    /// URL for the avatar image of the team that owns the circuit associated with this proof.
64    #[serde(rename = "circuit_team_avatar_url")]
65    pub circuit_team_avatar_url: String,
66    /// The slug of the team that owns the circuit associated with this proof.
67    #[serde(rename = "circuit_team_slug")]
68    pub circuit_team_slug: String,
69    #[serde(
70        rename = "compute_time",
71        default,
72        with = "::serde_with::rust::double_option",
73        skip_serializing_if = "Option::is_none"
74    )]
75    pub compute_time: Option<Option<String>>,
76    #[serde(
77        rename = "compute_time_sec",
78        default,
79        with = "::serde_with::rust::double_option",
80        skip_serializing_if = "Option::is_none"
81    )]
82    pub compute_time_sec: Option<Option<f64>>,
83    /// Detailed compute times for the proof generation.
84    #[serde(
85        rename = "compute_times",
86        default,
87        with = "::serde_with::rust::double_option",
88        skip_serializing_if = "Option::is_none"
89    )]
90    pub compute_times: Option<Option<Box<models::AnyOfLessThanGreaterThan>>>,
91    #[serde(
92        rename = "file_size",
93        default,
94        with = "::serde_with::rust::double_option",
95        skip_serializing_if = "Option::is_none"
96    )]
97    pub file_size: Option<Option<i32>>,
98    #[serde(
99        rename = "proof",
100        default,
101        with = "::serde_with::rust::double_option",
102        skip_serializing_if = "Option::is_none"
103    )]
104    pub proof: Option<Option<serde_json::Value>>,
105    /// The public outputs of the circuit.
106    #[serde(
107        rename = "public",
108        default,
109        with = "::serde_with::rust::double_option",
110        skip_serializing_if = "Option::is_none"
111    )]
112    pub public: Option<Option<Box<models::AnyOfLessThanGreaterThan>>>,
113    #[serde(
114        rename = "queue_time",
115        default,
116        with = "::serde_with::rust::double_option",
117        skip_serializing_if = "Option::is_none"
118    )]
119    pub queue_time: Option<Option<String>>,
120    #[serde(
121        rename = "queue_time_sec",
122        default,
123        with = "::serde_with::rust::double_option",
124        skip_serializing_if = "Option::is_none"
125    )]
126    pub queue_time_sec: Option<Option<f64>>,
127    #[serde(
128        rename = "smart_contract_calldata",
129        default,
130        with = "::serde_with::rust::double_option",
131        skip_serializing_if = "Option::is_none"
132    )]
133    pub smart_contract_calldata: Option<Option<String>>,
134    /// Boolean indicating whether this proof has smart contract calldata available.
135    #[serde(
136        rename = "has_smart_contract_calldata",
137        skip_serializing_if = "Option::is_none"
138    )]
139    pub has_smart_contract_calldata: Option<bool>,
140    /// Boolean indicating whether this proof's circuit has a verification key available.
141    #[serde(
142        rename = "has_verification_key",
143        skip_serializing_if = "Option::is_none"
144    )]
145    pub has_verification_key: Option<bool>,
146    #[serde(
147        rename = "verification_key",
148        default,
149        with = "::serde_with::rust::double_option",
150        skip_serializing_if = "Option::is_none"
151    )]
152    pub verification_key: Option<Option<serde_json::Value>>,
153    #[serde(
154        rename = "warnings",
155        default,
156        with = "::serde_with::rust::double_option",
157        skip_serializing_if = "Option::is_none"
158    )]
159    pub warnings: Option<Option<Vec<String>>>,
160    #[serde(
161        rename = "error",
162        default,
163        with = "::serde_with::rust::double_option",
164        skip_serializing_if = "Option::is_none"
165    )]
166    pub error: Option<Option<String>>,
167}
168
169impl ProofInfoResponse {
170    /// Response for getting proof info.
171    pub fn new(
172        proof_id: String,
173        circuit_name: String,
174        project_name: String,
175        circuit_id: String,
176        circuit_type: models::CircuitType,
177        date_created: String,
178        meta: std::collections::HashMap<String, String>,
179        perform_verify: bool,
180        status: models::JobStatus,
181        finished_processing: bool,
182        verified: Option<bool>,
183        team: String,
184        team_avatar_url: String,
185        team_name: String,
186        team_slug: String,
187        circuit_team: String,
188        circuit_team_avatar_url: String,
189        circuit_team_slug: String,
190    ) -> ProofInfoResponse {
191        ProofInfoResponse {
192            proof_id,
193            circuit_name,
194            project_name,
195            circuit_id,
196            circuit_type,
197            date_created,
198            meta,
199            perform_verify,
200            status,
201            finished_processing,
202            verified,
203            team,
204            team_avatar_url,
205            team_name,
206            team_slug,
207            circuit_team,
208            circuit_team_avatar_url,
209            circuit_team_slug,
210            compute_time: None,
211            compute_time_sec: None,
212            compute_times: None,
213            file_size: None,
214            proof: None,
215            public: None,
216            queue_time: None,
217            queue_time_sec: None,
218            smart_contract_calldata: None,
219            has_smart_contract_calldata: None,
220            has_verification_key: None,
221            verification_key: None,
222            warnings: None,
223            error: None,
224        }
225    }
226}