|
|
|
|
@ -133,7 +133,7 @@ class AssetResponseDto {
|
|
|
|
|
|
|
|
|
|
DateTime updatedAt;
|
|
|
|
|
|
|
|
|
|
AssetResponseDtoVisibilityEnum visibility;
|
|
|
|
|
AssetVisibility visibility;
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
bool operator ==(Object other) => identical(this, other) || other is AssetResponseDto &&
|
|
|
|
|
@ -318,7 +318,7 @@ class AssetResponseDto {
|
|
|
|
|
type: AssetTypeEnum.fromJson(json[r'type'])!,
|
|
|
|
|
unassignedFaces: AssetFaceWithoutPersonResponseDto.listFromJson(json[r'unassignedFaces']),
|
|
|
|
|
updatedAt: mapDateTime(json, r'updatedAt', r'')!,
|
|
|
|
|
visibility: AssetResponseDtoVisibilityEnum.fromJson(json[r'visibility'])!,
|
|
|
|
|
visibility: AssetVisibility.fromJson(json[r'visibility'])!,
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
return null;
|
|
|
|
|
@ -389,83 +389,3 @@ class AssetResponseDto {
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class AssetResponseDtoVisibilityEnum {
|
|
|
|
|
/// Instantiate a new enum with the provided [value].
|
|
|
|
|
const AssetResponseDtoVisibilityEnum._(this.value);
|
|
|
|
|
|
|
|
|
|
/// The underlying value of this enum member.
|
|
|
|
|
final String value;
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
String toString() => value;
|
|
|
|
|
|
|
|
|
|
String toJson() => value;
|
|
|
|
|
|
|
|
|
|
static const archive = AssetResponseDtoVisibilityEnum._(r'archive');
|
|
|
|
|
static const timeline = AssetResponseDtoVisibilityEnum._(r'timeline');
|
|
|
|
|
static const hidden = AssetResponseDtoVisibilityEnum._(r'hidden');
|
|
|
|
|
static const locked = AssetResponseDtoVisibilityEnum._(r'locked');
|
|
|
|
|
|
|
|
|
|
/// List of all possible values in this [enum][AssetResponseDtoVisibilityEnum].
|
|
|
|
|
static const values = <AssetResponseDtoVisibilityEnum>[
|
|
|
|
|
archive,
|
|
|
|
|
timeline,
|
|
|
|
|
hidden,
|
|
|
|
|
locked,
|
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
static AssetResponseDtoVisibilityEnum? fromJson(dynamic value) => AssetResponseDtoVisibilityEnumTypeTransformer().decode(value);
|
|
|
|
|
|
|
|
|
|
static List<AssetResponseDtoVisibilityEnum> listFromJson(dynamic json, {bool growable = false,}) {
|
|
|
|
|
final result = <AssetResponseDtoVisibilityEnum>[];
|
|
|
|
|
if (json is List && json.isNotEmpty) {
|
|
|
|
|
for (final row in json) {
|
|
|
|
|
final value = AssetResponseDtoVisibilityEnum.fromJson(row);
|
|
|
|
|
if (value != null) {
|
|
|
|
|
result.add(value);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return result.toList(growable: growable);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// Transformation class that can [encode] an instance of [AssetResponseDtoVisibilityEnum] to String,
|
|
|
|
|
/// and [decode] dynamic data back to [AssetResponseDtoVisibilityEnum].
|
|
|
|
|
class AssetResponseDtoVisibilityEnumTypeTransformer {
|
|
|
|
|
factory AssetResponseDtoVisibilityEnumTypeTransformer() => _instance ??= const AssetResponseDtoVisibilityEnumTypeTransformer._();
|
|
|
|
|
|
|
|
|
|
const AssetResponseDtoVisibilityEnumTypeTransformer._();
|
|
|
|
|
|
|
|
|
|
String encode(AssetResponseDtoVisibilityEnum data) => data.value;
|
|
|
|
|
|
|
|
|
|
/// Decodes a [dynamic value][data] to a AssetResponseDtoVisibilityEnum.
|
|
|
|
|
///
|
|
|
|
|
/// 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.
|
|
|
|
|
AssetResponseDtoVisibilityEnum? decode(dynamic data, {bool allowNull = true}) {
|
|
|
|
|
if (data != null) {
|
|
|
|
|
switch (data) {
|
|
|
|
|
case r'archive': return AssetResponseDtoVisibilityEnum.archive;
|
|
|
|
|
case r'timeline': return AssetResponseDtoVisibilityEnum.timeline;
|
|
|
|
|
case r'hidden': return AssetResponseDtoVisibilityEnum.hidden;
|
|
|
|
|
case r'locked': return AssetResponseDtoVisibilityEnum.locked;
|
|
|
|
|
default:
|
|
|
|
|
if (!allowNull) {
|
|
|
|
|
throw ArgumentError('Unknown enum value to decode: $data');
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// Singleton [AssetResponseDtoVisibilityEnumTypeTransformer] instance.
|
|
|
|
|
static AssetResponseDtoVisibilityEnumTypeTransformer? _instance;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|