2025-08-21 17:15:11 -05: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 17:01:14 -05:00
/// Check bulk upload
2025-08-21 17:15:11 -05:00
///
2025-11-11 17:01:14 -05:00
/// Determine which assets have already been uploaded to the server based on their SHA1 checksums.
2025-08-21 17:15:11 -05:00
///
/// Note: This method returns the HTTP [Response].
///
/// Parameters:
///
/// * [AssetBulkUploadCheckDto] assetBulkUploadCheckDto (required):
2026-05-30 11:31:17 -04:00
Future < Response > checkBulkUploadWithHttpInfo ( AssetBulkUploadCheckDto assetBulkUploadCheckDto , { Future < void > ? abortTrigger , } ) async {
2025-08-21 17:15:11 -05:00
// 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 ,
2026-05-30 11:31:17 -04:00
abortTrigger: abortTrigger ,
2025-08-21 17:15:11 -05:00
) ;
}
2025-11-11 17:01:14 -05:00
/// Check bulk upload
2025-08-21 17:15:11 -05:00
///
2025-11-11 17:01:14 -05:00
/// Determine which assets have already been uploaded to the server based on their SHA1 checksums.
2025-08-21 17:15:11 -05:00
///
/// Parameters:
///
/// * [AssetBulkUploadCheckDto] assetBulkUploadCheckDto (required):
2026-05-30 11:31:17 -04:00
Future < AssetBulkUploadCheckResponseDto ? > checkBulkUpload ( AssetBulkUploadCheckDto assetBulkUploadCheckDto , { Future < void > ? abortTrigger , } ) async {
final response = await checkBulkUploadWithHttpInfo ( assetBulkUploadCheckDto , abortTrigger: abortTrigger , ) ;
2025-08-21 17:15:11 -05: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 ) , ' AssetBulkUploadCheckResponseDto ' , ) as AssetBulkUploadCheckResponseDto ;
}
return null ;
}
2025-11-11 17:01:14 -05:00
/// Copy asset
///
/// Copy asset information like albums, tags, etc. from one asset to another.
2025-10-29 14:43:47 +01:00
///
/// Note: This method returns the HTTP [Response].
///
/// Parameters:
///
/// * [AssetCopyDto] assetCopyDto (required):
2026-05-30 11:31:17 -04:00
Future < Response > copyAssetWithHttpInfo ( AssetCopyDto assetCopyDto , { Future < void > ? abortTrigger , } ) async {
2025-10-29 14:43:47 +01:00
// 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 ,
2026-05-30 11:31:17 -04:00
abortTrigger: abortTrigger ,
2025-10-29 14:43:47 +01:00
) ;
}
2025-11-11 17:01:14 -05:00
/// Copy asset
///
/// Copy asset information like albums, tags, etc. from one asset to another.
2025-10-29 14:43:47 +01:00
///
/// Parameters:
///
/// * [AssetCopyDto] assetCopyDto (required):
2026-05-30 11:31:17 -04:00
Future < void > copyAsset ( AssetCopyDto assetCopyDto , { Future < void > ? abortTrigger , } ) async {
final response = await copyAssetWithHttpInfo ( assetCopyDto , abortTrigger: abortTrigger , ) ;
2025-10-29 14:43:47 +01:00
if ( response . statusCode > = HttpStatus . badRequest ) {
throw ApiException ( response . statusCode , await _decodeBodyBytes ( response ) ) ;
}
}
2025-11-11 17:01:14 -05:00
/// Delete asset metadata by key
///
/// Delete a specific metadata key-value pair associated with the specified asset.
2025-08-27 14:31:23 -04:00
///
/// Note: This method returns the HTTP [Response].
///
/// Parameters:
///
/// * [String] id (required):
2026-01-29 14:49:15 +01:00
/// Asset ID
2025-08-27 14:31:23 -04:00
///
2026-01-08 14:52:16 -05:00
/// * [String] key (required):
2026-01-29 14:49:15 +01:00
/// Metadata key
2026-05-30 11:31:17 -04:00
Future < Response > deleteAssetMetadataWithHttpInfo ( String id , String key , { Future < void > ? abortTrigger , } ) async {
2025-08-27 14:31:23 -04:00
// ignore: prefer_const_declarations
final apiPath = r'/assets/{id}/metadata/{key}'
. replaceAll ( ' {id} ' , id )
2026-01-08 14:52:16 -05:00
. replaceAll ( ' {key} ' , key ) ;
2025-08-27 14:31:23 -04: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 ,
2026-05-30 11:31:17 -04:00
abortTrigger: abortTrigger ,
2025-08-27 14:31:23 -04:00
) ;
}
2025-11-11 17:01:14 -05:00
/// Delete asset metadata by key
///
/// Delete a specific metadata key-value pair associated with the specified asset.
2025-08-27 14:31:23 -04:00
///
/// Parameters:
///
/// * [String] id (required):
2026-01-29 14:49:15 +01:00
/// Asset ID
2025-08-27 14:31:23 -04:00
///
2026-01-08 14:52:16 -05:00
/// * [String] key (required):
2026-01-29 14:49:15 +01:00
/// Metadata key
2026-05-30 11:31:17 -04:00
Future < void > deleteAssetMetadata ( String id , String key , { Future < void > ? abortTrigger , } ) async {
final response = await deleteAssetMetadataWithHttpInfo ( id , key , abortTrigger: abortTrigger , ) ;
2025-08-27 14:31:23 -04:00
if ( response . statusCode > = HttpStatus . badRequest ) {
throw ApiException ( response . statusCode , await _decodeBodyBytes ( response ) ) ;
}
}
2025-11-11 17:01:14 -05:00
/// Delete assets
///
/// Deletes multiple assets at the same time.
2025-08-21 17:15:11 -05:00
///
/// Note: This method returns the HTTP [Response].
///
/// Parameters:
///
/// * [AssetBulkDeleteDto] assetBulkDeleteDto (required):
2026-05-30 11:31:17 -04:00
Future < Response > deleteAssetsWithHttpInfo ( AssetBulkDeleteDto assetBulkDeleteDto , { Future < void > ? abortTrigger , } ) async {
2025-08-21 17:15:11 -05:00
// 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 ,
2026-05-30 11:31:17 -04:00
abortTrigger: abortTrigger ,
2025-08-21 17:15:11 -05:00
) ;
}
2025-11-11 17:01:14 -05:00
/// Delete assets
///
/// Deletes multiple assets at the same time.
2025-08-21 17:15:11 -05:00
///
/// Parameters:
///
/// * [AssetBulkDeleteDto] assetBulkDeleteDto (required):
2026-05-30 11:31:17 -04:00
Future < void > deleteAssets ( AssetBulkDeleteDto assetBulkDeleteDto , { Future < void > ? abortTrigger , } ) async {
final response = await deleteAssetsWithHttpInfo ( assetBulkDeleteDto , abortTrigger: abortTrigger , ) ;
2025-08-21 17:15:11 -05:00
if ( response . statusCode > = HttpStatus . badRequest ) {
throw ApiException ( response . statusCode , await _decodeBodyBytes ( response ) ) ;
}
}
2026-01-08 14:52:16 -05:00
/// Delete asset metadata
///
/// Delete metadata key-value pairs for multiple assets.
///
/// Note: This method returns the HTTP [Response].
///
/// Parameters:
///
/// * [AssetMetadataBulkDeleteDto] assetMetadataBulkDeleteDto (required):
2026-05-30 11:31:17 -04:00
Future < Response > deleteBulkAssetMetadataWithHttpInfo ( AssetMetadataBulkDeleteDto assetMetadataBulkDeleteDto , { Future < void > ? abortTrigger , } ) async {
2026-01-08 14:52:16 -05:00
// 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 ,
2026-05-30 11:31:17 -04:00
abortTrigger: abortTrigger ,
2026-01-08 14:52:16 -05:00
) ;
}
/// Delete asset metadata
///
/// Delete metadata key-value pairs for multiple assets.
///
/// Parameters:
///
/// * [AssetMetadataBulkDeleteDto] assetMetadataBulkDeleteDto (required):
2026-05-30 11:31:17 -04:00
Future < void > deleteBulkAssetMetadata ( AssetMetadataBulkDeleteDto assetMetadataBulkDeleteDto , { Future < void > ? abortTrigger , } ) async {
final response = await deleteBulkAssetMetadataWithHttpInfo ( assetMetadataBulkDeleteDto , abortTrigger: abortTrigger , ) ;
2026-01-08 14:52:16 -05:00
if ( response . statusCode > = HttpStatus . badRequest ) {
throw ApiException ( response . statusCode , await _decodeBodyBytes ( response ) ) ;
}
}
2025-11-11 17:01:14 -05:00
/// Download original asset
///
/// Downloads the original file of the specified asset.
2025-08-21 17:15:11 -05:00
///
/// Note: This method returns the HTTP [Response].
///
/// Parameters:
///
/// * [String] id (required):
///
2026-01-09 17:59:52 -05:00
/// * [bool] edited:
2026-01-29 14:49:15 +01:00
/// Return edited asset if available
2026-01-09 17:59:52 -05:00
///
2025-08-21 17:15:11 -05:00
/// * [String] key:
///
/// * [String] slug:
2026-05-30 11:31:17 -04:00
Future < Response > downloadAssetWithHttpInfo ( String id , { bool ? edited , String ? key , String ? slug , Future < void > ? abortTrigger , } ) async {
2025-08-21 17:15:11 -05: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 17:59:52 -05:00
if ( edited ! = null ) {
queryParams . addAll ( _queryParams ( ' ' , ' edited ' , edited ) ) ;
}
2025-08-21 17:15:11 -05: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 ,
2026-05-30 11:31:17 -04:00
abortTrigger: abortTrigger ,
2025-08-21 17:15:11 -05:00
) ;
}
2025-11-11 17:01:14 -05:00
/// Download original asset
///
/// Downloads the original file of the specified asset.
2025-08-21 17:15:11 -05:00
///
/// Parameters:
///
/// * [String] id (required):
///
2026-01-09 17:59:52 -05:00
/// * [bool] edited:
2026-01-29 14:49:15 +01:00
/// Return edited asset if available
2026-01-09 17:59:52 -05:00
///
2025-08-21 17:15:11 -05:00
/// * [String] key:
///
/// * [String] slug:
2026-05-30 11:31:17 -04:00
Future < MultipartFile ? > downloadAsset ( String id , { bool ? edited , String ? key , String ? slug , Future < void > ? abortTrigger , } ) async {
final response = await downloadAssetWithHttpInfo ( id , edited: edited , key: key , slug: slug , abortTrigger: abortTrigger , ) ;
2025-08-21 17:15:11 -05: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 17:59:52 -05: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 14:57:57 -06:00
/// * [AssetEditsCreateDto] assetEditsCreateDto (required):
2026-05-30 11:31:17 -04:00
Future < Response > editAssetWithHttpInfo ( String id , AssetEditsCreateDto assetEditsCreateDto , { Future < void > ? abortTrigger , } ) async {
2026-01-09 17:59:52 -05:00
// ignore: prefer_const_declarations
final apiPath = r'/assets/{id}/edits'
. replaceAll ( ' {id} ' , id ) ;
// ignore: prefer_final_locals
2026-02-23 14:57:57 -06:00
Object ? postBody = assetEditsCreateDto ;
2026-01-09 17:59:52 -05: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 ,
2026-05-30 11:31:17 -04:00
abortTrigger: abortTrigger ,
2026-01-09 17:59:52 -05:00
) ;
}
/// 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 14:57:57 -06:00
/// * [AssetEditsCreateDto] assetEditsCreateDto (required):
2026-05-30 11:31:17 -04:00
Future < AssetEditsResponseDto ? > editAsset ( String id , AssetEditsCreateDto assetEditsCreateDto , { Future < void > ? abortTrigger , } ) async {
final response = await editAssetWithHttpInfo ( id , assetEditsCreateDto , abortTrigger: abortTrigger , ) ;
2026-01-09 17:59:52 -05: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 14:57:57 -06:00
return await apiClient . deserializeAsync ( await _decodeBodyBytes ( response ) , ' AssetEditsResponseDto ' , ) as AssetEditsResponseDto ;
2026-01-09 17:59:52 -05:00
}
return null ;
}
2026-06-01 14:52:29 -04:00
/// End HLS streaming session
///
/// Releases server resources for the streaming session.
///
/// Note: This method returns the HTTP [Response].
///
/// Parameters:
///
/// * [String] id (required):
///
/// * [String] sessionId (required):
///
/// * [String] key:
///
/// * [String] slug:
Future < Response > endSessionWithHttpInfo ( String id , String sessionId , { String ? key , String ? slug , Future < void > ? abortTrigger , } ) async {
// ignore: prefer_const_declarations
final apiPath = r'/assets/{id}/video/stream/{sessionId}'
. replaceAll ( ' {id} ' , id )
. replaceAll ( ' {sessionId} ' , sessionId ) ;
// 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 ,
' DELETE ' ,
queryParams ,
postBody ,
headerParams ,
formParams ,
contentTypes . isEmpty ? null : contentTypes . first ,
abortTrigger: abortTrigger ,
) ;
}
/// End HLS streaming session
///
/// Releases server resources for the streaming session.
///
/// Parameters:
///
/// * [String] id (required):
///
/// * [String] sessionId (required):
///
/// * [String] key:
///
/// * [String] slug:
Future < void > endSession ( String id , String sessionId , { String ? key , String ? slug , Future < void > ? abortTrigger , } ) async {
final response = await endSessionWithHttpInfo ( id , sessionId , key: key , slug: slug , abortTrigger: abortTrigger , ) ;
if ( response . statusCode > = HttpStatus . badRequest ) {
throw ApiException ( response . statusCode , await _decodeBodyBytes ( response ) ) ;
}
}
2026-01-09 17:59:52 -05:00
/// 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):
2026-05-30 11:31:17 -04:00
Future < Response > getAssetEditsWithHttpInfo ( String id , { Future < void > ? abortTrigger , } ) async {
2026-01-09 17:59:52 -05:00
// 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 ,
2026-05-30 11:31:17 -04:00
abortTrigger: abortTrigger ,
2026-01-09 17:59:52 -05:00
) ;
}
/// 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-05-30 11:31:17 -04:00
Future < AssetEditsResponseDto ? > getAssetEdits ( String id , { Future < void > ? abortTrigger , } ) async {
final response = await getAssetEditsWithHttpInfo ( id , abortTrigger: abortTrigger , ) ;
2026-01-09 17:59:52 -05: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 14:57:57 -06:00
return await apiClient . deserializeAsync ( await _decodeBodyBytes ( response ) , ' AssetEditsResponseDto ' , ) as AssetEditsResponseDto ;
2026-01-09 17:59:52 -05:00
}
return null ;
}
2025-11-11 17:01:14 -05:00
/// Retrieve an asset
///
/// Retrieve detailed information about a specific asset.
2025-08-21 17:15:11 -05:00
///
/// Note: This method returns the HTTP [Response].
///
/// Parameters:
///
/// * [String] id (required):
///
/// * [String] key:
///
/// * [String] slug:
2026-05-30 11:31:17 -04:00
Future < Response > getAssetInfoWithHttpInfo ( String id , { String ? key , String ? slug , Future < void > ? abortTrigger , } ) async {
2025-08-21 17:15:11 -05:00
// 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 ,
2026-05-30 11:31:17 -04:00
abortTrigger: abortTrigger ,
2025-08-21 17:15:11 -05:00
) ;
}
2025-11-11 17:01:14 -05:00
/// Retrieve an asset
///
/// Retrieve detailed information about a specific asset.
2025-08-21 17:15:11 -05:00
///
/// Parameters:
///
/// * [String] id (required):
///
/// * [String] key:
///
/// * [String] slug:
2026-05-30 11:31:17 -04:00
Future < AssetResponseDto ? > getAssetInfo ( String id , { String ? key , String ? slug , Future < void > ? abortTrigger , } ) async {
final response = await getAssetInfoWithHttpInfo ( id , key: key , slug: slug , abortTrigger: abortTrigger , ) ;
2025-08-21 17:15:11 -05: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 ) , ' AssetResponseDto ' , ) as AssetResponseDto ;
}
return null ;
}
2025-11-11 17:01:14 -05:00
/// Get asset metadata
///
/// Retrieve all metadata key-value pairs associated with the specified asset.
2025-08-27 14:31:23 -04:00
///
/// Note: This method returns the HTTP [Response].
///
/// Parameters:
///
/// * [String] id (required):
2026-05-30 11:31:17 -04:00
Future < Response > getAssetMetadataWithHttpInfo ( String id , { Future < void > ? abortTrigger , } ) async {
2025-08-27 14:31:23 -04:00
// 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 ,
2026-05-30 11:31:17 -04:00
abortTrigger: abortTrigger ,
2025-08-27 14:31:23 -04:00
) ;
}
2025-11-11 17:01:14 -05:00
/// Get asset metadata
///
/// Retrieve all metadata key-value pairs associated with the specified asset.
2025-08-27 14:31:23 -04:00
///
/// Parameters:
///
/// * [String] id (required):
2026-05-30 11:31:17 -04:00
Future < List < AssetMetadataResponseDto > ? > getAssetMetadata ( String id , { Future < void > ? abortTrigger , } ) async {
final response = await getAssetMetadataWithHttpInfo ( id , abortTrigger: abortTrigger , ) ;
2025-08-27 14:31:23 -04: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 ) {
final responseBody = await _decodeBodyBytes ( response ) ;
return ( await apiClient . deserializeAsync ( responseBody , ' List<AssetMetadataResponseDto> ' ) as List )
. cast < AssetMetadataResponseDto > ( )
. toList ( growable: false ) ;
}
return null ;
}
2025-11-11 17:01:14 -05:00
/// Retrieve asset metadata by key
///
/// Retrieve the value of a specific metadata key associated with the specified asset.
2025-08-27 14:31:23 -04:00
///
/// Note: This method returns the HTTP [Response].
///
/// Parameters:
///
/// * [String] id (required):
2026-01-29 14:49:15 +01:00
/// Asset ID
2025-08-27 14:31:23 -04:00
///
2026-01-08 14:52:16 -05:00
/// * [String] key (required):
2026-01-29 14:49:15 +01:00
/// Metadata key
2026-05-30 11:31:17 -04:00
Future < Response > getAssetMetadataByKeyWithHttpInfo ( String id , String key , { Future < void > ? abortTrigger , } ) async {
2025-08-27 14:31:23 -04:00
// ignore: prefer_const_declarations
final apiPath = r'/assets/{id}/metadata/{key}'
. replaceAll ( ' {id} ' , id )
2026-01-08 14:52:16 -05:00
. replaceAll ( ' {key} ' , key ) ;
2025-08-27 14:31:23 -04: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 ,
2026-05-30 11:31:17 -04:00
abortTrigger: abortTrigger ,
2025-08-27 14:31:23 -04:00
) ;
}
2025-11-11 17:01:14 -05:00
/// Retrieve asset metadata by key
///
/// Retrieve the value of a specific metadata key associated with the specified asset.
2025-08-27 14:31:23 -04:00
///
/// Parameters:
///
/// * [String] id (required):
2026-01-29 14:49:15 +01:00
/// Asset ID
2025-08-27 14:31:23 -04:00
///
2026-01-08 14:52:16 -05:00
/// * [String] key (required):
2026-01-29 14:49:15 +01:00
/// Metadata key
2026-05-30 11:31:17 -04:00
Future < AssetMetadataResponseDto ? > getAssetMetadataByKey ( String id , String key , { Future < void > ? abortTrigger , } ) async {
final response = await getAssetMetadataByKeyWithHttpInfo ( id , key , abortTrigger: abortTrigger , ) ;
2025-08-27 14:31:23 -04: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 ) , ' AssetMetadataResponseDto ' , ) as AssetMetadataResponseDto ;
}
return null ;
}
2025-11-11 17:01:14 -05:00
/// Retrieve asset OCR data
///
/// Retrieve all OCR (Optical Character Recognition) data associated with the specified asset.
2025-10-28 15:57:03 -05:00
///
/// Note: This method returns the HTTP [Response].
///
/// Parameters:
///
/// * [String] id (required):
2026-05-30 11:31:17 -04:00
Future < Response > getAssetOcrWithHttpInfo ( String id , { Future < void > ? abortTrigger , } ) async {
2025-10-28 15:57:03 -05:00
// 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 ,
2026-05-30 11:31:17 -04:00
abortTrigger: abortTrigger ,
2025-10-28 15:57:03 -05:00
) ;
}
2025-11-11 17:01:14 -05:00
/// Retrieve asset OCR data
///
/// Retrieve all OCR (Optical Character Recognition) data associated with the specified asset.
2025-10-28 15:57:03 -05:00
///
/// Parameters:
///
/// * [String] id (required):
2026-05-30 11:31:17 -04:00
Future < List < AssetOcrResponseDto > ? > getAssetOcr ( String id , { Future < void > ? abortTrigger , } ) async {
final response = await getAssetOcrWithHttpInfo ( id , abortTrigger: abortTrigger , ) ;
2025-10-28 15:57:03 -05: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 ) {
final responseBody = await _decodeBodyBytes ( response ) ;
return ( await apiClient . deserializeAsync ( responseBody , ' List<AssetOcrResponseDto> ' ) as List )
. cast < AssetOcrResponseDto > ( )
. toList ( growable: false ) ;
}
return null ;
}
2025-11-11 17:01:14 -05:00
/// Get asset statistics
///
/// Retrieve various statistics about the assets owned by the authenticated user.
2025-08-21 17:15:11 -05:00
///
/// Note: This method returns the HTTP [Response].
///
/// Parameters:
///
/// * [bool] isFavorite:
2026-01-29 14:49:15 +01:00
/// Filter by favorite status
2025-08-21 17:15:11 -05:00
///
/// * [bool] isTrashed:
2026-01-29 14:49:15 +01:00
/// Filter by trash status
2025-08-21 17:15:11 -05:00
///
/// * [AssetVisibility] visibility:
2026-05-30 11:31:17 -04:00
Future < Response > getAssetStatisticsWithHttpInfo ( { bool ? isFavorite , bool ? isTrashed , AssetVisibility ? visibility , Future < void > ? abortTrigger , } ) async {
2025-08-21 17:15:11 -05:00
// 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 ,
2026-05-30 11:31:17 -04:00
abortTrigger: abortTrigger ,
2025-08-21 17:15:11 -05:00
) ;
}
2025-11-11 17:01:14 -05:00
/// Get asset statistics
///
/// Retrieve various statistics about the assets owned by the authenticated user.
2025-08-21 17:15:11 -05:00
///
/// Parameters:
///
/// * [bool] isFavorite:
2026-01-29 14:49:15 +01:00
/// Filter by favorite status
2025-08-21 17:15:11 -05:00
///
/// * [bool] isTrashed:
2026-01-29 14:49:15 +01:00
/// Filter by trash status
2025-08-21 17:15:11 -05:00
///
/// * [AssetVisibility] visibility:
2026-05-30 11:31:17 -04:00
Future < AssetStatsResponseDto ? > getAssetStatistics ( { bool ? isFavorite , bool ? isTrashed , AssetVisibility ? visibility , Future < void > ? abortTrigger , } ) async {
final response = await getAssetStatisticsWithHttpInfo ( isFavorite: isFavorite , isTrashed: isTrashed , visibility: visibility , abortTrigger: abortTrigger , ) ;
2025-08-21 17:15:11 -05: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 ) , ' AssetStatsResponseDto ' , ) as AssetStatsResponseDto ;
}
return null ;
}
2026-06-01 14:52:29 -04:00
/// Get HLS main playlist
///
/// Returns an HLS main playlist with all available variants for the asset.
///
/// Note: This method returns the HTTP [Response].
///
/// Parameters:
///
/// * [String] id (required):
///
/// * [String] key:
///
/// * [String] slug:
Future < Response > getMainPlaylistWithHttpInfo ( String id , { String ? key , String ? slug , Future < void > ? abortTrigger , } ) async {
// ignore: prefer_const_declarations
final apiPath = r'/assets/{id}/video/stream/main.m3u8'
. 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 ,
abortTrigger: abortTrigger ,
) ;
}
/// Get HLS main playlist
///
/// Returns an HLS main playlist with all available variants for the asset.
///
/// Parameters:
///
/// * [String] id (required):
///
/// * [String] key:
///
/// * [String] slug:
Future < String ? > getMainPlaylist ( String id , { String ? key , String ? slug , Future < void > ? abortTrigger , } ) async {
final response = await getMainPlaylistWithHttpInfo ( id , key: key , slug: slug , abortTrigger: abortTrigger , ) ;
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 ) , ' String ' , ) as String ;
}
return null ;
}
/// Get HLS media playlist
///
/// Returns an HLS media playlist for one variant of the streaming session.
///
/// Note: This method returns the HTTP [Response].
///
/// Parameters:
///
/// * [String] id (required):
///
/// * [String] sessionId (required):
///
/// * [int] variantIndex (required):
///
/// * [String] key:
///
/// * [String] slug:
Future < Response > getMediaPlaylistWithHttpInfo ( String id , String sessionId , int variantIndex , { String ? key , String ? slug , Future < void > ? abortTrigger , } ) async {
// ignore: prefer_const_declarations
final apiPath = r'/assets/{id}/video/stream/{sessionId}/{variantIndex}/playlist.m3u8'
. replaceAll ( ' {id} ' , id )
. replaceAll ( ' {sessionId} ' , sessionId )
. replaceAll ( ' {variantIndex} ' , variantIndex . toString ( ) ) ;
// 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 ,
abortTrigger: abortTrigger ,
) ;
}
/// Get HLS media playlist
///
/// Returns an HLS media playlist for one variant of the streaming session.
///
/// Parameters:
///
/// * [String] id (required):
///
/// * [String] sessionId (required):
///
/// * [int] variantIndex (required):
///
/// * [String] key:
///
/// * [String] slug:
Future < String ? > getMediaPlaylist ( String id , String sessionId , int variantIndex , { String ? key , String ? slug , Future < void > ? abortTrigger , } ) async {
final response = await getMediaPlaylistWithHttpInfo ( id , sessionId , variantIndex , key: key , slug: slug , abortTrigger: abortTrigger , ) ;
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 ) , ' String ' , ) as String ;
}
return null ;
}
/// Get HLS segment or init file
///
/// Streams an HLS init segment (init.mp4) or media segment (seg_N.m4s).
///
/// Note: This method returns the HTTP [Response].
///
/// Parameters:
///
/// * [String] filename (required):
///
/// * [String] id (required):
///
/// * [String] sessionId (required):
///
/// * [int] variantIndex (required):
///
/// * [String] key:
///
/// * [String] slug:
2026-06-10 19:18:36 -04:00
///
/// * [int] xImmichHlsMsn:
Future < Response > getSegmentWithHttpInfo ( String filename , String id , String sessionId , int variantIndex , { String ? key , String ? slug , int ? xImmichHlsMsn , Future < void > ? abortTrigger , } ) async {
2026-06-01 14:52:29 -04:00
// ignore: prefer_const_declarations
final apiPath = r'/assets/{id}/video/stream/{sessionId}/{variantIndex}/{filename}'
. replaceAll ( ' {filename} ' , filename )
. replaceAll ( ' {id} ' , id )
. replaceAll ( ' {sessionId} ' , sessionId )
. replaceAll ( ' {variantIndex} ' , variantIndex . toString ( ) ) ;
// 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 ) ) ;
}
2026-06-10 19:18:36 -04:00
if ( xImmichHlsMsn ! = null ) {
headerParams [ r'x-immich-hls-msn' ] = parameterToString ( xImmichHlsMsn ) ;
}
2026-06-01 14:52:29 -04:00
const contentTypes = < String > [ ] ;
return apiClient . invokeAPI (
apiPath ,
' GET ' ,
queryParams ,
postBody ,
headerParams ,
formParams ,
contentTypes . isEmpty ? null : contentTypes . first ,
abortTrigger: abortTrigger ,
) ;
}
/// Get HLS segment or init file
///
/// Streams an HLS init segment (init.mp4) or media segment (seg_N.m4s).
///
/// Parameters:
///
/// * [String] filename (required):
///
/// * [String] id (required):
///
/// * [String] sessionId (required):
///
/// * [int] variantIndex (required):
///
/// * [String] key:
///
/// * [String] slug:
2026-06-10 19:18:36 -04:00
///
/// * [int] xImmichHlsMsn:
Future < MultipartFile ? > getSegment ( String filename , String id , String sessionId , int variantIndex , { String ? key , String ? slug , int ? xImmichHlsMsn , Future < void > ? abortTrigger , } ) async {
final response = await getSegmentWithHttpInfo ( filename , id , sessionId , variantIndex , key: key , slug: slug , xImmichHlsMsn: xImmichHlsMsn , abortTrigger: abortTrigger , ) ;
2026-06-01 14:52:29 -04: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 ;
}
2025-11-11 17:01:14 -05:00
/// Play asset video
///
/// Streams the video file for the specified asset. This endpoint also supports byte range requests.
2025-08-21 17:15:11 -05:00
///
/// Note: This method returns the HTTP [Response].
///
/// Parameters:
///
/// * [String] id (required):
///
/// * [String] key:
///
/// * [String] slug:
2026-05-30 11:31:17 -04:00
Future < Response > playAssetVideoWithHttpInfo ( String id , { String ? key , String ? slug , Future < void > ? abortTrigger , } ) async {
2025-08-21 17:15:11 -05:00
// 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 ,
2026-05-30 11:31:17 -04:00
abortTrigger: abortTrigger ,
2025-08-21 17:15:11 -05:00
) ;
}
2025-11-11 17:01:14 -05:00
/// Play asset video
///
/// Streams the video file for the specified asset. This endpoint also supports byte range requests.
2025-08-21 17:15:11 -05:00
///
/// Parameters:
///
/// * [String] id (required):
///
/// * [String] key:
///
/// * [String] slug:
2026-05-30 11:31:17 -04:00
Future < MultipartFile ? > playAssetVideo ( String id , { String ? key , String ? slug , Future < void > ? abortTrigger , } ) async {
final response = await playAssetVideoWithHttpInfo ( id , key: key , slug: slug , abortTrigger: abortTrigger , ) ;
2025-08-21 17:15:11 -05: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 17:59:52 -05: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):
2026-05-30 11:31:17 -04:00
Future < Response > removeAssetEditsWithHttpInfo ( String id , { Future < void > ? abortTrigger , } ) async {
2026-01-09 17:59:52 -05:00
// 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 ,
2026-05-30 11:31:17 -04:00
abortTrigger: abortTrigger ,
2026-01-09 17:59:52 -05:00
) ;
}
/// Remove edits from an existing asset
///
/// Removes all edit actions (crop, rotate, mirror) associated with the specified asset.
///
/// Parameters:
///
/// * [String] id (required):
2026-05-30 11:31:17 -04:00
Future < void > removeAssetEdits ( String id , { Future < void > ? abortTrigger , } ) async {
final response = await removeAssetEditsWithHttpInfo ( id , abortTrigger: abortTrigger , ) ;
2026-01-09 17:59:52 -05:00
if ( response . statusCode > = HttpStatus . badRequest ) {
throw ApiException ( response . statusCode , await _decodeBodyBytes ( response ) ) ;
}
}
2025-11-11 17:01:14 -05:00
/// Run an asset job
///
/// Run a specific job on a set of assets.
///
/// Note: This method returns the HTTP [Response].
///
2025-08-21 17:15:11 -05:00
/// Parameters:
///
/// * [AssetJobsDto] assetJobsDto (required):
2026-05-30 11:31:17 -04:00
Future < Response > runAssetJobsWithHttpInfo ( AssetJobsDto assetJobsDto , { Future < void > ? abortTrigger , } ) async {
2025-08-21 17:15:11 -05:00
// 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 ,
2026-05-30 11:31:17 -04:00
abortTrigger: abortTrigger ,
2025-08-21 17:15:11 -05:00
) ;
}
2025-11-11 17:01:14 -05:00
/// Run an asset job
///
/// Run a specific job on a set of assets.
///
2025-08-21 17:15:11 -05:00
/// Parameters:
///
/// * [AssetJobsDto] assetJobsDto (required):
2026-05-30 11:31:17 -04:00
Future < void > runAssetJobs ( AssetJobsDto assetJobsDto , { Future < void > ? abortTrigger , } ) async {
final response = await runAssetJobsWithHttpInfo ( assetJobsDto , abortTrigger: abortTrigger , ) ;
2025-08-21 17:15:11 -05:00
if ( response . statusCode > = HttpStatus . badRequest ) {
throw ApiException ( response . statusCode , await _decodeBodyBytes ( response ) ) ;
}
}
2025-11-11 17:01:14 -05:00
/// Update an asset
///
/// Update information of a specific asset.
2025-08-21 17:15:11 -05:00
///
/// Note: This method returns the HTTP [Response].
///
/// Parameters:
///
/// * [String] id (required):
///
/// * [UpdateAssetDto] updateAssetDto (required):
2026-05-30 11:31:17 -04:00
Future < Response > updateAssetWithHttpInfo ( String id , UpdateAssetDto updateAssetDto , { Future < void > ? abortTrigger , } ) async {
2025-08-21 17:15:11 -05:00
// 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 ,
2026-05-30 11:31:17 -04:00
abortTrigger: abortTrigger ,
2025-08-21 17:15:11 -05:00
) ;
}
2025-11-11 17:01:14 -05:00
/// Update an asset
///
/// Update information of a specific asset.
2025-08-21 17:15:11 -05:00
///
/// Parameters:
///
/// * [String] id (required):
///
/// * [UpdateAssetDto] updateAssetDto (required):
2026-05-30 11:31:17 -04:00
Future < AssetResponseDto ? > updateAsset ( String id , UpdateAssetDto updateAssetDto , { Future < void > ? abortTrigger , } ) async {
final response = await updateAssetWithHttpInfo ( id , updateAssetDto , abortTrigger: abortTrigger , ) ;
2025-08-21 17:15:11 -05: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 ) , ' AssetResponseDto ' , ) as AssetResponseDto ;
}
return null ;
}
2025-11-11 17:01:14 -05:00
/// Update asset metadata
///
/// Update or add metadata key-value pairs for the specified asset.
2025-08-27 14:31:23 -04:00
///
/// Note: This method returns the HTTP [Response].
///
/// Parameters:
///
/// * [String] id (required):
///
/// * [AssetMetadataUpsertDto] assetMetadataUpsertDto (required):
2026-05-30 11:31:17 -04:00
Future < Response > updateAssetMetadataWithHttpInfo ( String id , AssetMetadataUpsertDto assetMetadataUpsertDto , { Future < void > ? abortTrigger , } ) async {
2025-08-27 14:31:23 -04:00
// 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 ,
2026-05-30 11:31:17 -04:00
abortTrigger: abortTrigger ,
2025-08-27 14:31:23 -04:00
) ;
}
2025-11-11 17:01:14 -05:00
/// Update asset metadata
///
/// Update or add metadata key-value pairs for the specified asset.
2025-08-27 14:31:23 -04:00
///
/// Parameters:
///
/// * [String] id (required):
///
/// * [AssetMetadataUpsertDto] assetMetadataUpsertDto (required):
2026-05-30 11:31:17 -04:00
Future < List < AssetMetadataResponseDto > ? > updateAssetMetadata ( String id , AssetMetadataUpsertDto assetMetadataUpsertDto , { Future < void > ? abortTrigger , } ) async {
final response = await updateAssetMetadataWithHttpInfo ( id , assetMetadataUpsertDto , abortTrigger: abortTrigger , ) ;
2025-08-27 14:31:23 -04: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 ) {
final responseBody = await _decodeBodyBytes ( response ) ;
return ( await apiClient . deserializeAsync ( responseBody , ' List<AssetMetadataResponseDto> ' ) as List )
. cast < AssetMetadataResponseDto > ( )
. toList ( growable: false ) ;
}
return null ;
}
2025-11-11 17:01:14 -05:00
/// Update assets
///
/// Updates multiple assets at the same time.
2025-08-21 17:15:11 -05:00
///
/// Note: This method returns the HTTP [Response].
///
/// Parameters:
///
/// * [AssetBulkUpdateDto] assetBulkUpdateDto (required):
2026-05-30 11:31:17 -04:00
Future < Response > updateAssetsWithHttpInfo ( AssetBulkUpdateDto assetBulkUpdateDto , { Future < void > ? abortTrigger , } ) async {
2025-08-21 17:15:11 -05:00
// 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 ,
2026-05-30 11:31:17 -04:00
abortTrigger: abortTrigger ,
2025-08-21 17:15:11 -05:00
) ;
}
2025-11-11 17:01:14 -05:00
/// Update assets
///
/// Updates multiple assets at the same time.
2025-08-21 17:15:11 -05:00
///
/// Parameters:
///
/// * [AssetBulkUpdateDto] assetBulkUpdateDto (required):
2026-05-30 11:31:17 -04:00
Future < void > updateAssets ( AssetBulkUpdateDto assetBulkUpdateDto , { Future < void > ? abortTrigger , } ) async {
final response = await updateAssetsWithHttpInfo ( assetBulkUpdateDto , abortTrigger: abortTrigger , ) ;
2025-08-21 17:15:11 -05:00
if ( response . statusCode > = HttpStatus . badRequest ) {
throw ApiException ( response . statusCode , await _decodeBodyBytes ( response ) ) ;
}
}
2026-01-08 14:52:16 -05:00
/// Upsert asset metadata
///
/// Upsert metadata key-value pairs for multiple assets.
///
/// Note: This method returns the HTTP [Response].
///
/// Parameters:
///
/// * [AssetMetadataBulkUpsertDto] assetMetadataBulkUpsertDto (required):
2026-05-30 11:31:17 -04:00
Future < Response > updateBulkAssetMetadataWithHttpInfo ( AssetMetadataBulkUpsertDto assetMetadataBulkUpsertDto , { Future < void > ? abortTrigger , } ) async {
2026-01-08 14:52:16 -05:00
// 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 ,
2026-05-30 11:31:17 -04:00
abortTrigger: abortTrigger ,
2026-01-08 14:52:16 -05:00
) ;
}
/// Upsert asset metadata
///
/// Upsert metadata key-value pairs for multiple assets.
///
/// Parameters:
///
/// * [AssetMetadataBulkUpsertDto] assetMetadataBulkUpsertDto (required):
2026-05-30 11:31:17 -04:00
Future < List < AssetMetadataBulkResponseDto > ? > updateBulkAssetMetadata ( AssetMetadataBulkUpsertDto assetMetadataBulkUpsertDto , { Future < void > ? abortTrigger , } ) async {
final response = await updateBulkAssetMetadataWithHttpInfo ( assetMetadataBulkUpsertDto , abortTrigger: abortTrigger , ) ;
2026-01-08 14:52:16 -05: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 ) {
final responseBody = await _decodeBodyBytes ( response ) ;
return ( await apiClient . deserializeAsync ( responseBody , ' List<AssetMetadataBulkResponseDto> ' ) as List )
. cast < AssetMetadataBulkResponseDto > ( )
. toList ( growable: false ) ;
}
return null ;
}
2025-11-11 17:01:14 -05:00
/// Upload asset
///
/// Uploads a new asset to the server.
2025-08-21 17:15:11 -05:00
///
/// Note: This method returns the HTTP [Response].
///
/// Parameters:
///
/// * [MultipartFile] assetData (required):
2026-01-29 14:49:15 +01:00
/// Asset file data
2025-08-21 17:15:11 -05:00
///
/// * [DateTime] fileCreatedAt (required):
2026-01-29 14:49:15 +01:00
/// File creation date
2025-08-21 17:15:11 -05:00
///
/// * [DateTime] fileModifiedAt (required):
2026-01-29 14:49:15 +01:00
/// File modification date
2025-08-21 17:15:11 -05:00
///
/// * [String] key:
///
/// * [String] slug:
///
/// * [String] xImmichChecksum:
/// sha1 checksum that can be used for duplicate detection before the file is uploaded
///
2026-04-30 09:44:27 -04:00
/// * [int] duration:
/// Duration in milliseconds (for videos)
2025-08-21 17:15:11 -05:00
///
/// * [String] filename:
2026-01-29 14:49:15 +01:00
/// Filename
2025-08-21 17:15:11 -05:00
///
/// * [bool] isFavorite:
2026-01-29 14:49:15 +01:00
/// Mark as favorite
2025-08-21 17:15:11 -05:00
///
/// * [String] livePhotoVideoId:
2026-01-29 14:49:15 +01:00
/// Live photo video ID
2025-08-21 17:15:11 -05:00
///
2026-01-08 17:01:25 -05:00
/// * [List<AssetMetadataUpsertItemDto>] metadata:
2026-01-29 14:49:15 +01:00
/// Asset metadata items
2026-01-08 17:01:25 -05:00
///
2025-08-21 17:15:11 -05:00
/// * [MultipartFile] sidecarData:
2026-01-29 14:49:15 +01:00
/// Sidecar file data
2025-08-21 17:15:11 -05:00
///
/// * [AssetVisibility] visibility:
2026-05-30 11:31:17 -04:00
Future < Response > uploadAssetWithHttpInfo ( MultipartFile assetData , DateTime fileCreatedAt , DateTime fileModifiedAt , { String ? key , String ? slug , String ? xImmichChecksum , int ? duration , String ? filename , bool ? isFavorite , String ? livePhotoVideoId , List < AssetMetadataUpsertItemDto > ? metadata , MultipartFile ? sidecarData , AssetVisibility ? visibility , Future < void > ? abortTrigger , } ) async {
2025-08-21 17:15:11 -05: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 14:31:23 -04:00
if ( metadata ! = null ) {
hasFields = true ;
mp . fields [ r'metadata' ] = parameterToString ( metadata ) ;
}
2025-08-21 17:15:11 -05: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 ,
2026-05-30 11:31:17 -04:00
abortTrigger: abortTrigger ,
2025-08-21 17:15:11 -05:00
) ;
}
2025-11-11 17:01:14 -05:00
/// Upload asset
///
/// Uploads a new asset to the server.
2025-08-21 17:15:11 -05:00
///
/// Parameters:
///
/// * [MultipartFile] assetData (required):
2026-01-29 14:49:15 +01:00
/// Asset file data
2025-08-21 17:15:11 -05:00
///
/// * [DateTime] fileCreatedAt (required):
2026-01-29 14:49:15 +01:00
/// File creation date
2025-08-21 17:15:11 -05:00
///
/// * [DateTime] fileModifiedAt (required):
2026-01-29 14:49:15 +01:00
/// File modification date
2025-08-21 17:15:11 -05:00
///
/// * [String] key:
///
/// * [String] slug:
///
/// * [String] xImmichChecksum:
/// sha1 checksum that can be used for duplicate detection before the file is uploaded
///
2026-04-30 09:44:27 -04:00
/// * [int] duration:
/// Duration in milliseconds (for videos)
2025-08-21 17:15:11 -05:00
///
/// * [String] filename:
2026-01-29 14:49:15 +01:00
/// Filename
2025-08-21 17:15:11 -05:00
///
/// * [bool] isFavorite:
2026-01-29 14:49:15 +01:00
/// Mark as favorite
2025-08-21 17:15:11 -05:00
///
/// * [String] livePhotoVideoId:
2026-01-29 14:49:15 +01:00
/// Live photo video ID
2025-08-21 17:15:11 -05:00
///
2026-01-08 17:01:25 -05:00
/// * [List<AssetMetadataUpsertItemDto>] metadata:
2026-01-29 14:49:15 +01:00
/// Asset metadata items
2026-01-08 17:01:25 -05:00
///
2025-08-21 17:15:11 -05:00
/// * [MultipartFile] sidecarData:
2026-01-29 14:49:15 +01:00
/// Sidecar file data
2025-08-21 17:15:11 -05:00
///
/// * [AssetVisibility] visibility:
2026-05-30 11:31:17 -04:00
Future < AssetMediaResponseDto ? > uploadAsset ( MultipartFile assetData , DateTime fileCreatedAt , DateTime fileModifiedAt , { String ? key , String ? slug , String ? xImmichChecksum , int ? duration , String ? filename , bool ? isFavorite , String ? livePhotoVideoId , List < AssetMetadataUpsertItemDto > ? metadata , MultipartFile ? sidecarData , AssetVisibility ? visibility , Future < void > ? abortTrigger , } ) 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 , abortTrigger: abortTrigger , ) ;
2025-08-21 17:15:11 -05: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 17:01:14 -05:00
/// View asset thumbnail
///
2026-01-23 15:42:21 +01: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 17:15:11 -05:00
///
/// Note: This method returns the HTTP [Response].
///
/// Parameters:
///
/// * [String] id (required):
///
2026-01-09 17:59:52 -05:00
/// * [bool] edited:
2026-01-29 14:49:15 +01:00
/// Return edited asset if available
2026-01-09 17:59:52 -05:00
///
2025-08-21 17:15:11 -05:00
/// * [String] key:
///
/// * [AssetMediaSize] size:
///
/// * [String] slug:
2026-05-30 11:31:17 -04:00
Future < Response > viewAssetWithHttpInfo ( String id , { bool ? edited , String ? key , AssetMediaSize ? size , String ? slug , Future < void > ? abortTrigger , } ) async {
2025-08-21 17:15:11 -05: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 17:59:52 -05:00
if ( edited ! = null ) {
queryParams . addAll ( _queryParams ( ' ' , ' edited ' , edited ) ) ;
}
2025-08-21 17:15:11 -05: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 ,
2026-05-30 11:31:17 -04:00
abortTrigger: abortTrigger ,
2025-08-21 17:15:11 -05:00
) ;
}
2025-11-11 17:01:14 -05:00
/// View asset thumbnail
///
2026-01-23 15:42:21 +01: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 17:15:11 -05:00
///
/// Parameters:
///
/// * [String] id (required):
///
2026-01-09 17:59:52 -05:00
/// * [bool] edited:
2026-01-29 14:49:15 +01:00
/// Return edited asset if available
2026-01-09 17:59:52 -05:00
///
2025-08-21 17:15:11 -05:00
/// * [String] key:
///
/// * [AssetMediaSize] size:
///
/// * [String] slug:
2026-05-30 11:31:17 -04:00
Future < MultipartFile ? > viewAsset ( String id , { bool ? edited , String ? key , AssetMediaSize ? size , String ? slug , Future < void > ? abortTrigger , } ) async {
final response = await viewAssetWithHttpInfo ( id , edited: edited , key: key , size: size , slug: slug , abortTrigger: abortTrigger , ) ;
2025-08-21 17:15:11 -05: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 ;
}
}