use crate::models;
use serde::{Deserialize, Serialize};
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize, bon::Builder)]
pub struct ProjectUserListResponse {
#[serde(rename = "object")]
pub object: String,
#[serde(rename = "data")]
pub data: Vec<models::ProjectUser>,
#[serde(
rename = "first_id",
default,
with = "::serde_with::rust::double_option",
skip_serializing_if = "Option::is_none"
)]
pub first_id: Option<Option<String>>,
#[serde(
rename = "last_id",
default,
with = "::serde_with::rust::double_option",
skip_serializing_if = "Option::is_none"
)]
pub last_id: Option<Option<String>>,
#[serde(rename = "has_more")]
pub has_more: bool,
}
impl ProjectUserListResponse {
pub fn new(
object: String,
data: Vec<models::ProjectUser>,
has_more: bool,
) -> ProjectUserListResponse {
ProjectUserListResponse {
object,
data,
first_id: None,
last_id: None,
has_more,
}
}
}
impl std::fmt::Display for ProjectUserListResponse {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match serde_json::to_string(self) {
Ok(s) => write!(f, "{}", s),
Err(_) => Err(std::fmt::Error),
}
}
}