Skip to main content

openapi_nexus_go/templating/data/
operations_data.rs

1//! Operations data for template rendering
2
3use serde::{Deserialize, Serialize};
4
5use crate::templating::data::CommonFileHeaderData;
6
7/// Response type information for operations
8#[derive(Debug, Clone, Serialize, Deserialize)]
9pub struct OperationResponse {
10    pub name: String,
11    pub operation_name: String,
12    pub body_type: Option<String>,
13}
14
15/// Operations data for template rendering
16#[derive(Debug, Clone, Serialize, Deserialize)]
17pub struct OperationsData {
18    pub responses: Vec<OperationResponse>,
19    pub common_file_header: CommonFileHeaderData,
20    pub module_path: String,
21}
22
23impl OperationsData {
24    pub fn new(
25        responses: Vec<OperationResponse>,
26        common_file_header: CommonFileHeaderData,
27        module_path: String,
28    ) -> Self {
29        Self {
30            responses,
31            common_file_header,
32            module_path,
33        }
34    }
35}