UNPKG

@simplyhomes/sos-sdk

Version:

TypeScript SDK for Simply Homes SoS API v4

64 lines (63 loc) 2.18 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 { SoSViewEntityDataFromJSON, SoSViewEntityDataToJSON, } from './SoSViewEntityData'; /** * Check if a given object implements the SoSViewEntityBase interface. */ export function instanceOfSoSViewEntityBase(value) { if (!('vid' in value) || value['vid'] === undefined) return false; if (!('userId' in value) || value['userId'] === 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 SoSViewEntityBaseFromJSON(json) { return SoSViewEntityBaseFromJSONTyped(json, false); } export function SoSViewEntityBaseFromJSONTyped(json, ignoreDiscriminator) { if (json == null) { return json; } return { ...json, // Preserve relation fields from views 'vid': json['vid'], 'name': json['name'] == null ? undefined : json['name'], 'data': json['data'] == null ? undefined : SoSViewEntityDataFromJSON(json['data']), 'userId': json['userId'], 'createdAt': json['createdAt'], 'updatedAt': json['updatedAt'], 'expiresAt': json['expiresAt'] == null ? undefined : json['expiresAt'], }; } export function SoSViewEntityBaseToJSON(json) { return SoSViewEntityBaseToJSONTyped(json, false); } export function SoSViewEntityBaseToJSONTyped(value, ignoreDiscriminator = false) { if (value == null) { return value; } return { 'vid': value['vid'], 'name': value['name'], 'data': SoSViewEntityDataToJSON(value['data']), 'userId': value['userId'], 'createdAt': value['createdAt'], 'updatedAt': value['updatedAt'], 'expiresAt': value['expiresAt'] == null ? value['expiresAt'] : value['expiresAt'], }; }