Skip to content

Commit

Permalink
Merge pull request #53 from poppingmoon/registry
Browse files Browse the repository at this point in the history
レジストリ関連のエンドポイントに対応
  • Loading branch information
shiosyakeyakini-info authored Mar 30, 2024
2 parents 9d1b4cc + d3fa79b commit 9d9d7b6
Show file tree
Hide file tree
Showing 22 changed files with 1,159 additions and 39 deletions.
4 changes: 4 additions & 0 deletions lib/misskey_dart.dart
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,12 @@ 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';
export 'src/data/i/registry/i_registry_get_detail_request.dart';
export 'src/data/i/registry/i_registry_get_detail_response.dart';
export 'src/data/i/registry/i_registry_get_request.dart';
export 'src/data/i/registry/i_registry_keys_request.dart';
export 'src/data/i/registry/i_registry_keys_with_type_request.dart';
export 'src/data/i/registry/i_registry_remove_request.dart';
export 'src/data/i/registry/i_registry_scopes_with_domain_response.dart';
export 'src/data/i/registry/i_registry_set_request.dart';
export 'src/data/notes/notes_clips_request.dart';
export 'src/data/notes/notes_timeline_request.dart';
Expand Down
2 changes: 1 addition & 1 deletion lib/src/data/i/registry/i_registry_get_all_request.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ part 'i_registry_get_all_request.g.dart';
class IRegistryGetAllRequest with _$IRegistryGetAllRequest {
const factory IRegistryGetAllRequest({
required List<String> scope,
required String? domain,
String? domain,
}) = _IRegistryGetAllRequest;

factory IRegistryGetAllRequest.fromJson(Map<String, dynamic> json) =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ class __$$IRegistryGetAllRequestImplCopyWithImpl<$Res>
@JsonSerializable()
class _$IRegistryGetAllRequestImpl implements _IRegistryGetAllRequest {
const _$IRegistryGetAllRequestImpl(
{required final List<String> scope, required this.domain})
{required final List<String> scope, this.domain})
: _scope = scope;

factory _$IRegistryGetAllRequestImpl.fromJson(Map<String, dynamic> json) =>
Expand Down Expand Up @@ -168,7 +168,7 @@ class _$IRegistryGetAllRequestImpl implements _IRegistryGetAllRequest {
abstract class _IRegistryGetAllRequest implements IRegistryGetAllRequest {
const factory _IRegistryGetAllRequest(
{required final List<String> scope,
required final String? domain}) = _$IRegistryGetAllRequestImpl;
final String? domain}) = _$IRegistryGetAllRequestImpl;

factory _IRegistryGetAllRequest.fromJson(Map<String, dynamic> json) =
_$IRegistryGetAllRequestImpl.fromJson;
Expand Down
15 changes: 15 additions & 0 deletions lib/src/data/i/registry/i_registry_get_detail_response.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import 'package:freezed_annotation/freezed_annotation.dart';

part 'i_registry_get_detail_response.freezed.dart';
part 'i_registry_get_detail_response.g.dart';

@freezed
class IRegistryGetDetailResponse with _$IRegistryGetDetailResponse {
const factory IRegistryGetDetailResponse({
required DateTime updatedAt,
required dynamic value,
}) = _IRegistryGetDetailResponse;

factory IRegistryGetDetailResponse.fromJson(Map<String, dynamic> json) =>
_$IRegistryGetDetailResponseFromJson(json);
}
181 changes: 181 additions & 0 deletions lib/src/data/i/registry/i_registry_get_detail_response.freezed.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,181 @@
// 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_registry_get_detail_response.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');

IRegistryGetDetailResponse _$IRegistryGetDetailResponseFromJson(
Map<String, dynamic> json) {
return _IRegistryGetDetailResponse.fromJson(json);
}

/// @nodoc
mixin _$IRegistryGetDetailResponse {
DateTime get updatedAt => throw _privateConstructorUsedError;
dynamic get value => throw _privateConstructorUsedError;

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

/// @nodoc
abstract class $IRegistryGetDetailResponseCopyWith<$Res> {
factory $IRegistryGetDetailResponseCopyWith(IRegistryGetDetailResponse value,
$Res Function(IRegistryGetDetailResponse) then) =
_$IRegistryGetDetailResponseCopyWithImpl<$Res,
IRegistryGetDetailResponse>;
@useResult
$Res call({DateTime updatedAt, dynamic value});
}

/// @nodoc
class _$IRegistryGetDetailResponseCopyWithImpl<$Res,
$Val extends IRegistryGetDetailResponse>
implements $IRegistryGetDetailResponseCopyWith<$Res> {
_$IRegistryGetDetailResponseCopyWithImpl(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? updatedAt = null,
Object? value = freezed,
}) {
return _then(_value.copyWith(
updatedAt: null == updatedAt
? _value.updatedAt
: updatedAt // ignore: cast_nullable_to_non_nullable
as DateTime,
value: freezed == value
? _value.value
: value // ignore: cast_nullable_to_non_nullable
as dynamic,
) as $Val);
}
}

/// @nodoc
abstract class _$$IRegistryGetDetailResponseImplCopyWith<$Res>
implements $IRegistryGetDetailResponseCopyWith<$Res> {
factory _$$IRegistryGetDetailResponseImplCopyWith(
_$IRegistryGetDetailResponseImpl value,
$Res Function(_$IRegistryGetDetailResponseImpl) then) =
__$$IRegistryGetDetailResponseImplCopyWithImpl<$Res>;
@override
@useResult
$Res call({DateTime updatedAt, dynamic value});
}

/// @nodoc
class __$$IRegistryGetDetailResponseImplCopyWithImpl<$Res>
extends _$IRegistryGetDetailResponseCopyWithImpl<$Res,
_$IRegistryGetDetailResponseImpl>
implements _$$IRegistryGetDetailResponseImplCopyWith<$Res> {
__$$IRegistryGetDetailResponseImplCopyWithImpl(
_$IRegistryGetDetailResponseImpl _value,
$Res Function(_$IRegistryGetDetailResponseImpl) _then)
: super(_value, _then);

@pragma('vm:prefer-inline')
@override
$Res call({
Object? updatedAt = null,
Object? value = freezed,
}) {
return _then(_$IRegistryGetDetailResponseImpl(
updatedAt: null == updatedAt
? _value.updatedAt
: updatedAt // ignore: cast_nullable_to_non_nullable
as DateTime,
value: freezed == value
? _value.value
: value // ignore: cast_nullable_to_non_nullable
as dynamic,
));
}
}

/// @nodoc
@JsonSerializable()
class _$IRegistryGetDetailResponseImpl implements _IRegistryGetDetailResponse {
const _$IRegistryGetDetailResponseImpl(
{required this.updatedAt, required this.value});

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

@override
final DateTime updatedAt;
@override
final dynamic value;

@override
String toString() {
return 'IRegistryGetDetailResponse(updatedAt: $updatedAt, value: $value)';
}

@override
bool operator ==(Object other) {
return identical(this, other) ||
(other.runtimeType == runtimeType &&
other is _$IRegistryGetDetailResponseImpl &&
(identical(other.updatedAt, updatedAt) ||
other.updatedAt == updatedAt) &&
const DeepCollectionEquality().equals(other.value, value));
}

@JsonKey(ignore: true)
@override
int get hashCode => Object.hash(
runtimeType, updatedAt, const DeepCollectionEquality().hash(value));

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

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

abstract class _IRegistryGetDetailResponse
implements IRegistryGetDetailResponse {
const factory _IRegistryGetDetailResponse(
{required final DateTime updatedAt,
required final dynamic value}) = _$IRegistryGetDetailResponseImpl;

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

@override
DateTime get updatedAt;
@override
dynamic get value;
@override
@JsonKey(ignore: true)
_$$IRegistryGetDetailResponseImplCopyWith<_$IRegistryGetDetailResponseImpl>
get copyWith => throw _privateConstructorUsedError;
}
21 changes: 21 additions & 0 deletions lib/src/data/i/registry/i_registry_get_detail_response.g.dart

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

2 changes: 1 addition & 1 deletion lib/src/data/i/registry/i_registry_get_request.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class IRegistryGetRequest with _$IRegistryGetRequest {
const factory IRegistryGetRequest({
required String key,
required List<String> scope,
required String? domain,
String? domain,
}) = _IRegistryGetRequest;

factory IRegistryGetRequest.fromJson(Map<String, dynamic> json) =>
Expand Down
6 changes: 2 additions & 4 deletions lib/src/data/i/registry/i_registry_get_request.freezed.dart
Original file line number Diff line number Diff line change
Expand Up @@ -120,9 +120,7 @@ class __$$IRegistryGetRequestImplCopyWithImpl<$Res>
@JsonSerializable()
class _$IRegistryGetRequestImpl implements _IRegistryGetRequest {
const _$IRegistryGetRequestImpl(
{required this.key,
required final List<String> scope,
required this.domain})
{required this.key, required final List<String> scope, this.domain})
: _scope = scope;

factory _$IRegistryGetRequestImpl.fromJson(Map<String, dynamic> json) =>
Expand Down Expand Up @@ -180,7 +178,7 @@ abstract class _IRegistryGetRequest implements IRegistryGetRequest {
const factory _IRegistryGetRequest(
{required final String key,
required final List<String> scope,
required final String? domain}) = _$IRegistryGetRequestImpl;
final String? domain}) = _$IRegistryGetRequestImpl;

factory _IRegistryGetRequest.fromJson(Map<String, dynamic> json) =
_$IRegistryGetRequestImpl.fromJson;
Expand Down
15 changes: 15 additions & 0 deletions lib/src/data/i/registry/i_registry_keys_request.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import 'package:freezed_annotation/freezed_annotation.dart';

part 'i_registry_keys_request.freezed.dart';
part 'i_registry_keys_request.g.dart';

@freezed
class IRegistryKeysRequest with _$IRegistryKeysRequest {
const factory IRegistryKeysRequest({
required List<String> scope,
String? domain,
}) = _IRegistryKeysRequest;

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

0 comments on commit 9d9d7b6

Please sign in to comment.