Skip to content

Commit

Permalink
Merge pull request #46 from poppingmoon/mute-list
Browse files Browse the repository at this point in the history
ブロックとミュートのリストに対応
  • Loading branch information
shiosyakeyakini-info authored Mar 30, 2024
2 parents 3938d0f + d1d32b9 commit fed9bf1
Show file tree
Hide file tree
Showing 25 changed files with 1,590 additions and 6 deletions.
6 changes: 6 additions & 0 deletions lib/misskey_dart.dart
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,10 @@ export 'src/data/antennas/antennas_show_request.dart';
export 'src/data/antennas/antennas_update_request.dart';
export 'src/data/ap/ap_show_request.dart';
export 'src/data/ap/ap_show_response.dart';
export 'src/data/base/blocking.dart';
export 'src/data/base/muting.dart';
export 'src/data/base/note.dart';
export 'src/data/base/renote_muting.dart';
export 'src/data/base/user.dart';
export 'src/data/base/clip.dart';
export 'src/data/base/antenna.dart';
Expand Down Expand Up @@ -192,10 +195,13 @@ export 'src/data/users/users_get_frequently_replied_users_request.dart';
export 'src/data/users/users_get_frequently_replied_users_response.dart';
export 'src/data/block/block_create_request.dart';
export 'src/data/block/block_delete_request.dart';
export 'src/data/block/blocking_list_request.dart';
export 'src/data/renote_mute/renote_mute_create_request.dart';
export 'src/data/renote_mute/renote_mute_delete_request.dart';
export 'src/data/renote_mute/renote_mute_list_request.dart';
export 'src/data/mute/mute_create_request.dart';
export 'src/data/mute/mute_delete_request.dart';
export 'src/data/mute/mute_list_request.dart';
export 'src/data/roles/roles_list_response.dart';
export 'src/data/roles/roles_notes_request.dart';
export 'src/data/roles/roles_show_request.dart';
Expand Down
19 changes: 19 additions & 0 deletions lib/src/data/base/blocking.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import 'package:freezed_annotation/freezed_annotation.dart';
import 'package:misskey_dart/misskey_dart.dart';
import 'package:misskey_dart/src/converters/date_time_converter.dart';

part 'blocking.freezed.dart';
part 'blocking.g.dart';

@freezed
class Blocking with _$Blocking {
const factory Blocking({
required String id,
@DateTimeConverter() required DateTime createdAt,
required String blockeeId,
required UserDetailedNotMe blockee,
}) = _Blocking;

factory Blocking.fromJson(Map<String, dynamic> json) =>
_$BlockingFromJson(json);
}
233 changes: 233 additions & 0 deletions lib/src/data/base/blocking.freezed.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,233 @@
// coverage:ignore-file
// GENERATED CODE - DO NOT MODIFY BY HAND
// ignore_for_file: type=lint
// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark

part of 'blocking.dart';

// **************************************************************************
// FreezedGenerator
// **************************************************************************

T _$identity<T>(T value) => value;

final _privateConstructorUsedError = UnsupportedError(
'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#custom-getters-and-methods');

Blocking _$BlockingFromJson(Map<String, dynamic> json) {
return _Blocking.fromJson(json);
}

/// @nodoc
mixin _$Blocking {
String get id => throw _privateConstructorUsedError;
@DateTimeConverter()
DateTime get createdAt => throw _privateConstructorUsedError;
String get blockeeId => throw _privateConstructorUsedError;
UserDetailedNotMe get blockee => throw _privateConstructorUsedError;

Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
@JsonKey(ignore: true)
$BlockingCopyWith<Blocking> get copyWith =>
throw _privateConstructorUsedError;
}

/// @nodoc
abstract class $BlockingCopyWith<$Res> {
factory $BlockingCopyWith(Blocking value, $Res Function(Blocking) then) =
_$BlockingCopyWithImpl<$Res, Blocking>;
@useResult
$Res call(
{String id,
@DateTimeConverter() DateTime createdAt,
String blockeeId,
UserDetailedNotMe blockee});

$UserDetailedNotMeCopyWith<$Res> get blockee;
}

/// @nodoc
class _$BlockingCopyWithImpl<$Res, $Val extends Blocking>
implements $BlockingCopyWith<$Res> {
_$BlockingCopyWithImpl(this._value, this._then);

// ignore: unused_field
final $Val _value;
// ignore: unused_field
final $Res Function($Val) _then;

@pragma('vm:prefer-inline')
@override
$Res call({
Object? id = null,
Object? createdAt = null,
Object? blockeeId = null,
Object? blockee = null,
}) {
return _then(_value.copyWith(
id: null == id
? _value.id
: id // ignore: cast_nullable_to_non_nullable
as String,
createdAt: null == createdAt
? _value.createdAt
: createdAt // ignore: cast_nullable_to_non_nullable
as DateTime,
blockeeId: null == blockeeId
? _value.blockeeId
: blockeeId // ignore: cast_nullable_to_non_nullable
as String,
blockee: null == blockee
? _value.blockee
: blockee // ignore: cast_nullable_to_non_nullable
as UserDetailedNotMe,
) as $Val);
}

@override
@pragma('vm:prefer-inline')
$UserDetailedNotMeCopyWith<$Res> get blockee {
return $UserDetailedNotMeCopyWith<$Res>(_value.blockee, (value) {
return _then(_value.copyWith(blockee: value) as $Val);
});
}
}

