use crate::AttributeValue;
use std::collections::HashMap;
#[derive(Debug)]
pub struct Operation {
name: Option<String>,
op_type: String,
inputs: Vec<String>,
outputs: Vec<String>,
attributes: HashMap<String, AttributeValue>,
}
impl Operation {
pub(crate) fn new(
name: Option<String>,
op_type: String,
inputs: Vec<String>,
outputs: Vec<String>,
attributes: HashMap<String, AttributeValue>,
) -> Self {
Operation {
name,
op_type,
inputs,
outputs,
attributes,
}
}
pub fn name(&self) -> Option<&str> {
self.name.as_deref()
}
pub fn op_type(&self) -> &str {
&self.op_type
}
pub fn inputs(&self) -> &[String] {
&self.inputs
}
pub fn outputs(&self) -> &[String] {
&self.outputs
}
pub fn attributes(&self) -> &HashMap<String, AttributeValue> {
&self.attributes
}
pub fn attributes_mut(&mut self) -> &mut HashMap<String, AttributeValue> {
&mut self.attributes
}
}