UNPKG

wallee

Version:
47 lines (46 loc) 1.83 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.instanceOfRole = instanceOfRole; exports.RoleFromJSON = RoleFromJSON; exports.RoleFromJSONTyped = RoleFromJSONTyped; exports.RoleToJSON = RoleToJSON; exports.RoleToJSONTyped = RoleToJSONTyped; const Account_1 = require("./Account"); const Permission_1 = require("./Permission"); const RoleState_1 = require("./RoleState"); /** * Check if a given object implements the Role interface. */ function instanceOfRole(value) { return true; } function RoleFromJSON(json) { return RoleFromJSONTyped(json, false); } function RoleFromJSONTyped(json, ignoreDiscriminator) { if (json == null) { return json; } return { 'permissions': json['permissions'] == null ? undefined : (new Set(json['permissions'].map(Permission_1.PermissionFromJSON))), 'name': json['name'] == null ? undefined : json['name'], 'plannedPurgeDate': json['plannedPurgeDate'] == null ? undefined : (new Date(json['plannedPurgeDate'])), 'id': json['id'] == null ? undefined : json['id'], 'state': json['state'] == null ? undefined : (0, RoleState_1.RoleStateFromJSON)(json['state']), 'version': json['version'] == null ? undefined : json['version'], 'account': json['account'] == null ? undefined : (0, Account_1.AccountFromJSON)(json['account']), 'twoFactorRequired': json['twoFactorRequired'] == null ? undefined : json['twoFactorRequired'], }; } function RoleToJSON(json) { return RoleToJSONTyped(json, false); } function RoleToJSONTyped(value, ignoreDiscriminator = false) { if (value == null) { return value; } return { 'state': (0, RoleState_1.RoleStateToJSON)(value['state']), 'account': (0, Account_1.AccountToJSON)(value['account']), }; }