UNPKG

wallee

Version:
54 lines (53 loc) 2.89 kB
import { AccountFromJSON, AccountToJSON, } from './Account'; import { SpaceAddressFromJSON, SpaceAddressToJSON, } from './SpaceAddress'; import { CreationEntityStateFromJSON, CreationEntityStateToJSON, } from './CreationEntityState'; import { TenantDatabaseFromJSON, TenantDatabaseToJSON, } from './TenantDatabase'; /** * Check if a given object implements the Space interface. */ export function instanceOfSpace(value) { return true; } export function SpaceFromJSON(json) { return SpaceFromJSONTyped(json, false); } export function SpaceFromJSONTyped(json, ignoreDiscriminator) { if (json == null) { return json; } return { 'activeOrRestrictedActive': json['activeOrRestrictedActive'] == null ? undefined : json['activeOrRestrictedActive'], 'deletedOn': json['deletedOn'] == null ? undefined : (new Date(json['deletedOn'])), 'plannedPurgeDate': json['plannedPurgeDate'] == null ? undefined : (new Date(json['plannedPurgeDate'])), 'active': json['active'] == null ? undefined : json['active'], 'timeZone': json['timeZone'] == null ? undefined : json['timeZone'], 'createdOn': json['createdOn'] == null ? undefined : (new Date(json['createdOn'])), 'primaryCurrency': json['primaryCurrency'] == null ? undefined : json['primaryCurrency'], 'version': json['version'] == null ? undefined : json['version'], 'deletedBy': json['deletedBy'] == null ? undefined : json['deletedBy'], 'requestLimit': json['requestLimit'] == null ? undefined : json['requestLimit'], 'database': json['database'] == null ? undefined : TenantDatabaseFromJSON(json['database']), 'postalAddress': json['postalAddress'] == null ? undefined : SpaceAddressFromJSON(json['postalAddress']), 'restrictedActive': json['restrictedActive'] == null ? undefined : json['restrictedActive'], 'createdBy': json['createdBy'] == null ? undefined : json['createdBy'], 'name': json['name'] == null ? undefined : json['name'], 'technicalContactAddresses': json['technicalContactAddresses'] == null ? undefined : new Set(json['technicalContactAddresses']), 'id': json['id'] == null ? undefined : json['id'], 'state': json['state'] == null ? undefined : CreationEntityStateFromJSON(json['state']), 'account': json['account'] == null ? undefined : AccountFromJSON(json['account']), }; } export function SpaceToJSON(json) { return SpaceToJSONTyped(json, false); } export function SpaceToJSONTyped(value, ignoreDiscriminator = false) { if (value == null) { return value; } return { 'database': TenantDatabaseToJSON(value['database']), 'postalAddress': SpaceAddressToJSON(value['postalAddress']), 'state': CreationEntityStateToJSON(value['state']), 'account': AccountToJSON(value['account']), }; }