mirror of
https://github.com/immich-app/immich.git
synced 2026-03-03 02:47:02 +00:00
feat: getAssetEdits respond with edit IDs (#26445)
* feat: getAssetEdits respond with edit IDs * chore: cleanup typings for edit API * chore: cleanup types with jason * fix: openapi sync * fix: factory
This commit is contained in:
11
mobile/openapi/README.md
generated
11
mobile/openapi/README.md
generated
@@ -358,12 +358,11 @@ Class | Method | HTTP request | Description
|
||||
- [AssetDeltaSyncDto](doc//AssetDeltaSyncDto.md)
|
||||
- [AssetDeltaSyncResponseDto](doc//AssetDeltaSyncResponseDto.md)
|
||||
- [AssetEditAction](doc//AssetEditAction.md)
|
||||
- [AssetEditActionCrop](doc//AssetEditActionCrop.md)
|
||||
- [AssetEditActionListDto](doc//AssetEditActionListDto.md)
|
||||
- [AssetEditActionListDtoEditsInner](doc//AssetEditActionListDtoEditsInner.md)
|
||||
- [AssetEditActionMirror](doc//AssetEditActionMirror.md)
|
||||
- [AssetEditActionRotate](doc//AssetEditActionRotate.md)
|
||||
- [AssetEditsDto](doc//AssetEditsDto.md)
|
||||
- [AssetEditActionItemDto](doc//AssetEditActionItemDto.md)
|
||||
- [AssetEditActionItemDtoParameters](doc//AssetEditActionItemDtoParameters.md)
|
||||
- [AssetEditActionItemResponseDto](doc//AssetEditActionItemResponseDto.md)
|
||||
- [AssetEditsCreateDto](doc//AssetEditsCreateDto.md)
|
||||
- [AssetEditsResponseDto](doc//AssetEditsResponseDto.md)
|
||||
- [AssetFaceCreateDto](doc//AssetFaceCreateDto.md)
|
||||
- [AssetFaceDeleteDto](doc//AssetFaceDeleteDto.md)
|
||||
- [AssetFaceResponseDto](doc//AssetFaceResponseDto.md)
|
||||
|
||||
11
mobile/openapi/lib/api.dart
generated
11
mobile/openapi/lib/api.dart
generated
@@ -97,12 +97,11 @@ part 'model/asset_copy_dto.dart';
|
||||
part 'model/asset_delta_sync_dto.dart';
|
||||
part 'model/asset_delta_sync_response_dto.dart';
|
||||
part 'model/asset_edit_action.dart';
|
||||
part 'model/asset_edit_action_crop.dart';
|
||||
part 'model/asset_edit_action_list_dto.dart';
|
||||
part 'model/asset_edit_action_list_dto_edits_inner.dart';
|
||||
part 'model/asset_edit_action_mirror.dart';
|
||||
part 'model/asset_edit_action_rotate.dart';
|
||||
part 'model/asset_edits_dto.dart';
|
||||
part 'model/asset_edit_action_item_dto.dart';
|
||||
part 'model/asset_edit_action_item_dto_parameters.dart';
|
||||
part 'model/asset_edit_action_item_response_dto.dart';
|
||||
part 'model/asset_edits_create_dto.dart';
|
||||
part 'model/asset_edits_response_dto.dart';
|
||||
part 'model/asset_face_create_dto.dart';
|
||||
part 'model/asset_face_delete_dto.dart';
|
||||
part 'model/asset_face_response_dto.dart';
|
||||
|
||||
18
mobile/openapi/lib/api/assets_api.dart
generated
18
mobile/openapi/lib/api/assets_api.dart
generated
@@ -421,14 +421,14 @@ class AssetsApi {
|
||||
///
|
||||
/// * [String] id (required):
|
||||
///
|
||||
/// * [AssetEditActionListDto] assetEditActionListDto (required):
|
||||
Future<Response> editAssetWithHttpInfo(String id, AssetEditActionListDto assetEditActionListDto,) async {
|
||||
/// * [AssetEditsCreateDto] assetEditsCreateDto (required):
|
||||
Future<Response> editAssetWithHttpInfo(String id, AssetEditsCreateDto assetEditsCreateDto,) async {
|
||||
// ignore: prefer_const_declarations
|
||||
final apiPath = r'/assets/{id}/edits'
|
||||
.replaceAll('{id}', id);
|
||||
|
||||
// ignore: prefer_final_locals
|
||||
Object? postBody = assetEditActionListDto;
|
||||
Object? postBody = assetEditsCreateDto;
|
||||
|
||||
final queryParams = <QueryParam>[];
|
||||
final headerParams = <String, String>{};
|
||||
@@ -456,9 +456,9 @@ class AssetsApi {
|
||||
///
|
||||
/// * [String] id (required):
|
||||
///
|
||||
/// * [AssetEditActionListDto] assetEditActionListDto (required):
|
||||
Future<AssetEditsDto?> editAsset(String id, AssetEditActionListDto assetEditActionListDto,) async {
|
||||
final response = await editAssetWithHttpInfo(id, assetEditActionListDto,);
|
||||
/// * [AssetEditsCreateDto] assetEditsCreateDto (required):
|
||||
Future<AssetEditsResponseDto?> editAsset(String id, AssetEditsCreateDto assetEditsCreateDto,) async {
|
||||
final response = await editAssetWithHttpInfo(id, assetEditsCreateDto,);
|
||||
if (response.statusCode >= HttpStatus.badRequest) {
|
||||
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
|
||||
}
|
||||
@@ -466,7 +466,7 @@ class AssetsApi {
|
||||
// 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), 'AssetEditsDto',) as AssetEditsDto;
|
||||
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'AssetEditsResponseDto',) as AssetEditsResponseDto;
|
||||
|
||||
}
|
||||
return null;
|
||||
@@ -576,7 +576,7 @@ class AssetsApi {
|
||||
/// Parameters:
|
||||
///
|
||||
/// * [String] id (required):
|
||||
Future<AssetEditsDto?> getAssetEdits(String id,) async {
|
||||
Future<AssetEditsResponseDto?> getAssetEdits(String id,) async {
|
||||
final response = await getAssetEditsWithHttpInfo(id,);
|
||||
if (response.statusCode >= HttpStatus.badRequest) {
|
||||
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
|
||||
@@ -585,7 +585,7 @@ class AssetsApi {
|
||||
// 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), 'AssetEditsDto',) as AssetEditsDto;
|
||||
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'AssetEditsResponseDto',) as AssetEditsResponseDto;
|
||||
|
||||
}
|
||||
return null;
|
||||
|
||||
22
mobile/openapi/lib/api_client.dart
generated
22
mobile/openapi/lib/api_client.dart
generated
@@ -240,18 +240,16 @@ class ApiClient {
|
||||
return AssetDeltaSyncResponseDto.fromJson(value);
|
||||
case 'AssetEditAction':
|
||||
return AssetEditActionTypeTransformer().decode(value);
|
||||
case 'AssetEditActionCrop':
|
||||
return AssetEditActionCrop.fromJson(value);
|
||||
case 'AssetEditActionListDto':
|
||||
return AssetEditActionListDto.fromJson(value);
|
||||
case 'AssetEditActionListDtoEditsInner':
|
||||
return AssetEditActionListDtoEditsInner.fromJson(value);
|
||||
case 'AssetEditActionMirror':
|
||||
return AssetEditActionMirror.fromJson(value);
|
||||
case 'AssetEditActionRotate':
|
||||
return AssetEditActionRotate.fromJson(value);
|
||||
case 'AssetEditsDto':
|
||||
return AssetEditsDto.fromJson(value);
|
||||
case 'AssetEditActionItemDto':
|
||||
return AssetEditActionItemDto.fromJson(value);
|
||||
case 'AssetEditActionItemDtoParameters':
|
||||
return AssetEditActionItemDtoParameters.fromJson(value);
|
||||
case 'AssetEditActionItemResponseDto':
|
||||
return AssetEditActionItemResponseDto.fromJson(value);
|
||||
case 'AssetEditsCreateDto':
|
||||
return AssetEditsCreateDto.fromJson(value);
|
||||
case 'AssetEditsResponseDto':
|
||||
return AssetEditsResponseDto.fromJson(value);
|
||||
case 'AssetFaceCreateDto':
|
||||
return AssetFaceCreateDto.fromJson(value);
|
||||
case 'AssetFaceDeleteDto':
|
||||
|
||||
@@ -10,9 +10,9 @@
|
||||
|
||||
part of openapi.api;
|
||||
|
||||
class AssetEditActionCrop {
|
||||
/// Returns a new [AssetEditActionCrop] instance.
|
||||
AssetEditActionCrop({
|
||||
class AssetEditActionItemDto {
|
||||
/// Returns a new [AssetEditActionItemDto] instance.
|
||||
AssetEditActionItemDto({
|
||||
required this.action,
|
||||
required this.parameters,
|
||||
});
|
||||
@@ -20,10 +20,10 @@ class AssetEditActionCrop {
|
||||
/// Type of edit action to perform
|
||||
AssetEditAction action;
|
||||
|
||||
CropParameters parameters;
|
||||
AssetEditActionItemDtoParameters parameters;
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) => identical(this, other) || other is AssetEditActionCrop &&
|
||||
bool operator ==(Object other) => identical(this, other) || other is AssetEditActionItemDto &&
|
||||
other.action == action &&
|
||||
other.parameters == parameters;
|
||||
|
||||
@@ -34,7 +34,7 @@ class AssetEditActionCrop {
|
||||
(parameters.hashCode);
|
||||
|
||||
@override
|
||||
String toString() => 'AssetEditActionCrop[action=$action, parameters=$parameters]';
|
||||
String toString() => 'AssetEditActionItemDto[action=$action, parameters=$parameters]';
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final json = <String, dynamic>{};
|
||||
@@ -43,27 +43,27 @@ class AssetEditActionCrop {
|
||||
return json;
|
||||
}
|
||||
|
||||
/// Returns a new [AssetEditActionCrop] instance and imports its values from
|
||||
/// Returns a new [AssetEditActionItemDto] instance and imports its values from
|
||||
/// [value] if it's a [Map], null otherwise.
|
||||
// ignore: prefer_constructors_over_static_methods
|
||||
static AssetEditActionCrop? fromJson(dynamic value) {
|
||||
upgradeDto(value, "AssetEditActionCrop");
|
||||
static AssetEditActionItemDto? fromJson(dynamic value) {
|
||||
upgradeDto(value, "AssetEditActionItemDto");
|
||||
if (value is Map) {
|
||||
final json = value.cast<String, dynamic>();
|
||||
|
||||
return AssetEditActionCrop(
|
||||
return AssetEditActionItemDto(
|
||||
action: AssetEditAction.fromJson(json[r'action'])!,
|
||||
parameters: CropParameters.fromJson(json[r'parameters'])!,
|
||||
parameters: AssetEditActionItemDtoParameters.fromJson(json[r'parameters'])!,
|
||||
);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
static List<AssetEditActionCrop> listFromJson(dynamic json, {bool growable = false,}) {
|
||||
final result = <AssetEditActionCrop>[];
|
||||
static List<AssetEditActionItemDto> listFromJson(dynamic json, {bool growable = false,}) {
|
||||
final result = <AssetEditActionItemDto>[];
|
||||
if (json is List && json.isNotEmpty) {
|
||||
for (final row in json) {
|
||||
final value = AssetEditActionCrop.fromJson(row);
|
||||
final value = AssetEditActionItemDto.fromJson(row);
|
||||
if (value != null) {
|
||||
result.add(value);
|
||||
}
|
||||
@@ -72,12 +72,12 @@ class AssetEditActionCrop {
|
||||
return result.toList(growable: growable);
|
||||
}
|
||||
|
||||
static Map<String, AssetEditActionCrop> mapFromJson(dynamic json) {
|
||||
final map = <String, AssetEditActionCrop>{};
|
||||
static Map<String, AssetEditActionItemDto> mapFromJson(dynamic json) {
|
||||
final map = <String, AssetEditActionItemDto>{};
|
||||
if (json is Map && json.isNotEmpty) {
|
||||
json = json.cast<String, dynamic>(); // ignore: parameter_assignments
|
||||
for (final entry in json.entries) {
|
||||
final value = AssetEditActionCrop.fromJson(entry.value);
|
||||
final value = AssetEditActionItemDto.fromJson(entry.value);
|
||||
if (value != null) {
|
||||
map[entry.key] = value;
|
||||
}
|
||||
@@ -86,14 +86,14 @@ class AssetEditActionCrop {
|
||||
return map;
|
||||
}
|
||||
|
||||
// maps a json object with a list of AssetEditActionCrop-objects as value to a dart map
|
||||
static Map<String, List<AssetEditActionCrop>> mapListFromJson(dynamic json, {bool growable = false,}) {
|
||||
final map = <String, List<AssetEditActionCrop>>{};
|
||||
// maps a json object with a list of AssetEditActionItemDto-objects as value to a dart map
|
||||
static Map<String, List<AssetEditActionItemDto>> mapListFromJson(dynamic json, {bool growable = false,}) {
|
||||
final map = <String, List<AssetEditActionItemDto>>{};
|
||||
if (json is Map && json.isNotEmpty) {
|
||||
// ignore: parameter_assignments
|
||||
json = json.cast<String, dynamic>();
|
||||
for (final entry in json.entries) {
|
||||
map[entry.key] = AssetEditActionCrop.listFromJson(entry.value, growable: growable,);
|
||||
map[entry.key] = AssetEditActionItemDto.listFromJson(entry.value, growable: growable,);
|
||||
}
|
||||
}
|
||||
return map;
|
||||
153
mobile/openapi/lib/model/asset_edit_action_item_dto_parameters.dart
generated
Normal file
153
mobile/openapi/lib/model/asset_edit_action_item_dto_parameters.dart
generated
Normal file
@@ -0,0 +1,153 @@
|
||||
//
|
||||
// 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 AssetEditActionItemDtoParameters {
|
||||
/// Returns a new [AssetEditActionItemDtoParameters] instance.
|
||||
AssetEditActionItemDtoParameters({
|
||||
required this.height,
|
||||
required this.width,
|
||||
required this.x,
|
||||
required this.y,
|
||||
required this.angle,
|
||||
required this.axis,
|
||||
});
|
||||
|
||||
/// Height of the crop
|
||||
///
|
||||
/// Minimum value: 1
|
||||
num height;
|
||||
|
||||
/// Width of the crop
|
||||
///
|
||||
/// Minimum value: 1
|
||||
num width;
|
||||
|
||||
/// Top-Left X coordinate of crop
|
||||
///
|
||||
/// Minimum value: 0
|
||||
num x;
|
||||
|
||||
/// Top-Left Y coordinate of crop
|
||||
///
|
||||
/// Minimum value: 0
|
||||
num y;
|
||||
|
||||
/// Rotation angle in degrees
|
||||
num angle;
|
||||
|
||||
/// Axis to mirror along
|
||||
MirrorAxis axis;
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) => identical(this, other) || other is AssetEditActionItemDtoParameters &&
|
||||
other.height == height &&
|
||||
other.width == width &&
|
||||
other.x == x &&
|
||||
other.y == y &&
|
||||
other.angle == angle &&
|
||||
other.axis == axis;
|
||||
|
||||
@override
|
||||
int get hashCode =>
|
||||
// ignore: unnecessary_parenthesis
|
||||
(height.hashCode) +
|
||||
(width.hashCode) +
|
||||
(x.hashCode) +
|
||||
(y.hashCode) +
|
||||
(angle.hashCode) +
|
||||
(axis.hashCode);
|
||||
|
||||
@override
|
||||
String toString() => 'AssetEditActionItemDtoParameters[height=$height, width=$width, x=$x, y=$y, angle=$angle, axis=$axis]';
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final json = <String, dynamic>{};
|
||||
json[r'height'] = this.height;
|
||||
json[r'width'] = this.width;
|
||||
json[r'x'] = this.x;
|
||||
json[r'y'] = this.y;
|
||||
json[r'angle'] = this.angle;
|
||||
json[r'axis'] = this.axis;
|
||||
return json;
|
||||
}
|
||||
|
||||
/// Returns a new [AssetEditActionItemDtoParameters] instance and imports its values from
|
||||
/// [value] if it's a [Map], null otherwise.
|
||||
// ignore: prefer_constructors_over_static_methods
|
||||
static AssetEditActionItemDtoParameters? fromJson(dynamic value) {
|
||||
upgradeDto(value, "AssetEditActionItemDtoParameters");
|
||||
if (value is Map) {
|
||||
final json = value.cast<String, dynamic>();
|
||||
|
||||
return AssetEditActionItemDtoParameters(
|
||||
height: num.parse('${json[r'height']}'),
|
||||
width: num.parse('${json[r'width']}'),
|
||||
x: num.parse('${json[r'x']}'),
|
||||
y: num.parse('${json[r'y']}'),
|
||||
angle: num.parse('${json[r'angle']}'),
|
||||
axis: MirrorAxis.fromJson(json[r'axis'])!,
|
||||
);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
static List<AssetEditActionItemDtoParameters> listFromJson(dynamic json, {bool growable = false,}) {
|
||||
final result = <AssetEditActionItemDtoParameters>[];
|
||||
if (json is List && json.isNotEmpty) {
|
||||
for (final row in json) {
|
||||
final value = AssetEditActionItemDtoParameters.fromJson(row);
|
||||
if (value != null) {
|
||||
result.add(value);
|
||||
}
|
||||
}
|
||||
}
|
||||
return result.toList(growable: growable);
|
||||
}
|
||||
|
||||
static Map<String, AssetEditActionItemDtoParameters> mapFromJson(dynamic json) {
|
||||
final map = <String, AssetEditActionItemDtoParameters>{};
|
||||
if (json is Map && json.isNotEmpty) {
|
||||
json = json.cast<String, dynamic>(); // ignore: parameter_assignments
|
||||
for (final entry in json.entries) {
|
||||
final value = AssetEditActionItemDtoParameters.fromJson(entry.value);
|
||||
if (value != null) {
|
||||
map[entry.key] = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
// maps a json object with a list of AssetEditActionItemDtoParameters-objects as value to a dart map
|
||||
static Map<String, List<AssetEditActionItemDtoParameters>> mapListFromJson(dynamic json, {bool growable = false,}) {
|
||||
final map = <String, List<AssetEditActionItemDtoParameters>>{};
|
||||
if (json is Map && json.isNotEmpty) {
|
||||
// ignore: parameter_assignments
|
||||
json = json.cast<String, dynamic>();
|
||||
for (final entry in json.entries) {
|
||||
map[entry.key] = AssetEditActionItemDtoParameters.listFromJson(entry.value, growable: growable,);
|
||||
}
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
/// The list of required keys that must be present in a JSON.
|
||||
static const requiredKeys = <String>{
|
||||
'height',
|
||||
'width',
|
||||
'x',
|
||||
'y',
|
||||
'angle',
|
||||
'axis',
|
||||
};
|
||||
}
|
||||
|
||||
@@ -10,60 +10,67 @@
|
||||
|
||||
part of openapi.api;
|
||||
|
||||
class AssetEditActionListDtoEditsInner {
|
||||
/// Returns a new [AssetEditActionListDtoEditsInner] instance.
|
||||
AssetEditActionListDtoEditsInner({
|
||||
class AssetEditActionItemResponseDto {
|
||||
/// Returns a new [AssetEditActionItemResponseDto] instance.
|
||||
AssetEditActionItemResponseDto({
|
||||
required this.action,
|
||||
required this.id,
|
||||
required this.parameters,
|
||||
});
|
||||
|
||||
/// Type of edit action to perform
|
||||
AssetEditAction action;
|
||||
|
||||
MirrorParameters parameters;
|
||||
String id;
|
||||
|
||||
AssetEditActionItemDtoParameters parameters;
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) => identical(this, other) || other is AssetEditActionListDtoEditsInner &&
|
||||
bool operator ==(Object other) => identical(this, other) || other is AssetEditActionItemResponseDto &&
|
||||
other.action == action &&
|
||||
other.id == id &&
|
||||
other.parameters == parameters;
|
||||
|
||||
@override
|
||||
int get hashCode =>
|
||||
// ignore: unnecessary_parenthesis
|
||||
(action.hashCode) +
|
||||
(id.hashCode) +
|
||||
(parameters.hashCode);
|
||||
|
||||
@override
|
||||
String toString() => 'AssetEditActionListDtoEditsInner[action=$action, parameters=$parameters]';
|
||||
String toString() => 'AssetEditActionItemResponseDto[action=$action, id=$id, parameters=$parameters]';
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final json = <String, dynamic>{};
|
||||
json[r'action'] = this.action;
|
||||
json[r'id'] = this.id;
|
||||
json[r'parameters'] = this.parameters;
|
||||
return json;
|
||||
}
|
||||
|
||||
/// Returns a new [AssetEditActionListDtoEditsInner] instance and imports its values from
|
||||
/// Returns a new [AssetEditActionItemResponseDto] instance and imports its values from
|
||||
/// [value] if it's a [Map], null otherwise.
|
||||
// ignore: prefer_constructors_over_static_methods
|
||||
static AssetEditActionListDtoEditsInner? fromJson(dynamic value) {
|
||||
upgradeDto(value, "AssetEditActionListDtoEditsInner");
|
||||
static AssetEditActionItemResponseDto? fromJson(dynamic value) {
|
||||
upgradeDto(value, "AssetEditActionItemResponseDto");
|
||||
if (value is Map) {
|
||||
final json = value.cast<String, dynamic>();
|
||||
|
||||
return AssetEditActionListDtoEditsInner(
|
||||
return AssetEditActionItemResponseDto(
|
||||
action: AssetEditAction.fromJson(json[r'action'])!,
|
||||
parameters: MirrorParameters.fromJson(json[r'parameters'])!,
|
||||
id: mapValueOfType<String>(json, r'id')!,
|
||||
parameters: AssetEditActionItemDtoParameters.fromJson(json[r'parameters'])!,
|
||||
);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
static List<AssetEditActionListDtoEditsInner> listFromJson(dynamic json, {bool growable = false,}) {
|
||||
final result = <AssetEditActionListDtoEditsInner>[];
|
||||
static List<AssetEditActionItemResponseDto> listFromJson(dynamic json, {bool growable = false,}) {
|
||||
final result = <AssetEditActionItemResponseDto>[];
|
||||
if (json is List && json.isNotEmpty) {
|
||||
for (final row in json) {
|
||||
final value = AssetEditActionListDtoEditsInner.fromJson(row);
|
||||
final value = AssetEditActionItemResponseDto.fromJson(row);
|
||||
if (value != null) {
|
||||
result.add(value);
|
||||
}
|
||||
@@ -72,12 +79,12 @@ class AssetEditActionListDtoEditsInner {
|
||||
return result.toList(growable: growable);
|
||||
}
|
||||
|
||||
static Map<String, AssetEditActionListDtoEditsInner> mapFromJson(dynamic json) {
|
||||
final map = <String, AssetEditActionListDtoEditsInner>{};
|
||||
static Map<String, AssetEditActionItemResponseDto> mapFromJson(dynamic json) {
|
||||
final map = <String, AssetEditActionItemResponseDto>{};
|
||||
if (json is Map && json.isNotEmpty) {
|
||||
json = json.cast<String, dynamic>(); // ignore: parameter_assignments
|
||||
for (final entry in json.entries) {
|
||||
final value = AssetEditActionListDtoEditsInner.fromJson(entry.value);
|
||||
final value = AssetEditActionItemResponseDto.fromJson(entry.value);
|
||||
if (value != null) {
|
||||
map[entry.key] = value;
|
||||
}
|
||||
@@ -86,14 +93,14 @@ class AssetEditActionListDtoEditsInner {
|
||||
return map;
|
||||
}
|
||||
|
||||
// maps a json object with a list of AssetEditActionListDtoEditsInner-objects as value to a dart map
|
||||
static Map<String, List<AssetEditActionListDtoEditsInner>> mapListFromJson(dynamic json, {bool growable = false,}) {
|
||||
final map = <String, List<AssetEditActionListDtoEditsInner>>{};
|
||||
// maps a json object with a list of AssetEditActionItemResponseDto-objects as value to a dart map
|
||||
static Map<String, List<AssetEditActionItemResponseDto>> mapListFromJson(dynamic json, {bool growable = false,}) {
|
||||
final map = <String, List<AssetEditActionItemResponseDto>>{};
|
||||
if (json is Map && json.isNotEmpty) {
|
||||
// ignore: parameter_assignments
|
||||
json = json.cast<String, dynamic>();
|
||||
for (final entry in json.entries) {
|
||||
map[entry.key] = AssetEditActionListDtoEditsInner.listFromJson(entry.value, growable: growable,);
|
||||
map[entry.key] = AssetEditActionItemResponseDto.listFromJson(entry.value, growable: growable,);
|
||||
}
|
||||
}
|
||||
return map;
|
||||
@@ -102,6 +109,7 @@ class AssetEditActionListDtoEditsInner {
|
||||
/// The list of required keys that must be present in a JSON.
|
||||
static const requiredKeys = <String>{
|
||||
'action',
|
||||
'id',
|
||||
'parameters',
|
||||
};
|
||||
}
|
||||
108
mobile/openapi/lib/model/asset_edit_action_mirror.dart
generated
108
mobile/openapi/lib/model/asset_edit_action_mirror.dart
generated
@@ -1,108 +0,0 @@
|
||||
//
|
||||
// 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 AssetEditActionMirror {
|
||||
/// Returns a new [AssetEditActionMirror] instance.
|
||||
AssetEditActionMirror({
|
||||
required this.action,
|
||||
required this.parameters,
|
||||
});
|
||||
|
||||
/// Type of edit action to perform
|
||||
AssetEditAction action;
|
||||
|
||||
MirrorParameters parameters;
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) => identical(this, other) || other is AssetEditActionMirror &&
|
||||
other.action == action &&
|
||||
other.parameters == parameters;
|
||||
|
||||
@override
|
||||
int get hashCode =>
|
||||
// ignore: unnecessary_parenthesis
|
||||
(action.hashCode) +
|
||||
(parameters.hashCode);
|
||||
|
||||
@override
|
||||
String toString() => 'AssetEditActionMirror[action=$action, parameters=$parameters]';
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final json = <String, dynamic>{};
|
||||
json[r'action'] = this.action;
|
||||
json[r'parameters'] = this.parameters;
|
||||
return json;
|
||||
}
|
||||
|
||||
/// Returns a new [AssetEditActionMirror] instance and imports its values from
|
||||
/// [value] if it's a [Map], null otherwise.
|
||||
// ignore: prefer_constructors_over_static_methods
|
||||
static AssetEditActionMirror? fromJson(dynamic value) {
|
||||
upgradeDto(value, "AssetEditActionMirror");
|
||||
if (value is Map) {
|
||||
final json = value.cast<String, dynamic>();
|
||||
|
||||
return AssetEditActionMirror(
|
||||
action: AssetEditAction.fromJson(json[r'action'])!,
|
||||
parameters: MirrorParameters.fromJson(json[r'parameters'])!,
|
||||
);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
static List<AssetEditActionMirror> listFromJson(dynamic json, {bool growable = false,}) {
|
||||
final result = <AssetEditActionMirror>[];
|
||||
if (json is List && json.isNotEmpty) {
|
||||
for (final row in json) {
|
||||
final value = AssetEditActionMirror.fromJson(row);
|
||||
if (value != null) {
|
||||
result.add(value);
|
||||
}
|
||||
}
|
||||
}
|
||||
return result.toList(growable: growable);
|
||||
}
|
||||
|
||||
static Map<String, AssetEditActionMirror> mapFromJson(dynamic json) {
|
||||
final map = <String, AssetEditActionMirror>{};
|
||||
if (json is Map && json.isNotEmpty) {
|
||||
json = json.cast<String, dynamic>(); // ignore: parameter_assignments
|
||||
for (final entry in json.entries) {
|
||||
final value = AssetEditActionMirror.fromJson(entry.value);
|
||||
if (value != null) {
|
||||
map[entry.key] = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
// maps a json object with a list of AssetEditActionMirror-objects as value to a dart map
|
||||
static Map<String, List<AssetEditActionMirror>> mapListFromJson(dynamic json, {bool growable = false,}) {
|
||||
final map = <String, List<AssetEditActionMirror>>{};
|
||||
if (json is Map && json.isNotEmpty) {
|
||||
// ignore: parameter_assignments
|
||||
json = json.cast<String, dynamic>();
|
||||
for (final entry in json.entries) {
|
||||
map[entry.key] = AssetEditActionMirror.listFromJson(entry.value, growable: growable,);
|
||||
}
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
/// The list of required keys that must be present in a JSON.
|
||||
static const requiredKeys = <String>{
|
||||
'action',
|
||||
'parameters',
|
||||
};
|
||||
}
|
||||
|
||||
108
mobile/openapi/lib/model/asset_edit_action_rotate.dart
generated
108
mobile/openapi/lib/model/asset_edit_action_rotate.dart
generated
@@ -1,108 +0,0 @@
|
||||
//
|
||||
// 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 AssetEditActionRotate {
|
||||
/// Returns a new [AssetEditActionRotate] instance.
|
||||
AssetEditActionRotate({
|
||||
required this.action,
|
||||
required this.parameters,
|
||||
});
|
||||
|
||||
/// Type of edit action to perform
|
||||
AssetEditAction action;
|
||||
|
||||
RotateParameters parameters;
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) => identical(this, other) || other is AssetEditActionRotate &&
|
||||
other.action == action &&
|
||||
other.parameters == parameters;
|
||||
|
||||
@override
|
||||
int get hashCode =>
|
||||
// ignore: unnecessary_parenthesis
|
||||
(action.hashCode) +
|
||||
(parameters.hashCode);
|
||||
|
||||
@override
|
||||
String toString() => 'AssetEditActionRotate[action=$action, parameters=$parameters]';
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final json = <String, dynamic>{};
|
||||
json[r'action'] = this.action;
|
||||
json[r'parameters'] = this.parameters;
|
||||
return json;
|
||||
}
|
||||
|
||||
/// Returns a new [AssetEditActionRotate] instance and imports its values from
|
||||
/// [value] if it's a [Map], null otherwise.
|
||||
// ignore: prefer_constructors_over_static_methods
|
||||
static AssetEditActionRotate? fromJson(dynamic value) {
|
||||
upgradeDto(value, "AssetEditActionRotate");
|
||||
if (value is Map) {
|
||||
final json = value.cast<String, dynamic>();
|
||||
|
||||
return AssetEditActionRotate(
|
||||
action: AssetEditAction.fromJson(json[r'action'])!,
|
||||
parameters: RotateParameters.fromJson(json[r'parameters'])!,
|
||||
);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
static List<AssetEditActionRotate> listFromJson(dynamic json, {bool growable = false,}) {
|
||||
final result = <AssetEditActionRotate>[];
|
||||
if (json is List && json.isNotEmpty) {
|
||||
for (final row in json) {
|
||||
final value = AssetEditActionRotate.fromJson(row);
|
||||
if (value != null) {
|
||||
result.add(value);
|
||||
}
|
||||
}
|
||||
}
|
||||
return result.toList(growable: growable);
|
||||
}
|
||||
|
||||
static Map<String, AssetEditActionRotate> mapFromJson(dynamic json) {
|
||||
final map = <String, AssetEditActionRotate>{};
|
||||
if (json is Map && json.isNotEmpty) {
|
||||
json = json.cast<String, dynamic>(); // ignore: parameter_assignments
|
||||
for (final entry in json.entries) {
|
||||
final value = AssetEditActionRotate.fromJson(entry.value);
|
||||
if (value != null) {
|
||||
map[entry.key] = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
// maps a json object with a list of AssetEditActionRotate-objects as value to a dart map
|
||||
static Map<String, List<AssetEditActionRotate>> mapListFromJson(dynamic json, {bool growable = false,}) {
|
||||
final map = <String, List<AssetEditActionRotate>>{};
|
||||
if (json is Map && json.isNotEmpty) {
|
||||
// ignore: parameter_assignments
|
||||
json = json.cast<String, dynamic>();
|
||||
for (final entry in json.entries) {
|
||||
map[entry.key] = AssetEditActionRotate.listFromJson(entry.value, growable: growable,);
|
||||
}
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
/// The list of required keys that must be present in a JSON.
|
||||
static const requiredKeys = <String>{
|
||||
'action',
|
||||
'parameters',
|
||||
};
|
||||
}
|
||||
|
||||
@@ -10,17 +10,17 @@
|
||||
|
||||
part of openapi.api;
|
||||
|
||||
class AssetEditActionListDto {
|
||||
/// Returns a new [AssetEditActionListDto] instance.
|
||||
AssetEditActionListDto({
|
||||
class AssetEditsCreateDto {
|
||||
/// Returns a new [AssetEditsCreateDto] instance.
|
||||
AssetEditsCreateDto({
|
||||
this.edits = const [],
|
||||
});
|
||||
|
||||
/// List of edit actions to apply (crop, rotate, or mirror)
|
||||
List<AssetEditActionListDtoEditsInner> edits;
|
||||
List<AssetEditActionItemDto> edits;
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) => identical(this, other) || other is AssetEditActionListDto &&
|
||||
bool operator ==(Object other) => identical(this, other) || other is AssetEditsCreateDto &&
|
||||
_deepEquality.equals(other.edits, edits);
|
||||
|
||||
@override
|
||||
@@ -29,7 +29,7 @@ class AssetEditActionListDto {
|
||||
(edits.hashCode);
|
||||
|
||||
@override
|
||||
String toString() => 'AssetEditActionListDto[edits=$edits]';
|
||||
String toString() => 'AssetEditsCreateDto[edits=$edits]';
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final json = <String, dynamic>{};
|
||||
@@ -37,26 +37,26 @@ class AssetEditActionListDto {
|
||||
return json;
|
||||
}
|
||||
|
||||
/// Returns a new [AssetEditActionListDto] instance and imports its values from
|
||||
/// Returns a new [AssetEditsCreateDto] instance and imports its values from
|
||||
/// [value] if it's a [Map], null otherwise.
|
||||
// ignore: prefer_constructors_over_static_methods
|
||||
static AssetEditActionListDto? fromJson(dynamic value) {
|
||||
upgradeDto(value, "AssetEditActionListDto");
|
||||
static AssetEditsCreateDto? fromJson(dynamic value) {
|
||||
upgradeDto(value, "AssetEditsCreateDto");
|
||||
if (value is Map) {
|
||||
final json = value.cast<String, dynamic>();
|
||||
|
||||
return AssetEditActionListDto(
|
||||
edits: AssetEditActionListDtoEditsInner.listFromJson(json[r'edits']),
|
||||
return AssetEditsCreateDto(
|
||||
edits: AssetEditActionItemDto.listFromJson(json[r'edits']),
|
||||
);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
static List<AssetEditActionListDto> listFromJson(dynamic json, {bool growable = false,}) {
|
||||
final result = <AssetEditActionListDto>[];
|
||||
static List<AssetEditsCreateDto> listFromJson(dynamic json, {bool growable = false,}) {
|
||||
final result = <AssetEditsCreateDto>[];
|
||||
if (json is List && json.isNotEmpty) {
|
||||
for (final row in json) {
|
||||
final value = AssetEditActionListDto.fromJson(row);
|
||||
final value = AssetEditsCreateDto.fromJson(row);
|
||||
if (value != null) {
|
||||
result.add(value);
|
||||
}
|
||||
@@ -65,12 +65,12 @@ class AssetEditActionListDto {
|
||||
return result.toList(growable: growable);
|
||||
}
|
||||
|
||||
static Map<String, AssetEditActionListDto> mapFromJson(dynamic json) {
|
||||
final map = <String, AssetEditActionListDto>{};
|
||||
static Map<String, AssetEditsCreateDto> mapFromJson(dynamic json) {
|
||||
final map = <String, AssetEditsCreateDto>{};
|
||||
if (json is Map && json.isNotEmpty) {
|
||||
json = json.cast<String, dynamic>(); // ignore: parameter_assignments
|
||||
for (final entry in json.entries) {
|
||||
final value = AssetEditActionListDto.fromJson(entry.value);
|
||||
final value = AssetEditsCreateDto.fromJson(entry.value);
|
||||
if (value != null) {
|
||||
map[entry.key] = value;
|
||||
}
|
||||
@@ -79,14 +79,14 @@ class AssetEditActionListDto {
|
||||
return map;
|
||||
}
|
||||
|
||||
// maps a json object with a list of AssetEditActionListDto-objects as value to a dart map
|
||||
static Map<String, List<AssetEditActionListDto>> mapListFromJson(dynamic json, {bool growable = false,}) {
|
||||
final map = <String, List<AssetEditActionListDto>>{};
|
||||
// maps a json object with a list of AssetEditsCreateDto-objects as value to a dart map
|
||||
static Map<String, List<AssetEditsCreateDto>> mapListFromJson(dynamic json, {bool growable = false,}) {
|
||||
final map = <String, List<AssetEditsCreateDto>>{};
|
||||
if (json is Map && json.isNotEmpty) {
|
||||
// ignore: parameter_assignments
|
||||
json = json.cast<String, dynamic>();
|
||||
for (final entry in json.entries) {
|
||||
map[entry.key] = AssetEditActionListDto.listFromJson(entry.value, growable: growable,);
|
||||
map[entry.key] = AssetEditsCreateDto.listFromJson(entry.value, growable: growable,);
|
||||
}
|
||||
}
|
||||
return map;
|
||||
@@ -10,21 +10,21 @@
|
||||
|
||||
part of openapi.api;
|
||||
|
||||
class AssetEditsDto {
|
||||
/// Returns a new [AssetEditsDto] instance.
|
||||
AssetEditsDto({
|
||||
class AssetEditsResponseDto {
|
||||
/// Returns a new [AssetEditsResponseDto] instance.
|
||||
AssetEditsResponseDto({
|
||||
required this.assetId,
|
||||
this.edits = const [],
|
||||
});
|
||||
|
||||
/// Asset ID to apply edits to
|
||||
/// Asset ID these edits belong to
|
||||
String assetId;
|
||||
|
||||
/// List of edit actions to apply (crop, rotate, or mirror)
|
||||
List<AssetEditActionListDtoEditsInner> edits;
|
||||
/// List of edit actions applied to the asset
|
||||
List<AssetEditActionItemResponseDto> edits;
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) => identical(this, other) || other is AssetEditsDto &&
|
||||
bool operator ==(Object other) => identical(this, other) || other is AssetEditsResponseDto &&
|
||||
other.assetId == assetId &&
|
||||
_deepEquality.equals(other.edits, edits);
|
||||
|
||||
@@ -35,7 +35,7 @@ class AssetEditsDto {
|
||||
(edits.hashCode);
|
||||
|
||||
@override
|
||||
String toString() => 'AssetEditsDto[assetId=$assetId, edits=$edits]';
|
||||
String toString() => 'AssetEditsResponseDto[assetId=$assetId, edits=$edits]';
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final json = <String, dynamic>{};
|
||||
@@ -44,27 +44,27 @@ class AssetEditsDto {
|
||||
return json;
|
||||
}
|
||||
|
||||
/// Returns a new [AssetEditsDto] instance and imports its values from
|
||||
/// Returns a new [AssetEditsResponseDto] instance and imports its values from
|
||||
/// [value] if it's a [Map], null otherwise.
|
||||
// ignore: prefer_constructors_over_static_methods
|
||||
static AssetEditsDto? fromJson(dynamic value) {
|
||||
upgradeDto(value, "AssetEditsDto");
|
||||
static AssetEditsResponseDto? fromJson(dynamic value) {
|
||||
upgradeDto(value, "AssetEditsResponseDto");
|
||||
if (value is Map) {
|
||||
final json = value.cast<String, dynamic>();
|
||||
|
||||
return AssetEditsDto(
|
||||
return AssetEditsResponseDto(
|
||||
assetId: mapValueOfType<String>(json, r'assetId')!,
|
||||
edits: AssetEditActionListDtoEditsInner.listFromJson(json[r'edits']),
|
||||
edits: AssetEditActionItemResponseDto.listFromJson(json[r'edits']),
|
||||
);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
static List<AssetEditsDto> listFromJson(dynamic json, {bool growable = false,}) {
|
||||
final result = <AssetEditsDto>[];
|
||||
static List<AssetEditsResponseDto> listFromJson(dynamic json, {bool growable = false,}) {
|
||||
final result = <AssetEditsResponseDto>[];
|
||||
if (json is List && json.isNotEmpty) {
|
||||
for (final row in json) {
|
||||
final value = AssetEditsDto.fromJson(row);
|
||||
final value = AssetEditsResponseDto.fromJson(row);
|
||||
if (value != null) {
|
||||
result.add(value);
|
||||
}
|
||||
@@ -73,12 +73,12 @@ class AssetEditsDto {
|
||||
return result.toList(growable: growable);
|
||||
}
|
||||
|
||||
static Map<String, AssetEditsDto> mapFromJson(dynamic json) {
|
||||
final map = <String, AssetEditsDto>{};
|
||||
static Map<String, AssetEditsResponseDto> mapFromJson(dynamic json) {
|
||||
final map = <String, AssetEditsResponseDto>{};
|
||||
if (json is Map && json.isNotEmpty) {
|
||||
json = json.cast<String, dynamic>(); // ignore: parameter_assignments
|
||||
for (final entry in json.entries) {
|
||||
final value = AssetEditsDto.fromJson(entry.value);
|
||||
final value = AssetEditsResponseDto.fromJson(entry.value);
|
||||
if (value != null) {
|
||||
map[entry.key] = value;
|
||||
}
|
||||
@@ -87,14 +87,14 @@ class AssetEditsDto {
|
||||
return map;
|
||||
}
|
||||
|
||||
// maps a json object with a list of AssetEditsDto-objects as value to a dart map
|
||||
static Map<String, List<AssetEditsDto>> mapListFromJson(dynamic json, {bool growable = false,}) {
|
||||
final map = <String, List<AssetEditsDto>>{};
|
||||
// maps a json object with a list of AssetEditsResponseDto-objects as value to a dart map
|
||||
static Map<String, List<AssetEditsResponseDto>> mapListFromJson(dynamic json, {bool growable = false,}) {
|
||||
final map = <String, List<AssetEditsResponseDto>>{};
|
||||
if (json is Map && json.isNotEmpty) {
|
||||
// ignore: parameter_assignments
|
||||
json = json.cast<String, dynamic>();
|
||||
for (final entry in json.entries) {
|
||||
map[entry.key] = AssetEditsDto.listFromJson(entry.value, growable: growable,);
|
||||
map[entry.key] = AssetEditsResponseDto.listFromJson(entry.value, growable: growable,);
|
||||
}
|
||||
}
|
||||
return map;
|
||||
Reference in New Issue
Block a user