use crate::models;
use serde::{Deserialize, Serialize};
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, bon::Builder)]
pub struct ProjectServiceAccountListResponse {
#[serde(rename = "object")]
pub object: Object,
#[serde(rename = "data")]
pub data: Vec<models::ProjectServiceAccount>,
#[serde(rename = "first_id")]
pub first_id: String,
#[serde(rename = "last_id")]
pub last_id: String,
#[serde(rename = "has_more")]
pub has_more: bool,
}
impl ProjectServiceAccountListResponse {
pub fn new(
object: Object,
data: Vec<models::ProjectServiceAccount>,
first_id: String,
last_id: String,
has_more: bool,
) -> ProjectServiceAccountListResponse {
ProjectServiceAccountListResponse {
object,
data,
first_id,
last_id,
has_more,
}
}
}
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Object {
#[serde(rename = "list")]
List,
}
impl Default for Object {
fn default() -> Object {
Self::List
}
}
impl std::fmt::Display for ProjectServiceAccountListResponse {
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),
}
}
}