1
0
mirror of https://github.com/immich-app/immich.git synced 2025-08-08 23:07:06 +02:00

Fixed openapi generation command for mobile

This commit is contained in:
Alex Tran
2022-12-06 16:10:04 -06:00
parent f91bdc2785
commit b5a5363a6a
82 changed files with 363 additions and 4231 deletions

View File

@ -1,111 +0,0 @@
//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
// @dart=2.12
// 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 AdminConfigResponseDto {
/// Returns a new [AdminConfigResponseDto] instance.
AdminConfigResponseDto({
required this.config,
});
Object config;
@override
bool operator ==(Object other) => identical(this, other) || other is AdminConfigResponseDto &&
other.config == config;
@override
int get hashCode =>
// ignore: unnecessary_parenthesis
(config.hashCode);
@override
String toString() => 'AdminConfigResponseDto[config=$config]';
Map<String, dynamic> toJson() {
final _json = <String, dynamic>{};
_json[r'config'] = config;
return _json;
}
/// Returns a new [AdminConfigResponseDto] instance and imports its values from
/// [value] if it's a [Map], null otherwise.
// ignore: prefer_constructors_over_static_methods
static AdminConfigResponseDto? fromJson(dynamic value) {
if (value is Map) {
final json = value.cast<String, dynamic>();
// Ensure that the map contains the required keys.
// Note 1: the values aren't checked for validity beyond being non-null.
// Note 2: this code is stripped in release mode!
assert(() {
requiredKeys.forEach((key) {
assert(json.containsKey(key), 'Required key "AdminConfigResponseDto[$key]" is missing from JSON.');
assert(json[key] != null, 'Required key "AdminConfigResponseDto[$key]" has a null value in JSON.');
});
return true;
}());
return AdminConfigResponseDto(
config: mapValueOfType<Object>(json, r'config')!,
);
}
return null;
}
static List<AdminConfigResponseDto>? listFromJson(dynamic json, {bool growable = false,}) {
final result = <AdminConfigResponseDto>[];
if (json is List && json.isNotEmpty) {
for (final row in json) {
final value = AdminConfigResponseDto.fromJson(row);
if (value != null) {
result.add(value);
}
}
}
return result.toList(growable: growable);
}
static Map<String, AdminConfigResponseDto> mapFromJson(dynamic json) {
final map = <String, AdminConfigResponseDto>{};
if (json is Map && json.isNotEmpty) {
json = json.cast<String, dynamic>(); // ignore: parameter_assignments
for (final entry in json.entries) {
final value = AdminConfigResponseDto.fromJson(entry.value);
if (value != null) {
map[entry.key] = value;
}
}
}
return map;
}
// maps a json object with a list of AdminConfigResponseDto-objects as value to a dart map
static Map<String, List<AdminConfigResponseDto>> mapListFromJson(dynamic json, {bool growable = false,}) {
final map = <String, List<AdminConfigResponseDto>>{};
if (json is Map && json.isNotEmpty) {
json = json.cast<String, dynamic>(); // ignore: parameter_assignments
for (final entry in json.entries) {
final value = AdminConfigResponseDto.listFromJson(entry.value, growable: growable,);
if (value != null) {
map[entry.key] = value;
}
}
}
return map;
}
/// The list of required keys that must be present in a JSON.
static const requiredKeys = <String>{
'config',
};
}

View File

@ -1,119 +0,0 @@
//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
// @dart=2.12
// 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 AssetCountByTimeGroupDto {
/// Returns a new [AssetCountByTimeGroupDto] instance.
AssetCountByTimeGroupDto({
required this.timeGroup,
required this.count,
});
String timeGroup;
int count;
@override
bool operator ==(Object other) => identical(this, other) || other is AssetCountByTimeGroupDto &&
other.timeGroup == timeGroup &&
other.count == count;
@override
int get hashCode =>
// ignore: unnecessary_parenthesis
(timeGroup.hashCode) +
(count.hashCode);
@override
String toString() => 'AssetCountByTimeGroupDto[timeGroup=$timeGroup, count=$count]';
Map<String, dynamic> toJson() {
final _json = <String, dynamic>{};
_json[r'timeGroup'] = timeGroup;
_json[r'count'] = count;
return _json;
}
/// Returns a new [AssetCountByTimeGroupDto] instance and imports its values from
/// [value] if it's a [Map], null otherwise.
// ignore: prefer_constructors_over_static_methods
static AssetCountByTimeGroupDto? fromJson(dynamic value) {
if (value is Map) {
final json = value.cast<String, dynamic>();
// Ensure that the map contains the required keys.
// Note 1: the values aren't checked for validity beyond being non-null.
// Note 2: this code is stripped in release mode!
assert(() {
requiredKeys.forEach((key) {
assert(json.containsKey(key), 'Required key "AssetCountByTimeGroupDto[$key]" is missing from JSON.');
assert(json[key] != null, 'Required key "AssetCountByTimeGroupDto[$key]" has a null value in JSON.');
});
return true;
}());
return AssetCountByTimeGroupDto(
timeGroup: mapValueOfType<String>(json, r'timeGroup')!,
count: mapValueOfType<int>(json, r'count')!,
);
}
return null;
}
static List<AssetCountByTimeGroupDto>? listFromJson(dynamic json, {bool growable = false,}) {
final result = <AssetCountByTimeGroupDto>[];
if (json is List && json.isNotEmpty) {
for (final row in json) {
final value = AssetCountByTimeGroupDto.fromJson(row);
if (value != null) {
result.add(value);
}
}
}
return result.toList(growable: growable);
}
static Map<String, AssetCountByTimeGroupDto> mapFromJson(dynamic json) {
final map = <String, AssetCountByTimeGroupDto>{};
if (json is Map && json.isNotEmpty) {
json = json.cast<String, dynamic>(); // ignore: parameter_assignments
for (final entry in json.entries) {
final value = AssetCountByTimeGroupDto.fromJson(entry.value);
if (value != null) {
map[entry.key] = value;
}
}
}
return map;
}
// maps a json object with a list of AssetCountByTimeGroupDto-objects as value to a dart map
static Map<String, List<AssetCountByTimeGroupDto>> mapListFromJson(dynamic json, {bool growable = false,}) {
final map = <String, List<AssetCountByTimeGroupDto>>{};
if (json is Map && json.isNotEmpty) {
json = json.cast<String, dynamic>(); // ignore: parameter_assignments
for (final entry in json.entries) {
final value = AssetCountByTimeGroupDto.listFromJson(entry.value, growable: growable,);
if (value != null) {
map[entry.key] = value;
}
}
}
return map;
}
/// The list of required keys that must be present in a JSON.
static const requiredKeys = <String>{
'timeGroup',
'count',
};
}

View File

@ -1,119 +0,0 @@
//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
// @dart=2.12
// 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 AssetCountByTimeGroupResponseDto {
/// Returns a new [AssetCountByTimeGroupResponseDto] instance.
AssetCountByTimeGroupResponseDto({
required this.count,
this.buckets = const [],
});
int count;
List<AssetCountByTimeBucketResponseDto> buckets;
@override
bool operator ==(Object other) => identical(this, other) || other is AssetCountByTimeGroupResponseDto &&
other.count == count &&
other.buckets == buckets;
@override
int get hashCode =>
// ignore: unnecessary_parenthesis
(count.hashCode) +
(buckets.hashCode);
@override
String toString() => 'AssetCountByTimeGroupResponseDto[count=$count, buckets=$buckets]';
Map<String, dynamic> toJson() {
final _json = <String, dynamic>{};
_json[r'count'] = count;
_json[r'buckets'] = buckets;
return _json;
}
/// Returns a new [AssetCountByTimeGroupResponseDto] instance and imports its values from
/// [value] if it's a [Map], null otherwise.
// ignore: prefer_constructors_over_static_methods
static AssetCountByTimeGroupResponseDto? fromJson(dynamic value) {
if (value is Map) {
final json = value.cast<String, dynamic>();
// Ensure that the map contains the required keys.
// Note 1: the values aren't checked for validity beyond being non-null.
// Note 2: this code is stripped in release mode!
assert(() {
requiredKeys.forEach((key) {
assert(json.containsKey(key), 'Required key "AssetCountByTimeGroupResponseDto[$key]" is missing from JSON.');
assert(json[key] != null, 'Required key "AssetCountByTimeGroupResponseDto[$key]" has a null value in JSON.');
});
return true;
}());
return AssetCountByTimeGroupResponseDto(
count: mapValueOfType<int>(json, r'count')!,
buckets: AssetCountByTimeBucketResponseDto.listFromJson(json[r'buckets'])!,
);
}
return null;
}
static List<AssetCountByTimeGroupResponseDto>? listFromJson(dynamic json, {bool growable = false,}) {
final result = <AssetCountByTimeGroupResponseDto>[];
if (json is List && json.isNotEmpty) {
for (final row in json) {
final value = AssetCountByTimeGroupResponseDto.fromJson(row);
if (value != null) {
result.add(value);
}
}
}
return result.toList(growable: growable);
}
static Map<String, AssetCountByTimeGroupResponseDto> mapFromJson(dynamic json) {
final map = <String, AssetCountByTimeGroupResponseDto>{};
if (json is Map && json.isNotEmpty) {
json = json.cast<String, dynamic>(); // ignore: parameter_assignments
for (final entry in json.entries) {
final value = AssetCountByTimeGroupResponseDto.fromJson(entry.value);
if (value != null) {
map[entry.key] = value;
}
}
}
return map;
}
// maps a json object with a list of AssetCountByTimeGroupResponseDto-objects as value to a dart map
static Map<String, List<AssetCountByTimeGroupResponseDto>> mapListFromJson(dynamic json, {bool growable = false,}) {
final map = <String, List<AssetCountByTimeGroupResponseDto>>{};
if (json is Map && json.isNotEmpty) {
json = json.cast<String, dynamic>(); // ignore: parameter_assignments
for (final entry in json.entries) {
final value = AssetCountByTimeGroupResponseDto.listFromJson(entry.value, growable: growable,);
if (value != null) {
map[entry.key] = value;
}
}
}
return map;
}
/// The list of required keys that must be present in a JSON.
static const requiredKeys = <String>{
'count',
'buckets',
};
}

