@emergentmethods/asknews-typescript-sdk
Version:
Typescript SDK for AskNews API
52 lines (51 loc) • 1.87 kB
JavaScript
/* tslint:disable */
/* eslint-disable */
/**
* AskNews API
* AskNews API [](https://status.asknews.app/status/prod)
*
* The version of the OpenAPI document: 0.24.22
* 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 UserProfileSubscription interface.
*/
export function instanceOfUserProfileSubscription(value) {
if (!('status' in value) || value['status'] === undefined)
return false;
if (!('plan' in value) || value['plan'] === undefined)
return false;
return true;
}
export function UserProfileSubscriptionFromJSON(json) {
return UserProfileSubscriptionFromJSONTyped(json, false);
}
export 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'])),
};
}
export function UserProfileSubscriptionToJSON(json) {
return UserProfileSubscriptionToJSONTyped(json, false);
}
export 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()),
};
}