@factset/sdk-securityexplanation
Version:
Security Explanation client library for JavaScript
109 lines (100 loc) • 3.26 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _ApiClient = _interopRequireDefault(require("../ApiClient"));
var _ErrorSource = _interopRequireDefault(require("./ErrorSource"));
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
/**
* Security Explanation API
* Allow clients to use Security Explanation through APIs.
*
* The version of the OpenAPI document: 1.1.0
* Contact: api@factset.com
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*
*/
/**
* The APIError model module.
* @module model/APIError
*/
class APIError {
/**
* Constructs a new <code>APIError</code>.
* Full details of any error
* @alias module:model/APIError
* @param id {String} Identifier for the error (the Chain ID)
* @param code {String} The error code
* @param title {String} The title of the error
*/
constructor(id, code, title) {
APIError.initialize(this, id, code, title);
}
/**
* Initializes the fields of this object.
* This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
* Only for internal use.
*/
static initialize(obj, id, code, title) {
obj['id'] = id;
obj['code'] = code;
obj['title'] = title;
}
/**
* Constructs a <code>APIError</code> from a plain JavaScript object, optionally creating a new instance.
* Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
* @param {Object} data The plain JavaScript object bearing properties of interest.
* @param {module:model/APIError} obj Optional instance to populate.
* @return {module:model/APIError} The populated <code>APIError</code> instance.
*/
static constructFromObject(data, obj) {
if (data) {
obj = obj || new APIError();
if (data.hasOwnProperty('id')) {
obj['id'] = _ApiClient.default.convertToType(data['id'], 'String');
}
if (data.hasOwnProperty('code')) {
obj['code'] = _ApiClient.default.convertToType(data['code'], 'String');
}
if (data.hasOwnProperty('title')) {
obj['title'] = _ApiClient.default.convertToType(data['title'], 'String');
}
if (data.hasOwnProperty('detail')) {
obj['detail'] = _ApiClient.default.convertToType(data['detail'], 'String');
}
if (data.hasOwnProperty('source')) {
obj['source'] = _ErrorSource.default.constructFromObject(data['source']);
}
}
return obj;
}
}
/**
* Identifier for the error (the Chain ID)
* @member {String} id
*/
APIError.prototype['id'] = undefined;
/**
* The error code
* @member {String} code
*/
APIError.prototype['code'] = undefined;
/**
* The title of the error
* @member {String} title
*/
APIError.prototype['title'] = undefined;
/**
* Explanation specific to the occurrence of the error
* @member {String} detail
*/
APIError.prototype['detail'] = undefined;
/**
* @member {module:model/ErrorSource} source
*/
APIError.prototype['source'] = undefined;
var _default = exports.default = APIError;