View File

@ -1,119 +0,0 @@
//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
// @dart=2.12
// 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 AssetCountResponseDto {
/// Returns a new [AssetCountResponseDto] instance.
AssetCountResponseDto({
required this.photos,
required this.videos,
});
int photos;
int videos;
@override
bool operator ==(Object other) => identical(this, other) || other is AssetCountResponseDto &&
other.photos == photos &&
other.videos == videos;
@override
int get hashCode =>
// ignore: unnecessary_parenthesis
(photos.hashCode) +
(videos.hashCode);
@override
String toString() => 'AssetCountResponseDto[photos=$photos, videos=$videos]';
Map<String, dynamic> toJson() {
final _json = <String, dynamic>{};
_json[r'photos'] = photos;
_json[r'videos'] = videos;
return _json;
}
/// Returns a new [AssetCountResponseDto] instance and imports its values from
/// [value] if it's a [Map], null otherwise.
// ignore: prefer_constructors_over_static_methods
static AssetCountResponseDto? fromJson(dynamic value) {
if (value is Map) {
final json = value.cast<String, dynamic>();
// Ensure that the map contains the required keys.
// Note 1: the values aren't checked for validity beyond being non-null.
// Note 2: this code is stripped in release mode!
assert(() {
requiredKeys.forEach((key) {
assert(json.containsKey(key), 'Required key "AssetCountResponseDto[$key]" is missing from JSON.');
assert(json[key] != null, 'Required key "AssetCountResponseDto[$key]" has a null value in JSON.');
});
return true;
}());
return AssetCountResponseDto(
photos: mapValueOfType<int>(json, r'photos')!,
videos: mapValueOfType<int>(json, r'videos')!,
);
}
return null;
}
static List<AssetCountResponseDto>? listFromJson(dynamic json, {bool growable = false,}) {
final result = <AssetCountResponseDto>[];
if (json is List && json.isNotEmpty) {
for (final row in json) {
final value = AssetCountResponseDto.fromJson(row);
if (value != null) {
result.add(value);
}
}
}
return result.toList(growable: growable);
}
static Map<String, AssetCountResponseDto> mapFromJson(dynamic json) {
final map = <String, AssetCountResponseDto>{};
if (json is Map && json.isNotEmpty) {
json = json.cast<String, dynamic>(); // ignore: parameter_assignments
for (final entry in json.entries) {
final value = AssetCountResponseDto.fromJson(entry.value);
if (value != null) {
map[entry.key] = value;
}
}
}
return map;
}
// maps a json object with a list of AssetCountResponseDto-objects as value to a dart map
static Map<String, List<AssetCountResponseDto>> mapListFromJson(dynamic json, {bool growable = false,}) {
final map = <String, List<AssetCountResponseDto>>{};
if (json is Map && json.isNotEmpty) {
json = json.cast<String, dynamic>(); // ignore: parameter_assignments
for (final entry in json.entries) {
final value = AssetCountResponseDto.listFromJson(entry.value, growable: growable,);
if (value != null) {
map[entry.key] = value;
}
}
}
return map;
}
/// The list of required keys that must be present in a JSON.
static const requiredKeys = <String>{
'photos',
'videos',
};
}

View File

