// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import { APIResource } from '../../core/resource'; import { APIPromise } from '../../core/api-promise'; import { buildHeaders } from '../../internal/headers'; import { RequestOptions } from '../../internal/request-options'; import { path } from '../../internal/utils/path'; export class Content extends APIResource { /** * Download the raw bytes of a file by id. * * Streams the stored object's content back directly (not a redirect or signed * URL), with the response Content-Type set to the file's stored MIME type and * Content-Disposition set to attachment. Use the metadata endpoint for size, * filename, and other attributes. */ retrieve( fileID: string, params: ContentRetrieveParams | null | undefined = {}, options?: RequestOptions, ): APIPromise { const { 'x-project-id': xProjectID } = params ?? {}; return this._client.get(path`/v5/files/${fileID}/content`, { ...options, headers: buildHeaders([ { ...(xProjectID != null ? { 'x-project-id': xProjectID } : undefined) }, options?.headers, ]), }); } } export type ContentRetrieveResponse = unknown; export interface ContentRetrieveParams { 'x-project-id'?: string; } export declare namespace Content { export { type ContentRetrieveResponse as ContentRetrieveResponse, type ContentRetrieveParams as ContentRetrieveParams, }; }