wallee
Version:
TypeScript/JavaScript client for wallee
47 lines (46 loc) • 2.11 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.instanceOfLabelDescriptor = instanceOfLabelDescriptor;
exports.LabelDescriptorFromJSON = LabelDescriptorFromJSON;
exports.LabelDescriptorFromJSONTyped = LabelDescriptorFromJSONTyped;
exports.LabelDescriptorToJSON = LabelDescriptorToJSON;
exports.LabelDescriptorToJSONTyped = LabelDescriptorToJSONTyped;
const Feature_1 = require("./Feature");
const LabelDescriptorCategory_1 = require("./LabelDescriptorCategory");
const LabelDescriptorGroup_1 = require("./LabelDescriptorGroup");
/**
* Check if a given object implements the LabelDescriptor interface.
*/
function instanceOfLabelDescriptor(value) {
return true;
}
function LabelDescriptorFromJSON(json) {
return LabelDescriptorFromJSONTyped(json, false);
}
function LabelDescriptorFromJSONTyped(json, ignoreDiscriminator) {
if (json == null) {
return json;
}
return {
'features': json['features'] == null ? undefined : (new Set(json['features'].map(Feature_1.FeatureFromJSON))),
'name': json['name'] == null ? undefined : json['name'],
'description': json['description'] == null ? undefined : json['description'],
'weight': json['weight'] == null ? undefined : json['weight'],
'id': json['id'] == null ? undefined : json['id'],
'category': json['category'] == null ? undefined : (0, LabelDescriptorCategory_1.LabelDescriptorCategoryFromJSON)(json['category']),
'type': json['type'] == null ? undefined : json['type'],
'group': json['group'] == null ? undefined : (0, LabelDescriptorGroup_1.LabelDescriptorGroupFromJSON)(json['group']),
};
}
function LabelDescriptorToJSON(json) {
return LabelDescriptorToJSONTyped(json, false);
}
function LabelDescriptorToJSONTyped(value, ignoreDiscriminator = false) {
if (value == null) {
return value;
}
return {
'category': (0, LabelDescriptorCategory_1.LabelDescriptorCategoryToJSON)(value['category']),
'group': (0, LabelDescriptorGroup_1.LabelDescriptorGroupToJSON)(value['group']),
};
}