@ -1,384 +0,0 @@
//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
// @dart=2.12
// 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 AssetEntity {
/// Returns a new [AssetEntity] instance.
AssetEntity({
required this.id,
required this.deviceAssetId,
required this.userId,
required this.deviceId,
required this.type,
required this.originalPath,
required this.resizePath,
required this.webpPath,
required this.encodedVideoPath,
required this.createdAt,
required this.modifiedAt,
required this.isFavorite,
required this.mimeType,
this.checksum,
required this.duration,
required this.isVisible,
required this.livePhotoVideoId,
this.exifInfo,
this.smartInfo,
this.tags = const [],
});
String id;
String deviceAssetId;
String userId;
String deviceId;
AssetEntityTypeEnum type;
String originalPath;
String? resizePath;
String? webpPath;
String encodedVideoPath;
String createdAt;
String modifiedAt;
bool isFavorite;
String? mimeType;
Object? checksum;
String? duration;
bool isVisible;
String? livePhotoVideoId;
///
/// Please note: This property should have been non-nullable! Since the specification file
/// does not include a default value (using the "default:" property), however, the generated
/// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note.
///
ExifEntity? exifInfo;
///
/// Please note: This property should have been non-nullable! Since the specification file
/// does not include a default value (using the "default:" property), however, the generated
/// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note.
///
SmartInfoEntity? smartInfo;
List<TagEntity> tags;
@override
bool operator ==(Object other) => identical(this, other) || other is AssetEntity &&
other.id == id &&
other.deviceAssetId == deviceAssetId &&
other.userId == userId &&
other.deviceId == deviceId &&
other.type == type &&
other.originalPath == originalPath &&
other.resizePath == resizePath &&
other.webpPath == webpPath &&
other.encodedVideoPath == encodedVideoPath &&
other.createdAt == createdAt &&
other.modifiedAt == modifiedAt &&
other.isFavorite == isFavorite &&
other.mimeType == mimeType &&
other.checksum == checksum &&
other.duration == duration &&
other.isVisible == isVisible &&
other.livePhotoVideoId == livePhotoVideoId &&
other.exifInfo == exifInfo &&
other.smartInfo == smartInfo &&
other.tags == tags;
@override
int get hashCode =>
// ignore: unnecessary_parenthesis
(id.hashCode) +
(deviceAssetId.hashCode) +
(userId.hashCode) +
(deviceId.hashCode) +
(type.hashCode) +
(originalPath.hashCode) +
(resizePath == null ? 0 : resizePath!.hashCode) +
(webpPath == null ? 0 : webpPath!.hashCode) +
(encodedVideoPath.hashCode) +
(createdAt.hashCode) +
(modifiedAt.hashCode) +
(isFavorite.hashCode) +
(mimeType == null ? 0 : mimeType!.hashCode) +
(checksum == null ? 0 : checksum!.hashCode) +
(duration == null ? 0 : duration!.hashCode) +
(isVisible.hashCode) +
(livePhotoVideoId == null ? 0 : livePhotoVideoId!.hashCode) +
(exifInfo == null ? 0 : exifInfo!.hashCode) +
(smartInfo == null ? 0 : smartInfo!.hashCode) +
(tags.hashCode);
@override
String toString() => 'AssetEntity[id=$id, deviceAssetId=$deviceAssetId, userId=$userId, deviceId=$deviceId, type=$type, originalPath=$originalPath, resizePath=$resizePath, webpPath=$webpPath, encodedVideoPath=$encodedVideoPath, createdAt=$createdAt, modifiedAt=$modifiedAt, isFavorite=$isFavorite, mimeType=$mimeType, checksum=$checksum, duration=$duration, isVisible=$isVisible, livePhotoVideoId=$livePhotoVideoId, exifInfo=$exifInfo, smartInfo=$smartInfo, tags=$tags]';
Map<String, dynamic> toJson() {
final _json = <String, dynamic>{};
_json[r'id'] = id;
_json[r'deviceAssetId'] = deviceAssetId;
_json[r'userId'] = userId;
_json[r'deviceId'] = deviceId;
_json[r'type'] = type;
_json[r'originalPath'] = originalPath;
if (resizePath != null) {
_json[r'resizePath'] = resizePath;
} else {
_json[r'resizePath'] = null;
}
if (webpPath != null) {
_json[r'webpPath'] = webpPath;
} else {
_json[r'webpPath'] = null;
}
_json[r'encodedVideoPath'] = encodedVideoPath;
_json[r'createdAt'] = createdAt;
_json[r'modifiedAt'] = modifiedAt;
_json[r'isFavorite'] = isFavorite;
if (mimeType != null) {
_json[r'mimeType'] = mimeType;
} else {
_json[r'mimeType'] = null;
}
if (checksum != null) {
_json[r'checksum'] = checksum;
} else {
_json[r'checksum'] = null;
}
if (duration != null) {
_json[r'duration'] = duration;
} else {
_json[r'duration'] = null;
}
_json[r'isVisible'] = isVisible;
if (livePhotoVideoId != null) {
_json[r'livePhotoVideoId'] = livePhotoVideoId;
} else {
_json[r'livePhotoVideoId'] = null;
}
if (exifInfo != null) {
_json[r'exifInfo'] = exifInfo;
} else {
_json[r'exifInfo'] = null;
}
if (smartInfo != null) {
_json[r'smartInfo'] = smartInfo;
} else {
_json[r'smartInfo'] = null;
}
_json[r'tags'] = tags;
return _json;
}
/// Returns a new [AssetEntity] instance and imports its values from
/// [value] if it's a [Map], null otherwise.
// ignore: prefer_constructors_over_static_methods
static AssetEntity? fromJson(dynamic value) {
if (value is Map) {
final json = value.cast<String, dynamic>();
// Ensure that the map contains the required keys.
// Note 1: the values aren't checked for validity beyond being non-null.
// Note 2: this code is stripped in release mode!
assert(() {
requiredKeys.forEach((key) {
assert(json.containsKey(key), 'Required key "AssetEntity[$key]" is missing from JSON.');
assert(json[key] != null, 'Required key "AssetEntity[$key]" has a null value in JSON.');
});
return true;
}());
return AssetEntity(
id: mapValueOfType<String>(json, r'id')!,
deviceAssetId: mapValueOfType<String>(json, r'deviceAssetId')!,
userId: mapValueOfType<String>(json, r'userId')!,
deviceId: mapValueOfType<String>(json, r'deviceId')!,
type: AssetEntityTypeEnum.fromJson(json[r'type'])!,
originalPath: mapValueOfType<String>(json, r'originalPath')!,
resizePath: mapValueOfType<String>(json, r'resizePath'),
webpPath: mapValueOfType<String>(json, r'webpPath'),
encodedVideoPath: mapValueOfType<String>(json, r'encodedVideoPath')!,
createdAt: mapValueOfType<String>(json, r'createdAt')!,
modifiedAt: mapValueOfType<String>(json, r'modifiedAt')!,
isFavorite: mapValueOfType<bool>(json, r'isFavorite')!,
mimeType: mapValueOfType<String>(json, r'mimeType'),
checksum: mapValueOfType<Object>(json, r'checksum'),
duration: mapValueOfType<String>(json, r'duration'),
isVisible: mapValueOfType<bool>(json, r'isVisible')!,
livePhotoVideoId: mapValueOfType<String>(json, r'livePhotoVideoId'),
exifInfo: ExifEntity.fromJson(json[r'exifInfo']),
smartInfo: SmartInfoEntity.fromJson(json[r'smartInfo']),
tags: TagEntity.listFromJson(json[r'tags'])!,
);
}
return null;
}
static List<AssetEntity>? listFromJson(dynamic json, {bool growable = false,}) {
final result = <AssetEntity>[];
if (json is List && json.isNotEmpty) {
for (final row in json) {
final value = AssetEntity.fromJson(row);
if (value != null) {
result.add(value);
}
}
}
return result.toList(growable: growable);
}
static Map<String, AssetEntity> mapFromJson(dynamic json) {
final map = <String, AssetEntity>{};
if (json is Map && json.isNotEmpty) {
json = json.cast<String, dynamic>(); // ignore: parameter_assignments
for (final entry in json.entries) {
final value = AssetEntity.fromJson(entry.value);
if (value != null) {
map[entry.key] = value;
}
}
}
return map;
}
// maps a json object with a list of AssetEntity-objects as value to a dart map
static Map<String, List<AssetEntity>> mapListFromJson(dynamic json, {bool growable = false,}) {
final map = <String, List<AssetEntity>>{};
if (json is Map && json.isNotEmpty) {
json = json.cast<String, dynamic>(); // ignore: parameter_assignments
for (final entry in json.entries) {
final value = AssetEntity.listFromJson(entry.value, growable: growable,);
if (value != null) {
map[entry.key] = value;
}
}
}
return map;
}
/// The list of required keys that must be present in a JSON.
static const requiredKeys = <String>{
'id',
'deviceAssetId',
'userId',
'deviceId',
'type',
'originalPath',
'resizePath',
'webpPath',
'encodedVideoPath',
'createdAt',
'modifiedAt',
'isFavorite',
'mimeType',
'duration',
'isVisible',
'livePhotoVideoId',
'tags',
};
}
class AssetEntityTypeEnum {
/// Instantiate a new enum with the provided [value].
const AssetEntityTypeEnum._(this.value);
/// The underlying value of this enum member.
final String value;
@override
String toString() => value;
String toJson() => value;
static const IMAGE = AssetEntityTypeEnum._(r'IMAGE');
static const VIDEO = AssetEntityTypeEnum._(r'VIDEO');
static const AUDIO = AssetEntityTypeEnum._(r'AUDIO');
static const OTHER = AssetEntityTypeEnum._(r'OTHER');
/// List of all possible values in this [enum][AssetEntityTypeEnum].
static const values = <AssetEntityTypeEnum>[
IMAGE,
VIDEO,
AUDIO,
OTHER,
];
static AssetEntityTypeEnum? fromJson(dynamic value) => AssetEntityTypeEnumTypeTransformer().decode(value);
static List<AssetEntityTypeEnum>? listFromJson(dynamic json, {bool growable = false,}) {
final result = <AssetEntityTypeEnum>[];
if (json is List && json.isNotEmpty) {
for (final row in json) {
final value = AssetEntityTypeEnum.fromJson(row);
if (value != null) {
result.add(value);
}
}
}
return result.toList(growable: growable);
}
}
/// Transformation class that can [encode] an instance of [AssetEntityTypeEnum] to String,
/// and [decode] dynamic data back to [AssetEntityTypeEnum].
class AssetEntityTypeEnumTypeTransformer {
factory AssetEntityTypeEnumTypeTransformer() => _instance ??= const AssetEntityTypeEnumTypeTransformer._();
const AssetEntityTypeEnumTypeTransformer._();
String encode(AssetEntityTypeEnum data) => data.value;
/// Decodes a [dynamic value][data] to a AssetEntityTypeEnum.
///
/// If [allowNull] is true and the [dynamic value][data] cannot be decoded successfully,
/// then null is returned. However, if [allowNull] is false and the [dynamic value][data]
/// cannot be decoded successfully, then an [UnimplementedError] is thrown.
///
/// The [allowNull] is very handy when an API changes and a new enum value is added or removed,
/// and users are still using an old app with the old code.
AssetEntityTypeEnum? decode(dynamic data, {bool allowNull = true}) {
if (data != null) {
switch (data.toString()) {
case r'IMAGE': return AssetEntityTypeEnum.IMAGE;
case r'VIDEO': return AssetEntityTypeEnum.VIDEO;
case r'AUDIO': return AssetEntityTypeEnum.AUDIO;
case r'OTHER': return AssetEntityTypeEnum.OTHER;
default:
if (!allowNull) {
throw ArgumentError('Unknown enum value to decode: $data');
}
}
}
return null;
}
/// Singleton [AssetEntityTypeEnumTypeTransformer] instance.
static AssetEntityTypeEnumTypeTransformer? _instance;
}

View File

@ -1,111 +0,0 @@
//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
// @dart=2.12
// 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 CreateJobDto {
/// Returns a new [CreateJobDto] instance.
CreateJobDto({
required this.jobType,
});
JobType jobType;
@override
bool operator ==(Object other) => identical(this, other) || other is CreateJobDto &&
other.jobType == jobType;
@override
int get hashCode =>
// ignore: unnecessary_parenthesis
(jobType.hashCode);
@override
String toString() => 'CreateJobDto[jobType=$jobType]';
Map<String, dynamic> toJson() {
final _json = <String, dynamic>{};
_json[r'jobType'] = jobType;
return _json;
}
/// Returns a new [CreateJobDto] instance and imports its values from
/// [value] if it's a [Map], null otherwise.
// ignore: prefer_constructors_over_static_methods
static CreateJobDto? fromJson(dynamic value) {
if (value is Map) {
final json = value.cast<String, dynamic>();
// Ensure that the map contains the required keys.
// Note 1: the values aren't checked for validity beyond being non-null.
// Note 2: this code is stripped in release mode!
assert(() {
requiredKeys.forEach((key) {
assert(json.containsKey(key), 'Required key "CreateJobDto[$key]" is missing from JSON.');
assert(json[key] != null, 'Required key "CreateJobDto[$key]" has a null value in JSON.');
});
return true;
}());
return CreateJobDto(
jobType: JobType.fromJson(json[r'jobType'])!,
);
}
return null;
}
static List<CreateJobDto>? listFromJson(dynamic json, {bool growable = false,}) {
final result = <CreateJobDto>[];
if (json is List && json.isNotEmpty) {
for (final row in json) {
final value = CreateJobDto.fromJson(row);
if (value != null) {
result.add(value);
}
}
}
return result.toList(growable: growable);
}
static Map<String, CreateJobDto> mapFromJson(dynamic json) {
final map = <String, CreateJobDto>{};
if (json is Map && json.isNotEmpty) {
json = json.cast<String, dynamic>(); // ignore: parameter_assignments
for (final entry in json.entries) {
final value = CreateJobDto.fromJson(entry.value);
if (value != null) {
map[entry.key] = value;
}
}
}
return map;
}
// maps a json object with a list of CreateJobDto-objects as value to a dart map
static Map<String, List<CreateJobDto>> mapListFromJson(dynamic json, {bool growable = false,}) {
final map = <String, List<CreateJobDto>>{};
if (json is Map && json.isNotEmpty) {
json = json.cast<String, dynamic>(); // ignore: parameter_assignments
for (final entry in json.entries) {
final value = CreateJobDto.listFromJson(entry.value, growable: growable,);
if (value != null) {
map[entry.key] = value;
}
}
}
return map;
}
/// The list of required keys that must be present in a JSON.
static const requiredKeys = <String>{
'jobType',
};
}

