feat: add serde + clone + debug + more datatypes
This commit is contained in:
parent
e613464413
commit
d7a87e8609
@ -5,10 +5,13 @@ use validation::Validation;
|
||||
|
||||
mod validation;
|
||||
|
||||
#[derive(Deserialize, Serialize)]
|
||||
#[derive(Deserialize, Serialize, Clone, Debug)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct Parameter {
|
||||
name: Arc<str>,
|
||||
#[serde(rename = "type")]
|
||||
data_type: DataType,
|
||||
#[serde(skip)]
|
||||
is_array: bool,
|
||||
aliases: Vec<Arc<str>>,
|
||||
description: Option<Arc<str>>,
|
||||
@ -17,7 +20,7 @@ pub struct Parameter {
|
||||
validations: Vec<Validation>,
|
||||
}
|
||||
|
||||
#[derive(Deserialize, Serialize)]
|
||||
#[derive(Deserialize, Serialize, Clone, PartialEq, Eq, Default, Debug)]
|
||||
pub struct ParameterSet {
|
||||
name: Arc<str>,
|
||||
mandatory: bool,
|
||||
@ -26,13 +29,19 @@ pub struct ParameterSet {
|
||||
value_from_pipeline_by_property_name: Option<bool>,
|
||||
}
|
||||
|
||||
#[derive(Deserialize, Serialize)]
|
||||
#[derive(Deserialize, Serialize, Clone, Debug)]
|
||||
pub enum DataType {
|
||||
DateTime,
|
||||
//TODO: Make this Variant obsolete by implementing De-/Serialize on the using Structs
|
||||
#[serde(rename = "String[]")]
|
||||
StringArray,
|
||||
String,
|
||||
Int32,
|
||||
Int64,
|
||||
#[serde(rename = "SwitchParameter")]
|
||||
Switch,
|
||||
Bool,
|
||||
Boolean,
|
||||
#[serde(rename = "PSCredential")]
|
||||
Credential,
|
||||
SecureString,
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user