use crate::models;
use serde::{Deserialize, Serialize};
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct RuleResponse {
#[serde(rename = "action")]
pub action: String,
#[serde(rename = "architecture")]
pub architecture: String,
#[serde(rename = "created_at")]
pub created_at: String,
#[serde(rename = "created_by", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
pub created_by: Option<Option<uuid::Uuid>>,
#[serde(rename = "enabled")]
pub enabled: bool,
#[serde(rename = "id")]
pub id: uuid::Uuid,
#[serde(rename = "package_pattern")]
pub package_pattern: String,
#[serde(rename = "priority")]
pub priority: i32,
#[serde(rename = "reason")]
pub reason: String,
#[serde(rename = "staging_repo_id", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
pub staging_repo_id: Option<Option<uuid::Uuid>>,
#[serde(rename = "updated_at")]
pub updated_at: String,
#[serde(rename = "version_constraint")]
pub version_constraint: String,
}
impl RuleResponse {
pub fn new(action: String, architecture: String, created_at: String, enabled: bool, id: uuid::Uuid, package_pattern: String, priority: i32, reason: String, updated_at: String, version_constraint: String) -> RuleResponse {
RuleResponse {
action,
architecture,
created_at,
created_by: None,
enabled,
id,
package_pattern,
priority,
reason,
staging_repo_id: None,
updated_at,
version_constraint,
}
}
}