use crate::models;
use serde::{Deserialize, Serialize};
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct EmailSubscriptionResponse {
#[serde(rename = "created_at")]
pub created_at: String,
#[serde(rename = "enabled")]
pub enabled: bool,
#[serde(rename = "event_types")]
pub event_types: Vec<String>,
#[serde(rename = "id")]
pub id: uuid::Uuid,
#[serde(rename = "recipients")]
pub recipients: Vec<String>,
#[serde(rename = "repository_id", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
pub repository_id: Option<Option<uuid::Uuid>>,
#[serde(rename = "updated_at")]
pub updated_at: String,
}
impl EmailSubscriptionResponse {
pub fn new(created_at: String, enabled: bool, event_types: Vec<String>, id: uuid::Uuid, recipients: Vec<String>, updated_at: String) -> EmailSubscriptionResponse {
EmailSubscriptionResponse {
created_at,
enabled,
event_types,
id,
recipients,
repository_id: None,
updated_at,
}
}
}