From 99071bed0df791e85b28d65b0ce14873175b7d9f Mon Sep 17 00:00:00 2001 From: poppingmoon <63451158+poppingmoon@users.noreply.github.com> Date: Tue, 28 May 2024 18:57:25 +0900 Subject: [PATCH] =?UTF-8?q?Antenna=E3=81=AEnotify=E3=82=92nullable?= =?UTF-8?q?=E3=81=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../antennas/antennas_create_request.dart | 3 +- .../antennas_create_request.freezed.dart | 32 ++++++++++--------- .../antennas/antennas_create_request.g.dart | 2 +- .../antennas/antennas_update_request.dart | 3 +- .../antennas_update_request.freezed.dart | 32 ++++++++++--------- .../antennas/antennas_update_request.g.dart | 2 +- lib/src/data/base/antenna.dart | 2 +- lib/src/data/base/antenna.freezed.dart | 5 +-- lib/src/data/base/antenna.g.dart | 2 +- 9 files changed, 45 insertions(+), 38 deletions(-) diff --git a/lib/src/data/antennas/antennas_create_request.dart b/lib/src/data/antennas/antennas_create_request.dart index e5707c13..ac1294d8 100644 --- a/lib/src/data/antennas/antennas_create_request.dart +++ b/lib/src/data/antennas/antennas_create_request.dart @@ -16,7 +16,8 @@ class AntennasCreateRequest with _$AntennasCreateRequest { required bool caseSensitive, required bool withReplies, required bool withFile, - required bool notify, + // Removed in Misskey 2024.5.0 + bool? notify, bool? localOnly, }) = _AntennasCreateRequest; diff --git a/lib/src/data/antennas/antennas_create_request.freezed.dart b/lib/src/data/antennas/antennas_create_request.freezed.dart index 79bcf725..4ba7f835 100644 --- a/lib/src/data/antennas/antennas_create_request.freezed.dart +++ b/lib/src/data/antennas/antennas_create_request.freezed.dart @@ -29,8 +29,9 @@ mixin _$AntennasCreateRequest { List get users => throw _privateConstructorUsedError; bool get caseSensitive => throw _privateConstructorUsedError; bool get withReplies => throw _privateConstructorUsedError; - bool get withFile => throw _privateConstructorUsedError; - bool get notify => throw _privateConstructorUsedError; + bool get withFile => + throw _privateConstructorUsedError; // Removed in Misskey 2024.5.0 + bool? get notify => throw _privateConstructorUsedError; bool? get localOnly => throw _privateConstructorUsedError; Map toJson() => throw _privateConstructorUsedError; @@ -55,7 +56,7 @@ abstract class $AntennasCreateRequestCopyWith<$Res> { bool caseSensitive, bool withReplies, bool withFile, - bool notify, + bool? notify, bool? localOnly}); } @@ -82,7 +83,7 @@ class _$AntennasCreateRequestCopyWithImpl<$Res, Object? caseSensitive = null, Object? withReplies = null, Object? withFile = null, - Object? notify = null, + Object? notify = freezed, Object? localOnly = freezed, }) { return _then(_value.copyWith( @@ -122,10 +123,10 @@ class _$AntennasCreateRequestCopyWithImpl<$Res, ? _value.withFile : withFile // ignore: cast_nullable_to_non_nullable as bool, - notify: null == notify + notify: freezed == notify ? _value.notify : notify // ignore: cast_nullable_to_non_nullable - as bool, + as bool?, localOnly: freezed == localOnly ? _value.localOnly : localOnly // ignore: cast_nullable_to_non_nullable @@ -153,7 +154,7 @@ abstract class _$$AntennasCreateRequestImplCopyWith<$Res> bool caseSensitive, bool withReplies, bool withFile, - bool notify, + bool? notify, bool? localOnly}); } @@ -178,7 +179,7 @@ class __$$AntennasCreateRequestImplCopyWithImpl<$Res> Object? caseSensitive = null, Object? withReplies = null, Object? withFile = null, - Object? notify = null, + Object? notify = freezed, Object? localOnly = freezed, }) { return _then(_$AntennasCreateRequestImpl( @@ -218,10 +219,10 @@ class __$$AntennasCreateRequestImplCopyWithImpl<$Res> ? _value.withFile : withFile // ignore: cast_nullable_to_non_nullable as bool, - notify: null == notify + notify: freezed == notify ? _value.notify : notify // ignore: cast_nullable_to_non_nullable - as bool, + as bool?, localOnly: freezed == localOnly ? _value.localOnly : localOnly // ignore: cast_nullable_to_non_nullable @@ -243,7 +244,7 @@ class _$AntennasCreateRequestImpl implements _AntennasCreateRequest { required this.caseSensitive, required this.withReplies, required this.withFile, - required this.notify, + this.notify, this.localOnly}) : _keywords = keywords, _excludeKeywords = excludeKeywords, @@ -288,8 +289,9 @@ class _$AntennasCreateRequestImpl implements _AntennasCreateRequest { final bool withReplies; @override final bool withFile; +// Removed in Misskey 2024.5.0 @override - final bool notify; + final bool? notify; @override final bool? localOnly; @@ -364,7 +366,7 @@ abstract class _AntennasCreateRequest implements AntennasCreateRequest { required final bool caseSensitive, required final bool withReplies, required final bool withFile, - required final bool notify, + final bool? notify, final bool? localOnly}) = _$AntennasCreateRequestImpl; factory _AntennasCreateRequest.fromJson(Map json) = @@ -388,8 +390,8 @@ abstract class _AntennasCreateRequest implements AntennasCreateRequest { bool get withReplies; @override bool get withFile; - @override - bool get notify; + @override // Removed in Misskey 2024.5.0 + bool? get notify; @override bool? get localOnly; @override diff --git a/lib/src/data/antennas/antennas_create_request.g.dart b/lib/src/data/antennas/antennas_create_request.g.dart index 5e7ed56b..730e5296 100644 --- a/lib/src/data/antennas/antennas_create_request.g.dart +++ b/lib/src/data/antennas/antennas_create_request.g.dart @@ -22,7 +22,7 @@ _$AntennasCreateRequestImpl _$$AntennasCreateRequestImplFromJson( caseSensitive: json['caseSensitive'] as bool, withReplies: json['withReplies'] as bool, withFile: json['withFile'] as bool, - notify: json['notify'] as bool, + notify: json['notify'] as bool?, localOnly: json['localOnly'] as bool?, ); diff --git a/lib/src/data/antennas/antennas_update_request.dart b/lib/src/data/antennas/antennas_update_request.dart index 1a4192b6..490562f6 100644 --- a/lib/src/data/antennas/antennas_update_request.dart +++ b/lib/src/data/antennas/antennas_update_request.dart @@ -17,7 +17,8 @@ class AntennasUpdateRequest with _$AntennasUpdateRequest { required bool caseSensitive, required bool withReplies, required bool withFile, - required bool notify, + // Removed in Misskey 2024.5.0 + bool? notify, bool? localOnly, }) = _AntennasUpdateRequest; diff --git a/lib/src/data/antennas/antennas_update_request.freezed.dart b/lib/src/data/antennas/antennas_update_request.freezed.dart index d7a8c290..12f5b918 100644 --- a/lib/src/data/antennas/antennas_update_request.freezed.dart +++ b/lib/src/data/antennas/antennas_update_request.freezed.dart @@ -30,8 +30,9 @@ mixin _$AntennasUpdateRequest { List get users => throw _privateConstructorUsedError; bool get caseSensitive => throw _privateConstructorUsedError; bool get withReplies => throw _privateConstructorUsedError; - bool get withFile => throw _privateConstructorUsedError; - bool get notify => throw _privateConstructorUsedError; + bool get withFile => + throw _privateConstructorUsedError; // Removed in Misskey 2024.5.0 + bool? get notify => throw _privateConstructorUsedError; bool? get localOnly => throw _privateConstructorUsedError; Map toJson() => throw _privateConstructorUsedError; @@ -57,7 +58,7 @@ abstract class $AntennasUpdateRequestCopyWith<$Res> { bool caseSensitive, bool withReplies, bool withFile, - bool notify, + bool? notify, bool? localOnly}); } @@ -85,7 +86,7 @@ class _$AntennasUpdateRequestCopyWithImpl<$Res, Object? caseSensitive = null, Object? withReplies = null, Object? withFile = null, - Object? notify = null, + Object? notify = freezed, Object? localOnly = freezed, }) { return _then(_value.copyWith( @@ -129,10 +130,10 @@ class _$AntennasUpdateRequestCopyWithImpl<$Res, ? _value.withFile : withFile // ignore: cast_nullable_to_non_nullable as bool, - notify: null == notify + notify: freezed == notify ? _value.notify : notify // ignore: cast_nullable_to_non_nullable - as bool, + as bool?, localOnly: freezed == localOnly ? _value.localOnly : localOnly // ignore: cast_nullable_to_non_nullable @@ -161,7 +162,7 @@ abstract class _$$AntennasUpdateRequestImplCopyWith<$Res> bool caseSensitive, bool withReplies, bool withFile, - bool notify, + bool? notify, bool? localOnly}); } @@ -187,7 +188,7 @@ class __$$AntennasUpdateRequestImplCopyWithImpl<$Res> Object? caseSensitive = null, Object? withReplies = null, Object? withFile = null, - Object? notify = null, + Object? notify = freezed, Object? localOnly = freezed, }) { return _then(_$AntennasUpdateRequestImpl( @@ -231,10 +232,10 @@ class __$$AntennasUpdateRequestImplCopyWithImpl<$Res> ? _value.withFile : withFile // ignore: cast_nullable_to_non_nullable as bool, - notify: null == notify + notify: freezed == notify ? _value.notify : notify // ignore: cast_nullable_to_non_nullable - as bool, + as bool?, localOnly: freezed == localOnly ? _value.localOnly : localOnly // ignore: cast_nullable_to_non_nullable @@ -257,7 +258,7 @@ class _$AntennasUpdateRequestImpl implements _AntennasUpdateRequest { required this.caseSensitive, required this.withReplies, required this.withFile, - required this.notify, + this.notify, this.localOnly}) : _keywords = keywords, _excludeKeywords = excludeKeywords, @@ -304,8 +305,9 @@ class _$AntennasUpdateRequestImpl implements _AntennasUpdateRequest { final bool withReplies; @override final bool withFile; +// Removed in Misskey 2024.5.0 @override - final bool notify; + final bool? notify; @override final bool? localOnly; @@ -384,7 +386,7 @@ abstract class _AntennasUpdateRequest implements AntennasUpdateRequest { required final bool caseSensitive, required final bool withReplies, required final bool withFile, - required final bool notify, + final bool? notify, final bool? localOnly}) = _$AntennasUpdateRequestImpl; factory _AntennasUpdateRequest.fromJson(Map json) = @@ -410,8 +412,8 @@ abstract class _AntennasUpdateRequest implements AntennasUpdateRequest { bool get withReplies; @override bool get withFile; - @override - bool get notify; + @override // Removed in Misskey 2024.5.0 + bool? get notify; @override bool? get localOnly; @override diff --git a/lib/src/data/antennas/antennas_update_request.g.dart b/lib/src/data/antennas/antennas_update_request.g.dart index ca801ee0..3d3b0c92 100644 --- a/lib/src/data/antennas/antennas_update_request.g.dart +++ b/lib/src/data/antennas/antennas_update_request.g.dart @@ -23,7 +23,7 @@ _$AntennasUpdateRequestImpl _$$AntennasUpdateRequestImplFromJson( caseSensitive: json['caseSensitive'] as bool, withReplies: json['withReplies'] as bool, withFile: json['withFile'] as bool, - notify: json['notify'] as bool, + notify: json['notify'] as bool?, localOnly: json['localOnly'] as bool?, ); diff --git a/lib/src/data/base/antenna.dart b/lib/src/data/base/antenna.dart index 9de6f358..d2ce71f1 100644 --- a/lib/src/data/base/antenna.dart +++ b/lib/src/data/base/antenna.dart @@ -17,7 +17,7 @@ class Antenna with _$Antenna { String? userListId, required List users, required bool caseSensitive, - required bool notify, + @Default(false) bool notify, required bool withReplies, required bool withFile, required bool isActive, diff --git a/lib/src/data/base/antenna.freezed.dart b/lib/src/data/base/antenna.freezed.dart index 91324344..685ca145 100644 --- a/lib/src/data/base/antenna.freezed.dart +++ b/lib/src/data/base/antenna.freezed.dart @@ -289,7 +289,7 @@ class _$AntennaImpl implements _Antenna { this.userListId, required final List users, required this.caseSensitive, - required this.notify, + this.notify = false, required this.withReplies, required this.withFile, required this.isActive, @@ -340,6 +340,7 @@ class _$AntennaImpl implements _Antenna { @override final bool caseSensitive; @override + @JsonKey() final bool notify; @override final bool withReplies; @@ -433,7 +434,7 @@ abstract class _Antenna implements Antenna { final String? userListId, required final List users, required final bool caseSensitive, - required final bool notify, + final bool notify, required final bool withReplies, required final bool withFile, required final bool isActive, diff --git a/lib/src/data/base/antenna.g.dart b/lib/src/data/base/antenna.g.dart index 66d91154..dbb39202 100644 --- a/lib/src/data/base/antenna.g.dart +++ b/lib/src/data/base/antenna.g.dart @@ -22,7 +22,7 @@ _$AntennaImpl _$$AntennaImplFromJson(Map json) => userListId: json['userListId'] as String?, users: (json['users'] as List).map((e) => e as String).toList(), caseSensitive: json['caseSensitive'] as bool, - notify: json['notify'] as bool, + notify: json['notify'] as bool? ?? false, withReplies: json['withReplies'] as bool, withFile: json['withFile'] as bool, isActive: json['isActive'] as bool,