wallee
Version:
TypeScript/JavaScript client for wallee
40 lines (39 loc) • 1.58 kB
JavaScript
import { FeatureFromJSON, FeatureToJSON, } from './Feature';
/**
* Check if a given object implements the Permission interface.
*/
export function instanceOfPermission(value) {
return true;
}
export function PermissionFromJSON(json) {
return PermissionFromJSONTyped(json, false);
}
export function PermissionFromJSONTyped(json, ignoreDiscriminator) {
if (json == null) {
return json;
}
return {
'parent': json['parent'] == null ? undefined : json['parent'],
'feature': json['feature'] == null ? undefined : 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'],
};
}
export function PermissionToJSON(json) {
return PermissionToJSONTyped(json, false);
}
export function PermissionToJSONTyped(value, ignoreDiscriminator = false) {
if (value == null) {
return value;
}
return {
'feature': FeatureToJSON(value['feature']),
};
}