diff --git a/lib/src/data/emoji_response.dart b/lib/src/data/emoji_response.dart index 72984df9..f6574bca 100644 --- a/lib/src/data/emoji_response.dart +++ b/lib/src/data/emoji_response.dart @@ -16,7 +16,7 @@ class EmojiResponse with _$EmojiResponse { String? license, @Default(false) bool isSensitive, @Default(false) bool localOnly, - //TODO: roleIdsThatCanBeUsedThisEmojiAsReaction + List? roleIdsThatCanBeUsedThisEmojiAsReaction, }) = _EmojiResponse; factory EmojiResponse.fromJson(Map json) => diff --git a/lib/src/data/emoji_response.freezed.dart b/lib/src/data/emoji_response.freezed.dart index 3ac59e2f..47e79dc8 100644 --- a/lib/src/data/emoji_response.freezed.dart +++ b/lib/src/data/emoji_response.freezed.dart @@ -30,6 +30,8 @@ mixin _$EmojiResponse { String? get license => throw _privateConstructorUsedError; bool get isSensitive => throw _privateConstructorUsedError; bool get localOnly => throw _privateConstructorUsedError; + List? get roleIdsThatCanBeUsedThisEmojiAsReaction => + throw _privateConstructorUsedError; Map toJson() => throw _privateConstructorUsedError; @JsonKey(ignore: true) @@ -52,7 +54,8 @@ abstract class $EmojiResponseCopyWith<$Res> { @NullableUriConverter() Uri? url, String? license, bool isSensitive, - bool localOnly}); + bool localOnly, + List? roleIdsThatCanBeUsedThisEmojiAsReaction}); } /// @nodoc @@ -77,6 +80,7 @@ class _$EmojiResponseCopyWithImpl<$Res, $Val extends EmojiResponse> Object? license = freezed, Object? isSensitive = null, Object? localOnly = null, + Object? roleIdsThatCanBeUsedThisEmojiAsReaction = freezed, }) { return _then(_value.copyWith( id: null == id @@ -115,6 +119,11 @@ class _$EmojiResponseCopyWithImpl<$Res, $Val extends EmojiResponse> ? _value.localOnly : localOnly // ignore: cast_nullable_to_non_nullable as bool, + roleIdsThatCanBeUsedThisEmojiAsReaction: freezed == + roleIdsThatCanBeUsedThisEmojiAsReaction + ? _value.roleIdsThatCanBeUsedThisEmojiAsReaction + : roleIdsThatCanBeUsedThisEmojiAsReaction // ignore: cast_nullable_to_non_nullable + as List?, ) as $Val); } } @@ -136,7 +145,8 @@ abstract class _$$EmojiResponseImplCopyWith<$Res> @NullableUriConverter() Uri? url, String? license, bool isSensitive, - bool localOnly}); + bool localOnly, + List? roleIdsThatCanBeUsedThisEmojiAsReaction}); } /// @nodoc @@ -159,6 +169,7 @@ class __$$EmojiResponseImplCopyWithImpl<$Res> Object? license = freezed, Object? isSensitive = null, Object? localOnly = null, + Object? roleIdsThatCanBeUsedThisEmojiAsReaction = freezed, }) { return _then(_$EmojiResponseImpl( id: null == id @@ -197,6 +208,11 @@ class __$$EmojiResponseImplCopyWithImpl<$Res> ? _value.localOnly : localOnly // ignore: cast_nullable_to_non_nullable as bool, + roleIdsThatCanBeUsedThisEmojiAsReaction: freezed == + roleIdsThatCanBeUsedThisEmojiAsReaction + ? _value._roleIdsThatCanBeUsedThisEmojiAsReaction + : roleIdsThatCanBeUsedThisEmojiAsReaction // ignore: cast_nullable_to_non_nullable + as List?, )); } } @@ -213,8 +229,11 @@ class _$EmojiResponseImpl implements _EmojiResponse { @NullableUriConverter() required this.url, this.license, this.isSensitive = false, - this.localOnly = false}) - : _aliases = aliases; + this.localOnly = false, + final List? roleIdsThatCanBeUsedThisEmojiAsReaction}) + : _aliases = aliases, + _roleIdsThatCanBeUsedThisEmojiAsReaction = + roleIdsThatCanBeUsedThisEmojiAsReaction; factory _$EmojiResponseImpl.fromJson(Map json) => _$$EmojiResponseImplFromJson(json); @@ -247,10 +266,20 @@ class _$EmojiResponseImpl implements _EmojiResponse { @override @JsonKey() final bool localOnly; + final List? _roleIdsThatCanBeUsedThisEmojiAsReaction; + @override + List? get roleIdsThatCanBeUsedThisEmojiAsReaction { + final value = _roleIdsThatCanBeUsedThisEmojiAsReaction; + if (value == null) return null; + if (_roleIdsThatCanBeUsedThisEmojiAsReaction is EqualUnmodifiableListView) + return _roleIdsThatCanBeUsedThisEmojiAsReaction; + // ignore: implicit_dynamic_type + return EqualUnmodifiableListView(value); + } @override String toString() { - return 'EmojiResponse(id: $id, aliases: $aliases, name: $name, category: $category, host: $host, url: $url, license: $license, isSensitive: $isSensitive, localOnly: $localOnly)'; + return 'EmojiResponse(id: $id, aliases: $aliases, name: $name, category: $category, host: $host, url: $url, license: $license, isSensitive: $isSensitive, localOnly: $localOnly, roleIdsThatCanBeUsedThisEmojiAsReaction: $roleIdsThatCanBeUsedThisEmojiAsReaction)'; } @override @@ -269,7 +298,10 @@ class _$EmojiResponseImpl implements _EmojiResponse { (identical(other.isSensitive, isSensitive) || other.isSensitive == isSensitive) && (identical(other.localOnly, localOnly) || - other.localOnly == localOnly)); + other.localOnly == localOnly) && + const DeepCollectionEquality().equals( + other._roleIdsThatCanBeUsedThisEmojiAsReaction, + _roleIdsThatCanBeUsedThisEmojiAsReaction)); } @JsonKey(ignore: true) @@ -284,7 +316,9 @@ class _$EmojiResponseImpl implements _EmojiResponse { url, license, isSensitive, - localOnly); + localOnly, + const DeepCollectionEquality() + .hash(_roleIdsThatCanBeUsedThisEmojiAsReaction)); @JsonKey(ignore: true) @override @@ -302,15 +336,17 @@ class _$EmojiResponseImpl implements _EmojiResponse { abstract class _EmojiResponse implements EmojiResponse { const factory _EmojiResponse( - {required final String id, - final List aliases, - required final String name, - final String? category, - final String? host, - @NullableUriConverter() required final Uri? url, - final String? license, - final bool isSensitive, - final bool localOnly}) = _$EmojiResponseImpl; + {required final String id, + final List aliases, + required final String name, + final String? category, + final String? host, + @NullableUriConverter() required final Uri? url, + final String? license, + final bool isSensitive, + final bool localOnly, + final List? roleIdsThatCanBeUsedThisEmojiAsReaction}) = + _$EmojiResponseImpl; factory _EmojiResponse.fromJson(Map json) = _$EmojiResponseImpl.fromJson; @@ -335,6 +371,8 @@ abstract class _EmojiResponse implements EmojiResponse { @override bool get localOnly; @override + List? get roleIdsThatCanBeUsedThisEmojiAsReaction; + @override @JsonKey(ignore: true) _$$EmojiResponseImplCopyWith<_$EmojiResponseImpl> get copyWith => throw _privateConstructorUsedError; diff --git a/lib/src/data/emoji_response.g.dart b/lib/src/data/emoji_response.g.dart index d295e482..fda5474a 100644 --- a/lib/src/data/emoji_response.g.dart +++ b/lib/src/data/emoji_response.g.dart @@ -21,6 +21,10 @@ _$EmojiResponseImpl _$$EmojiResponseImplFromJson(Map json) => license: json['license'] as String?, isSensitive: json['isSensitive'] as bool? ?? false, localOnly: json['localOnly'] as bool? ?? false, + roleIdsThatCanBeUsedThisEmojiAsReaction: + (json['roleIdsThatCanBeUsedThisEmojiAsReaction'] as List?) + ?.map((e) => e as String) + .toList(), ); Map _$$EmojiResponseImplToJson(_$EmojiResponseImpl instance) => @@ -34,6 +38,8 @@ Map _$$EmojiResponseImplToJson(_$EmojiResponseImpl instance) => 'license': instance.license, 'isSensitive': instance.isSensitive, 'localOnly': instance.localOnly, + 'roleIdsThatCanBeUsedThisEmojiAsReaction': + instance.roleIdsThatCanBeUsedThisEmojiAsReaction, }; Value? _$JsonConverterFromJson( diff --git a/lib/src/data/emojis_response.dart b/lib/src/data/emojis_response.dart index 4d5b4f01..881bd01e 100644 --- a/lib/src/data/emojis_response.dart +++ b/lib/src/data/emojis_response.dart @@ -21,7 +21,9 @@ class Emoji with _$Emoji { required String name, String? category, @UriConverter() required Uri url, + bool? localOnly, @Default(false) bool isSensitive, + List? roleIdsThatCanBeUsedThisEmojiAsReaction, }) = _Emoji; factory Emoji.fromJson(Map json) => _$EmojiFromJson(json); diff --git a/lib/src/data/emojis_response.freezed.dart b/lib/src/data/emojis_response.freezed.dart index 94f05bc6..c6ef1816 100644 --- a/lib/src/data/emojis_response.freezed.dart +++ b/lib/src/data/emojis_response.freezed.dart @@ -170,7 +170,10 @@ mixin _$Emoji { String? get category => throw _privateConstructorUsedError; @UriConverter() Uri get url => throw _privateConstructorUsedError; + bool? get localOnly => throw _privateConstructorUsedError; bool get isSensitive => throw _privateConstructorUsedError; + List? get roleIdsThatCanBeUsedThisEmojiAsReaction => + throw _privateConstructorUsedError; Map toJson() => throw _privateConstructorUsedError; @JsonKey(ignore: true) @@ -187,7 +190,9 @@ abstract class $EmojiCopyWith<$Res> { String name, String? category, @UriConverter() Uri url, - bool isSensitive}); + bool? localOnly, + bool isSensitive, + List? roleIdsThatCanBeUsedThisEmojiAsReaction}); } /// @nodoc @@ -207,7 +212,9 @@ class _$EmojiCopyWithImpl<$Res, $Val extends Emoji> Object? name = null, Object? category = freezed, Object? url = null, + Object? localOnly = freezed, Object? isSensitive = null, + Object? roleIdsThatCanBeUsedThisEmojiAsReaction = freezed, }) { return _then(_value.copyWith( aliases: null == aliases @@ -226,10 +233,19 @@ class _$EmojiCopyWithImpl<$Res, $Val extends Emoji> ? _value.url : url // ignore: cast_nullable_to_non_nullable as Uri, + localOnly: freezed == localOnly + ? _value.localOnly + : localOnly // ignore: cast_nullable_to_non_nullable + as bool?, isSensitive: null == isSensitive ? _value.isSensitive : isSensitive // ignore: cast_nullable_to_non_nullable as bool, + roleIdsThatCanBeUsedThisEmojiAsReaction: freezed == + roleIdsThatCanBeUsedThisEmojiAsReaction + ? _value.roleIdsThatCanBeUsedThisEmojiAsReaction + : roleIdsThatCanBeUsedThisEmojiAsReaction // ignore: cast_nullable_to_non_nullable + as List?, ) as $Val); } } @@ -246,7 +262,9 @@ abstract class _$$EmojiImplCopyWith<$Res> implements $EmojiCopyWith<$Res> { String name, String? category, @UriConverter() Uri url, - bool isSensitive}); + bool? localOnly, + bool isSensitive, + List? roleIdsThatCanBeUsedThisEmojiAsReaction}); } /// @nodoc @@ -264,7 +282,9 @@ class __$$EmojiImplCopyWithImpl<$Res> Object? name = null, Object? category = freezed, Object? url = null, + Object? localOnly = freezed, Object? isSensitive = null, + Object? roleIdsThatCanBeUsedThisEmojiAsReaction = freezed, }) { return _then(_$EmojiImpl( aliases: null == aliases @@ -283,10 +303,19 @@ class __$$EmojiImplCopyWithImpl<$Res> ? _value.url : url // ignore: cast_nullable_to_non_nullable as Uri, + localOnly: freezed == localOnly + ? _value.localOnly + : localOnly // ignore: cast_nullable_to_non_nullable + as bool?, isSensitive: null == isSensitive ? _value.isSensitive : isSensitive // ignore: cast_nullable_to_non_nullable as bool, + roleIdsThatCanBeUsedThisEmojiAsReaction: freezed == + roleIdsThatCanBeUsedThisEmojiAsReaction + ? _value._roleIdsThatCanBeUsedThisEmojiAsReaction + : roleIdsThatCanBeUsedThisEmojiAsReaction // ignore: cast_nullable_to_non_nullable + as List?, )); } } @@ -299,8 +328,12 @@ class _$EmojiImpl implements _Emoji { required this.name, this.category, @UriConverter() required this.url, - this.isSensitive = false}) - : _aliases = aliases; + this.localOnly, + this.isSensitive = false, + final List? roleIdsThatCanBeUsedThisEmojiAsReaction}) + : _aliases = aliases, + _roleIdsThatCanBeUsedThisEmojiAsReaction = + roleIdsThatCanBeUsedThisEmojiAsReaction; factory _$EmojiImpl.fromJson(Map json) => _$$EmojiImplFromJson(json); @@ -321,12 +354,24 @@ class _$EmojiImpl implements _Emoji { @UriConverter() final Uri url; @override + final bool? localOnly; + @override @JsonKey() final bool isSensitive; + final List? _roleIdsThatCanBeUsedThisEmojiAsReaction; + @override + List? get roleIdsThatCanBeUsedThisEmojiAsReaction { + final value = _roleIdsThatCanBeUsedThisEmojiAsReaction; + if (value == null) return null; + if (_roleIdsThatCanBeUsedThisEmojiAsReaction is EqualUnmodifiableListView) + return _roleIdsThatCanBeUsedThisEmojiAsReaction; + // ignore: implicit_dynamic_type + return EqualUnmodifiableListView(value); + } @override String toString() { - return 'Emoji(aliases: $aliases, name: $name, category: $category, url: $url, isSensitive: $isSensitive)'; + return 'Emoji(aliases: $aliases, name: $name, category: $category, url: $url, localOnly: $localOnly, isSensitive: $isSensitive, roleIdsThatCanBeUsedThisEmojiAsReaction: $roleIdsThatCanBeUsedThisEmojiAsReaction)'; } @override @@ -339,8 +384,13 @@ class _$EmojiImpl implements _Emoji { (identical(other.category, category) || other.category == category) && (identical(other.url, url) || other.url == url) && + (identical(other.localOnly, localOnly) || + other.localOnly == localOnly) && (identical(other.isSensitive, isSensitive) || - other.isSensitive == isSensitive)); + other.isSensitive == isSensitive) && + const DeepCollectionEquality().equals( + other._roleIdsThatCanBeUsedThisEmojiAsReaction, + _roleIdsThatCanBeUsedThisEmojiAsReaction)); } @JsonKey(ignore: true) @@ -351,7 +401,10 @@ class _$EmojiImpl implements _Emoji { name, category, url, - isSensitive); + localOnly, + isSensitive, + const DeepCollectionEquality() + .hash(_roleIdsThatCanBeUsedThisEmojiAsReaction)); @JsonKey(ignore: true) @override @@ -369,11 +422,14 @@ class _$EmojiImpl implements _Emoji { abstract class _Emoji implements Emoji { const factory _Emoji( - {required final List aliases, - required final String name, - final String? category, - @UriConverter() required final Uri url, - final bool isSensitive}) = _$EmojiImpl; + {required final List aliases, + required final String name, + final String? category, + @UriConverter() required final Uri url, + final bool? localOnly, + final bool isSensitive, + final List? roleIdsThatCanBeUsedThisEmojiAsReaction}) = + _$EmojiImpl; factory _Emoji.fromJson(Map json) = _$EmojiImpl.fromJson; @@ -387,8 +443,12 @@ abstract class _Emoji implements Emoji { @UriConverter() Uri get url; @override + bool? get localOnly; + @override bool get isSensitive; @override + List? get roleIdsThatCanBeUsedThisEmojiAsReaction; + @override @JsonKey(ignore: true) _$$EmojiImplCopyWith<_$EmojiImpl> get copyWith => throw _privateConstructorUsedError; diff --git a/lib/src/data/emojis_response.g.dart b/lib/src/data/emojis_response.g.dart index 3c14fd74..a93ce4a5 100644 --- a/lib/src/data/emojis_response.g.dart +++ b/lib/src/data/emojis_response.g.dart @@ -25,7 +25,12 @@ _$EmojiImpl _$$EmojiImplFromJson(Map json) => _$EmojiImpl( name: json['name'] as String, category: json['category'] as String?, url: const UriConverter().fromJson(json['url'] as String), + localOnly: json['localOnly'] as bool?, isSensitive: json['isSensitive'] as bool? ?? false, + roleIdsThatCanBeUsedThisEmojiAsReaction: + (json['roleIdsThatCanBeUsedThisEmojiAsReaction'] as List?) + ?.map((e) => e as String) + .toList(), ); Map _$$EmojiImplToJson(_$EmojiImpl instance) => @@ -34,5 +39,8 @@ Map _$$EmojiImplToJson(_$EmojiImpl instance) => 'name': instance.name, 'category': instance.category, 'url': const UriConverter().toJson(instance.url), + 'localOnly': instance.localOnly, 'isSensitive': instance.isSensitive, + 'roleIdsThatCanBeUsedThisEmojiAsReaction': + instance.roleIdsThatCanBeUsedThisEmojiAsReaction, };