UNPKG

@vectorize-io/vectorize-client

Version:
79 lines (78 loc) 3.59 kB
"use strict"; /* tslint:disable */ /* eslint-disable */ /** * Vectorize API (Beta) * API for Vectorize services * * The version of the OpenAPI document: 0.0.1 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ var __assign = (this && this.__assign) || function () { __assign = Object.assign || function(t) { for (var s, i = 1, n = arguments.length; i < n; i++) { s = arguments[i]; for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; } return t; }; return __assign.apply(this, arguments); }; Object.defineProperty(exports, "__esModule", { value: true }); exports.instanceOfDocument = instanceOfDocument; exports.DocumentFromJSON = DocumentFromJSON; exports.DocumentFromJSONTyped = DocumentFromJSONTyped; exports.DocumentToJSON = DocumentToJSON; exports.DocumentToJSONTyped = DocumentToJSONTyped; /** * Check if a given object implements the Document interface. */ function instanceOfDocument(value) { if (!('relevancy' in value) || value['relevancy'] === undefined) return false; if (!('id' in value) || value['id'] === undefined) return false; if (!('text' in value) || value['text'] === undefined) return false; if (!('chunkId' in value) || value['chunkId'] === undefined) return false; if (!('totalChunks' in value) || value['totalChunks'] === undefined) return false; if (!('origin' in value) || value['origin'] === undefined) return false; if (!('originId' in value) || value['originId'] === undefined) return false; if (!('similarity' in value) || value['similarity'] === undefined) return false; if (!('source' in value) || value['source'] === undefined) return false; if (!('uniqueSource' in value) || value['uniqueSource'] === undefined) return false; if (!('sourceDisplayName' in value) || value['sourceDisplayName'] === undefined) return false; return true; } function DocumentFromJSON(json) { return DocumentFromJSONTyped(json, false); } function DocumentFromJSONTyped(json, ignoreDiscriminator) { if (json == null) { return json; } return __assign(__assign({}, json), { 'relevancy': json['relevancy'], 'id': json['id'], 'text': json['text'], 'chunkId': json['chunk_id'], 'totalChunks': json['total_chunks'], 'origin': json['origin'], 'originId': json['origin_id'], 'similarity': json['similarity'], 'source': json['source'], 'uniqueSource': json['unique_source'], 'sourceDisplayName': json['source_display_name'], 'pipelineId': json['pipeline_id'] == null ? undefined : json['pipeline_id'], 'orgId': json['org_id'] == null ? undefined : json['org_id'] }); } function DocumentToJSON(json) { return DocumentToJSONTyped(json, false); } function DocumentToJSONTyped(value, ignoreDiscriminator) { if (ignoreDiscriminator === void 0) { ignoreDiscriminator = false; } if (value == null) { return value; } return __assign(__assign({}, value), { 'relevancy': value['relevancy'], 'id': value['id'], 'text': value['text'], 'chunk_id': value['chunkId'], 'total_chunks': value['totalChunks'], 'origin': value['origin'], 'origin_id': value['originId'], 'similarity': value['similarity'], 'source': value['source'], 'unique_source': value['uniqueSource'], 'source_display_name': value['sourceDisplayName'], 'pipeline_id': value['pipelineId'], 'org_id': value['orgId'] }); }