use super::*;
pub struct InputDataModelDefinitionBuilder {
input: InputDataModelDefinition,
}
impl InputDataModelDefinitionBuilder {
pub fn new() -> Self {
Self {
input: InputDataModelDefinition::default(),
}
}
pub fn from(&mut self, value: Value) -> &mut Self {
self.input.from = Some(value);
self
}
pub fn build(self) -> InputDataModelDefinition {
self.input
}
}
impl Default for InputDataModelDefinitionBuilder {
fn default() -> Self {
Self::new()
}
}
pub struct OutputDataModelDefinitionBuilder {
output: OutputDataModelDefinition,
}
impl OutputDataModelDefinitionBuilder {
pub fn new() -> Self {
Self {
output: OutputDataModelDefinition::default(),
}
}
pub fn r#as(&mut self, value: Value) -> &mut Self {
self.output.as_ = Some(value);
self
}
pub fn build(self) -> OutputDataModelDefinition {
self.output
}
}
impl Default for OutputDataModelDefinitionBuilder {
fn default() -> Self {
Self::new()
}
}
pub struct EventDefinitionBuilder {
event: EventDefinition,
}
impl EventDefinitionBuilder {
pub fn new() -> Self {
Self {
event: EventDefinition::default(),
}
}
pub fn with(&mut self, name: &str, value: Value) -> &mut Self {
self.event.with.insert(name.to_string(), value);
self
}
pub fn with_attributes(&mut self, attrs: HashMap<String, Value>) -> &mut Self {
self.event.with = attrs;
self
}
pub fn build(self) -> EventDefinition {
self.event
}
}
impl Default for EventDefinitionBuilder {
fn default() -> Self {
Self::new()
}
}