backstage_client/entities/
template.rs

1use crate::entities::common::Metadata;
2use serde::{Deserialize, Serialize};
3use std::collections::HashMap;
4
5#[derive(Debug, Serialize, Deserialize)]
6pub struct TemplateEntity {
7    pub api_version: Option<String>,
8    pub metadata: Metadata,
9    pub spec: TemplateSpec,
10    pub relations: Option<Vec<crate::entities::common::Relation>>,
11}
12
13#[derive(Debug, Serialize, Deserialize)]
14pub struct TemplateSpec {
15    pub owner: String,
16    pub r#type: String,
17    pub parameters: Vec<Parameter>,
18    pub steps: Vec<Step>,
19}
20
21#[derive(Debug, Serialize, Deserialize)]
22pub struct Parameter {
23    pub title: String,
24    pub required: Vec<String>,
25    pub properties: HashMap<String, Property>,
26}
27
28#[derive(Debug, Serialize, Deserialize)]
29pub struct Property {
30    pub title: String,
31    pub r#type: String,
32    pub description: Option<String>,
33    pub ui_autofocus: Option<bool>,
34    pub ui_options: Option<HashMap<String, serde_json::Value>>,
35}
36
37#[derive(Debug, Serialize, Deserialize)]
38pub struct Step {
39    pub id: String,
40    pub name: String,
41    pub action: String,
42    pub input: HashMap<String, serde_json::Value>,
43}