use serde::{Deserialize, Serialize};
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct GradleDeprecations {
pub deprecations: Option<Vec<GradleDeprecationEntry>>,
}
#[derive(Debug, Clone, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct GradleDeprecationEntry {
pub summary: String,
pub removal_details: String,
pub advice: Option<String>,
pub documentation_url: Option<String>,
pub usages: Vec<GradleDeprecationUsage>,
}
#[derive(Debug, Clone, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct GradleDeprecationUsage {
pub contextual_advice: Option<String>,
pub owner: GradleDeprecationOwner,
}
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct GradleDeprecationOwner {
pub location: Option<String>,
#[serde(rename = "type")]
pub owner_type: DeprecationOwnerType,
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, Deserialize, Serialize)]
#[serde(rename_all = "lowercase")]
pub enum DeprecationOwnerType {
Plugin,
Script,
Task,
Unknown,
}
impl std::fmt::Display for DeprecationOwnerType {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match self {
DeprecationOwnerType::Plugin => write!(f, "plugin"),
DeprecationOwnerType::Script => write!(f, "script"),
DeprecationOwnerType::Task => write!(f, "task"),
DeprecationOwnerType::Unknown => write!(f, "unknown"),
}
}
}