From 1071a6c7427133ad325e670b50370131c58064e4 Mon Sep 17 00:00:00 2001 From: poppingmoon <63451158+poppingmoon@users.noreply.github.com> Date: Tue, 17 Oct 2023 07:08:02 +0900 Subject: [PATCH] =?UTF-8?q?JoinMisskeyInstanceInfo=E3=81=ABmeta=E3=82=92?= =?UTF-8?q?=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/src/data/join_misskey_instances.dart | 1 + .../data/join_misskey_instances.freezed.dart | 64 +++++++++++++------ lib/src/data/join_misskey_instances.g.dart | 2 + 3 files changed, 49 insertions(+), 18 deletions(-) diff --git a/lib/src/data/join_misskey_instances.dart b/lib/src/data/join_misskey_instances.dart index e0dc4321..58756564 100644 --- a/lib/src/data/join_misskey_instances.dart +++ b/lib/src/data/join_misskey_instances.dart @@ -42,6 +42,7 @@ class JoinMisskeyInstanceInfo with _$JoinMisskeyInstanceInfo { @Default(false) bool icon, // ignore: invalid_annotation_target @JsonKey(name: "nodeinfo") JoinMisskeyNodeInfo? nodeInfo, + Map? meta, }) = _JoinMisskeyInstanceInfo; factory JoinMisskeyInstanceInfo.fromJson(Map json) => diff --git a/lib/src/data/join_misskey_instances.freezed.dart b/lib/src/data/join_misskey_instances.freezed.dart index e86de939..a225f92d 100644 --- a/lib/src/data/join_misskey_instances.freezed.dart +++ b/lib/src/data/join_misskey_instances.freezed.dart @@ -436,6 +436,7 @@ mixin _$JoinMisskeyInstanceInfo { throw _privateConstructorUsedError; // ignore: invalid_annotation_target @JsonKey(name: "nodeinfo") JoinMisskeyNodeInfo? get nodeInfo => throw _privateConstructorUsedError; + Map? get meta => throw _privateConstructorUsedError; Map toJson() => throw _privateConstructorUsedError; @JsonKey(ignore: true) @@ -459,7 +460,8 @@ abstract class $JoinMisskeyInstanceInfoCopyWith<$Res> { bool banner, bool background, bool icon, - @JsonKey(name: "nodeinfo") JoinMisskeyNodeInfo? nodeInfo}); + @JsonKey(name: "nodeinfo") JoinMisskeyNodeInfo? nodeInfo, + Map? meta}); $JoinMisskeyNodeInfoCopyWith<$Res>? get nodeInfo; } @@ -488,6 +490,7 @@ class _$JoinMisskeyInstanceInfoCopyWithImpl<$Res, Object? background = null, Object? icon = null, Object? nodeInfo = freezed, + Object? meta = freezed, }) { return _then(_value.copyWith( url: null == url @@ -530,6 +533,10 @@ class _$JoinMisskeyInstanceInfoCopyWithImpl<$Res, ? _value.nodeInfo : nodeInfo // ignore: cast_nullable_to_non_nullable as JoinMisskeyNodeInfo?, + meta: freezed == meta + ? _value.meta + : meta // ignore: cast_nullable_to_non_nullable + as Map?, ) as $Val); } @@ -565,7 +572,8 @@ abstract class _$$JoinMisskeyInstanceInfoImplCopyWith<$Res> bool banner, bool background, bool icon, - @JsonKey(name: "nodeinfo") JoinMisskeyNodeInfo? nodeInfo}); + @JsonKey(name: "nodeinfo") JoinMisskeyNodeInfo? nodeInfo, + Map? meta}); @override $JoinMisskeyNodeInfoCopyWith<$Res>? get nodeInfo; @@ -594,6 +602,7 @@ class __$$JoinMisskeyInstanceInfoImplCopyWithImpl<$Res> Object? background = null, Object? icon = null, Object? nodeInfo = freezed, + Object? meta = freezed, }) { return _then(_$JoinMisskeyInstanceInfoImpl( url: null == url @@ -636,6 +645,10 @@ class __$$JoinMisskeyInstanceInfoImplCopyWithImpl<$Res> ? _value.nodeInfo : nodeInfo // ignore: cast_nullable_to_non_nullable as JoinMisskeyNodeInfo?, + meta: freezed == meta + ? _value._meta + : meta // ignore: cast_nullable_to_non_nullable + as Map?, )); } } @@ -653,8 +666,10 @@ class _$JoinMisskeyInstanceInfoImpl implements _JoinMisskeyInstanceInfo { this.banner = false, this.background = false, this.icon = false, - @JsonKey(name: "nodeinfo") this.nodeInfo}) - : _langs = langs; + @JsonKey(name: "nodeinfo") this.nodeInfo, + final Map? meta}) + : _langs = langs, + _meta = meta; factory _$JoinMisskeyInstanceInfoImpl.fromJson(Map json) => _$$JoinMisskeyInstanceInfoImplFromJson(json); @@ -690,10 +705,19 @@ class _$JoinMisskeyInstanceInfoImpl implements _JoinMisskeyInstanceInfo { @override @JsonKey(name: "nodeinfo") final JoinMisskeyNodeInfo? nodeInfo; + final Map? _meta; + @override + Map? get meta { + final value = _meta; + if (value == null) return null; + if (_meta is EqualUnmodifiableMapView) return _meta; + // ignore: implicit_dynamic_type + return EqualUnmodifiableMapView(value); + } @override String toString() { - return 'JoinMisskeyInstanceInfo(url: $url, name: $name, langs: $langs, description: $description, isAlive: $isAlive, value: $value, banner: $banner, background: $background, icon: $icon, nodeInfo: $nodeInfo)'; + return 'JoinMisskeyInstanceInfo(url: $url, name: $name, langs: $langs, description: $description, isAlive: $isAlive, value: $value, banner: $banner, background: $background, icon: $icon, nodeInfo: $nodeInfo, meta: $meta)'; } @override @@ -713,7 +737,8 @@ class _$JoinMisskeyInstanceInfoImpl implements _JoinMisskeyInstanceInfo { other.background == background) && (identical(other.icon, icon) || other.icon == icon) && (identical(other.nodeInfo, nodeInfo) || - other.nodeInfo == nodeInfo)); + other.nodeInfo == nodeInfo) && + const DeepCollectionEquality().equals(other._meta, _meta)); } @JsonKey(ignore: true) @@ -729,7 +754,8 @@ class _$JoinMisskeyInstanceInfoImpl implements _JoinMisskeyInstanceInfo { banner, background, icon, - nodeInfo); + nodeInfo, + const DeepCollectionEquality().hash(_meta)); @JsonKey(ignore: true) @override @@ -748,17 +774,17 @@ class _$JoinMisskeyInstanceInfoImpl implements _JoinMisskeyInstanceInfo { abstract class _JoinMisskeyInstanceInfo implements JoinMisskeyInstanceInfo { const factory _JoinMisskeyInstanceInfo( - {required final String url, - required final String name, - required final List langs, - required final String? description, - required final bool isAlive, - required final double value, - final bool banner, - final bool background, - final bool icon, - @JsonKey(name: "nodeinfo") final JoinMisskeyNodeInfo? nodeInfo}) = - _$JoinMisskeyInstanceInfoImpl; + {required final String url, + required final String name, + required final List langs, + required final String? description, + required final bool isAlive, + required final double value, + final bool banner, + final bool background, + final bool icon, + @JsonKey(name: "nodeinfo") final JoinMisskeyNodeInfo? nodeInfo, + final Map? meta}) = _$JoinMisskeyInstanceInfoImpl; factory _JoinMisskeyInstanceInfo.fromJson(Map json) = _$JoinMisskeyInstanceInfoImpl.fromJson; @@ -785,6 +811,8 @@ abstract class _JoinMisskeyInstanceInfo implements JoinMisskeyInstanceInfo { @JsonKey(name: "nodeinfo") JoinMisskeyNodeInfo? get nodeInfo; @override + Map? get meta; + @override @JsonKey(ignore: true) _$$JoinMisskeyInstanceInfoImplCopyWith<_$JoinMisskeyInstanceInfoImpl> get copyWith => throw _privateConstructorUsedError; diff --git a/lib/src/data/join_misskey_instances.g.dart b/lib/src/data/join_misskey_instances.g.dart index 9e4d5b96..2c74c172 100644 --- a/lib/src/data/join_misskey_instances.g.dart +++ b/lib/src/data/join_misskey_instances.g.dart @@ -59,6 +59,7 @@ _$JoinMisskeyInstanceInfoImpl _$$JoinMisskeyInstanceInfoImplFromJson( ? null : JoinMisskeyNodeInfo.fromJson( json['nodeinfo'] as Map), + meta: json['meta'] as Map?, ); Map _$$JoinMisskeyInstanceInfoImplToJson( @@ -74,6 +75,7 @@ Map _$$JoinMisskeyInstanceInfoImplToJson( 'background': instance.background, 'icon': instance.icon, 'nodeinfo': instance.nodeInfo?.toJson(), + 'meta': instance.meta, }; _$JoinMisskeyNodeInfoImpl _$$JoinMisskeyNodeInfoImplFromJson(