UNPKG

fastcomments-sdk

Version:

FastComments API Client - A SDK for interacting with the FastComments API

121 lines 5.38 kB
"use strict"; /* tslint:disable */ /* eslint-disable */ /** * fastcomments * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: 0.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ Object.defineProperty(exports, "__esModule", { value: true }); exports.instanceOfUserNotification = instanceOfUserNotification; exports.UserNotificationFromJSON = UserNotificationFromJSON; exports.UserNotificationFromJSONTyped = UserNotificationFromJSONTyped; exports.UserNotificationToJSON = UserNotificationToJSON; exports.UserNotificationToJSONTyped = UserNotificationToJSONTyped; const NotificationObjectType_1 = require("./NotificationObjectType"); const NotificationType_1 = require("./NotificationType"); /** * Check if a given object implements the UserNotification interface. */ function instanceOfUserNotification(value) { if (!('id' in value) || value['id'] === undefined) return false; if (!('tenantId' in value) || value['tenantId'] === undefined) return false; if (!('urlId' in value) || value['urlId'] === undefined) return false; if (!('url' in value) || value['url'] === undefined) return false; if (!('relatedObjectType' in value) || value['relatedObjectType'] === undefined) return false; if (!('relatedObjectId' in value) || value['relatedObjectId'] === undefined) return false; if (!('viewed' in value) || value['viewed'] === undefined) return false; if (!('isUnreadMessage' in value) || value['isUnreadMessage'] === undefined) return false; if (!('sent' in value) || value['sent'] === undefined) return false; if (!('createdAt' in value) || value['createdAt'] === undefined) return false; if (!('type' in value) || value['type'] === undefined) return false; if (!('optedOut' in value) || value['optedOut'] === undefined) return false; return true; } function UserNotificationFromJSON(json) { return UserNotificationFromJSONTyped(json, false); } function UserNotificationFromJSONTyped(json, ignoreDiscriminator) { if (json == null) { return json; } return { 'id': json['_id'], 'tenantId': json['tenantId'], 'userId': json['userId'] == null ? undefined : json['userId'], 'anonUserId': json['anonUserId'] == null ? undefined : json['anonUserId'], 'urlId': json['urlId'], 'url': json['url'], 'pageTitle': json['pageTitle'] == null ? undefined : json['pageTitle'], 'relatedObjectType': (0, NotificationObjectType_1.NotificationObjectTypeFromJSON)(json['relatedObjectType']), 'relatedObjectId': json['relatedObjectId'], 'viewed': json['viewed'], 'isUnreadMessage': json['isUnreadMessage'], 'sent': json['sent'], 'createdAt': (new Date(json['createdAt'])), 'type': (0, NotificationType_1.NotificationTypeFromJSON)(json['type']), 'fromCommentId': json['fromCommentId'] == null ? undefined : json['fromCommentId'], 'fromVoteId': json['fromVoteId'] == null ? undefined : json['fromVoteId'], 'fromUserName': json['fromUserName'] == null ? undefined : json['fromUserName'], 'fromUserId': json['fromUserId'] == null ? undefined : json['fromUserId'], 'fromUserAvatarSrc': json['fromUserAvatarSrc'] == null ? undefined : json['fromUserAvatarSrc'], 'optedOut': json['optedOut'], 'count': json['count'] == null ? undefined : json['count'], 'relatedIds': json['relatedIds'] == null ? undefined : json['relatedIds'], 'fromUserIds': json['fromUserIds'] == null ? undefined : json['fromUserIds'], 'fromUserNames': json['fromUserNames'] == null ? undefined : json['fromUserNames'], }; } function UserNotificationToJSON(json) { return UserNotificationToJSONTyped(json, false); } function UserNotificationToJSONTyped(value, ignoreDiscriminator = false) { if (value == null) { return value; } return { '_id': value['id'], 'tenantId': value['tenantId'], 'userId': value['userId'], 'anonUserId': value['anonUserId'], 'urlId': value['urlId'], 'url': value['url'], 'pageTitle': value['pageTitle'], 'relatedObjectType': (0, NotificationObjectType_1.NotificationObjectTypeToJSON)(value['relatedObjectType']), 'relatedObjectId': value['relatedObjectId'], 'viewed': value['viewed'], 'isUnreadMessage': value['isUnreadMessage'], 'sent': value['sent'], 'createdAt': ((value['createdAt']).toISOString()), 'type': (0, NotificationType_1.NotificationTypeToJSON)(value['type']), 'fromCommentId': value['fromCommentId'], 'fromVoteId': value['fromVoteId'], 'fromUserName': value['fromUserName'], 'fromUserId': value['fromUserId'], 'fromUserAvatarSrc': value['fromUserAvatarSrc'], 'optedOut': value['optedOut'], 'count': value['count'], 'relatedIds': value['relatedIds'], 'fromUserIds': value['fromUserIds'], 'fromUserNames': value['fromUserNames'], }; } //# sourceMappingURL=UserNotification.js.map