Skip to main content

backstage_client/entities/
component.rs

1use crate::entities::common::{Metadata, Relation};
2use serde::{Deserialize, Serialize};
3
4#[derive(Debug, Serialize, Deserialize)]
5#[serde(rename_all = "camelCase")]
6pub struct Component {
7    pub api_version: String,
8    pub metadata: Metadata,
9    pub spec: ComponentSpec,
10    pub relations: Option<Vec<Relation>>, // Use Option if relations can be missing
11}
12
13#[derive(Debug, Serialize, Deserialize)]
14pub struct ComponentSpec {
15    pub r#type: String,
16    pub owner: String,
17    pub lifecycle: String,
18    pub domain: Option<String>, // Use Option if domain can be missing
19    pub system: Option<String>, // Use Option if system can be missing
20    pub consumes_apis: Option<Vec<String>>, // Use Option if consumes_apis can be missing
21}