Browse Source

specs,tool,nextcloud,neon: Generate merged specs with automatic prefixes

pull/168/head
jld3103 2 years ago
parent
commit
aa8e24b507
No known key found for this signature in database
GPG Key ID: 9062417B9E8EB7B3
  1. 5
      packages/neon/lib/src/blocs/user_status.dart
  2. 4
      packages/neon/lib/src/widgets/account_avatar.dart
  3. 196
      packages/nextcloud/lib/src/nextcloud.openapi.dart
  4. 35
      packages/nextcloud/lib/src/nextcloud.openapi.g.dart
  5. 22
      packages/nextcloud/lib/src/nextcloud.openapi.json
  6. 98
      packages/nextcloud/test/user_status.dart
  7. 24
      specs/core.json
  8. 38
      specs/news.json
  9. 18
      specs/notes.json
  10. 32
      specs/notifications.json
  11. 10
      specs/provisioning_api.json
  12. 56
      specs/user_status.json
  13. 19
      tool/generate-nextcloud.sh

5
packages/neon/lib/src/blocs/user_status.dart

@ -3,7 +3,7 @@ part of '../neon.dart';
abstract class UserStatusBlocEvents {} abstract class UserStatusBlocEvents {}
abstract class UserStatusBlocStates { abstract class UserStatusBlocStates {
BehaviorSubject<Result<NextcloudUserStatus?>> get userStatus; BehaviorSubject<Result<NextcloudUserStatusStatus?>> get userStatus;
} }
class UserStatusBloc extends InteractiveBloc implements UserStatusBlocEvents, UserStatusBlocStates { class UserStatusBloc extends InteractiveBloc implements UserStatusBlocEvents, UserStatusBlocStates {
@ -30,7 +30,8 @@ class UserStatusBloc extends InteractiveBloc implements UserStatusBlocEvents, Us
} }
@override @override
BehaviorSubject<Result<NextcloudUserStatus?>> userStatus = BehaviorSubject<Result<NextcloudUserStatus?>>(); BehaviorSubject<Result<NextcloudUserStatusStatus?>> userStatus =
BehaviorSubject<Result<NextcloudUserStatusStatus?>>();
@override @override
Future refresh() async { Future refresh() async {

4
packages/neon/lib/src/widgets/account_avatar.dart

@ -39,7 +39,7 @@ class AccountAvatar extends StatelessWidget {
), ),
), ),
), ),
ResultBuilder<UserStatusBloc, NextcloudUserStatus?>( ResultBuilder<UserStatusBloc, NextcloudUserStatusStatus?>(
stream: Provider.of<AccountsBloc>(context, listen: false).getUserStatusBloc(account).userStatus, stream: Provider.of<AccountsBloc>(context, listen: false).getUserStatusBloc(account).userStatus,
builder: (final context, final userStatus) => SizedBox( builder: (final context, final userStatus) => SizedBox(
height: kAvatarSize, height: kAvatarSize,
@ -77,7 +77,7 @@ class AccountAvatar extends StatelessWidget {
); );
} }
Color _userStatusToColor(final NextcloudUserStatus userStatus) { Color _userStatusToColor(final NextcloudUserStatusStatus userStatus) {
switch (userStatus.status) { switch (userStatus.status) {
case NextcloudUserStatusType.online: case NextcloudUserStatusType.online:
return const Color(0xFF49B382); return const Color(0xFF49B382);

196
packages/nextcloud/lib/src/nextcloud.openapi.dart

@ -1218,7 +1218,7 @@ class NextcloudUserStatusClient {
throw NextcloudApiException.fromResponse(response); // coverage:ignore-line throw NextcloudApiException.fromResponse(response); // coverage:ignore-line
} }
Future<NextcloudUserStatusGetUserStatus> getStatus() async { Future<NextcloudUserStatusGetStatus> getStatus() async {
var path = '/ocs/v2.php/apps/user_status/api/v1/user_status'; var path = '/ocs/v2.php/apps/user_status/api/v1/user_status';
final queryParameters = <String, dynamic>{}; final queryParameters = <String, dynamic>{};
final headers = <String, String>{}; final headers = <String, String>{};
@ -1230,13 +1230,13 @@ class NextcloudUserStatusClient {
body, body,
); );
if (response.statusCode == 200) { if (response.statusCode == 200) {
return NextcloudUserStatusGetUserStatus.fromJson( return NextcloudUserStatusGetStatus.fromJson(
json.decode(utf8.decode(response.body) as String) as Map<String, dynamic>); json.decode(utf8.decode(response.body) as String) as Map<String, dynamic>);
} }
throw NextcloudApiException.fromResponse(response); // coverage:ignore-line throw NextcloudApiException.fromResponse(response); // coverage:ignore-line
} }
Future<NextcloudUserStatusGetUserStatus> setStatus({required NextcloudUserStatusType statusType}) async { Future<NextcloudUserStatusGetStatus> setStatus({required NextcloudUserStatusType statusType}) async {
var path = '/ocs/v2.php/apps/user_status/api/v1/user_status/status'; var path = '/ocs/v2.php/apps/user_status/api/v1/user_status/status';
final queryParameters = <String, dynamic>{}; final queryParameters = <String, dynamic>{};
final headers = <String, String>{}; final headers = <String, String>{};
@ -1249,13 +1249,13 @@ class NextcloudUserStatusClient {
body, body,
); );
if (response.statusCode == 200) { if (response.statusCode == 200) {
return NextcloudUserStatusGetUserStatus.fromJson( return NextcloudUserStatusGetStatus.fromJson(
json.decode(utf8.decode(response.body) as String) as Map<String, dynamic>); json.decode(utf8.decode(response.body) as String) as Map<String, dynamic>);
} }
throw NextcloudApiException.fromResponse(response); // coverage:ignore-line throw NextcloudApiException.fromResponse(response); // coverage:ignore-line
} }
Future<NextcloudUserStatusGetUserStatus> setPredefinedMessage({ Future<NextcloudUserStatusGetStatus> setPredefinedMessage({
required String messageId, required String messageId,
int? clearAt, int? clearAt,
}) async { }) async {
@ -1274,13 +1274,13 @@ class NextcloudUserStatusClient {
body, body,
); );
if (response.statusCode == 200) { if (response.statusCode == 200) {
return NextcloudUserStatusGetUserStatus.fromJson( return NextcloudUserStatusGetStatus.fromJson(
json.decode(utf8.decode(response.body) as String) as Map<String, dynamic>); json.decode(utf8.decode(response.body) as String) as Map<String, dynamic>);
} }
throw NextcloudApiException.fromResponse(response); // coverage:ignore-line throw NextcloudApiException.fromResponse(response); // coverage:ignore-line
} }
Future<NextcloudUserStatusGetUserStatus> setCustomMessage({ Future<NextcloudUserStatusGetStatus> setCustomMessage({
String? statusIcon, String? statusIcon,
String? message, String? message,
int? clearAt, int? clearAt,
@ -1305,7 +1305,7 @@ class NextcloudUserStatusClient {
body, body,
); );
if (response.statusCode == 200) { if (response.statusCode == 200) {
return NextcloudUserStatusGetUserStatus.fromJson( return NextcloudUserStatusGetStatus.fromJson(
json.decode(utf8.decode(response.body) as String) as Map<String, dynamic>); json.decode(utf8.decode(response.body) as String) as Map<String, dynamic>);
} }
throw NextcloudApiException.fromResponse(response); // coverage:ignore-line throw NextcloudApiException.fromResponse(response); // coverage:ignore-line
@ -1346,7 +1346,7 @@ class NextcloudUserStatusClient {
throw NextcloudApiException.fromResponse(response); // coverage:ignore-line throw NextcloudApiException.fromResponse(response); // coverage:ignore-line
} }
Future<NextcloudUserStatus> heartbeat({required NextcloudUserStatusType status}) async { Future<NextcloudUserStatusStatus> heartbeat({required NextcloudUserStatusType status}) async {
var path = '/ocs/v2.php/apps/user_status/api/v1/heartbeat'; var path = '/ocs/v2.php/apps/user_status/api/v1/heartbeat';
final queryParameters = <String, dynamic>{}; final queryParameters = <String, dynamic>{};
final headers = <String, String>{}; final headers = <String, String>{};
@ -1359,7 +1359,8 @@ class NextcloudUserStatusClient {
body, body,
); );
if (response.statusCode == 200) { if (response.statusCode == 200) {
return NextcloudUserStatus.fromJson(json.decode(utf8.decode(response.body) as String) as Map<String, dynamic>); return NextcloudUserStatusStatus.fromJson(
json.decode(utf8.decode(response.body) as String) as Map<String, dynamic>);
} }
throw NextcloudApiException.fromResponse(response); // coverage:ignore-line throw NextcloudApiException.fromResponse(response); // coverage:ignore-line
} }
@ -4632,14 +4633,14 @@ class NextcloudUserStatusClearAt {
static String? toJsonString(NextcloudUserStatusClearAt? data) => data == null ? null : json.encode(data.toJson()); static String? toJsonString(NextcloudUserStatusClearAt? data) => data == null ? null : json.encode(data.toJson());
} }
class NextcloudUserStatusPublicUserStatus_ClearAt { class NextcloudUserStatusPublicStatus_ClearAt {
NextcloudUserStatusPublicUserStatus_ClearAt( NextcloudUserStatusPublicStatus_ClearAt(
this._data, { this._data, {
this.userStatusClearAt, this.userStatusClearAt,
this.$int, this.$int,
}); });
factory NextcloudUserStatusPublicUserStatus_ClearAt.fromJson(dynamic data) { factory NextcloudUserStatusPublicStatus_ClearAt.fromJson(dynamic data) {
NextcloudUserStatusClearAt? userStatusClearAt; NextcloudUserStatusClearAt? userStatusClearAt;
int? $int; int? $int;
try { try {
@ -4648,7 +4649,7 @@ class NextcloudUserStatusPublicUserStatus_ClearAt {
try { try {
$int = (data as int); $int = (data as int);
} catch (_) {} } catch (_) {}
return NextcloudUserStatusPublicUserStatus_ClearAt( return NextcloudUserStatusPublicStatus_ClearAt(
data, data,
userStatusClearAt: userStatusClearAt, userStatusClearAt: userStatusClearAt,
$int: $int, $int: $int,
@ -4656,8 +4657,8 @@ class NextcloudUserStatusPublicUserStatus_ClearAt {
} }
// coverage:ignore-start // coverage:ignore-start
factory NextcloudUserStatusPublicUserStatus_ClearAt.fromJsonString(String data) => factory NextcloudUserStatusPublicStatus_ClearAt.fromJsonString(String data) =>
NextcloudUserStatusPublicUserStatus_ClearAt.fromJson(json.decode(data)); NextcloudUserStatusPublicStatus_ClearAt.fromJson(json.decode(data));
// coverage:ignore-end // coverage:ignore-end
final dynamic _data; final dynamic _data;
@ -4705,8 +4706,8 @@ enum NextcloudUserStatusType {
} }
@JsonSerializable() @JsonSerializable()
class NextcloudUserStatusPublicUserStatus { class NextcloudUserStatusPublicStatus {
NextcloudUserStatusPublicUserStatus({ NextcloudUserStatusPublicStatus({
required this.userId, required this.userId,
this.message, this.message,
this.icon, this.icon,
@ -4715,13 +4716,13 @@ class NextcloudUserStatusPublicUserStatus {
}); });
// coverage:ignore-start // coverage:ignore-start
factory NextcloudUserStatusPublicUserStatus.fromJson(Map<String, dynamic> json) => factory NextcloudUserStatusPublicStatus.fromJson(Map<String, dynamic> json) =>
_$NextcloudUserStatusPublicUserStatusFromJson(json); _$NextcloudUserStatusPublicStatusFromJson(json);
// coverage:ignore-end // coverage:ignore-end
// coverage:ignore-start // coverage:ignore-start
factory NextcloudUserStatusPublicUserStatus.fromJsonString(String data) => factory NextcloudUserStatusPublicStatus.fromJsonString(String data) =>
NextcloudUserStatusPublicUserStatus.fromJson(json.decode(data) as Map<String, dynamic>); NextcloudUserStatusPublicStatus.fromJson(json.decode(data) as Map<String, dynamic>);
// coverage:ignore-end // coverage:ignore-end
final String userId; final String userId;
@ -4730,14 +4731,14 @@ class NextcloudUserStatusPublicUserStatus {
final String? icon; final String? icon;
final NextcloudUserStatusPublicUserStatus_ClearAt clearAt; final NextcloudUserStatusPublicStatus_ClearAt clearAt;
final NextcloudUserStatusType status; final NextcloudUserStatusType status;
// coverage:ignore-start // coverage:ignore-start
Map<String, dynamic> toJson() => _$NextcloudUserStatusPublicUserStatusToJson(this); Map<String, dynamic> toJson() => _$NextcloudUserStatusPublicStatusToJson(this);
// coverage:ignore-end // coverage:ignore-end
static String? toJsonString(NextcloudUserStatusPublicUserStatus? data) => static String? toJsonString(NextcloudUserStatusPublicStatus? data) =>
data == null ? null : json.encode(data.toJson()); data == null ? null : json.encode(data.toJson());
} }
@ -4760,7 +4761,7 @@ class NextcloudUserStatusGetPublicStatuses_Ocs {
final NextcloudOCSMeta meta; final NextcloudOCSMeta meta;
final List<NextcloudUserStatusPublicUserStatus> data; final List<NextcloudUserStatusPublicStatus> data;
// coverage:ignore-start // coverage:ignore-start
Map<String, dynamic> toJson() => _$NextcloudUserStatusGetPublicStatuses_OcsToJson(this); Map<String, dynamic> toJson() => _$NextcloudUserStatusGetPublicStatuses_OcsToJson(this);
@ -4795,17 +4796,17 @@ class NextcloudUserStatusGetPublicStatuses {
class NextcloudUserStatusGetPublicStatus_Ocs_Data { class NextcloudUserStatusGetPublicStatus_Ocs_Data {
NextcloudUserStatusGetPublicStatus_Ocs_Data( NextcloudUserStatusGetPublicStatus_Ocs_Data(
this._data, { this._data, {
this.userStatusPublicUserStatus, this.userStatusPublicStatus,
}); });
factory NextcloudUserStatusGetPublicStatus_Ocs_Data.fromJson(dynamic data) { factory NextcloudUserStatusGetPublicStatus_Ocs_Data.fromJson(dynamic data) {
NextcloudUserStatusPublicUserStatus? userStatusPublicUserStatus; NextcloudUserStatusPublicStatus? userStatusPublicStatus;
try { try {
userStatusPublicUserStatus = NextcloudUserStatusPublicUserStatus.fromJson(data as Map<String, dynamic>); userStatusPublicStatus = NextcloudUserStatusPublicStatus.fromJson(data as Map<String, dynamic>);
} catch (_) {} } catch (_) {}
return NextcloudUserStatusGetPublicStatus_Ocs_Data( return NextcloudUserStatusGetPublicStatus_Ocs_Data(
data, data,
userStatusPublicUserStatus: userStatusPublicUserStatus, userStatusPublicStatus: userStatusPublicStatus,
); );
} }
@ -4816,7 +4817,7 @@ class NextcloudUserStatusGetPublicStatus_Ocs_Data {
final dynamic _data; final dynamic _data;
final NextcloudUserStatusPublicUserStatus? userStatusPublicUserStatus; final NextcloudUserStatusPublicStatus? userStatusPublicStatus;
// coverage:ignore-start // coverage:ignore-start
dynamic toJson() => _data; dynamic toJson() => _data;
@ -4877,14 +4878,14 @@ class NextcloudUserStatusGetPublicStatus {
data == null ? null : json.encode(data.toJson()); data == null ? null : json.encode(data.toJson());
} }
class NextcloudUserStatus_ClearAt { class NextcloudUserStatusStatus_ClearAt {
NextcloudUserStatus_ClearAt( NextcloudUserStatusStatus_ClearAt(
this._data, { this._data, {
this.userStatusClearAt, this.userStatusClearAt,
this.$int, this.$int,
}); });
factory NextcloudUserStatus_ClearAt.fromJson(dynamic data) { factory NextcloudUserStatusStatus_ClearAt.fromJson(dynamic data) {
NextcloudUserStatusClearAt? userStatusClearAt; NextcloudUserStatusClearAt? userStatusClearAt;
int? $int; int? $int;
try { try {
@ -4893,7 +4894,7 @@ class NextcloudUserStatus_ClearAt {
try { try {
$int = (data as int); $int = (data as int);
} catch (_) {} } catch (_) {}
return NextcloudUserStatus_ClearAt( return NextcloudUserStatusStatus_ClearAt(
data, data,
userStatusClearAt: userStatusClearAt, userStatusClearAt: userStatusClearAt,
$int: $int, $int: $int,
@ -4901,8 +4902,8 @@ class NextcloudUserStatus_ClearAt {
} }
// coverage:ignore-start // coverage:ignore-start
factory NextcloudUserStatus_ClearAt.fromJsonString(String data) => factory NextcloudUserStatusStatus_ClearAt.fromJsonString(String data) =>
NextcloudUserStatus_ClearAt.fromJson(json.decode(data)); NextcloudUserStatusStatus_ClearAt.fromJson(json.decode(data));
// coverage:ignore-end // coverage:ignore-end
final dynamic _data; final dynamic _data;
@ -4921,8 +4922,8 @@ class NextcloudUserStatus_ClearAt {
} }
@JsonSerializable() @JsonSerializable()
class NextcloudUserStatus { class NextcloudUserStatusStatus {
NextcloudUserStatus({ NextcloudUserStatusStatus({
required this.userId, required this.userId,
this.message, this.message,
this.messageId, this.messageId,
@ -4934,12 +4935,12 @@ class NextcloudUserStatus {
}); });
// coverage:ignore-start // coverage:ignore-start
factory NextcloudUserStatus.fromJson(Map<String, dynamic> json) => _$NextcloudUserStatusFromJson(json); factory NextcloudUserStatusStatus.fromJson(Map<String, dynamic> json) => _$NextcloudUserStatusStatusFromJson(json);
// coverage:ignore-end // coverage:ignore-end
// coverage:ignore-start // coverage:ignore-start
factory NextcloudUserStatus.fromJsonString(String data) => factory NextcloudUserStatusStatus.fromJsonString(String data) =>
NextcloudUserStatus.fromJson(json.decode(data) as Map<String, dynamic>); NextcloudUserStatusStatus.fromJson(json.decode(data) as Map<String, dynamic>);
// coverage:ignore-end // coverage:ignore-end
final String userId; final String userId;
@ -4952,43 +4953,43 @@ class NextcloudUserStatus {
final String? icon; final String? icon;
final NextcloudUserStatus_ClearAt clearAt; final NextcloudUserStatusStatus_ClearAt clearAt;
final NextcloudUserStatusType status; final NextcloudUserStatusType status;
final bool statusIsUserDefined; final bool statusIsUserDefined;
// coverage:ignore-start // coverage:ignore-start
Map<String, dynamic> toJson() => _$NextcloudUserStatusToJson(this); Map<String, dynamic> toJson() => _$NextcloudUserStatusStatusToJson(this);
// coverage:ignore-end // coverage:ignore-end
static String? toJsonString(NextcloudUserStatus? data) => data == null ? null : json.encode(data.toJson()); static String? toJsonString(NextcloudUserStatusStatus? data) => data == null ? null : json.encode(data.toJson());
} }
class NextcloudUserStatusGetUserStatus_Ocs_Data { class NextcloudUserStatusGetStatus_Ocs_Data {
NextcloudUserStatusGetUserStatus_Ocs_Data( NextcloudUserStatusGetStatus_Ocs_Data(
this._data, { this._data, {
this.userStatus, this.userStatusStatus,
}); });
factory NextcloudUserStatusGetUserStatus_Ocs_Data.fromJson(dynamic data) { factory NextcloudUserStatusGetStatus_Ocs_Data.fromJson(dynamic data) {
NextcloudUserStatus? userStatus; NextcloudUserStatusStatus? userStatusStatus;
try { try {
userStatus = NextcloudUserStatus.fromJson(data as Map<String, dynamic>); userStatusStatus = NextcloudUserStatusStatus.fromJson(data as Map<String, dynamic>);
} catch (_) {} } catch (_) {}
return NextcloudUserStatusGetUserStatus_Ocs_Data( return NextcloudUserStatusGetStatus_Ocs_Data(
data, data,
userStatus: userStatus, userStatusStatus: userStatusStatus,
); );
} }
// coverage:ignore-start // coverage:ignore-start
factory NextcloudUserStatusGetUserStatus_Ocs_Data.fromJsonString(String data) => factory NextcloudUserStatusGetStatus_Ocs_Data.fromJsonString(String data) =>
NextcloudUserStatusGetUserStatus_Ocs_Data.fromJson(json.decode(data)); NextcloudUserStatusGetStatus_Ocs_Data.fromJson(json.decode(data));
// coverage:ignore-end // coverage:ignore-end
final dynamic _data; final dynamic _data;
final NextcloudUserStatus? userStatus; final NextcloudUserStatusStatus? userStatusStatus;
// coverage:ignore-start // coverage:ignore-start
dynamic toJson() => _data; dynamic toJson() => _data;
@ -4999,54 +5000,53 @@ class NextcloudUserStatusGetUserStatus_Ocs_Data {
} }
@JsonSerializable() @JsonSerializable()
class NextcloudUserStatusGetUserStatus_Ocs { class NextcloudUserStatusGetStatus_Ocs {
NextcloudUserStatusGetUserStatus_Ocs({ NextcloudUserStatusGetStatus_Ocs({
required this.meta, required this.meta,
required this.data, required this.data,
}); });
// coverage:ignore-start // coverage:ignore-start
factory NextcloudUserStatusGetUserStatus_Ocs.fromJson(Map<String, dynamic> json) => factory NextcloudUserStatusGetStatus_Ocs.fromJson(Map<String, dynamic> json) =>
_$NextcloudUserStatusGetUserStatus_OcsFromJson(json); _$NextcloudUserStatusGetStatus_OcsFromJson(json);
// coverage:ignore-end // coverage:ignore-end
// coverage:ignore-start // coverage:ignore-start
factory NextcloudUserStatusGetUserStatus_Ocs.fromJsonString(String data) => factory NextcloudUserStatusGetStatus_Ocs.fromJsonString(String data) =>
NextcloudUserStatusGetUserStatus_Ocs.fromJson(json.decode(data) as Map<String, dynamic>); NextcloudUserStatusGetStatus_Ocs.fromJson(json.decode(data) as Map<String, dynamic>);
// coverage:ignore-end // coverage:ignore-end
final NextcloudOCSMeta meta; final NextcloudOCSMeta meta;
final NextcloudUserStatusGetUserStatus_Ocs_Data data; final NextcloudUserStatusGetStatus_Ocs_Data data;
// coverage:ignore-start // coverage:ignore-start
Map<String, dynamic> toJson() => _$NextcloudUserStatusGetUserStatus_OcsToJson(this); Map<String, dynamic> toJson() => _$NextcloudUserStatusGetStatus_OcsToJson(this);
// coverage:ignore-end // coverage:ignore-end
static String? toJsonString(NextcloudUserStatusGetUserStatus_Ocs? data) => static String? toJsonString(NextcloudUserStatusGetStatus_Ocs? data) =>
data == null ? null : json.encode(data.toJson()); data == null ? null : json.encode(data.toJson());
} }
@JsonSerializable() @JsonSerializable()
class NextcloudUserStatusGetUserStatus { class NextcloudUserStatusGetStatus {
NextcloudUserStatusGetUserStatus({required this.ocs}); NextcloudUserStatusGetStatus({required this.ocs});
// coverage:ignore-start // coverage:ignore-start
factory NextcloudUserStatusGetUserStatus.fromJson(Map<String, dynamic> json) => factory NextcloudUserStatusGetStatus.fromJson(Map<String, dynamic> json) =>
_$NextcloudUserStatusGetUserStatusFromJson(json); _$NextcloudUserStatusGetStatusFromJson(json);
// coverage:ignore-end // coverage:ignore-end
// coverage:ignore-start // coverage:ignore-start
factory NextcloudUserStatusGetUserStatus.fromJsonString(String data) => factory NextcloudUserStatusGetStatus.fromJsonString(String data) =>
NextcloudUserStatusGetUserStatus.fromJson(json.decode(data) as Map<String, dynamic>); NextcloudUserStatusGetStatus.fromJson(json.decode(data) as Map<String, dynamic>);
// coverage:ignore-end // coverage:ignore-end
final NextcloudUserStatusGetUserStatus_Ocs ocs; final NextcloudUserStatusGetStatus_Ocs ocs;
// coverage:ignore-start // coverage:ignore-start
Map<String, dynamic> toJson() => _$NextcloudUserStatusGetUserStatusToJson(this); Map<String, dynamic> toJson() => _$NextcloudUserStatusGetStatusToJson(this);
// coverage:ignore-end // coverage:ignore-end
static String? toJsonString(NextcloudUserStatusGetUserStatus? data) => static String? toJsonString(NextcloudUserStatusGetStatus? data) => data == null ? null : json.encode(data.toJson());
data == null ? null : json.encode(data.toJson());
} }
class NextcloudUserStatusPredefinedStatus_ClearAt { class NextcloudUserStatusPredefinedStatus_ClearAt {
@ -5733,10 +5733,10 @@ final _deserializers = <Type, dynamic Function(dynamic)>{
List<NextcloudUserStatusGetPublicStatuses_Ocs>: (final data) => (data as List) List<NextcloudUserStatusGetPublicStatuses_Ocs>: (final data) => (data as List)
.map((final e) => NextcloudUserStatusGetPublicStatuses_Ocs.fromJson(e as Map<String, dynamic>)) .map((final e) => NextcloudUserStatusGetPublicStatuses_Ocs.fromJson(e as Map<String, dynamic>))
.toList(), .toList(),
NextcloudUserStatusPublicUserStatus: (final data) => NextcloudUserStatusPublicStatus: (final data) =>
NextcloudUserStatusPublicUserStatus.fromJson(data as Map<String, dynamic>), NextcloudUserStatusPublicStatus.fromJson(data as Map<String, dynamic>),
List<NextcloudUserStatusPublicUserStatus>: (final data) => List<NextcloudUserStatusPublicStatus>: (final data) =>
(data as List).map((final e) => NextcloudUserStatusPublicUserStatus.fromJson(e as Map<String, dynamic>)).toList(), (data as List).map((final e) => NextcloudUserStatusPublicStatus.fromJson(e as Map<String, dynamic>)).toList(),
NextcloudUserStatusClearAt: (final data) => NextcloudUserStatusClearAt.fromJson(data as Map<String, dynamic>), NextcloudUserStatusClearAt: (final data) => NextcloudUserStatusClearAt.fromJson(data as Map<String, dynamic>),
List<NextcloudUserStatusClearAt>: (final data) => List<NextcloudUserStatusClearAt>: (final data) =>
(data as List).map((final e) => NextcloudUserStatusClearAt.fromJson(e as Map<String, dynamic>)).toList(), (data as List).map((final e) => NextcloudUserStatusClearAt.fromJson(e as Map<String, dynamic>)).toList(),
@ -5749,18 +5749,16 @@ final _deserializers = <Type, dynamic Function(dynamic)>{
List<NextcloudUserStatusGetPublicStatus_Ocs>: (final data) => (data as List) List<NextcloudUserStatusGetPublicStatus_Ocs>: (final data) => (data as List)
.map((final e) => NextcloudUserStatusGetPublicStatus_Ocs.fromJson(e as Map<String, dynamic>)) .map((final e) => NextcloudUserStatusGetPublicStatus_Ocs.fromJson(e as Map<String, dynamic>))
.toList(), .toList(),
NextcloudUserStatusGetUserStatus: (final data) => NextcloudUserStatusGetStatus: (final data) => NextcloudUserStatusGetStatus.fromJson(data as Map<String, dynamic>),
NextcloudUserStatusGetUserStatus.fromJson(data as Map<String, dynamic>), List<NextcloudUserStatusGetStatus>: (final data) =>
List<NextcloudUserStatusGetUserStatus>: (final data) => (data as List).map((final e) => NextcloudUserStatusGetStatus.fromJson(e as Map<String, dynamic>)).toList(),
(data as List).map((final e) => NextcloudUserStatusGetUserStatus.fromJson(e as Map<String, dynamic>)).toList(), NextcloudUserStatusGetStatus_Ocs: (final data) =>
NextcloudUserStatusGetUserStatus_Ocs: (final data) => NextcloudUserStatusGetStatus_Ocs.fromJson(data as Map<String, dynamic>),
NextcloudUserStatusGetUserStatus_Ocs.fromJson(data as Map<String, dynamic>), List<NextcloudUserStatusGetStatus_Ocs>: (final data) =>
List<NextcloudUserStatusGetUserStatus_Ocs>: (final data) => (data as List) (data as List).map((final e) => NextcloudUserStatusGetStatus_Ocs.fromJson(e as Map<String, dynamic>)).toList(),
.map((final e) => NextcloudUserStatusGetUserStatus_Ocs.fromJson(e as Map<String, dynamic>)) NextcloudUserStatusStatus: (final data) => NextcloudUserStatusStatus.fromJson(data as Map<String, dynamic>),
.toList(), List<NextcloudUserStatusStatus>: (final data) =>
NextcloudUserStatus: (final data) => NextcloudUserStatus.fromJson(data as Map<String, dynamic>), (data as List).map((final e) => NextcloudUserStatusStatus.fromJson(e as Map<String, dynamic>)).toList(),
List<NextcloudUserStatus>: (final data) =>
(data as List).map((final e) => NextcloudUserStatus.fromJson(e as Map<String, dynamic>)).toList(),
NextcloudUserStatusPredefinedStatuses: (final data) => NextcloudUserStatusPredefinedStatuses: (final data) =>
NextcloudUserStatusPredefinedStatuses.fromJson(data as Map<String, dynamic>), NextcloudUserStatusPredefinedStatuses.fromJson(data as Map<String, dynamic>),
List<NextcloudUserStatusPredefinedStatuses>: (final data) => (data as List) List<NextcloudUserStatusPredefinedStatuses>: (final data) => (data as List)
@ -6018,20 +6016,20 @@ final _serializers = <Type, dynamic Function(dynamic)>{
List<NextcloudUserStatusGetPublicStatuses>: (final data) => data.map((final e) => e.toJson()).toList(), List<NextcloudUserStatusGetPublicStatuses>: (final data) => data.map((final e) => e.toJson()).toList(),
NextcloudUserStatusGetPublicStatuses_Ocs: (final data) => data.toJson(), NextcloudUserStatusGetPublicStatuses_Ocs: (final data) => data.toJson(),
List<NextcloudUserStatusGetPublicStatuses_Ocs>: (final data) => data.map((final e) => e.toJson()).toList(), List<NextcloudUserStatusGetPublicStatuses_Ocs>: (final data) => data.map((final e) => e.toJson()).toList(),
NextcloudUserStatusPublicUserStatus: (final data) => data.toJson(), NextcloudUserStatusPublicStatus: (final data) => data.toJson(),
List<NextcloudUserStatusPublicUserStatus>: (final data) => data.map((final e) => e.toJson()).toList(), List<NextcloudUserStatusPublicStatus>: (final data) => data.map((final e) => e.toJson()).toList(),
NextcloudUserStatusClearAt: (final data) => data.toJson(), NextcloudUserStatusClearAt: (final data) => data.toJson(),
List<NextcloudUserStatusClearAt>: (final data) => data.map((final e) => e.toJson()).toList(), List<NextcloudUserStatusClearAt>: (final data) => data.map((final e) => e.toJson()).toList(),
NextcloudUserStatusGetPublicStatus: (final data) => data.toJson(), NextcloudUserStatusGetPublicStatus: (final data) => data.toJson(),
List<NextcloudUserStatusGetPublicStatus>: (final data) => data.map((final e) => e.toJson()).toList(), List<NextcloudUserStatusGetPublicStatus>: (final data) => data.map((final e) => e.toJson()).toList(),
NextcloudUserStatusGetPublicStatus_Ocs: (final data) => data.toJson(), NextcloudUserStatusGetPublicStatus_Ocs: (final data) => data.toJson(),
List<NextcloudUserStatusGetPublicStatus_Ocs>: (final data) => data.map((final e) => e.toJson()).toList(), List<NextcloudUserStatusGetPublicStatus_Ocs>: (final data) => data.map((final e) => e.toJson()).toList(),
NextcloudUserStatusGetUserStatus: (final data) => data.toJson(), NextcloudUserStatusGetStatus: (final data) => data.toJson(),
List<NextcloudUserStatusGetUserStatus>: (final data) => data.map((final e) => e.toJson()).toList(), List<NextcloudUserStatusGetStatus>: (final data) => data.map((final e) => e.toJson()).toList(),
NextcloudUserStatusGetUserStatus_Ocs: (final data) => data.toJson(), NextcloudUserStatusGetStatus_Ocs: (final data) => data.toJson(),
List<NextcloudUserStatusGetUserStatus_Ocs>: (final data) => data.map((final e) => e.toJson()).toList(), List<NextcloudUserStatusGetStatus_Ocs>: (final data) => data.map((final e) => e.toJson()).toList(),
NextcloudUserStatus: (final data) => data.toJson(), NextcloudUserStatusStatus: (final data) => data.toJson(),
List<NextcloudUserStatus>: (final data) => data.map((final e) => e.toJson()).toList(), List<NextcloudUserStatusStatus>: (final data) => data.map((final e) => e.toJson()).toList(),
NextcloudUserStatusPredefinedStatuses: (final data) => data.toJson(), NextcloudUserStatusPredefinedStatuses: (final data) => data.toJson(),
List<NextcloudUserStatusPredefinedStatuses>: (final data) => data.map((final e) => e.toJson()).toList(), List<NextcloudUserStatusPredefinedStatuses>: (final data) => data.map((final e) => e.toJson()).toList(),
NextcloudUserStatusPredefinedStatuses_Ocs: (final data) => data.toJson(), NextcloudUserStatusPredefinedStatuses_Ocs: (final data) => data.toJson(),

35
packages/nextcloud/lib/src/nextcloud.openapi.g.dart

@ -1970,21 +1970,21 @@ const _$NextcloudUserStatusClearAt_TypeEnumMap = {
NextcloudUserStatusClearAt_Type.endOf: 'end-of', NextcloudUserStatusClearAt_Type.endOf: 'end-of',
}; };
NextcloudUserStatusPublicUserStatus _$NextcloudUserStatusPublicUserStatusFromJson(Map<String, dynamic> json) { NextcloudUserStatusPublicStatus _$NextcloudUserStatusPublicStatusFromJson(Map<String, dynamic> json) {
$checkKeys( $checkKeys(
json, json,
allowedKeys: const ['userId', 'message', 'icon', 'clearAt', 'status'], allowedKeys: const ['userId', 'message', 'icon', 'clearAt', 'status'],
); );
return NextcloudUserStatusPublicUserStatus( return NextcloudUserStatusPublicStatus(
userId: json['userId'] as String, userId: json['userId'] as String,
message: json['message'] as String?, message: json['message'] as String?,
icon: json['icon'] as String?, icon: json['icon'] as String?,
clearAt: NextcloudUserStatusPublicUserStatus_ClearAt.fromJson(json['clearAt']), clearAt: NextcloudUserStatusPublicStatus_ClearAt.fromJson(json['clearAt']),
status: $enumDecode(_$NextcloudUserStatusTypeEnumMap, json['status']), status: $enumDecode(_$NextcloudUserStatusTypeEnumMap, json['status']),
); );
} }
Map<String, dynamic> _$NextcloudUserStatusPublicUserStatusToJson(NextcloudUserStatusPublicUserStatus instance) => Map<String, dynamic> _$NextcloudUserStatusPublicStatusToJson(NextcloudUserStatusPublicStatus instance) =>
<String, dynamic>{ <String, dynamic>{
'userId': instance.userId, 'userId': instance.userId,
'message': instance.message, 'message': instance.message,
@ -2009,7 +2009,7 @@ NextcloudUserStatusGetPublicStatuses_Ocs _$NextcloudUserStatusGetPublicStatuses_
return NextcloudUserStatusGetPublicStatuses_Ocs( return NextcloudUserStatusGetPublicStatuses_Ocs(
meta: NextcloudOCSMeta.fromJson(json['meta'] as Map<String, dynamic>), meta: NextcloudOCSMeta.fromJson(json['meta'] as Map<String, dynamic>),
data: (json['data'] as List<dynamic>) data: (json['data'] as List<dynamic>)
.map((e) => NextcloudUserStatusPublicUserStatus.fromJson(e as Map<String, dynamic>)) .map((e) => NextcloudUserStatusPublicStatus.fromJson(e as Map<String, dynamic>))
.toList(), .toList(),
); );
} }
@ -2068,7 +2068,7 @@ Map<String, dynamic> _$NextcloudUserStatusGetPublicStatusToJson(NextcloudUserSta
'ocs': instance.ocs.toJson(), 'ocs': instance.ocs.toJson(),
}; };
NextcloudUserStatus _$NextcloudUserStatusFromJson(Map<String, dynamic> json) { NextcloudUserStatusStatus _$NextcloudUserStatusStatusFromJson(Map<String, dynamic> json) {
$checkKeys( $checkKeys(
json, json,
allowedKeys: const [ allowedKeys: const [
@ -2082,19 +2082,19 @@ NextcloudUserStatus _$NextcloudUserStatusFromJson(Map<String, dynamic> json) {
'statusIsUserDefined' 'statusIsUserDefined'
], ],
); );
return NextcloudUserStatus( return NextcloudUserStatusStatus(
userId: json['userId'] as String, userId: json['userId'] as String,
message: json['message'] as String?, message: json['message'] as String?,
messageId: json['messageId'] as String?, messageId: json['messageId'] as String?,
messageIsPredefined: json['messageIsPredefined'] as bool, messageIsPredefined: json['messageIsPredefined'] as bool,
icon: json['icon'] as String?, icon: json['icon'] as String?,
clearAt: NextcloudUserStatus_ClearAt.fromJson(json['clearAt']), clearAt: NextcloudUserStatusStatus_ClearAt.fromJson(json['clearAt']),
status: $enumDecode(_$NextcloudUserStatusTypeEnumMap, json['status']), status: $enumDecode(_$NextcloudUserStatusTypeEnumMap, json['status']),
statusIsUserDefined: json['statusIsUserDefined'] as bool, statusIsUserDefined: json['statusIsUserDefined'] as bool,
); );
} }
Map<String, dynamic> _$NextcloudUserStatusToJson(NextcloudUserStatus instance) => <String, dynamic>{ Map<String, dynamic> _$NextcloudUserStatusStatusToJson(NextcloudUserStatusStatus instance) => <String, dynamic>{
'userId': instance.userId, 'userId': instance.userId,
'message': instance.message, 'message': instance.message,
'messageId': instance.messageId, 'messageId': instance.messageId,
@ -2105,35 +2105,34 @@ Map<String, dynamic> _$NextcloudUserStatusToJson(NextcloudUserStatus instance) =
'statusIsUserDefined': instance.statusIsUserDefined, 'statusIsUserDefined': instance.statusIsUserDefined,
}; };
NextcloudUserStatusGetUserStatus_Ocs _$NextcloudUserStatusGetUserStatus_OcsFromJson(Map<String, dynamic> json) { NextcloudUserStatusGetStatus_Ocs _$NextcloudUserStatusGetStatus_OcsFromJson(Map<String, dynamic> json) {
$checkKeys( $checkKeys(
json, json,
allowedKeys: const ['meta', 'data'], allowedKeys: const ['meta', 'data'],
); );
return NextcloudUserStatusGetUserStatus_Ocs( return NextcloudUserStatusGetStatus_Ocs(
meta: NextcloudOCSMeta.fromJson(json['meta'] as Map<String, dynamic>), meta: NextcloudOCSMeta.fromJson(json['meta'] as Map<String, dynamic>),
data: NextcloudUserStatusGetUserStatus_Ocs_Data.fromJson(json['data']), data: NextcloudUserStatusGetStatus_Ocs_Data.fromJson(json['data']),
); );
} }
Map<String, dynamic> _$NextcloudUserStatusGetUserStatus_OcsToJson(NextcloudUserStatusGetUserStatus_Ocs instance) => Map<String, dynamic> _$NextcloudUserStatusGetStatus_OcsToJson(NextcloudUserStatusGetStatus_Ocs instance) =>
<String, dynamic>{ <String, dynamic>{
'meta': instance.meta.toJson(), 'meta': instance.meta.toJson(),
'data': instance.data.toJson(), 'data': instance.data.toJson(),
}; };
NextcloudUserStatusGetUserStatus _$NextcloudUserStatusGetUserStatusFromJson(Map<String, dynamic> json) { NextcloudUserStatusGetStatus _$NextcloudUserStatusGetStatusFromJson(Map<String, dynamic> json) {
$checkKeys( $checkKeys(
json, json,
allowedKeys: const ['ocs'], allowedKeys: const ['ocs'],
); );
return NextcloudUserStatusGetUserStatus( return NextcloudUserStatusGetStatus(
ocs: NextcloudUserStatusGetUserStatus_Ocs.fromJson(json['ocs'] as Map<String, dynamic>), ocs: NextcloudUserStatusGetStatus_Ocs.fromJson(json['ocs'] as Map<String, dynamic>),
); );
} }
Map<String, dynamic> _$NextcloudUserStatusGetUserStatusToJson(NextcloudUserStatusGetUserStatus instance) => Map<String, dynamic> _$NextcloudUserStatusGetStatusToJson(NextcloudUserStatusGetStatus instance) => <String, dynamic>{
<String, dynamic>{
'ocs': instance.ocs.toJson(), 'ocs': instance.ocs.toJson(),
}; };

22
packages/nextcloud/lib/src/nextcloud.openapi.json

@ -1842,7 +1842,7 @@
"invisible" "invisible"
] ]
}, },
"UserStatusGetUserStatus": { "UserStatusGetStatus": {
"type": "object", "type": "object",
"required": [ "required": [
"ocs" "ocs"
@ -1861,7 +1861,7 @@
"data": { "data": {
"anyOf": [ "anyOf": [
{ {
"$ref": "#/components/schemas/UserStatus" "$ref": "#/components/schemas/UserStatusStatus"
} }
] ]
} }
@ -1888,7 +1888,7 @@
"data": { "data": {
"type": "array", "type": "array",
"items": { "items": {
"$ref": "#/components/schemas/UserStatusPublicUserStatus" "$ref": "#/components/schemas/UserStatusPublicStatus"
} }
} }
} }
@ -1914,7 +1914,7 @@
"data": { "data": {
"anyOf": [ "anyOf": [
{ {
"$ref": "#/components/schemas/UserStatusPublicUserStatus" "$ref": "#/components/schemas/UserStatusPublicStatus"
} }
] ]
} }
@ -1922,7 +1922,7 @@
} }
} }
}, },
"UserStatus": { "UserStatusStatus": {
"type": "object", "type": "object",
"required": [ "required": [
"userId", "userId",
@ -1966,7 +1966,7 @@
} }
} }
}, },
"UserStatusPublicUserStatus": { "UserStatusPublicStatus": {
"type": "object", "type": "object",
"required": [ "required": [
"userId", "userId",
@ -3524,7 +3524,7 @@
"content": { "content": {
"application/json": { "application/json": {
"schema": { "schema": {
"$ref": "#/components/schemas/UserStatusGetUserStatus" "$ref": "#/components/schemas/UserStatusGetStatus"
} }
} }
} }
@ -3554,7 +3554,7 @@
"content": { "content": {
"application/json": { "application/json": {
"schema": { "schema": {
"$ref": "#/components/schemas/UserStatusGetUserStatus" "$ref": "#/components/schemas/UserStatusGetStatus"
} }
} }
} }
@ -3592,7 +3592,7 @@
"content": { "content": {
"application/json": { "application/json": {
"schema": { "schema": {
"$ref": "#/components/schemas/UserStatusGetUserStatus" "$ref": "#/components/schemas/UserStatusGetStatus"
} }
} }
} }
@ -3638,7 +3638,7 @@
"content": { "content": {
"application/json": { "application/json": {
"schema": { "schema": {
"$ref": "#/components/schemas/UserStatusGetUserStatus" "$ref": "#/components/schemas/UserStatusGetStatus"
} }
} }
} }
@ -3701,7 +3701,7 @@
"content": { "content": {
"application/json": { "application/json": {
"schema": { "schema": {
"$ref": "#/components/schemas/UserStatus" "$ref": "#/components/schemas/UserStatusStatus"
} }
} }
} }

98
packages/nextcloud/test/user_status.dart

@ -52,15 +52,15 @@ Future run(final DockerImage image) async {
test('Set status', () async { test('Set status', () async {
final response = await client.userStatus.setStatus(statusType: NextcloudUserStatusType.online); final response = await client.userStatus.setStatus(statusType: NextcloudUserStatusType.online);
expect(response.ocs.data.userStatus!.userId, 'user1'); expect(response.ocs.data.userStatusStatus!.userId, 'user1');
expect(response.ocs.data.userStatus!.message, null); expect(response.ocs.data.userStatusStatus!.message, null);
expect(response.ocs.data.userStatus!.messageId, null); expect(response.ocs.data.userStatusStatus!.messageId, null);
expect(response.ocs.data.userStatus!.messageIsPredefined, false); expect(response.ocs.data.userStatusStatus!.messageIsPredefined, false);
expect(response.ocs.data.userStatus!.icon, null); expect(response.ocs.data.userStatusStatus!.icon, null);
expect(response.ocs.data.userStatus!.clearAt.userStatusClearAt, null); expect(response.ocs.data.userStatusStatus!.clearAt.userStatusClearAt, null);
expect(response.ocs.data.userStatus!.clearAt.$int, null); expect(response.ocs.data.userStatusStatus!.clearAt.$int, null);
expect(response.ocs.data.userStatus!.status, NextcloudUserStatusType.online); expect(response.ocs.data.userStatusStatus!.status, NextcloudUserStatusType.online);
expect(response.ocs.data.userStatus!.statusIsUserDefined, true); expect(response.ocs.data.userStatusStatus!.statusIsUserDefined, true);
}); });
test('Get status', () async { test('Get status', () async {
@ -69,15 +69,15 @@ Future run(final DockerImage image) async {
await client.userStatus.setStatus(statusType: NextcloudUserStatusType.online); await client.userStatus.setStatus(statusType: NextcloudUserStatusType.online);
final response = await client.userStatus.getStatus(); final response = await client.userStatus.getStatus();
expect(response.ocs.data.userStatus!.userId, 'user1'); expect(response.ocs.data.userStatusStatus!.userId, 'user1');
expect(response.ocs.data.userStatus!.message, null); expect(response.ocs.data.userStatusStatus!.message, null);
expect(response.ocs.data.userStatus!.messageId, null); expect(response.ocs.data.userStatusStatus!.messageId, null);
expect(response.ocs.data.userStatus!.messageIsPredefined, false); expect(response.ocs.data.userStatusStatus!.messageIsPredefined, false);
expect(response.ocs.data.userStatus!.icon, null); expect(response.ocs.data.userStatusStatus!.icon, null);
expect(response.ocs.data.userStatus!.clearAt.userStatusClearAt, null); expect(response.ocs.data.userStatusStatus!.clearAt.userStatusClearAt, null);
expect(response.ocs.data.userStatus!.clearAt.$int, null); expect(response.ocs.data.userStatusStatus!.clearAt.$int, null);
expect(response.ocs.data.userStatus!.status, NextcloudUserStatusType.online); expect(response.ocs.data.userStatusStatus!.status, NextcloudUserStatusType.online);
expect(response.ocs.data.userStatus!.statusIsUserDefined, true); expect(response.ocs.data.userStatusStatus!.statusIsUserDefined, true);
}); });
test('Find all statuses', () async { test('Find all statuses', () async {
@ -101,12 +101,12 @@ Future run(final DockerImage image) async {
await client.userStatus.setStatus(statusType: NextcloudUserStatusType.online); await client.userStatus.setStatus(statusType: NextcloudUserStatusType.online);
final response = await client.userStatus.getPublicStatus(userId: 'user1'); final response = await client.userStatus.getPublicStatus(userId: 'user1');
expect(response.ocs.data.userStatusPublicUserStatus!.userId, 'user1'); expect(response.ocs.data.userStatusPublicStatus!.userId, 'user1');
expect(response.ocs.data.userStatusPublicUserStatus!.message, null); expect(response.ocs.data.userStatusPublicStatus!.message, null);
expect(response.ocs.data.userStatusPublicUserStatus!.icon, null); expect(response.ocs.data.userStatusPublicStatus!.icon, null);
expect(response.ocs.data.userStatusPublicUserStatus!.clearAt.userStatusClearAt, null); expect(response.ocs.data.userStatusPublicStatus!.clearAt.userStatusClearAt, null);
expect(response.ocs.data.userStatusPublicUserStatus!.clearAt.$int, null); expect(response.ocs.data.userStatusPublicStatus!.clearAt.$int, null);
expect(response.ocs.data.userStatusPublicUserStatus!.status, NextcloudUserStatusType.online); expect(response.ocs.data.userStatusPublicStatus!.status, NextcloudUserStatusType.online);
}); });
test('Set predefined message', () async { test('Set predefined message', () async {
@ -115,14 +115,14 @@ Future run(final DockerImage image) async {
messageId: 'meeting', messageId: 'meeting',
clearAt: clearAt, clearAt: clearAt,
); );
expect(response.ocs.data.userStatus!.userId, 'user1'); expect(response.ocs.data.userStatusStatus!.userId, 'user1');
expect(response.ocs.data.userStatus!.message, null); expect(response.ocs.data.userStatusStatus!.message, null);
expect(response.ocs.data.userStatus!.messageId, 'meeting'); expect(response.ocs.data.userStatusStatus!.messageId, 'meeting');
expect(response.ocs.data.userStatus!.messageIsPredefined, true); expect(response.ocs.data.userStatusStatus!.messageIsPredefined, true);
expect(response.ocs.data.userStatus!.icon, null); expect(response.ocs.data.userStatusStatus!.icon, null);
expect(response.ocs.data.userStatus!.clearAt.$int, clearAt); expect(response.ocs.data.userStatusStatus!.clearAt.$int, clearAt);
expect(response.ocs.data.userStatus!.status, NextcloudUserStatusType.offline); expect(response.ocs.data.userStatusStatus!.status, NextcloudUserStatusType.offline);
expect(response.ocs.data.userStatus!.statusIsUserDefined, false); expect(response.ocs.data.userStatusStatus!.statusIsUserDefined, false);
}); });
test('Set custom message', () async { test('Set custom message', () async {
@ -132,14 +132,14 @@ Future run(final DockerImage image) async {
message: 'bla', message: 'bla',
clearAt: clearAt, clearAt: clearAt,
); );
expect(response.ocs.data.userStatus!.userId, 'user1'); expect(response.ocs.data.userStatusStatus!.userId, 'user1');
expect(response.ocs.data.userStatus!.message, 'bla'); expect(response.ocs.data.userStatusStatus!.message, 'bla');
expect(response.ocs.data.userStatus!.messageId, null); expect(response.ocs.data.userStatusStatus!.messageId, null);
expect(response.ocs.data.userStatus!.messageIsPredefined, false); expect(response.ocs.data.userStatusStatus!.messageIsPredefined, false);
expect(response.ocs.data.userStatus!.icon, '😀'); expect(response.ocs.data.userStatusStatus!.icon, '😀');
expect(response.ocs.data.userStatus!.clearAt.$int, clearAt); expect(response.ocs.data.userStatusStatus!.clearAt.$int, clearAt);
expect(response.ocs.data.userStatus!.status, NextcloudUserStatusType.offline); expect(response.ocs.data.userStatusStatus!.status, NextcloudUserStatusType.offline);
expect(response.ocs.data.userStatus!.statusIsUserDefined, false); expect(response.ocs.data.userStatusStatus!.statusIsUserDefined, false);
}); });
test('Clear message', () async { test('Clear message', () async {
@ -152,15 +152,15 @@ Future run(final DockerImage image) async {
await client.userStatus.clearMessage(); await client.userStatus.clearMessage();
final response = await client.userStatus.getStatus(); final response = await client.userStatus.getStatus();
expect(response.ocs.data.userStatus!.userId, 'user1'); expect(response.ocs.data.userStatusStatus!.userId, 'user1');
expect(response.ocs.data.userStatus!.message, null); expect(response.ocs.data.userStatusStatus!.message, null);
expect(response.ocs.data.userStatus!.messageId, null); expect(response.ocs.data.userStatusStatus!.messageId, null);
expect(response.ocs.data.userStatus!.messageIsPredefined, false); expect(response.ocs.data.userStatusStatus!.messageIsPredefined, false);
expect(response.ocs.data.userStatus!.icon, null); expect(response.ocs.data.userStatusStatus!.icon, null);
expect(response.ocs.data.userStatus!.clearAt.userStatusClearAt, null); expect(response.ocs.data.userStatusStatus!.clearAt.userStatusClearAt, null);
expect(response.ocs.data.userStatus!.clearAt.$int, null); expect(response.ocs.data.userStatusStatus!.clearAt.$int, null);
expect(response.ocs.data.userStatus!.status, NextcloudUserStatusType.offline); expect(response.ocs.data.userStatusStatus!.status, NextcloudUserStatusType.offline);
expect(response.ocs.data.userStatus!.statusIsUserDefined, false); expect(response.ocs.data.userStatusStatus!.statusIsUserDefined, false);
}); });
test('Heartbeat', () async { test('Heartbeat', () async {

24
specs/core.json

@ -81,7 +81,7 @@
} }
} }
}, },
"CoreServerStatus": { "ServerStatus": {
"type": "object", "type": "object",
"required": [ "required": [
"installed", "installed",
@ -120,7 +120,7 @@
} }
} }
}, },
"CoreServerCapabilities": { "ServerCapabilities": {
"type": "object", "type": "object",
"required": [ "required": [
"ocs" "ocs"
@ -783,7 +783,7 @@
} }
} }
}, },
"CoreNavigationApps": { "NavigationApps": {
"type": "object", "type": "object",
"required": [ "required": [
"ocs" "ocs"
@ -857,7 +857,7 @@
} }
} }
}, },
"CoreLoginFlowInit": { "LoginFlowInit": {
"type": "object", "type": "object",
"required": [ "required": [
"poll", "poll",
@ -884,7 +884,7 @@
} }
} }
}, },
"CoreLoginFlowResult": { "LoginFlowResult": {
"type": "object", "type": "object",
"required": [ "required": [
"server", "server",
@ -903,7 +903,7 @@
} }
} }
}, },
"CoreAutocompleteResult": { "AutocompleteResult": {
"type": "object", "type": "object",
"required": [ "required": [
"ocs" "ocs"
@ -986,7 +986,7 @@
"content": { "content": {
"application/json": { "application/json": {
"schema": { "schema": {
"$ref": "#/components/schemas/CoreServerStatus" "$ref": "#/components/schemas/ServerStatus"
} }
} }
} }
@ -1006,7 +1006,7 @@
"content": { "content": {
"application/json": { "application/json": {
"schema": { "schema": {
"$ref": "#/components/schemas/CoreServerCapabilities" "$ref": "#/components/schemas/ServerCapabilities"
} }
} }
} }
@ -1026,7 +1026,7 @@
"content": { "content": {
"application/json": { "application/json": {
"schema": { "schema": {
"$ref": "#/components/schemas/CoreNavigationApps" "$ref": "#/components/schemas/NavigationApps"
} }
} }
} }
@ -1046,7 +1046,7 @@
"content": { "content": {
"application/json": { "application/json": {
"schema": { "schema": {
"$ref": "#/components/schemas/CoreLoginFlowInit" "$ref": "#/components/schemas/LoginFlowInit"
} }
} }
} }
@ -1076,7 +1076,7 @@
"content": { "content": {
"application/json": { "application/json": {
"schema": { "schema": {
"$ref": "#/components/schemas/CoreLoginFlowResult" "$ref": "#/components/schemas/LoginFlowResult"
} }
} }
} }
@ -1306,7 +1306,7 @@
"content": { "content": {
"application/json": { "application/json": {
"schema": { "schema": {
"$ref": "#/components/schemas/CoreAutocompleteResult" "$ref": "#/components/schemas/AutocompleteResult"
} }
} }
} }

38
specs/news.json

@ -81,7 +81,7 @@
} }
} }
}, },
"NewsListFeeds": { "ListFeeds": {
"type": "object", "type": "object",
"required": [ "required": [
"feeds" "feeds"
@ -96,12 +96,12 @@
"feeds": { "feeds": {
"type": "array", "type": "array",
"items": { "items": {
"$ref": "#/components/schemas/NewsFeed" "$ref": "#/components/schemas/Feed"
} }
} }
} }
}, },
"NewsFeed": { "Feed": {
"type": "object", "type": "object",
"required": [ "required": [
"id", "id",
@ -154,12 +154,12 @@
"items": { "items": {
"type": "array", "type": "array",
"items": { "items": {
"$ref": "#/components/schemas/NewsArticle" "$ref": "#/components/schemas/Article"
} }
} }
} }
}, },
"NewsArticle": { "Article": {
"type": "object", "type": "object",
"required": [ "required": [
"id", "id",
@ -239,7 +239,7 @@
} }
} }
}, },
"NewsListArticles": { "ListArticles": {
"type": "object", "type": "object",
"required": [ "required": [
"items" "items"
@ -248,12 +248,12 @@
"items": { "items": {
"type": "array", "type": "array",
"items": { "items": {
"$ref": "#/components/schemas/NewsArticle" "$ref": "#/components/schemas/Article"
} }
} }
} }
}, },
"NewsListFolders": { "ListFolders": {
"type": "object", "type": "object",
"required": [ "required": [
"folders" "folders"
@ -262,12 +262,12 @@
"folders": { "folders": {
"type": "array", "type": "array",
"items": { "items": {
"$ref": "#/components/schemas/NewsFolder" "$ref": "#/components/schemas/Folder"
} }
} }
} }
}, },
"NewsFolder": { "Folder": {
"type": "object", "type": "object",
"required": [ "required": [
"id", "id",
@ -290,12 +290,12 @@
"deprecated": true, "deprecated": true,
"type": "array", "type": "array",
"items": { "items": {
"$ref": "#/components/schemas/NewsFeed" "$ref": "#/components/schemas/Feed"
} }
} }
} }
}, },
"NewsSupportedAPIVersions": { "SupportedAPIVersions": {
"type": "object", "type": "object",
"properties": { "properties": {
"apiLevels": { "apiLevels": {
@ -327,7 +327,7 @@
"content": { "content": {
"application/json": { "application/json": {
"schema": { "schema": {
"$ref": "#/components/schemas/NewsSupportedAPIVersions" "$ref": "#/components/schemas/SupportedAPIVersions"
} }
} }
} }
@ -347,7 +347,7 @@
"content": { "content": {
"application/json": { "application/json": {
"schema": { "schema": {
"$ref": "#/components/schemas/NewsListFolders" "$ref": "#/components/schemas/ListFolders"
} }
} }
} }
@ -375,7 +375,7 @@
"content": { "content": {
"application/json": { "application/json": {
"schema": { "schema": {
"$ref": "#/components/schemas/NewsListFolders" "$ref": "#/components/schemas/ListFolders"
} }
} }
} }
@ -474,7 +474,7 @@
"content": { "content": {
"application/json": { "application/json": {
"schema": { "schema": {
"$ref": "#/components/schemas/NewsListFeeds" "$ref": "#/components/schemas/ListFeeds"
} }
} }
} }
@ -510,7 +510,7 @@
"content": { "content": {
"application/json": { "application/json": {
"schema": { "schema": {
"$ref": "#/components/schemas/NewsListFeeds" "$ref": "#/components/schemas/ListFeeds"
} }
} }
} }
@ -708,7 +708,7 @@
"content": { "content": {
"application/json": { "application/json": {
"schema": { "schema": {
"$ref": "#/components/schemas/NewsListArticles" "$ref": "#/components/schemas/ListArticles"
} }
} }
} }
@ -757,7 +757,7 @@
"content": { "content": {
"application/json": { "application/json": {
"schema": { "schema": {
"$ref": "#/components/schemas/NewsListArticles" "$ref": "#/components/schemas/ListArticles"
} }
} }
} }

18
specs/notes.json

@ -81,7 +81,7 @@
} }
} }
}, },
"NotesNote": { "Note": {
"type": "object", "type": "object",
"required": [ "required": [
"id", "id",
@ -128,7 +128,7 @@
} }
} }
}, },
"NotesSettings": { "Settings": {
"type": "object", "type": "object",
"required": [ "required": [
"notesPath", "notesPath",
@ -226,7 +226,7 @@
"schema": { "schema": {
"type": "array", "type": "array",
"items": { "items": {
"$ref": "#/components/schemas/NotesNote" "$ref": "#/components/schemas/Note"
} }
} }
} }
@ -292,7 +292,7 @@
"content": { "content": {
"application/json": { "application/json": {
"schema": { "schema": {
"$ref": "#/components/schemas/NotesNote" "$ref": "#/components/schemas/Note"
} }
} }
} }
@ -340,7 +340,7 @@
"content": { "content": {
"application/json": { "application/json": {
"schema": { "schema": {
"$ref": "#/components/schemas/NotesNote" "$ref": "#/components/schemas/Note"
} }
} }
} }
@ -408,7 +408,7 @@
"content": { "content": {
"application/json": { "application/json": {
"schema": { "schema": {
"$ref": "#/components/schemas/NotesNote" "$ref": "#/components/schemas/Note"
} }
} }
} }
@ -446,7 +446,7 @@
"content": { "content": {
"application/json": { "application/json": {
"schema": { "schema": {
"$ref": "#/components/schemas/NotesSettings" "$ref": "#/components/schemas/Settings"
} }
} }
} }
@ -463,7 +463,7 @@
"content": { "content": {
"application/json": { "application/json": {
"schema": { "schema": {
"$ref": "#/components/schemas/NotesSettings" "$ref": "#/components/schemas/Settings"
} }
} }
} }
@ -474,7 +474,7 @@
"content": { "content": {
"application/json": { "application/json": {
"schema": { "schema": {
"$ref": "#/components/schemas/NotesSettings" "$ref": "#/components/schemas/Settings"
} }
} }
} }

32
specs/notifications.json

@ -81,7 +81,7 @@
} }
} }
}, },
"NotificationsNotification": { "Notification": {
"type": "object", "type": "object",
"required": [ "required": [
"notification_id", "notification_id",
@ -156,12 +156,12 @@
"actions": { "actions": {
"type": "array", "type": "array",
"items": { "items": {
"$ref": "#/components/schemas/NotificationsNotificationAction" "$ref": "#/components/schemas/NotificationAction"
} }
} }
} }
}, },
"NotificationsNotificationAction": { "NotificationAction": {
"type": "object", "type": "object",
"required": [ "required": [
"label", "label",
@ -183,7 +183,7 @@
} }
} }
}, },
"NotificationsListNotifications": { "ListNotifications": {
"type": "object", "type": "object",
"required": [ "required": [
"ocs" "ocs"
@ -202,14 +202,14 @@
"data": { "data": {
"type": "array", "type": "array",
"items": { "items": {
"$ref": "#/components/schemas/NotificationsNotification" "$ref": "#/components/schemas/Notification"
} }
} }
} }
} }
} }
}, },
"NotificationsGetNotification": { "GetNotification": {
"type": "object", "type": "object",
"required": [ "required": [
"ocs" "ocs"
@ -226,13 +226,13 @@
"$ref": "#/components/schemas/OCSMeta" "$ref": "#/components/schemas/OCSMeta"
}, },
"data": { "data": {
"$ref": "#/components/schemas/NotificationsNotification" "$ref": "#/components/schemas/Notification"
} }
} }
} }
} }
}, },
"NotificationsPushServerSubscription": { "PushServerSubscription": {
"type": "object", "type": "object",
"required": [ "required": [
"publicKey", "publicKey",
@ -254,7 +254,7 @@
} }
} }
}, },
"NotificationsPushServerRegistration": { "PushServerRegistration": {
"type": "object", "type": "object",
"required": [ "required": [
"ocs" "ocs"
@ -271,13 +271,13 @@
"$ref": "#/components/schemas/OCSMeta" "$ref": "#/components/schemas/OCSMeta"
}, },
"data": { "data": {
"$ref": "#/components/schemas/NotificationsPushServerSubscription" "$ref": "#/components/schemas/PushServerSubscription"
} }
} }
} }
} }
}, },
"NotificationsPushNotification": { "PushNotification": {
"type": "object", "type": "object",
"required": [ "required": [
"accountID", "accountID",
@ -296,11 +296,11 @@
"type": "string" "type": "string"
}, },
"subject": { "subject": {
"$ref": "#/components/schemas/NotificationsPushNotificationDecryptedSubject" "$ref": "#/components/schemas/PushNotificationDecryptedSubject"
} }
} }
}, },
"NotificationsPushNotificationDecryptedSubject": { "PushNotificationDecryptedSubject": {
"type": "object", "type": "object",
"properties": { "properties": {
"nid": { "nid": {
@ -347,7 +347,7 @@
"content": { "content": {
"application/json": { "application/json": {
"schema": { "schema": {
"$ref": "#/components/schemas/NotificationsListNotifications" "$ref": "#/components/schemas/ListNotifications"
} }
} }
} }
@ -395,7 +395,7 @@
"content": { "content": {
"application/json": { "application/json": {
"schema": { "schema": {
"$ref": "#/components/schemas/NotificationsGetNotification" "$ref": "#/components/schemas/GetNotification"
} }
} }
} }
@ -460,7 +460,7 @@
"content": { "content": {
"application/json": { "application/json": {
"schema": { "schema": {
"$ref": "#/components/schemas/NotificationsPushServerRegistration" "$ref": "#/components/schemas/PushServerRegistration"
} }
} }
} }

10
specs/provisioning_api.json

@ -81,7 +81,7 @@
} }
} }
}, },
"ProvisioningApiUser": { "User": {
"type": "object", "type": "object",
"required": [ "required": [
"ocs" "ocs"
@ -98,13 +98,13 @@
"$ref": "#/components/schemas/OCSMeta" "$ref": "#/components/schemas/OCSMeta"
}, },
"data": { "data": {
"$ref": "#/components/schemas/ProvisioningApiUserDetails" "$ref": "#/components/schemas/UserDetails"
} }
} }
} }
} }
}, },
"ProvisioningApiUserDetails": { "UserDetails": {
"type": "object", "type": "object",
"required": [ "required": [
"storageLocation", "storageLocation",
@ -327,7 +327,7 @@
"content": { "content": {
"application/json": { "application/json": {
"schema": { "schema": {
"$ref": "#/components/schemas/ProvisioningApiUser" "$ref": "#/components/schemas/User"
} }
} }
} }
@ -357,7 +357,7 @@
"content": { "content": {
"application/json": { "application/json": {
"schema": { "schema": {
"$ref": "#/components/schemas/ProvisioningApiUser" "$ref": "#/components/schemas/User"
} }
} }
} }

56
specs/user_status.json

@ -81,7 +81,7 @@
} }
} }
}, },
"UserStatusPredefinedStatuses": { "PredefinedStatuses": {
"type": "object", "type": "object",
"required": [ "required": [
"ocs" "ocs"
@ -100,14 +100,14 @@
"data": { "data": {
"type": "array", "type": "array",
"items": { "items": {
"$ref": "#/components/schemas/UserStatusPredefinedStatus" "$ref": "#/components/schemas/PredefinedStatus"
} }
} }
} }
} }
} }
}, },
"UserStatusPredefinedStatus": { "PredefinedStatus": {
"type": "object", "type": "object",
"required": [ "required": [
"id", "id",
@ -128,7 +128,7 @@
"clearAt": { "clearAt": {
"anyOf": [ "anyOf": [
{ {
"$ref": "#/components/schemas/UserStatusClearAt" "$ref": "#/components/schemas/ClearAt"
}, },
{ {
"type": "integer", "type": "integer",
@ -138,7 +138,7 @@
} }
} }
}, },
"UserStatusClearAt": { "ClearAt": {
"type": "object", "type": "object",
"required": [ "required": [
"type", "type",
@ -169,7 +169,7 @@
} }
} }
}, },
"UserStatusType": { "Type": {
"type": "string", "type": "string",
"enum": [ "enum": [
"online", "online",
@ -179,7 +179,7 @@
"invisible" "invisible"
] ]
}, },
"UserStatusGetUserStatus": { "GetStatus": {
"type": "object", "type": "object",
"required": [ "required": [
"ocs" "ocs"
@ -198,7 +198,7 @@
"data": { "data": {
"anyOf": [ "anyOf": [
{ {
"$ref": "#/components/schemas/UserStatus" "$ref": "#/components/schemas/Status"
} }
] ]
} }
@ -206,7 +206,7 @@
} }
} }
}, },
"UserStatusGetPublicStatuses": { "GetPublicStatuses": {
"type": "object", "type": "object",
"required": [ "required": [
"ocs" "ocs"
@ -225,14 +225,14 @@
"data": { "data": {
"type": "array", "type": "array",
"items": { "items": {
"$ref": "#/components/schemas/UserStatusPublicUserStatus" "$ref": "#/components/schemas/PublicStatus"
} }
} }
} }
} }
} }
}, },
"UserStatusGetPublicStatus": { "GetPublicStatus": {
"type": "object", "type": "object",
"required": [ "required": [
"ocs" "ocs"
@ -251,7 +251,7 @@
"data": { "data": {
"anyOf": [ "anyOf": [
{ {
"$ref": "#/components/schemas/UserStatusPublicUserStatus" "$ref": "#/components/schemas/PublicStatus"
} }
] ]
} }
@ -259,7 +259,7 @@
} }
} }
}, },
"UserStatus": { "Status": {
"type": "object", "type": "object",
"required": [ "required": [
"userId", "userId",
@ -287,7 +287,7 @@
"clearAt": { "clearAt": {
"anyOf": [ "anyOf": [
{ {
"$ref": "#/components/schemas/UserStatusClearAt" "$ref": "#/components/schemas/ClearAt"
}, },
{ {
"type": "integer", "type": "integer",
@ -296,14 +296,14 @@
] ]
}, },
"status": { "status": {
"$ref": "#/components/schemas/UserStatusType" "$ref": "#/components/schemas/Type"
}, },
"statusIsUserDefined": { "statusIsUserDefined": {
"type": "boolean" "type": "boolean"
} }
} }
}, },
"UserStatusPublicUserStatus": { "PublicStatus": {
"type": "object", "type": "object",
"required": [ "required": [
"userId", "userId",
@ -323,7 +323,7 @@
"clearAt": { "clearAt": {
"anyOf": [ "anyOf": [
{ {
"$ref": "#/components/schemas/UserStatusClearAt" "$ref": "#/components/schemas/ClearAt"
}, },
{ {
"type": "integer", "type": "integer",
@ -332,7 +332,7 @@
] ]
}, },
"status": { "status": {
"$ref": "#/components/schemas/UserStatusType" "$ref": "#/components/schemas/Type"
} }
} }
} }
@ -357,7 +357,7 @@
"content": { "content": {
"application/json": { "application/json": {
"schema": { "schema": {
"$ref": "#/components/schemas/UserStatusGetPublicStatuses" "$ref": "#/components/schemas/GetPublicStatuses"
} }
} }
} }
@ -387,7 +387,7 @@
"content": { "content": {
"application/json": { "application/json": {
"schema": { "schema": {
"$ref": "#/components/schemas/UserStatusGetPublicStatus" "$ref": "#/components/schemas/GetPublicStatus"
} }
} }
} }
@ -407,7 +407,7 @@
"content": { "content": {
"application/json": { "application/json": {
"schema": { "schema": {
"$ref": "#/components/schemas/UserStatusGetUserStatus" "$ref": "#/components/schemas/GetStatus"
} }
} }
} }
@ -427,7 +427,7 @@
"in": "query", "in": "query",
"required": true, "required": true,
"schema": { "schema": {
"$ref": "#/components/schemas/UserStatusType" "$ref": "#/components/schemas/Type"
} }
} }
], ],
@ -437,7 +437,7 @@
"content": { "content": {
"application/json": { "application/json": {
"schema": { "schema": {
"$ref": "#/components/schemas/UserStatusGetUserStatus" "$ref": "#/components/schemas/GetStatus"
} }
} }
} }
@ -475,7 +475,7 @@
"content": { "content": {
"application/json": { "application/json": {
"schema": { "schema": {
"$ref": "#/components/schemas/UserStatusGetUserStatus" "$ref": "#/components/schemas/GetStatus"
} }
} }
} }
@ -521,7 +521,7 @@
"content": { "content": {
"application/json": { "application/json": {
"schema": { "schema": {
"$ref": "#/components/schemas/UserStatusGetUserStatus" "$ref": "#/components/schemas/GetStatus"
} }
} }
} }
@ -554,7 +554,7 @@
"content": { "content": {
"application/json": { "application/json": {
"schema": { "schema": {
"$ref": "#/components/schemas/UserStatusPredefinedStatuses" "$ref": "#/components/schemas/PredefinedStatuses"
} }
} }
} }
@ -574,7 +574,7 @@
"in": "query", "in": "query",
"required": true, "required": true,
"schema": { "schema": {
"$ref": "#/components/schemas/UserStatusType" "$ref": "#/components/schemas/Type"
} }
} }
], ],
@ -584,7 +584,7 @@
"content": { "content": {
"application/json": { "application/json": {
"schema": { "schema": {
"$ref": "#/components/schemas/UserStatus" "$ref": "#/components/schemas/Status"
} }
} }
} }