View File

@ -1,414 +0,0 @@
//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
// @dart=2.12
// 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 ExifEntity {
/// Returns a new [ExifEntity] instance.
ExifEntity({
required this.id,
required this.assetId,
required this.description,
required this.exifImageWidth,
required this.exifImageHeight,
required this.fileSizeInByte,
required this.orientation,
required this.dateTimeOriginal,
required this.modifyDate,
required this.latitude,
required this.longitude,
required this.city,
required this.state,
required this.country,
required this.make,
required this.model,
required this.imageName,
required this.lensModel,
required this.fNumber,
required this.focalLength,
required this.iso,
required this.exposureTime,
this.fps,
this.asset,
required this.exifTextSearchableColumn,
});
String id;
String assetId;
/// General info
String description;
num? exifImageWidth;
num? exifImageHeight;
num? fileSizeInByte;
String? orientation;
DateTime? dateTimeOriginal;
DateTime? modifyDate;
num? latitude;
num? longitude;
String? city;
String? state;
String? country;
/// Image info
String? make;
String? model;
String? imageName;
String? lensModel;
num? fNumber;
num? focalLength;
num? iso;
num? exposureTime;
/// Video info
num? fps;
///
/// Please note: This property should have been non-nullable! Since the specification file
/// does not include a default value (using the "default:" property), however, the generated
/// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note.
///
AssetEntity? asset;
String exifTextSearchableColumn;
@override
bool operator ==(Object other) => identical(this, other) || other is ExifEntity &&
other.id == id &&
other.assetId == assetId &&
other.description == description &&
other.exifImageWidth == exifImageWidth &&
other.exifImageHeight == exifImageHeight &&
other.fileSizeInByte == fileSizeInByte &&
other.orientation == orientation &&
other.dateTimeOriginal == dateTimeOriginal &&
other.modifyDate == modifyDate &&
other.latitude == latitude &&
other.longitude == longitude &&
other.city == city &&
other.state == state &&
other.country == country &&
other.make == make &&
other.model == model &&
other.imageName == imageName &&
other.lensModel == lensModel &&
other.fNumber == fNumber &&
other.focalLength == focalLength &&
other.iso == iso &&
other.exposureTime == exposureTime &&
other.fps == fps &&
other.asset == asset &&
other.exifTextSearchableColumn == exifTextSearchableColumn;
@override
int get hashCode =>
// ignore: unnecessary_parenthesis
(id.hashCode) +
(assetId.hashCode) +
(description.hashCode) +
(exifImageWidth == null ? 0 : exifImageWidth!.hashCode) +
(exifImageHeight == null ? 0 : exifImageHeight!.hashCode) +
(fileSizeInByte == null ? 0 : fileSizeInByte!.hashCode) +
(orientation == null ? 0 : orientation!.hashCode) +
(dateTimeOriginal == null ? 0 : dateTimeOriginal!.hashCode) +
(modifyDate == null ? 0 : modifyDate!.hashCode) +
(latitude == null ? 0 : latitude!.hashCode) +
(longitude == null ? 0 : longitude!.hashCode) +
(city == null ? 0 : city!.hashCode) +
(state == null ? 0 : state!.hashCode) +
(country == null ? 0 : country!.hashCode) +
(make == null ? 0 : make!.hashCode) +
(model == null ? 0 : model!.hashCode) +
(imageName == null ? 0 : imageName!.hashCode) +
(lensModel == null ? 0 : lensModel!.hashCode) +
(fNumber == null ? 0 : fNumber!.hashCode) +
(focalLength == null ? 0 : focalLength!.hashCode) +
(iso == null ? 0 : iso!.hashCode) +
(exposureTime == null ? 0 : exposureTime!.hashCode) +
(fps == null ? 0 : fps!.hashCode) +
(asset == null ? 0 : asset!.hashCode) +
(exifTextSearchableColumn.hashCode);
@override
String toString() => 'ExifEntity[id=$id, assetId=$assetId, description=$description, exifImageWidth=$exifImageWidth, exifImageHeight=$exifImageHeight, fileSizeInByte=$fileSizeInByte, orientation=$orientation, dateTimeOriginal=$dateTimeOriginal, modifyDate=$modifyDate, latitude=$latitude, longitude=$longitude, city=$city, state=$state, country=$country, make=$make, model=$model, imageName=$imageName, lensModel=$lensModel, fNumber=$fNumber, focalLength=$focalLength, iso=$iso, exposureTime=$exposureTime, fps=$fps, asset=$asset, exifTextSearchableColumn=$exifTextSearchableColumn]';
Map<String, dynamic> toJson() {
final _json = <String, dynamic>{};
_json[r'id'] = id;
_json[r'assetId'] = assetId;
_json[r'description'] = description;
if (exifImageWidth != null) {
_json[r'exifImageWidth'] = exifImageWidth;
} else {
_json[r'exifImageWidth'] = null;
}
if (exifImageHeight != null) {
_json[r'exifImageHeight'] = exifImageHeight;
} else {
_json[r'exifImageHeight'] = null;
}
if (fileSizeInByte != null) {
_json[r'fileSizeInByte'] = fileSizeInByte;
} else {
_json[r'fileSizeInByte'] = null;
}
if (orientation != null) {
_json[r'orientation'] = orientation;
} else {
_json[r'orientation'] = null;
}
if (dateTimeOriginal != null) {
_json[r'dateTimeOriginal'] = dateTimeOriginal!.toUtc().toIso8601String();
} else {
_json[r'dateTimeOriginal'] = null;
}
if (modifyDate != null) {
_json[r'modifyDate'] = modifyDate!.toUtc().toIso8601String();
} else {
_json[r'modifyDate'] = null;
}
if (latitude != null) {
_json[r'latitude'] = latitude;
} else {
_json[r'latitude'] = null;
}
if (longitude != null) {
_json[r'longitude'] = longitude;
} else {
_json[r'longitude'] = null;
}
if (city != null) {
_json[r'city'] = city;
} else {
_json[r'city'] = null;
}
if (state != null) {
_json[r'state'] = state;
} else {
_json[r'state'] = null;
}
if (country != null) {
_json[r'country'] = country;
} else {
_json[r'country'] = null;
}
if (make != null) {
_json[r'make'] = make;
} else {
_json[r'make'] = null;
}
if (model != null) {
_json[r'model'] = model;
} else {
_json[r'model'] = null;
}
if (imageName != null) {
_json[r'imageName'] = imageName;
} else {
_json[r'imageName'] = null;
}
if (lensModel != null) {
_json[r'lensModel'] = lensModel;
} else {
_json[r'lensModel'] = null;
}
if (fNumber != null) {
_json[r'fNumber'] = fNumber;
} else {
_json[r'fNumber'] = null;
}
if (focalLength != null) {
_json[r'focalLength'] = focalLength;
} else {
_json[r'focalLength'] = null;
}
if (iso != null) {
_json[r'iso'] = iso;
} else {
_json[r'iso'] = null;
}
if (exposureTime != null) {
_json[r'exposureTime'] = exposureTime;
} else {
_json[r'exposureTime'] = null;
}
if (fps != null) {
_json[r'fps'] = fps;
} else {
_json[r'fps'] = null;
}
if (asset != null) {
_json[r'asset'] = asset;
} else {
_json[r'asset'] = null;
}
_json[r'exifTextSearchableColumn'] = exifTextSearchableColumn;
return _json;
}
/// Returns a new [ExifEntity] instance and imports its values from
/// [value] if it's a [Map], null otherwise.
// ignore: prefer_constructors_over_static_methods
static ExifEntity? fromJson(dynamic value) {
if (value is Map) {
final json = value.cast<String, dynamic>();
// Ensure that the map contains the required keys.
// Note 1: the values aren't checked for validity beyond being non-null.
// Note 2: this code is stripped in release mode!
assert(() {
requiredKeys.forEach((key) {
assert(json.containsKey(key), 'Required key "ExifEntity[$key]" is missing from JSON.');
assert(json[key] != null, 'Required key "ExifEntity[$key]" has a null value in JSON.');
});
return true;
}());
return ExifEntity(
id: mapValueOfType<String>(json, r'id')!,
assetId: mapValueOfType<String>(json, r'assetId')!,
description: mapValueOfType<String>(json, r'description')!,
exifImageWidth: json[r'exifImageWidth'] == null
? null
: num.parse(json[r'exifImageWidth'].toString()),
exifImageHeight: json[r'exifImageHeight'] == null
? null
: num.parse(json[r'exifImageHeight'].toString()),
fileSizeInByte: json[r'fileSizeInByte'] == null
? null
: num.parse(json[r'fileSizeInByte'].toString()),
orientation: mapValueOfType<String>(json, r'orientation'),
dateTimeOriginal: mapDateTime(json, r'dateTimeOriginal', ''),
modifyDate: mapDateTime(json, r'modifyDate', ''),
latitude: json[r'latitude'] == null
? null
: num.parse(json[r'latitude'].toString()),
longitude: json[r'longitude'] == null
? null
: num.parse(json[r'longitude'].toString()),
city: mapValueOfType<String>(json, r'city'),
state: mapValueOfType<String>(json, r'state'),
country: mapValueOfType<String>(json, r'country'),
make: mapValueOfType<String>(json, r'make'),
model: mapValueOfType<String>(json, r'model'),
imageName: mapValueOfType<String>(json, r'imageName'),
lensModel: mapValueOfType<String>(json, r'lensModel'),
fNumber: json[r'fNumber'] == null
? null
: num.parse(json[r'fNumber'].toString()),
focalLength: json[r'focalLength'] == null
? null
: num.parse(json[r'focalLength'].toString()),
iso: json[r'iso'] == null
? null
: num.parse(json[r'iso'].toString()),
exposureTime: json[r'exposureTime'] == null
? null
: num.parse(json[r'exposureTime'].toString()),
fps: json[r'fps'] == null
? null
: num.parse(json[r'fps'].toString()),
asset: AssetEntity.fromJson(json[r'asset']),
exifTextSearchableColumn: mapValueOfType<String>(json, r'exifTextSearchableColumn')!,
);
}
return null;
}
static List<ExifEntity>? listFromJson(dynamic json, {bool growable = false,}) {
final result = <ExifEntity>[];
if (json is List && json.isNotEmpty) {
for (final row in json) {
final value = ExifEntity.fromJson(row);
if (value != null) {
result.add(value);
}
}
}
return result.toList(growable: growable);
}
static Map<String, ExifEntity> mapFromJson(dynamic json) {
final map = <String, ExifEntity>{};
if (json is Map && json.isNotEmpty) {
json = json.cast<String, dynamic>(); // ignore: parameter_assignments
for (final entry in json.entries) {
final value = ExifEntity.fromJson(entry.value);
if (value != null) {
map[entry.key] = value;
}
}
}
return map;
}
// maps a json object with a list of ExifEntity-objects as value to a dart map
static Map<String, List<ExifEntity>> mapListFromJson(dynamic json, {bool growable = false,}) {
final map = <String, List<ExifEntity>>{};
if (json is Map && json.isNotEmpty) {
json = json.cast<String, dynamic>(); // ignore: parameter_assignments
for (final entry in json.entries) {
final value = ExifEntity.listFromJson(entry.value, growable: growable,);
if (value != null) {
map[entry.key] = value;
}
}
}
return map;
}
/// The list of required keys that must be present in a JSON.
static const requiredKeys = <String>{
'id',
'assetId',
'description',
'exifImageWidth',
'exifImageHeight',
'fileSizeInByte',
'orientation',
'dateTimeOriginal',
'modifyDate',
'latitude',
'longitude',
'city',
'state',
'country',
'make',
'model',
'imageName',
'lensModel',
'fNumber',
'focalLength',
'iso',
'exposureTime',
'exifTextSearchableColumn',
};
}

