Skip to content

Commit

Permalink
ノートのピン留めに対応
Browse files Browse the repository at this point in the history
  • Loading branch information
poppingmoon committed Mar 30, 2024
1 parent 7059829 commit ad1d046
Show file tree
Hide file tree
Showing 9 changed files with 398 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/misskey_dart.dart
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,8 @@ export 'src/data/i/i_favorites_response.dart';
export 'src/data/i/i_page_likes_request.dart';
export 'src/data/i/i_page_likes_response.dart';
export 'src/data/i/i_pages_request.dart';
export 'src/data/i/i_pin_request.dart';
export 'src/data/i/i_unpin_request.dart';
export 'src/data/i/i_update_request.dart';
export 'src/data/i/i_read_announcement_request.dart';
export 'src/data/i/registry/i_registry_get_all_request.dart';
Expand Down
14 changes: 14 additions & 0 deletions lib/src/data/i/i_pin_request.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import 'package:freezed_annotation/freezed_annotation.dart';

part 'i_pin_request.freezed.dart';
part 'i_pin_request.g.dart';

@freezed
class IPinRequest with _$IPinRequest {
const factory IPinRequest({
required String noteId,
}) = _IPinRequest;

factory IPinRequest.fromJson(Map<String, Object?> json) =>
_$IPinRequestFromJson(json);
}
152 changes: 152 additions & 0 deletions lib/src/data/i/i_pin_request.freezed.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,152 @@
// 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 'i_pin_request.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');

IPinRequest _$IPinRequestFromJson(Map<String, dynamic> json) {
return _IPinRequest.fromJson(json);
}

/// @nodoc
mixin _$IPinRequest {
String get noteId => throw _privateConstructorUsedError;

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

/// @nodoc
abstract class $IPinRequestCopyWith<$Res> {
factory $IPinRequestCopyWith(
IPinRequest value, $Res Function(IPinRequest) then) =
_$IPinRequestCopyWithImpl<$Res, IPinRequest>;
@useResult
$Res call({String noteId});
}

/// @nodoc
class _$IPinRequestCopyWithImpl<$Res, $Val extends IPinRequest>
implements $IPinRequestCopyWith<$Res> {
_$IPinRequestCopyWithImpl(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? noteId = null,
}) {
return _then(_value.copyWith(
noteId: null == noteId
? _value.noteId
: noteId // ignore: cast_nullable_to_non_nullable
as String,
) as $Val);
}
}

/// @nodoc
abstract class _$$IPinRequestImplCopyWith<$Res>
implements $IPinRequestCopyWith<$Res> {
factory _$$IPinRequestImplCopyWith(
_$IPinRequestImpl value, $Res Function(_$IPinRequestImpl) then) =
__$$IPinRequestImplCopyWithImpl<$Res>;
@override
@useResult
$Res call({String noteId});
}

/// @nodoc
class __$$IPinRequestImplCopyWithImpl<$Res>
extends _$IPinRequestCopyWithImpl<$Res, _$IPinRequestImpl>
implements _$$IPinRequestImplCopyWith<$Res> {
__$$IPinRequestImplCopyWithImpl(
_$IPinRequestImpl _value, $Res Function(_$IPinRequestImpl) _then)
: super(_value, _then);

@pragma('vm:prefer-inline')
@override
$Res call({
Object? noteId = null,
}) {
return _then(_$IPinRequestImpl(
noteId: null == noteId
? _value.noteId
: noteId // ignore: cast_nullable_to_non_nullable
as String,
));
}
}

