@emergentmethods/asknews-typescript-sdk
Version:
Typescript SDK for AskNews API
56 lines (55 loc) • 1.6 kB
JavaScript
/* tslint:disable */
/* eslint-disable */
/**
* AskNews API
* AskNews API
*
* The version of the OpenAPI document: 0.19.10
* 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.
*/
/**
* Check if a given object implements the RedditComment interface.
*/
export 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;
}
export function RedditCommentFromJSON(json) {
return RedditCommentFromJSONTyped(json, false);
}
export function RedditCommentFromJSONTyped(json, ignoreDiscriminator) {
if (json == null) {
return json;
}
return {
'author': json['author'],
'body': json['body'],
'date': (new Date(json['date'])),
'upvotes': json['upvotes'],
};
}
export function RedditCommentToJSON(json) {
return RedditCommentToJSONTyped(json, false);
}
export function RedditCommentToJSONTyped(value, ignoreDiscriminator = false) {
if (value == null) {
return value;
}
return {
'author': value['author'],
'body': value['body'],
'date': ((value['date']).toISOString()),
'upvotes': value['upvotes'],
};
}