View File

@ -1,111 +0,0 @@
//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
// @dart=2.12
// 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 GetAssetCountByTimeGroupDto {
/// Returns a new [GetAssetCountByTimeGroupDto] instance.
GetAssetCountByTimeGroupDto({
required this.timeGroup,
});
TimeGroupEnum timeGroup;
@override
bool operator ==(Object other) => identical(this, other) || other is GetAssetCountByTimeGroupDto &&
other.timeGroup == timeGroup;
@override
int get hashCode =>
// ignore: unnecessary_parenthesis
(timeGroup.hashCode);
@override
String toString() => 'GetAssetCountByTimeGroupDto[timeGroup=$timeGroup]';
Map<String, dynamic> toJson() {
final _json = <String, dynamic>{};
_json[r'timeGroup'] = timeGroup;
return _json;
}
/// Returns a new [GetAssetCountByTimeGroupDto] instance and imports its values from
/// [value] if it's a [Map], null otherwise.
// ignore: prefer_constructors_over_static_methods
static GetAssetCountByTimeGroupDto? fromJson(dynamic value) {
if (value is Map) {
final json = value.cast<String, dynamic>();
// Ensure that the map contains the required keys.
// Note 1: the values aren't checked for validity beyond being non-null.
// Note 2: this code is stripped in release mode!
assert(() {
requiredKeys.forEach((key) {
assert(json.containsKey(key), 'Required key "GetAssetCountByTimeGroupDto[$key]" is missing from JSON.');
assert(json[key] != null, 'Required key "GetAssetCountByTimeGroupDto[$key]" has a null value in JSON.');
});
return true;
}());
return GetAssetCountByTimeGroupDto(
timeGroup: TimeGroupEnum.fromJson(json[r'timeGroup'])!,
);
}
return null;
}
static List<GetAssetCountByTimeGroupDto>? listFromJson(dynamic json, {bool growable = false,}) {
final result = <GetAssetCountByTimeGroupDto>[];
if (json is List && json.isNotEmpty) {
for (final row in json) {
final value = GetAssetCountByTimeGroupDto.fromJson(row);
if (value != null) {
result.add(value);
}
}
}
return result.toList(growable: growable);
}
static Map<String, GetAssetCountByTimeGroupDto> mapFromJson(dynamic json) {
final map = <String, GetAssetCountByTimeGroupDto>{};
if (json is Map && json.isNotEmpty) {
json = json.cast<String, dynamic>(); // ignore: parameter_assignments
for (final entry in json.entries) {
final value = GetAssetCountByTimeGroupDto.fromJson(entry.value);
if (value != null) {
map[entry.key] = value;
}
}
}
return map;
}
// maps a json object with a list of GetAssetCountByTimeGroupDto-objects as value to a dart map
static Map<String, List<GetAssetCountByTimeGroupDto>> mapListFromJson(dynamic json, {bool growable = false,}) {
final map = <String, List<GetAssetCountByTimeGroupDto>>{};
if (json is Map && json.isNotEmpty) {
json = json.cast<String, dynamic>(); // ignore: parameter_assignments
for (final entry in json.entries) {
final value = GetAssetCountByTimeGroupDto.listFromJson(entry.value, growable: growable,);
if (value != null) {
map[entry.key] = value;
}
}
}
return map;
}
/// The list of required keys that must be present in a JSON.
static const requiredKeys = <String>{
'timeGroup',
};
}

View File

@ -1,91 +0,0 @@
//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
// @dart=2.12
// 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 JobType {
/// Instantiate a new enum with the provided [value].
const JobType._(this.value);
/// The underlying value of this enum member.
final String value;
@override
String toString() => value;
String toJson() => value;
static const THUMBNAIL_GENERATION = JobType._(r'THUMBNAIL_GENERATION');
static const METADATA_EXTRACTION = JobType._(r'METADATA_EXTRACTION');
static const VIDEO_CONVERSION = JobType._(r'VIDEO_CONVERSION');
static const CHECKSUM_GENERATION = JobType._(r'CHECKSUM_GENERATION');
/// List of all possible values in this [enum][JobType].
static const values = <JobType>[
THUMBNAIL_GENERATION,
METADATA_EXTRACTION,
VIDEO_CONVERSION,
CHECKSUM_GENERATION,
];
static JobType? fromJson(dynamic value) => JobTypeTypeTransformer().decode(value);
static List<JobType>? listFromJson(dynamic json, {bool growable = false,}) {
final result = <JobType>[];
if (json is List && json.isNotEmpty) {
for (final row in json) {
final value = JobType.fromJson(row);
if (value != null) {
result.add(value);
}
}
}
return result.toList(growable: growable);
}
}
/// Transformation class that can [encode] an instance of [JobType] to String,
/// and [decode] dynamic data back to [JobType].
class JobTypeTypeTransformer {
factory JobTypeTypeTransformer() => _instance ??= const JobTypeTypeTransformer._();
const JobTypeTypeTransformer._();
String encode(JobType data) => data.value;
/// Decodes a [dynamic value][data] to a JobType.
///
/// If [allowNull] is true and the [dynamic value][data] cannot be decoded successfully,
/// then null is returned. However, if [allowNull] is false and the [dynamic value][data]
/// cannot be decoded successfully, then an [UnimplementedError] is thrown.
///
/// The [allowNull] is very handy when an API changes and a new enum value is added or removed,
/// and users are still using an old app with the old code.
JobType? decode(dynamic data, {bool allowNull = true}) {
if (data != null) {
switch (data.toString()) {
case r'THUMBNAIL_GENERATION': return JobType.THUMBNAIL_GENERATION;
case r'METADATA_EXTRACTION': return JobType.METADATA_EXTRACTION;
case r'VIDEO_CONVERSION': return JobType.VIDEO_CONVERSION;
case r'CHECKSUM_GENERATION': return JobType.CHECKSUM_GENERATION;
default:
if (!allowNull) {
throw ArgumentError('Unknown enum value to decode: $data');
}
}
}
return null;
}
/// Singleton [JobTypeTypeTransformer] instance.
static JobTypeTypeTransformer? _instance;
}

