import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient.mjs"; import { type NormalizedClientOptionsWithAuth } from "../../../../BaseClient.mjs"; import * as core from "../../../../core/index.mjs"; import * as Whop from "../../../index.mjs"; export declare namespace FilesClient { type Options = BaseClientOptions; interface RequestOptions extends BaseRequestOptions { } } /** * A File is an uploaded document or media object, identified by a `file_` ID. Creating a file returns a presigned destination; upload the bytes there and the file becomes `ready`. * * Use the Files API to create a file, upload its content directly to storage (in one PUT, or in parts for large files), and retrieve it while polling for readiness. A ready file's ID can be attached wherever Whop accepts files. */ export declare class FilesClient { protected readonly _options: NormalizedClientOptionsWithAuth; constructor(options?: FilesClient.Options); /** * Returns the files with the given IDs, newest first — fetch a batch in one request instead of retrieving each file individually. Only files you created are returned; IDs that do not exist, or that another credential created, are omitted. For a batch larger than one page, follow `page_info` with the same `file_ids` to walk the rest. * * @param {Whop.ListFilesRequest} request * @param {FilesClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Whop.BadRequestError} * @throws {@link Whop.UnauthorizedError} * @throws {@link errors.WhopError} * @throws {@link errors.WhopTimeoutError} * * @example * await client.files.list({ * file_ids: ["file_xxxxxxxxxxxxx"] * }) */ list(request?: Whop.ListFilesRequest, requestOptions?: FilesClient.RequestOptions): Promise>; /** * Creates a file and returns a presigned destination to upload its bytes to. PUT the bytes to `upload_url` (single-part), or to each of `multipart_upload_urls` and then call Complete File Multipart Upload. Once the bytes land the file becomes `ready`, and its ID can be attached wherever a file is accepted — account legal documents, dispute evidence documents. For a step-by-step walkthrough of single-part and multipart uploads, see the [direct file uploads guide](/developer/guides/direct-file-uploads). * * @param {Whop.CreateFilesRequest} request * @param {FilesClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Whop.BadRequestError} * @throws {@link Whop.UnauthorizedError} * @throws {@link Whop.ConflictError} * @throws {@link errors.WhopError} * @throws {@link errors.WhopTimeoutError} * * @example * await client.files.create({ * filename: "terms.pdf" * }) */ create(request: Whop.CreateFilesRequest, requestOptions?: FilesClient.RequestOptions): core.HttpResponsePromise; private __create; /** * Retrieves a file you uploaded — poll it after uploading the bytes to see `upload_status` become `ready`. Only the creator can retrieve a file this way; a file attached to another resource is read through that resource. * * @param {Whop.RetrieveFilesRequest} request * @param {FilesClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Whop.UnauthorizedError} * @throws {@link Whop.NotFoundError} * @throws {@link errors.WhopError} * @throws {@link errors.WhopTimeoutError} * * @example * await client.files.retrieve({ * id: "id" * }) */ retrieve(request: Whop.RetrieveFilesRequest, requestOptions?: FilesClient.RequestOptions): core.HttpResponsePromise; private __retrieve; /** * Assembles the parts of a multipart upload after every part has been PUT to its presigned URL. Pass the `multipart_upload_id` from Create File and each part's `ETag` response header. For a step-by-step walkthrough of multipart uploads, see the [direct file uploads guide](/developer/guides/direct-file-uploads). * * @param {Whop.CompleteFilesRequest} request * @param {FilesClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Whop.BadRequestError} * @throws {@link Whop.UnauthorizedError} * @throws {@link Whop.NotFoundError} * @throws {@link Whop.ConflictError} * @throws {@link errors.WhopError} * @throws {@link errors.WhopTimeoutError} * * @example * await client.files.complete({ * id: "id", * multipart_parts: [{ * etag: "etag-1", * part_number: 1 * }], * multipart_upload_id: "upload-id" * }) */ complete(request: Whop.CompleteFilesRequest, requestOptions?: FilesClient.RequestOptions): core.HttpResponsePromise; private __complete; }