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