/* tslint:disable */ /* eslint-disable */ /** * DocRaptor * A native client library for the DocRaptor HTML to PDF/XLS service. * * The version of the OpenAPI document: 2.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ import { exists, mapValues } from '../runtime'; import type { PrinceOptions } from './PrinceOptions'; import { PrinceOptionsFromJSON, PrinceOptionsFromJSONTyped, PrinceOptionsToJSON, } from './PrinceOptions'; /** * * @export * @interface Doc */ export interface Doc { /** * A name for identifying your document. * @type {string} * @memberof Doc */ name: string; /** * The type of document being created. * @type {string} * @memberof Doc */ documentType: DocDocumentTypeEnum; /** * The HTML data to be transformed into a document. You must supply content using document_content or document_url. * * @type {string} * @memberof Doc */ documentContent: string; /** * The URL to fetch the HTML data to be transformed into a document. You must supply content using document_content or document_url. * * @type {string} * @memberof Doc */ documentUrl?: string; /** * Enable test mode for this document. Test documents are not charged for but include a watermark. * @type {boolean} * @memberof Doc */ test?: boolean; /** * Specify a specific verison of the DocRaptor Pipeline to use. * @type {string} * @memberof Doc */ pipeline?: string; /** * Force strict HTML validation. * @type {string} * @memberof Doc */ strict?: DocStrictEnum; /** * Failed loading of images/javascripts/stylesheets/etc. will not cause the rendering to stop. * @type {boolean} * @memberof Doc */ ignoreResourceErrors?: boolean; /** * Prevent console.log from stopping document rendering during JavaScript execution. * @type {boolean} * @memberof Doc */ ignoreConsoleMessages?: boolean; /** * A field for storing a small amount of metadata with this document. * @type {string} * @memberof Doc */ tag?: string; /** * Request support help with this request if it succeeds. * @type {boolean} * @memberof Doc */ help?: boolean; /** * Enable DocRaptor JavaScript parsing. PrinceXML JavaScript parsing is also available elsewhere. * @type {boolean} * @memberof Doc */ javascript?: boolean; /** * Set HTTP referrer when generating this document. * @type {string} * @memberof Doc */ referrer?: string; /** * A URL that will receive a POST request after successfully completing an asynchronous document. The POST data will include download_url and download_id similar to status API responses. WARNING: this only works on asynchronous documents. * * @type {string} * @memberof Doc */ callbackUrl?: string; /** * The number of times a hosted document can be downloaded. If no limit is specified, the document will be available for an unlimited number of downloads. * @type {number} * @memberof Doc */ hostedDownloadLimit?: number; /** * The date and time at which a hosted document will be removed and no longer available. Must be a properly formatted ISO 8601 datetime, like 1981-01-23T08:02:30-05:00. * @type {string} * @memberof Doc */ hostedExpiresAt?: string; /** * * @type {PrinceOptions} * @memberof Doc */ princeOptions?: PrinceOptions; } /** * @export */ export const DocDocumentTypeEnum = { Pdf: 'pdf', Xls: 'xls', Xlsx: 'xlsx' } as const; export type DocDocumentTypeEnum = typeof DocDocumentTypeEnum[keyof typeof DocDocumentTypeEnum]; /** * @export */ export const DocStrictEnum = { None: 'none', Html: 'html' } as const; export type DocStrictEnum = typeof DocStrictEnum[keyof typeof DocStrictEnum]; /** * Check if a given object implements the Doc interface. */ export function instanceOfDoc(value: object): boolean { let isInstance = true; isInstance = isInstance && "name" in value; isInstance = isInstance && "documentType" in value; isInstance = isInstance && "documentContent" in value; return isInstance; } export function DocFromJSON(json: any): Doc { return DocFromJSONTyped(json, false); } export function DocFromJSONTyped(json: any, ignoreDiscriminator: boolean): Doc { if ((json === undefined) || (json === null)) { return json; } return { 'name': json['name'], 'documentType': json['document_type'], 'documentContent': json['document_content'], 'documentUrl': !exists(json, 'document_url') ? undefined : json['document_url'], 'test': !exists(json, 'test') ? undefined : json['test'], 'pipeline': !exists(json, 'pipeline') ? undefined : json['pipeline'], 'strict': !exists(json, 'strict') ? undefined : json['strict'], 'ignoreResourceErrors': !exists(json, 'ignore_resource_errors') ? undefined : json['ignore_resource_errors'], 'ignoreConsoleMessages': !exists(json, 'ignore_console_messages') ? undefined : json['ignore_console_messages'], 'tag': !exists(json, 'tag') ? undefined : json['tag'], 'help': !exists(json, 'help') ? undefined : json['help'], 'javascript': !exists(json, 'javascript') ? undefined : json['javascript'], 'referrer': !exists(json, 'referrer') ? undefined : json['referrer'], 'callbackUrl': !exists(json, 'callback_url') ? undefined : json['callback_url'], 'hostedDownloadLimit': !exists(json, 'hosted_download_limit') ? undefined : json['hosted_download_limit'], 'hostedExpiresAt': !exists(json, 'hosted_expires_at') ? undefined : json['hosted_expires_at'], 'princeOptions': !exists(json, 'prince_options') ? undefined : PrinceOptionsFromJSON(json['prince_options']), }; } export function DocToJSON(value?: Doc | null): any { if (value === undefined) { return undefined; } if (value === null) { return null; } return { 'name': value.name, 'document_type': value.documentType, 'document_content': value.documentContent, 'document_url': value.documentUrl, 'test': value.test, 'pipeline': value.pipeline, 'strict': value.strict, 'ignore_resource_errors': value.ignoreResourceErrors, 'ignore_console_messages': value.ignoreConsoleMessages, 'tag': value.tag, 'help': value.help, 'javascript': value.javascript, 'referrer': value.referrer, 'callback_url': value.callbackUrl, 'hosted_download_limit': value.hostedDownloadLimit, 'hosted_expires_at': value.hostedExpiresAt, 'prince_options': PrinceOptionsToJSON(value.princeOptions), }; }