use crate::models;
use serde::{Deserialize, Serialize};
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, bon::Builder)]
pub struct UpdateProjectServiceAccountBody {
#[serde(rename = "name", skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
#[serde(rename = "role", skip_serializing_if = "Option::is_none")]
pub role: Option<Role>,
}
impl UpdateProjectServiceAccountBody {
pub fn new() -> UpdateProjectServiceAccountBody {
UpdateProjectServiceAccountBody {
name: None,
role: None,
}
}
}
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Role {
#[serde(rename = "member")]
Member,
#[serde(rename = "owner")]
Owner,
}
impl Default for Role {
fn default() -> Role {
Self::Member
}
}
impl std::fmt::Display for UpdateProjectServiceAccountBody {
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),
}
}
}