19
tool/generate-nextcloud.sh

@ -6,12 +6,25 @@ rm -rf /tmp/nextcloud-neon
mkdir -p /tmp/nextcloud-neon mkdir -p /tmp/nextcloud-neon
codenames=(core news notes notifications provisioning_api user_status) codenames=(core news notes notifications provisioning_api user_status)
prefixes=(Core News Notes Notifications ProvisioningApi UserStatus)
base_spec=/tmp/nextcloud-neon/base.json base_spec=/tmp/nextcloud-neon/base.json
merged_spec=/tmp/nextcloud-neon/merged.json merged_spec=/tmp/nextcloud-neon/merged.json
for codename in ${codenames[*]}; do for i in $(seq 0 $((${#codenames[@]} - 1))); do
codename=${codenames[i]}
prefix=${prefixes[i]}
cp specs/"$codename".json /tmp/nextcloud-neon/"$codename".json
jq \
--arg prefix "$prefix" \
-s \
'.[]
| .components.schemas = (.components.schemas | with_entries(.key = if .key == "OCSMeta" or .key == "EmptyOCS" then .key else $prefix + .key end))
| walk(if type == "object" and has("$ref") and ."$ref" != "#/components/schemas/OCSMeta" and ."$ref" != "#/components/schemas/EmptyOCS" then ."$ref" |= sub("#/components/schemas/";"#/components/schemas/" + $prefix) else . end)' \
/tmp/nextcloud-neon/"$codename".json \
> /tmp/nextcloud-neon/"$codename"-prefixed.json
if [ ! -f $base_spec ]; then if [ ! -f $base_spec ]; then
cp specs/"$codename".json $base_spec cp /tmp/nextcloud-neon/"$codename"-prefixed.json $base_spec
else else
jq \ jq \
-s \ -s \
@ -23,7 +36,7 @@ for codename in ${codenames[*]}; do
paths: (.[0].paths * .[1].paths), paths: (.[0].paths * .[1].paths),
}' \ }' \
$base_spec \ $base_spec \
specs/"$codename".json \ /tmp/nextcloud-neon/"$codename"-prefixed.json \
> $merged_spec > $merged_spec
cp $merged_spec $base_spec cp $merged_spec $base_spec
fi fi

Loading…
Cancel
Save