use crate::models;
use serde::{Deserialize, Serialize};
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize, bon::Builder)]
pub struct EnvironmentResourceSelfHosted {
#[serde(rename = "type")]
pub r#type: Type,
#[serde(rename = "remote_url")]
pub remote_url: String,
#[serde(rename = "id")]
pub id: String,
#[serde(rename = "workspace_directory")]
pub workspace_directory: String,
#[serde(rename = "capability_directories")]
pub capability_directories: Vec<String>,
}
impl EnvironmentResourceSelfHosted {
pub fn new(
r#type: Type,
remote_url: String,
id: String,
workspace_directory: String,
capability_directories: Vec<String>,
) -> EnvironmentResourceSelfHosted {
EnvironmentResourceSelfHosted {
r#type,
remote_url,
id,
workspace_directory,
capability_directories,
}
}
}
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Type {
#[serde(rename = "self_hosted")]
SelfHosted,
}
impl Default for Type {
fn default() -> Type {
Self::SelfHosted
}
}
impl std::fmt::Display for EnvironmentResourceSelfHosted {
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),
}
}
}