UNPKG

@simplyhomes/sos-sdk

Version:

TypeScript SDK for Simply Homes SoS API v4

81 lines (80 loc) 3.02 kB
/* tslint:disable */ /* eslint-disable */ /** * API v4 * Swagger documentation for API v4 * * The version of the OpenAPI document: 4.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ import { SoSNotificationEntityBaseMetadataFromJSON, SoSNotificationEntityBaseMetadataToJSON, } from './SoSNotificationEntityBaseMetadata'; import { SoSNotificationEntityTypeFromJSON, SoSNotificationEntityTypeToJSON, } from './SoSNotificationEntityType'; /** * Check if a given object implements the SoSNotificationEntityBase interface. */ export function instanceOfSoSNotificationEntityBase(value) { if (!('nid' in value) || value['nid'] === undefined) return false; if (!('userId' in value) || value['userId'] === undefined) return false; if (!('organizationId' in value) || value['organizationId'] === undefined) return false; if (!('type' in value) || value['type'] === undefined) return false; if (!('title' in value) || value['title'] === undefined) return false; if (!('body' in value) || value['body'] === undefined) return false; if (!('read' in value) || value['read'] === undefined) return false; if (!('starred' in value) || value['starred'] === undefined) return false; if (!('createdAt' in value) || value['createdAt'] === undefined) return false; return true; } export function SoSNotificationEntityBaseFromJSON(json) { return SoSNotificationEntityBaseFromJSONTyped(json, false); } export function SoSNotificationEntityBaseFromJSONTyped(json, ignoreDiscriminator) { if (json == null) { return json; } return { ...json, // Preserve relation fields from views 'nid': json['nid'], 'userId': json['userId'], 'organizationId': json['organizationId'], 'type': SoSNotificationEntityTypeFromJSON(json['type']), 'title': json['title'], 'body': json['body'], 'metadata': json['metadata'] == null ? undefined : SoSNotificationEntityBaseMetadataFromJSON(json['metadata']), 'read': json['read'], 'starred': json['starred'], 'createdAt': json['createdAt'], }; } export function SoSNotificationEntityBaseToJSON(json) { return SoSNotificationEntityBaseToJSONTyped(json, false); } export function SoSNotificationEntityBaseToJSONTyped(value, ignoreDiscriminator = false) { if (value == null) { return value; } return { 'nid': value['nid'], 'userId': value['userId'], 'organizationId': value['organizationId'], 'type': SoSNotificationEntityTypeToJSON(value['type']), 'title': value['title'], 'body': value['body'], 'metadata': SoSNotificationEntityBaseMetadataToJSON(value['metadata']), 'read': value['read'], 'starred': value['starred'], 'createdAt': value['createdAt'], }; }