@emergentmethods/asknews-typescript-sdk
Version:
Typescript SDK for AskNews API
64 lines (63 loc) • 2.11 kB
JavaScript
/* tslint:disable */
/* eslint-disable */
/**
* AskNews API
* AskNews API
*
* The version of the OpenAPI document: 0.21.1
* Contact: contact@emergentmethods.ai
*
* 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.RedditCommentToJSONTyped = exports.RedditCommentToJSON = exports.RedditCommentFromJSONTyped = exports.RedditCommentFromJSON = exports.instanceOfRedditComment = void 0;
/**
* Check if a given object implements the RedditComment interface.
*/
function instanceOfRedditComment(value) {
if (!('author' in value) || value['author'] === undefined)
return false;
if (!('body' in value) || value['body'] === undefined)
return false;
if (!('date' in value) || value['date'] === undefined)
return false;
if (!('upvotes' in value) || value['upvotes'] === undefined)
return false;
return true;
}
exports.instanceOfRedditComment = instanceOfRedditComment;
function RedditCommentFromJSON(json) {
return RedditCommentFromJSONTyped(json, false);
}
exports.RedditCommentFromJSON = RedditCommentFromJSON;
function RedditCommentFromJSONTyped(json, ignoreDiscriminator) {
if (json == null) {
return json;
}
return {
'author': json['author'],
'body': json['body'],
'date': (new Date(json['date'])),
'upvotes': json['upvotes'],
};
}
exports.RedditCommentFromJSONTyped = RedditCommentFromJSONTyped;
function RedditCommentToJSON(json) {
return RedditCommentToJSONTyped(json, false);
}
exports.RedditCommentToJSON = RedditCommentToJSON;
function RedditCommentToJSONTyped(value, ignoreDiscriminator = false) {
if (value == null) {
return value;
}
return {
'author': value['author'],
'body': value['body'],
'date': ((value['date']).toISOString()),
'upvotes': value['upvotes'],
};
}
exports.RedditCommentToJSONTyped = RedditCommentToJSONTyped;
;