add fromJSON method (#13573)

This commit is contained in:
William Cheng
2022-10-03 21:57:03 +08:00
committed by GitHub
parent 922f9783fd
commit c30ae752a0
8 changed files with 74 additions and 0 deletions

View File

@@ -145,6 +145,14 @@ class Color {
return this.getActualInstance();
}
/**
* Create an instance of Color from a JSON string.
* @param {string} json_string JSON string.
* @return {module:model/Color} An instance of Color.
*/
static fromJSON = function(json_string){
return Color.constructFromObject(JSON.parse(json_string));
}
}

View File

@@ -99,6 +99,14 @@ class Pig {
return this.getActualInstance();
}
/**
* Create an instance of Pig from a JSON string.
* @param {string} json_string JSON string.
* @return {module:model/Pig} An instance of Pig.
*/
static fromJSON = function(json_string){
return Pig.constructFromObject(JSON.parse(json_string));
}
}
/**