@indexea/sdk
Version:
Indexea JavaScript SDK (indexea.com)
92 lines (91 loc) • 4.67 kB
JavaScript
;
/* tslint:disable */
/* eslint-disable */
/**
* Indexea OpenAPI
* 这是 Indexea 搜索服务平台的 OpenAPI,用于描述平台的所有接口信息,你可以通过这个页面来了解和在线验证平台的所有接口信息。 ### Errors 本 API 使用标准的 HTTP 状态码来指示操作成功或者失败,如果失败将会在 body 中以 JSON 格式提供详细的错误信息,如下所示: ``` { \"error\": 404, \"message\": \"page not found\" } ```
*
* The version of the OpenAPI document: 1.0.0
* Contact: indexea.com@gmail.com
*
* 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.AccountBeanToJSON = exports.AccountBeanFromJSONTyped = exports.AccountBeanFromJSON = exports.instanceOfAccountBean = void 0;
var runtime_1 = require("../runtime");
var AppBean_1 = require("./AppBean");
/**
* Check if a given object implements the AccountBean interface.
*/
function instanceOfAccountBean(value) {
var isInstance = true;
return isInstance;
}
exports.instanceOfAccountBean = instanceOfAccountBean;
function AccountBeanFromJSON(json) {
return AccountBeanFromJSONTyped(json, false);
}
exports.AccountBeanFromJSON = AccountBeanFromJSON;
function AccountBeanFromJSONTyped(json, ignoreDiscriminator) {
if ((json === undefined) || (json === null)) {
return json;
}
return {
'id': !(0, runtime_1.exists)(json, 'id') ? undefined : json['id'],
'scopes': !(0, runtime_1.exists)(json, 'scopes') ? undefined : json['scopes'],
'token': !(0, runtime_1.exists)(json, 'token') ? undefined : json['token'],
'tokenAt': !(0, runtime_1.exists)(json, 'token_at') ? undefined : (new Date(json['token_at'])),
'name': !(0, runtime_1.exists)(json, 'name') ? undefined : json['name'],
'account': !(0, runtime_1.exists)(json, 'account') ? undefined : json['account'],
'avatar': !(0, runtime_1.exists)(json, 'avatar') ? undefined : json['avatar'],
'company': !(0, runtime_1.exists)(json, 'company') ? undefined : json['company'],
'nation': !(0, runtime_1.exists)(json, 'nation') ? undefined : json['nation'],
'state': !(0, runtime_1.exists)(json, 'state') ? undefined : json['state'],
'city': !(0, runtime_1.exists)(json, 'city') ? undefined : json['city'],
'address': !(0, runtime_1.exists)(json, 'address') ? undefined : json['address'],
'loginIp': !(0, runtime_1.exists)(json, 'login_ip') ? undefined : json['login_ip'],
'loginAt': !(0, runtime_1.exists)(json, 'login_at') ? undefined : (new Date(json['login_at'])),
'createdAt': !(0, runtime_1.exists)(json, 'created_at') ? undefined : (new Date(json['created_at'])),
'origin': !(0, runtime_1.exists)(json, 'origin') ? undefined : json['origin'],
'subscription': !(0, runtime_1.exists)(json, 'subscription') ? undefined : json['subscription'],
'settings': !(0, runtime_1.exists)(json, 'settings') ? undefined : json['settings'],
'roles': !(0, runtime_1.exists)(json, 'roles') ? undefined : json['roles'],
'status': !(0, runtime_1.exists)(json, 'status') ? undefined : json['status'],
'apps': !(0, runtime_1.exists)(json, 'apps') ? undefined : (json['apps'].map(AppBean_1.AppBeanFromJSON)),
};
}
exports.AccountBeanFromJSONTyped = AccountBeanFromJSONTyped;
function AccountBeanToJSON(value) {
if (value === undefined) {
return undefined;
}
if (value === null) {
return null;
}
return {
'id': value.id,
'scopes': value.scopes,
'token': value.token,
'token_at': value.tokenAt === undefined ? undefined : (value.tokenAt.toISOString()),
'name': value.name,
'account': value.account,
'avatar': value.avatar,
'company': value.company,
'nation': value.nation,
'state': value.state,
'city': value.city,
'address': value.address,
'login_ip': value.loginIp,
'login_at': value.loginAt === undefined ? undefined : (value.loginAt.toISOString()),
'created_at': value.createdAt === undefined ? undefined : (value.createdAt.toISOString()),
'origin': value.origin,
'subscription': value.subscription,
'settings': value.settings,
'roles': value.roles,
'status': value.status,
'apps': value.apps === undefined ? undefined : (value.apps.map(AppBean_1.AppBeanToJSON)),
};
}
exports.AccountBeanToJSON = AccountBeanToJSON;