@emergentmethods/asknews-typescript-sdk
Version:
Typescript SDK for AskNews API
50 lines (49 loc) • 1.75 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.ProfileToJSONTyped = exports.ProfileToJSON = exports.ProfileFromJSONTyped = exports.ProfileFromJSON = void 0;
const UserProfile_1 = require("./UserProfile");
function ProfileFromJSON(json) {
return ProfileFromJSONTyped(json, false);
}
exports.ProfileFromJSON = ProfileFromJSON;
function ProfileFromJSONTyped(json, ignoreDiscriminator) {
if (json == null) {
return json;
}
switch (json['identity_type']) {
case 'user':
return Object.assign({}, (0, UserProfile_1.UserProfileFromJSONTyped)(json, true), { identityType: 'user' });
default:
throw new Error(`No variant of Profile exists with 'identityType=${json['identityType']}'`);
}
}
exports.ProfileFromJSONTyped = ProfileFromJSONTyped;
function ProfileToJSON(json) {
return ProfileToJSONTyped(json, false);
}
exports.ProfileToJSON = ProfileToJSON;
function ProfileToJSONTyped(value, ignoreDiscriminator = false) {
if (value == null) {
return value;
}
switch (value['identityType']) {
case 'user':
return Object.assign({}, (0, UserProfile_1.UserProfileToJSON)(value), { identityType: 'user' });
default:
throw new Error(`No variant of Profile exists with 'identityType=${value['identityType']}'`);
}
}
exports.ProfileToJSONTyped = ProfileToJSONTyped;
;