@simplyhomes/sos-sdk
Version:
TypeScript SDK for Simply Homes SoS API v4
66 lines (65 loc) • 2.27 kB
JavaScript
/* 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 { MessageNotificationEntityTypeFromJSON, MessageNotificationEntityTypeToJSON, } from './MessageNotificationEntityType';
/**
* Check if a given object implements the SoSMessageNotificationEntityBase interface.
*/
export function instanceOfSoSMessageNotificationEntityBase(value) {
if (!('id' in value) || value['id'] === undefined)
return false;
if (!('userId' in value) || value['userId'] === undefined)
return false;
if (!('messageId' in value) || value['messageId'] === undefined)
return false;
if (!('type' in value) || value['type'] === undefined)
return false;
if (!('read' in value) || value['read'] === undefined)
return false;
if (!('createdAt' in value) || value['createdAt'] === undefined)
return false;
return true;
}
export function SoSMessageNotificationEntityBaseFromJSON(json) {
return SoSMessageNotificationEntityBaseFromJSONTyped(json, false);
}
export function SoSMessageNotificationEntityBaseFromJSONTyped(json, ignoreDiscriminator) {
if (json == null) {
return json;
}
return {
...json, // Preserve relation fields from views
'id': json['id'],
'userId': json['userId'],
'messageId': json['messageId'],
'type': MessageNotificationEntityTypeFromJSON(json['type']),
'read': json['read'],
'createdAt': json['createdAt'],
};
}
export function SoSMessageNotificationEntityBaseToJSON(json) {
return SoSMessageNotificationEntityBaseToJSONTyped(json, false);
}
export function SoSMessageNotificationEntityBaseToJSONTyped(value, ignoreDiscriminator = false) {
if (value == null) {
return value;
}
return {
'id': value['id'],
'userId': value['userId'],
'messageId': value['messageId'],
'type': MessageNotificationEntityTypeToJSON(value['type']),
'read': value['read'],
'createdAt': value['createdAt'],
};
}