@simplyhomes/sos-sdk
Version:
TypeScript SDK for Simply Homes SoS API v4
70 lines (69 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 { SoSWorkOrderEntityStatusFromJSON, SoSWorkOrderEntityStatusToJSON, } from './SoSWorkOrderEntityStatus';
/**
* Check if a given object implements the SoSWorkOrderEntityBase interface.
*/
export function instanceOfSoSWorkOrderEntityBase(value) {
if (!('woid' in value) || value['woid'] === undefined)
return false;
if (!('renovationId' in value) || value['renovationId'] === undefined)
return false;
if (!('name' in value) || value['name'] === undefined)
return false;
return true;
}
export function SoSWorkOrderEntityBaseFromJSON(json) {
return SoSWorkOrderEntityBaseFromJSONTyped(json, false);
}
export function SoSWorkOrderEntityBaseFromJSONTyped(json, ignoreDiscriminator) {
if (json == null) {
return json;
}
return {
...json, // Preserve relation fields from views
'woid': json['woid'],
'renovationId': json['renovationId'],
'status': json['status'] == null ? undefined : SoSWorkOrderEntityStatusFromJSON(json['status']),
'name': json['name'],
'notes': json['notes'] == null ? undefined : json['notes'],
'budget': json['budget'] == null ? undefined : json['budget'],
'actualCost': json['actualCost'] == null ? undefined : json['actualCost'],
'deadline': json['deadline'] == null ? undefined : json['deadline'],
'startDate': json['startDate'] == null ? undefined : json['startDate'],
'completionDate': json['completionDate'] == null ? undefined : json['completionDate'],
'createdAt': json['createdAt'] == null ? undefined : json['createdAt'],
};
}
export function SoSWorkOrderEntityBaseToJSON(json) {
return SoSWorkOrderEntityBaseToJSONTyped(json, false);
}
export function SoSWorkOrderEntityBaseToJSONTyped(value, ignoreDiscriminator = false) {
if (value == null) {
return value;
}
return {
'woid': value['woid'],
'renovationId': value['renovationId'],
'status': SoSWorkOrderEntityStatusToJSON(value['status']),
'name': value['name'],
'notes': value['notes'],
'budget': value['budget'],
'actualCost': value['actualCost'],
'deadline': value['deadline'] == null ? value['deadline'] : value['deadline'],
'startDate': value['startDate'] == null ? value['startDate'] : value['startDate'],
'completionDate': value['completionDate'] == null ? value['completionDate'] : value['completionDate'],
'createdAt': value['createdAt'] == null ? value['createdAt'] : value['createdAt'],
};
}