@emergentmethods/asknews-typescript-sdk
Version:
Typescript SDK for AskNews API
60 lines (59 loc) • 2.41 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.
*/
Object.defineProperty(exports, "__esModule", { value: true });
exports.UserProfileSubscriptionToJSONTyped = exports.UserProfileSubscriptionToJSON = exports.UserProfileSubscriptionFromJSONTyped = exports.UserProfileSubscriptionFromJSON = exports.instanceOfUserProfileSubscription = void 0;
/**
* Check if a given object implements the UserProfileSubscription interface.
*/
function instanceOfUserProfileSubscription(value) {
if (!('status' in value) || value['status'] === undefined)
return false;
if (!('plan' in value) || value['plan'] === undefined)
return false;
return true;
}
exports.instanceOfUserProfileSubscription = instanceOfUserProfileSubscription;
function UserProfileSubscriptionFromJSON(json) {
return UserProfileSubscriptionFromJSONTyped(json, false);
}
exports.UserProfileSubscriptionFromJSON = UserProfileSubscriptionFromJSON;
function UserProfileSubscriptionFromJSONTyped(json, ignoreDiscriminator) {
if (json == null) {
return json;
}
return {
'status': json['status'],
'plan': json['plan'],
'periodStart': json['period_start'] == null ? undefined : (new Date(json['period_start'])),
'periodEnd': json['period_end'] == null ? undefined : (new Date(json['period_end'])),
};
}
exports.UserProfileSubscriptionFromJSONTyped = UserProfileSubscriptionFromJSONTyped;
function UserProfileSubscriptionToJSON(json) {
return UserProfileSubscriptionToJSONTyped(json, false);
}
exports.UserProfileSubscriptionToJSON = UserProfileSubscriptionToJSON;
function UserProfileSubscriptionToJSONTyped(value, ignoreDiscriminator = false) {
if (value == null) {
return value;
}
return {
'status': value['status'],
'plan': value['plan'],
'period_start': value['periodStart'] == null ? undefined : (value['periodStart'].toISOString()),
'period_end': value['periodEnd'] == null ? undefined : (value['periodEnd'].toISOString()),
};
}
exports.UserProfileSubscriptionToJSONTyped = UserProfileSubscriptionToJSONTyped;