View File

@ -1,164 +0,0 @@
//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
// @dart=2.12
// 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 SmartInfoEntity {
/// Returns a new [SmartInfoEntity] instance.
SmartInfoEntity({
required this.id,
required this.assetId,
this.tags = const [],
this.objects = const [],
this.asset,
});
String id;
String assetId;
List<String>? tags;
List<String>? objects;
///
/// Please note: This property should have been non-nullable! Since the specification file
/// does not include a default value (using the "default:" property), however, the generated
/// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note.
///
AssetEntity? asset;
@override
bool operator ==(Object other) => identical(this, other) || other is SmartInfoEntity &&
other.id == id &&
other.assetId == assetId &&
other.tags == tags &&
other.objects == objects &&
other.asset == asset;
@override
int get hashCode =>
// ignore: unnecessary_parenthesis
(id.hashCode) +
(assetId.hashCode) +
(tags == null ? 0 : tags!.hashCode) +
(objects == null ? 0 : objects!.hashCode) +
(asset == null ? 0 : asset!.hashCode);
@override
String toString() => 'SmartInfoEntity[id=$id, assetId=$assetId, tags=$tags, objects=$objects, asset=$asset]';
Map<String, dynamic> toJson() {
final _json = <String, dynamic>{};
_json[r'id'] = id;
_json[r'assetId'] = assetId;
if (tags != null) {
_json[r'tags'] = tags;
} else {
_json[r'tags'] = null;
}
if (objects != null) {
_json[r'objects'] = objects;
} else {
_json[r'objects'] = null;
}
if (asset != null) {
_json[r'asset'] = asset;
} else {
_json[r'asset'] = null;
}
return _json;
}
/// Returns a new [SmartInfoEntity] instance and imports its values from
/// [value] if it's a [Map], null otherwise.
// ignore: prefer_constructors_over_static_methods
static SmartInfoEntity? fromJson(dynamic value) {
if (value is Map) {
final json = value.cast<String, dynamic>();
// Ensure that the map contains the required keys.
// Note 1: the values aren't checked for validity beyond being non-null.
// Note 2: this code is stripped in release mode!
assert(() {
requiredKeys.forEach((key) {
assert(json.containsKey(key), 'Required key "SmartInfoEntity[$key]" is missing from JSON.');
assert(json[key] != null, 'Required key "SmartInfoEntity[$key]" has a null value in JSON.');
});
return true;
}());
return SmartInfoEntity(
id: mapValueOfType<String>(json, r'id')!,
assetId: mapValueOfType<String>(json, r'assetId')!,
tags: json[r'tags'] is List
? (json[r'tags'] as List).cast<String>()
: const [],
objects: json[r'objects'] is List
? (json[r'objects'] as List).cast<String>()
: const [],
asset: AssetEntity.fromJson(json[r'asset']),
);
}
return null;
}
static List<SmartInfoEntity>? listFromJson(dynamic json, {bool growable = false,}) {
final result = <SmartInfoEntity>[];
if (json is List && json.isNotEmpty) {
for (final row in json) {
final value = SmartInfoEntity.fromJson(row);
if (value != null) {
result.add(value);
}
}
}
return result.toList(growable: growable);
}
static Map<String, SmartInfoEntity> mapFromJson(dynamic json) {
final map = <String, SmartInfoEntity>{};
if (json is Map && json.isNotEmpty) {
json = json.cast<String, dynamic>(); // ignore: parameter_assignments
for (final entry in json.entries) {
final value = SmartInfoEntity.fromJson(entry.value);
if (value != null) {
map[entry.key] = value;
}
}
}
return map;
}
// maps a json object with a list of SmartInfoEntity-objects as value to a dart map
static Map<String, List<SmartInfoEntity>> mapListFromJson(dynamic json, {bool growable = false,}) {
final map = <String, List<SmartInfoEntity>>{};
if (json is Map && json.isNotEmpty) {
json = json.cast<String, dynamic>(); // ignore: parameter_assignments
for (final entry in json.entries) {
final value = SmartInfoEntity.listFromJson(entry.value, growable: growable,);
if (value != null) {
map[entry.key] = value;
}
}
}
return map;
}
/// The list of required keys that must be present in a JSON.
static const requiredKeys = <String>{
'id',
'assetId',
'tags',
'objects',
};
}

View File

@ -1,202 +0,0 @@
//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
// @dart=2.12
// 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 SystemConfigEntity {
/// Returns a new [SystemConfigEntity] instance.
SystemConfigEntity({
required this.key,
required this.value,
});
SystemConfigEntityKeyEnum key;
Object value;
@override
bool operator ==(Object other) => identical(this, other) || other is SystemConfigEntity &&
other.key == key &&
other.value == value;
@override
int get hashCode =>
// ignore: unnecessary_parenthesis
(key.hashCode) +
(value.hashCode);
@override
String toString() => 'SystemConfigEntity[key=$key, value=$value]';
Map<String, dynamic> toJson() {
final _json = <String, dynamic>{};
_json[r'key'] = key;
_json[r'value'] = value;
return _json;
}
/// Returns a new [SystemConfigEntity] instance and imports its values from
/// [value] if it's a [Map], null otherwise.
// ignore: prefer_constructors_over_static_methods
static SystemConfigEntity? fromJson(dynamic value) {
if (value is Map) {
final json = value.cast<String, dynamic>();
// Ensure that the map contains the required keys.
// Note 1: the values aren't checked for validity beyond being non-null.
// Note 2: this code is stripped in release mode!
assert(() {
requiredKeys.forEach((key) {
assert(json.containsKey(key), 'Required key "SystemConfigEntity[$key]" is missing from JSON.');
assert(json[key] != null, 'Required key "SystemConfigEntity[$key]" has a null value in JSON.');
});
return true;
}());
return SystemConfigEntity(
key: SystemConfigEntityKeyEnum.fromJson(json[r'key'])!,
value: mapValueOfType<Object>(json, r'value')!,
);
}
return null;
}
static List<SystemConfigEntity>? listFromJson(dynamic json, {bool growable = false,}) {
final result = <SystemConfigEntity>[];
if (json is List && json.isNotEmpty) {
for (final row in json) {
final value = SystemConfigEntity.fromJson(row);
if (value != null) {
result.add(value);
}
}
}
return result.toList(growable: growable);
}
static Map<String, SystemConfigEntity> mapFromJson(dynamic json) {
final map = <String, SystemConfigEntity>{};
if (json is Map && json.isNotEmpty) {
json = json.cast<String, dynamic>(); // ignore: parameter_assignments
for (final entry in json.entries) {
final value = SystemConfigEntity.fromJson(entry.value);
if (value != null) {
map[entry.key] = value;
}
}
}
return map;
}
// maps a json object with a list of SystemConfigEntity-objects as value to a dart map
static Map<String, List<SystemConfigEntity>> mapListFromJson(dynamic json, {bool growable = false,}) {
final map = <String, List<SystemConfigEntity>>{};
if (json is Map && json.isNotEmpty) {
json = json.cast<String, dynamic>(); // ignore: parameter_assignments
for (final entry in json.entries) {
final value = SystemConfigEntity.listFromJson(entry.value, growable: growable,);
if (value != null) {
map[entry.key] = value;
}
}
}
return map;
}
/// The list of required keys that must be present in a JSON.
static const requiredKeys = <String>{
'key',
'value',
};
}
class SystemConfigEntityKeyEnum {
/// Instantiate a new enum with the provided [value].
const SystemConfigEntityKeyEnum._(this.value);
/// The underlying value of this enum member.
final String value;
@override
String toString() => value;
String toJson() => value;
static const crf = SystemConfigEntityKeyEnum._(r'ffmpeg_crf');
static const preset = SystemConfigEntityKeyEnum._(r'ffmpeg_preset');
static const targetVideoCodec = SystemConfigEntityKeyEnum._(r'ffmpeg_target_video_codec');
static const targetAudioCodec = SystemConfigEntityKeyEnum._(r'ffmpeg_target_audio_codec');
static const targetScaling = SystemConfigEntityKeyEnum._(r'ffmpeg_target_scaling');
/// List of all possible values in this [enum][SystemConfigEntityKeyEnum].
static const values = <SystemConfigEntityKeyEnum>[
crf,
preset,
targetVideoCodec,
targetAudioCodec,
targetScaling,
];
static SystemConfigEntityKeyEnum? fromJson(dynamic value) => SystemConfigEntityKeyEnumTypeTransformer().decode(value);
static List<SystemConfigEntityKeyEnum>? listFromJson(dynamic json, {bool growable = false,}) {
final result = <SystemConfigEntityKeyEnum>[];
if (json is List && json.isNotEmpty) {
for (final row in json) {
final value = SystemConfigEntityKeyEnum.fromJson(row);
if (value != null) {
result.add(value);
}
}
}
return result.toList(growable: growable);
}
}
/// Transformation class that can [encode] an instance of [SystemConfigEntityKeyEnum] to String,
/// and [decode] dynamic data back to [SystemConfigEntityKeyEnum].
class SystemConfigEntityKeyEnumTypeTransformer {
factory SystemConfigEntityKeyEnumTypeTransformer() => _instance ??= const SystemConfigEntityKeyEnumTypeTransformer._();
const SystemConfigEntityKeyEnumTypeTransformer._();
String encode(SystemConfigEntityKeyEnum data) => data.value;
/// Decodes a [dynamic value][data] to a SystemConfigEntityKeyEnum.
///
/// If [allowNull] is true and the [dynamic value][data] cannot be decoded successfully,
/// then null is returned. However, if [allowNull] is false and the [dynamic value][data]
/// cannot be decoded successfully, then an [UnimplementedError] is thrown.
///
/// The [allowNull] is very handy when an API changes and a new enum value is added or removed,
/// and users are still using an old app with the old code.
SystemConfigEntityKeyEnum? decode(dynamic data, {bool allowNull = true}) {
if (data != null) {
switch (data.toString()) {
case r'ffmpeg_crf': return SystemConfigEntityKeyEnum.crf;
case r'ffmpeg_preset': return SystemConfigEntityKeyEnum.preset;
case r'ffmpeg_target_video_codec': return SystemConfigEntityKeyEnum.targetVideoCodec;
case r'ffmpeg_target_audio_codec': return SystemConfigEntityKeyEnum.targetAudioCodec;
case r'ffmpeg_target_scaling': return SystemConfigEntityKeyEnum.targetScaling;
default:
if (!allowNull) {
throw ArgumentError('Unknown enum value to decode: $data');
}
}
}
return null;
}
/// Singleton [SystemConfigEntityKeyEnumTypeTransformer] instance.
static SystemConfigEntityKeyEnumTypeTransformer? _instance;
}

