// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import { APIResource } from '../../../core/resource'; import * as GetAPI from './get'; import { Get, PdfResponse } from './get'; import { APIPromise } from '../../../core/api-promise'; import { RequestOptions } from '../../../internal/request-options'; import { path } from '../../../internal/utils/path'; export class PdfGenerator extends APIResource { get: GetAPI.Get = new GetAPI.Get(this._client); /** * Generate a new PDF presentation * * @example * ```ts * const pdfGenerator = await client.v1.pdfGenerator.create({ * locale: 'locale', * numberOfSlides: 1, * topic: 'topic', * }); * ``` */ create(body: PdfGeneratorCreateParams, options?: RequestOptions): APIPromise { return this._client.post('/api/v1/pdf-generator/create', { body, ...options }); } /** * Delete a PDF presentation by ID * * @example * ```ts * const pdfGenerator = await client.v1.pdfGenerator.delete( * 'id', * ); * ``` */ delete(id: string, options?: RequestOptions): APIPromise { return this._client.delete(path`/api/v1/pdf-generator/delete/${id}`, options); } /** * Get all PDF presentations * * @example * ```ts * const pdfResponses = await client.v1.pdfGenerator.getAll(); * ``` */ getAll(options?: RequestOptions): APIPromise { return this._client.get('/api/v1/pdf-generator/get', options); } /** * Get a PDF presentation by ID * * @example * ```ts * const pdfResponse = await client.v1.pdfGenerator.getByID( * 'id', * ); * ``` */ getByID(id: string, options?: RequestOptions): APIPromise { return this._client.get(path`/api/v1/pdf-generator/get/${id}`, options); } } export interface PdfGeneratorCreateResponse { presentation?: GetAPI.PdfResponse; success?: boolean; } export interface PdfGeneratorDeleteResponse { message?: string; success?: boolean; } export type PdfGeneratorGetAllResponse = Array; export interface PdfGeneratorCreateParams { /** * Locale/language for the presentation (e.g., en-US, es-ES, fr-FR) */ locale: string; /** * Number of slides to generate */ numberOfSlides: number; /** * The topic for the PDF presentation */ topic: string; /** * Custom images to use (required when imageMode is "provide-own") */ customImages?: Array; /** * Image handling mode: search (auto-search), provide-own (use custom images), none * (no images, use icons) */ imageMode?: 'search' | 'provide-own' | 'none'; /** * Custom logo URL to use (optional, falls back to default StudyFetch logo) */ logoUrl?: string; } export namespace PdfGeneratorCreateParams { export interface CustomImage { /** * Description of what this image shows */ description: string; /** * Base64-encoded image data (provide either url or base64) */ base64?: string; /** * Image URL to download and use (provide either url or base64) */ url?: string; } } PdfGenerator.Get = Get; export declare namespace PdfGenerator { export { type PdfGeneratorCreateResponse as PdfGeneratorCreateResponse, type PdfGeneratorDeleteResponse as PdfGeneratorDeleteResponse, type PdfGeneratorGetAllResponse as PdfGeneratorGetAllResponse, type PdfGeneratorCreateParams as PdfGeneratorCreateParams, }; export { Get as Get, type PdfResponse as PdfResponse }; }