@emergentmethods/asknews-typescript-sdk
Version:
Typescript SDK for AskNews API
61 lines (60 loc) • 2.14 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.ValidationErrorToJSONTyped = exports.ValidationErrorToJSON = exports.ValidationErrorFromJSONTyped = exports.ValidationErrorFromJSON = exports.instanceOfValidationError = void 0;
const ValidationErrorLocInner_1 = require("./ValidationErrorLocInner");
/**
* Check if a given object implements the ValidationError interface.
*/
function instanceOfValidationError(value) {
if (!('loc' in value) || value['loc'] === undefined)
return false;
if (!('msg' in value) || value['msg'] === undefined)
return false;
if (!('type' in value) || value['type'] === undefined)
return false;
return true;
}
exports.instanceOfValidationError = instanceOfValidationError;
function ValidationErrorFromJSON(json) {
return ValidationErrorFromJSONTyped(json, false);
}
exports.ValidationErrorFromJSON = ValidationErrorFromJSON;
function ValidationErrorFromJSONTyped(json, ignoreDiscriminator) {
if (json == null) {
return json;
}
return {
'loc': (json['loc'].map(ValidationErrorLocInner_1.ValidationErrorLocInnerFromJSON)),
'msg': json['msg'],
'type': json['type'],
};
}
exports.ValidationErrorFromJSONTyped = ValidationErrorFromJSONTyped;
function ValidationErrorToJSON(json) {
return ValidationErrorToJSONTyped(json, false);
}
exports.ValidationErrorToJSON = ValidationErrorToJSON;
function ValidationErrorToJSONTyped(value, ignoreDiscriminator = false) {
if (value == null) {
return value;
}
return {
'loc': (value['loc'].map(ValidationErrorLocInner_1.ValidationErrorLocInnerToJSON)),
'msg': value['msg'],
'type': value['type'],
};
}
exports.ValidationErrorToJSONTyped = ValidationErrorToJSONTyped;
;