UNPKG

@simplyhomes/sos-sdk

Version:

TypeScript SDK for Simply Homes SoS API v4

381 lines (380 loc) 46 kB
/* tslint:disable */ /* eslint-disable */ /** * API v4 * Swagger documentation for API v4 * * The version of the OpenAPI document: 4.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 * as runtime from '../runtime'; import { V4FileUploadsCreateFileUploadResponseDtoFromJSON, V4FileUploadsDeleteFileUploadResponseDtoFromJSON, V4FileUploadsGetFileUploadColumnsResponseDtoFromJSON, V4FileUploadsGetFileUploadResponseDtoFromJSON, V4FileUploadsGetFileUploadsInViewResponseDtoFromJSON, V4FileUploadsGetFileUploadsResponseDtoFromJSON, V4FileUploadsGetSignedUrlResponseDtoFromJSON, V4FileUploadsUpdateFileUploadBodyDtoToJSON, V4FileUploadsUpdateFileUploadResponseDtoFromJSON, } from '../models/index'; /** * */ export class FileUploadsAPIV4Api extends runtime.BaseAPI { /** * # POST /v4/file-uploads ## Overview Uploads a file directly to the server and creates a corresponding file upload record. This is a single-step process that handles both file upload and database record creation. ## Authentication - **Required**: Yes - **Security**: - `x-api-key` header - `organization-id` header ## Request Body This endpoint expects a **multipart/form-data** request with the file attached. ### Content Type - **Content-Type**: `multipart/form-data` ### Form Fields | Field | Type | Required | Description | |-------|------|----------|-------------| | `file` | File | Yes | The file to be uploaded (any file type supported) | ### File Constraints - The system will automatically extract file metadata (name, size, MIME type) - File will be uploaded to configured storage (AWS S3 or local storage) - Database record created with file metadata and storage URL ## Use Cases This endpoint is ideal for: - **Direct File Upload**: Upload files directly through the API - **Document Management**: Upload property documents, contracts, and legal files - **Property Documentation**: Store property-related files with automatic organization linking - **Content Management**: Upload business documents and files - **Asset Management**: Upload and track files for auditing and organization - **Compliance**: Upload regulatory documents and compliance files * Upload a new file */ async v4FileUploadsControllerCreateFileUploadV4Raw(requestParameters, initOverrides) { if (requestParameters['file'] == null) { throw new runtime.RequiredError('file', 'Required parameter "file" was null or undefined when calling v4FileUploadsControllerCreateFileUploadV4().'); } if (requestParameters['type'] == null) { throw new runtime.RequiredError('type', 'Required parameter "type" was null or undefined when calling v4FileUploadsControllerCreateFileUploadV4().'); } const queryParameters = {}; const headerParameters = {}; if (this.configuration && this.configuration.apiKey) { headerParameters["x-api-key"] = await this.configuration.apiKey("x-api-key"); // x-api-key authentication } if (this.configuration && this.configuration.apiKey) { headerParameters["organization-id"] = await this.configuration.apiKey("organization-id"); // organization-id authentication } const consumes = [ { contentType: 'multipart/form-data' }, ]; // @ts-ignore: canConsumeForm may be unused const canConsumeForm = runtime.canConsumeForm(consumes); let formParams; let useForm = false; // use FormData to transmit files using content-type "multipart/form-data" useForm = canConsumeForm; if (useForm) { formParams = new FormData(); } else { formParams = new URLSearchParams(); } if (requestParameters['file'] != null) { formParams.append('file', requestParameters['file']); } if (requestParameters['propertyId'] != null) { formParams.append('propertyId', requestParameters['propertyId']); } if (requestParameters['transactionId'] != null) { formParams.append('transactionId', requestParameters['transactionId']); } if (requestParameters['inspectionId'] != null) { formParams.append('inspectionId', requestParameters['inspectionId']); } if (requestParameters['renovationId'] != null) { formParams.append('renovationId', requestParameters['renovationId']); } if (requestParameters['type'] != null) { formParams.append('type', requestParameters['type']); } let urlPath = `/v4/file-uploads`; const response = await this.request({ path: urlPath, method: 'POST', headers: headerParameters, query: queryParameters, body: formParams, }, initOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => V4FileUploadsCreateFileUploadResponseDtoFromJSON(jsonValue)); } /** * # POST /v4/file-uploads ## Overview Uploads a file directly to the server and creates a corresponding file upload record. This is a single-step process that handles both file upload and database record creation. ## Authentication - **Required**: Yes - **Security**: - `x-api-key` header - `organization-id` header ## Request Body This endpoint expects a **multipart/form-data** request with the file attached. ### Content Type - **Content-Type**: `multipart/form-data` ### Form Fields | Field | Type | Required | Description | |-------|------|----------|-------------| | `file` | File | Yes | The file to be uploaded (any file type supported) | ### File Constraints - The system will automatically extract file metadata (name, size, MIME type) - File will be uploaded to configured storage (AWS S3 or local storage) - Database record created with file metadata and storage URL ## Use Cases This endpoint is ideal for: - **Direct File Upload**: Upload files directly through the API - **Document Management**: Upload property documents, contracts, and legal files - **Property Documentation**: Store property-related files with automatic organization linking - **Content Management**: Upload business documents and files - **Asset Management**: Upload and track files for auditing and organization - **Compliance**: Upload regulatory documents and compliance files * Upload a new file */ async v4FileUploadsControllerCreateFileUploadV4(requestParameters, initOverrides) { const response = await this.v4FileUploadsControllerCreateFileUploadV4Raw(requestParameters, initOverrides); return await response.value(); } /** * # DELETE /v4/file-uploads/{fileUploadId} ## Overview Deletes an existing file upload from the system. This is a permanent operation that removes the file upload record and optionally the associated file from storage. ## Authentication - **Required**: Yes - **Security**: - `x-api-key` header - `organization-id` header ## Request Parameters ### Path Parameters | Parameter | Type | Required | Description | |-----------|------|----------|-------------| | `fileUploadId` | string | Yes | The unique identifier of the file upload to delete | ## Access Control - **Organization Scope**: File upload must belong to the authenticated user\'s organization - **File Upload Validation**: Invalid or non-existent file upload IDs will return a 404 error - **Data Privacy**: Only file uploads within the user\'s organization can be deleted ## Deletion Behavior The deletion operation: - **Permanent Removal**: File upload record is permanently deleted from the system - **File Handling**: Associated file in storage may need separate cleanup - **Cascade Effects**: Associated relationships and references are handled appropriately - **Immediate Effect**: Deletion is applied immediately - **Audit Trail**: Deletion is logged for audit and compliance purposes ## Response Structure Returns confirmation that the file upload was successfully deleted. ## Use Cases This endpoint is ideal for: - **Document Cleanup**: Remove outdated or unused file uploads - **Storage Management**: Free up storage space by removing unnecessary files - **Content Management**: Clean up document libraries and file collections - **Data Management**: Maintain clean file upload databases - **Compliance**: Delete file uploads upon user request or policy requirements - **Legal Requirements**: Remove documents as required by legal or regulatory obligations ## Important Considerations Before deleting a file upload, consider: - **Associated Content**: Check if file is referenced by properties, contracts, or other entities - **Storage Cleanup**: Consider whether the actual file needs to be removed from storage - **Backup Requirements**: Ensure proper backup if recovery might be needed - **Legal Implications**: Consider legal requirements for document retention - **User Notification**: Consider notifying relevant users of the deletion - **Alternative Actions**: Consider archiving instead of permanent deletion ## Error Handling Common errors include: - **File Upload Not Found**: File upload ID does not exist or belongs to different organization - **Permission Denied**: User lacks permission to delete file uploads - **Referential Constraints**: File upload cannot be deleted due to active references - **Storage Errors**: Issues with file storage system during cleanup - **System Errors**: Database or system issues preventing deletion ## Recovery - **No Recovery**: Deleted file upload records cannot be restored through the API - **File Recovery**: Files in storage may be recoverable depending on storage configuration - **Backup Systems**: Recovery may be possible through system backups - **Audit Logs**: Deletion events are recorded for audit purposes * Delete a specific file-upload by fileUploadId */ async v4FileUploadsControllerDeleteFileUploadV4Raw(requestParameters, initOverrides) { if (requestParameters['fileUploadId'] == null) { throw new runtime.RequiredError('fileUploadId', 'Required parameter "fileUploadId" was null or undefined when calling v4FileUploadsControllerDeleteFileUploadV4().'); } const queryParameters = {}; const headerParameters = {}; if (this.configuration && this.configuration.apiKey) { headerParameters["x-api-key"] = await this.configuration.apiKey("x-api-key"); // x-api-key authentication } if (this.configuration && this.configuration.apiKey) { headerParameters["organization-id"] = await this.configuration.apiKey("organization-id"); // organization-id authentication } let urlPath = `/v4/file-uploads/{fileUploadId}`; urlPath = urlPath.replace(`{${"fileUploadId"}}`, encodeURIComponent(String(requestParameters['fileUploadId']))); const response = await this.request({ path: urlPath, method: 'DELETE', headers: headerParameters, query: queryParameters, }, initOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => V4FileUploadsDeleteFileUploadResponseDtoFromJSON(jsonValue)); } /** * # DELETE /v4/file-uploads/{fileUploadId} ## Overview Deletes an existing file upload from the system. This is a permanent operation that removes the file upload record and optionally the associated file from storage. ## Authentication - **Required**: Yes - **Security**: - `x-api-key` header - `organization-id` header ## Request Parameters ### Path Parameters | Parameter | Type | Required | Description | |-----------|------|----------|-------------| | `fileUploadId` | string | Yes | The unique identifier of the file upload to delete | ## Access Control - **Organization Scope**: File upload must belong to the authenticated user\'s organization - **File Upload Validation**: Invalid or non-existent file upload IDs will return a 404 error - **Data Privacy**: Only file uploads within the user\'s organization can be deleted ## Deletion Behavior The deletion operation: - **Permanent Removal**: File upload record is permanently deleted from the system - **File Handling**: Associated file in storage may need separate cleanup - **Cascade Effects**: Associated relationships and references are handled appropriately - **Immediate Effect**: Deletion is applied immediately - **Audit Trail**: Deletion is logged for audit and compliance purposes ## Response Structure Returns confirmation that the file upload was successfully deleted. ## Use Cases This endpoint is ideal for: - **Document Cleanup**: Remove outdated or unused file uploads - **Storage Management**: Free up storage space by removing unnecessary files - **Content Management**: Clean up document libraries and file collections - **Data Management**: Maintain clean file upload databases - **Compliance**: Delete file uploads upon user request or policy requirements - **Legal Requirements**: Remove documents as required by legal or regulatory obligations ## Important Considerations Before deleting a file upload, consider: - **Associated Content**: Check if file is referenced by properties, contracts, or other entities - **Storage Cleanup**: Consider whether the actual file needs to be removed from storage - **Backup Requirements**: Ensure proper backup if recovery might be needed - **Legal Implications**: Consider legal requirements for document retention - **User Notification**: Consider notifying relevant users of the deletion - **Alternative Actions**: Consider archiving instead of permanent deletion ## Error Handling Common errors include: - **File Upload Not Found**: File upload ID does not exist or belongs to different organization - **Permission Denied**: User lacks permission to delete file uploads - **Referential Constraints**: File upload cannot be deleted due to active references - **Storage Errors**: Issues with file storage system during cleanup - **System Errors**: Database or system issues preventing deletion ## Recovery - **No Recovery**: Deleted file upload records cannot be restored through the API - **File Recovery**: Files in storage may be recoverable depending on storage configuration - **Backup Systems**: Recovery may be possible through system backups - **Audit Logs**: Deletion events are recorded for audit purposes * Delete a specific file-upload by fileUploadId */ async v4FileUploadsControllerDeleteFileUploadV4(requestParameters, initOverrides) { const response = await this.v4FileUploadsControllerDeleteFileUploadV4Raw(requestParameters, initOverrides); return await response.value(); } /** * # GET /v4/file-uploads/{fileUploadId}/{columns} ## Overview Retrieves specific columns of a file upload by its unique identifier. This endpoint allows you to fetch only the data you need, improving performance and reducing bandwidth usage for file upload information. ## Authentication - **Required**: Yes - **Security**: - `x-api-key` header - `organization-id` header ## Request Parameters ### Path Parameters | Parameter | Type | Required | Description | |-----------|------|----------|-------------| | `fileUploadId` | string | Yes | The unique identifier of the file upload | | `columns` | string | Yes | Comma-separated list of column names to retrieve | ## Column Selection Available columns include: - **id**: File upload identifier - **filename**: Original filename - **url**: File URL - **size**: File size in bytes - **mimeType**: File MIME type - **category**: File category or classification - **uploadedAt**: Upload timestamp - **organizationId**: Organization identifier ### Examples - Single column: `filename` - Multiple columns: `filename,url,size` - All metadata: `filename,url,size,mimeType,category,uploadedAt` ## Use Cases This endpoint is ideal for: - **Performance Optimization**: Fetch only required data to reduce response size - **Bandwidth Conservation**: Minimize data transfer for mobile or limited connections - **Specific Data Needs**: Get only the columns needed for specific use cases - **List Views**: Fetch minimal data for displaying file upload lists - **Metadata Extraction**: Get specific metadata without full file upload details - **Report Generation**: Extract specific columns for reporting purposes * Get specific columns of a file-upload by fileUploadId */ async v4FileUploadsControllerGetFileUploadColumnsV4Raw(requestParameters, initOverrides) { if (requestParameters['columns'] == null) { throw new runtime.RequiredError('columns', 'Required parameter "columns" was null or undefined when calling v4FileUploadsControllerGetFileUploadColumnsV4().'); } if (requestParameters['fileUploadId'] == null) { throw new runtime.RequiredError('fileUploadId', 'Required parameter "fileUploadId" was null or undefined when calling v4FileUploadsControllerGetFileUploadColumnsV4().'); } const queryParameters = {}; const headerParameters = {}; if (this.configuration && this.configuration.apiKey) { headerParameters["x-api-key"] = await this.configuration.apiKey("x-api-key"); // x-api-key authentication } if (this.configuration && this.configuration.apiKey) { headerParameters["organization-id"] = await this.configuration.apiKey("organization-id"); // organization-id authentication } let urlPath = `/v4/file-uploads/{fileUploadId}/{columns}`; urlPath = urlPath.replace(`{${"columns"}}`, encodeURIComponent(String(requestParameters['columns']))); urlPath = urlPath.replace(`{${"fileUploadId"}}`, encodeURIComponent(String(requestParameters['fileUploadId']))); const response = await this.request({ path: urlPath, method: 'GET', headers: headerParameters, query: queryParameters, }, initOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => V4FileUploadsGetFileUploadColumnsResponseDtoFromJSON(jsonValue)); } /** * # GET /v4/file-uploads/{fileUploadId}/{columns} ## Overview Retrieves specific columns of a file upload by its unique identifier. This endpoint allows you to fetch only the data you need, improving performance and reducing bandwidth usage for file upload information. ## Authentication - **Required**: Yes - **Security**: - `x-api-key` header - `organization-id` header ## Request Parameters ### Path Parameters | Parameter | Type | Required | Description | |-----------|------|----------|-------------| | `fileUploadId` | string | Yes | The unique identifier of the file upload | | `columns` | string | Yes | Comma-separated list of column names to retrieve | ## Column Selection Available columns include: - **id**: File upload identifier - **filename**: Original filename - **url**: File URL - **size**: File size in bytes - **mimeType**: File MIME type - **category**: File category or classification - **uploadedAt**: Upload timestamp - **organizationId**: Organization identifier ### Examples - Single column: `filename` - Multiple columns: `filename,url,size` - All metadata: `filename,url,size,mimeType,category,uploadedAt` ## Use Cases This endpoint is ideal for: - **Performance Optimization**: Fetch only required data to reduce response size - **Bandwidth Conservation**: Minimize data transfer for mobile or limited connections - **Specific Data Needs**: Get only the columns needed for specific use cases - **List Views**: Fetch minimal data for displaying file upload lists - **Metadata Extraction**: Get specific metadata without full file upload details - **Report Generation**: Extract specific columns for reporting purposes * Get specific columns of a file-upload by fileUploadId */ async v4FileUploadsControllerGetFileUploadColumnsV4(requestParameters, initOverrides) { const response = await this.v4FileUploadsControllerGetFileUploadColumnsV4Raw(requestParameters, initOverrides); return await response.value(); } /** * # GET /v4/file-uploads/{fileUploadId} ## Overview Retrieves a specific file upload by its unique identifier. This endpoint provides detailed information about a single uploaded file or document, including metadata and access information. ## Authentication - **Required**: Yes - **Security**: - `x-api-key` header - `organization-id` header ## Request Parameters ### Path Parameters | Parameter | Type | Required | Description | |-----------|------|----------|-------------| | `fileUploadId` | string | Yes | The unique identifier of the file upload to retrieve | ### Query Parameters | Parameter | Type | Required | Description | |-----------|------|----------|-------------| | `viewId` | number | No | Optional view ID to apply specific column selection and formatting | ## Access Control - **Organization Scope**: Only file uploads within the authenticated user\'s organization are accessible - **File Upload Validation**: Invalid or non-existent file upload IDs will return a 404 error - **Data Privacy**: Sensitive file upload data is protected by organization boundaries ## Response Structure Returns detailed information about the specified file upload. ## Use Cases This endpoint is ideal for: - **File Upload Details**: Get complete information about a specific uploaded file - **Document Verification**: Verify file upload properties and metadata - **File Information**: Access file URLs, sizes, categories, and MIME types - **Property Documentation**: Retrieve specific property documents or contracts - **Content Management**: Get file details for editing, sharing, or display purposes - **Legal Document Access**: Access specific legal documents and contracts * Get a specific file-upload by fileUploadId */ async v4FileUploadsControllerGetFileUploadV4Raw(requestParameters, initOverrides) { if (requestParameters['fileUploadId'] == null) { throw new runtime.RequiredError('fileUploadId', 'Required parameter "fileUploadId" was null or undefined when calling v4FileUploadsControllerGetFileUploadV4().'); } const queryParameters = {}; if (requestParameters['viewId'] != null) { queryParameters['viewId'] = requestParameters['viewId']; } const headerParameters = {}; if (this.configuration && this.configuration.apiKey) { headerParameters["x-api-key"] = await this.configuration.apiKey("x-api-key"); // x-api-key authentication } if (this.configuration && this.configuration.apiKey) { headerParameters["organization-id"] = await this.configuration.apiKey("organization-id"); // organization-id authentication } let urlPath = `/v4/file-uploads/{fileUploadId}`; urlPath = urlPath.replace(`{${"fileUploadId"}}`, encodeURIComponent(String(requestParameters['fileUploadId']))); const response = await this.request({ path: urlPath, method: 'GET', headers: headerParameters, query: queryParameters, }, initOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => V4FileUploadsGetFileUploadResponseDtoFromJSON(jsonValue)); } /** * # GET /v4/file-uploads/{fileUploadId} ## Overview Retrieves a specific file upload by its unique identifier. This endpoint provides detailed information about a single uploaded file or document, including metadata and access information. ## Authentication - **Required**: Yes - **Security**: - `x-api-key` header - `organization-id` header ## Request Parameters ### Path Parameters | Parameter | Type | Required | Description | |-----------|------|----------|-------------| | `fileUploadId` | string | Yes | The unique identifier of the file upload to retrieve | ### Query Parameters | Parameter | Type | Required | Description | |-----------|------|----------|-------------| | `viewId` | number | No | Optional view ID to apply specific column selection and formatting | ## Access Control - **Organization Scope**: Only file uploads within the authenticated user\'s organization are accessible - **File Upload Validation**: Invalid or non-existent file upload IDs will return a 404 error - **Data Privacy**: Sensitive file upload data is protected by organization boundaries ## Response Structure Returns detailed information about the specified file upload. ## Use Cases This endpoint is ideal for: - **File Upload Details**: Get complete information about a specific uploaded file - **Document Verification**: Verify file upload properties and metadata - **File Information**: Access file URLs, sizes, categories, and MIME types - **Property Documentation**: Retrieve specific property documents or contracts - **Content Management**: Get file details for editing, sharing, or display purposes - **Legal Document Access**: Access specific legal documents and contracts * Get a specific file-upload by fileUploadId */ async v4FileUploadsControllerGetFileUploadV4(requestParameters, initOverrides) { const response = await this.v4FileUploadsControllerGetFileUploadV4Raw(requestParameters, initOverrides); return await response.value(); } /** * # GET /v4/file-uploads/viewId/{viewId} ## Overview Retrieves file uploads using a specific view configuration. Views define custom filtering, sorting, and column selection for file uploads, allowing for organized and consistent data presentation based on file types, categories, or business needs. ## Authentication - **Required**: Yes - **Security**: - `x-api-key` header - `organization-id` header ## Request Parameters ### Path Parameters | Parameter | Type | Required | Description | |-----------|------|----------|-------------| | `viewId` | number | Yes | The unique identifier of the view to apply | ### Query Parameters | Parameter | Type | Required | Description | |-----------|------|----------|-------------| | `limit` | number | No | Maximum number of file uploads to return (default: 20, max: 100) | | `offset` | number | No | Number of file uploads to skip for pagination (default: 0) | | `countOnly` | boolean | No | Return only the count without the actual data | ## View Configuration Views can define: - **Column Selection**: Specific columns to include in the response - **Filtering Rules**: Criteria for which file uploads to include (by category, file type, etc.) - **Sorting Options**: Default sorting for the results - **Access Controls**: Additional permission checks ## Use Cases This endpoint is ideal for: - **Document Libraries**: Display file uploads according to predefined library configurations - **Category Management**: Use views to organize different types of documents and files - **User Preferences**: Apply user-specific view settings for consistent experience - **Filtered Lists**: Show only relevant file uploads based on view criteria - **Dashboard Views**: Create specialized views for different dashboard sections - **Compliance Views**: Organize regulatory and compliance documents * Get file-uploads with a specific viewId */ async v4FileUploadsControllerGetFileUploadsInViewV4Raw(requestParameters, initOverrides) { if (requestParameters['viewId'] == null) { throw new runtime.RequiredError('viewId', 'Required parameter "viewId" was null or undefined when calling v4FileUploadsControllerGetFileUploadsInViewV4().'); } const queryParameters = {}; if (requestParameters['limit'] != null) { queryParameters['limit'] = requestParameters['limit']; } if (requestParameters['offset'] != null) { queryParameters['offset'] = requestParameters['offset']; } if (requestParameters['countOnly'] != null) { queryParameters['countOnly'] = requestParameters['countOnly']; } const headerParameters = {}; if (this.configuration && this.configuration.apiKey) { headerParameters["x-api-key"] = await this.configuration.apiKey("x-api-key"); // x-api-key authentication } if (this.configuration && this.configuration.apiKey) { headerParameters["organization-id"] = await this.configuration.apiKey("organization-id"); // organization-id authentication } let urlPath = `/v4/file-uploads/viewId/{viewId}`; urlPath = urlPath.replace(`{${"viewId"}}`, encodeURIComponent(String(requestParameters['viewId']))); const response = await this.request({ path: urlPath, method: 'GET', headers: headerParameters, query: queryParameters, }, initOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => V4FileUploadsGetFileUploadsInViewResponseDtoFromJSON(jsonValue)); } /** * # GET /v4/file-uploads/viewId/{viewId} ## Overview Retrieves file uploads using a specific view configuration. Views define custom filtering, sorting, and column selection for file uploads, allowing for organized and consistent data presentation based on file types, categories, or business needs. ## Authentication - **Required**: Yes - **Security**: - `x-api-key` header - `organization-id` header ## Request Parameters ### Path Parameters | Parameter | Type | Required | Description | |-----------|------|----------|-------------| | `viewId` | number | Yes | The unique identifier of the view to apply | ### Query Parameters | Parameter | Type | Required | Description | |-----------|------|----------|-------------| | `limit` | number | No | Maximum number of file uploads to return (default: 20, max: 100) | | `offset` | number | No | Number of file uploads to skip for pagination (default: 0) | | `countOnly` | boolean | No | Return only the count without the actual data | ## View Configuration Views can define: - **Column Selection**: Specific columns to include in the response - **Filtering Rules**: Criteria for which file uploads to include (by category, file type, etc.) - **Sorting Options**: Default sorting for the results - **Access Controls**: Additional permission checks ## Use Cases This endpoint is ideal for: - **Document Libraries**: Display file uploads according to predefined library configurations - **Category Management**: Use views to organize different types of documents and files - **User Preferences**: Apply user-specific view settings for consistent experience - **Filtered Lists**: Show only relevant file uploads based on view criteria - **Dashboard Views**: Create specialized views for different dashboard sections - **Compliance Views**: Organize regulatory and compliance documents * Get file-uploads with a specific viewId */ async v4FileUploadsControllerGetFileUploadsInViewV4(requestParameters, initOverrides) { const response = await this.v4FileUploadsControllerGetFileUploadsInViewV4Raw(requestParameters, initOverrides); return await response.value(); } /** * # GET /v4/file-uploads ## Overview Retrieves uploaded files and documents with optional filtering, sorting, and pagination capabilities. This endpoint provides access to all file assets uploaded for properties, contracts, legal documents, and other real estate content. ## Authentication - **Required**: Yes - **Security**: - `x-api-key` header - `organization-id` header ## Request Parameters ### Query Parameters | Parameter | Type | Required | Description | |-----------|------|----------|-------------| | `viewId` | number | No | Optional view ID to apply filters and column selection | | `limit` | number | No | Maximum number of uploads to return (default: 20, max: 100) | | `offset` | number | No | Number of uploads to skip for pagination (default: 0) | | `countOnly` | boolean | No | Return only the count of uploads without the actual data | ## Use Cases This endpoint is ideal for: - **Document Management**: Browse and manage uploaded documents and files - **Content Organization**: Organize file assets by type, category, or project - **Storage Analysis**: Monitor storage usage and file types - **Asset Discovery**: Find specific documents or files - **File Library**: Build document libraries for properties and projects - **Compliance**: Manage legal documents, contracts, and compliance files * Get file-uploads with optional viewId */ async v4FileUploadsControllerGetFileUploadsV4Raw(requestParameters, initOverrides) { const queryParameters = {}; if (requestParameters['viewId'] != null) { queryParameters['viewId'] = requestParameters['viewId']; } if (requestParameters['limit'] != null) { queryParameters['limit'] = requestParameters['limit']; } if (requestParameters['offset'] != null) { queryParameters['offset'] = requestParameters['offset']; } if (requestParameters['countOnly'] != null) { queryParameters['countOnly'] = requestParameters['countOnly']; } const headerParameters = {}; if (this.configuration && this.configuration.apiKey) { headerParameters["x-api-key"] = await this.configuration.apiKey("x-api-key"); // x-api-key authentication } if (this.configuration && this.configuration.apiKey) { headerParameters["organization-id"] = await this.configuration.apiKey("organization-id"); // organization-id authentication } let urlPath = `/v4/file-uploads`; const response = await this.request({ path: urlPath, method: 'GET', headers: headerParameters, query: queryParameters, }, initOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => V4FileUploadsGetFileUploadsResponseDtoFromJSON(jsonValue)); } /** * # GET /v4/file-uploads ## Overview Retrieves uploaded files and documents with optional filtering, sorting, and pagination capabilities. This endpoint provides access to all file assets uploaded for properties, contracts, legal documents, and other real estate content. ## Authentication - **Required**: Yes - **Security**: - `x-api-key` header - `organization-id` header ## Request Parameters ### Query Parameters | Parameter | Type | Required | Description | |-----------|------|----------|-------------| | `viewId` | number | No | Optional view ID to apply filters and column selection | | `limit` | number | No | Maximum number of uploads to return (default: 20, max: 100) | | `offset` | number | No | Number of uploads to skip for pagination (default: 0) | | `countOnly` | boolean | No | Return only the count of uploads without the actual data | ## Use Cases This endpoint is ideal for: - **Document Management**: Browse and manage uploaded documents and files - **Content Organization**: Organize file assets by type, category, or project - **Storage Analysis**: Monitor storage usage and file types - **Asset Discovery**: Find specific documents or files - **File Library**: Build document libraries for properties and projects - **Compliance**: Manage legal documents, contracts, and compliance files * Get file-uploads with optional viewId */ async v4FileUploadsControllerGetFileUploadsV4(requestParameters = {}, initOverrides) { const response = await this.v4FileUploadsControllerGetFileUploadsV4Raw(requestParameters, initOverrides); return await response.value(); } /** * Returns a temporary signed S3 URL for securely accessing the file. The URL expires after 1 hour. * Get signed URL for accessing a file */ async v4FileUploadsControllerGetSignedUrlV4Raw(requestParameters, initOverrides) { if (requestParameters['fileUploadId'] == null) { throw new runtime.RequiredError('fileUploadId', 'Required parameter "fileUploadId" was null or undefined when calling v4FileUploadsControllerGetSignedUrlV4().'); } const queryParameters = {}; const headerParameters = {}; if (this.configuration && this.configuration.apiKey) { headerParameters["x-api-key"] = await this.configuration.apiKey("x-api-key"); // x-api-key authentication } if (this.configuration && this.configuration.apiKey) { headerParameters["organization-id"] = await this.configuration.apiKey("organization-id"); // organization-id authentication } let urlPath = `/v4/file-uploads/{fileUploadId}/file`; urlPath = urlPath.replace(`{${"fileUploadId"}}`, encodeURIComponent(String(requestParameters['fileUploadId']))); const response = await this.request({ path: urlPath, method: 'GET', headers: headerParameters, query: queryParameters, }, initOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => V4FileUploadsGetSignedUrlResponseDtoFromJSON(jsonValue)); } /** * Returns a temporary signed S3 URL for securely accessing the file. The URL expires after 1 hour. * Get signed URL for accessing a file */ async v4FileUploadsControllerGetSignedUrlV4(requestParameters, initOverrides) { const response = await this.v4FileUploadsControllerGetSignedUrlV4Raw(requestParameters, initOverrides); return await response.value(); } /** * # PATCH /v4/file-uploads/{fileUploadId} ## Overview Updates metadata of an existing file upload. This endpoint allows you to modify file upload properties such as filename, URL, size, MIME type, and category without re-uploading the file. ## Authentication - **Required**: Yes - **Security**: - `x-api-key` header - `organization-id` header ## Request Parameters ### Path Parameters | Parameter | Type | Required | Description | |-----------|------|----------|-------------| | `fileUploadId` | string | Yes | The unique identifier of the file upload to update | ## Request Body The request body should contain the fields to update. All fields are optional. ### Optional Fields | Field | Type | Description | |-------|------|-------------| | `filename` | string | Original filename of the file | | `url` | string | URL where the file is stored | | `size` | number | Size of the file in bytes | | `mimeType` | string | MIME type of the file | | `category` | string | Category or classification of the file | ### Validation Rules - **URL**: Must be a valid URL format if provided - **Size**: Must be a positive number if provided - **Filename**: Must be a non-empty string if provided - **MIME Type**: Should follow standard MIME type format if provided - **Category**: Should be a valid category classification if provided ## Use Cases This endpoint is ideal for: - **Metadata Correction**: Fix incorrect filename, size, category, or MIME type information - **URL Updates**: Update file URLs when files are moved to different storage locations - **File Organization**: Update filenames and categories for better organization - **Content Management**: Maintain accurate file metadata for document management systems - **Migration Support**: Update file upload records during system migrations - **Category Management**: Reorganize files by updating category classifications ## Access Control - **Organization Scope**: File upload must belong to the authenticated user\'s organization - **Update Validation**: Only valid file upload IDs can be updated - **Data Privacy**: Updates are isolated to the user\'s organization * Update a specific file-upload by fileUploadId */ async v4FileUploadsControllerUpdateFileUploadV4Raw(requestParameters, initOverrides) { if (requestParameters['fileUploadId'] == null) { throw new runtime.RequiredError('fileUploadId', 'Required parameter "fileUploadId" was null or undefined when calling v4FileUploadsControllerUpdateFileUploadV4().'); } if (requestParameters['v4FileUploadsUpdateFileUploadBodyDto'] == null) { throw new runtime.RequiredError('v4FileUploadsUpdateFileUploadBodyDto', 'Required parameter "v4FileUploadsUpdateFileUploadBodyDto" was null or undefined when calling v4FileUploadsControllerUpdateFileUploadV4().'); } const queryParameters = {}; const headerParameters = {}; headerParameters['Content-Type'] = 'application/json'; if (this.configuration && this.configuration.apiKey) { headerParameters["x-api-key"] = await this.configuration.apiKey("x-api-key"); // x-api-key authentication } if (this.configuration && this.configuration.apiKey) { headerParameters["organization-id"] = await this.configuration.apiKey("organization-id"); // organization-id authentication } let urlPath = `/v4/file-uploads/{fileUploadId}`; urlPath = urlPath.replace(`{${"fileUploadId"}}`, encodeURIComponent(String(requestParameters['fileUploadId']))); const response = await this.request({ path: urlPath, method: 'PATCH', headers: headerParameters, query: queryParameters, body: V4FileUploadsUpdateFileUploadBodyDtoToJSON(requestParameters['v4FileUploadsUpdateFileUploadBodyDto']), }, initOverrides); return new runtime.JSONApiResponse(response, (jsonValue) => V4FileUploadsUpdateFileUploadResponseDtoFromJSON(jsonValue)); } /** * # PATCH /v4/file-uploads/{fileUploadId} ## Overview Updates metadata of an existing file upload. This endpoint allows you to modify file upload properties such as filename, URL, size, MIME type, and category without re-uploading the file. ## Authentication - **Required**: Yes - **Security**: - `x-api-key` header - `organization-id` header ## Request Parameters ### Path Parameters | Parameter | Type | Required | Description | |-----------|------|----------|-------------| | `fileUploadId` | string | Yes | The unique identifier of the file upload to update | ## Request Body The request body should contain the fields to update. All fields are optional. ### Optional Fields | Field | Type | Description | |-------|------|-------------| | `filename` | string | Original filename of the file | | `url` | string | URL where the file is stored | | `size` | number | Size of the file in bytes | | `mimeType` | string | MIME type of the file | | `category` | string | Category or classification of the file | ### Validation Rules - **URL**: Must be a valid URL format if provided - **Size**: Must be a positive number if provided - **Filename**: Must be a non-empty string if provided - **MIME Type**: Should follow standard MIME type format if provided - **Category**: Should be a valid category classification if provided ## Use Cases This endpoint is ideal for: - **Metadata Correction**: Fix incorrect filename, size, category, or MIME type information - **URL Updates**: Update file URLs when files are moved to different storage locations - **File Organization**: Update filenames and categories for better organization - **Content Management**: Maintain accurate file metadata for document management systems - **Migration Support**: Update file upload records during system migrations - **Category Management**: Reorganize files by updating category classifications ## Access Control - **Organization Scope**: File upload must belong to the authenticated user\'s organization - **Update Validation**: Only valid file upload IDs can be updated - **Data Privacy**: Updates are isolated to the user\'s organization * Update a specific file-upload by fileUploadId */ async v4FileUploadsControllerUpdateFileUploadV4(requestParameters, initOverrides) { const response = await this.v4FileUploadsControllerUpdateFileUploadV4Raw(requestParameters, initOverrides); return await response.value(); } } /** * @export * @enum {string} */ export var V4FileUploadsControllerCreateFileUploadV4Type; (function (V4FileUploadsControllerCreateFileUploadV4Type) { V4FileUploadsControllerCreateFileUploadV4Type["PropertyGeneral"] = "property.general"; V4FileUploadsControllerCreateFileUploadV4Type["CommentAttachment"] = "comment.attachment"; V4FileUploadsControllerCreateFileUploadV4Type["MessageAttachment"] = "message.attachment"; V4FileUploadsControllerCreateFileUploadV4Type["TransactionContract"] = "transaction.contract"; V4FileUploadsControllerCreateFileUploadV4Type["TransactionEmdReceipt"] = "transaction.emd_receipt"; V4FileUploadsControllerCreateFileUploadV4Type["TransactionAmendment"] = "transaction.amendment"; V4FileUploadsControllerCreateFileUploadV4Type["TransactionGeneral"] = "transaction.general"; V4FileUploadsControllerCreateFileUploadV4Type["InspectionGeneral"] = "inspection.general"; V4FileUploadsControllerCreateFileUploadV4Type["InspectionReport"] = "inspection.report"; V4FileUploadsControllerCreateFileUploadV4Type["RenovationGeneral"] = "renovation.general"; V4FileUploadsControllerCreateFileUploadV4Type["RentalListingGeneral"] = "rental_listing.general"; V4FileUploadsControllerCreateFileUploadV4Type["RentalListingPmWalkthrough"] = "rental_listing.pm_walkthrough"; V4FileUploadsControllerCreateFileUploadV4Type["WorkOrderGeneral"] = "work_order.general"; V4FileUploadsControllerCreateFileUploadV4Type["UpdateMedia"] = "update.media"; V4FileUploadsControllerCreateFileUploadV4Type["LeasingLeaseDocuments"] = "leasing.lease_documents"; V4FileUploadsControllerCreateFileUploadV4Type["LeasingHousingAuthorityDocuments"] = "leasing.housing_authority_documents"; })(V4FileUploadsControllerCreateFileUploadV4Type || (V4FileUploadsControllerCreateFileUploadV4Type = {}));