UNPKG

wallee

Version:
47 lines (46 loc) 1.89 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.instanceOfPermission = instanceOfPermission; exports.PermissionFromJSON = PermissionFromJSON; exports.PermissionFromJSONTyped = PermissionFromJSONTyped; exports.PermissionToJSON = PermissionToJSON; exports.PermissionToJSONTyped = PermissionToJSONTyped; const Feature_1 = require("./Feature"); /** * Check if a given object implements the Permission interface. */ function instanceOfPermission(value) { return true; } function PermissionFromJSON(json) { return PermissionFromJSONTyped(json, false); } function PermissionFromJSONTyped(json, ignoreDiscriminator) { if (json == null) { return json; } return { 'parent': json['parent'] == null ? undefined : json['parent'], 'feature': json['feature'] == null ? undefined : (0, Feature_1.FeatureFromJSON)(json['feature']), 'name': json['name'] == null ? undefined : json['name'], 'pathToRoot': json['pathToRoot'] == null ? undefined : json['pathToRoot'], 'webAppEnabled': json['webAppEnabled'] == null ? undefined : json['webAppEnabled'], 'description': json['description'] == null ? undefined : json['description'], 'id': json['id'] == null ? undefined : json['id'], 'leaf': json['leaf'] == null ? undefined : json['leaf'], 'title': json['title'] == null ? undefined : json['title'], 'group': json['group'] == null ? undefined : json['group'], 'twoFactorRequired': json['twoFactorRequired'] == null ? undefined : json['twoFactorRequired'], }; } function PermissionToJSON(json) { return PermissionToJSONTyped(json, false); } function PermissionToJSONTyped(value, ignoreDiscriminator = false) { if (value == null) { return value; } return { 'feature': (0, Feature_1.FeatureToJSON)(value['feature']), }; }