@simplyhomes/sos-sdk
Version:
TypeScript SDK for Simply Homes SoS API v4
61 lines (60 loc) • 2.46 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 { V4NotificationsCreateNotificationBodyDtoMetadataFromJSON, V4NotificationsCreateNotificationBodyDtoMetadataToJSON, } from './V4NotificationsCreateNotificationBodyDtoMetadata';
import { SoSNotificationEntityTypeFromJSON, SoSNotificationEntityTypeToJSON, } from './SoSNotificationEntityType';
/**
* Check if a given object implements the V4NotificationsCreateNotificationBodyDto interface.
*/
export function instanceOfV4NotificationsCreateNotificationBodyDto(value) {
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;
return true;
}
export function V4NotificationsCreateNotificationBodyDtoFromJSON(json) {
return V4NotificationsCreateNotificationBodyDtoFromJSONTyped(json, false);
}
export function V4NotificationsCreateNotificationBodyDtoFromJSONTyped(json, ignoreDiscriminator) {
if (json == null) {
return json;
}
return {
...json, // Preserve relation fields from views
'type': SoSNotificationEntityTypeFromJSON(json['type']),
'title': json['title'],
'body': json['body'],
'metadata': json['metadata'] == null ? undefined : V4NotificationsCreateNotificationBodyDtoMetadataFromJSON(json['metadata']),
'read': json['read'] == null ? undefined : json['read'],
'starred': json['starred'] == null ? undefined : json['starred'],
};
}
export function V4NotificationsCreateNotificationBodyDtoToJSON(json) {
return V4NotificationsCreateNotificationBodyDtoToJSONTyped(json, false);
}
export function V4NotificationsCreateNotificationBodyDtoToJSONTyped(value, ignoreDiscriminator = false) {
if (value == null) {
return value;
}
return {
'type': SoSNotificationEntityTypeToJSON(value['type']),
'title': value['title'],
'body': value['body'],
'metadata': V4NotificationsCreateNotificationBodyDtoMetadataToJSON(value['metadata']),
'read': value['read'],
'starred': value['starred'],
};
}