/// @nodoc
@JsonSerializable()
class _$IPinRequestImpl implements _IPinRequest {
const _$IPinRequestImpl({required this.noteId});

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

@override
final String noteId;

@override
String toString() {
return 'IPinRequest(noteId: $noteId)';
}

@override
bool operator ==(Object other) {
return identical(this, other) ||
(other.runtimeType == runtimeType &&
other is _$IPinRequestImpl &&
(identical(other.noteId, noteId) || other.noteId == noteId));
}

@JsonKey(ignore: true)
@override
int get hashCode => Object.hash(runtimeType, noteId);

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

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

abstract class _IPinRequest implements IPinRequest {
const factory _IPinRequest({required final String noteId}) =
_$IPinRequestImpl;

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

@override
String get noteId;
@override
@JsonKey(ignore: true)
_$$IPinRequestImplCopyWith<_$IPinRequestImpl> get copyWith =>
throw _privateConstructorUsedError;
}
17 changes: 17 additions & 0 deletions lib/src/data/i/i_pin_request.g.dart

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

14 changes: 14 additions & 0 deletions lib/src/data/i/i_unpin_request.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import 'package:freezed_annotation/freezed_annotation.dart';

part 'i_unpin_request.freezed.dart';
part 'i_unpin_request.g.dart';

@freezed
class IUnpinRequest with _$IUnpinRequest {
const factory IUnpinRequest({
required String noteId,
}) = _IUnpinRequest;

factory IUnpinRequest.fromJson(Map<String, Object?> json) =>
_$IUnpinRequestFromJson(json);
}
152 changes: 152 additions & 0 deletions lib/src/data/i/i_unpin_request.freezed.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,152 @@
// 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 'i_unpin_request.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');

IUnpinRequest _$IUnpinRequestFromJson(Map<String, dynamic> json) {
return _IUnpinRequest.fromJson(json);
}

/// @nodoc
mixin _$IUnpinRequest {
String get noteId => throw _privateConstructorUsedError;

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

/// @nodoc
abstract class $IUnpinRequestCopyWith<$Res> {
factory $IUnpinRequestCopyWith(
IUnpinRequest value, $Res Function(IUnpinRequest) then) =
_$IUnpinRequestCopyWithImpl<$Res, IUnpinRequest>;
@useResult
$Res call({String noteId});
}

/// @nodoc
class _$IUnpinRequestCopyWithImpl<$Res, $Val extends IUnpinRequest>
implements $IUnpinRequestCopyWith<$Res> {
_$IUnpinRequestCopyWithImpl(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? noteId = null,
}) {
return _then(_value.copyWith(
noteId: null == noteId
? _value.noteId
: noteId // ignore: cast_nullable_to_non_nullable
as String,
) as $Val);
}
}

/// @nodoc
abstract class _$$IUnpinRequestImplCopyWith<$Res>
implements $IUnpinRequestCopyWith<$Res> {
factory _$$IUnpinRequestImplCopyWith(
_$IUnpinRequestImpl value, $Res Function(_$IUnpinRequestImpl) then) =
__$$IUnpinRequestImplCopyWithImpl<$Res>;
@override
@useResult
$Res call({String noteId});
}

/// @nodoc
class __$$IUnpinRequestImplCopyWithImpl<$Res>
extends _$IUnpinRequestCopyWithImpl<$Res, _$IUnpinRequestImpl>
implements _$$IUnpinRequestImplCopyWith<$Res> {
__$$IUnpinRequestImplCopyWithImpl(
_$IUnpinRequestImpl _value, $Res Function(_$IUnpinRequestImpl) _then)
: super(_value, _then);

@pragma('vm:prefer-inline')
@override
$Res call({
Object? noteId = null,
}) {
return _then(_$IUnpinRequestImpl(
noteId: null == noteId
? _value.noteId
: noteId // ignore: cast_nullable_to_non_nullable
as String,
));
}
}

/// @nodoc
@JsonSerializable()
class _$IUnpinRequestImpl implements _IUnpinRequest {
const _$IUnpinRequestImpl({required this.noteId});

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

@override
final String noteId;

@override
String toString() {
return 'IUnpinRequest(noteId: $noteId)';
}

@override
bool operator ==(Object other) {
return identical(this, other) ||
(other.runtimeType == runtimeType &&
other is _$IUnpinRequestImpl &&
(identical(other.noteId, noteId) || other.noteId == noteId));
}

@JsonKey(ignore: true)
@override
int get hashCode => Object.hash(runtimeType, noteId);

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

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

abstract class _IUnpinRequest implements IUnpinRequest {
const factory _IUnpinRequest({required final String noteId}) =
_$IUnpinRequestImpl;

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

@override
String get noteId;
@override
@JsonKey(ignore: true)
_$$IUnpinRequestImplCopyWith<_$IUnpinRequestImpl> get copyWith =>
throw _privateConstructorUsedError;
}
17 changes: 17 additions & 0 deletions lib/src/data/i/i_unpin_request.g.dart

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

Loading

0 comments on commit ad1d046

Please sign in to comment.