mirror of
https://github.com/TeamPiped/piped_dart.git
synced 2024-08-14 22:27:49 +00:00
Update with oneOf.
This commit is contained in:
parent
938917a835
commit
b91c008f1c
18 changed files with 2390 additions and 1919 deletions
|
@ -1 +1 @@
|
|||
6.0.1
|
||||
6.2.0
|
|
@ -2,6 +2,7 @@
|
|||
// AUTO-GENERATED FILE, DO NOT MODIFY!
|
||||
//
|
||||
|
||||
// ignore_for_file: unused_element
|
||||
import 'package:piped_api/src/model/stream_item.dart';
|
||||
import 'package:built_collection/built_collection.dart';
|
||||
import 'package:built_value/built_value.dart';
|
||||
|
@ -21,181 +22,241 @@ part 'channel_info.g.dart';
|
|||
/// * [relatedStreams]
|
||||
/// * [subscriberCount] - The number of subscribers the channel has.
|
||||
/// * [verified] - Whether the channel is verified.
|
||||
@BuiltValue()
|
||||
abstract class ChannelInfo implements Built<ChannelInfo, ChannelInfoBuilder> {
|
||||
/// The URL of the channel's avatar.
|
||||
@BuiltValueField(wireName: r'avatarUrl')
|
||||
String? get avatarUrl;
|
||||
/// The URL of the channel's avatar.
|
||||
@BuiltValueField(wireName: r'avatarUrl')
|
||||
String? get avatarUrl;
|
||||
|
||||
/// The URL of the channel's banner.
|
||||
@BuiltValueField(wireName: r'bannerUrl')
|
||||
String? get bannerUrl;
|
||||
/// The URL of the channel's banner.
|
||||
@BuiltValueField(wireName: r'bannerUrl')
|
||||
String? get bannerUrl;
|
||||
|
||||
/// The channel's description.
|
||||
@BuiltValueField(wireName: r'description')
|
||||
String? get description;
|
||||
/// The channel's description.
|
||||
@BuiltValueField(wireName: r'description')
|
||||
String? get description;
|
||||
|
||||
/// The ID of the channel.
|
||||
@BuiltValueField(wireName: r'id')
|
||||
String? get id;
|
||||
/// The ID of the channel.
|
||||
@BuiltValueField(wireName: r'id')
|
||||
String? get id;
|
||||
|
||||
/// The name of the channel.
|
||||
@BuiltValueField(wireName: r'name')
|
||||
String? get name;
|
||||
/// The name of the channel.
|
||||
@BuiltValueField(wireName: r'name')
|
||||
String? get name;
|
||||
|
||||
/// The parameter used to get the next page of related videos.
|
||||
@BuiltValueField(wireName: r'nextpage')
|
||||
String? get nextpage;
|
||||
/// The parameter used to get the next page of related videos.
|
||||
@BuiltValueField(wireName: r'nextpage')
|
||||
String? get nextpage;
|
||||
|
||||
@BuiltValueField(wireName: r'relatedStreams')
|
||||
BuiltList<StreamItem>? get relatedStreams;
|
||||
@BuiltValueField(wireName: r'relatedStreams')
|
||||
BuiltList<StreamItem>? get relatedStreams;
|
||||
|
||||
/// The number of subscribers the channel has.
|
||||
@BuiltValueField(wireName: r'subscriberCount')
|
||||
int? get subscriberCount;
|
||||
/// The number of subscribers the channel has.
|
||||
@BuiltValueField(wireName: r'subscriberCount')
|
||||
int? get subscriberCount;
|
||||
|
||||
/// Whether the channel is verified.
|
||||
@BuiltValueField(wireName: r'verified')
|
||||
bool? get verified;
|
||||
/// Whether the channel is verified.
|
||||
@BuiltValueField(wireName: r'verified')
|
||||
bool? get verified;
|
||||
|
||||
ChannelInfo._();
|
||||
ChannelInfo._();
|
||||
|
||||
@BuiltValueHook(initializeBuilder: true)
|
||||
static void _defaults(ChannelInfoBuilder b) => b;
|
||||
factory ChannelInfo([void updates(ChannelInfoBuilder b)]) = _$ChannelInfo;
|
||||
|
||||
factory ChannelInfo([void updates(ChannelInfoBuilder b)]) = _$ChannelInfo;
|
||||
@BuiltValueHook(initializeBuilder: true)
|
||||
static void _defaults(ChannelInfoBuilder b) => b;
|
||||
|
||||
@BuiltValueSerializer(custom: true)
|
||||
static Serializer<ChannelInfo> get serializer => _$ChannelInfoSerializer();
|
||||
@BuiltValueSerializer(custom: true)
|
||||
static Serializer<ChannelInfo> get serializer => _$ChannelInfoSerializer();
|
||||
}
|
||||
|
||||
class _$ChannelInfoSerializer implements StructuredSerializer<ChannelInfo> {
|
||||
@override
|
||||
final Iterable<Type> types = const [ChannelInfo, _$ChannelInfo];
|
||||
class _$ChannelInfoSerializer implements PrimitiveSerializer<ChannelInfo> {
|
||||
@override
|
||||
final Iterable<Type> types = const [ChannelInfo, _$ChannelInfo];
|
||||
|
||||
@override
|
||||
final String wireName = r'ChannelInfo';
|
||||
@override
|
||||
final String wireName = r'ChannelInfo';
|
||||
|
||||
@override
|
||||
Iterable<Object?> serialize(Serializers serializers, ChannelInfo object,
|
||||
{FullType specifiedType = FullType.unspecified}) {
|
||||
final result = <Object?>[];
|
||||
if (object.avatarUrl != null) {
|
||||
result
|
||||
..add(r'avatarUrl')
|
||||
..add(serializers.serialize(object.avatarUrl,
|
||||
specifiedType: const FullType(String)));
|
||||
}
|
||||
if (object.bannerUrl != null) {
|
||||
result
|
||||
..add(r'bannerUrl')
|
||||
..add(serializers.serialize(object.bannerUrl,
|
||||
specifiedType: const FullType(String)));
|
||||
}
|
||||
if (object.description != null) {
|
||||
result
|
||||
..add(r'description')
|
||||
..add(serializers.serialize(object.description,
|
||||
specifiedType: const FullType(String)));
|
||||
}
|
||||
if (object.id != null) {
|
||||
result
|
||||
..add(r'id')
|
||||
..add(serializers.serialize(object.id,
|
||||
specifiedType: const FullType(String)));
|
||||
}
|
||||
if (object.name != null) {
|
||||
result
|
||||
..add(r'name')
|
||||
..add(serializers.serialize(object.name,
|
||||
specifiedType: const FullType(String)));
|
||||
}
|
||||
if (object.nextpage != null) {
|
||||
result
|
||||
..add(r'nextpage')
|
||||
..add(serializers.serialize(object.nextpage,
|
||||
specifiedType: const FullType(String)));
|
||||
}
|
||||
if (object.relatedStreams != null) {
|
||||
result
|
||||
..add(r'relatedStreams')
|
||||
..add(serializers.serialize(object.relatedStreams,
|
||||
specifiedType: const FullType(BuiltList, [FullType(StreamItem)])));
|
||||
}
|
||||
if (object.subscriberCount != null) {
|
||||
result
|
||||
..add(r'subscriberCount')
|
||||
..add(serializers.serialize(object.subscriberCount,
|
||||
specifiedType: const FullType(int)));
|
||||
}
|
||||
if (object.verified != null) {
|
||||
result
|
||||
..add(r'verified')
|
||||
..add(serializers.serialize(object.verified,
|
||||
specifiedType: const FullType(bool)));
|
||||
}
|
||||
return result;
|
||||
Iterable<Object?> _serializeProperties(
|
||||
Serializers serializers,
|
||||
ChannelInfo object, {
|
||||
FullType specifiedType = FullType.unspecified,
|
||||
}) sync* {
|
||||
if (object.avatarUrl != null) {
|
||||
yield r'avatarUrl';
|
||||
yield serializers.serialize(
|
||||
object.avatarUrl,
|
||||
specifiedType: const FullType(String),
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
ChannelInfo deserialize(Serializers serializers, Iterable<Object?> serialized,
|
||||
{FullType specifiedType = FullType.unspecified}) {
|
||||
final result = ChannelInfoBuilder();
|
||||
|
||||
final iterator = serialized.iterator;
|
||||
while (iterator.moveNext()) {
|
||||
final key = iterator.current as String;
|
||||
iterator.moveNext();
|
||||
final Object? value = iterator.current;
|
||||
|
||||
switch (key) {
|
||||
case r'avatarUrl':
|
||||
final valueDes = serializers.deserialize(value,
|
||||
specifiedType: const FullType(String)) as String;
|
||||
result.avatarUrl = valueDes;
|
||||
break;
|
||||
case r'bannerUrl':
|
||||
final valueDes = serializers.deserialize(value,
|
||||
specifiedType: const FullType(String)) as String;
|
||||
result.bannerUrl = valueDes;
|
||||
break;
|
||||
case r'description':
|
||||
final valueDes = serializers.deserialize(value,
|
||||
specifiedType: const FullType(String)) as String;
|
||||
result.description = valueDes;
|
||||
break;
|
||||
case r'id':
|
||||
final valueDes = serializers.deserialize(value,
|
||||
specifiedType: const FullType(String)) as String;
|
||||
result.id = valueDes;
|
||||
break;
|
||||
case r'name':
|
||||
final valueDes = serializers.deserialize(value,
|
||||
specifiedType: const FullType(String)) as String;
|
||||
result.name = valueDes;
|
||||
break;
|
||||
case r'nextpage':
|
||||
final valueDes = serializers.deserialize(value,
|
||||
specifiedType: const FullType(String)) as String;
|
||||
result.nextpage = valueDes;
|
||||
break;
|
||||
case r'relatedStreams':
|
||||
final valueDes = serializers.deserialize(value,
|
||||
specifiedType: const FullType(BuiltList, [FullType(StreamItem)])) as BuiltList<StreamItem>;
|
||||
result.relatedStreams.replace(valueDes);
|
||||
break;
|
||||
case r'subscriberCount':
|
||||
final valueDes = serializers.deserialize(value,
|
||||
specifiedType: const FullType(int)) as int;
|
||||
result.subscriberCount = valueDes;
|
||||
break;
|
||||
case r'verified':
|
||||
final valueDes = serializers.deserialize(value,
|
||||
specifiedType: const FullType(bool)) as bool;
|
||||
result.verified = valueDes;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return result.build();
|
||||
if (object.bannerUrl != null) {
|
||||
yield r'bannerUrl';
|
||||
yield serializers.serialize(
|
||||
object.bannerUrl,
|
||||
specifiedType: const FullType(String),
|
||||
);
|
||||
}
|
||||
if (object.description != null) {
|
||||
yield r'description';
|
||||
yield serializers.serialize(
|
||||
object.description,
|
||||
specifiedType: const FullType(String),
|
||||
);
|
||||
}
|
||||
if (object.id != null) {
|
||||
yield r'id';
|
||||
yield serializers.serialize(
|
||||
object.id,
|
||||
specifiedType: const FullType(String),
|
||||
);
|
||||
}
|
||||
if (object.name != null) {
|
||||
yield r'name';
|
||||
yield serializers.serialize(
|
||||
object.name,
|
||||
specifiedType: const FullType(String),
|
||||
);
|
||||
}
|
||||
if (object.nextpage != null) {
|
||||
yield r'nextpage';
|
||||
yield serializers.serialize(
|
||||
object.nextpage,
|
||||
specifiedType: const FullType(String),
|
||||
);
|
||||
}
|
||||
if (object.relatedStreams != null) {
|
||||
yield r'relatedStreams';
|
||||
yield serializers.serialize(
|
||||
object.relatedStreams,
|
||||
specifiedType: const FullType(BuiltList, [FullType(StreamItem)]),
|
||||
);
|
||||
}
|
||||
if (object.subscriberCount != null) {
|
||||
yield r'subscriberCount';
|
||||
yield serializers.serialize(
|
||||
object.subscriberCount,
|
||||
specifiedType: const FullType(int),
|
||||
);
|
||||
}
|
||||
if (object.verified != null) {
|
||||
yield r'verified';
|
||||
yield serializers.serialize(
|
||||
object.verified,
|
||||
specifiedType: const FullType(bool),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
Object serialize(
|
||||
Serializers serializers,
|
||||
ChannelInfo object, {
|
||||
FullType specifiedType = FullType.unspecified,
|
||||
}) {
|
||||
return _serializeProperties(serializers, object, specifiedType: specifiedType).toList();
|
||||
}
|
||||
|
||||
void _deserializeProperties(
|
||||
Serializers serializers,
|
||||
Object serialized, {
|
||||
FullType specifiedType = FullType.unspecified,
|
||||
required List<Object?> serializedList,
|
||||
required ChannelInfoBuilder result,
|
||||
required List<Object?> unhandled,
|
||||
}) {
|
||||
for (var i = 0; i < serializedList.length; i += 2) {
|
||||
final key = serializedList[i] as String;
|
||||
final value = serializedList[i + 1];
|
||||
switch (key) {
|
||||
case r'avatarUrl':
|
||||
final valueDes = serializers.deserialize(
|
||||
value,
|
||||
specifiedType: const FullType(String),
|
||||
) as String;
|
||||
result.avatarUrl = valueDes;
|
||||
break;
|
||||
case r'bannerUrl':
|
||||
final valueDes = serializers.deserialize(
|
||||
value,
|
||||
specifiedType: const FullType(String),
|
||||
) as String;
|
||||
result.bannerUrl = valueDes;
|
||||
break;
|
||||
case r'description':
|
||||
final valueDes = serializers.deserialize(
|
||||
value,
|
||||
specifiedType: const FullType(String),
|
||||
) as String;
|
||||
result.description = valueDes;
|
||||
break;
|
||||
case r'id':
|
||||
final valueDes = serializers.deserialize(
|
||||
value,
|
||||
specifiedType: const FullType(String),
|
||||
) as String;
|
||||
result.id = valueDes;
|
||||
break;
|
||||
case r'name':
|
||||
final valueDes = serializers.deserialize(
|
||||
value,
|
||||
specifiedType: const FullType(String),
|
||||
) as String;
|
||||
result.name = valueDes;
|
||||
break;
|
||||
case r'nextpage':
|
||||
final valueDes = serializers.deserialize(
|
||||
value,
|
||||
specifiedType: const FullType(String),
|
||||
) as String;
|
||||
result.nextpage = valueDes;
|
||||
break;
|
||||
case r'relatedStreams':
|
||||
final valueDes = serializers.deserialize(
|
||||
value,
|
||||
specifiedType: const FullType(BuiltList, [FullType(StreamItem)]),
|
||||
) as BuiltList<StreamItem>;
|
||||
result.relatedStreams.replace(valueDes);
|
||||
break;
|
||||
case r'subscriberCount':
|
||||
final valueDes = serializers.deserialize(
|
||||
value,
|
||||
specifiedType: const FullType(int),
|
||||
) as int;
|
||||
result.subscriberCount = valueDes;
|
||||
break;
|
||||
case r'verified':
|
||||
final valueDes = serializers.deserialize(
|
||||
value,
|
||||
specifiedType: const FullType(bool),
|
||||
) as bool;
|
||||
result.verified = valueDes;
|
||||
break;
|
||||
default:
|
||||
unhandled.add(key);
|
||||
unhandled.add(value);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
ChannelInfo deserialize(
|
||||
Serializers serializers,
|
||||
Object serialized, {
|
||||
FullType specifiedType = FullType.unspecified,
|
||||
}) {
|
||||
final result = ChannelInfoBuilder();
|
||||
final serializedList = (serialized as Iterable<Object?>).toList();
|
||||
final unhandled = <Object?>[];
|
||||
_deserializeProperties(
|
||||
serializers,
|
||||
serialized,
|
||||
specifiedType: specifiedType,
|
||||
serializedList: serializedList,
|
||||
unhandled: unhandled,
|
||||
result: result,
|
||||
);
|
||||
return result.build();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
// AUTO-GENERATED FILE, DO NOT MODIFY!
|
||||
//
|
||||
|
||||
// ignore_for_file: unused_element
|
||||
import 'package:built_value/built_value.dart';
|
||||
import 'package:built_value/serializer.dart';
|
||||
|
||||
|
@ -17,152 +18,206 @@ part 'channel_item.g.dart';
|
|||
/// * [url] - The relative URL of the channel.
|
||||
/// * [verified] - Whether the channel is verified.
|
||||
/// * [videos] - The number of videos the channel has.
|
||||
@BuiltValue()
|
||||
abstract class ChannelItem implements Built<ChannelItem, ChannelItemBuilder> {
|
||||
/// The description of the channel.
|
||||
@BuiltValueField(wireName: r'description')
|
||||
String? get description;
|
||||
/// The description of the channel.
|
||||
@BuiltValueField(wireName: r'description')
|
||||
String? get description;
|
||||
|
||||
/// The name of the channel.
|
||||
@BuiltValueField(wireName: r'name')
|
||||
String? get name;
|
||||
/// The name of the channel.
|
||||
@BuiltValueField(wireName: r'name')
|
||||
String? get name;
|
||||
|
||||
/// The number of subscribers the channel has.
|
||||
@BuiltValueField(wireName: r'subscribers')
|
||||
int? get subscribers;
|
||||
/// The number of subscribers the channel has.
|
||||
@BuiltValueField(wireName: r'subscribers')
|
||||
int? get subscribers;
|
||||
|
||||
/// The thumbnail of the channel.
|
||||
@BuiltValueField(wireName: r'thumbnail')
|
||||
String? get thumbnail;
|
||||
/// The thumbnail of the channel.
|
||||
@BuiltValueField(wireName: r'thumbnail')
|
||||
String? get thumbnail;
|
||||
|
||||
/// The relative URL of the channel.
|
||||
@BuiltValueField(wireName: r'url')
|
||||
String? get url;
|
||||
/// The relative URL of the channel.
|
||||
@BuiltValueField(wireName: r'url')
|
||||
String? get url;
|
||||
|
||||
/// Whether the channel is verified.
|
||||
@BuiltValueField(wireName: r'verified')
|
||||
bool? get verified;
|
||||
/// Whether the channel is verified.
|
||||
@BuiltValueField(wireName: r'verified')
|
||||
bool? get verified;
|
||||
|
||||
/// The number of videos the channel has.
|
||||
@BuiltValueField(wireName: r'videos')
|
||||
int? get videos;
|
||||
/// The number of videos the channel has.
|
||||
@BuiltValueField(wireName: r'videos')
|
||||
int? get videos;
|
||||
|
||||
ChannelItem._();
|
||||
ChannelItem._();
|
||||
|
||||
@BuiltValueHook(initializeBuilder: true)
|
||||
static void _defaults(ChannelItemBuilder b) => b;
|
||||
factory ChannelItem([void updates(ChannelItemBuilder b)]) = _$ChannelItem;
|
||||
|
||||
factory ChannelItem([void updates(ChannelItemBuilder b)]) = _$ChannelItem;
|
||||
@BuiltValueHook(initializeBuilder: true)
|
||||
static void _defaults(ChannelItemBuilder b) => b;
|
||||
|
||||
@BuiltValueSerializer(custom: true)
|
||||
static Serializer<ChannelItem> get serializer => _$ChannelItemSerializer();
|
||||
@BuiltValueSerializer(custom: true)
|
||||
static Serializer<ChannelItem> get serializer => _$ChannelItemSerializer();
|
||||
}
|
||||
|
||||
class _$ChannelItemSerializer implements StructuredSerializer<ChannelItem> {
|
||||
@override
|
||||
final Iterable<Type> types = const [ChannelItem, _$ChannelItem];
|
||||
class _$ChannelItemSerializer implements PrimitiveSerializer<ChannelItem> {
|
||||
@override
|
||||
final Iterable<Type> types = const [ChannelItem, _$ChannelItem];
|
||||
|
||||
@override
|
||||
final String wireName = r'ChannelItem';
|
||||
@override
|
||||
final String wireName = r'ChannelItem';
|
||||
|
||||
@override
|
||||
Iterable<Object?> serialize(Serializers serializers, ChannelItem object,
|
||||
{FullType specifiedType = FullType.unspecified}) {
|
||||
final result = <Object?>[];
|
||||
if (object.description != null) {
|
||||
result
|
||||
..add(r'description')
|
||||
..add(serializers.serialize(object.description,
|
||||
specifiedType: const FullType(String)));
|
||||
}
|
||||
if (object.name != null) {
|
||||
result
|
||||
..add(r'name')
|
||||
..add(serializers.serialize(object.name,
|
||||
specifiedType: const FullType(String)));
|
||||
}
|
||||
if (object.subscribers != null) {
|
||||
result
|
||||
..add(r'subscribers')
|
||||
..add(serializers.serialize(object.subscribers,
|
||||
specifiedType: const FullType(int)));
|
||||
}
|
||||
if (object.thumbnail != null) {
|
||||
result
|
||||
..add(r'thumbnail')
|
||||
..add(serializers.serialize(object.thumbnail,
|
||||
specifiedType: const FullType(String)));
|
||||
}
|
||||
if (object.url != null) {
|
||||
result
|
||||
..add(r'url')
|
||||
..add(serializers.serialize(object.url,
|
||||
specifiedType: const FullType(String)));
|
||||
}
|
||||
if (object.verified != null) {
|
||||
result
|
||||
..add(r'verified')
|
||||
..add(serializers.serialize(object.verified,
|
||||
specifiedType: const FullType(bool)));
|
||||
}
|
||||
if (object.videos != null) {
|
||||
result
|
||||
..add(r'videos')
|
||||
..add(serializers.serialize(object.videos,
|
||||
specifiedType: const FullType(int)));
|
||||
}
|
||||
return result;
|
||||
Iterable<Object?> _serializeProperties(
|
||||
Serializers serializers,
|
||||
ChannelItem object, {
|
||||
FullType specifiedType = FullType.unspecified,
|
||||
}) sync* {
|
||||
if (object.description != null) {
|
||||
yield r'description';
|
||||
yield serializers.serialize(
|
||||
object.description,
|
||||
specifiedType: const FullType(String),
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
ChannelItem deserialize(Serializers serializers, Iterable<Object?> serialized,
|
||||
{FullType specifiedType = FullType.unspecified}) {
|
||||
final result = ChannelItemBuilder();
|
||||
|
||||
final iterator = serialized.iterator;
|
||||
while (iterator.moveNext()) {
|
||||
final key = iterator.current as String;
|
||||
iterator.moveNext();
|
||||
final Object? value = iterator.current;
|
||||
|
||||
switch (key) {
|
||||
case r'description':
|
||||
final valueDes = serializers.deserialize(value,
|
||||
specifiedType: const FullType(String)) as String;
|
||||
result.description = valueDes;
|
||||
break;
|
||||
case r'name':
|
||||
final valueDes = serializers.deserialize(value,
|
||||
specifiedType: const FullType(String)) as String;
|
||||
result.name = valueDes;
|
||||
break;
|
||||
case r'subscribers':
|
||||
final valueDes = serializers.deserialize(value,
|
||||
specifiedType: const FullType(int)) as int;
|
||||
result.subscribers = valueDes;
|
||||
break;
|
||||
case r'thumbnail':
|
||||
final valueDes = serializers.deserialize(value,
|
||||
specifiedType: const FullType(String)) as String;
|
||||
result.thumbnail = valueDes;
|
||||
break;
|
||||
case r'url':
|
||||
final valueDes = serializers.deserialize(value,
|
||||
specifiedType: const FullType(String)) as String;
|
||||
result.url = valueDes;
|
||||
break;
|
||||
case r'verified':
|
||||
final valueDes = serializers.deserialize(value,
|
||||
specifiedType: const FullType(bool)) as bool;
|
||||
result.verified = valueDes;
|
||||
break;
|
||||
case r'videos':
|
||||
final valueDes = serializers.deserialize(value,
|
||||
specifiedType: const FullType(int)) as int;
|
||||
result.videos = valueDes;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return result.build();
|
||||
if (object.name != null) {
|
||||
yield r'name';
|
||||
yield serializers.serialize(
|
||||
object.name,
|
||||
specifiedType: const FullType(String),
|
||||
);
|
||||
}
|
||||
if (object.subscribers != null) {
|
||||
yield r'subscribers';
|
||||
yield serializers.serialize(
|
||||
object.subscribers,
|
||||
specifiedType: const FullType(int),
|
||||
);
|
||||
}
|
||||
if (object.thumbnail != null) {
|
||||
yield r'thumbnail';
|
||||
yield serializers.serialize(
|
||||
object.thumbnail,
|
||||
specifiedType: const FullType(String),
|
||||
);
|
||||
}
|
||||
if (object.url != null) {
|
||||
yield r'url';
|
||||
yield serializers.serialize(
|
||||
object.url,
|
||||
specifiedType: const FullType(String),
|
||||
);
|
||||
}
|
||||
if (object.verified != null) {
|
||||
yield r'verified';
|
||||
yield serializers.serialize(
|
||||
object.verified,
|
||||
specifiedType: const FullType(bool),
|
||||
);
|
||||
}
|
||||
if (object.videos != null) {
|
||||
yield r'videos';
|
||||
yield serializers.serialize(
|
||||
object.videos,
|
||||
specifiedType: const FullType(int),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
Object serialize(
|
||||
Serializers serializers,
|
||||
ChannelItem object, {
|
||||
FullType specifiedType = FullType.unspecified,
|
||||
}) {
|
||||
return _serializeProperties(serializers, object, specifiedType: specifiedType).toList();
|
||||
}
|
||||
|
||||
void _deserializeProperties(
|
||||
Serializers serializers,
|
||||
Object serialized, {
|
||||
FullType specifiedType = FullType.unspecified,
|
||||
required List<Object?> serializedList,
|
||||
required ChannelItemBuilder result,
|
||||
required List<Object?> unhandled,
|
||||
}) {
|
||||
for (var i = 0; i < serializedList.length; i += 2) {
|
||||
final key = serializedList[i] as String;
|
||||
final value = serializedList[i + 1];
|
||||
switch (key) {
|
||||
case r'description':
|
||||
final valueDes = serializers.deserialize(
|
||||
value,
|
||||
specifiedType: const FullType(String),
|
||||
) as String;
|
||||
result.description = valueDes;
|
||||
break;
|
||||
case r'name':
|
||||
final valueDes = serializers.deserialize(
|
||||
value,
|
||||
specifiedType: const FullType(String),
|
||||
) as String;
|
||||
result.name = valueDes;
|
||||
break;
|
||||
case r'subscribers':
|
||||
final valueDes = serializers.deserialize(
|
||||
value,
|
||||
specifiedType: const FullType(int),
|
||||
) as int;
|
||||
result.subscribers = valueDes;
|
||||
break;
|
||||
case r'thumbnail':
|
||||
final valueDes = serializers.deserialize(
|
||||
value,
|
||||
specifiedType: const FullType(String),
|
||||
) as String;
|
||||
result.thumbnail = valueDes;
|
||||
break;
|
||||
case r'url':
|
||||
final valueDes = serializers.deserialize(
|
||||
value,
|
||||
specifiedType: const FullType(String),
|
||||
) as String;
|
||||
result.url = valueDes;
|
||||
break;
|
||||
case r'verified':
|
||||
final valueDes = serializers.deserialize(
|
||||
value,
|
||||
specifiedType: const FullType(bool),
|
||||
) as bool;
|
||||
result.verified = valueDes;
|
||||
break;
|
||||
case r'videos':
|
||||
final valueDes = serializers.deserialize(
|
||||
value,
|
||||
specifiedType: const FullType(int),
|
||||
) as int;
|
||||
result.videos = valueDes;
|
||||
break;
|
||||
default:
|
||||
unhandled.add(key);
|
||||
unhandled.add(value);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
ChannelItem deserialize(
|
||||
Serializers serializers,
|
||||
Object serialized, {
|
||||
FullType specifiedType = FullType.unspecified,
|
||||
}) {
|
||||
final result = ChannelItemBuilder();
|
||||
final serializedList = (serialized as Iterable<Object?>).toList();
|
||||
final unhandled = <Object?>[];
|
||||
_deserializeProperties(
|
||||
serializers,
|
||||
serialized,
|
||||
specifiedType: specifiedType,
|
||||
serializedList: serializedList,
|
||||
unhandled: unhandled,
|
||||
result: result,
|
||||
);
|
||||
return result.build();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
// AUTO-GENERATED FILE, DO NOT MODIFY!
|
||||
//
|
||||
|
||||
// ignore_for_file: unused_element
|
||||
import 'package:built_value/built_value.dart';
|
||||
import 'package:built_value/serializer.dart';
|
||||
|
||||
|
@ -21,212 +22,278 @@ part 'comment.g.dart';
|
|||
/// * [hearted] - Whether the comment was hearted by the video's uploader.
|
||||
/// * [pinned] - Whether the comment was pinned by the video's uploader.
|
||||
/// * [verified] - Whether the author of the comment is verified.
|
||||
@BuiltValue()
|
||||
abstract class Comment implements Built<Comment, CommentBuilder> {
|
||||
/// The name of the author of the comment.
|
||||
@BuiltValueField(wireName: r'author')
|
||||
String? get author;
|
||||
/// The name of the author of the comment.
|
||||
@BuiltValueField(wireName: r'author')
|
||||
String? get author;
|
||||
|
||||
/// The thumbnail/avatar of the author of the comment.
|
||||
@BuiltValueField(wireName: r'thumbnail')
|
||||
String? get thumbnail;
|
||||
/// The thumbnail/avatar of the author of the comment.
|
||||
@BuiltValueField(wireName: r'thumbnail')
|
||||
String? get thumbnail;
|
||||
|
||||
/// The ID of the comment.
|
||||
@BuiltValueField(wireName: r'commentId')
|
||||
String? get commentId;
|
||||
/// The ID of the comment.
|
||||
@BuiltValueField(wireName: r'commentId')
|
||||
String? get commentId;
|
||||
|
||||
/// The text of the comment.
|
||||
@BuiltValueField(wireName: r'commentText')
|
||||
String? get commentText;
|
||||
/// The text of the comment.
|
||||
@BuiltValueField(wireName: r'commentText')
|
||||
String? get commentText;
|
||||
|
||||
/// The relative time the comment was made.
|
||||
@BuiltValueField(wireName: r'commentedTime')
|
||||
String? get commentedTime;
|
||||
/// The relative time the comment was made.
|
||||
@BuiltValueField(wireName: r'commentedTime')
|
||||
String? get commentedTime;
|
||||
|
||||
/// The relative URL of the author of the comment.
|
||||
@BuiltValueField(wireName: r'commentorUrl')
|
||||
String? get commentorUrl;
|
||||
/// The relative URL of the author of the comment.
|
||||
@BuiltValueField(wireName: r'commentorUrl')
|
||||
String? get commentorUrl;
|
||||
|
||||
/// The parameter used as the nextpage to fetch replies for this comment.
|
||||
@BuiltValueField(wireName: r'repliesPage')
|
||||
String? get repliesPage;
|
||||
/// The parameter used as the nextpage to fetch replies for this comment.
|
||||
@BuiltValueField(wireName: r'repliesPage')
|
||||
String? get repliesPage;
|
||||
|
||||
/// The number of likes the comment has.
|
||||
@BuiltValueField(wireName: r'likeCount')
|
||||
int? get likeCount;
|
||||
/// The number of likes the comment has.
|
||||
@BuiltValueField(wireName: r'likeCount')
|
||||
int? get likeCount;
|
||||
|
||||
/// Whether the comment was hearted by the video's uploader.
|
||||
@BuiltValueField(wireName: r'hearted')
|
||||
bool? get hearted;
|
||||
/// Whether the comment was hearted by the video's uploader.
|
||||
@BuiltValueField(wireName: r'hearted')
|
||||
bool? get hearted;
|
||||
|
||||
/// Whether the comment was pinned by the video's uploader.
|
||||
@BuiltValueField(wireName: r'pinned')
|
||||
bool? get pinned;
|
||||
/// Whether the comment was pinned by the video's uploader.
|
||||
@BuiltValueField(wireName: r'pinned')
|
||||
bool? get pinned;
|
||||
|
||||
/// Whether the author of the comment is verified.
|
||||
@BuiltValueField(wireName: r'verified')
|
||||
bool? get verified;
|
||||
/// Whether the author of the comment is verified.
|
||||
@BuiltValueField(wireName: r'verified')
|
||||
bool? get verified;
|
||||
|
||||
Comment._();
|
||||
Comment._();
|
||||
|
||||
@BuiltValueHook(initializeBuilder: true)
|
||||
static void _defaults(CommentBuilder b) => b;
|
||||
factory Comment([void updates(CommentBuilder b)]) = _$Comment;
|
||||
|
||||
factory Comment([void updates(CommentBuilder b)]) = _$Comment;
|
||||
@BuiltValueHook(initializeBuilder: true)
|
||||
static void _defaults(CommentBuilder b) => b;
|
||||
|
||||
@BuiltValueSerializer(custom: true)
|
||||
static Serializer<Comment> get serializer => _$CommentSerializer();
|
||||
@BuiltValueSerializer(custom: true)
|
||||
static Serializer<Comment> get serializer => _$CommentSerializer();
|
||||
}
|
||||
|
||||
class _$CommentSerializer implements StructuredSerializer<Comment> {
|
||||
@override
|
||||
final Iterable<Type> types = const [Comment, _$Comment];
|
||||
class _$CommentSerializer implements PrimitiveSerializer<Comment> {
|
||||
@override
|
||||
final Iterable<Type> types = const [Comment, _$Comment];
|
||||
|
||||
@override
|
||||
final String wireName = r'Comment';
|
||||
@override
|
||||
final String wireName = r'Comment';
|
||||
|
||||
@override
|
||||
Iterable<Object?> serialize(Serializers serializers, Comment object,
|
||||
{FullType specifiedType = FullType.unspecified}) {
|
||||
final result = <Object?>[];
|
||||
if (object.author != null) {
|
||||
result
|
||||
..add(r'author')
|
||||
..add(serializers.serialize(object.author,
|
||||
specifiedType: const FullType(String)));
|
||||
}
|
||||
if (object.thumbnail != null) {
|
||||
result
|
||||
..add(r'thumbnail')
|
||||
..add(serializers.serialize(object.thumbnail,
|
||||
specifiedType: const FullType(String)));
|
||||
}
|
||||
if (object.commentId != null) {
|
||||
result
|
||||
..add(r'commentId')
|
||||
..add(serializers.serialize(object.commentId,
|
||||
specifiedType: const FullType(String)));
|
||||
}
|
||||
if (object.commentText != null) {
|
||||
result
|
||||
..add(r'commentText')
|
||||
..add(serializers.serialize(object.commentText,
|
||||
specifiedType: const FullType(String)));
|
||||
}
|
||||
if (object.commentedTime != null) {
|
||||
result
|
||||
..add(r'commentedTime')
|
||||
..add(serializers.serialize(object.commentedTime,
|
||||
specifiedType: const FullType(String)));
|
||||
}
|
||||
if (object.commentorUrl != null) {
|
||||
result
|
||||
..add(r'commentorUrl')
|
||||
..add(serializers.serialize(object.commentorUrl,
|
||||
specifiedType: const FullType(String)));
|
||||
}
|
||||
if (object.repliesPage != null) {
|
||||
result
|
||||
..add(r'repliesPage')
|
||||
..add(serializers.serialize(object.repliesPage,
|
||||
specifiedType: const FullType(String)));
|
||||
}
|
||||
if (object.likeCount != null) {
|
||||
result
|
||||
..add(r'likeCount')
|
||||
..add(serializers.serialize(object.likeCount,
|
||||
specifiedType: const FullType(int)));
|
||||
}
|
||||
if (object.hearted != null) {
|
||||
result
|
||||
..add(r'hearted')
|
||||
..add(serializers.serialize(object.hearted,
|
||||
specifiedType: const FullType(bool)));
|
||||
}
|
||||
if (object.pinned != null) {
|
||||
result
|
||||
..add(r'pinned')
|
||||
..add(serializers.serialize(object.pinned,
|
||||
specifiedType: const FullType(bool)));
|
||||
}
|
||||
if (object.verified != null) {
|
||||
result
|
||||
..add(r'verified')
|
||||
..add(serializers.serialize(object.verified,
|
||||
specifiedType: const FullType(bool)));
|
||||
}
|
||||
return result;
|
||||
Iterable<Object?> _serializeProperties(
|
||||
Serializers serializers,
|
||||
Comment object, {
|
||||
FullType specifiedType = FullType.unspecified,
|
||||
}) sync* {
|
||||
if (object.author != null) {
|
||||
yield r'author';
|
||||
yield serializers.serialize(
|
||||
object.author,
|
||||
specifiedType: const FullType(String),
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
Comment deserialize(Serializers serializers, Iterable<Object?> serialized,
|
||||
{FullType specifiedType = FullType.unspecified}) {
|
||||
final result = CommentBuilder();
|
||||
|
||||
final iterator = serialized.iterator;
|
||||
while (iterator.moveNext()) {
|
||||
final key = iterator.current as String;
|
||||
iterator.moveNext();
|
||||
final Object? value = iterator.current;
|
||||
|
||||
switch (key) {
|
||||
case r'author':
|
||||
final valueDes = serializers.deserialize(value,
|
||||
specifiedType: const FullType(String)) as String;
|
||||
result.author = valueDes;
|
||||
break;
|
||||
case r'thumbnail':
|
||||
final valueDes = serializers.deserialize(value,
|
||||
specifiedType: const FullType(String)) as String;
|
||||
result.thumbnail = valueDes;
|
||||
break;
|
||||
case r'commentId':
|
||||
final valueDes = serializers.deserialize(value,
|
||||
specifiedType: const FullType(String)) as String;
|
||||
result.commentId = valueDes;
|
||||
break;
|
||||
case r'commentText':
|
||||
final valueDes = serializers.deserialize(value,
|
||||
specifiedType: const FullType(String)) as String;
|
||||
result.commentText = valueDes;
|
||||
break;
|
||||
case r'commentedTime':
|
||||
final valueDes = serializers.deserialize(value,
|
||||
specifiedType: const FullType(String)) as String;
|
||||
result.commentedTime = valueDes;
|
||||
break;
|
||||
case r'commentorUrl':
|
||||
final valueDes = serializers.deserialize(value,
|
||||
specifiedType: const FullType(String)) as String;
|
||||
result.commentorUrl = valueDes;
|
||||
break;
|
||||
case r'repliesPage':
|
||||
final valueDes = serializers.deserialize(value,
|
||||
specifiedType: const FullType(String)) as String;
|
||||
result.repliesPage = valueDes;
|
||||
break;
|
||||
case r'likeCount':
|
||||
final valueDes = serializers.deserialize(value,
|
||||
specifiedType: const FullType(int)) as int;
|
||||
result.likeCount = valueDes;
|
||||
break;
|
||||
case r'hearted':
|
||||
final valueDes = serializers.deserialize(value,
|
||||
specifiedType: const FullType(bool)) as bool;
|
||||
result.hearted = valueDes;
|
||||
break;
|
||||
case r'pinned':
|
||||
final valueDes = serializers.deserialize(value,
|
||||
specifiedType: const FullType(bool)) as bool;
|
||||
result.pinned = valueDes;
|
||||
break;
|
||||
case r'verified':
|
||||
final valueDes = serializers.deserialize(value,
|
||||
specifiedType: const FullType(bool)) as bool;
|
||||
result.verified = valueDes;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return result.build();
|
||||
if (object.thumbnail != null) {
|
||||
yield r'thumbnail';
|
||||
yield serializers.serialize(
|
||||
object.thumbnail,
|
||||
specifiedType: const FullType(String),
|
||||
);
|
||||
}
|
||||
if (object.commentId != null) {
|
||||
yield r'commentId';
|
||||
yield serializers.serialize(
|
||||
object.commentId,
|
||||
specifiedType: const FullType(String),
|
||||
);
|
||||
}
|
||||
if (object.commentText != null) {
|
||||
yield r'commentText';
|
||||
yield serializers.serialize(
|
||||
object.commentText,
|
||||
specifiedType: const FullType(String),
|
||||
);
|
||||
}
|
||||
if (object.commentedTime != null) {
|
||||
yield r'commentedTime';
|
||||
yield serializers.serialize(
|
||||
object.commentedTime,
|
||||
specifiedType: const FullType(String),
|
||||
);
|
||||
}
|
||||
if (object.commentorUrl != null) {
|
||||
yield r'commentorUrl';
|
||||
yield serializers.serialize(
|
||||
object.commentorUrl,
|
||||
specifiedType: const FullType(String),
|
||||
);
|
||||
}
|
||||
if (object.repliesPage != null) {
|
||||
yield r'repliesPage';
|
||||
yield serializers.serialize(
|
||||
object.repliesPage,
|
||||
specifiedType: const FullType(String),
|
||||
);
|
||||
}
|
||||
if (object.likeCount != null) {
|
||||
yield r'likeCount';
|
||||
yield serializers.serialize(
|
||||
object.likeCount,
|
||||
specifiedType: const FullType(int),
|
||||
);
|
||||
}
|
||||
if (object.hearted != null) {
|
||||
yield r'hearted';
|
||||
yield serializers.serialize(
|
||||
object.hearted,
|
||||
specifiedType: const FullType(bool),
|
||||
);
|
||||
}
|
||||
if (object.pinned != null) {
|
||||
yield r'pinned';
|
||||
yield serializers.serialize(
|
||||
object.pinned,
|
||||
specifiedType: const FullType(bool),
|
||||
);
|
||||
}
|
||||
if (object.verified != null) {
|
||||
yield r'verified';
|
||||
yield serializers.serialize(
|
||||
object.verified,
|
||||
specifiedType: const FullType(bool),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
Object serialize(
|
||||
Serializers serializers,
|
||||
Comment object, {
|
||||
FullType specifiedType = FullType.unspecified,
|
||||
}) {
|
||||
return _serializeProperties(serializers, object, specifiedType: specifiedType).toList();
|
||||
}
|
||||
|
||||
void _deserializeProperties(
|
||||
Serializers serializers,
|
||||
Object serialized, {
|
||||
FullType specifiedType = FullType.unspecified,
|
||||
required List<Object?> serializedList,
|
||||
required CommentBuilder result,
|
||||
required List<Object?> unhandled,
|
||||
}) {
|
||||
for (var i = 0; i < serializedList.length; i += 2) {
|
||||
final key = serializedList[i] as String;
|
||||
final value = serializedList[i + 1];
|
||||
switch (key) {
|
||||
case r'author':
|
||||
final valueDes = serializers.deserialize(
|
||||
value,
|
||||
specifiedType: const FullType(String),
|
||||
) as String;
|
||||
result.author = valueDes;
|
||||
break;
|
||||
case r'thumbnail':
|
||||
final valueDes = serializers.deserialize(
|
||||
value,
|
||||
specifiedType: const FullType(String),
|
||||
) as String;
|
||||
result.thumbnail = valueDes;
|
||||
break;
|
||||
case r'commentId':
|
||||
final valueDes = serializers.deserialize(
|
||||
value,
|
||||
specifiedType: const FullType(String),
|
||||
) as String;
|
||||
result.commentId = valueDes;
|
||||
break;
|
||||
case r'commentText':
|
||||
final valueDes = serializers.deserialize(
|
||||
value,
|
||||
specifiedType: const FullType(String),
|
||||
) as String;
|
||||
result.commentText = valueDes;
|
||||
break;
|
||||
case r'commentedTime':
|
||||
final valueDes = serializers.deserialize(
|
||||
value,
|
||||
specifiedType: const FullType(String),
|
||||
) as String;
|
||||
result.commentedTime = valueDes;
|
||||
break;
|
||||
case r'commentorUrl':
|
||||
final valueDes = serializers.deserialize(
|
||||
value,
|
||||
specifiedType: const FullType(String),
|
||||
) as String;
|
||||
result.commentorUrl = valueDes;
|
||||
break;
|
||||
case r'repliesPage':
|
||||
final valueDes = serializers.deserialize(
|
||||
value,
|
||||
specifiedType: const FullType(String),
|
||||
) as String;
|
||||
result.repliesPage = valueDes;
|
||||
break;
|
||||
case r'likeCount':
|
||||
final valueDes = serializers.deserialize(
|
||||
value,
|
||||
specifiedType: const FullType(int),
|
||||
) as int;
|
||||
result.likeCount = valueDes;
|
||||
break;
|
||||
case r'hearted':
|
||||
final valueDes = serializers.deserialize(
|
||||
value,
|
||||
specifiedType: const FullType(bool),
|
||||
) as bool;
|
||||
result.hearted = valueDes;
|
||||
break;
|
||||
case r'pinned':
|
||||
final valueDes = serializers.deserialize(
|
||||
value,
|
||||
specifiedType: const FullType(bool),
|
||||
) as bool;
|
||||
result.pinned = valueDes;
|
||||
break;
|
||||
case r'verified':
|
||||
final valueDes = serializers.deserialize(
|
||||
value,
|
||||
specifiedType: const FullType(bool),
|
||||
) as bool;
|
||||
result.verified = valueDes;
|
||||
break;
|
||||
default:
|
||||
unhandled.add(key);
|
||||
unhandled.add(value);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
Comment deserialize(
|
||||
Serializers serializers,
|
||||
Object serialized, {
|
||||
FullType specifiedType = FullType.unspecified,
|
||||
}) {
|
||||
final result = CommentBuilder();
|
||||
final serializedList = (serialized as Iterable<Object?>).toList();
|
||||
final unhandled = <Object?>[];
|
||||
_deserializeProperties(
|
||||
serializers,
|
||||
serialized,
|
||||
specifiedType: specifiedType,
|
||||
serializedList: serializedList,
|
||||
unhandled: unhandled,
|
||||
result: result,
|
||||
);
|
||||
return result.build();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
// AUTO-GENERATED FILE, DO NOT MODIFY!
|
||||
//
|
||||
|
||||
// ignore_for_file: unused_element
|
||||
import 'package:built_collection/built_collection.dart';
|
||||
import 'package:piped_api/src/model/comment.dart';
|
||||
import 'package:built_value/built_value.dart';
|
||||
|
@ -15,92 +16,134 @@ part 'comments_page.g.dart';
|
|||
/// * [comments]
|
||||
/// * [nextpage] - The parameter used to get the next page of comments.
|
||||
/// * [disabled] - Whether or not comments are disabled on the video.
|
||||
@BuiltValue()
|
||||
abstract class CommentsPage implements Built<CommentsPage, CommentsPageBuilder> {
|
||||
@BuiltValueField(wireName: r'comments')
|
||||
BuiltList<Comment>? get comments;
|
||||
@BuiltValueField(wireName: r'comments')
|
||||
BuiltList<Comment>? get comments;
|
||||
|
||||
/// The parameter used to get the next page of comments.
|
||||
@BuiltValueField(wireName: r'nextpage')
|
||||
String? get nextpage;
|
||||
/// The parameter used to get the next page of comments.
|
||||
@BuiltValueField(wireName: r'nextpage')
|
||||
String? get nextpage;
|
||||
|
||||
/// Whether or not comments are disabled on the video.
|
||||
@BuiltValueField(wireName: r'disabled')
|
||||
bool? get disabled;
|
||||
/// Whether or not comments are disabled on the video.
|
||||
@BuiltValueField(wireName: r'disabled')
|
||||
bool? get disabled;
|
||||
|
||||
CommentsPage._();
|
||||
CommentsPage._();
|
||||
|
||||
@BuiltValueHook(initializeBuilder: true)
|
||||
static void _defaults(CommentsPageBuilder b) => b;
|
||||
factory CommentsPage([void updates(CommentsPageBuilder b)]) = _$CommentsPage;
|
||||
|
||||
factory CommentsPage([void updates(CommentsPageBuilder b)]) = _$CommentsPage;
|
||||
@BuiltValueHook(initializeBuilder: true)
|
||||
static void _defaults(CommentsPageBuilder b) => b;
|
||||
|
||||
@BuiltValueSerializer(custom: true)
|
||||
static Serializer<CommentsPage> get serializer => _$CommentsPageSerializer();
|
||||
@BuiltValueSerializer(custom: true)
|
||||
static Serializer<CommentsPage> get serializer => _$CommentsPageSerializer();
|
||||
}
|
||||
|
||||
class _$CommentsPageSerializer implements StructuredSerializer<CommentsPage> {
|
||||
@override
|
||||
final Iterable<Type> types = const [CommentsPage, _$CommentsPage];
|
||||
class _$CommentsPageSerializer implements PrimitiveSerializer<CommentsPage> {
|
||||
@override
|
||||
final Iterable<Type> types = const [CommentsPage, _$CommentsPage];
|
||||
|
||||
@override
|
||||
final String wireName = r'CommentsPage';
|
||||
@override
|
||||
final String wireName = r'CommentsPage';
|
||||
|
||||
@override
|
||||
Iterable<Object?> serialize(Serializers serializers, CommentsPage object,
|
||||
{FullType specifiedType = FullType.unspecified}) {
|
||||
final result = <Object?>[];
|
||||
if (object.comments != null) {
|
||||
result
|
||||
..add(r'comments')
|
||||
..add(serializers.serialize(object.comments,
|
||||
specifiedType: const FullType(BuiltList, [FullType(Comment)])));
|
||||
}
|
||||
if (object.nextpage != null) {
|
||||
result
|
||||
..add(r'nextpage')
|
||||
..add(serializers.serialize(object.nextpage,
|
||||
specifiedType: const FullType.nullable(String)));
|
||||
}
|
||||
if (object.disabled != null) {
|
||||
result
|
||||
..add(r'disabled')
|
||||
..add(serializers.serialize(object.disabled,
|
||||
specifiedType: const FullType(bool)));
|
||||
}
|
||||
return result;
|
||||
Iterable<Object?> _serializeProperties(
|
||||
Serializers serializers,
|
||||
CommentsPage object, {
|
||||
FullType specifiedType = FullType.unspecified,
|
||||
}) sync* {
|
||||
if (object.comments != null) {
|
||||
yield r'comments';
|
||||
yield serializers.serialize(
|
||||
object.comments,
|
||||
specifiedType: const FullType(BuiltList, [FullType(Comment)]),
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
CommentsPage deserialize(Serializers serializers, Iterable<Object?> serialized,
|
||||
{FullType specifiedType = FullType.unspecified}) {
|
||||
final result = CommentsPageBuilder();
|
||||
|
||||
final iterator = serialized.iterator;
|
||||
while (iterator.moveNext()) {
|
||||
final key = iterator.current as String;
|
||||
iterator.moveNext();
|
||||
final Object? value = iterator.current;
|
||||
|
||||
switch (key) {
|
||||
case r'comments':
|
||||
final valueDes = serializers.deserialize(value,
|
||||
specifiedType: const FullType(BuiltList, [FullType(Comment)])) as BuiltList<Comment>;
|
||||
result.comments.replace(valueDes);
|
||||
break;
|
||||
case r'nextpage':
|
||||
final valueDes = serializers.deserialize(value,
|
||||
specifiedType: const FullType.nullable(String)) as String?;
|
||||
if (valueDes == null) continue;
|
||||
result.nextpage = valueDes;
|
||||
break;
|
||||
case r'disabled':
|
||||
final valueDes = serializers.deserialize(value,
|
||||
specifiedType: const FullType(bool)) as bool;
|
||||
result.disabled = valueDes;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return result.build();
|
||||
if (object.nextpage != null) {
|
||||
yield r'nextpage';
|
||||
yield serializers.serialize(
|
||||
object.nextpage,
|
||||
specifiedType: const FullType.nullable(String),
|
||||
);
|
||||
}
|
||||
if (object.disabled != null) {
|
||||
yield r'disabled';
|
||||
yield serializers.serialize(
|
||||
object.disabled,
|
||||
specifiedType: const FullType(bool),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
Object serialize(
|
||||
Serializers serializers,
|
||||
CommentsPage object, {
|
||||
FullType specifiedType = FullType.unspecified,
|
||||
}) {
|
||||
return _serializeProperties(serializers, object, specifiedType: specifiedType).toList();
|
||||
}
|
||||
|
||||
void _deserializeProperties(
|
||||
Serializers serializers,
|
||||
Object serialized, {
|
||||
FullType specifiedType = FullType.unspecified,
|
||||
required List<Object?> serializedList,
|
||||
required CommentsPageBuilder result,
|
||||
required List<Object?> unhandled,
|
||||
}) {
|
||||
for (var i = 0; i < serializedList.length; i += 2) {
|
||||
final key = serializedList[i] as String;
|
||||
final value = serializedList[i + 1];
|
||||
switch (key) {
|
||||
case r'comments':
|
||||
final valueDes = serializers.deserialize(
|
||||
value,
|
||||
specifiedType: const FullType(BuiltList, [FullType(Comment)]),
|
||||
) as BuiltList<Comment>;
|
||||
result.comments.replace(valueDes);
|
||||
break;
|
||||
case r'nextpage':
|
||||
final valueDes = serializers.deserialize(
|
||||
value,
|
||||
specifiedType: const FullType.nullable(String),
|
||||
) as String?;
|
||||
if (valueDes == null) continue;
|
||||
result.nextpage = valueDes;
|
||||
break;
|
||||
case r'disabled':
|
||||
final valueDes = serializers.deserialize(
|
||||
value,
|
||||
specifiedType: const FullType(bool),
|
||||
) as bool;
|
||||
result.disabled = valueDes;
|
||||
break;
|
||||
default:
|
||||
unhandled.add(key);
|
||||
unhandled.add(value);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
CommentsPage deserialize(
|
||||
Serializers serializers,
|
||||
Object serialized, {
|
||||
FullType specifiedType = FullType.unspecified,
|
||||
}) {
|
||||
final result = CommentsPageBuilder();
|
||||
final serializedList = (serialized as Iterable<Object?>).toList();
|
||||
final unhandled = <Object?>[];
|
||||
_deserializeProperties(
|
||||
serializers,
|
||||
serialized,
|
||||
specifiedType: specifiedType,
|
||||
serializedList: serializedList,
|
||||
unhandled: unhandled,
|
||||
result: result,
|
||||
);
|
||||
return result.build();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
// AUTO-GENERATED FILE, DO NOT MODIFY!
|
||||
//
|
||||
|
||||
// ignore_for_file: unused_element
|
||||
import 'package:built_value/built_value.dart';
|
||||
import 'package:built_value/serializer.dart';
|
||||
|
||||
|
@ -12,73 +13,112 @@ part 'exception_error.g.dart';
|
|||
/// Properties:
|
||||
/// * [error] - The stacktrace provided by the server.
|
||||
/// * [message] - The error message from the stacktrace.
|
||||
@BuiltValue()
|
||||
abstract class ExceptionError implements Built<ExceptionError, ExceptionErrorBuilder> {
|
||||
/// The stacktrace provided by the server.
|
||||
@BuiltValueField(wireName: r'error')
|
||||
String get error;
|
||||
/// The stacktrace provided by the server.
|
||||
@BuiltValueField(wireName: r'error')
|
||||
String get error;
|
||||
|
||||
/// The error message from the stacktrace.
|
||||
@BuiltValueField(wireName: r'message')
|
||||
String get message;
|
||||
/// The error message from the stacktrace.
|
||||
@BuiltValueField(wireName: r'message')
|
||||
String get message;
|
||||
|
||||
ExceptionError._();
|
||||
ExceptionError._();
|
||||
|
||||
@BuiltValueHook(initializeBuilder: true)
|
||||
static void _defaults(ExceptionErrorBuilder b) => b;
|
||||
factory ExceptionError([void updates(ExceptionErrorBuilder b)]) = _$ExceptionError;
|
||||
|
||||
factory ExceptionError([void updates(ExceptionErrorBuilder b)]) = _$ExceptionError;
|
||||
@BuiltValueHook(initializeBuilder: true)
|
||||
static void _defaults(ExceptionErrorBuilder b) => b;
|
||||
|
||||
@BuiltValueSerializer(custom: true)
|
||||
static Serializer<ExceptionError> get serializer => _$ExceptionErrorSerializer();
|
||||
@BuiltValueSerializer(custom: true)
|
||||
static Serializer<ExceptionError> get serializer => _$ExceptionErrorSerializer();
|
||||
}
|
||||
|
||||
class _$ExceptionErrorSerializer implements StructuredSerializer<ExceptionError> {
|
||||
@override
|
||||
final Iterable<Type> types = const [ExceptionError, _$ExceptionError];
|
||||
class _$ExceptionErrorSerializer implements PrimitiveSerializer<ExceptionError> {
|
||||
@override
|
||||
final Iterable<Type> types = const [ExceptionError, _$ExceptionError];
|
||||
|
||||
@override
|
||||
final String wireName = r'ExceptionError';
|
||||
@override
|
||||
final String wireName = r'ExceptionError';
|
||||
|
||||
@override
|
||||
Iterable<Object?> serialize(Serializers serializers, ExceptionError object,
|
||||
{FullType specifiedType = FullType.unspecified}) {
|
||||
final result = <Object?>[];
|
||||
result
|
||||
..add(r'error')
|
||||
..add(serializers.serialize(object.error,
|
||||
specifiedType: const FullType(String)));
|
||||
result
|
||||
..add(r'message')
|
||||
..add(serializers.serialize(object.message,
|
||||
specifiedType: const FullType(String)));
|
||||
return result;
|
||||
Iterable<Object?> _serializeProperties(
|
||||
Serializers serializers,
|
||||
ExceptionError object, {
|
||||
FullType specifiedType = FullType.unspecified,
|
||||
}) sync* {
|
||||
yield r'error';
|
||||
yield serializers.serialize(
|
||||
object.error,
|
||||
specifiedType: const FullType(String),
|
||||
);
|
||||
yield r'message';
|
||||
yield serializers.serialize(
|
||||
object.message,
|
||||
specifiedType: const FullType(String),
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
Object serialize(
|
||||
Serializers serializers,
|
||||
ExceptionError object, {
|
||||
FullType specifiedType = FullType.unspecified,
|
||||
}) {
|
||||
return _serializeProperties(serializers, object, specifiedType: specifiedType).toList();
|
||||
}
|
||||
|
||||
void _deserializeProperties(
|
||||
Serializers serializers,
|
||||
Object serialized, {
|
||||
FullType specifiedType = FullType.unspecified,
|
||||
required List<Object?> serializedList,
|
||||
required ExceptionErrorBuilder result,
|
||||
required List<Object?> unhandled,
|
||||
}) {
|
||||
for (var i = 0; i < serializedList.length; i += 2) {
|
||||
final key = serializedList[i] as String;
|
||||
final value = serializedList[i + 1];
|
||||
switch (key) {
|
||||
case r'error':
|
||||
final valueDes = serializers.deserialize(
|
||||
value,
|
||||
specifiedType: const FullType(String),
|
||||
) as String;
|
||||
result.error = valueDes;
|
||||
break;
|
||||
case r'message':
|
||||
final valueDes = serializers.deserialize(
|
||||
value,
|
||||
specifiedType: const FullType(String),
|
||||
) as String;
|
||||
result.message = valueDes;
|
||||
break;
|
||||
default:
|
||||
unhandled.add(key);
|
||||
unhandled.add(value);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
ExceptionError deserialize(Serializers serializers, Iterable<Object?> serialized,
|
||||
{FullType specifiedType = FullType.unspecified}) {
|
||||
final result = ExceptionErrorBuilder();
|
||||
|
||||
final iterator = serialized.iterator;
|
||||
while (iterator.moveNext()) {
|
||||
final key = iterator.current as String;
|
||||
iterator.moveNext();
|
||||
final Object? value = iterator.current;
|
||||
|
||||
switch (key) {
|
||||
case r'error':
|
||||
final valueDes = serializers.deserialize(value,
|
||||
specifiedType: const FullType(String)) as String;
|
||||
result.error = valueDes;
|
||||
break;
|
||||
case r'message':
|
||||
final valueDes = serializers.deserialize(value,
|
||||
specifiedType: const FullType(String)) as String;
|
||||
result.message = valueDes;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return result.build();
|
||||
}
|
||||
@override
|
||||
ExceptionError deserialize(
|
||||
Serializers serializers,
|
||||
Object serialized, {
|
||||
FullType specifiedType = FullType.unspecified,
|
||||
}) {
|
||||
final result = ExceptionErrorBuilder();
|
||||
final serializedList = (serialized as Iterable<Object?>).toList();
|
||||
final unhandled = <Object?>[];
|
||||
_deserializeProperties(
|
||||
serializers,
|
||||
serialized,
|
||||
specifiedType: specifiedType,
|
||||
serializedList: serializedList,
|
||||
unhandled: unhandled,
|
||||
result: result,
|
||||
);
|
||||
return result.build();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
// AUTO-GENERATED FILE, DO NOT MODIFY!
|
||||
//
|
||||
|
||||
// ignore_for_file: unused_element
|
||||
import 'package:built_value/built_value.dart';
|
||||
import 'package:built_value/serializer.dart';
|
||||
|
||||
|
@ -14,107 +15,152 @@ part 'playlist_item.g.dart';
|
|||
/// * [thumbnail] - The thumbnail of the playlist.
|
||||
/// * [url] - The relative URL of the playlist.
|
||||
/// * [videos] - The number of videos in the playlist.
|
||||
@BuiltValue()
|
||||
abstract class PlaylistItem implements Built<PlaylistItem, PlaylistItemBuilder> {
|
||||
/// The name of the playlist.
|
||||
@BuiltValueField(wireName: r'name')
|
||||
String? get name;
|
||||
/// The name of the playlist.
|
||||
@BuiltValueField(wireName: r'name')
|
||||
String? get name;
|
||||
|
||||
/// The thumbnail of the playlist.
|
||||
@BuiltValueField(wireName: r'thumbnail')
|
||||
String? get thumbnail;
|
||||
/// The thumbnail of the playlist.
|
||||
@BuiltValueField(wireName: r'thumbnail')
|
||||
String? get thumbnail;
|
||||
|
||||
/// The relative URL of the playlist.
|
||||
@BuiltValueField(wireName: r'url')
|
||||
String? get url;
|
||||
/// The relative URL of the playlist.
|
||||
@BuiltValueField(wireName: r'url')
|
||||
String? get url;
|
||||
|
||||
/// The number of videos in the playlist.
|
||||
@BuiltValueField(wireName: r'videos')
|
||||
int? get videos;
|
||||
/// The number of videos in the playlist.
|
||||
@BuiltValueField(wireName: r'videos')
|
||||
int? get videos;
|
||||
|
||||
PlaylistItem._();
|
||||
PlaylistItem._();
|
||||
|
||||
@BuiltValueHook(initializeBuilder: true)
|
||||
static void _defaults(PlaylistItemBuilder b) => b;
|
||||
factory PlaylistItem([void updates(PlaylistItemBuilder b)]) = _$PlaylistItem;
|
||||
|
||||
factory PlaylistItem([void updates(PlaylistItemBuilder b)]) = _$PlaylistItem;
|
||||
@BuiltValueHook(initializeBuilder: true)
|
||||
static void _defaults(PlaylistItemBuilder b) => b;
|
||||
|
||||
@BuiltValueSerializer(custom: true)
|
||||
static Serializer<PlaylistItem> get serializer => _$PlaylistItemSerializer();
|
||||
@BuiltValueSerializer(custom: true)
|
||||
static Serializer<PlaylistItem> get serializer => _$PlaylistItemSerializer();
|
||||
}
|
||||
|
||||
class _$PlaylistItemSerializer implements StructuredSerializer<PlaylistItem> {
|
||||
@override
|
||||
final Iterable<Type> types = const [PlaylistItem, _$PlaylistItem];
|
||||
class _$PlaylistItemSerializer implements PrimitiveSerializer<PlaylistItem> {
|
||||
@override
|
||||
final Iterable<Type> types = const [PlaylistItem, _$PlaylistItem];
|
||||
|
||||
@override
|
||||
final String wireName = r'PlaylistItem';
|
||||
@override
|
||||
final String wireName = r'PlaylistItem';
|
||||
|
||||
@override
|
||||
Iterable<Object?> serialize(Serializers serializers, PlaylistItem object,
|
||||
{FullType specifiedType = FullType.unspecified}) {
|
||||
final result = <Object?>[];
|
||||
if (object.name != null) {
|
||||
result
|
||||
..add(r'name')
|
||||
..add(serializers.serialize(object.name,
|
||||
specifiedType: const FullType(String)));
|
||||
}
|
||||
if (object.thumbnail != null) {
|
||||
result
|
||||
..add(r'thumbnail')
|
||||
..add(serializers.serialize(object.thumbnail,
|
||||
specifiedType: const FullType(String)));
|
||||
}
|
||||
if (object.url != null) {
|
||||
result
|
||||
..add(r'url')
|
||||
..add(serializers.serialize(object.url,
|
||||
specifiedType: const FullType(String)));
|
||||
}
|
||||
if (object.videos != null) {
|
||||
result
|
||||
..add(r'videos')
|
||||
..add(serializers.serialize(object.videos,
|
||||
specifiedType: const FullType(int)));
|
||||
}
|
||||
return result;
|
||||
Iterable<Object?> _serializeProperties(
|
||||
Serializers serializers,
|
||||
PlaylistItem object, {
|
||||
FullType specifiedType = FullType.unspecified,
|
||||
}) sync* {
|
||||
if (object.name != null) {
|
||||
yield r'name';
|
||||
yield serializers.serialize(
|
||||
object.name,
|
||||
specifiedType: const FullType(String),
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
PlaylistItem deserialize(Serializers serializers, Iterable<Object?> serialized,
|
||||
{FullType specifiedType = FullType.unspecified}) {
|
||||
final result = PlaylistItemBuilder();
|
||||
|
||||
final iterator = serialized.iterator;
|
||||
while (iterator.moveNext()) {
|
||||
final key = iterator.current as String;
|
||||
iterator.moveNext();
|
||||
final Object? value = iterator.current;
|
||||
|
||||
switch (key) {
|
||||
case r'name':
|
||||
final valueDes = serializers.deserialize(value,
|
||||
specifiedType: const FullType(String)) as String;
|
||||
result.name = valueDes;
|
||||
break;
|
||||
case r'thumbnail':
|
||||
final valueDes = serializers.deserialize(value,
|
||||
specifiedType: const FullType(String)) as String;
|
||||
result.thumbnail = valueDes;
|
||||
break;
|
||||
case r'url':
|
||||
final valueDes = serializers.deserialize(value,
|
||||
specifiedType: const FullType(String)) as String;
|
||||
result.url = valueDes;
|
||||
break;
|
||||
case r'videos':
|
||||
final valueDes = serializers.deserialize(value,
|
||||
specifiedType: const FullType(int)) as int;
|
||||
result.videos = valueDes;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return result.build();
|
||||
if (object.thumbnail != null) {
|
||||
yield r'thumbnail';
|
||||
yield serializers.serialize(
|
||||
object.thumbnail,
|
||||
specifiedType: const FullType(String),
|
||||
);
|
||||
}
|
||||
if (object.url != null) {
|
||||
yield r'url';
|
||||
yield serializers.serialize(
|
||||
object.url,
|
||||
specifiedType: const FullType(String),
|
||||
);
|
||||
}
|
||||
if (object.videos != null) {
|
||||
yield r'videos';
|
||||
yield serializers.serialize(
|
||||
object.videos,
|
||||
specifiedType: const FullType(int),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
Object serialize(
|
||||
Serializers serializers,
|
||||
PlaylistItem object, {
|
||||
FullType specifiedType = FullType.unspecified,
|
||||
}) {
|
||||
return _serializeProperties(serializers, object, specifiedType: specifiedType).toList();
|
||||
}
|
||||
|
||||
void _deserializeProperties(
|
||||
Serializers serializers,
|
||||
Object serialized, {
|
||||
FullType specifiedType = FullType.unspecified,
|
||||
required List<Object?> serializedList,
|
||||
required PlaylistItemBuilder result,
|
||||
required List<Object?> unhandled,
|
||||
}) {
|
||||
for (var i = 0; i < serializedList.length; i += 2) {
|
||||
final key = serializedList[i] as String;
|
||||
final value = serializedList[i + 1];
|
||||
switch (key) {
|
||||
case r'name':
|
||||
final valueDes = serializers.deserialize(
|
||||
value,
|
||||
specifiedType: const FullType(String),
|
||||
) as String;
|
||||
result.name = valueDes;
|
||||
break;
|
||||
case r'thumbnail':
|
||||
final valueDes = serializers.deserialize(
|
||||
value,
|
||||
specifiedType: const FullType(String),
|
||||
) as String;
|
||||
result.thumbnail = valueDes;
|
||||
break;
|
||||
case r'url':
|
||||
final valueDes = serializers.deserialize(
|
||||
value,
|
||||
specifiedType: const FullType(String),
|
||||
) as String;
|
||||
result.url = valueDes;
|
||||
break;
|
||||
case r'videos':
|
||||
final valueDes = serializers.deserialize(
|
||||
value,
|
||||
specifiedType: const FullType(int),
|
||||
) as int;
|
||||
result.videos = valueDes;
|
||||
break;
|
||||
default:
|
||||
unhandled.add(key);
|
||||
unhandled.add(value);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
PlaylistItem deserialize(
|
||||
Serializers serializers,
|
||||
Object serialized, {
|
||||
FullType specifiedType = FullType.unspecified,
|
||||
}) {
|
||||
final result = PlaylistItemBuilder();
|
||||
final serializedList = (serialized as Iterable<Object?>).toList();
|
||||
final unhandled = <Object?>[];
|
||||
_deserializeProperties(
|
||||
serializers,
|
||||
serialized,
|
||||
specifiedType: specifiedType,
|
||||
serializedList: serializedList,
|
||||
unhandled: unhandled,
|
||||
result: result,
|
||||
);
|
||||
return result.build();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
// AUTO-GENERATED FILE, DO NOT MODIFY!
|
||||
//
|
||||
|
||||
// ignore_for_file: unused_element
|
||||
import 'package:built_collection/built_collection.dart';
|
||||
import 'package:built_value/built_value.dart';
|
||||
import 'package:built_value/serializer.dart';
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
// AUTO-GENERATED FILE, DO NOT MODIFY!
|
||||
//
|
||||
|
||||
// ignore_for_file: unused_element
|
||||
import 'package:built_collection/built_collection.dart';
|
||||
import 'package:built_value/built_value.dart';
|
||||
import 'package:built_value/serializer.dart';
|
||||
|
|
|
@ -2,11 +2,13 @@
|
|||
// AUTO-GENERATED FILE, DO NOT MODIFY!
|
||||
//
|
||||
|
||||
// ignore_for_file: unused_element
|
||||
import 'package:piped_api/src/model/stream_item.dart';
|
||||
import 'package:piped_api/src/model/channel_item.dart';
|
||||
import 'package:piped_api/src/model/playlist_item.dart';
|
||||
import 'package:built_value/built_value.dart';
|
||||
import 'package:built_value/serializer.dart';
|
||||
import 'package:one_of/one_of.dart';
|
||||
|
||||
part 'search_item.g.dart';
|
||||
|
||||
|
@ -29,281 +31,58 @@ part 'search_item.g.dart';
|
|||
/// * [subscribers] - The number of subscribers the channel has.
|
||||
/// * [verified] - Whether the channel is verified.
|
||||
/// * [videos] - The number of videos in the playlist.
|
||||
@BuiltValue()
|
||||
abstract class SearchItem implements Built<SearchItem, SearchItemBuilder> {
|
||||
/// The duration of the video in seconds.
|
||||
@BuiltValueField(wireName: r'duration')
|
||||
int get duration;
|
||||
/// One Of [ChannelItem], [PlaylistItem], [StreamItem]
|
||||
OneOf get oneOf;
|
||||
|
||||
/// The thumbnail of the playlist.
|
||||
@BuiltValueField(wireName: r'thumbnail')
|
||||
String get thumbnail;
|
||||
SearchItem._();
|
||||
|
||||
/// The title of the video.
|
||||
@BuiltValueField(wireName: r'title')
|
||||
String get title;
|
||||
factory SearchItem([void updates(SearchItemBuilder b)]) = _$SearchItem;
|
||||
|
||||
/// The date in unix epoch the video was uploaded.
|
||||
@BuiltValueField(wireName: r'uploaded')
|
||||
int? get uploaded;
|
||||
@BuiltValueHook(initializeBuilder: true)
|
||||
static void _defaults(SearchItemBuilder b) => b;
|
||||
|
||||
/// The relative date the video was uploaded on.
|
||||
@BuiltValueField(wireName: r'uploadedDate')
|
||||
String? get uploadedDate;
|
||||
|
||||
/// The avatar of the channel of the video.
|
||||
@BuiltValueField(wireName: r'uploaderAvatar')
|
||||
String? get uploaderAvatar;
|
||||
|
||||
/// The name of the channel of the video.
|
||||
@BuiltValueField(wireName: r'uploaderName')
|
||||
String? get uploaderName;
|
||||
|
||||
/// The relative URL of the channel of the video.
|
||||
@BuiltValueField(wireName: r'uploaderUrl')
|
||||
String? get uploaderUrl;
|
||||
|
||||
/// Whether or not the channel has a verified badge.
|
||||
@BuiltValueField(wireName: r'uploaderVerified')
|
||||
bool? get uploaderVerified;
|
||||
|
||||
/// The relative URL of the playlist.
|
||||
@BuiltValueField(wireName: r'url')
|
||||
String get url;
|
||||
|
||||
/// The number of views the video has.
|
||||
@BuiltValueField(wireName: r'views')
|
||||
int? get views;
|
||||
|
||||
/// The description of the channel.
|
||||
@BuiltValueField(wireName: r'description')
|
||||
String? get description;
|
||||
|
||||
/// The name of the playlist.
|
||||
@BuiltValueField(wireName: r'name')
|
||||
String? get name;
|
||||
|
||||
/// The number of subscribers the channel has.
|
||||
@BuiltValueField(wireName: r'subscribers')
|
||||
int? get subscribers;
|
||||
|
||||
/// Whether the channel is verified.
|
||||
@BuiltValueField(wireName: r'verified')
|
||||
bool? get verified;
|
||||
|
||||
/// The number of videos in the playlist.
|
||||
@BuiltValueField(wireName: r'videos')
|
||||
int? get videos;
|
||||
|
||||
SearchItem._();
|
||||
|
||||
@BuiltValueHook(initializeBuilder: true)
|
||||
static void _defaults(SearchItemBuilder b) => b;
|
||||
|
||||
factory SearchItem([void updates(SearchItemBuilder b)]) = _$SearchItem;
|
||||
|
||||
@BuiltValueSerializer(custom: true)
|
||||
static Serializer<SearchItem> get serializer => _$SearchItemSerializer();
|
||||
@BuiltValueSerializer(custom: true)
|
||||
static Serializer<SearchItem> get serializer => _$SearchItemSerializer();
|
||||
}
|
||||
|
||||
class _$SearchItemSerializer implements StructuredSerializer<SearchItem> {
|
||||
@override
|
||||
final Iterable<Type> types = const [SearchItem, _$SearchItem];
|
||||
class _$SearchItemSerializer implements PrimitiveSerializer<SearchItem> {
|
||||
@override
|
||||
final Iterable<Type> types = const [SearchItem, _$SearchItem];
|
||||
|
||||
@override
|
||||
final String wireName = r'SearchItem';
|
||||
@override
|
||||
final String wireName = r'SearchItem';
|
||||
|
||||
@override
|
||||
Iterable<Object?> serialize(Serializers serializers, SearchItem object,
|
||||
{FullType specifiedType = FullType.unspecified}) {
|
||||
final result = <Object?>[];
|
||||
result
|
||||
..add(r'duration')
|
||||
..add(serializers.serialize(object.duration,
|
||||
specifiedType: const FullType(int)));
|
||||
result
|
||||
..add(r'thumbnail')
|
||||
..add(serializers.serialize(object.thumbnail,
|
||||
specifiedType: const FullType(String)));
|
||||
result
|
||||
..add(r'title')
|
||||
..add(serializers.serialize(object.title,
|
||||
specifiedType: const FullType(String)));
|
||||
if (object.uploaded != null) {
|
||||
result
|
||||
..add(r'uploaded')
|
||||
..add(serializers.serialize(object.uploaded,
|
||||
specifiedType: const FullType(int)));
|
||||
}
|
||||
if (object.uploadedDate != null) {
|
||||
result
|
||||
..add(r'uploadedDate')
|
||||
..add(serializers.serialize(object.uploadedDate,
|
||||
specifiedType: const FullType.nullable(String)));
|
||||
}
|
||||
if (object.uploaderAvatar != null) {
|
||||
result
|
||||
..add(r'uploaderAvatar')
|
||||
..add(serializers.serialize(object.uploaderAvatar,
|
||||
specifiedType: const FullType.nullable(String)));
|
||||
}
|
||||
if (object.uploaderName != null) {
|
||||
result
|
||||
..add(r'uploaderName')
|
||||
..add(serializers.serialize(object.uploaderName,
|
||||
specifiedType: const FullType(String)));
|
||||
}
|
||||
if (object.uploaderUrl != null) {
|
||||
result
|
||||
..add(r'uploaderUrl')
|
||||
..add(serializers.serialize(object.uploaderUrl,
|
||||
specifiedType: const FullType(String)));
|
||||
}
|
||||
if (object.uploaderVerified != null) {
|
||||
result
|
||||
..add(r'uploaderVerified')
|
||||
..add(serializers.serialize(object.uploaderVerified,
|
||||
specifiedType: const FullType(bool)));
|
||||
}
|
||||
result
|
||||
..add(r'url')
|
||||
..add(serializers.serialize(object.url,
|
||||
specifiedType: const FullType(String)));
|
||||
if (object.views != null) {
|
||||
result
|
||||
..add(r'views')
|
||||
..add(serializers.serialize(object.views,
|
||||
specifiedType: const FullType(int)));
|
||||
}
|
||||
if (object.description != null) {
|
||||
result
|
||||
..add(r'description')
|
||||
..add(serializers.serialize(object.description,
|
||||
specifiedType: const FullType(String)));
|
||||
}
|
||||
if (object.name != null) {
|
||||
result
|
||||
..add(r'name')
|
||||
..add(serializers.serialize(object.name,
|
||||
specifiedType: const FullType(String)));
|
||||
}
|
||||
if (object.subscribers != null) {
|
||||
result
|
||||
..add(r'subscribers')
|
||||
..add(serializers.serialize(object.subscribers,
|
||||
specifiedType: const FullType(int)));
|
||||
}
|
||||
if (object.verified != null) {
|
||||
result
|
||||
..add(r'verified')
|
||||
..add(serializers.serialize(object.verified,
|
||||
specifiedType: const FullType(bool)));
|
||||
}
|
||||
if (object.videos != null) {
|
||||
result
|
||||
..add(r'videos')
|
||||
..add(serializers.serialize(object.videos,
|
||||
specifiedType: const FullType(int)));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
Iterable<Object?> _serializeProperties(
|
||||
Serializers serializers,
|
||||
SearchItem object, {
|
||||
FullType specifiedType = FullType.unspecified,
|
||||
}) sync* {
|
||||
}
|
||||
|
||||
@override
|
||||
SearchItem deserialize(Serializers serializers, Iterable<Object?> serialized,
|
||||
{FullType specifiedType = FullType.unspecified}) {
|
||||
final result = SearchItemBuilder();
|
||||
@override
|
||||
Object serialize(
|
||||
Serializers serializers,
|
||||
SearchItem object, {
|
||||
FullType specifiedType = FullType.unspecified,
|
||||
}) {
|
||||
final oneOf = object.oneOf;
|
||||
return serializers.serialize(oneOf.value, specifiedType: FullType(oneOf.valueType))!;
|
||||
}
|
||||
|
||||
final iterator = serialized.iterator;
|
||||
while (iterator.moveNext()) {
|
||||
final key = iterator.current as String;
|
||||
iterator.moveNext();
|
||||
final Object? value = iterator.current;
|
||||
|
||||
switch (key) {
|
||||
case r'duration':
|
||||
final valueDes = serializers.deserialize(value,
|
||||
specifiedType: const FullType(int)) as int;
|
||||
result.duration = valueDes;
|
||||
break;
|
||||
case r'thumbnail':
|
||||
final valueDes = serializers.deserialize(value,
|
||||
specifiedType: const FullType(String)) as String;
|
||||
result.thumbnail = valueDes;
|
||||
break;
|
||||
case r'title':
|
||||
final valueDes = serializers.deserialize(value,
|
||||
specifiedType: const FullType(String)) as String;
|
||||
result.title = valueDes;
|
||||
break;
|
||||
case r'uploaded':
|
||||
final valueDes = serializers.deserialize(value,
|
||||
specifiedType: const FullType(int)) as int;
|
||||
result.uploaded = valueDes;
|
||||
break;
|
||||
case r'uploadedDate':
|
||||
final valueDes = serializers.deserialize(value,
|
||||
specifiedType: const FullType.nullable(String)) as String?;
|
||||
if (valueDes == null) continue;
|
||||
result.uploadedDate = valueDes;
|
||||
break;
|
||||
case r'uploaderAvatar':
|
||||
final valueDes = serializers.deserialize(value,
|
||||
specifiedType: const FullType.nullable(String)) as String?;
|
||||
if (valueDes == null) continue;
|
||||
result.uploaderAvatar = valueDes;
|
||||
break;
|
||||
case r'uploaderName':
|
||||
final valueDes = serializers.deserialize(value,
|
||||
specifiedType: const FullType(String)) as String;
|
||||
result.uploaderName = valueDes;
|
||||
break;
|
||||
case r'uploaderUrl':
|
||||
final valueDes = serializers.deserialize(value,
|
||||
specifiedType: const FullType(String)) as String;
|
||||
result.uploaderUrl = valueDes;
|
||||
break;
|
||||
case r'uploaderVerified':
|
||||
final valueDes = serializers.deserialize(value,
|
||||
specifiedType: const FullType(bool)) as bool;
|
||||
result.uploaderVerified = valueDes;
|
||||
break;
|
||||
case r'url':
|
||||
final valueDes = serializers.deserialize(value,
|
||||
specifiedType: const FullType(String)) as String;
|
||||
result.url = valueDes;
|
||||
break;
|
||||
case r'views':
|
||||
final valueDes = serializers.deserialize(value,
|
||||
specifiedType: const FullType(int)) as int;
|
||||
result.views = valueDes;
|
||||
break;
|
||||
case r'description':
|
||||
final valueDes = serializers.deserialize(value,
|
||||
specifiedType: const FullType(String)) as String;
|
||||
result.description = valueDes;
|
||||
break;
|
||||
case r'name':
|
||||
final valueDes = serializers.deserialize(value,
|
||||
specifiedType: const FullType(String)) as String;
|
||||
result.name = valueDes;
|
||||
break;
|
||||
case r'subscribers':
|
||||
final valueDes = serializers.deserialize(value,
|
||||
specifiedType: const FullType(int)) as int;
|
||||
result.subscribers = valueDes;
|
||||
break;
|
||||
case r'verified':
|
||||
final valueDes = serializers.deserialize(value,
|
||||
specifiedType: const FullType(bool)) as bool;
|
||||
result.verified = valueDes;
|
||||
break;
|
||||
case r'videos':
|
||||
final valueDes = serializers.deserialize(value,
|
||||
specifiedType: const FullType(int)) as int;
|
||||
result.videos = valueDes;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return result.build();
|
||||
}
|
||||
@override
|
||||
SearchItem deserialize(
|
||||
Serializers serializers,
|
||||
Object serialized, {
|
||||
FullType specifiedType = FullType.unspecified,
|
||||
}) {
|
||||
final result = SearchItemBuilder();
|
||||
Object? oneOfDataSrc;
|
||||
final targetType = const FullType(OneOf, [FullType(StreamItem), FullType(ChannelItem), FullType(PlaylistItem), ]);
|
||||
oneOfDataSrc = serialized;
|
||||
result.oneOf = serializers.deserialize(oneOfDataSrc, specifiedType: targetType) as OneOf;
|
||||
return result.build();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
// AUTO-GENERATED FILE, DO NOT MODIFY!
|
||||
//
|
||||
|
||||
// ignore_for_file: unused_element
|
||||
import 'package:built_collection/built_collection.dart';
|
||||
import 'package:piped_api/src/model/search_item.dart';
|
||||
import 'package:built_value/built_value.dart';
|
||||
|
@ -16,108 +17,153 @@ part 'search_page.g.dart';
|
|||
/// * [items]
|
||||
/// * [nextpage] - The parameter used to get the next page of this page.
|
||||
/// * [suggestion] - The suggested search query.
|
||||
@BuiltValue()
|
||||
abstract class SearchPage implements Built<SearchPage, SearchPageBuilder> {
|
||||
/// Whether the search query was corrected.
|
||||
@BuiltValueField(wireName: r'corrected')
|
||||
bool? get corrected;
|
||||
/// Whether the search query was corrected.
|
||||
@BuiltValueField(wireName: r'corrected')
|
||||
bool? get corrected;
|
||||
|
||||
@BuiltValueField(wireName: r'items')
|
||||
BuiltList<SearchItem>? get items;
|
||||
@BuiltValueField(wireName: r'items')
|
||||
BuiltList<SearchItem>? get items;
|
||||
|
||||
/// The parameter used to get the next page of this page.
|
||||
@BuiltValueField(wireName: r'nextpage')
|
||||
String? get nextpage;
|
||||
/// The parameter used to get the next page of this page.
|
||||
@BuiltValueField(wireName: r'nextpage')
|
||||
String? get nextpage;
|
||||
|
||||
/// The suggested search query.
|
||||
@BuiltValueField(wireName: r'suggestion')
|
||||
String? get suggestion;
|
||||
/// The suggested search query.
|
||||
@BuiltValueField(wireName: r'suggestion')
|
||||
String? get suggestion;
|
||||
|
||||
SearchPage._();
|
||||
SearchPage._();
|
||||
|
||||
@BuiltValueHook(initializeBuilder: true)
|
||||
static void _defaults(SearchPageBuilder b) => b;
|
||||
factory SearchPage([void updates(SearchPageBuilder b)]) = _$SearchPage;
|
||||
|
||||
factory SearchPage([void updates(SearchPageBuilder b)]) = _$SearchPage;
|
||||
@BuiltValueHook(initializeBuilder: true)
|
||||
static void _defaults(SearchPageBuilder b) => b;
|
||||
|
||||
@BuiltValueSerializer(custom: true)
|
||||
static Serializer<SearchPage> get serializer => _$SearchPageSerializer();
|
||||
@BuiltValueSerializer(custom: true)
|
||||
static Serializer<SearchPage> get serializer => _$SearchPageSerializer();
|
||||
}
|
||||
|
||||
class _$SearchPageSerializer implements StructuredSerializer<SearchPage> {
|
||||
@override
|
||||
final Iterable<Type> types = const [SearchPage, _$SearchPage];
|
||||
class _$SearchPageSerializer implements PrimitiveSerializer<SearchPage> {
|
||||
@override
|
||||
final Iterable<Type> types = const [SearchPage, _$SearchPage];
|
||||
|
||||
@override
|
||||
final String wireName = r'SearchPage';
|
||||
@override
|
||||
final String wireName = r'SearchPage';
|
||||
|
||||
@override
|
||||
Iterable<Object?> serialize(Serializers serializers, SearchPage object,
|
||||
{FullType specifiedType = FullType.unspecified}) {
|
||||
final result = <Object?>[];
|
||||
if (object.corrected != null) {
|
||||
result
|
||||
..add(r'corrected')
|
||||
..add(serializers.serialize(object.corrected,
|
||||
specifiedType: const FullType(bool)));
|
||||
}
|
||||
if (object.items != null) {
|
||||
result
|
||||
..add(r'items')
|
||||
..add(serializers.serialize(object.items,
|
||||
specifiedType: const FullType(BuiltList, [FullType(SearchItem)])));
|
||||
}
|
||||
if (object.nextpage != null) {
|
||||
result
|
||||
..add(r'nextpage')
|
||||
..add(serializers.serialize(object.nextpage,
|
||||
specifiedType: const FullType.nullable(String)));
|
||||
}
|
||||
if (object.suggestion != null) {
|
||||
result
|
||||
..add(r'suggestion')
|
||||
..add(serializers.serialize(object.suggestion,
|
||||
specifiedType: const FullType.nullable(String)));
|
||||
}
|
||||
return result;
|
||||
Iterable<Object?> _serializeProperties(
|
||||
Serializers serializers,
|
||||
SearchPage object, {
|
||||
FullType specifiedType = FullType.unspecified,
|
||||
}) sync* {
|
||||
if (object.corrected != null) {
|
||||
yield r'corrected';
|
||||
yield serializers.serialize(
|
||||
object.corrected,
|
||||
specifiedType: const FullType(bool),
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
SearchPage deserialize(Serializers serializers, Iterable<Object?> serialized,
|
||||
{FullType specifiedType = FullType.unspecified}) {
|
||||
final result = SearchPageBuilder();
|
||||
|
||||
final iterator = serialized.iterator;
|
||||
while (iterator.moveNext()) {
|
||||
final key = iterator.current as String;
|
||||
iterator.moveNext();
|
||||
final Object? value = iterator.current;
|
||||
|
||||
switch (key) {
|
||||
case r'corrected':
|
||||
final valueDes = serializers.deserialize(value,
|
||||
specifiedType: const FullType(bool)) as bool;
|
||||
result.corrected = valueDes;
|
||||
break;
|
||||
case r'items':
|
||||
final valueDes = serializers.deserialize(value,
|
||||
specifiedType: const FullType(BuiltList, [FullType(SearchItem)])) as BuiltList<SearchItem>;
|
||||
result.items.replace(valueDes);
|
||||
break;
|
||||
case r'nextpage':
|
||||
final valueDes = serializers.deserialize(value,
|
||||
specifiedType: const FullType.nullable(String)) as String?;
|
||||
if (valueDes == null) continue;
|
||||
result.nextpage = valueDes;
|
||||
break;
|
||||
case r'suggestion':
|
||||
final valueDes = serializers.deserialize(value,
|
||||
specifiedType: const FullType.nullable(String)) as String?;
|
||||
if (valueDes == null) continue;
|
||||
result.suggestion = valueDes;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return result.build();
|
||||
if (object.items != null) {
|
||||
yield r'items';
|
||||
yield serializers.serialize(
|
||||
object.items,
|
||||
specifiedType: const FullType(BuiltList, [FullType(SearchItem)]),
|
||||
);
|
||||
}
|
||||
if (object.nextpage != null) {
|
||||
yield r'nextpage';
|
||||
yield serializers.serialize(
|
||||
object.nextpage,
|
||||
specifiedType: const FullType.nullable(String),
|
||||
);
|
||||
}
|
||||
if (object.suggestion != null) {
|
||||
yield r'suggestion';
|
||||
yield serializers.serialize(
|
||||
object.suggestion,
|
||||
specifiedType: const FullType.nullable(String),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
Object serialize(
|
||||
Serializers serializers,
|
||||
SearchPage object, {
|
||||
FullType specifiedType = FullType.unspecified,
|
||||
}) {
|
||||
return _serializeProperties(serializers, object, specifiedType: specifiedType).toList();
|
||||
}
|
||||
|
||||
void _deserializeProperties(
|
||||
Serializers serializers,
|
||||
Object serialized, {
|
||||
FullType specifiedType = FullType.unspecified,
|
||||
required List<Object?> serializedList,
|
||||
required SearchPageBuilder result,
|
||||
required List<Object?> unhandled,
|
||||
}) {
|
||||
for (var i = 0; i < serializedList.length; i += 2) {
|
||||
final key = serializedList[i] as String;
|
||||
final value = serializedList[i + 1];
|
||||
switch (key) {
|
||||
case r'corrected':
|
||||
final valueDes = serializers.deserialize(
|
||||
value,
|
||||
specifiedType: const FullType(bool),
|
||||
) as bool;
|
||||
result.corrected = valueDes;
|
||||
break;
|
||||
case r'items':
|
||||
final valueDes = serializers.deserialize(
|
||||
value,
|
||||
specifiedType: const FullType(BuiltList, [FullType(SearchItem)]),
|
||||
) as BuiltList<SearchItem>;
|
||||
result.items.replace(valueDes);
|
||||
break;
|
||||
case r'nextpage':
|
||||
final valueDes = serializers.deserialize(
|
||||
value,
|
||||
specifiedType: const FullType.nullable(String),
|
||||
) as String?;
|
||||
if (valueDes == null) continue;
|
||||
result.nextpage = valueDes;
|
||||
break;
|
||||
case r'suggestion':
|
||||
final valueDes = serializers.deserialize(
|
||||
value,
|
||||
specifiedType: const FullType.nullable(String),
|
||||
) as String?;
|
||||
if (valueDes == null) continue;
|
||||
result.suggestion = valueDes;
|
||||
break;
|
||||
default:
|
||||
unhandled.add(key);
|
||||
unhandled.add(value);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
SearchPage deserialize(
|
||||
Serializers serializers,
|
||||
Object serialized, {
|
||||
FullType specifiedType = FullType.unspecified,
|
||||
}) {
|
||||
final result = SearchPageBuilder();
|
||||
final serializedList = (serialized as Iterable<Object?>).toList();
|
||||
final unhandled = <Object?>[];
|
||||
_deserializeProperties(
|
||||
serializers,
|
||||
serialized,
|
||||
specifiedType: specifiedType,
|
||||
serializedList: serializedList,
|
||||
unhandled: unhandled,
|
||||
result: result,
|
||||
);
|
||||
return result.build();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
// AUTO-GENERATED FILE, DO NOT MODIFY!
|
||||
//
|
||||
|
||||
// ignore_for_file: unused_element
|
||||
import 'package:built_collection/built_collection.dart';
|
||||
import 'package:built_value/built_value.dart';
|
||||
import 'package:built_value/serializer.dart';
|
||||
|
@ -25,250 +26,325 @@ part 'stream.g.dart';
|
|||
/// * [width]
|
||||
/// * [height]
|
||||
/// * [fps]
|
||||
@BuiltValue()
|
||||
abstract class Stream implements Built<Stream, StreamBuilder> {
|
||||
/// The URL of the stream.
|
||||
@BuiltValueField(wireName: r'url')
|
||||
String? get url;
|
||||
/// The URL of the stream.
|
||||
@BuiltValueField(wireName: r'url')
|
||||
String? get url;
|
||||
|
||||
/// The format of the stream.
|
||||
@BuiltValueField(wireName: r'format')
|
||||
StreamFormatEnum? get format;
|
||||
// enum formatEnum { MPEG_4, v3GPP, WEBM, M4A, WEBMA_OPUS, };
|
||||
/// The format of the stream.
|
||||
@BuiltValueField(wireName: r'format')
|
||||
StreamFormatEnum? get format;
|
||||
// enum formatEnum { MPEG_4, v3GPP, WEBM, M4A, WEBMA_OPUS, };
|
||||
|
||||
/// The quality of the stream.
|
||||
@BuiltValueField(wireName: r'quality')
|
||||
String? get quality;
|
||||
/// The quality of the stream.
|
||||
@BuiltValueField(wireName: r'quality')
|
||||
String? get quality;
|
||||
|
||||
/// The mime type of the stream.
|
||||
@BuiltValueField(wireName: r'mimeType')
|
||||
String? get mimeType;
|
||||
/// The mime type of the stream.
|
||||
@BuiltValueField(wireName: r'mimeType')
|
||||
String? get mimeType;
|
||||
|
||||
/// The codec of the stream.
|
||||
@BuiltValueField(wireName: r'codec')
|
||||
String? get codec;
|
||||
/// The codec of the stream.
|
||||
@BuiltValueField(wireName: r'codec')
|
||||
String? get codec;
|
||||
|
||||
@BuiltValueField(wireName: r'videoOnly')
|
||||
bool? get videoOnly;
|
||||
@BuiltValueField(wireName: r'videoOnly')
|
||||
bool? get videoOnly;
|
||||
|
||||
@BuiltValueField(wireName: r'bitrate')
|
||||
int? get bitrate;
|
||||
@BuiltValueField(wireName: r'bitrate')
|
||||
int? get bitrate;
|
||||
|
||||
@BuiltValueField(wireName: r'initStart')
|
||||
int? get initStart;
|
||||
@BuiltValueField(wireName: r'initStart')
|
||||
int? get initStart;
|
||||
|
||||
@BuiltValueField(wireName: r'initEnd')
|
||||
int? get initEnd;
|
||||
@BuiltValueField(wireName: r'initEnd')
|
||||
int? get initEnd;
|
||||
|
||||
@BuiltValueField(wireName: r'indexStart')
|
||||
int? get indexStart;
|
||||
@BuiltValueField(wireName: r'indexStart')
|
||||
int? get indexStart;
|
||||
|
||||
@BuiltValueField(wireName: r'indexEnd')
|
||||
int? get indexEnd;
|
||||
@BuiltValueField(wireName: r'indexEnd')
|
||||
int? get indexEnd;
|
||||
|
||||
@BuiltValueField(wireName: r'width')
|
||||
int? get width;
|
||||
@BuiltValueField(wireName: r'width')
|
||||
int? get width;
|
||||
|
||||
@BuiltValueField(wireName: r'height')
|
||||
int? get height;
|
||||
@BuiltValueField(wireName: r'height')
|
||||
int? get height;
|
||||
|
||||
@BuiltValueField(wireName: r'fps')
|
||||
int? get fps;
|
||||
@BuiltValueField(wireName: r'fps')
|
||||
int? get fps;
|
||||
|
||||
Stream._();
|
||||
Stream._();
|
||||
|
||||
@BuiltValueHook(initializeBuilder: true)
|
||||
static void _defaults(StreamBuilder b) => b;
|
||||
factory Stream([void updates(StreamBuilder b)]) = _$Stream;
|
||||
|
||||
factory Stream([void updates(StreamBuilder b)]) = _$Stream;
|
||||
@BuiltValueHook(initializeBuilder: true)
|
||||
static void _defaults(StreamBuilder b) => b;
|
||||
|
||||
@BuiltValueSerializer(custom: true)
|
||||
static Serializer<Stream> get serializer => _$StreamSerializer();
|
||||
@BuiltValueSerializer(custom: true)
|
||||
static Serializer<Stream> get serializer => _$StreamSerializer();
|
||||
}
|
||||
|
||||
class _$StreamSerializer implements StructuredSerializer<Stream> {
|
||||
@override
|
||||
final Iterable<Type> types = const [Stream, _$Stream];
|
||||
class _$StreamSerializer implements PrimitiveSerializer<Stream> {
|
||||
@override
|
||||
final Iterable<Type> types = const [Stream, _$Stream];
|
||||
|
||||
@override
|
||||
final String wireName = r'Stream';
|
||||
@override
|
||||
final String wireName = r'Stream';
|
||||
|
||||
@override
|
||||
Iterable<Object?> serialize(Serializers serializers, Stream object,
|
||||
{FullType specifiedType = FullType.unspecified}) {
|
||||
final result = <Object?>[];
|
||||
if (object.url != null) {
|
||||
result
|
||||
..add(r'url')
|
||||
..add(serializers.serialize(object.url,
|
||||
specifiedType: const FullType(String)));
|
||||
}
|
||||
if (object.format != null) {
|
||||
result
|
||||
..add(r'format')
|
||||
..add(serializers.serialize(object.format,
|
||||
specifiedType: const FullType(StreamFormatEnum)));
|
||||
}
|
||||
if (object.quality != null) {
|
||||
result
|
||||
..add(r'quality')
|
||||
..add(serializers.serialize(object.quality,
|
||||
specifiedType: const FullType(String)));
|
||||
}
|
||||
if (object.mimeType != null) {
|
||||
result
|
||||
..add(r'mimeType')
|
||||
..add(serializers.serialize(object.mimeType,
|
||||
specifiedType: const FullType(String)));
|
||||
}
|
||||
if (object.codec != null) {
|
||||
result
|
||||
..add(r'codec')
|
||||
..add(serializers.serialize(object.codec,
|
||||
specifiedType: const FullType(String)));
|
||||
}
|
||||
if (object.videoOnly != null) {
|
||||
result
|
||||
..add(r'videoOnly')
|
||||
..add(serializers.serialize(object.videoOnly,
|
||||
specifiedType: const FullType(bool)));
|
||||
}
|
||||
if (object.bitrate != null) {
|
||||
result
|
||||
..add(r'bitrate')
|
||||
..add(serializers.serialize(object.bitrate,
|
||||
specifiedType: const FullType(int)));
|
||||
}
|
||||
if (object.initStart != null) {
|
||||
result
|
||||
..add(r'initStart')
|
||||
..add(serializers.serialize(object.initStart,
|
||||
specifiedType: const FullType(int)));
|
||||
}
|
||||
if (object.initEnd != null) {
|
||||
result
|
||||
..add(r'initEnd')
|
||||
..add(serializers.serialize(object.initEnd,
|
||||
specifiedType: const FullType(int)));
|
||||
}
|
||||
if (object.indexStart != null) {
|
||||
result
|
||||
..add(r'indexStart')
|
||||
..add(serializers.serialize(object.indexStart,
|
||||
specifiedType: const FullType(int)));
|
||||
}
|
||||
if (object.indexEnd != null) {
|
||||
result
|
||||
..add(r'indexEnd')
|
||||
..add(serializers.serialize(object.indexEnd,
|
||||
specifiedType: const FullType(int)));
|
||||
}
|
||||
if (object.width != null) {
|
||||
result
|
||||
..add(r'width')
|
||||
..add(serializers.serialize(object.width,
|
||||
specifiedType: const FullType(int)));
|
||||
}
|
||||
if (object.height != null) {
|
||||
result
|
||||
..add(r'height')
|
||||
..add(serializers.serialize(object.height,
|
||||
specifiedType: const FullType(int)));
|
||||
}
|
||||
if (object.fps != null) {
|
||||
result
|
||||
..add(r'fps')
|
||||
..add(serializers.serialize(object.fps,
|
||||
specifiedType: const FullType(int)));
|
||||
}
|
||||
return result;
|
||||
Iterable<Object?> _serializeProperties(
|
||||
Serializers serializers,
|
||||
Stream object, {
|
||||
FullType specifiedType = FullType.unspecified,
|
||||
}) sync* {
|
||||
if (object.url != null) {
|
||||
yield r'url';
|
||||
yield serializers.serialize(
|
||||
object.url,
|
||||
specifiedType: const FullType(String),
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
Stream deserialize(Serializers serializers, Iterable<Object?> serialized,
|
||||
{FullType specifiedType = FullType.unspecified}) {
|
||||
final result = StreamBuilder();
|
||||
|
||||
final iterator = serialized.iterator;
|
||||
while (iterator.moveNext()) {
|
||||
final key = iterator.current as String;
|
||||
iterator.moveNext();
|
||||
final Object? value = iterator.current;
|
||||
|
||||
switch (key) {
|
||||
case r'url':
|
||||
final valueDes = serializers.deserialize(value,
|
||||
specifiedType: const FullType(String)) as String;
|
||||
result.url = valueDes;
|
||||
break;
|
||||
case r'format':
|
||||
final valueDes = serializers.deserialize(value,
|
||||
specifiedType: const FullType(StreamFormatEnum)) as StreamFormatEnum;
|
||||
result.format = valueDes;
|
||||
break;
|
||||
case r'quality':
|
||||
final valueDes = serializers.deserialize(value,
|
||||
specifiedType: const FullType(String)) as String;
|
||||
result.quality = valueDes;
|
||||
break;
|
||||
case r'mimeType':
|
||||
final valueDes = serializers.deserialize(value,
|
||||
specifiedType: const FullType(String)) as String;
|
||||
result.mimeType = valueDes;
|
||||
break;
|
||||
case r'codec':
|
||||
final valueDes = serializers.deserialize(value,
|
||||
specifiedType: const FullType(String)) as String;
|
||||
result.codec = valueDes;
|
||||
break;
|
||||
case r'videoOnly':
|
||||
final valueDes = serializers.deserialize(value,
|
||||
specifiedType: const FullType(bool)) as bool;
|
||||
result.videoOnly = valueDes;
|
||||
break;
|
||||
case r'bitrate':
|
||||
final valueDes = serializers.deserialize(value,
|
||||
specifiedType: const FullType(int)) as int;
|
||||
result.bitrate = valueDes;
|
||||
break;
|
||||
case r'initStart':
|
||||
final valueDes = serializers.deserialize(value,
|
||||
specifiedType: const FullType(int)) as int;
|
||||
result.initStart = valueDes;
|
||||
break;
|
||||
case r'initEnd':
|
||||
final valueDes = serializers.deserialize(value,
|
||||
specifiedType: const FullType(int)) as int;
|
||||
result.initEnd = valueDes;
|
||||
break;
|
||||
case r'indexStart':
|
||||
final valueDes = serializers.deserialize(value,
|
||||
specifiedType: const FullType(int)) as int;
|
||||
result.indexStart = valueDes;
|
||||
break;
|
||||
case r'indexEnd':
|
||||
final valueDes = serializers.deserialize(value,
|
||||
specifiedType: const FullType(int)) as int;
|
||||
result.indexEnd = valueDes;
|
||||
break;
|
||||
case r'width':
|
||||
final valueDes = serializers.deserialize(value,
|
||||
specifiedType: const FullType(int)) as int;
|
||||
result.width = valueDes;
|
||||
break;
|
||||
case r'height':
|
||||
final valueDes = serializers.deserialize(value,
|
||||
specifiedType: const FullType(int)) as int;
|
||||
result.height = valueDes;
|
||||
break;
|
||||
case r'fps':
|
||||
final valueDes = serializers.deserialize(value,
|
||||
specifiedType: const FullType(int)) as int;
|
||||
result.fps = valueDes;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return result.build();
|
||||
if (object.format != null) {
|
||||
yield r'format';
|
||||
yield serializers.serialize(
|
||||
object.format,
|
||||
specifiedType: const FullType(StreamFormatEnum),
|
||||
);
|
||||
}
|
||||
if (object.quality != null) {
|
||||
yield r'quality';
|
||||
yield serializers.serialize(
|
||||
object.quality,
|
||||
specifiedType: const FullType(String),
|
||||
);
|
||||
}
|
||||
if (object.mimeType != null) {
|
||||
yield r'mimeType';
|
||||
yield serializers.serialize(
|
||||
object.mimeType,
|
||||
specifiedType: const FullType(String),
|
||||
);
|
||||
}
|
||||
if (object.codec != null) {
|
||||
yield r'codec';
|
||||
yield serializers.serialize(
|
||||
object.codec,
|
||||
specifiedType: const FullType(String),
|
||||
);
|
||||
}
|
||||
if (object.videoOnly != null) {
|
||||
yield r'videoOnly';
|
||||
yield serializers.serialize(
|
||||
object.videoOnly,
|
||||
specifiedType: const FullType(bool),
|
||||
);
|
||||
}
|
||||
if (object.bitrate != null) {
|
||||
yield r'bitrate';
|
||||
yield serializers.serialize(
|
||||
object.bitrate,
|
||||
specifiedType: const FullType(int),
|
||||
);
|
||||
}
|
||||
if (object.initStart != null) {
|
||||
yield r'initStart';
|
||||
yield serializers.serialize(
|
||||
object.initStart,
|
||||
specifiedType: const FullType(int),
|
||||
);
|
||||
}
|
||||
if (object.initEnd != null) {
|
||||
yield r'initEnd';
|
||||
yield serializers.serialize(
|
||||
object.initEnd,
|
||||
specifiedType: const FullType(int),
|
||||
);
|
||||
}
|
||||
if (object.indexStart != null) {
|
||||
yield r'indexStart';
|
||||
yield serializers.serialize(
|
||||
object.indexStart,
|
||||
specifiedType: const FullType(int),
|
||||
);
|
||||
}
|
||||
if (object.indexEnd != null) {
|
||||
yield r'indexEnd';
|
||||
yield serializers.serialize(
|
||||
object.indexEnd,
|
||||
specifiedType: const FullType(int),
|
||||
);
|
||||
}
|
||||
if (object.width != null) {
|
||||
yield r'width';
|
||||
yield serializers.serialize(
|
||||
object.width,
|
||||
specifiedType: const FullType(int),
|
||||
);
|
||||
}
|
||||
if (object.height != null) {
|
||||
yield r'height';
|
||||
yield serializers.serialize(
|
||||
object.height,
|
||||
specifiedType: const FullType(int),
|
||||
);
|
||||
}
|
||||
if (object.fps != null) {
|
||||
yield r'fps';
|
||||
yield serializers.serialize(
|
||||
object.fps,
|
||||
specifiedType: const FullType(int),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
Object serialize(
|
||||
Serializers serializers,
|
||||
Stream object, {
|
||||
FullType specifiedType = FullType.unspecified,
|
||||
}) {
|
||||
return _serializeProperties(serializers, object, specifiedType: specifiedType).toList();
|
||||
}
|
||||
|
||||
void _deserializeProperties(
|
||||
Serializers serializers,
|
||||
Object serialized, {
|
||||
FullType specifiedType = FullType.unspecified,
|
||||
required List<Object?> serializedList,
|
||||
required StreamBuilder result,
|
||||
required List<Object?> unhandled,
|
||||
}) {
|
||||
for (var i = 0; i < serializedList.length; i += 2) {
|
||||
final key = serializedList[i] as String;
|
||||
final value = serializedList[i + 1];
|
||||
switch (key) {
|
||||
case r'url':
|
||||
final valueDes = serializers.deserialize(
|
||||
value,
|
||||
specifiedType: const FullType(String),
|
||||
) as String;
|
||||
result.url = valueDes;
|
||||
break;
|
||||
case r'format':
|
||||
final valueDes = serializers.deserialize(
|
||||
value,
|
||||
specifiedType: const FullType(StreamFormatEnum),
|
||||
) as StreamFormatEnum;
|
||||
result.format = valueDes;
|
||||
break;
|
||||
case r'quality':
|
||||
final valueDes = serializers.deserialize(
|
||||
value,
|
||||
specifiedType: const FullType(String),
|
||||
) as String;
|
||||
result.quality = valueDes;
|
||||
break;
|
||||
case r'mimeType':
|
||||
final valueDes = serializers.deserialize(
|
||||
value,
|
||||
specifiedType: const FullType(String),
|
||||
) as String;
|
||||
result.mimeType = valueDes;
|
||||
break;
|
||||
case r'codec':
|
||||
final valueDes = serializers.deserialize(
|
||||
value,
|
||||
specifiedType: const FullType(String),
|
||||
) as String;
|
||||
result.codec = valueDes;
|
||||
break;
|
||||
case r'videoOnly':
|
||||
final valueDes = serializers.deserialize(
|
||||
value,
|
||||
specifiedType: const FullType(bool),
|
||||
) as bool;
|
||||
result.videoOnly = valueDes;
|
||||
break;
|
||||
case r'bitrate':
|
||||
final valueDes = serializers.deserialize(
|
||||
value,
|
||||
specifiedType: const FullType(int),
|
||||
) as int;
|
||||
result.bitrate = valueDes;
|
||||
break;
|
||||
case r'initStart':
|
||||
final valueDes = serializers.deserialize(
|
||||
value,
|
||||
specifiedType: const FullType(int),
|
||||
) as int;
|
||||
result.initStart = valueDes;
|
||||
break;
|
||||
case r'initEnd':
|
||||
final valueDes = serializers.deserialize(
|
||||
value,
|
||||
specifiedType: const FullType(int),
|
||||
) as int;
|
||||
result.initEnd = valueDes;
|
||||
break;
|
||||
case r'indexStart':
|
||||
final valueDes = serializers.deserialize(
|
||||
value,
|
||||
specifiedType: const FullType(int),
|
||||
) as int;
|
||||
result.indexStart = valueDes;
|
||||
break;
|
||||
case r'indexEnd':
|
||||
final valueDes = serializers.deserialize(
|
||||
value,
|
||||
specifiedType: const FullType(int),
|
||||
) as int;
|
||||
result.indexEnd = valueDes;
|
||||
break;
|
||||
case r'width':
|
||||
final valueDes = serializers.deserialize(
|
||||
value,
|
||||
specifiedType: const FullType(int),
|
||||
) as int;
|
||||
result.width = valueDes;
|
||||
break;
|
||||
case r'height':
|
||||
final valueDes = serializers.deserialize(
|
||||
value,
|
||||
specifiedType: const FullType(int),
|
||||
) as int;
|
||||
result.height = valueDes;
|
||||
break;
|
||||
case r'fps':
|
||||
final valueDes = serializers.deserialize(
|
||||
value,
|
||||
specifiedType: const FullType(int),
|
||||
) as int;
|
||||
result.fps = valueDes;
|
||||
break;
|
||||
default:
|
||||
unhandled.add(key);
|
||||
unhandled.add(value);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
Stream deserialize(
|
||||
Serializers serializers,
|
||||
Object serialized, {
|
||||
FullType specifiedType = FullType.unspecified,
|
||||
}) {
|
||||
final result = StreamBuilder();
|
||||
final serializedList = (serialized as Iterable<Object?>).toList();
|
||||
final unhandled = <Object?>[];
|
||||
_deserializeProperties(
|
||||
serializers,
|
||||
serialized,
|
||||
specifiedType: specifiedType,
|
||||
serializedList: serializedList,
|
||||
unhandled: unhandled,
|
||||
result: result,
|
||||
);
|
||||
return result.build();
|
||||
}
|
||||
}
|
||||
|
||||
class StreamFormatEnum extends EnumClass {
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
// AUTO-GENERATED FILE, DO NOT MODIFY!
|
||||
//
|
||||
|
||||
// ignore_for_file: unused_element
|
||||
import 'package:built_value/built_value.dart';
|
||||
import 'package:built_value/serializer.dart';
|
||||
|
||||
|
@ -21,206 +22,272 @@ part 'stream_item.g.dart';
|
|||
/// * [uploaderVerified] - Whether or not the channel has a verified badge.
|
||||
/// * [url] - The relative URL to the video.
|
||||
/// * [views] - The number of views the video has.
|
||||
@BuiltValue()
|
||||
abstract class StreamItem implements Built<StreamItem, StreamItemBuilder> {
|
||||
/// The duration of the video in seconds.
|
||||
@BuiltValueField(wireName: r'duration')
|
||||
int get duration;
|
||||
/// The duration of the video in seconds.
|
||||
@BuiltValueField(wireName: r'duration')
|
||||
int get duration;
|
||||
|
||||
/// The thumbnail of the video.
|
||||
@BuiltValueField(wireName: r'thumbnail')
|
||||
String get thumbnail;
|
||||
/// The thumbnail of the video.
|
||||
@BuiltValueField(wireName: r'thumbnail')
|
||||
String get thumbnail;
|
||||
|
||||
/// The title of the video.
|
||||
@BuiltValueField(wireName: r'title')
|
||||
String get title;
|
||||
/// The title of the video.
|
||||
@BuiltValueField(wireName: r'title')
|
||||
String get title;
|
||||
|
||||
/// The date in unix epoch the video was uploaded.
|
||||
@BuiltValueField(wireName: r'uploaded')
|
||||
int? get uploaded;
|
||||
/// The date in unix epoch the video was uploaded.
|
||||
@BuiltValueField(wireName: r'uploaded')
|
||||
int? get uploaded;
|
||||
|
||||
/// The relative date the video was uploaded on.
|
||||
@BuiltValueField(wireName: r'uploadedDate')
|
||||
String? get uploadedDate;
|
||||
/// The relative date the video was uploaded on.
|
||||
@BuiltValueField(wireName: r'uploadedDate')
|
||||
String? get uploadedDate;
|
||||
|
||||
/// The avatar of the channel of the video.
|
||||
@BuiltValueField(wireName: r'uploaderAvatar')
|
||||
String? get uploaderAvatar;
|
||||
/// The avatar of the channel of the video.
|
||||
@BuiltValueField(wireName: r'uploaderAvatar')
|
||||
String? get uploaderAvatar;
|
||||
|
||||
/// The name of the channel of the video.
|
||||
@BuiltValueField(wireName: r'uploaderName')
|
||||
String? get uploaderName;
|
||||
/// The name of the channel of the video.
|
||||
@BuiltValueField(wireName: r'uploaderName')
|
||||
String? get uploaderName;
|
||||
|
||||
/// The relative URL of the channel of the video.
|
||||
@BuiltValueField(wireName: r'uploaderUrl')
|
||||
String? get uploaderUrl;
|
||||
/// The relative URL of the channel of the video.
|
||||
@BuiltValueField(wireName: r'uploaderUrl')
|
||||
String? get uploaderUrl;
|
||||
|
||||
/// Whether or not the channel has a verified badge.
|
||||
@BuiltValueField(wireName: r'uploaderVerified')
|
||||
bool? get uploaderVerified;
|
||||
/// Whether or not the channel has a verified badge.
|
||||
@BuiltValueField(wireName: r'uploaderVerified')
|
||||
bool? get uploaderVerified;
|
||||
|
||||
/// The relative URL to the video.
|
||||
@BuiltValueField(wireName: r'url')
|
||||
String get url;
|
||||
/// The relative URL to the video.
|
||||
@BuiltValueField(wireName: r'url')
|
||||
String get url;
|
||||
|
||||
/// The number of views the video has.
|
||||
@BuiltValueField(wireName: r'views')
|
||||
int? get views;
|
||||
/// The number of views the video has.
|
||||
@BuiltValueField(wireName: r'views')
|
||||
int? get views;
|
||||
|
||||
StreamItem._();
|
||||
StreamItem._();
|
||||
|
||||
@BuiltValueHook(initializeBuilder: true)
|
||||
static void _defaults(StreamItemBuilder b) => b;
|
||||
factory StreamItem([void updates(StreamItemBuilder b)]) = _$StreamItem;
|
||||
|
||||
factory StreamItem([void updates(StreamItemBuilder b)]) = _$StreamItem;
|
||||
@BuiltValueHook(initializeBuilder: true)
|
||||
static void _defaults(StreamItemBuilder b) => b;
|
||||
|
||||
@BuiltValueSerializer(custom: true)
|
||||
static Serializer<StreamItem> get serializer => _$StreamItemSerializer();
|
||||
@BuiltValueSerializer(custom: true)
|
||||
static Serializer<StreamItem> get serializer => _$StreamItemSerializer();
|
||||
}
|
||||
|
||||
class _$StreamItemSerializer implements StructuredSerializer<StreamItem> {
|
||||
@override
|
||||
final Iterable<Type> types = const [StreamItem, _$StreamItem];
|
||||
class _$StreamItemSerializer implements PrimitiveSerializer<StreamItem> {
|
||||
@override
|
||||
final Iterable<Type> types = const [StreamItem, _$StreamItem];
|
||||
|
||||
@override
|
||||
final String wireName = r'StreamItem';
|
||||
@override
|
||||
final String wireName = r'StreamItem';
|
||||
|
||||
@override
|
||||
Iterable<Object?> serialize(Serializers serializers, StreamItem object,
|
||||
{FullType specifiedType = FullType.unspecified}) {
|
||||
final result = <Object?>[];
|
||||
result
|
||||
..add(r'duration')
|
||||
..add(serializers.serialize(object.duration,
|
||||
specifiedType: const FullType(int)));
|
||||
result
|
||||
..add(r'thumbnail')
|
||||
..add(serializers.serialize(object.thumbnail,
|
||||
specifiedType: const FullType(String)));
|
||||
result
|
||||
..add(r'title')
|
||||
..add(serializers.serialize(object.title,
|
||||
specifiedType: const FullType(String)));
|
||||
if (object.uploaded != null) {
|
||||
result
|
||||
..add(r'uploaded')
|
||||
..add(serializers.serialize(object.uploaded,
|
||||
specifiedType: const FullType(int)));
|
||||
}
|
||||
if (object.uploadedDate != null) {
|
||||
result
|
||||
..add(r'uploadedDate')
|
||||
..add(serializers.serialize(object.uploadedDate,
|
||||
specifiedType: const FullType.nullable(String)));
|
||||
}
|
||||
if (object.uploaderAvatar != null) {
|
||||
result
|
||||
..add(r'uploaderAvatar')
|
||||
..add(serializers.serialize(object.uploaderAvatar,
|
||||
specifiedType: const FullType.nullable(String)));
|
||||
}
|
||||
if (object.uploaderName != null) {
|
||||
result
|
||||
..add(r'uploaderName')
|
||||
..add(serializers.serialize(object.uploaderName,
|
||||
specifiedType: const FullType(String)));
|
||||
}
|
||||
if (object.uploaderUrl != null) {
|
||||
result
|
||||
..add(r'uploaderUrl')
|
||||
..add(serializers.serialize(object.uploaderUrl,
|
||||
specifiedType: const FullType(String)));
|
||||
}
|
||||
if (object.uploaderVerified != null) {
|
||||
result
|
||||
..add(r'uploaderVerified')
|
||||
..add(serializers.serialize(object.uploaderVerified,
|
||||
specifiedType: const FullType(bool)));
|
||||
}
|
||||
result
|
||||
..add(r'url')
|
||||
..add(serializers.serialize(object.url,
|
||||
specifiedType: const FullType(String)));
|
||||
if (object.views != null) {
|
||||
result
|
||||
..add(r'views')
|
||||
..add(serializers.serialize(object.views,
|
||||
specifiedType: const FullType(int)));
|
||||
}
|
||||
return result;
|
||||
Iterable<Object?> _serializeProperties(
|
||||
Serializers serializers,
|
||||
StreamItem object, {
|
||||
FullType specifiedType = FullType.unspecified,
|
||||
}) sync* {
|
||||
yield r'duration';
|
||||
yield serializers.serialize(
|
||||
object.duration,
|
||||
specifiedType: const FullType(int),
|
||||
);
|
||||
yield r'thumbnail';
|
||||
yield serializers.serialize(
|
||||
object.thumbnail,
|
||||
specifiedType: const FullType(String),
|
||||
);
|
||||
yield r'title';
|
||||
yield serializers.serialize(
|
||||
object.title,
|
||||
specifiedType: const FullType(String),
|
||||
);
|
||||
if (object.uploaded != null) {
|
||||
yield r'uploaded';
|
||||
yield serializers.serialize(
|
||||
object.uploaded,
|
||||
specifiedType: const FullType(int),
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
StreamItem deserialize(Serializers serializers, Iterable<Object?> serialized,
|
||||
{FullType specifiedType = FullType.unspecified}) {
|
||||
final result = StreamItemBuilder();
|
||||
|
||||
final iterator = serialized.iterator;
|
||||
while (iterator.moveNext()) {
|
||||
final key = iterator.current as String;
|
||||
iterator.moveNext();
|
||||
final Object? value = iterator.current;
|
||||
|
||||
switch (key) {
|
||||
case r'duration':
|
||||
final valueDes = serializers.deserialize(value,
|
||||
specifiedType: const FullType(int)) as int;
|
||||
result.duration = valueDes;
|
||||
break;
|
||||
case r'thumbnail':
|
||||
final valueDes = serializers.deserialize(value,
|
||||
specifiedType: const FullType(String)) as String;
|
||||
result.thumbnail = valueDes;
|
||||
break;
|
||||
case r'title':
|
||||
final valueDes = serializers.deserialize(value,
|
||||
specifiedType: const FullType(String)) as String;
|
||||
result.title = valueDes;
|
||||
break;
|
||||
case r'uploaded':
|
||||
final valueDes = serializers.deserialize(value,
|
||||
specifiedType: const FullType(int)) as int;
|
||||
result.uploaded = valueDes;
|
||||
break;
|
||||
case r'uploadedDate':
|
||||
final valueDes = serializers.deserialize(value,
|
||||
specifiedType: const FullType.nullable(String)) as String?;
|
||||
if (valueDes == null) continue;
|
||||
result.uploadedDate = valueDes;
|
||||
break;
|
||||
case r'uploaderAvatar':
|
||||
final valueDes = serializers.deserialize(value,
|
||||
specifiedType: const FullType.nullable(String)) as String?;
|
||||
if (valueDes == null) continue;
|
||||
result.uploaderAvatar = valueDes;
|
||||
break;
|
||||
case r'uploaderName':
|
||||
final valueDes = serializers.deserialize(value,
|
||||
specifiedType: const FullType(String)) as String;
|
||||
result.uploaderName = valueDes;
|
||||
break;
|
||||
case r'uploaderUrl':
|
||||
final valueDes = serializers.deserialize(value,
|
||||
specifiedType: const FullType(String)) as String;
|
||||
result.uploaderUrl = valueDes;
|
||||
break;
|
||||
case r'uploaderVerified':
|
||||
final valueDes = serializers.deserialize(value,
|
||||
specifiedType: const FullType(bool)) as bool;
|
||||
result.uploaderVerified = valueDes;
|
||||
break;
|
||||
case r'url':
|
||||
final valueDes = serializers.deserialize(value,
|
||||
specifiedType: const FullType(String)) as String;
|
||||
result.url = valueDes;
|
||||
break;
|
||||
case r'views':
|
||||
final valueDes = serializers.deserialize(value,
|
||||
specifiedType: const FullType(int)) as int;
|
||||
result.views = valueDes;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return result.build();
|
||||
if (object.uploadedDate != null) {
|
||||
yield r'uploadedDate';
|
||||
yield serializers.serialize(
|
||||
object.uploadedDate,
|
||||
specifiedType: const FullType.nullable(String),
|
||||
);
|
||||
}
|
||||
if (object.uploaderAvatar != null) {
|
||||
yield r'uploaderAvatar';
|
||||
yield serializers.serialize(
|
||||
object.uploaderAvatar,
|
||||
specifiedType: const FullType.nullable(String),
|
||||
);
|
||||
}
|
||||
if (object.uploaderName != null) {
|
||||
yield r'uploaderName';
|
||||
yield serializers.serialize(
|
||||
object.uploaderName,
|
||||
specifiedType: const FullType(String),
|
||||
);
|
||||
}
|
||||
if (object.uploaderUrl != null) {
|
||||
yield r'uploaderUrl';
|
||||
yield serializers.serialize(
|
||||
object.uploaderUrl,
|
||||
specifiedType: const FullType(String),
|
||||
);
|
||||
}
|
||||
if (object.uploaderVerified != null) {
|
||||
yield r'uploaderVerified';
|
||||
yield serializers.serialize(
|
||||
object.uploaderVerified,
|
||||
specifiedType: const FullType(bool),
|
||||
);
|
||||
}
|
||||
yield r'url';
|
||||
yield serializers.serialize(
|
||||
object.url,
|
||||
specifiedType: const FullType(String),
|
||||
);
|
||||
if (object.views != null) {
|
||||
yield r'views';
|
||||
yield serializers.serialize(
|
||||
object.views,
|
||||
specifiedType: const FullType(int),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
Object serialize(
|
||||
Serializers serializers,
|
||||
StreamItem object, {
|
||||
FullType specifiedType = FullType.unspecified,
|
||||
}) {
|
||||
return _serializeProperties(serializers, object, specifiedType: specifiedType).toList();
|
||||
}
|
||||
|
||||
void _deserializeProperties(
|
||||
Serializers serializers,
|
||||
Object serialized, {
|
||||
FullType specifiedType = FullType.unspecified,
|
||||
required List<Object?> serializedList,
|
||||
required StreamItemBuilder result,
|
||||
required List<Object?> unhandled,
|
||||
}) {
|
||||
for (var i = 0; i < serializedList.length; i += 2) {
|
||||
final key = serializedList[i] as String;
|
||||
final value = serializedList[i + 1];
|
||||
switch (key) {
|
||||
case r'duration':
|
||||
final valueDes = serializers.deserialize(
|
||||
value,
|
||||
specifiedType: const FullType(int),
|
||||
) as int;
|
||||
result.duration = valueDes;
|
||||
break;
|
||||
case r'thumbnail':
|
||||
final valueDes = serializers.deserialize(
|
||||
value,
|
||||
specifiedType: const FullType(String),
|
||||
) as String;
|
||||
result.thumbnail = valueDes;
|
||||
break;
|
||||
case r'title':
|
||||
final valueDes = serializers.deserialize(
|
||||
value,
|
||||
specifiedType: const FullType(String),
|
||||
) as String;
|
||||
result.title = valueDes;
|
||||
break;
|
||||
case r'uploaded':
|
||||
final valueDes = serializers.deserialize(
|
||||
value,
|
||||
specifiedType: const FullType(int),
|
||||
) as int;
|
||||
result.uploaded = valueDes;
|
||||
break;
|
||||
case r'uploadedDate':
|
||||
final valueDes = serializers.deserialize(
|
||||
value,
|
||||
specifiedType: const FullType.nullable(String),
|
||||
) as String?;
|
||||
if (valueDes == null) continue;
|
||||
result.uploadedDate = valueDes;
|
||||
break;
|
||||
case r'uploaderAvatar':
|
||||
final valueDes = serializers.deserialize(
|
||||
value,
|
||||
specifiedType: const FullType.nullable(String),
|
||||
) as String?;
|
||||
if (valueDes == null) continue;
|
||||
result.uploaderAvatar = valueDes;
|
||||
break;
|
||||
case r'uploaderName':
|
||||
final valueDes = serializers.deserialize(
|
||||
value,
|
||||
specifiedType: const FullType(String),
|
||||
) as String;
|
||||
result.uploaderName = valueDes;
|
||||
break;
|
||||
case r'uploaderUrl':
|
||||
final valueDes = serializers.deserialize(
|
||||
value,
|
||||
specifiedType: const FullType(String),
|
||||
) as String;
|
||||
result.uploaderUrl = valueDes;
|
||||
break;
|
||||
case r'uploaderVerified':
|
||||
final valueDes = serializers.deserialize(
|
||||
value,
|
||||
specifiedType: const FullType(bool),
|
||||
) as bool;
|
||||
result.uploaderVerified = valueDes;
|
||||
break;
|
||||
case r'url':
|
||||
final valueDes = serializers.deserialize(
|
||||
value,
|
||||
specifiedType: const FullType(String),
|
||||
) as String;
|
||||
result.url = valueDes;
|
||||
break;
|
||||
case r'views':
|
||||
final valueDes = serializers.deserialize(
|
||||
value,
|
||||
specifiedType: const FullType(int),
|
||||
) as int;
|
||||
result.views = valueDes;
|
||||
break;
|
||||
default:
|
||||
unhandled.add(key);
|
||||
unhandled.add(value);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
StreamItem deserialize(
|
||||
Serializers serializers,
|
||||
Object serialized, {
|
||||
FullType specifiedType = FullType.unspecified,
|
||||
}) {
|
||||
final result = StreamItemBuilder();
|
||||
final serializedList = (serialized as Iterable<Object?>).toList();
|
||||
final unhandled = <Object?>[];
|
||||
_deserializeProperties(
|
||||
serializers,
|
||||
serialized,
|
||||
specifiedType: specifiedType,
|
||||
serializedList: serializedList,
|
||||
unhandled: unhandled,
|
||||
result: result,
|
||||
);
|
||||
return result.build();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
// AUTO-GENERATED FILE, DO NOT MODIFY!
|
||||
//
|
||||
|
||||
// ignore_for_file: unused_element
|
||||
import 'package:piped_api/src/model/stream_item.dart';
|
||||
import 'package:built_collection/built_collection.dart';
|
||||
import 'package:built_value/built_value.dart';
|
||||
|
@ -14,77 +15,116 @@ part 'streams_page.g.dart';
|
|||
/// Properties:
|
||||
/// * [relatedStreams]
|
||||
/// * [nextpage] - The parameter used to get the next page of this page.
|
||||
@BuiltValue()
|
||||
abstract class StreamsPage implements Built<StreamsPage, StreamsPageBuilder> {
|
||||
@BuiltValueField(wireName: r'relatedStreams')
|
||||
BuiltList<StreamItem>? get relatedStreams;
|
||||
@BuiltValueField(wireName: r'relatedStreams')
|
||||
BuiltList<StreamItem>? get relatedStreams;
|
||||
|
||||
/// The parameter used to get the next page of this page.
|
||||
@BuiltValueField(wireName: r'nextpage')
|
||||
String? get nextpage;
|
||||
/// The parameter used to get the next page of this page.
|
||||
@BuiltValueField(wireName: r'nextpage')
|
||||
String? get nextpage;
|
||||
|
||||
StreamsPage._();
|
||||
StreamsPage._();
|
||||
|
||||
@BuiltValueHook(initializeBuilder: true)
|
||||
static void _defaults(StreamsPageBuilder b) => b;
|
||||
factory StreamsPage([void updates(StreamsPageBuilder b)]) = _$StreamsPage;
|
||||
|
||||
factory StreamsPage([void updates(StreamsPageBuilder b)]) = _$StreamsPage;
|
||||
@BuiltValueHook(initializeBuilder: true)
|
||||
static void _defaults(StreamsPageBuilder b) => b;
|
||||
|
||||
@BuiltValueSerializer(custom: true)
|
||||
static Serializer<StreamsPage> get serializer => _$StreamsPageSerializer();
|
||||
@BuiltValueSerializer(custom: true)
|
||||
static Serializer<StreamsPage> get serializer => _$StreamsPageSerializer();
|
||||
}
|
||||
|
||||
class _$StreamsPageSerializer implements StructuredSerializer<StreamsPage> {
|
||||
@override
|
||||
final Iterable<Type> types = const [StreamsPage, _$StreamsPage];
|
||||
class _$StreamsPageSerializer implements PrimitiveSerializer<StreamsPage> {
|
||||
@override
|
||||
final Iterable<Type> types = const [StreamsPage, _$StreamsPage];
|
||||
|
||||
@override
|
||||
final String wireName = r'StreamsPage';
|
||||
@override
|
||||
final String wireName = r'StreamsPage';
|
||||
|
||||
@override
|
||||
Iterable<Object?> serialize(Serializers serializers, StreamsPage object,
|
||||
{FullType specifiedType = FullType.unspecified}) {
|
||||
final result = <Object?>[];
|
||||
if (object.relatedStreams != null) {
|
||||
result
|
||||
..add(r'relatedStreams')
|
||||
..add(serializers.serialize(object.relatedStreams,
|
||||
specifiedType: const FullType(BuiltList, [FullType(StreamItem)])));
|
||||
}
|
||||
if (object.nextpage != null) {
|
||||
result
|
||||
..add(r'nextpage')
|
||||
..add(serializers.serialize(object.nextpage,
|
||||
specifiedType: const FullType.nullable(String)));
|
||||
}
|
||||
return result;
|
||||
Iterable<Object?> _serializeProperties(
|
||||
Serializers serializers,
|
||||
StreamsPage object, {
|
||||
FullType specifiedType = FullType.unspecified,
|
||||
}) sync* {
|
||||
if (object.relatedStreams != null) {
|
||||
yield r'relatedStreams';
|
||||
yield serializers.serialize(
|
||||
object.relatedStreams,
|
||||
specifiedType: const FullType(BuiltList, [FullType(StreamItem)]),
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
StreamsPage deserialize(Serializers serializers, Iterable<Object?> serialized,
|
||||
{FullType specifiedType = FullType.unspecified}) {
|
||||
final result = StreamsPageBuilder();
|
||||
|
||||
final iterator = serialized.iterator;
|
||||
while (iterator.moveNext()) {
|
||||
final key = iterator.current as String;
|
||||
iterator.moveNext();
|
||||
final Object? value = iterator.current;
|
||||
|
||||
switch (key) {
|
||||
case r'relatedStreams':
|
||||
final valueDes = serializers.deserialize(value,
|
||||
specifiedType: const FullType(BuiltList, [FullType(StreamItem)])) as BuiltList<StreamItem>;
|
||||
result.relatedStreams.replace(valueDes);
|
||||
break;
|
||||
case r'nextpage':
|
||||
final valueDes = serializers.deserialize(value,
|
||||
specifiedType: const FullType.nullable(String)) as String?;
|
||||
if (valueDes == null) continue;
|
||||
result.nextpage = valueDes;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return result.build();
|
||||
if (object.nextpage != null) {
|
||||
yield r'nextpage';
|
||||
yield serializers.serialize(
|
||||
object.nextpage,
|
||||
specifiedType: const FullType.nullable(String),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
Object serialize(
|
||||
Serializers serializers,
|
||||
StreamsPage object, {
|
||||
FullType specifiedType = FullType.unspecified,
|
||||
}) {
|
||||
return _serializeProperties(serializers, object, specifiedType: specifiedType).toList();
|
||||
}
|
||||
|
||||
void _deserializeProperties(
|
||||
Serializers serializers,
|
||||
Object serialized, {
|
||||
FullType specifiedType = FullType.unspecified,
|
||||
required List<Object?> serializedList,
|
||||
required StreamsPageBuilder result,
|
||||
required List<Object?> unhandled,
|
||||
}) {
|
||||
for (var i = 0; i < serializedList.length; i += 2) {
|
||||
final key = serializedList[i] as String;
|
||||
final value = serializedList[i + 1];
|
||||
switch (key) {
|
||||
case r'relatedStreams':
|
||||
final valueDes = serializers.deserialize(
|
||||
value,
|
||||
specifiedType: const FullType(BuiltList, [FullType(StreamItem)]),
|
||||
) as BuiltList<StreamItem>;
|
||||
result.relatedStreams.replace(valueDes);
|
||||
break;
|
||||
case r'nextpage':
|
||||
final valueDes = serializers.deserialize(
|
||||
value,
|
||||
specifiedType: const FullType.nullable(String),
|
||||
) as String?;
|
||||
if (valueDes == null) continue;
|
||||
result.nextpage = valueDes;
|
||||
break;
|
||||
default:
|
||||
unhandled.add(key);
|
||||
unhandled.add(value);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
StreamsPage deserialize(
|
||||
Serializers serializers,
|
||||
Object serialized, {
|
||||
FullType specifiedType = FullType.unspecified,
|
||||
}) {
|
||||
final result = StreamsPageBuilder();
|
||||
final serializedList = (serialized as Iterable<Object?>).toList();
|
||||
final unhandled = <Object?>[];
|
||||
_deserializeProperties(
|
||||
serializers,
|
||||
serialized,
|
||||
specifiedType: specifiedType,
|
||||
serializedList: serializedList,
|
||||
unhandled: unhandled,
|
||||
result: result,
|
||||
);
|
||||
return result.build();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
// AUTO-GENERATED FILE, DO NOT MODIFY!
|
||||
//
|
||||
|
||||
// ignore_for_file: unused_element
|
||||
import 'package:built_value/built_value.dart';
|
||||
import 'package:built_value/serializer.dart';
|
||||
|
||||
|
@ -14,107 +15,152 @@ part 'subtitle.g.dart';
|
|||
/// * [code] - The language code of the subtitle.
|
||||
/// * [mimeType] - The mime type of the subtitle.
|
||||
/// * [url] - The URL of the subtitle.
|
||||
@BuiltValue()
|
||||
abstract class Subtitle implements Built<Subtitle, SubtitleBuilder> {
|
||||
/// Whether the subtitle is auto generated.
|
||||
@BuiltValueField(wireName: r'autoGenerated')
|
||||
bool? get autoGenerated;
|
||||
/// Whether the subtitle is auto generated.
|
||||
@BuiltValueField(wireName: r'autoGenerated')
|
||||
bool? get autoGenerated;
|
||||
|
||||
/// The language code of the subtitle.
|
||||
@BuiltValueField(wireName: r'code')
|
||||
String? get code;
|
||||
/// The language code of the subtitle.
|
||||
@BuiltValueField(wireName: r'code')
|
||||
String? get code;
|
||||
|
||||
/// The mime type of the subtitle.
|
||||
@BuiltValueField(wireName: r'mimeType')
|
||||
String? get mimeType;
|
||||
/// The mime type of the subtitle.
|
||||
@BuiltValueField(wireName: r'mimeType')
|
||||
String? get mimeType;
|
||||
|
||||
/// The URL of the subtitle.
|
||||
@BuiltValueField(wireName: r'url')
|
||||
String? get url;
|
||||
/// The URL of the subtitle.
|
||||
@BuiltValueField(wireName: r'url')
|
||||
String? get url;
|
||||
|
||||
Subtitle._();
|
||||
Subtitle._();
|
||||
|
||||
@BuiltValueHook(initializeBuilder: true)
|
||||
static void _defaults(SubtitleBuilder b) => b;
|
||||
factory Subtitle([void updates(SubtitleBuilder b)]) = _$Subtitle;
|
||||
|
||||
factory Subtitle([void updates(SubtitleBuilder b)]) = _$Subtitle;
|
||||
@BuiltValueHook(initializeBuilder: true)
|
||||
static void _defaults(SubtitleBuilder b) => b;
|
||||
|
||||
@BuiltValueSerializer(custom: true)
|
||||
static Serializer<Subtitle> get serializer => _$SubtitleSerializer();
|
||||
@BuiltValueSerializer(custom: true)
|
||||
static Serializer<Subtitle> get serializer => _$SubtitleSerializer();
|
||||
}
|
||||
|
||||
class _$SubtitleSerializer implements StructuredSerializer<Subtitle> {
|
||||
@override
|
||||
final Iterable<Type> types = const [Subtitle, _$Subtitle];
|
||||
class _$SubtitleSerializer implements PrimitiveSerializer<Subtitle> {
|
||||
@override
|
||||
final Iterable<Type> types = const [Subtitle, _$Subtitle];
|
||||
|
||||
@override
|
||||
final String wireName = r'Subtitle';
|
||||
@override
|
||||
final String wireName = r'Subtitle';
|
||||
|
||||
@override
|
||||
Iterable<Object?> serialize(Serializers serializers, Subtitle object,
|
||||
{FullType specifiedType = FullType.unspecified}) {
|
||||
final result = <Object?>[];
|
||||
if (object.autoGenerated != null) {
|
||||
result
|
||||
..add(r'autoGenerated')
|
||||
..add(serializers.serialize(object.autoGenerated,
|
||||
specifiedType: const FullType(bool)));
|
||||
}
|
||||
if (object.code != null) {
|
||||
result
|
||||
..add(r'code')
|
||||
..add(serializers.serialize(object.code,
|
||||
specifiedType: const FullType(String)));
|
||||
}
|
||||
if (object.mimeType != null) {
|
||||
result
|
||||
..add(r'mimeType')
|
||||
..add(serializers.serialize(object.mimeType,
|
||||
specifiedType: const FullType(String)));
|
||||
}
|
||||
if (object.url != null) {
|
||||
result
|
||||
..add(r'url')
|
||||
..add(serializers.serialize(object.url,
|
||||
specifiedType: const FullType(String)));
|
||||
}
|
||||
return result;
|
||||
Iterable<Object?> _serializeProperties(
|
||||
Serializers serializers,
|
||||
Subtitle object, {
|
||||
FullType specifiedType = FullType.unspecified,
|
||||
}) sync* {
|
||||
if (object.autoGenerated != null) {
|
||||
yield r'autoGenerated';
|
||||
yield serializers.serialize(
|
||||
object.autoGenerated,
|
||||
specifiedType: const FullType(bool),
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
Subtitle deserialize(Serializers serializers, Iterable<Object?> serialized,
|
||||
{FullType specifiedType = FullType.unspecified}) {
|
||||
final result = SubtitleBuilder();
|
||||
|
||||
final iterator = serialized.iterator;
|
||||
while (iterator.moveNext()) {
|
||||
final key = iterator.current as String;
|
||||
iterator.moveNext();
|
||||
final Object? value = iterator.current;
|
||||
|
||||
switch (key) {
|
||||
case r'autoGenerated':
|
||||
final valueDes = serializers.deserialize(value,
|
||||
specifiedType: const FullType(bool)) as bool;
|
||||
result.autoGenerated = valueDes;
|
||||
break;
|
||||
case r'code':
|
||||
final valueDes = serializers.deserialize(value,
|
||||
specifiedType: const FullType(String)) as String;
|
||||
result.code = valueDes;
|
||||
break;
|
||||
case r'mimeType':
|
||||
final valueDes = serializers.deserialize(value,
|
||||
specifiedType: const FullType(String)) as String;
|
||||
result.mimeType = valueDes;
|
||||
break;
|
||||
case r'url':
|
||||
final valueDes = serializers.deserialize(value,
|
||||
specifiedType: const FullType(String)) as String;
|
||||
result.url = valueDes;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return result.build();
|
||||
if (object.code != null) {
|
||||
yield r'code';
|
||||
yield serializers.serialize(
|
||||
object.code,
|
||||
specifiedType: const FullType(String),
|
||||
);
|
||||
}
|
||||
if (object.mimeType != null) {
|
||||
yield r'mimeType';
|
||||
yield serializers.serialize(
|
||||
object.mimeType,
|
||||
specifiedType: const FullType(String),
|
||||
);
|
||||
}
|
||||
if (object.url != null) {
|
||||
yield r'url';
|
||||
yield serializers.serialize(
|
||||
object.url,
|
||||
specifiedType: const FullType(String),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
Object serialize(
|
||||
Serializers serializers,
|
||||
Subtitle object, {
|
||||
FullType specifiedType = FullType.unspecified,
|
||||
}) {
|
||||
return _serializeProperties(serializers, object, specifiedType: specifiedType).toList();
|
||||
}
|
||||
|
||||
void _deserializeProperties(
|
||||
Serializers serializers,
|
||||
Object serialized, {
|
||||
FullType specifiedType = FullType.unspecified,
|
||||
required List<Object?> serializedList,
|
||||
required SubtitleBuilder result,
|
||||
required List<Object?> unhandled,
|
||||
}) {
|
||||
for (var i = 0; i < serializedList.length; i += 2) {
|
||||
final key = serializedList[i] as String;
|
||||
final value = serializedList[i + 1];
|
||||
switch (key) {
|
||||
case r'autoGenerated':
|
||||
final valueDes = serializers.deserialize(
|
||||
value,
|
||||
specifiedType: const FullType(bool),
|
||||
) as bool;
|
||||
result.autoGenerated = valueDes;
|
||||
break;
|
||||
case r'code':
|
||||
final valueDes = serializers.deserialize(
|
||||
value,
|
||||
specifiedType: const FullType(String),
|
||||
) as String;
|
||||
result.code = valueDes;
|
||||
break;
|
||||
case r'mimeType':
|
||||
final valueDes = serializers.deserialize(
|
||||
value,
|
||||
specifiedType: const FullType(String),
|
||||
) as String;
|
||||
result.mimeType = valueDes;
|
||||
break;
|
||||
case r'url':
|
||||
final valueDes = serializers.deserialize(
|
||||
value,
|
||||
specifiedType: const FullType(String),
|
||||
) as String;
|
||||
result.url = valueDes;
|
||||
break;
|
||||
default:
|
||||
unhandled.add(key);
|
||||
unhandled.add(value);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
Subtitle deserialize(
|
||||
Serializers serializers,
|
||||
Object serialized, {
|
||||
FullType specifiedType = FullType.unspecified,
|
||||
}) {
|
||||
final result = SubtitleBuilder();
|
||||
final serializedList = (serialized as Iterable<Object?>).toList();
|
||||
final unhandled = <Object?>[];
|
||||
_deserializeProperties(
|
||||
serializers,
|
||||
serialized,
|
||||
specifiedType: specifiedType,
|
||||
serializedList: serializedList,
|
||||
unhandled: unhandled,
|
||||
result: result,
|
||||
);
|
||||
return result.build();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
// AUTO-GENERATED FILE, DO NOT MODIFY!
|
||||
//
|
||||
|
||||
// ignore_for_file: unused_element
|
||||
import 'package:piped_api/src/model/stream_item.dart';
|
||||
import 'package:built_collection/built_collection.dart';
|
||||
import 'package:piped_api/src/model/stream.dart';
|
||||
|
@ -35,358 +36,454 @@ part 'video_info.g.dart';
|
|||
/// * [uploaderVerified] - Whether the video's uploader is verified.
|
||||
/// * [views] - The number of views the video has.
|
||||
/// * [relatedStreams]
|
||||
@BuiltValue()
|
||||
abstract class VideoInfo implements Built<VideoInfo, VideoInfoBuilder> {
|
||||
@BuiltValueField(wireName: r'audioStreams')
|
||||
BuiltList<Stream>? get audioStreams;
|
||||
@BuiltValueField(wireName: r'audioStreams')
|
||||
BuiltList<Stream>? get audioStreams;
|
||||
|
||||
@BuiltValueField(wireName: r'videoStreams')
|
||||
BuiltList<Stream>? get videoStreams;
|
||||
@BuiltValueField(wireName: r'videoStreams')
|
||||
BuiltList<Stream>? get videoStreams;
|
||||
|
||||
/// The video's description.
|
||||
@BuiltValueField(wireName: r'description')
|
||||
String? get description;
|
||||
/// The video's description.
|
||||
@BuiltValueField(wireName: r'description')
|
||||
String? get description;
|
||||
|
||||
/// The number of dislikes the video has.
|
||||
@BuiltValueField(wireName: r'dislikes')
|
||||
int? get dislikes;
|
||||
/// The number of dislikes the video has.
|
||||
@BuiltValueField(wireName: r'dislikes')
|
||||
int? get dislikes;
|
||||
|
||||
/// The video's duration in seconds.
|
||||
@BuiltValueField(wireName: r'duration')
|
||||
int? get duration;
|
||||
/// The video's duration in seconds.
|
||||
@BuiltValueField(wireName: r'duration')
|
||||
int? get duration;
|
||||
|
||||
/// The stream of the video in a HLS manifest.
|
||||
@BuiltValueField(wireName: r'hls')
|
||||
String? get hls;
|
||||
/// The stream of the video in a HLS manifest.
|
||||
@BuiltValueField(wireName: r'hls')
|
||||
String? get hls;
|
||||
|
||||
/// The LBRY ID of the video.
|
||||
@BuiltValueField(wireName: r'lbryId')
|
||||
String? get lbryId;
|
||||
/// The LBRY ID of the video.
|
||||
@BuiltValueField(wireName: r'lbryId')
|
||||
String? get lbryId;
|
||||
|
||||
/// The number of likes the video has.
|
||||
@BuiltValueField(wireName: r'likes')
|
||||
int? get likes;
|
||||
/// The number of likes the video has.
|
||||
@BuiltValueField(wireName: r'likes')
|
||||
int? get likes;
|
||||
|
||||
/// Whether the video is a livestream.
|
||||
@BuiltValueField(wireName: r'livestream')
|
||||
bool? get livestream;
|
||||
/// Whether the video is a livestream.
|
||||
@BuiltValueField(wireName: r'livestream')
|
||||
bool? get livestream;
|
||||
|
||||
/// The base URL of the backend instance's proxy.
|
||||
@BuiltValueField(wireName: r'proxyUrl')
|
||||
String? get proxyUrl;
|
||||
/// The base URL of the backend instance's proxy.
|
||||
@BuiltValueField(wireName: r'proxyUrl')
|
||||
String? get proxyUrl;
|
||||
|
||||
@BuiltValueField(wireName: r'subtitles')
|
||||
BuiltList<Subtitle>? get subtitles;
|
||||
@BuiltValueField(wireName: r'subtitles')
|
||||
BuiltList<Subtitle>? get subtitles;
|
||||
|
||||
/// The URL of the DASH manifest.
|
||||
@BuiltValueField(wireName: r'dash')
|
||||
String? get dash;
|
||||
/// The URL of the DASH manifest.
|
||||
@BuiltValueField(wireName: r'dash')
|
||||
String? get dash;
|
||||
|
||||
/// The URL of the video's thumbnail.
|
||||
@BuiltValueField(wireName: r'thumbnailUrl')
|
||||
String? get thumbnailUrl;
|
||||
/// The URL of the video's thumbnail.
|
||||
@BuiltValueField(wireName: r'thumbnailUrl')
|
||||
String? get thumbnailUrl;
|
||||
|
||||
/// The video's title.
|
||||
@BuiltValueField(wireName: r'title')
|
||||
String? get title;
|
||||
/// The video's title.
|
||||
@BuiltValueField(wireName: r'title')
|
||||
String? get title;
|
||||
|
||||
/// The date the video was uploaded.
|
||||
@BuiltValueField(wireName: r'uploadDate')
|
||||
String? get uploadDate;
|
||||
/// The date the video was uploaded.
|
||||
@BuiltValueField(wireName: r'uploadDate')
|
||||
String? get uploadDate;
|
||||
|
||||
/// The video's uploader.
|
||||
@BuiltValueField(wireName: r'uploader')
|
||||
String? get uploader;
|
||||
/// The video's uploader.
|
||||
@BuiltValueField(wireName: r'uploader')
|
||||
String? get uploader;
|
||||
|
||||
/// The URL of the video's uploader's avatar.
|
||||
@BuiltValueField(wireName: r'uploaderAvatar')
|
||||
String? get uploaderAvatar;
|
||||
/// The URL of the video's uploader's avatar.
|
||||
@BuiltValueField(wireName: r'uploaderAvatar')
|
||||
String? get uploaderAvatar;
|
||||
|
||||
/// The relative URL of the video's uploader.
|
||||
@BuiltValueField(wireName: r'uploaderUrl')
|
||||
String? get uploaderUrl;
|
||||
/// The relative URL of the video's uploader.
|
||||
@BuiltValueField(wireName: r'uploaderUrl')
|
||||
String? get uploaderUrl;
|
||||
|
||||
/// Whether the video's uploader is verified.
|
||||
@BuiltValueField(wireName: r'uploaderVerified')
|
||||
bool? get uploaderVerified;
|
||||
/// Whether the video's uploader is verified.
|
||||
@BuiltValueField(wireName: r'uploaderVerified')
|
||||
bool? get uploaderVerified;
|
||||
|
||||
/// The number of views the video has.
|
||||
@BuiltValueField(wireName: r'views')
|
||||
int? get views;
|
||||
/// The number of views the video has.
|
||||
@BuiltValueField(wireName: r'views')
|
||||
int? get views;
|
||||
|
||||
@BuiltValueField(wireName: r'relatedStreams')
|
||||
BuiltList<StreamItem>? get relatedStreams;
|
||||
@BuiltValueField(wireName: r'relatedStreams')
|
||||
BuiltList<StreamItem>? get relatedStreams;
|
||||
|
||||
VideoInfo._();
|
||||
VideoInfo._();
|
||||
|
||||
@BuiltValueHook(initializeBuilder: true)
|
||||
static void _defaults(VideoInfoBuilder b) => b;
|
||||
factory VideoInfo([void updates(VideoInfoBuilder b)]) = _$VideoInfo;
|
||||
|
||||
factory VideoInfo([void updates(VideoInfoBuilder b)]) = _$VideoInfo;
|
||||
@BuiltValueHook(initializeBuilder: true)
|
||||
static void _defaults(VideoInfoBuilder b) => b;
|
||||
|
||||
@BuiltValueSerializer(custom: true)
|
||||
static Serializer<VideoInfo> get serializer => _$VideoInfoSerializer();
|
||||
@BuiltValueSerializer(custom: true)
|
||||
static Serializer<VideoInfo> get serializer => _$VideoInfoSerializer();
|
||||
}
|
||||
|
||||
class _$VideoInfoSerializer implements StructuredSerializer<VideoInfo> {
|
||||
@override
|
||||
final Iterable<Type> types = const [VideoInfo, _$VideoInfo];
|
||||
class _$VideoInfoSerializer implements PrimitiveSerializer<VideoInfo> {
|
||||
@override
|
||||
final Iterable<Type> types = const [VideoInfo, _$VideoInfo];
|
||||
|
||||
@override
|
||||
final String wireName = r'VideoInfo';
|
||||
@override
|
||||
final String wireName = r'VideoInfo';
|
||||
|
||||
@override
|
||||
Iterable<Object?> serialize(Serializers serializers, VideoInfo object,
|
||||
{FullType specifiedType = FullType.unspecified}) {
|
||||
final result = <Object?>[];
|
||||
if (object.audioStreams != null) {
|
||||
result
|
||||
..add(r'audioStreams')
|
||||
..add(serializers.serialize(object.audioStreams,
|
||||
specifiedType: const FullType(BuiltList, [FullType(Stream)])));
|
||||
}
|
||||
if (object.videoStreams != null) {
|
||||
result
|
||||
..add(r'videoStreams')
|
||||
..add(serializers.serialize(object.videoStreams,
|
||||
specifiedType: const FullType(BuiltList, [FullType(Stream)])));
|
||||
}
|
||||
if (object.description != null) {
|
||||
result
|
||||
..add(r'description')
|
||||
..add(serializers.serialize(object.description,
|
||||
specifiedType: const FullType(String)));
|
||||
}
|
||||
if (object.dislikes != null) {
|
||||
result
|
||||
..add(r'dislikes')
|
||||
..add(serializers.serialize(object.dislikes,
|
||||
specifiedType: const FullType(int)));
|
||||
}
|
||||
if (object.duration != null) {
|
||||
result
|
||||
..add(r'duration')
|
||||
..add(serializers.serialize(object.duration,
|
||||
specifiedType: const FullType(int)));
|
||||
}
|
||||
if (object.hls != null) {
|
||||
result
|
||||
..add(r'hls')
|
||||
..add(serializers.serialize(object.hls,
|
||||
specifiedType: const FullType(String)));
|
||||
}
|
||||
if (object.lbryId != null) {
|
||||
result
|
||||
..add(r'lbryId')
|
||||
..add(serializers.serialize(object.lbryId,
|
||||
specifiedType: const FullType(String)));
|
||||
}
|
||||
if (object.likes != null) {
|
||||
result
|
||||
..add(r'likes')
|
||||
..add(serializers.serialize(object.likes,
|
||||
specifiedType: const FullType(int)));
|
||||
}
|
||||
if (object.livestream != null) {
|
||||
result
|
||||
..add(r'livestream')
|
||||
..add(serializers.serialize(object.livestream,
|
||||
specifiedType: const FullType(bool)));
|
||||
}
|
||||
if (object.proxyUrl != null) {
|
||||
result
|
||||
..add(r'proxyUrl')
|
||||
..add(serializers.serialize(object.proxyUrl,
|
||||
specifiedType: const FullType(String)));
|
||||
}
|
||||
if (object.subtitles != null) {
|
||||
result
|
||||
..add(r'subtitles')
|
||||
..add(serializers.serialize(object.subtitles,
|
||||
specifiedType: const FullType(BuiltList, [FullType(Subtitle)])));
|
||||
}
|
||||
if (object.dash != null) {
|
||||
result
|
||||
..add(r'dash')
|
||||
..add(serializers.serialize(object.dash,
|
||||
specifiedType: const FullType(String)));
|
||||
}
|
||||
if (object.thumbnailUrl != null) {
|
||||
result
|
||||
..add(r'thumbnailUrl')
|
||||
..add(serializers.serialize(object.thumbnailUrl,
|
||||
specifiedType: const FullType(String)));
|
||||
}
|
||||
if (object.title != null) {
|
||||
result
|
||||
..add(r'title')
|
||||
..add(serializers.serialize(object.title,
|
||||
specifiedType: const FullType(String)));
|
||||
}
|
||||
if (object.uploadDate != null) {
|
||||
result
|
||||
..add(r'uploadDate')
|
||||
..add(serializers.serialize(object.uploadDate,
|
||||
specifiedType: const FullType(String)));
|
||||
}
|
||||
if (object.uploader != null) {
|
||||
result
|
||||
..add(r'uploader')
|
||||
..add(serializers.serialize(object.uploader,
|
||||
specifiedType: const FullType(String)));
|
||||
}
|
||||
if (object.uploaderAvatar != null) {
|
||||
result
|
||||
..add(r'uploaderAvatar')
|
||||
..add(serializers.serialize(object.uploaderAvatar,
|
||||
specifiedType: const FullType(String)));
|
||||
}
|
||||
if (object.uploaderUrl != null) {
|
||||
result
|
||||
..add(r'uploaderUrl')
|
||||
..add(serializers.serialize(object.uploaderUrl,
|
||||
specifiedType: const FullType(String)));
|
||||
}
|
||||
if (object.uploaderVerified != null) {
|
||||
result
|
||||
..add(r'uploaderVerified')
|
||||
..add(serializers.serialize(object.uploaderVerified,
|
||||
specifiedType: const FullType(bool)));
|
||||
}
|
||||
if (object.views != null) {
|
||||
result
|
||||
..add(r'views')
|
||||
..add(serializers.serialize(object.views,
|
||||
specifiedType: const FullType(int)));
|
||||
}
|
||||
if (object.relatedStreams != null) {
|
||||
result
|
||||
..add(r'relatedStreams')
|
||||
..add(serializers.serialize(object.relatedStreams,
|
||||
specifiedType: const FullType(BuiltList, [FullType(StreamItem)])));
|
||||
}
|
||||
return result;
|
||||
Iterable<Object?> _serializeProperties(
|
||||
Serializers serializers,
|
||||
VideoInfo object, {
|
||||
FullType specifiedType = FullType.unspecified,
|
||||
}) sync* {
|
||||
if (object.audioStreams != null) {
|
||||
yield r'audioStreams';
|
||||
yield serializers.serialize(
|
||||
object.audioStreams,
|
||||
specifiedType: const FullType(BuiltList, [FullType(Stream)]),
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
VideoInfo deserialize(Serializers serializers, Iterable<Object?> serialized,
|
||||
{FullType specifiedType = FullType.unspecified}) {
|
||||
final result = VideoInfoBuilder();
|
||||
|
||||
final iterator = serialized.iterator;
|
||||
while (iterator.moveNext()) {
|
||||
final key = iterator.current as String;
|
||||
iterator.moveNext();
|
||||
final Object? value = iterator.current;
|
||||
|
||||
switch (key) {
|
||||
case r'audioStreams':
|
||||
final valueDes = serializers.deserialize(value,
|
||||
specifiedType: const FullType(BuiltList, [FullType(Stream)])) as BuiltList<Stream>;
|
||||
result.audioStreams.replace(valueDes);
|
||||
break;
|
||||
case r'videoStreams':
|
||||
final valueDes = serializers.deserialize(value,
|
||||
specifiedType: const FullType(BuiltList, [FullType(Stream)])) as BuiltList<Stream>;
|
||||
result.videoStreams.replace(valueDes);
|
||||
break;
|
||||
case r'description':
|
||||
final valueDes = serializers.deserialize(value,
|
||||
specifiedType: const FullType(String)) as String;
|
||||
result.description = valueDes;
|
||||
break;
|
||||
case r'dislikes':
|
||||
final valueDes = serializers.deserialize(value,
|
||||
specifiedType: const FullType(int)) as int;
|
||||
result.dislikes = valueDes;
|
||||
break;
|
||||
case r'duration':
|
||||
final valueDes = serializers.deserialize(value,
|
||||
specifiedType: const FullType(int)) as int;
|
||||
result.duration = valueDes;
|
||||
break;
|
||||
case r'hls':
|
||||
final valueDes = serializers.deserialize(value,
|
||||
specifiedType: const FullType(String)) as String;
|
||||
result.hls = valueDes;
|
||||
break;
|
||||
case r'lbryId':
|
||||
final valueDes = serializers.deserialize(value,
|
||||
specifiedType: const FullType(String)) as String;
|
||||
result.lbryId = valueDes;
|
||||
break;
|
||||
case r'likes':
|
||||
final valueDes = serializers.deserialize(value,
|
||||
specifiedType: const FullType(int)) as int;
|
||||
result.likes = valueDes;
|
||||
break;
|
||||
case r'livestream':
|
||||
final valueDes = serializers.deserialize(value,
|
||||
specifiedType: const FullType(bool)) as bool;
|
||||
result.livestream = valueDes;
|
||||
break;
|
||||
case r'proxyUrl':
|
||||
final valueDes = serializers.deserialize(value,
|
||||
specifiedType: const FullType(String)) as String;
|
||||
result.proxyUrl = valueDes;
|
||||
break;
|
||||
case r'subtitles':
|
||||
final valueDes = serializers.deserialize(value,
|
||||
specifiedType: const FullType(BuiltList, [FullType(Subtitle)])) as BuiltList<Subtitle>;
|
||||
result.subtitles.replace(valueDes);
|
||||
break;
|
||||
case r'dash':
|
||||
final valueDes = serializers.deserialize(value,
|
||||
specifiedType: const FullType(String)) as String;
|
||||
result.dash = valueDes;
|
||||
break;
|
||||
case r'thumbnailUrl':
|
||||
final valueDes = serializers.deserialize(value,
|
||||
specifiedType: const FullType(String)) as String;
|
||||
result.thumbnailUrl = valueDes;
|
||||
break;
|
||||
case r'title':
|
||||
final valueDes = serializers.deserialize(value,
|
||||
specifiedType: const FullType(String)) as String;
|
||||
result.title = valueDes;
|
||||
break;
|
||||
case r'uploadDate':
|
||||
final valueDes = serializers.deserialize(value,
|
||||
specifiedType: const FullType(String)) as String;
|
||||
result.uploadDate = valueDes;
|
||||
break;
|
||||
case r'uploader':
|
||||
final valueDes = serializers.deserialize(value,
|
||||
specifiedType: const FullType(String)) as String;
|
||||
result.uploader = valueDes;
|
||||
break;
|
||||
case r'uploaderAvatar':
|
||||
final valueDes = serializers.deserialize(value,
|
||||
specifiedType: const FullType(String)) as String;
|
||||
result.uploaderAvatar = valueDes;
|
||||
break;
|
||||
case r'uploaderUrl':
|
||||
final valueDes = serializers.deserialize(value,
|
||||
specifiedType: const FullType(String)) as String;
|
||||
result.uploaderUrl = valueDes;
|
||||
break;
|
||||
case r'uploaderVerified':
|
||||
final valueDes = serializers.deserialize(value,
|
||||
specifiedType: const FullType(bool)) as bool;
|
||||
result.uploaderVerified = valueDes;
|
||||
break;
|
||||
case r'views':
|
||||
final valueDes = serializers.deserialize(value,
|
||||
specifiedType: const FullType(int)) as int;
|
||||
result.views = valueDes;
|
||||
break;
|
||||
case r'relatedStreams':
|
||||
final valueDes = serializers.deserialize(value,
|
||||
specifiedType: const FullType(BuiltList, [FullType(StreamItem)])) as BuiltList<StreamItem>;
|
||||
result.relatedStreams.replace(valueDes);
|
||||
break;
|
||||
}
|
||||
}
|
||||
return result.build();
|
||||
if (object.videoStreams != null) {
|
||||
yield r'videoStreams';
|
||||
yield serializers.serialize(
|
||||
object.videoStreams,
|
||||
specifiedType: const FullType(BuiltList, [FullType(Stream)]),
|
||||
);
|
||||
}
|
||||
if (object.description != null) {
|
||||
yield r'description';
|
||||
yield serializers.serialize(
|
||||
object.description,
|
||||
specifiedType: const FullType(String),
|
||||
);
|
||||
}
|
||||
if (object.dislikes != null) {
|
||||
yield r'dislikes';
|
||||
yield serializers.serialize(
|
||||
object.dislikes,
|
||||
specifiedType: const FullType(int),
|
||||
);
|
||||
}
|
||||
if (object.duration != null) {
|
||||
yield r'duration';
|
||||
yield serializers.serialize(
|
||||
object.duration,
|
||||
specifiedType: const FullType(int),
|
||||
);
|
||||
}
|
||||
if (object.hls != null) {
|
||||
yield r'hls';
|
||||
yield serializers.serialize(
|
||||
object.hls,
|
||||
specifiedType: const FullType(String),
|
||||
);
|
||||
}
|
||||
if (object.lbryId != null) {
|
||||
yield r'lbryId';
|
||||
yield serializers.serialize(
|
||||
object.lbryId,
|
||||
specifiedType: const FullType(String),
|
||||
);
|
||||
}
|
||||
if (object.likes != null) {
|
||||
yield r'likes';
|
||||
yield serializers.serialize(
|
||||
object.likes,
|
||||
specifiedType: const FullType(int),
|
||||
);
|
||||
}
|
||||
if (object.livestream != null) {
|
||||
yield r'livestream';
|
||||
yield serializers.serialize(
|
||||
object.livestream,
|
||||
specifiedType: const FullType(bool),
|
||||
);
|
||||
}
|
||||
if (object.proxyUrl != null) {
|
||||
yield r'proxyUrl';
|
||||
yield serializers.serialize(
|
||||
object.proxyUrl,
|
||||
specifiedType: const FullType(String),
|
||||
);
|
||||
}
|
||||
if (object.subtitles != null) {
|
||||
yield r'subtitles';
|
||||
yield serializers.serialize(
|
||||
object.subtitles,
|
||||
specifiedType: const FullType(BuiltList, [FullType(Subtitle)]),
|
||||
);
|
||||
}
|
||||
if (object.dash != null) {
|
||||
yield r'dash';
|
||||
yield serializers.serialize(
|
||||
object.dash,
|
||||
specifiedType: const FullType(String),
|
||||
);
|
||||
}
|
||||
if (object.thumbnailUrl != null) {
|
||||
yield r'thumbnailUrl';
|
||||
yield serializers.serialize(
|
||||
object.thumbnailUrl,
|
||||
specifiedType: const FullType(String),
|
||||
);
|
||||
}
|
||||
if (object.title != null) {
|
||||
yield r'title';
|
||||
yield serializers.serialize(
|
||||
object.title,
|
||||
specifiedType: const FullType(String),
|
||||
);
|
||||
}
|
||||
if (object.uploadDate != null) {
|
||||
yield r'uploadDate';
|
||||
yield serializers.serialize(
|
||||
object.uploadDate,
|
||||
specifiedType: const FullType(String),
|
||||
);
|
||||
}
|
||||
if (object.uploader != null) {
|
||||
yield r'uploader';
|
||||
yield serializers.serialize(
|
||||
object.uploader,
|
||||
specifiedType: const FullType(String),
|
||||
);
|
||||
}
|
||||
if (object.uploaderAvatar != null) {
|
||||
yield r'uploaderAvatar';
|
||||
yield serializers.serialize(
|
||||
object.uploaderAvatar,
|
||||
specifiedType: const FullType(String),
|
||||
);
|
||||
}
|
||||
if (object.uploaderUrl != null) {
|
||||
yield r'uploaderUrl';
|
||||
yield serializers.serialize(
|
||||
object.uploaderUrl,
|
||||
specifiedType: const FullType(String),
|
||||
);
|
||||
}
|
||||
if (object.uploaderVerified != null) {
|
||||
yield r'uploaderVerified';
|
||||
yield serializers.serialize(
|
||||
object.uploaderVerified,
|
||||
specifiedType: const FullType(bool),
|
||||
);
|
||||
}
|
||||
if (object.views != null) {
|
||||
yield r'views';
|
||||
yield serializers.serialize(
|
||||
object.views,
|
||||
specifiedType: const FullType(int),
|
||||
);
|
||||
}
|
||||
if (object.relatedStreams != null) {
|
||||
yield r'relatedStreams';
|
||||
yield serializers.serialize(
|
||||
object.relatedStreams,
|
||||
specifiedType: const FullType(BuiltList, [FullType(StreamItem)]),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
Object serialize(
|
||||
Serializers serializers,
|
||||
VideoInfo object, {
|
||||
FullType specifiedType = FullType.unspecified,
|
||||
}) {
|
||||
return _serializeProperties(serializers, object, specifiedType: specifiedType).toList();
|
||||
}
|
||||
|
||||
void _deserializeProperties(
|
||||
Serializers serializers,
|
||||
Object serialized, {
|
||||
FullType specifiedType = FullType.unspecified,
|
||||
required List<Object?> serializedList,
|
||||
required VideoInfoBuilder result,
|
||||
required List<Object?> unhandled,
|
||||
}) {
|
||||
for (var i = 0; i < serializedList.length; i += 2) {
|
||||
final key = serializedList[i] as String;
|
||||
final value = serializedList[i + 1];
|
||||
switch (key) {
|
||||
case r'audioStreams':
|
||||
final valueDes = serializers.deserialize(
|
||||
value,
|
||||
specifiedType: const FullType(BuiltList, [FullType(Stream)]),
|
||||
) as BuiltList<Stream>;
|
||||
result.audioStreams.replace(valueDes);
|
||||
break;
|
||||
case r'videoStreams':
|
||||
final valueDes = serializers.deserialize(
|
||||
value,
|
||||
specifiedType: const FullType(BuiltList, [FullType(Stream)]),
|
||||
) as BuiltList<Stream>;
|
||||
result.videoStreams.replace(valueDes);
|
||||
break;
|
||||
case r'description':
|
||||
final valueDes = serializers.deserialize(
|
||||
value,
|
||||
specifiedType: const FullType(String),
|
||||
) as String;
|
||||
result.description = valueDes;
|
||||
break;
|
||||
case r'dislikes':
|
||||
final valueDes = serializers.deserialize(
|
||||
value,
|
||||
specifiedType: const FullType(int),
|
||||
) as int;
|
||||
result.dislikes = valueDes;
|
||||
break;
|
||||
case r'duration':
|
||||
final valueDes = serializers.deserialize(
|
||||
value,
|
||||
specifiedType: const FullType(int),
|
||||
) as int;
|
||||
result.duration = valueDes;
|
||||
break;
|
||||
case r'hls':
|
||||
final valueDes = serializers.deserialize(
|
||||
value,
|
||||
specifiedType: const FullType(String),
|
||||
) as String;
|
||||
result.hls = valueDes;
|
||||
break;
|
||||
case r'lbryId':
|
||||
final valueDes = serializers.deserialize(
|
||||
value,
|
||||
specifiedType: const FullType(String),
|
||||
) as String;
|
||||
result.lbryId = valueDes;
|
||||
break;
|
||||
case r'likes':
|
||||
final valueDes = serializers.deserialize(
|
||||
value,
|
||||
specifiedType: const FullType(int),
|
||||
) as int;
|
||||
result.likes = valueDes;
|
||||
break;
|
||||
case r'livestream':
|
||||
final valueDes = serializers.deserialize(
|
||||
value,
|
||||
specifiedType: const FullType(bool),
|
||||
) as bool;
|
||||
result.livestream = valueDes;
|
||||
break;
|
||||
case r'proxyUrl':
|
||||
final valueDes = serializers.deserialize(
|
||||
value,
|
||||
specifiedType: const FullType(String),
|
||||
) as String;
|
||||
result.proxyUrl = valueDes;
|
||||
break;
|
||||
case r'subtitles':
|
||||
final valueDes = serializers.deserialize(
|
||||
value,
|
||||
specifiedType: const FullType(BuiltList, [FullType(Subtitle)]),
|
||||
) as BuiltList<Subtitle>;
|
||||
result.subtitles.replace(valueDes);
|
||||
break;
|
||||
case r'dash':
|
||||
final valueDes = serializers.deserialize(
|
||||
value,
|
||||
specifiedType: const FullType(String),
|
||||
) as String;
|
||||
result.dash = valueDes;
|
||||
break;
|
||||
case r'thumbnailUrl':
|
||||
final valueDes = serializers.deserialize(
|
||||
value,
|
||||
specifiedType: const FullType(String),
|
||||
) as String;
|
||||
result.thumbnailUrl = valueDes;
|
||||
break;
|
||||
case r'title':
|
||||
final valueDes = serializers.deserialize(
|
||||
value,
|
||||
specifiedType: const FullType(String),
|
||||
) as String;
|
||||
result.title = valueDes;
|
||||
break;
|
||||
case r'uploadDate':
|
||||
final valueDes = serializers.deserialize(
|
||||
value,
|
||||
specifiedType: const FullType(String),
|
||||
) as String;
|
||||
result.uploadDate = valueDes;
|
||||
break;
|
||||
case r'uploader':
|
||||
final valueDes = serializers.deserialize(
|
||||
value,
|
||||
specifiedType: const FullType(String),
|
||||
) as String;
|
||||
result.uploader = valueDes;
|
||||
break;
|
||||
case r'uploaderAvatar':
|
||||
final valueDes = serializers.deserialize(
|
||||
value,
|
||||
specifiedType: const FullType(String),
|
||||
) as String;
|
||||
result.uploaderAvatar = valueDes;
|
||||
break;
|
||||
case r'uploaderUrl':
|
||||
final valueDes = serializers.deserialize(
|
||||
value,
|
||||
specifiedType: const FullType(String),
|
||||
) as String;
|
||||
result.uploaderUrl = valueDes;
|
||||
break;
|
||||
case r'uploaderVerified':
|
||||
final valueDes = serializers.deserialize(
|
||||
value,
|
||||
specifiedType: const FullType(bool),
|
||||
) as bool;
|
||||
result.uploaderVerified = valueDes;
|
||||
break;
|
||||
case r'views':
|
||||
final valueDes = serializers.deserialize(
|
||||
value,
|
||||
specifiedType: const FullType(int),
|
||||
) as int;
|
||||
result.views = valueDes;
|
||||
break;
|
||||
case r'relatedStreams':
|
||||
final valueDes = serializers.deserialize(
|
||||
value,
|
||||
specifiedType: const FullType(BuiltList, [FullType(StreamItem)]),
|
||||
) as BuiltList<StreamItem>;
|
||||
result.relatedStreams.replace(valueDes);
|
||||
break;
|
||||
default:
|
||||
unhandled.add(key);
|
||||
unhandled.add(value);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
VideoInfo deserialize(
|
||||
Serializers serializers,
|
||||
Object serialized, {
|
||||
FullType specifiedType = FullType.unspecified,
|
||||
}) {
|
||||
final result = VideoInfoBuilder();
|
||||
final serializedList = (serialized as Iterable<Object?>).toList();
|
||||
final unhandled = <Object?>[];
|
||||
_deserializeProperties(
|
||||
serializers,
|
||||
serialized,
|
||||
specifiedType: specifiedType,
|
||||
serializedList: serializedList,
|
||||
unhandled: unhandled,
|
||||
result: result,
|
||||
);
|
||||
return result.build();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -4,6 +4,8 @@
|
|||
|
||||
// ignore_for_file: unused_import
|
||||
|
||||
import 'package:one_of_serializer/any_of_serializer.dart';
|
||||
import 'package:one_of_serializer/one_of_serializer.dart';
|
||||
import 'package:built_collection/built_collection.dart';
|
||||
import 'package:built_value/json_object.dart';
|
||||
import 'package:built_value/serializer.dart';
|
||||
|
@ -52,6 +54,8 @@ Serializers serializers = (_$serializers.toBuilder()
|
|||
const FullType(BuiltList, [FullType(StreamItem)]),
|
||||
() => ListBuilder<StreamItem>(),
|
||||
)
|
||||
..add(const OneOfSerializer())
|
||||
..add(const AnyOfSerializer())
|
||||
..add(const DateSerializer())
|
||||
..add(Iso8601DateTimeSerializer()))
|
||||
.build();
|
||||
|
|
|
@ -8,10 +8,12 @@ environment:
|
|||
|
||||
dependencies:
|
||||
dio: '>=4.0.1 <5.0.0'
|
||||
built_value: '>=8.1.0 <9.0.0'
|
||||
built_collection: '>=5.1.0 <6.0.0'
|
||||
one_of: '>=1.5.0 <2.0.0'
|
||||
one_of_serializer: '>=1.5.0 <2.0.0'
|
||||
built_value: '>=8.4.0 <9.0.0'
|
||||
built_collection: '>=5.1.1 <6.0.0'
|
||||
|
||||
dev_dependencies:
|
||||
built_value_generator: '>=8.1.0 <9.0.0'
|
||||
built_value_generator: '>=8.4.0 <9.0.0'
|
||||
build_runner: any
|
||||
test: ^1.16.0
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue