2025-08-21 22:15:11 +00:00
//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
// @dart=2.18
// ignore_for_file: unused_element, unused_import
// ignore_for_file: always_put_required_named_parameters_first
// ignore_for_file: constant_identifier_names
// ignore_for_file: lines_longer_than_80_chars
part of openapi . api ;
class AssetsApi {
AssetsApi ( [ ApiClient ? apiClient ] ) : apiClient = apiClient ? ? defaultApiClient ;
final ApiClient apiClient ;
2025-11-11 22:01:14 +00:00
/// Check bulk upload
2025-08-21 22:15:11 +00:00
///
2025-11-11 22:01:14 +00:00
/// Determine which assets have already been uploaded to the server based on their SHA1 checksums.
2025-08-21 22:15:11 +00:00
///
/// Note: This method returns the HTTP [Response].
///
/// Parameters:
///
/// * [AssetBulkUploadCheckDto] assetBulkUploadCheckDto (required):
Future < Response > checkBulkUploadWithHttpInfo ( AssetBulkUploadCheckDto assetBulkUploadCheckDto , ) async {
// ignore: prefer_const_declarations
final apiPath = r'/assets/bulk-upload-check' ;
// ignore: prefer_final_locals
Object ? postBody = assetBulkUploadCheckDto ;
final queryParams = < QueryParam > [ ] ;
final headerParams = < String , String > { } ;
final formParams = < String , String > { } ;
const contentTypes = < String > [ ' application/json ' ] ;
return apiClient . invokeAPI (
apiPath ,
' POST ' ,
queryParams ,
postBody ,
headerParams ,
formParams ,
contentTypes . isEmpty ? null : contentTypes . first ,
) ;
}
2025-11-11 22:01:14 +00:00
/// Check bulk upload
2025-08-21 22:15:11 +00:00
///
2025-11-11 22:01:14 +00:00
/// Determine which assets have already been uploaded to the server based on their SHA1 checksums.
2025-08-21 22:15:11 +00:00
///
/// Parameters:
///
/// * [AssetBulkUploadCheckDto] assetBulkUploadCheckDto (required):
Future < AssetBulkUploadCheckResponseDto ? > checkBulkUpload ( AssetBulkUploadCheckDto assetBulkUploadCheckDto , ) async {
final response = await checkBulkUploadWithHttpInfo ( assetBulkUploadCheckDto , ) ;
if ( response . statusCode > = HttpStatus . badRequest ) {
throw ApiException ( response . statusCode , await _decodeBodyBytes ( response ) ) ;
}
// When a remote server returns no body with a status of 204, we shall not decode it.
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
// FormatException when trying to decode an empty string.
if ( response . body . isNotEmpty & & response . statusCode ! = HttpStatus . noContent ) {
return await apiClient . deserializeAsync ( await _decodeBodyBytes ( response ) , ' AssetBulkUploadCheckResponseDto ' , ) as AssetBulkUploadCheckResponseDto ;
}
return null ;
}
2025-11-11 22:01:14 +00:00
/// Copy asset
///
/// Copy asset information like albums, tags, etc. from one asset to another.
2025-10-29 13:43:47 +00:00
///
/// Note: This method returns the HTTP [Response].
///
/// Parameters:
///
/// * [AssetCopyDto] assetCopyDto (required):
Future < Response > copyAssetWithHttpInfo ( AssetCopyDto assetCopyDto , ) async {
// ignore: prefer_const_declarations
final apiPath = r'/assets/copy' ;
// ignore: prefer_final_locals
Object ? postBody = assetCopyDto ;
final queryParams = < QueryParam > [ ] ;
final headerParams = < String , String > { } ;
final formParams = < String , String > { } ;
const contentTypes = < String > [ ' application/json ' ] ;
return apiClient . invokeAPI (
apiPath ,
' PUT ' ,
queryParams ,
postBody ,
headerParams ,
formParams ,
contentTypes . isEmpty ? null : contentTypes . first ,
) ;
}
2025-11-11 22:01:14 +00:00
/// Copy asset
///
/// Copy asset information like albums, tags, etc. from one asset to another.
2025-10-29 13:43:47 +00:00
///
/// Parameters:
///
/// * [AssetCopyDto] assetCopyDto (required):
Future < void > copyAsset ( AssetCopyDto assetCopyDto , ) async {
final response = await copyAssetWithHttpInfo ( assetCopyDto , ) ;
if ( response . statusCode > = HttpStatus . badRequest ) {
throw ApiException ( response . statusCode , await _decodeBodyBytes ( response ) ) ;
}
}
2025-11-11 22:01:14 +00:00
/// Delete asset metadata by key
///
/// Delete a specific metadata key-value pair associated with the specified asset.
2025-08-27 18:31:23 +00:00
///
/// Note: This method returns the HTTP [Response].
///
/// Parameters:
///
/// * [String] id (required):
2026-01-29 13:49:15 +00:00
/// Asset ID
2025-08-27 18:31:23 +00:00
///
2026-01-08 19:52:16 +00:00
/// * [String] key (required):
2026-01-29 13:49:15 +00:00
/// Metadata key
2026-01-08 19:52:16 +00:00
Future < Response > deleteAssetMetadataWithHttpInfo ( String id , String key , ) async {
2025-08-27 18:31:23 +00:00
// ignore: prefer_const_declarations
final apiPath = r'/assets/{id}/metadata/{key}'
. replaceAll ( ' {id} ' , id )
2026-01-08 19:52:16 +00:00
. replaceAll ( ' {key} ' , key ) ;
2025-08-27 18:31:23 +00:00
// ignore: prefer_final_locals
Object ? postBody ;
final queryParams = < QueryParam > [ ] ;
final headerParams = < String , String > { } ;
final formParams = < String , String > { } ;
const contentTypes = < String > [ ] ;
return apiClient . invokeAPI (
apiPath ,
' DELETE ' ,
queryParams ,
postBody ,
headerParams ,
formParams ,
contentTypes . isEmpty ? null : contentTypes . first ,
) ;
}
2025-11-11 22:01:14 +00:00
/// Delete asset metadata by key
///
/// Delete a specific metadata key-value pair associated with the specified asset.
2025-08-27 18:31:23 +00:00
///
/// Parameters:
///
/// * [String] id (required):
2026-01-29 13:49:15 +00:00
/// Asset ID
2025-08-27 18:31:23 +00:00
///
2026-01-08 19:52:16 +00:00
/// * [String] key (required):
2026-01-29 13:49:15 +00:00
/// Metadata key
2026-01-08 19:52:16 +00:00
Future < void > deleteAssetMetadata ( String id , String key , ) async {
2025-08-27 18:31:23 +00:00
final response = await deleteAssetMetadataWithHttpInfo ( id , key , ) ;
if ( response . statusCode > = HttpStatus . badRequest ) {
throw ApiException ( response . statusCode , await _decodeBodyBytes ( response ) ) ;
}
}
2025-11-11 22:01:14 +00:00
/// Delete assets
///
/// Deletes multiple assets at the same time.
2025-08-21 22:15:11 +00:00
///
/// Note: This method returns the HTTP [Response].
///
/// Parameters:
///
/// * [AssetBulkDeleteDto] assetBulkDeleteDto (required):
Future < Response > deleteAssetsWithHttpInfo ( AssetBulkDeleteDto assetBulkDeleteDto , ) async {
// ignore: prefer_const_declarations
final apiPath = r'/assets' ;
// ignore: prefer_final_locals
Object ? postBody = assetBulkDeleteDto ;
final queryParams = < QueryParam > [ ] ;
final headerParams = < String , String > { } ;
final formParams = < String , String > { } ;
const contentTypes = < String > [ ' application/json ' ] ;
return apiClient . invokeAPI (
apiPath ,
' DELETE ' ,
queryParams ,
postBody ,
headerParams ,
formParams ,
contentTypes . isEmpty ? null : contentTypes . first ,
) ;
}
2025-11-11 22:01:14 +00:00
/// Delete assets
///
/// Deletes multiple assets at the same time.
2025-08-21 22:15:11 +00:00
///
/// Parameters:
///
/// * [AssetBulkDeleteDto] assetBulkDeleteDto (required):
Future < void > deleteAssets ( AssetBulkDeleteDto assetBulkDeleteDto , ) async {
final response = await deleteAssetsWithHttpInfo ( assetBulkDeleteDto , ) ;
if ( response . statusCode > = HttpStatus . badRequest ) {
throw ApiException ( response . statusCode , await _decodeBodyBytes ( response ) ) ;
}
}
2026-01-08 19:52:16 +00:00
/// Delete asset metadata
///
/// Delete metadata key-value pairs for multiple assets.
///
/// Note: This method returns the HTTP [Response].
///
/// Parameters:
///
/// * [AssetMetadataBulkDeleteDto] assetMetadataBulkDeleteDto (required):
Future < Response > deleteBulkAssetMetadataWithHttpInfo ( AssetMetadataBulkDeleteDto assetMetadataBulkDeleteDto , ) async {
// ignore: prefer_const_declarations
final apiPath = r'/assets/metadata' ;
// ignore: prefer_final_locals
Object ? postBody = assetMetadataBulkDeleteDto ;
final queryParams = < QueryParam > [ ] ;
final headerParams = < String , String > { } ;
final formParams = < String , String > { } ;
const contentTypes = < String > [ ' application/json ' ] ;
return apiClient . invokeAPI (
apiPath ,
' DELETE ' ,
queryParams ,
postBody ,
headerParams ,
formParams ,
contentTypes . isEmpty ? null : contentTypes . first ,
) ;
}
/// Delete asset metadata
///
/// Delete metadata key-value pairs for multiple assets.
///
/// Parameters:
///
/// * [AssetMetadataBulkDeleteDto] assetMetadataBulkDeleteDto (required):
Future < void > deleteBulkAssetMetadata ( AssetMetadataBulkDeleteDto assetMetadataBulkDeleteDto , ) async {
final response = await deleteBulkAssetMetadataWithHttpInfo ( assetMetadataBulkDeleteDto , ) ;
if ( response . statusCode > = HttpStatus . badRequest ) {
throw ApiException ( response . statusCode , await _decodeBodyBytes ( response ) ) ;
}
}
2025-11-11 22:01:14 +00:00
/// Download original asset
///
/// Downloads the original file of the specified asset.
2025-08-21 22:15:11 +00:00
///
/// Note: This method returns the HTTP [Response].
///
/// Parameters:
///
/// * [String] id (required):
///
2026-01-09 22:59:52 +00:00
/// * [bool] edited:
2026-01-29 13:49:15 +00:00
/// Return edited asset if available
2026-01-09 22:59:52 +00:00
///
2025-08-21 22:15:11 +00:00
/// * [String] key:
///
/// * [String] slug:
2026-01-09 22:59:52 +00:00
Future < Response > downloadAssetWithHttpInfo ( String id , { bool ? edited , String ? key , String ? slug , } ) async {
2025-08-21 22:15:11 +00:00
// ignore: prefer_const_declarations
final apiPath = r'/assets/{id}/original'
. replaceAll ( ' {id} ' , id ) ;
// ignore: prefer_final_locals
Object ? postBody ;
final queryParams = < QueryParam > [ ] ;
final headerParams = < String , String > { } ;
final formParams = < String , String > { } ;
2026-01-09 22:59:52 +00:00
if ( edited ! = null ) {
queryParams . addAll ( _queryParams ( ' ' , ' edited ' , edited ) ) ;
}
2025-08-21 22:15:11 +00:00
if ( key ! = null ) {
queryParams . addAll ( _queryParams ( ' ' , ' key ' , key ) ) ;
}
if ( slug ! = null ) {
queryParams . addAll ( _queryParams ( ' ' , ' slug ' , slug ) ) ;
}
const contentTypes = < String > [ ] ;
return apiClient . invokeAPI (
apiPath ,
' GET ' ,
queryParams ,
postBody ,
headerParams ,
formParams ,
contentTypes . isEmpty ? null : contentTypes . first ,
) ;
}
2025-11-11 22:01:14 +00:00
/// Download original asset
///
/// Downloads the original file of the specified asset.
2025-08-21 22:15:11 +00:00
///
/// Parameters:
///
/// * [String] id (required):
///
2026-01-09 22:59:52 +00:00
/// * [bool] edited:
2026-01-29 13:49:15 +00:00
/// Return edited asset if available
2026-01-09 22:59:52 +00:00
///
2025-08-21 22:15:11 +00:00
/// * [String] key:
///
/// * [String] slug:
2026-01-09 22:59:52 +00:00
Future < MultipartFile ? > downloadAsset ( String id , { bool ? edited , String ? key , String ? slug , } ) async {
final response = await downloadAssetWithHttpInfo ( id , edited: edited , key: key , slug: slug , ) ;
2025-08-21 22:15:11 +00:00
if ( response . statusCode > = HttpStatus . badRequest ) {
throw ApiException ( response . statusCode , await _decodeBodyBytes ( response ) ) ;
}
// When a remote server returns no body with a status of 204, we shall not decode it.
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
// FormatException when trying to decode an empty string.
if ( response . body . isNotEmpty & & response . statusCode ! = HttpStatus . noContent ) {
return await apiClient . deserializeAsync ( await _decodeBodyBytes ( response ) , ' MultipartFile ' , ) as MultipartFile ;
}
return null ;
}
2026-01-09 22:59:52 +00:00
/// Apply edits to an existing asset
///
/// Apply a series of edit actions (crop, rotate, mirror) to the specified asset.
///
/// Note: This method returns the HTTP [Response].
///
/// Parameters:
///
/// * [String] id (required):
///
2026-02-23 20:57:57 +00:00
/// * [AssetEditsCreateDto] assetEditsCreateDto (required):
Future < Response > editAssetWithHttpInfo ( String id , AssetEditsCreateDto assetEditsCreateDto , ) async {
2026-01-09 22:59:52 +00:00
// ignore: prefer_const_declarations
final apiPath = r'/assets/{id}/edits'
. replaceAll ( ' {id} ' , id ) ;
// ignore: prefer_final_locals
2026-02-23 20:57:57 +00:00
Object ? postBody = assetEditsCreateDto ;
2026-01-09 22:59:52 +00:00
final queryParams = < QueryParam > [ ] ;
final headerParams = < String , String > { } ;
final formParams = < String , String > { } ;
const contentTypes = < String > [ ' application/json ' ] ;
return apiClient . invokeAPI (
apiPath ,
' PUT ' ,
queryParams ,
postBody ,
headerParams ,
formParams ,
contentTypes . isEmpty ? null : contentTypes . first ,
) ;
}
/// Apply edits to an existing asset
///
/// Apply a series of edit actions (crop, rotate, mirror) to the specified asset.
///
/// Parameters:
///
/// * [String] id (required):
///
2026-02-23 20:57:57 +00:00
/// * [AssetEditsCreateDto] assetEditsCreateDto (required):
Future < AssetEditsResponseDto ? > editAsset ( String id , AssetEditsCreateDto assetEditsCreateDto , ) async {
final response = await editAssetWithHttpInfo ( id , assetEditsCreateDto , ) ;
2026-01-09 22:59:52 +00:00
if ( response . statusCode > = HttpStatus . badRequest ) {
throw ApiException ( response . statusCode , await _decodeBodyBytes ( response ) ) ;
}
// When a remote server returns no body with a status of 204, we shall not decode it.
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
// FormatException when trying to decode an empty string.
if ( response . body . isNotEmpty & & response . statusCode ! = HttpStatus . noContent ) {
2026-02-23 20:57:57 +00:00
return await apiClient . deserializeAsync ( await _decodeBodyBytes ( response ) , ' AssetEditsResponseDto ' , ) as AssetEditsResponseDto ;
2026-01-09 22:59:52 +00:00
}
return null ;
}
/// Retrieve edits for an existing asset
///
/// Retrieve a series of edit actions (crop, rotate, mirror) associated with the specified asset.
///
/// Note: This method returns the HTTP [Response].
///
/// Parameters:
///
/// * [String] id (required):
Future < Response > getAssetEditsWithHttpInfo ( String id , ) async {
// ignore: prefer_const_declarations
final apiPath = r'/assets/{id}/edits'
. replaceAll ( ' {id} ' , id ) ;
// ignore: prefer_final_locals
Object ? postBody ;
final queryParams = < QueryParam > [ ] ;
final headerParams = < String , String > { } ;
final formParams = < String , String > { } ;
const contentTypes = < String > [ ] ;
return apiClient . invokeAPI (
apiPath ,
' GET ' ,
queryParams ,
postBody ,
headerParams ,
formParams ,
contentTypes . isEmpty ? null : contentTypes . first ,
) ;
}
/// Retrieve edits for an existing asset
///
/// Retrieve a series of edit actions (crop, rotate, mirror) associated with the specified asset.
///
/// Parameters:
///
/// * [String] id (required):
2026-02-23 20:57:57 +00:00
Future < AssetEditsResponseDto ? > getAssetEdits ( String id , ) async {
2026-01-09 22:59:52 +00:00
final response = await getAssetEditsWithHttpInfo ( id , ) ;
if ( response . statusCode > = HttpStatus . badRequest ) {
throw ApiException ( response . statusCode , await _decodeBodyBytes ( response ) ) ;
}
// When a remote server returns no body with a status of 204, we shall not decode it.
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
// FormatException when trying to decode an empty string.
if ( response . body . isNotEmpty & & response . statusCode ! = HttpStatus . noContent ) {
2026-02-23 20:57:57 +00:00
return await apiClient . deserializeAsync ( await _decodeBodyBytes ( response ) , ' AssetEditsResponseDto ' , ) as AssetEditsResponseDto ;
2026-01-09 22:59:52 +00:00
}
return null ;
}
2025-11-11 22:01:14 +00:00
/// Retrieve an asset
///
/// Retrieve detailed information about a specific asset.
2025-08-21 22:15:11 +00:00
///
/// Note: This method returns the HTTP [Response].
///
/// Parameters:
///
/// * [String] id (required):
///
/// * [String] key:
///
/// * [String] slug:
Future < Response > getAssetInfoWithHttpInfo ( String id , { String ? key , String ? slug , } ) async {
// ignore: prefer_const_declarations
final apiPath = r'/assets/{id}'
. replaceAll ( ' {id} ' , id ) ;
// ignore: prefer_final_locals
Object ? postBody ;
final queryParams = < QueryParam > [ ] ;
final headerParams = < String , String > { } ;
final formParams = < String , String > { } ;
if ( key ! = null ) {
queryParams . addAll ( _queryParams ( ' ' , ' key ' , key ) ) ;
}
if ( slug ! = null ) {
queryParams . addAll ( _queryParams ( ' ' , ' slug ' , slug ) ) ;
}
const contentTypes = < String > [ ] ;
return apiClient . invokeAPI (
apiPath ,
' GET ' ,
queryParams ,
postBody ,
headerParams ,
formParams ,
contentTypes . isEmpty ? null : contentTypes . first ,
) ;
}
2025-11-11 22:01:14 +00:00
/// Retrieve an asset
///
/// Retrieve detailed information about a specific asset.
2025-08-21 22:15:11 +00:00
///
/// Parameters:
///
/// * [String] id (required):
///
/// * [String] key:
///
/// * [String] slug:
Future < AssetResponseDto ? > getAssetInfo ( String id , { String ? key , String ? slug , } ) async {
final response = await getAssetInfoWithHttpInfo ( id , key: key , slug: slug , ) ;
if ( response . statusCode > = HttpStatus . badRequest ) {
throw ApiException ( response . statusCode , await _decodeBodyBytes ( response ) ) ;
}
// When a remote server returns no body with a status of 204, we shall not decode it.
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
// FormatException when trying to decode an empty string.
if ( response . body . isNotEmpty & & response . statusCode ! = HttpStatus . noContent ) {
return await apiClient . deserializeAsync ( await _decodeBodyBytes ( response ) , ' AssetResponseDto ' , ) as AssetResponseDto ;
}
return null ;
}
2025-11-11 22:01:14 +00:00
/// Get asset metadata
///
/// Retrieve all metadata key-value pairs associated with the specified asset.
2025-08-27 18:31:23 +00:00
///
/// Note: This method returns the HTTP [Response].
///
/// Parameters:
///
/// * [String] id (required):
Future < Response > getAssetMetadataWithHttpInfo ( String id , ) async {
// ignore: prefer_const_declarations
final apiPath = r'/assets/{id}/metadata'
. replaceAll ( ' {id} ' , id ) ;
// ignore: prefer_final_locals
Object ? postBody ;
final queryParams = < QueryParam > [ ] ;
final headerParams = < String , String > { } ;
final formParams = < String , String > { } ;
const contentTypes = < String > [ ] ;
return apiClient . invokeAPI (
apiPath ,
' GET ' ,
queryParams ,
postBody ,
headerParams ,
formParams ,
contentTypes . isEmpty ? null : contentTypes . first ,
) ;
}
2025-11-11 22:01:14 +00:00
/// Get asset metadata
///
/// Retrieve all metadata key-value pairs associated with the specified asset.
2025-08-27 18:31:23 +00:00
///
/// Parameters:
///
/// * [String] id (required):
Future < List < AssetMetadataResponseDto > ? > getAssetMetadata ( String id , ) async {
final response = await getAssetMetadataWithHttpInfo ( id , ) ;
if ( response . statusCode > = HttpStatus . badRequest ) {
throw ApiException ( response . statusCode , await _decodeBodyBytes ( response ) ) ;
}
// When a remote server returns no body with a status of 204, we shall not decode it.
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
// FormatException when trying to decode an empty string.
if ( response . body . isNotEmpty & & response . statusCode ! = HttpStatus . noContent ) {
final responseBody = await _decodeBodyBytes ( response ) ;
return ( await apiClient . deserializeAsync ( responseBody , ' List<AssetMetadataResponseDto> ' ) as List )
. cast < AssetMetadataResponseDto > ( )
. toList ( growable: false ) ;
}
return null ;
}
2025-11-11 22:01:14 +00:00
/// Retrieve asset metadata by key
///
/// Retrieve the value of a specific metadata key associated with the specified asset.
2025-08-27 18:31:23 +00:00
///
/// Note: This method returns the HTTP [Response].
///
/// Parameters:
///
/// * [String] id (required):
2026-01-29 13:49:15 +00:00
/// Asset ID
2025-08-27 18:31:23 +00:00
///
2026-01-08 19:52:16 +00:00
/// * [String] key (required):
2026-01-29 13:49:15 +00:00
/// Metadata key
2026-01-08 19:52:16 +00:00
Future < Response > getAssetMetadataByKeyWithHttpInfo ( String id , String key , ) async {
2025-08-27 18:31:23 +00:00
// ignore: prefer_const_declarations
final apiPath = r'/assets/{id}/metadata/{key}'
. replaceAll ( ' {id} ' , id )
2026-01-08 19:52:16 +00:00
. replaceAll ( ' {key} ' , key ) ;
2025-08-27 18:31:23 +00:00
// ignore: prefer_final_locals
Object ? postBody ;
final queryParams = < QueryParam > [ ] ;
final headerParams = < String , String > { } ;
final formParams = < String , String > { } ;
const contentTypes = < String > [ ] ;
return apiClient . invokeAPI (
apiPath ,
' GET ' ,
queryParams ,
postBody ,
headerParams ,
formParams ,
contentTypes . isEmpty ? null : contentTypes . first ,
) ;
}
2025-11-11 22:01:14 +00:00
/// Retrieve asset metadata by key
///
/// Retrieve the value of a specific metadata key associated with the specified asset.
2025-08-27 18:31:23 +00:00
///
/// Parameters:
///
/// * [String] id (required):
2026-01-29 13:49:15 +00:00
/// Asset ID
2025-08-27 18:31:23 +00:00
///
2026-01-08 19:52:16 +00:00
/// * [String] key (required):
2026-01-29 13:49:15 +00:00
/// Metadata key
2026-01-08 19:52:16 +00:00
Future < AssetMetadataResponseDto ? > getAssetMetadataByKey ( String id , String key , ) async {
2025-08-27 18:31:23 +00:00
final response = await getAssetMetadataByKeyWithHttpInfo ( id , key , ) ;
if ( response . statusCode > = HttpStatus . badRequest ) {
throw ApiException ( response . statusCode , await _decodeBodyBytes ( response ) ) ;
}
// When a remote server returns no body with a status of 204, we shall not decode it.
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
// FormatException when trying to decode an empty string.
if ( response . body . isNotEmpty & & response . statusCode ! = HttpStatus . noContent ) {
return await apiClient . deserializeAsync ( await _decodeBodyBytes ( response ) , ' AssetMetadataResponseDto ' , ) as AssetMetadataResponseDto ;
}
return null ;
}
2025-11-11 22:01:14 +00:00
/// Retrieve asset OCR data
///
/// Retrieve all OCR (Optical Character Recognition) data associated with the specified asset.
2025-10-28 20:57:03 +00:00
///
/// Note: This method returns the HTTP [Response].
///
/// Parameters:
///
/// * [String] id (required):
Future < Response > getAssetOcrWithHttpInfo ( String id , ) async {
// ignore: prefer_const_declarations
final apiPath = r'/assets/{id}/ocr'
. replaceAll ( ' {id} ' , id ) ;
// ignore: prefer_final_locals
Object ? postBody ;
final queryParams = < QueryParam > [ ] ;
final headerParams = < String , String > { } ;
final formParams = < String , String > { } ;
const contentTypes = < String > [ ] ;
return apiClient . invokeAPI (
apiPath ,
' GET ' ,
queryParams ,
postBody ,
headerParams ,
formParams ,
contentTypes . isEmpty ? null : contentTypes . first ,
) ;
}
2025-11-11 22:01:14 +00:00
/// Retrieve asset OCR data
///
/// Retrieve all OCR (Optical Character Recognition) data associated with the specified asset.
2025-10-28 20:57:03 +00:00
///
/// Parameters:
///
/// * [String] id (required):
Future < List < AssetOcrResponseDto > ? > getAssetOcr ( String id , ) async {
final response = await getAssetOcrWithHttpInfo ( id , ) ;
if ( response . statusCode > = HttpStatus . badRequest ) {
throw ApiException ( response . statusCode , await _decodeBodyBytes ( response ) ) ;
}
// When a remote server returns no body with a status of 204, we shall not decode it.
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
// FormatException when trying to decode an empty string.
if ( response . body . isNotEmpty & & response . statusCode ! = HttpStatus . noContent ) {
final responseBody = await _decodeBodyBytes ( response ) ;
return ( await apiClient . deserializeAsync ( responseBody , ' List<AssetOcrResponseDto> ' ) as List )
. cast < AssetOcrResponseDto > ( )
. toList ( growable: false ) ;
}
return null ;
}
2025-11-11 22:01:14 +00:00
/// Get asset statistics
///
/// Retrieve various statistics about the assets owned by the authenticated user.
2025-08-21 22:15:11 +00:00
///
/// Note: This method returns the HTTP [Response].
///
/// Parameters:
///
/// * [bool] isFavorite:
2026-01-29 13:49:15 +00:00
/// Filter by favorite status
2025-08-21 22:15:11 +00:00
///
/// * [bool] isTrashed:
2026-01-29 13:49:15 +00:00
/// Filter by trash status
2025-08-21 22:15:11 +00:00
///
/// * [AssetVisibility] visibility:
Future < Response > getAssetStatisticsWithHttpInfo ( { bool ? isFavorite , bool ? isTrashed , AssetVisibility ? visibility , } ) async {
// ignore: prefer_const_declarations
final apiPath = r'/assets/statistics' ;
// ignore: prefer_final_locals
Object ? postBody ;
final queryParams = < QueryParam > [ ] ;
final headerParams = < String , String > { } ;
final formParams = < String , String > { } ;
if ( isFavorite ! = null ) {
queryParams . addAll ( _queryParams ( ' ' , ' isFavorite ' , isFavorite ) ) ;
}
if ( isTrashed ! = null ) {
queryParams . addAll ( _queryParams ( ' ' , ' isTrashed ' , isTrashed ) ) ;
}
if ( visibility ! = null ) {
queryParams . addAll ( _queryParams ( ' ' , ' visibility ' , visibility ) ) ;
}
const contentTypes = < String > [ ] ;
return apiClient . invokeAPI (
apiPath ,
' GET ' ,
queryParams ,
postBody ,
headerParams ,
formParams ,
contentTypes . isEmpty ? null : contentTypes . first ,
) ;
}
2025-11-11 22:01:14 +00:00
/// Get asset statistics
///
/// Retrieve various statistics about the assets owned by the authenticated user.
2025-08-21 22:15:11 +00:00
///
/// Parameters:
///
/// * [bool] isFavorite:
2026-01-29 13:49:15 +00:00
/// Filter by favorite status
2025-08-21 22:15:11 +00:00
///
/// * [bool] isTrashed:
2026-01-29 13:49:15 +00:00
/// Filter by trash status
2025-08-21 22:15:11 +00:00
///
/// * [AssetVisibility] visibility:
Future < AssetStatsResponseDto ? > getAssetStatistics ( { bool ? isFavorite , bool ? isTrashed , AssetVisibility ? visibility , } ) async {
final response = await getAssetStatisticsWithHttpInfo ( isFavorite: isFavorite , isTrashed: isTrashed , visibility: visibility , ) ;
if ( response . statusCode > = HttpStatus . badRequest ) {
throw ApiException ( response . statusCode , await _decodeBodyBytes ( response ) ) ;
}
// When a remote server returns no body with a status of 204, we shall not decode it.
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
// FormatException when trying to decode an empty string.
if ( response . body . isNotEmpty & & response . statusCode ! = HttpStatus . noContent ) {
return await apiClient . deserializeAsync ( await _decodeBodyBytes ( response ) , ' AssetStatsResponseDto ' , ) as AssetStatsResponseDto ;
}
return null ;
}
2025-11-11 22:01:14 +00:00
/// Play asset video
///
/// Streams the video file for the specified asset. This endpoint also supports byte range requests.
2025-08-21 22:15:11 +00:00
///
/// Note: This method returns the HTTP [Response].
///
/// Parameters:
///
/// * [String] id (required):
///
/// * [String] key:
///
/// * [String] slug:
Future < Response > playAssetVideoWithHttpInfo ( String id , { String ? key , String ? slug , } ) async {
// ignore: prefer_const_declarations
final apiPath = r'/assets/{id}/video/playback'
. replaceAll ( ' {id} ' , id ) ;
// ignore: prefer_final_locals
Object ? postBody ;
final queryParams = < QueryParam > [ ] ;
final headerParams = < String , String > { } ;
final formParams = < String , String > { } ;
if ( key ! = null ) {
queryParams . addAll ( _queryParams ( ' ' , ' key ' , key ) ) ;
}
if ( slug ! = null ) {
queryParams . addAll ( _queryParams ( ' ' , ' slug ' , slug ) ) ;
}
const contentTypes = < String > [ ] ;
return apiClient . invokeAPI (
apiPath ,
' GET ' ,
queryParams ,
postBody ,
headerParams ,
formParams ,
contentTypes . isEmpty ? null : contentTypes . first ,
) ;
}
2025-11-11 22:01:14 +00:00
/// Play asset video
///
/// Streams the video file for the specified asset. This endpoint also supports byte range requests.
2025-08-21 22:15:11 +00:00
///
/// Parameters:
///
/// * [String] id (required):
///
/// * [String] key:
///
/// * [String] slug:
Future < MultipartFile ? > playAssetVideo ( String id , { String ? key , String ? slug , } ) async {
final response = await playAssetVideoWithHttpInfo ( id , key: key , slug: slug , ) ;
if ( response . statusCode > = HttpStatus . badRequest ) {
throw ApiException ( response . statusCode , await _decodeBodyBytes ( response ) ) ;
}
// When a remote server returns no body with a status of 204, we shall not decode it.
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
// FormatException when trying to decode an empty string.
if ( response . body . isNotEmpty & & response . statusCode ! = HttpStatus . noContent ) {
return await apiClient . deserializeAsync ( await _decodeBodyBytes ( response ) , ' MultipartFile ' , ) as MultipartFile ;
}
return null ;
}
2026-01-09 22:59:52 +00:00
/// Remove edits from an existing asset
///
/// Removes all edit actions (crop, rotate, mirror) associated with the specified asset.
///
/// Note: This method returns the HTTP [Response].
///
/// Parameters:
///
/// * [String] id (required):
Future < Response > removeAssetEditsWithHttpInfo ( String id , ) async {
// ignore: prefer_const_declarations
final apiPath = r'/assets/{id}/edits'
. replaceAll ( ' {id} ' , id ) ;
// ignore: prefer_final_locals
Object ? postBody ;
final queryParams = < QueryParam > [ ] ;
final headerParams = < String , String > { } ;
final formParams = < String , String > { } ;
const contentTypes = < String > [ ] ;
return apiClient . invokeAPI (
apiPath ,
' DELETE ' ,
queryParams ,
postBody ,
headerParams ,
formParams ,
contentTypes . isEmpty ? null : contentTypes . first ,
) ;
}
/// Remove edits from an existing asset
///
/// Removes all edit actions (crop, rotate, mirror) associated with the specified asset.
///
/// Parameters:
///
/// * [String] id (required):
Future < void > removeAssetEdits ( String id , ) async {
final response = await removeAssetEditsWithHttpInfo ( id , ) ;
if ( response . statusCode > = HttpStatus . badRequest ) {
throw ApiException ( response . statusCode , await _decodeBodyBytes ( response ) ) ;
}
}
2025-11-11 22:01:14 +00:00
/// Run an asset job
///
/// Run a specific job on a set of assets.
///
/// Note: This method returns the HTTP [Response].
///
2025-08-21 22:15:11 +00:00
/// Parameters:
///
/// * [AssetJobsDto] assetJobsDto (required):
Future < Response > runAssetJobsWithHttpInfo ( AssetJobsDto assetJobsDto , ) async {
// ignore: prefer_const_declarations
final apiPath = r'/assets/jobs' ;
// ignore: prefer_final_locals
Object ? postBody = assetJobsDto ;
final queryParams = < QueryParam > [ ] ;
final headerParams = < String , String > { } ;
final formParams = < String , String > { } ;
const contentTypes = < String > [ ' application/json ' ] ;
return apiClient . invokeAPI (
apiPath ,
' POST ' ,
queryParams ,
postBody ,
headerParams ,
formParams ,
contentTypes . isEmpty ? null : contentTypes . first ,
) ;
}
2025-11-11 22:01:14 +00:00
/// Run an asset job
///
/// Run a specific job on a set of assets.
///
2025-08-21 22:15:11 +00:00
/// Parameters:
///
/// * [AssetJobsDto] assetJobsDto (required):
Future < void > runAssetJobs ( AssetJobsDto assetJobsDto , ) async {
final response = await runAssetJobsWithHttpInfo ( assetJobsDto , ) ;
if ( response . statusCode > = HttpStatus . badRequest ) {
throw ApiException ( response . statusCode , await _decodeBodyBytes ( response ) ) ;
}
}
2025-11-11 22:01:14 +00:00
/// Update an asset
///
/// Update information of a specific asset.
2025-08-21 22:15:11 +00:00
///
/// Note: This method returns the HTTP [Response].
///
/// Parameters:
///
/// * [String] id (required):
///
/// * [UpdateAssetDto] updateAssetDto (required):
Future < Response > updateAssetWithHttpInfo ( String id , UpdateAssetDto updateAssetDto , ) async {
// ignore: prefer_const_declarations
final apiPath = r'/assets/{id}'
. replaceAll ( ' {id} ' , id ) ;
// ignore: prefer_final_locals
Object ? postBody = updateAssetDto ;
final queryParams = < QueryParam > [ ] ;
final headerParams = < String , String > { } ;
final formParams = < String , String > { } ;
const contentTypes = < String > [ ' application/json ' ] ;
return apiClient . invokeAPI (
apiPath ,
' PUT ' ,
queryParams ,
postBody ,
headerParams ,
formParams ,
contentTypes . isEmpty ? null : contentTypes . first ,
) ;
}
2025-11-11 22:01:14 +00:00
/// Update an asset
///
/// Update information of a specific asset.
2025-08-21 22:15:11 +00:00
///
/// Parameters:
///
/// * [String] id (required):
///
/// * [UpdateAssetDto] updateAssetDto (required):
Future < AssetResponseDto ? > updateAsset ( String id , UpdateAssetDto updateAssetDto , ) async {
final response = await updateAssetWithHttpInfo ( id , updateAssetDto , ) ;
if ( response . statusCode > = HttpStatus . badRequest ) {
throw ApiException ( response . statusCode , await _decodeBodyBytes ( response ) ) ;
}
// When a remote server returns no body with a status of 204, we shall not decode it.
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
// FormatException when trying to decode an empty string.
if ( response . body . isNotEmpty & & response . statusCode ! = HttpStatus . noContent ) {
return await apiClient . deserializeAsync ( await _decodeBodyBytes ( response ) , ' AssetResponseDto ' , ) as AssetResponseDto ;
}
return null ;
}
2025-11-11 22:01:14 +00:00
/// Update asset metadata
///
/// Update or add metadata key-value pairs for the specified asset.
2025-08-27 18:31:23 +00:00
///
/// Note: This method returns the HTTP [Response].
///
/// Parameters:
///
/// * [String] id (required):
///
/// * [AssetMetadataUpsertDto] assetMetadataUpsertDto (required):
Future < Response > updateAssetMetadataWithHttpInfo ( String id , AssetMetadataUpsertDto assetMetadataUpsertDto , ) async {
// ignore: prefer_const_declarations
final apiPath = r'/assets/{id}/metadata'
. replaceAll ( ' {id} ' , id ) ;
// ignore: prefer_final_locals
Object ? postBody = assetMetadataUpsertDto ;
final queryParams = < QueryParam > [ ] ;
final headerParams = < String , String > { } ;
final formParams = < String , String > { } ;
const contentTypes = < String > [ ' application/json ' ] ;
return apiClient . invokeAPI (
apiPath ,
' PUT ' ,
queryParams ,
postBody ,
headerParams ,
formParams ,
contentTypes . isEmpty ? null : contentTypes . first ,
) ;
}
2025-11-11 22:01:14 +00:00
/// Update asset metadata
///
/// Update or add metadata key-value pairs for the specified asset.
2025-08-27 18:31:23 +00:00
///
/// Parameters:
///
/// * [String] id (required):
///
/// * [AssetMetadataUpsertDto] assetMetadataUpsertDto (required):
Future < List < AssetMetadataResponseDto > ? > updateAssetMetadata ( String id , AssetMetadataUpsertDto assetMetadataUpsertDto , ) async {
final response = await updateAssetMetadataWithHttpInfo ( id , assetMetadataUpsertDto , ) ;
if ( response . statusCode > = HttpStatus . badRequest ) {
throw ApiException ( response . statusCode , await _decodeBodyBytes ( response ) ) ;
}
// When a remote server returns no body with a status of 204, we shall not decode it.
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
// FormatException when trying to decode an empty string.
if ( response . body . isNotEmpty & & response . statusCode ! = HttpStatus . noContent ) {
final responseBody = await _decodeBodyBytes ( response ) ;
return ( await apiClient . deserializeAsync ( responseBody , ' List<AssetMetadataResponseDto> ' ) as List )
. cast < AssetMetadataResponseDto > ( )
. toList ( growable: false ) ;
}
return null ;
}
2025-11-11 22:01:14 +00:00
/// Update assets
///
/// Updates multiple assets at the same time.
2025-08-21 22:15:11 +00:00
///
/// Note: This method returns the HTTP [Response].
///
/// Parameters:
///
/// * [AssetBulkUpdateDto] assetBulkUpdateDto (required):
Future < Response > updateAssetsWithHttpInfo ( AssetBulkUpdateDto assetBulkUpdateDto , ) async {
// ignore: prefer_const_declarations
final apiPath = r'/assets' ;
// ignore: prefer_final_locals
Object ? postBody = assetBulkUpdateDto ;
final queryParams = < QueryParam > [ ] ;
final headerParams = < String , String > { } ;
final formParams = < String , String > { } ;
const contentTypes = < String > [ ' application/json ' ] ;
return apiClient . invokeAPI (
apiPath ,
' PUT ' ,
queryParams ,
postBody ,
headerParams ,
formParams ,
contentTypes . isEmpty ? null : contentTypes . first ,
) ;
}
2025-11-11 22:01:14 +00:00
/// Update assets
///
/// Updates multiple assets at the same time.
2025-08-21 22:15:11 +00:00
///
/// Parameters:
///
/// * [AssetBulkUpdateDto] assetBulkUpdateDto (required):
Future < void > updateAssets ( AssetBulkUpdateDto assetBulkUpdateDto , ) async {
final response = await updateAssetsWithHttpInfo ( assetBulkUpdateDto , ) ;
if ( response . statusCode > = HttpStatus . badRequest ) {
throw ApiException ( response . statusCode , await _decodeBodyBytes ( response ) ) ;
}
}
2026-01-08 19:52:16 +00:00
/// Upsert asset metadata
///
/// Upsert metadata key-value pairs for multiple assets.
///
/// Note: This method returns the HTTP [Response].
///
/// Parameters:
///
/// * [AssetMetadataBulkUpsertDto] assetMetadataBulkUpsertDto (required):
Future < Response > updateBulkAssetMetadataWithHttpInfo ( AssetMetadataBulkUpsertDto assetMetadataBulkUpsertDto , ) async {
// ignore: prefer_const_declarations
final apiPath = r'/assets/metadata' ;
// ignore: prefer_final_locals
Object ? postBody = assetMetadataBulkUpsertDto ;
final queryParams = < QueryParam > [ ] ;
final headerParams = < String , String > { } ;
final formParams = < String , String > { } ;
const contentTypes = < String > [ ' application/json ' ] ;
return apiClient . invokeAPI (
apiPath ,
' PUT ' ,
queryParams ,
postBody ,
headerParams ,
formParams ,
contentTypes . isEmpty ? null : contentTypes . first ,
) ;
}
/// Upsert asset metadata
///
/// Upsert metadata key-value pairs for multiple assets.
///
/// Parameters:
///
/// * [AssetMetadataBulkUpsertDto] assetMetadataBulkUpsertDto (required):
Future < List < AssetMetadataBulkResponseDto > ? > updateBulkAssetMetadata ( AssetMetadataBulkUpsertDto assetMetadataBulkUpsertDto , ) async {
final response = await updateBulkAssetMetadataWithHttpInfo ( assetMetadataBulkUpsertDto , ) ;
if ( response . statusCode > = HttpStatus . badRequest ) {
throw ApiException ( response . statusCode , await _decodeBodyBytes ( response ) ) ;
}
// When a remote server returns no body with a status of 204, we shall not decode it.
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
// FormatException when trying to decode an empty string.
if ( response . body . isNotEmpty & & response . statusCode ! = HttpStatus . noContent ) {
final responseBody = await _decodeBodyBytes ( response ) ;
return ( await apiClient . deserializeAsync ( responseBody , ' List<AssetMetadataBulkResponseDto> ' ) as List )
. cast < AssetMetadataBulkResponseDto > ( )
. toList ( growable: false ) ;
}
return null ;
}
2025-11-11 22:01:14 +00:00
/// Upload asset
///
/// Uploads a new asset to the server.
2025-08-21 22:15:11 +00:00
///
/// Note: This method returns the HTTP [Response].
///
/// Parameters:
///
/// * [MultipartFile] assetData (required):
2026-01-29 13:49:15 +00:00
/// Asset file data
2025-08-21 22:15:11 +00:00
///
/// * [DateTime] fileCreatedAt (required):
2026-01-29 13:49:15 +00:00
/// File creation date
2025-08-21 22:15:11 +00:00
///
/// * [DateTime] fileModifiedAt (required):
2026-01-29 13:49:15 +00:00
/// File modification date
2025-08-21 22:15:11 +00:00
///
/// * [String] key:
///
/// * [String] slug:
///
/// * [String] xImmichChecksum:
/// sha1 checksum that can be used for duplicate detection before the file is uploaded
///
/// * [String] duration:
2026-01-29 13:49:15 +00:00
/// Duration (for videos)
2025-08-21 22:15:11 +00:00
///
/// * [String] filename:
2026-01-29 13:49:15 +00:00
/// Filename
2025-08-21 22:15:11 +00:00
///
/// * [bool] isFavorite:
2026-01-29 13:49:15 +00:00
/// Mark as favorite
2025-08-21 22:15:11 +00:00
///
/// * [String] livePhotoVideoId:
2026-01-29 13:49:15 +00:00
/// Live photo video ID
2025-08-21 22:15:11 +00:00
///
2026-01-08 22:01:25 +00:00
/// * [List<AssetMetadataUpsertItemDto>] metadata:
2026-01-29 13:49:15 +00:00
/// Asset metadata items
2026-01-08 22:01:25 +00:00
///
2025-08-21 22:15:11 +00:00
/// * [MultipartFile] sidecarData:
2026-01-29 13:49:15 +00:00
/// Sidecar file data
2025-08-21 22:15:11 +00:00
///
/// * [AssetVisibility] visibility:
2026-04-15 19:00:33 +00:00
Future < Response > uploadAssetWithHttpInfo ( MultipartFile assetData , DateTime fileCreatedAt , DateTime fileModifiedAt , { String ? key , String ? slug , String ? xImmichChecksum , String ? duration , String ? filename , bool ? isFavorite , String ? livePhotoVideoId , List < AssetMetadataUpsertItemDto > ? metadata , MultipartFile ? sidecarData , AssetVisibility ? visibility , } ) async {
2025-08-21 22:15:11 +00:00
// ignore: prefer_const_declarations
final apiPath = r'/assets' ;
// ignore: prefer_final_locals
Object ? postBody ;
final queryParams = < QueryParam > [ ] ;
final headerParams = < String , String > { } ;
final formParams = < String , String > { } ;
if ( key ! = null ) {
queryParams . addAll ( _queryParams ( ' ' , ' key ' , key ) ) ;
}
if ( slug ! = null ) {
queryParams . addAll ( _queryParams ( ' ' , ' slug ' , slug ) ) ;
}
if ( xImmichChecksum ! = null ) {
headerParams [ r'x-immich-checksum' ] = parameterToString ( xImmichChecksum ) ;
}
const contentTypes = < String > [ ' multipart/form-data ' ] ;
bool hasFields = false ;
final mp = MultipartRequest ( ' POST ' , Uri . parse ( apiPath ) ) ;
if ( assetData ! = null ) {
hasFields = true ;
mp . fields [ r'assetData' ] = assetData . field ;
mp . files . add ( assetData ) ;
}
if ( duration ! = null ) {
hasFields = true ;
mp . fields [ r'duration' ] = parameterToString ( duration ) ;
}
if ( fileCreatedAt ! = null ) {
hasFields = true ;
mp . fields [ r'fileCreatedAt' ] = parameterToString ( fileCreatedAt ) ;
}
if ( fileModifiedAt ! = null ) {
hasFields = true ;
mp . fields [ r'fileModifiedAt' ] = parameterToString ( fileModifiedAt ) ;
}
if ( filename ! = null ) {
hasFields = true ;
mp . fields [ r'filename' ] = parameterToString ( filename ) ;
}
if ( isFavorite ! = null ) {
hasFields = true ;
mp . fields [ r'isFavorite' ] = parameterToString ( isFavorite ) ;
}
if ( livePhotoVideoId ! = null ) {
hasFields = true ;
mp . fields [ r'livePhotoVideoId' ] = parameterToString ( livePhotoVideoId ) ;
}
2025-08-27 18:31:23 +00:00
if ( metadata ! = null ) {
hasFields = true ;
mp . fields [ r'metadata' ] = parameterToString ( metadata ) ;
}
2025-08-21 22:15:11 +00:00
if ( sidecarData ! = null ) {
hasFields = true ;
mp . fields [ r'sidecarData' ] = sidecarData . field ;
mp . files . add ( sidecarData ) ;
}
if ( visibility ! = null ) {
hasFields = true ;
mp . fields [ r'visibility' ] = parameterToString ( visibility ) ;
}
if ( hasFields ) {
postBody = mp ;
}
return apiClient . invokeAPI (
apiPath ,
' POST ' ,
queryParams ,
postBody ,
headerParams ,
formParams ,
contentTypes . isEmpty ? null : contentTypes . first ,
) ;
}
2025-11-11 22:01:14 +00:00
/// Upload asset
///
/// Uploads a new asset to the server.
2025-08-21 22:15:11 +00:00
///
/// Parameters:
///
/// * [MultipartFile] assetData (required):
2026-01-29 13:49:15 +00:00
/// Asset file data
2025-08-21 22:15:11 +00:00
///
/// * [DateTime] fileCreatedAt (required):
2026-01-29 13:49:15 +00:00
/// File creation date
2025-08-21 22:15:11 +00:00
///
/// * [DateTime] fileModifiedAt (required):
2026-01-29 13:49:15 +00:00
/// File modification date
2025-08-21 22:15:11 +00:00
///
/// * [String] key:
///
/// * [String] slug:
///
/// * [String] xImmichChecksum:
/// sha1 checksum that can be used for duplicate detection before the file is uploaded
///
/// * [String] duration:
2026-01-29 13:49:15 +00:00
/// Duration (for videos)
2025-08-21 22:15:11 +00:00
///
/// * [String] filename:
2026-01-29 13:49:15 +00:00
/// Filename
2025-08-21 22:15:11 +00:00
///
/// * [bool] isFavorite:
2026-01-29 13:49:15 +00:00
/// Mark as favorite
2025-08-21 22:15:11 +00:00
///
/// * [String] livePhotoVideoId:
2026-01-29 13:49:15 +00:00
/// Live photo video ID
2025-08-21 22:15:11 +00:00
///
2026-01-08 22:01:25 +00:00
/// * [List<AssetMetadataUpsertItemDto>] metadata:
2026-01-29 13:49:15 +00:00
/// Asset metadata items
2026-01-08 22:01:25 +00:00
///
2025-08-21 22:15:11 +00:00
/// * [MultipartFile] sidecarData:
2026-01-29 13:49:15 +00:00
/// Sidecar file data
2025-08-21 22:15:11 +00:00
///
/// * [AssetVisibility] visibility:
2026-04-15 19:00:33 +00:00
Future < AssetMediaResponseDto ? > uploadAsset ( MultipartFile assetData , DateTime fileCreatedAt , DateTime fileModifiedAt , { String ? key , String ? slug , String ? xImmichChecksum , String ? duration , String ? filename , bool ? isFavorite , String ? livePhotoVideoId , List < AssetMetadataUpsertItemDto > ? metadata , MultipartFile ? sidecarData , AssetVisibility ? visibility , } ) async {
final response = await uploadAssetWithHttpInfo ( assetData , fileCreatedAt , fileModifiedAt , key: key , slug: slug , xImmichChecksum: xImmichChecksum , duration: duration , filename: filename , isFavorite: isFavorite , livePhotoVideoId: livePhotoVideoId , metadata: metadata , sidecarData: sidecarData , visibility: visibility , ) ;
2025-08-21 22:15:11 +00:00
if ( response . statusCode > = HttpStatus . badRequest ) {
throw ApiException ( response . statusCode , await _decodeBodyBytes ( response ) ) ;
}
// When a remote server returns no body with a status of 204, we shall not decode it.
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
// FormatException when trying to decode an empty string.
if ( response . body . isNotEmpty & & response . statusCode ! = HttpStatus . noContent ) {
return await apiClient . deserializeAsync ( await _decodeBodyBytes ( response ) , ' AssetMediaResponseDto ' , ) as AssetMediaResponseDto ;
}
return null ;
}
2025-11-11 22:01:14 +00:00
/// View asset thumbnail
///
2026-01-23 14:42:21 +00:00
/// Retrieve the thumbnail image for the specified asset. Viewing the fullsize thumbnail might redirect to downloadAsset, which requires a different permission.
2025-08-21 22:15:11 +00:00
///
/// Note: This method returns the HTTP [Response].
///
/// Parameters:
///
/// * [String] id (required):
///
2026-01-09 22:59:52 +00:00
/// * [bool] edited:
2026-01-29 13:49:15 +00:00
/// Return edited asset if available
2026-01-09 22:59:52 +00:00
///
2025-08-21 22:15:11 +00:00
/// * [String] key:
///
/// * [AssetMediaSize] size:
///
/// * [String] slug:
2026-01-09 22:59:52 +00:00
Future < Response > viewAssetWithHttpInfo ( String id , { bool ? edited , String ? key , AssetMediaSize ? size , String ? slug , } ) async {
2025-08-21 22:15:11 +00:00
// ignore: prefer_const_declarations
final apiPath = r'/assets/{id}/thumbnail'
. replaceAll ( ' {id} ' , id ) ;
// ignore: prefer_final_locals
Object ? postBody ;
final queryParams = < QueryParam > [ ] ;
final headerParams = < String , String > { } ;
final formParams = < String , String > { } ;
2026-01-09 22:59:52 +00:00
if ( edited ! = null ) {
queryParams . addAll ( _queryParams ( ' ' , ' edited ' , edited ) ) ;
}
2025-08-21 22:15:11 +00:00
if ( key ! = null ) {
queryParams . addAll ( _queryParams ( ' ' , ' key ' , key ) ) ;
}
if ( size ! = null ) {
queryParams . addAll ( _queryParams ( ' ' , ' size ' , size ) ) ;
}
if ( slug ! = null ) {
queryParams . addAll ( _queryParams ( ' ' , ' slug ' , slug ) ) ;
}
const contentTypes = < String > [ ] ;
return apiClient . invokeAPI (
apiPath ,
' GET ' ,
queryParams ,
postBody ,
headerParams ,
formParams ,
contentTypes . isEmpty ? null : contentTypes . first ,
) ;
}
2025-11-11 22:01:14 +00:00
/// View asset thumbnail
///
2026-01-23 14:42:21 +00:00
/// Retrieve the thumbnail image for the specified asset. Viewing the fullsize thumbnail might redirect to downloadAsset, which requires a different permission.
2025-08-21 22:15:11 +00:00
///
/// Parameters:
///
/// * [String] id (required):
///
2026-01-09 22:59:52 +00:00
/// * [bool] edited:
2026-01-29 13:49:15 +00:00
/// Return edited asset if available
2026-01-09 22:59:52 +00:00
///
2025-08-21 22:15:11 +00:00
/// * [String] key:
///
/// * [AssetMediaSize] size:
///
/// * [String] slug:
2026-01-09 22:59:52 +00:00
Future < MultipartFile ? > viewAsset ( String id , { bool ? edited , String ? key , AssetMediaSize ? size , String ? slug , } ) async {
final response = await viewAssetWithHttpInfo ( id , edited: edited , key: key , size: size , slug: slug , ) ;
2025-08-21 22:15:11 +00:00
if ( response . statusCode > = HttpStatus . badRequest ) {
throw ApiException ( response . statusCode , await _decodeBodyBytes ( response ) ) ;
}
// When a remote server returns no body with a status of 204, we shall not decode it.
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
// FormatException when trying to decode an empty string.
if ( response . body . isNotEmpty & & response . statusCode ! = HttpStatus . noContent ) {
return await apiClient . deserializeAsync ( await _decodeBodyBytes ( response ) , ' MultipartFile ' , ) as MultipartFile ;
}
return null ;
}
}