@simplyhomes/sos-sdk
Version:
TypeScript SDK for Simply Homes SoS API v4
80 lines (79 loc) • 2.88 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 { SoSMessageEntityEntityTypeFromJSON, SoSMessageEntityEntityTypeToJSON, } from './SoSMessageEntityEntityType';
/**
* Check if a given object implements the SoSMessageEntityBase interface.
*/
export function instanceOfSoSMessageEntityBase(value) {
if (!('mid' in value) || value['mid'] === undefined)
return false;
if (!('propertyId' in value) || value['propertyId'] === undefined)
return false;
if (!('entityType' in value) || value['entityType'] === undefined)
return false;
if (!('entityId' in value) || value['entityId'] === undefined)
return false;
if (!('content' in value) || value['content'] === undefined)
return false;
if (!('userId' in value) || value['userId'] === undefined)
return false;
if (!('organizationId' in value) || value['organizationId'] === undefined)
return false;
if (!('createdAt' in value) || value['createdAt'] === undefined)
return false;
if (!('updatedAt' in value) || value['updatedAt'] === undefined)
return false;
return true;
}
export function SoSMessageEntityBaseFromJSON(json) {
return SoSMessageEntityBaseFromJSONTyped(json, false);
}
export function SoSMessageEntityBaseFromJSONTyped(json, ignoreDiscriminator) {
if (json == null) {
return json;
}
return {
...json, // Preserve relation fields from views
'mid': json['mid'],
'propertyId': json['propertyId'],
'entityType': SoSMessageEntityEntityTypeFromJSON(json['entityType']),
'entityId': json['entityId'],
'content': json['content'],
'parentId': json['parentId'] == null ? undefined : json['parentId'],
'userId': json['userId'],
'organizationId': json['organizationId'],
'createdAt': json['createdAt'],
'updatedAt': json['updatedAt'],
};
}
export function SoSMessageEntityBaseToJSON(json) {
return SoSMessageEntityBaseToJSONTyped(json, false);
}
export function SoSMessageEntityBaseToJSONTyped(value, ignoreDiscriminator = false) {
if (value == null) {
return value;
}
return {
'mid': value['mid'],
'propertyId': value['propertyId'],
'entityType': SoSMessageEntityEntityTypeToJSON(value['entityType']),
'entityId': value['entityId'],
'content': value['content'],
'parentId': value['parentId'],
'userId': value['userId'],
'organizationId': value['organizationId'],
'createdAt': value['createdAt'],
'updatedAt': value['updatedAt'],
};
}