// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import { APIResource } from '../core/resource'; import * as BusinessPartnersAPI from './business-partners'; import { APIPromise } from '../core/api-promise'; import { RequestOptions } from '../internal/request-options'; import { path } from '../internal/utils/path'; /** * Generate presigned URLs to upload files to Rippling storage */ export class Files extends APIResource { /** * Retrieve a specific file */ retrieve(id: string, options?: RequestOptions): APIPromise { return this._client.get(path`/files/${id}/`, options); } /** * Create a new file */ create(body: FileCreateParams, options?: RequestOptions): APIPromise { return this._client.post('/files/', { body, ...options }); } } /** * Meta information for the response. */ export interface FileRetrieveResponse extends BusinessPartnersAPI.Meta { /** * Opaque identifier for this file */ id: string; /** * Lifecycle status: awaiting_upload | uploaded | active | infected */ status: string; /** * MIME type supplied by the client at create time */ content_type?: string; /** * Human-readable label for the file */ display_name?: string; /** * Required form fields to include in the multipart POST to S3 alongside the file * binary */ upload_fields?: unknown; /** * S3 endpoint URL — POST your multipart form here to upload the file. Present only * in the create response. */ upload_url?: string; /** * URLs for accessing the uploaded file after a successful upload */ url_data?: FileRetrieveResponse.URLData; } export namespace FileRetrieveResponse { /** * URLs for accessing the uploaded file after a successful upload */ export interface URLData { /** * CDN URL for previewing the uploaded file after upload completes */ preview_url?: string; /** * S3 URL where the file is accessible after upload */ s3_url?: string; } } /** * Response DTO for `POST /files/` and `GET /files/{id}`. */ export interface FileCreateResponse { /** * Opaque identifier for this file */ id: string; /** * Lifecycle status: awaiting_upload | uploaded | active | infected */ status: string; /** * MIME type supplied by the client at create time */ content_type?: string; /** * Human-readable label for the file */ display_name?: string; /** * Required form fields to include in the multipart POST to S3 alongside the file * binary */ upload_fields?: unknown; /** * S3 endpoint URL — POST your multipart form here to upload the file. Present only * in the create response. */ upload_url?: string; /** * URLs for accessing the uploaded file after a successful upload */ url_data?: FileCreateResponse.URLData; } export namespace FileCreateResponse { /** * URLs for accessing the uploaded file after a successful upload */ export interface URLData { /** * CDN URL for previewing the uploaded file after upload completes */ preview_url?: string; /** * S3 URL where the file is accessible after upload */ s3_url?: string; } } export interface FileCreateParams { /** * Lifecycle status: awaiting_upload | uploaded | active | infected */ status: string; /** * MIME type supplied by the client at create time */ content_type?: string; /** * Human-readable label for the file */ display_name?: string; /** * Required form fields to include in the multipart POST to S3 alongside the file * binary */ upload_fields?: unknown; /** * S3 endpoint URL — POST your multipart form here to upload the file. Present only * in the create response. */ upload_url?: string; /** * URLs for accessing the uploaded file after a successful upload */ url_data?: FileCreateParams.URLData; } export namespace FileCreateParams { /** * URLs for accessing the uploaded file after a successful upload */ export interface URLData { /** * CDN URL for previewing the uploaded file after upload completes */ preview_url?: string; /** * S3 URL where the file is accessible after upload */ s3_url?: string; } } export declare namespace Files { export { type FileRetrieveResponse as FileRetrieveResponse, type FileCreateResponse as FileCreateResponse, type FileCreateParams as FileCreateParams, }; }