use serde::{Deserialize, Serialize};
#[derive(Debug, Clone, Serialize)]
pub struct AzdoConnectionInfo {
pub status: String,
pub phase: u32,
pub organization_url: String,
pub message: String,
pub user_id: Option<String>,
pub user_name: Option<String>,
pub instance_id: Option<String>,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct AzdoWorkItem {
pub id: u32,
pub title: String,
pub state: String,
pub work_item_type: String,
pub tags: Vec<String>,
pub team_project: String,
pub url: Option<String>,
#[serde(default)]
pub iteration_path: Option<String>,
#[serde(default)]
pub area_path: Option<String>,
}
pub type WorkItem = AzdoWorkItem;
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct AzdoWorkItemType {
pub name: String,
pub reference_name: String,
pub description: String,
pub color: String,
pub icon: String,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct AzdoField {
pub name: String,
pub reference_name: String,
pub field_type: String,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct WorkItemRef {
pub id: u32,
pub url: String,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct WiqlResult {
pub query_type: String,
pub work_items: Vec<WorkItemRef>,
}
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq)]
pub struct AzdoIteration {
pub id: String,
pub name: String,
pub path: String,
pub start_date: Option<String>,
pub finish_date: Option<String>,
pub time_frame: String,
}
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq)]
pub struct AzdoUser {
pub descriptor: String,
pub display_name: String,
pub mail_address: Option<String>,
pub principal_name: Option<String>,
}
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq)]
pub struct AzdoComment {
pub id: u32,
pub text: String,
pub created_by: String,
pub created_date: String,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct AzdoWorkItemExtended {
pub id: u32,
pub title: String,
pub state: String,
pub work_item_type: String,
pub iteration_path: Option<String>,
pub area_path: Option<String>,
pub tags: Vec<String>,
pub custom_fields: std::collections::HashMap<String, serde_json::Value>,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct AzdoProject {
pub id: String,
pub name: String,
pub state: String,
pub visibility: String,
}