UNPKG

fastcomments-sdk

Version:

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

136 lines 6.83 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.instanceOfPublicComment = instanceOfPublicComment; exports.PublicCommentFromJSON = PublicCommentFromJSON; exports.PublicCommentFromJSONTyped = PublicCommentFromJSONTyped; exports.PublicCommentToJSON = PublicCommentToJSON; exports.PublicCommentToJSONTyped = PublicCommentToJSONTyped; const CommentUserBadgeInfo_1 = require("./CommentUserBadgeInfo"); /** * Check if a given object implements the PublicComment interface. */ function instanceOfPublicComment(value) { if (!('id' in value) || value['id'] === undefined) return false; if (!('commenterName' in value) || value['commenterName'] === undefined) return false; if (!('commentHTML' in value) || value['commentHTML'] === undefined) return false; if (!('date' in value) || value['date'] === undefined) return false; if (!('verified' in value) || value['verified'] === undefined) return false; return true; } function PublicCommentFromJSON(json) { return PublicCommentFromJSONTyped(json, false); } function PublicCommentFromJSONTyped(json, ignoreDiscriminator) { if (json == null) { return json; } return { 'id': json['_id'], 'userId': json['userId'] == null ? undefined : json['userId'], 'commenterName': json['commenterName'], 'commenterLink': json['commenterLink'] == null ? undefined : json['commenterLink'], 'commentHTML': json['commentHTML'], 'parentId': json['parentId'] == null ? undefined : json['parentId'], 'date': (json['date'] == null ? null : new Date(json['date'])), 'votes': json['votes'] == null ? undefined : json['votes'], 'votesUp': json['votesUp'] == null ? undefined : json['votesUp'], 'votesDown': json['votesDown'] == null ? undefined : json['votesDown'], 'verified': json['verified'], 'avatarSrc': json['avatarSrc'] == null ? undefined : json['avatarSrc'], 'hasImages': json['hasImages'] == null ? undefined : json['hasImages'], 'isByAdmin': json['isByAdmin'] == null ? undefined : json['isByAdmin'], 'isByModerator': json['isByModerator'] == null ? undefined : json['isByModerator'], 'isPinned': json['isPinned'] == null ? undefined : json['isPinned'], 'isLocked': json['isLocked'] == null ? undefined : json['isLocked'], 'displayLabel': json['displayLabel'] == null ? undefined : json['displayLabel'], 'rating': json['rating'] == null ? undefined : json['rating'], 'badges': json['badges'] == null ? undefined : (json['badges'].map(CommentUserBadgeInfo_1.CommentUserBadgeInfoFromJSON)), 'viewCount': json['viewCount'] == null ? undefined : json['viewCount'], 'isDeleted': json['isDeleted'] == null ? undefined : json['isDeleted'], 'isDeletedUser': json['isDeletedUser'] == null ? undefined : json['isDeletedUser'], 'isSpam': json['isSpam'] == null ? undefined : json['isSpam'], 'anonUserId': json['anonUserId'] == null ? undefined : json['anonUserId'], 'feedbackIds': json['feedbackIds'] == null ? undefined : json['feedbackIds'], 'requiresVerification': json['requiresVerification'] == null ? undefined : json['requiresVerification'], 'editKey': json['editKey'] == null ? undefined : json['editKey'], 'approved': json['approved'] == null ? undefined : json['approved'], 'isUnread': json['isUnread'] == null ? undefined : json['isUnread'], 'myVoteId': json['myVoteId'] == null ? undefined : json['myVoteId'], 'isVotedDown': json['isVotedDown'] == null ? undefined : json['isVotedDown'], 'isVotedUp': json['isVotedUp'] == null ? undefined : json['isVotedUp'], 'hasChildren': json['hasChildren'] == null ? undefined : json['hasChildren'], 'nestedChildrenCount': json['nestedChildrenCount'] == null ? undefined : json['nestedChildrenCount'], 'childCount': json['childCount'] == null ? undefined : json['childCount'], 'children': json['children'] == null ? undefined : (json['children'].map(PublicCommentFromJSON)), 'isFlagged': json['isFlagged'] == null ? undefined : json['isFlagged'], 'isBlocked': json['isBlocked'] == null ? undefined : json['isBlocked'], }; } function PublicCommentToJSON(json) { return PublicCommentToJSONTyped(json, false); } function PublicCommentToJSONTyped(value, ignoreDiscriminator = false) { if (value == null) { return value; } return { '_id': value['id'], 'userId': value['userId'], 'commenterName': value['commenterName'], 'commenterLink': value['commenterLink'], 'commentHTML': value['commentHTML'], 'parentId': value['parentId'], 'date': (value['date'] == null ? null : value['date'].toISOString()), 'votes': value['votes'], 'votesUp': value['votesUp'], 'votesDown': value['votesDown'], 'verified': value['verified'], 'avatarSrc': value['avatarSrc'], 'hasImages': value['hasImages'], 'isByAdmin': value['isByAdmin'], 'isByModerator': value['isByModerator'], 'isPinned': value['isPinned'], 'isLocked': value['isLocked'], 'displayLabel': value['displayLabel'], 'rating': value['rating'], 'badges': value['badges'] == null ? undefined : (value['badges'].map(CommentUserBadgeInfo_1.CommentUserBadgeInfoToJSON)), 'viewCount': value['viewCount'], 'isDeleted': value['isDeleted'], 'isDeletedUser': value['isDeletedUser'], 'isSpam': value['isSpam'], 'anonUserId': value['anonUserId'], 'feedbackIds': value['feedbackIds'], 'requiresVerification': value['requiresVerification'], 'editKey': value['editKey'], 'approved': value['approved'], 'isUnread': value['isUnread'], 'myVoteId': value['myVoteId'], 'isVotedDown': value['isVotedDown'], 'isVotedUp': value['isVotedUp'], 'hasChildren': value['hasChildren'], 'nestedChildrenCount': value['nestedChildrenCount'], 'childCount': value['childCount'], 'children': value['children'] == null ? undefined : (value['children'].map(PublicCommentToJSON)), 'isFlagged': value['isFlagged'], 'isBlocked': value['isBlocked'], }; } //# sourceMappingURL=PublicComment.js.map