View File

@ -1,236 +0,0 @@
//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
// @dart=2.12
// 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 TagEntity {
/// Returns a new [TagEntity] instance.
TagEntity({
required this.id,
required this.type,
required this.name,
required this.userId,
required this.renameTagId,
this.assets = const [],
required this.user,
});
String id;
TagEntityTypeEnum type;
String name;
String userId;
String renameTagId;
List<AssetEntity> assets;
UserEntity user;
@override
bool operator ==(Object other) => identical(this, other) || other is TagEntity &&
other.id == id &&
other.type == type &&
other.name == name &&
other.userId == userId &&
other.renameTagId == renameTagId &&
other.assets == assets &&
other.user == user;
@override
int get hashCode =>
// ignore: unnecessary_parenthesis
(id.hashCode) +
(type.hashCode) +
(name.hashCode) +
(userId.hashCode) +
(renameTagId.hashCode) +
(assets.hashCode) +
(user.hashCode);
@override
String toString() => 'TagEntity[id=$id, type=$type, name=$name, userId=$userId, renameTagId=$renameTagId, assets=$assets, user=$user]';
Map<String, dynamic> toJson() {
final _json = <String, dynamic>{};
_json[r'id'] = id;
_json[r'type'] = type;
_json[r'name'] = name;
_json[r'userId'] = userId;
_json[r'renameTagId'] = renameTagId;
_json[r'assets'] = assets;
_json[r'user'] = user;
return _json;
}
/// Returns a new [TagEntity] instance and imports its values from
/// [value] if it's a [Map], null otherwise.
// ignore: prefer_constructors_over_static_methods
static TagEntity? fromJson(dynamic value) {
if (value is Map) {
final json = value.cast<String, dynamic>();
// Ensure that the map contains the required keys.
// Note 1: the values aren't checked for validity beyond being non-null.
// Note 2: this code is stripped in release mode!
assert(() {
requiredKeys.forEach((key) {
assert(json.containsKey(key), 'Required key "TagEntity[$key]" is missing from JSON.');
assert(json[key] != null, 'Required key "TagEntity[$key]" has a null value in JSON.');
});
return true;
}());
return TagEntity(
id: mapValueOfType<String>(json, r'id')!,
type: TagEntityTypeEnum.fromJson(json[r'type'])!,
name: mapValueOfType<String>(json, r'name')!,
userId: mapValueOfType<String>(json, r'userId')!,
renameTagId: mapValueOfType<String>(json, r'renameTagId')!,
assets: AssetEntity.listFromJson(json[r'assets'])!,
user: UserEntity.fromJson(json[r'user'])!,
);
}
return null;
}
static List<TagEntity>? listFromJson(dynamic json, {bool growable = false,}) {
final result = <TagEntity>[];
if (json is List && json.isNotEmpty) {
for (final row in json) {
final value = TagEntity.fromJson(row);
if (value != null) {
result.add(value);
}
}
}
return result.toList(growable: growable);
}
static Map<String, TagEntity> mapFromJson(dynamic json) {
final map = <String, TagEntity>{};
if (json is Map && json.isNotEmpty) {
json = json.cast<String, dynamic>(); // ignore: parameter_assignments
for (final entry in json.entries) {
final value = TagEntity.fromJson(entry.value);
if (value != null) {
map[entry.key] = value;
}
}
}
return map;
}
// maps a json object with a list of TagEntity-objects as value to a dart map
static Map<String, List<TagEntity>> mapListFromJson(dynamic json, {bool growable = false,}) {
final map = <String, List<TagEntity>>{};
if (json is Map && json.isNotEmpty) {
json = json.cast<String, dynamic>(); // ignore: parameter_assignments
for (final entry in json.entries) {
final value = TagEntity.listFromJson(entry.value, growable: growable,);
if (value != null) {
map[entry.key] = value;
}
}
}
return map;
}
/// The list of required keys that must be present in a JSON.
static const requiredKeys = <String>{
'id',
'type',
'name',
'userId',
'renameTagId',
'assets',
'user',
};
}
class TagEntityTypeEnum {
/// Instantiate a new enum with the provided [value].
const TagEntityTypeEnum._(this.value);
/// The underlying value of this enum member.
final String value;
@override
String toString() => value;
String toJson() => value;
static const OBJECT = TagEntityTypeEnum._(r'OBJECT');
static const FACE = TagEntityTypeEnum._(r'FACE');
static const CUSTOM = TagEntityTypeEnum._(r'CUSTOM');
/// List of all possible values in this [enum][TagEntityTypeEnum].
static const values = <TagEntityTypeEnum>[
OBJECT,
FACE,
CUSTOM,
];
static TagEntityTypeEnum? fromJson(dynamic value) => TagEntityTypeEnumTypeTransformer().decode(value);
static List<TagEntityTypeEnum>? listFromJson(dynamic json, {bool growable = false,}) {
final result = <TagEntityTypeEnum>[];
if (json is List && json.isNotEmpty) {
for (final row in json) {
final value = TagEntityTypeEnum.fromJson(row);
if (value != null) {
result.add(value);
}
}
}
return result.toList(growable: growable);
}
}
/// Transformation class that can [encode] an instance of [TagEntityTypeEnum] to String,
/// and [decode] dynamic data back to [TagEntityTypeEnum].
class TagEntityTypeEnumTypeTransformer {
factory TagEntityTypeEnumTypeTransformer() => _instance ??= const TagEntityTypeEnumTypeTransformer._();
const TagEntityTypeEnumTypeTransformer._();
String encode(TagEntityTypeEnum data) => data.value;
/// Decodes a [dynamic value][data] to a TagEntityTypeEnum.
///
/// If [allowNull] is true and the [dynamic value][data] cannot be decoded successfully,
/// then null is returned. However, if [allowNull] is false and the [dynamic value][data]
/// cannot be decoded successfully, then an [UnimplementedError] is thrown.
///
/// The [allowNull] is very handy when an API changes and a new enum value is added or removed,
/// and users are still using an old app with the old code.
TagEntityTypeEnum? decode(dynamic data, {bool allowNull = true}) {
if (data != null) {
switch (data.toString()) {
case r'OBJECT': return TagEntityTypeEnum.OBJECT;
case r'FACE': return TagEntityTypeEnum.FACE;
case r'CUSTOM': return TagEntityTypeEnum.CUSTOM;
default:
if (!allowNull) {
throw ArgumentError('Unknown enum value to decode: $data');
}
}
}
return null;
}
/// Singleton [TagEntityTypeEnumTypeTransformer] instance.
static TagEntityTypeEnumTypeTransformer? _instance;
}