/// @nodoc
abstract class _$$BlockingImplCopyWith<$Res>
implements $BlockingCopyWith<$Res> {
factory _$$BlockingImplCopyWith(
_$BlockingImpl value, $Res Function(_$BlockingImpl) then) =
__$$BlockingImplCopyWithImpl<$Res>;
@override
@useResult
$Res call(
{String id,
@DateTimeConverter() DateTime createdAt,
String blockeeId,
UserDetailedNotMe blockee});

@override
$UserDetailedNotMeCopyWith<$Res> get blockee;
}

/// @nodoc
class __$$BlockingImplCopyWithImpl<$Res>
extends _$BlockingCopyWithImpl<$Res, _$BlockingImpl>
implements _$$BlockingImplCopyWith<$Res> {
__$$BlockingImplCopyWithImpl(
_$BlockingImpl _value, $Res Function(_$BlockingImpl) _then)
: super(_value, _then);

@pragma('vm:prefer-inline')
@override
$Res call({
Object? id = null,
Object? createdAt = null,
Object? blockeeId = null,
Object? blockee = null,
}) {
return _then(_$BlockingImpl(
id: null == id
? _value.id
: id // ignore: cast_nullable_to_non_nullable
as String,
createdAt: null == createdAt
? _value.createdAt
: createdAt // ignore: cast_nullable_to_non_nullable
as DateTime,
blockeeId: null == blockeeId
? _value.blockeeId
: blockeeId // ignore: cast_nullable_to_non_nullable
as String,
blockee: null == blockee
? _value.blockee
: blockee // ignore: cast_nullable_to_non_nullable
as UserDetailedNotMe,
));
}
}

/// @nodoc
@JsonSerializable()
class _$BlockingImpl implements _Blocking {
const _$BlockingImpl(
{required this.id,
@DateTimeConverter() required this.createdAt,
required this.blockeeId,
required this.blockee});

factory _$BlockingImpl.fromJson(Map<String, dynamic> json) =>
_$$BlockingImplFromJson(json);

@override
final String id;
@override
@DateTimeConverter()
final DateTime createdAt;
@override
final String blockeeId;
@override
final UserDetailedNotMe blockee;

@override
String toString() {
return 'Blocking(id: $id, createdAt: $createdAt, blockeeId: $blockeeId, blockee: $blockee)';
}

@override
bool operator ==(Object other) {
return identical(this, other) ||
(other.runtimeType == runtimeType &&
other is _$BlockingImpl &&
(identical(other.id, id) || other.id == id) &&
(identical(other.createdAt, createdAt) ||
other.createdAt == createdAt) &&
(identical(other.blockeeId, blockeeId) ||
other.blockeeId == blockeeId) &&
(identical(other.blockee, blockee) || other.blockee == blockee));
}

@JsonKey(ignore: true)
@override
int get hashCode =>
Object.hash(runtimeType, id, createdAt, blockeeId, blockee);

@JsonKey(ignore: true)
@override
@pragma('vm:prefer-inline')
_$$BlockingImplCopyWith<_$BlockingImpl> get copyWith =>
__$$BlockingImplCopyWithImpl<_$BlockingImpl>(this, _$identity);

@override
Map<String, dynamic> toJson() {
return _$$BlockingImplToJson(
this,
);
}
}

abstract class _Blocking implements Blocking {
const factory _Blocking(
{required final String id,
@DateTimeConverter() required final DateTime createdAt,
required final String blockeeId,
required final UserDetailedNotMe blockee}) = _$BlockingImpl;

factory _Blocking.fromJson(Map<String, dynamic> json) =
_$BlockingImpl.fromJson;

@override
String get id;
@override
@DateTimeConverter()
DateTime get createdAt;
@override
String get blockeeId;
@override
UserDetailedNotMe get blockee;
@override
@JsonKey(ignore: true)
_$$BlockingImplCopyWith<_$BlockingImpl> get copyWith =>
throw _privateConstructorUsedError;
}
25 changes: 25 additions & 0 deletions lib/src/data/base/blocking.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 19 additions & 0 deletions lib/src/data/base/muting.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import 'package:freezed_annotation/freezed_annotation.dart';
import 'package:misskey_dart/misskey_dart.dart';
import 'package:misskey_dart/src/converters/date_time_converter.dart';

part 'muting.freezed.dart';
part 'muting.g.dart';

@freezed
class Muting with _$Muting {
const factory Muting({
required String id,
@DateTimeConverter() required DateTime createdAt,
@NullableDateTimeConverter() DateTime? expiresAt,
required String muteeId,
required UserDetailedNotMe mutee,
}) = _Muting;

factory Muting.fromJson(Map<String, dynamic> json) => _$MutingFromJson(json);
}
Loading

0 comments on commit fed9bf1

Please sign in to comment.