/*
* Sindri Labs API
*
* ## 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.17
*
* The version of the OpenAPI document: v1.17.28
*
* Generated by: https://openapi-generator.tech
*/
use crate::models;
use serde::{Deserialize, Serialize};
/// GnarkCircuitInfoResponse : Response for getting Gnark circuit info.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct GnarkCircuitInfoResponse {
/// A unique identifier generated for the circuit. UUID4 format.
#[serde(rename = "circuit_id")]
pub circuit_id: String,
#[serde(rename = "circuit_name")]
pub circuit_name: String,
/// The name of the project. This can be used in place of circuit_id for proving. This is specified during creation in the included sindri.json file. If the project is renamed, this will be the new name of the project, not the original name that was included in the sindri.json file.
#[serde(rename = "project_name")]
pub project_name: String,
/// The development framework used to write the circuit. This is specified during creation in the included sindri.json file.
#[serde(rename = "circuit_type")]
pub circuit_type: CircuitType,
/// The UTC datetime the circuit was uploaded in ISO8601 format.
#[serde(rename = "date_created")]
pub date_created: String,
#[serde(rename = "homepage", deserialize_with = "Option::deserialize")]
pub homepage: Option<String>,
/// Metadata keys and values for the circuit that were specified at creation time.
#[serde(rename = "meta")]
pub meta: std::collections::HashMap<String, String>,
#[serde(rename = "num_proofs", deserialize_with = "Option::deserialize")]
pub num_proofs: Option<i64>,
/// The proving scheme for this circuit. This is specified during creation in the included sindri.json file.
#[serde(rename = "proving_scheme")]
pub proving_scheme: String,
/// Whether the circuit is public. Public circuits can be used by any user.
#[serde(rename = "public")]
pub public: bool,
#[serde(rename = "repository", deserialize_with = "Option::deserialize")]
pub repository: Option<String>,
/// The status of the circuit job.
#[serde(rename = "status")]
pub status: models::JobStatus,
/// The job is finished processing and waiting/polling can be terminated.
#[serde(rename = "finished_processing")]
pub finished_processing: bool,
/// Tags for the circuit.
#[serde(rename = "tags")]
pub tags: Vec<String>,
/// The name of the team that owns this circuit.
#[serde(rename = "team")]
pub team: String,
/// URL for the avatar image of the team that owns this circuit.
#[serde(rename = "team_avatar_url")]
pub team_avatar_url: String,
/// The name of the team that owns this circuit.
#[serde(rename = "team_name")]
pub team_name: String,
/// The slug of the team that owns this circuit.
#[serde(rename = "team_slug")]
pub team_slug: String,
#[serde(rename = "compute_time", deserialize_with = "Option::deserialize")]
pub compute_time: Option<String>,
#[serde(rename = "compute_time_sec", deserialize_with = "Option::deserialize")]
pub compute_time_sec: Option<f64>,
/// Detailed compute times for the circuit compilation.
#[serde(rename = "compute_times", deserialize_with = "Option::deserialize")]
pub compute_times: Option<Box<models::AnyOfLessThanGreaterThan>>,
#[serde(rename = "file_size", deserialize_with = "Option::deserialize")]
pub file_size: Option<i64>,
#[serde(rename = "queue_time", deserialize_with = "Option::deserialize")]
pub queue_time: Option<String>,
#[serde(rename = "queue_time_sec", deserialize_with = "Option::deserialize")]
pub queue_time_sec: Option<f64>,
/// The name of the uploaded circuit file. Note: the CLI and SDKs create a generic name when a directory is specified for upload.
#[serde(rename = "uploaded_file_name")]
pub uploaded_file_name: String,
/// Boolean indicating whether this circuit has a smart contract verifier available.
#[serde(rename = "has_smart_contract_verifier")]
pub has_smart_contract_verifier: bool,
/// Boolean indicating whether this circuit has a verification key available.
#[serde(rename = "has_verification_key")]
pub has_verification_key: bool,
#[serde(rename = "verification_key", deserialize_with = "Option::deserialize")]
pub verification_key: Option<serde_json::Value>,
#[serde(rename = "warnings", deserialize_with = "Option::deserialize")]
pub warnings: Option<Vec<String>>,
#[serde(rename = "error", deserialize_with = "Option::deserialize")]
pub error: Option<String>,
/// The elliptic curve over which the proving protocol takes place.
#[serde(rename = "curve")]
pub curve: String,
/// The Gnark frontend version tag.
#[serde(rename = "gnark_version")]
pub gnark_version: String,
}
impl GnarkCircuitInfoResponse {
/// Response for getting Gnark circuit info.
pub fn new(
circuit_id: String,
circuit_name: String,
project_name: String,
circuit_type: CircuitType,
date_created: String,
homepage: Option<String>,
meta: std::collections::HashMap<String, String>,
num_proofs: Option<i64>,
proving_scheme: String,
public: bool,
repository: Option<String>,
status: models::JobStatus,
finished_processing: bool,
tags: Vec<String>,
team: String,
team_avatar_url: String,
team_name: String,
team_slug: String,
compute_time: Option<String>,
compute_time_sec: Option<f64>,
compute_times: Option<models::AnyOfLessThanGreaterThan>,
file_size: Option<i64>,
queue_time: Option<String>,
queue_time_sec: Option<f64>,
uploaded_file_name: String,
has_smart_contract_verifier: bool,
has_verification_key: bool,
verification_key: Option<serde_json::Value>,
warnings: Option<Vec<String>>,
error: Option<String>,
curve: String,
gnark_version: String,
) -> GnarkCircuitInfoResponse {
GnarkCircuitInfoResponse {
circuit_id,
circuit_name,
project_name,
circuit_type,
date_created,
homepage,
meta,
num_proofs,
proving_scheme,
public,
repository,
status,
finished_processing,
tags,
team,
team_avatar_url,
team_name,
team_slug,
compute_time,
compute_time_sec,
compute_times: if let Some(x) = compute_times {
Some(Box::new(x))
} else {
None
},
file_size,
queue_time,
queue_time_sec,
uploaded_file_name,
has_smart_contract_verifier,
has_verification_key,
verification_key,
warnings,
error,
curve,
gnark_version,
}
}
}
/// The development framework used to write the circuit. This is specified during creation in the included sindri.json file.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum CircuitType {
#[serde(rename = "gnark")]
Gnark,
}
impl Default for CircuitType {
fn default() -> CircuitType {
Self::Gnark
}
}