View File

@ -1,85 +0,0 @@
//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
// @dart=2.12
// 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 TimeBucketEnum {
/// Instantiate a new enum with the provided [value].
const TimeBucketEnum._(this.value);
/// The underlying value of this enum member.
final String value;
@override
String toString() => value;
String toJson() => value;
static const day = TimeBucketEnum._(r'day');
static const month = TimeBucketEnum._(r'month');
/// List of all possible values in this [enum][TimeBucketEnum].
static const values = <TimeBucketEnum>[
day,
month,
];
static TimeBucketEnum? fromJson(dynamic value) => TimeBucketEnumTypeTransformer().decode(value);
static List<TimeBucketEnum>? listFromJson(dynamic json, {bool growable = false,}) {
final result = <TimeBucketEnum>[];
if (json is List && json.isNotEmpty) {
for (final row in json) {
final value = TimeBucketEnum.fromJson(row);
if (value != null) {
result.add(value);
}
}
}
return result.toList(growable: growable);
}
}
/// Transformation class that can [encode] an instance of [TimeBucketEnum] to String,
/// and [decode] dynamic data back to [TimeBucketEnum].
class TimeBucketEnumTypeTransformer {
factory TimeBucketEnumTypeTransformer() => _instance ??= const TimeBucketEnumTypeTransformer._();
const TimeBucketEnumTypeTransformer._();
String encode(TimeBucketEnum data) => data.value;
/// Decodes a [dynamic value][data] to a TimeBucketEnum.
///
/// If [allowNull] is true and the [dynamic value][data] cannot be decoded successfully,
/// then null is returned. However, if [allowNull] is false and the [dynamic value][data]
/// cannot be decoded successfully, then an [UnimplementedError] is thrown.
///
/// The [allowNull] is very handy when an API changes and a new enum value is added or removed,
/// and users are still using an old app with the old code.
TimeBucketEnum? decode(dynamic data, {bool allowNull = true}) {
if (data != null) {
switch (data.toString()) {
case r'day': return TimeBucketEnum.day;
case r'month': return TimeBucketEnum.month;
default:
if (!allowNull) {
throw ArgumentError('Unknown enum value to decode: $data');
}
}
}
return null;
}
/// Singleton [TimeBucketEnumTypeTransformer] instance.
static TimeBucketEnumTypeTransformer? _instance;
}

View File

@ -1,234 +0,0 @@
//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
// @dart=2.12
// 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 UserEntity {
/// Returns a new [UserEntity] instance.
UserEntity({
required this.id,
required this.firstName,
required this.lastName,
required this.isAdmin,
required this.email,
this.password,
this.salt,
required this.oauthId,
required this.profileImagePath,
required this.shouldChangePassword,
required this.createdAt,
this.deletedAt,
this.tags = const [],
});
String id;
String firstName;
String lastName;
bool isAdmin;
String email;
///
/// Please note: This property should have been non-nullable! Since the specification file
/// does not include a default value (using the "default:" property), however, the generated
/// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note.
///
String? password;
///
/// Please note: This property should have been non-nullable! Since the specification file
/// does not include a default value (using the "default:" property), however, the generated
/// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note.
///
String? salt;
String oauthId;
String profileImagePath;
bool shouldChangePassword;
String createdAt;
///
/// Please note: This property should have been non-nullable! Since the specification file
/// does not include a default value (using the "default:" property), however, the generated
/// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note.
///
DateTime? deletedAt;
List<TagEntity> tags;
@override
bool operator ==(Object other) => identical(this, other) || other is UserEntity &&
other.id == id &&
other.firstName == firstName &&
other.lastName == lastName &&
other.isAdmin == isAdmin &&
other.email == email &&
other.password == password &&
other.salt == salt &&
other.oauthId == oauthId &&
other.profileImagePath == profileImagePath &&
other.shouldChangePassword == shouldChangePassword &&
other.createdAt == createdAt &&
other.deletedAt == deletedAt &&
other.tags == tags;
@override
int get hashCode =>
// ignore: unnecessary_parenthesis
(id.hashCode) +
(firstName.hashCode) +
(lastName.hashCode) +
(isAdmin.hashCode) +
(email.hashCode) +
(password == null ? 0 : password!.hashCode) +
(salt == null ? 0 : salt!.hashCode) +
(oauthId.hashCode) +
(profileImagePath.hashCode) +
(shouldChangePassword.hashCode) +
(createdAt.hashCode) +
(deletedAt == null ? 0 : deletedAt!.hashCode) +
(tags.hashCode);
@override
String toString() => 'UserEntity[id=$id, firstName=$firstName, lastName=$lastName, isAdmin=$isAdmin, email=$email, password=$password, salt=$salt, oauthId=$oauthId, profileImagePath=$profileImagePath, shouldChangePassword=$shouldChangePassword, createdAt=$createdAt, deletedAt=$deletedAt, tags=$tags]';
Map<String, dynamic> toJson() {
final _json = <String, dynamic>{};
_json[r'id'] = id;
_json[r'firstName'] = firstName;
_json[r'lastName'] = lastName;
_json[r'isAdmin'] = isAdmin;
_json[r'email'] = email;
if (password != null) {
_json[r'password'] = password;
} else {
_json[r'password'] = null;
}
if (salt != null) {
_json[r'salt'] = salt;
} else {
_json[r'salt'] = null;
}
_json[r'oauthId'] = oauthId;
_json[r'profileImagePath'] = profileImagePath;
_json[r'shouldChangePassword'] = shouldChangePassword;
_json[r'createdAt'] = createdAt;
if (deletedAt != null) {
_json[r'deletedAt'] = deletedAt!.toUtc().toIso8601String();
} else {
_json[r'deletedAt'] = null;
}
_json[r'tags'] = tags;
return _json;
}
/// Returns a new [UserEntity] instance and imports its values from
/// [value] if it's a [Map], null otherwise.
// ignore: prefer_constructors_over_static_methods
static UserEntity? fromJson(dynamic value) {
if (value is Map) {
final json = value.cast<String, dynamic>();
// Ensure that the map contains the required keys.
// Note 1: the values aren't checked for validity beyond being non-null.
// Note 2: this code is stripped in release mode!
assert(() {
requiredKeys.forEach((key) {
assert(json.containsKey(key), 'Required key "UserEntity[$key]" is missing from JSON.');
assert(json[key] != null, 'Required key "UserEntity[$key]" has a null value in JSON.');
});
return true;
}());
return UserEntity(
id: mapValueOfType<String>(json, r'id')!,
firstName: mapValueOfType<String>(json, r'firstName')!,
lastName: mapValueOfType<String>(json, r'lastName')!,
isAdmin: mapValueOfType<bool>(json, r'isAdmin')!,
email: mapValueOfType<String>(json, r'email')!,
password: mapValueOfType<String>(json, r'password'),
salt: mapValueOfType<String>(json, r'salt'),
oauthId: mapValueOfType<String>(json, r'oauthId')!,
profileImagePath: mapValueOfType<String>(json, r'profileImagePath')!,
shouldChangePassword: mapValueOfType<bool>(json, r'shouldChangePassword')!,
createdAt: mapValueOfType<String>(json, r'createdAt')!,
deletedAt: mapDateTime(json, r'deletedAt', ''),
tags: TagEntity.listFromJson(json[r'tags'])!,
);
}
return null;
}
static List<UserEntity>? listFromJson(dynamic json, {bool growable = false,}) {
final result = <UserEntity>[];
if (json is List && json.isNotEmpty) {
for (final row in json) {
final value = UserEntity.fromJson(row);
if (value != null) {
result.add(value);
}
}
}
return result.toList(growable: growable);
}
static Map<String, UserEntity> mapFromJson(dynamic json) {
final map = <String, UserEntity>{};
if (json is Map && json.isNotEmpty) {
json = json.cast<String, dynamic>(); // ignore: parameter_assignments
for (final entry in json.entries) {
final value = UserEntity.fromJson(entry.value);
if (value != null) {
map[entry.key] = value;
}
}
}
return map;
}
// maps a json object with a list of UserEntity-objects as value to a dart map
static Map<String, List<UserEntity>> mapListFromJson(dynamic json, {bool growable = false,}) {
final map = <String, List<UserEntity>>{};
if (json is Map && json.isNotEmpty) {
json = json.cast<String, dynamic>(); // ignore: parameter_assignments
for (final entry in json.entries) {
final value = UserEntity.listFromJson(entry.value, growable: growable,);
if (value != null) {
map[entry.key] = value;
}
}
}
return map;
}
/// The list of required keys that must be present in a JSON.
static const requiredKeys = <String>{
'id',
'firstName',
'lastName',
'isAdmin',
'email',
'oauthId',
'profileImagePath',
'shouldChangePassword',
'createdAt',
'tags',
};
}