use crate::models;
use serde::{Deserialize, Serialize};
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct MainArgSignature {
#[serde(rename = "type")]
pub r#type: Type,
#[serde(rename = "error")]
pub error: String,
#[serde(rename = "star_args")]
pub star_args: bool,
#[serde(rename = "star_kwargs", skip_serializing_if = "Option::is_none")]
pub star_kwargs: Option<bool>,
#[serde(rename = "args")]
pub args: Vec<models::MainArgSignatureArgsInner>,
#[serde(rename = "auto_kind", deserialize_with = "Option::deserialize")]
pub auto_kind: Option<String>,
#[serde(rename = "has_preprocessor", deserialize_with = "Option::deserialize")]
pub has_preprocessor: Option<bool>,
}
impl MainArgSignature {
pub fn new(r#type: Type, error: String, star_args: bool, args: Vec<models::MainArgSignatureArgsInner>, auto_kind: Option<String>, has_preprocessor: Option<bool>) -> MainArgSignature {
MainArgSignature {
r#type,
error,
star_args,
star_kwargs: None,
args,
auto_kind,
has_preprocessor,
}
}
}
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Type {
#[serde(rename = "Valid")]
Valid,
#[serde(rename = "Invalid")]
Invalid,
}
impl Default for Type {
fn default() -> Type {
Self::Valid
}
}