Browse Source

specs,nextcloud: Update user status method names

pull/168/head
jld3103 2 years ago
parent
commit
34e90facd0
No known key found for this signature in database
GPG Key ID: 9062417B9E8EB7B3
  1. 142
      packages/nextcloud/lib/src/nextcloud.openapi.dart
  2. 32
      packages/nextcloud/lib/src/nextcloud.openapi.g.dart
  3. 14
      packages/nextcloud/lib/src/nextcloud.openapi.json
  4. 8
      packages/nextcloud/test/user_status.dart
  5. 14
      specs/user_status.json

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

@ -1181,7 +1181,7 @@ class NextcloudUserStatusClient {
final NextcloudClient rootClient; final NextcloudClient rootClient;
Future<NextcloudUserStatusFindAllStatuses> findAllStatuses() async { Future<NextcloudUserStatusGetPublicStatuses> getPublicStatuses() async {
var path = '/ocs/v2.php/apps/user_status/api/v1/statuses'; var path = '/ocs/v2.php/apps/user_status/api/v1/statuses';
final queryParameters = <String, dynamic>{}; final queryParameters = <String, dynamic>{};
final headers = <String, String>{}; final headers = <String, String>{};
@ -1193,13 +1193,13 @@ class NextcloudUserStatusClient {
body, body,
); );
if (response.statusCode == 200) { if (response.statusCode == 200) {
return NextcloudUserStatusFindAllStatuses.fromJson( return NextcloudUserStatusGetPublicStatuses.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<NextcloudUserStatusFindStatus> findStatus({required String userId}) async { Future<NextcloudUserStatusGetPublicStatus> getPublicStatus({required String userId}) async {
var path = '/ocs/v2.php/apps/user_status/api/v1/statuses/{userId}'; var path = '/ocs/v2.php/apps/user_status/api/v1/statuses/{userId}';
final queryParameters = <String, dynamic>{}; final queryParameters = <String, dynamic>{};
final headers = <String, String>{}; final headers = <String, String>{};
@ -1212,7 +1212,7 @@ class NextcloudUserStatusClient {
body, body,
); );
if (response.statusCode == 200) { if (response.statusCode == 200) {
return NextcloudUserStatusFindStatus.fromJson( return NextcloudUserStatusGetPublicStatus.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
@ -1328,7 +1328,7 @@ class NextcloudUserStatusClient {
throw NextcloudApiException.fromResponse(response); // coverage:ignore-line throw NextcloudApiException.fromResponse(response); // coverage:ignore-line
} }
Future<NextcloudUserStatusPredefinedStatuses> findAllPredefinedStatuses() async { Future<NextcloudUserStatusPredefinedStatuses> getPredefinedStatuses() async {
var path = '/ocs/v2.php/apps/user_status/api/v1/predefined_statuses'; var path = '/ocs/v2.php/apps/user_status/api/v1/predefined_statuses';
final queryParameters = <String, dynamic>{}; final queryParameters = <String, dynamic>{};
final headers = <String, String>{}; final headers = <String, String>{};
@ -4742,20 +4742,20 @@ class NextcloudUserStatusPublicUserStatus {
} }
@JsonSerializable() @JsonSerializable()
class NextcloudUserStatusFindAllStatuses_Ocs { class NextcloudUserStatusGetPublicStatuses_Ocs {
NextcloudUserStatusFindAllStatuses_Ocs({ NextcloudUserStatusGetPublicStatuses_Ocs({
required this.meta, required this.meta,
required this.data, required this.data,
}); });
// coverage:ignore-start // coverage:ignore-start
factory NextcloudUserStatusFindAllStatuses_Ocs.fromJson(Map<String, dynamic> json) => factory NextcloudUserStatusGetPublicStatuses_Ocs.fromJson(Map<String, dynamic> json) =>
_$NextcloudUserStatusFindAllStatuses_OcsFromJson(json); _$NextcloudUserStatusGetPublicStatuses_OcsFromJson(json);
// coverage:ignore-end // coverage:ignore-end
// coverage:ignore-start // coverage:ignore-start
factory NextcloudUserStatusFindAllStatuses_Ocs.fromJsonString(String data) => factory NextcloudUserStatusGetPublicStatuses_Ocs.fromJsonString(String data) =>
NextcloudUserStatusFindAllStatuses_Ocs.fromJson(json.decode(data) as Map<String, dynamic>); NextcloudUserStatusGetPublicStatuses_Ocs.fromJson(json.decode(data) as Map<String, dynamic>);
// coverage:ignore-end // coverage:ignore-end
final NextcloudOCSMeta meta; final NextcloudOCSMeta meta;
@ -4763,55 +4763,55 @@ class NextcloudUserStatusFindAllStatuses_Ocs {
final List<NextcloudUserStatusPublicUserStatus> data; final List<NextcloudUserStatusPublicUserStatus> data;
// coverage:ignore-start // coverage:ignore-start
Map<String, dynamic> toJson() => _$NextcloudUserStatusFindAllStatuses_OcsToJson(this); Map<String, dynamic> toJson() => _$NextcloudUserStatusGetPublicStatuses_OcsToJson(this);
// coverage:ignore-end // coverage:ignore-end
static String? toJsonString(NextcloudUserStatusFindAllStatuses_Ocs? data) => static String? toJsonString(NextcloudUserStatusGetPublicStatuses_Ocs? data) =>
data == null ? null : json.encode(data.toJson()); data == null ? null : json.encode(data.toJson());
} }
@JsonSerializable() @JsonSerializable()
class NextcloudUserStatusFindAllStatuses { class NextcloudUserStatusGetPublicStatuses {
NextcloudUserStatusFindAllStatuses({required this.ocs}); NextcloudUserStatusGetPublicStatuses({required this.ocs});
// coverage:ignore-start // coverage:ignore-start
factory NextcloudUserStatusFindAllStatuses.fromJson(Map<String, dynamic> json) => factory NextcloudUserStatusGetPublicStatuses.fromJson(Map<String, dynamic> json) =>
_$NextcloudUserStatusFindAllStatusesFromJson(json); _$NextcloudUserStatusGetPublicStatusesFromJson(json);
// coverage:ignore-end // coverage:ignore-end
// coverage:ignore-start // coverage:ignore-start
factory NextcloudUserStatusFindAllStatuses.fromJsonString(String data) => factory NextcloudUserStatusGetPublicStatuses.fromJsonString(String data) =>
NextcloudUserStatusFindAllStatuses.fromJson(json.decode(data) as Map<String, dynamic>); NextcloudUserStatusGetPublicStatuses.fromJson(json.decode(data) as Map<String, dynamic>);
// coverage:ignore-end // coverage:ignore-end
final NextcloudUserStatusFindAllStatuses_Ocs ocs; final NextcloudUserStatusGetPublicStatuses_Ocs ocs;
// coverage:ignore-start // coverage:ignore-start
Map<String, dynamic> toJson() => _$NextcloudUserStatusFindAllStatusesToJson(this); Map<String, dynamic> toJson() => _$NextcloudUserStatusGetPublicStatusesToJson(this);
// coverage:ignore-end // coverage:ignore-end
static String? toJsonString(NextcloudUserStatusFindAllStatuses? data) => static String? toJsonString(NextcloudUserStatusGetPublicStatuses? data) =>
data == null ? null : json.encode(data.toJson()); data == null ? null : json.encode(data.toJson());
} }
class NextcloudUserStatusFindStatus_Ocs_Data { class NextcloudUserStatusGetPublicStatus_Ocs_Data {
NextcloudUserStatusFindStatus_Ocs_Data( NextcloudUserStatusGetPublicStatus_Ocs_Data(
this._data, { this._data, {
this.userStatusPublicUserStatus, this.userStatusPublicUserStatus,
}); });
factory NextcloudUserStatusFindStatus_Ocs_Data.fromJson(dynamic data) { factory NextcloudUserStatusGetPublicStatus_Ocs_Data.fromJson(dynamic data) {
NextcloudUserStatusPublicUserStatus? userStatusPublicUserStatus; NextcloudUserStatusPublicUserStatus? userStatusPublicUserStatus;
try { try {
userStatusPublicUserStatus = NextcloudUserStatusPublicUserStatus.fromJson(data as Map<String, dynamic>); userStatusPublicUserStatus = NextcloudUserStatusPublicUserStatus.fromJson(data as Map<String, dynamic>);
} catch (_) {} } catch (_) {}
return NextcloudUserStatusFindStatus_Ocs_Data( return NextcloudUserStatusGetPublicStatus_Ocs_Data(
data, data,
userStatusPublicUserStatus: userStatusPublicUserStatus, userStatusPublicUserStatus: userStatusPublicUserStatus,
); );
} }
// coverage:ignore-start // coverage:ignore-start
factory NextcloudUserStatusFindStatus_Ocs_Data.fromJsonString(String data) => factory NextcloudUserStatusGetPublicStatus_Ocs_Data.fromJsonString(String data) =>
NextcloudUserStatusFindStatus_Ocs_Data.fromJson(json.decode(data)); NextcloudUserStatusGetPublicStatus_Ocs_Data.fromJson(json.decode(data));
// coverage:ignore-end // coverage:ignore-end
final dynamic _data; final dynamic _data;
@ -4827,53 +4827,54 @@ class NextcloudUserStatusFindStatus_Ocs_Data {
} }
@JsonSerializable() @JsonSerializable()
class NextcloudUserStatusFindStatus_Ocs { class NextcloudUserStatusGetPublicStatus_Ocs {
NextcloudUserStatusFindStatus_Ocs({ NextcloudUserStatusGetPublicStatus_Ocs({
required this.meta, required this.meta,
required this.data, required this.data,
}); });
// coverage:ignore-start // coverage:ignore-start
factory NextcloudUserStatusFindStatus_Ocs.fromJson(Map<String, dynamic> json) => factory NextcloudUserStatusGetPublicStatus_Ocs.fromJson(Map<String, dynamic> json) =>
_$NextcloudUserStatusFindStatus_OcsFromJson(json); _$NextcloudUserStatusGetPublicStatus_OcsFromJson(json);
// coverage:ignore-end // coverage:ignore-end
// coverage:ignore-start // coverage:ignore-start
factory NextcloudUserStatusFindStatus_Ocs.fromJsonString(String data) => factory NextcloudUserStatusGetPublicStatus_Ocs.fromJsonString(String data) =>
NextcloudUserStatusFindStatus_Ocs.fromJson(json.decode(data) as Map<String, dynamic>); NextcloudUserStatusGetPublicStatus_Ocs.fromJson(json.decode(data) as Map<String, dynamic>);
// coverage:ignore-end // coverage:ignore-end
final NextcloudOCSMeta meta; final NextcloudOCSMeta meta;
final NextcloudUserStatusFindStatus_Ocs_Data data; final NextcloudUserStatusGetPublicStatus_Ocs_Data data;
// coverage:ignore-start // coverage:ignore-start
Map<String, dynamic> toJson() => _$NextcloudUserStatusFindStatus_OcsToJson(this); Map<String, dynamic> toJson() => _$NextcloudUserStatusGetPublicStatus_OcsToJson(this);
// coverage:ignore-end // coverage:ignore-end
static String? toJsonString(NextcloudUserStatusFindStatus_Ocs? data) => static String? toJsonString(NextcloudUserStatusGetPublicStatus_Ocs? data) =>
data == null ? null : json.encode(data.toJson()); data == null ? null : json.encode(data.toJson());
} }
@JsonSerializable() @JsonSerializable()
class NextcloudUserStatusFindStatus { class NextcloudUserStatusGetPublicStatus {
NextcloudUserStatusFindStatus({required this.ocs}); NextcloudUserStatusGetPublicStatus({required this.ocs});
// coverage:ignore-start // coverage:ignore-start
factory NextcloudUserStatusFindStatus.fromJson(Map<String, dynamic> json) => factory NextcloudUserStatusGetPublicStatus.fromJson(Map<String, dynamic> json) =>
_$NextcloudUserStatusFindStatusFromJson(json); _$NextcloudUserStatusGetPublicStatusFromJson(json);
// coverage:ignore-end // coverage:ignore-end
// coverage:ignore-start // coverage:ignore-start
factory NextcloudUserStatusFindStatus.fromJsonString(String data) => factory NextcloudUserStatusGetPublicStatus.fromJsonString(String data) =>
NextcloudUserStatusFindStatus.fromJson(json.decode(data) as Map<String, dynamic>); NextcloudUserStatusGetPublicStatus.fromJson(json.decode(data) as Map<String, dynamic>);
// coverage:ignore-end // coverage:ignore-end
final NextcloudUserStatusFindStatus_Ocs ocs; final NextcloudUserStatusGetPublicStatus_Ocs ocs;
// coverage:ignore-start // coverage:ignore-start
Map<String, dynamic> toJson() => _$NextcloudUserStatusFindStatusToJson(this); Map<String, dynamic> toJson() => _$NextcloudUserStatusGetPublicStatusToJson(this);
// coverage:ignore-end // coverage:ignore-end
static String? toJsonString(NextcloudUserStatusFindStatus? data) => data == null ? null : json.encode(data.toJson()); static String? toJsonString(NextcloudUserStatusGetPublicStatus? data) =>
data == null ? null : json.encode(data.toJson());
} }
class NextcloudUserStatus_ClearAt { class NextcloudUserStatus_ClearAt {
@ -5722,14 +5723,15 @@ final _deserializers = <Type, dynamic Function(dynamic)>{
List<NextcloudProvisioningApiUserDetails_BackendCapabilities>: (final data) => (data as List) List<NextcloudProvisioningApiUserDetails_BackendCapabilities>: (final data) => (data as List)
.map((final e) => NextcloudProvisioningApiUserDetails_BackendCapabilities.fromJson(e as Map<String, dynamic>)) .map((final e) => NextcloudProvisioningApiUserDetails_BackendCapabilities.fromJson(e as Map<String, dynamic>))
.toList(), .toList(),
NextcloudUserStatusFindAllStatuses: (final data) => NextcloudUserStatusGetPublicStatuses: (final data) =>
NextcloudUserStatusFindAllStatuses.fromJson(data as Map<String, dynamic>), NextcloudUserStatusGetPublicStatuses.fromJson(data as Map<String, dynamic>),
List<NextcloudUserStatusFindAllStatuses>: (final data) => List<NextcloudUserStatusGetPublicStatuses>: (final data) => (data as List)
(data as List).map((final e) => NextcloudUserStatusFindAllStatuses.fromJson(e as Map<String, dynamic>)).toList(), .map((final e) => NextcloudUserStatusGetPublicStatuses.fromJson(e as Map<String, dynamic>))
NextcloudUserStatusFindAllStatuses_Ocs: (final data) => .toList(),
NextcloudUserStatusFindAllStatuses_Ocs.fromJson(data as Map<String, dynamic>), NextcloudUserStatusGetPublicStatuses_Ocs: (final data) =>
List<NextcloudUserStatusFindAllStatuses_Ocs>: (final data) => (data as List) NextcloudUserStatusGetPublicStatuses_Ocs.fromJson(data as Map<String, dynamic>),
.map((final e) => NextcloudUserStatusFindAllStatuses_Ocs.fromJson(e as Map<String, dynamic>)) List<NextcloudUserStatusGetPublicStatuses_Ocs>: (final data) => (data as List)
.map((final e) => NextcloudUserStatusGetPublicStatuses_Ocs.fromJson(e as Map<String, dynamic>))
.toList(), .toList(),
NextcloudUserStatusPublicUserStatus: (final data) => NextcloudUserStatusPublicUserStatus: (final data) =>
NextcloudUserStatusPublicUserStatus.fromJson(data as Map<String, dynamic>), NextcloudUserStatusPublicUserStatus.fromJson(data as Map<String, dynamic>),
@ -5738,13 +5740,15 @@ final _deserializers = <Type, dynamic Function(dynamic)>{
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(),
NextcloudUserStatusFindStatus: (final data) => NextcloudUserStatusFindStatus.fromJson(data as Map<String, dynamic>), NextcloudUserStatusGetPublicStatus: (final data) =>
List<NextcloudUserStatusFindStatus>: (final data) => NextcloudUserStatusGetPublicStatus.fromJson(data as Map<String, dynamic>),
(data as List).map((final e) => NextcloudUserStatusFindStatus.fromJson(e as Map<String, dynamic>)).toList(), List<NextcloudUserStatusGetPublicStatus>: (final data) =>
NextcloudUserStatusFindStatus_Ocs: (final data) => (data as List).map((final e) => NextcloudUserStatusGetPublicStatus.fromJson(e as Map<String, dynamic>)).toList(),
NextcloudUserStatusFindStatus_Ocs.fromJson(data as Map<String, dynamic>), NextcloudUserStatusGetPublicStatus_Ocs: (final data) =>
List<NextcloudUserStatusFindStatus_Ocs>: (final data) => NextcloudUserStatusGetPublicStatus_Ocs.fromJson(data as Map<String, dynamic>),
(data as List).map((final e) => NextcloudUserStatusFindStatus_Ocs.fromJson(e as Map<String, dynamic>)).toList(), List<NextcloudUserStatusGetPublicStatus_Ocs>: (final data) => (data as List)
.map((final e) => NextcloudUserStatusGetPublicStatus_Ocs.fromJson(e as Map<String, dynamic>))
.toList(),
NextcloudUserStatusGetUserStatus: (final data) => NextcloudUserStatusGetUserStatus: (final data) =>
NextcloudUserStatusGetUserStatus.fromJson(data as Map<String, dynamic>), NextcloudUserStatusGetUserStatus.fromJson(data as Map<String, dynamic>),
List<NextcloudUserStatusGetUserStatus>: (final data) => List<NextcloudUserStatusGetUserStatus>: (final data) =>
@ -6010,18 +6014,18 @@ final _serializers = <Type, dynamic Function(dynamic)>{
NextcloudProvisioningApiUserDetails_BackendCapabilities: (final data) => data.toJson(), NextcloudProvisioningApiUserDetails_BackendCapabilities: (final data) => data.toJson(),
List<NextcloudProvisioningApiUserDetails_BackendCapabilities>: (final data) => List<NextcloudProvisioningApiUserDetails_BackendCapabilities>: (final data) =>
data.map((final e) => e.toJson()).toList(), data.map((final e) => e.toJson()).toList(),
NextcloudUserStatusFindAllStatuses: (final data) => data.toJson(), NextcloudUserStatusGetPublicStatuses: (final data) => data.toJson(),
List<NextcloudUserStatusFindAllStatuses>: (final data) => data.map((final e) => e.toJson()).toList(), List<NextcloudUserStatusGetPublicStatuses>: (final data) => data.map((final e) => e.toJson()).toList(),
NextcloudUserStatusFindAllStatuses_Ocs: (final data) => data.toJson(), NextcloudUserStatusGetPublicStatuses_Ocs: (final data) => data.toJson(),
List<NextcloudUserStatusFindAllStatuses_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(), NextcloudUserStatusPublicUserStatus: (final data) => data.toJson(),
List<NextcloudUserStatusPublicUserStatus>: (final data) => data.map((final e) => e.toJson()).toList(), List<NextcloudUserStatusPublicUserStatus>: (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(),
NextcloudUserStatusFindStatus: (final data) => data.toJson(), NextcloudUserStatusGetPublicStatus: (final data) => data.toJson(),
List<NextcloudUserStatusFindStatus>: (final data) => data.map((final e) => e.toJson()).toList(), List<NextcloudUserStatusGetPublicStatus>: (final data) => data.map((final e) => e.toJson()).toList(),
NextcloudUserStatusFindStatus_Ocs: (final data) => data.toJson(), NextcloudUserStatusGetPublicStatus_Ocs: (final data) => data.toJson(),
List<NextcloudUserStatusFindStatus_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(), NextcloudUserStatusGetUserStatus: (final data) => data.toJson(),
List<NextcloudUserStatusGetUserStatus>: (final data) => data.map((final e) => e.toJson()).toList(), List<NextcloudUserStatusGetUserStatus>: (final data) => data.map((final e) => e.toJson()).toList(),
NextcloudUserStatusGetUserStatus_Ocs: (final data) => data.toJson(), NextcloudUserStatusGetUserStatus_Ocs: (final data) => data.toJson(),

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

@ -2001,12 +2001,12 @@ const _$NextcloudUserStatusTypeEnumMap = {
NextcloudUserStatusType.invisible: 'invisible', NextcloudUserStatusType.invisible: 'invisible',
}; };
NextcloudUserStatusFindAllStatuses_Ocs _$NextcloudUserStatusFindAllStatuses_OcsFromJson(Map<String, dynamic> json) { NextcloudUserStatusGetPublicStatuses_Ocs _$NextcloudUserStatusGetPublicStatuses_OcsFromJson(Map<String, dynamic> json) {
$checkKeys( $checkKeys(
json, json,
allowedKeys: const ['meta', 'data'], allowedKeys: const ['meta', 'data'],
); );
return NextcloudUserStatusFindAllStatuses_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) => NextcloudUserStatusPublicUserStatus.fromJson(e as Map<String, dynamic>))
@ -2014,55 +2014,57 @@ NextcloudUserStatusFindAllStatuses_Ocs _$NextcloudUserStatusFindAllStatuses_OcsF
); );
} }
Map<String, dynamic> _$NextcloudUserStatusFindAllStatuses_OcsToJson(NextcloudUserStatusFindAllStatuses_Ocs instance) => Map<String, dynamic> _$NextcloudUserStatusGetPublicStatuses_OcsToJson(
NextcloudUserStatusGetPublicStatuses_Ocs instance) =>
<String, dynamic>{ <String, dynamic>{
'meta': instance.meta.toJson(), 'meta': instance.meta.toJson(),
'data': instance.data.map((e) => e.toJson()).toList(), 'data': instance.data.map((e) => e.toJson()).toList(),
}; };
NextcloudUserStatusFindAllStatuses _$NextcloudUserStatusFindAllStatusesFromJson(Map<String, dynamic> json) { NextcloudUserStatusGetPublicStatuses _$NextcloudUserStatusGetPublicStatusesFromJson(Map<String, dynamic> json) {
$checkKeys( $checkKeys(
json, json,
allowedKeys: const ['ocs'], allowedKeys: const ['ocs'],
); );
return NextcloudUserStatusFindAllStatuses( return NextcloudUserStatusGetPublicStatuses(
ocs: NextcloudUserStatusFindAllStatuses_Ocs.fromJson(json['ocs'] as Map<String, dynamic>), ocs: NextcloudUserStatusGetPublicStatuses_Ocs.fromJson(json['ocs'] as Map<String, dynamic>),
); );
} }
Map<String, dynamic> _$NextcloudUserStatusFindAllStatusesToJson(NextcloudUserStatusFindAllStatuses instance) => Map<String, dynamic> _$NextcloudUserStatusGetPublicStatusesToJson(NextcloudUserStatusGetPublicStatuses instance) =>
<String, dynamic>{ <String, dynamic>{
'ocs': instance.ocs.toJson(), 'ocs': instance.ocs.toJson(),
}; };
NextcloudUserStatusFindStatus_Ocs _$NextcloudUserStatusFindStatus_OcsFromJson(Map<String, dynamic> json) { NextcloudUserStatusGetPublicStatus_Ocs _$NextcloudUserStatusGetPublicStatus_OcsFromJson(Map<String, dynamic> json) {
$checkKeys( $checkKeys(
json, json,
allowedKeys: const ['meta', 'data'], allowedKeys: const ['meta', 'data'],
); );
return NextcloudUserStatusFindStatus_Ocs( return NextcloudUserStatusGetPublicStatus_Ocs(
meta: NextcloudOCSMeta.fromJson(json['meta'] as Map<String, dynamic>), meta: NextcloudOCSMeta.fromJson(json['meta'] as Map<String, dynamic>),
data: NextcloudUserStatusFindStatus_Ocs_Data.fromJson(json['data']), data: NextcloudUserStatusGetPublicStatus_Ocs_Data.fromJson(json['data']),
); );
} }
Map<String, dynamic> _$NextcloudUserStatusFindStatus_OcsToJson(NextcloudUserStatusFindStatus_Ocs instance) => Map<String, dynamic> _$NextcloudUserStatusGetPublicStatus_OcsToJson(NextcloudUserStatusGetPublicStatus_Ocs instance) =>
<String, dynamic>{ <String, dynamic>{
'meta': instance.meta.toJson(), 'meta': instance.meta.toJson(),
'data': instance.data.toJson(), 'data': instance.data.toJson(),
}; };
NextcloudUserStatusFindStatus _$NextcloudUserStatusFindStatusFromJson(Map<String, dynamic> json) { NextcloudUserStatusGetPublicStatus _$NextcloudUserStatusGetPublicStatusFromJson(Map<String, dynamic> json) {
$checkKeys( $checkKeys(
json, json,
allowedKeys: const ['ocs'], allowedKeys: const ['ocs'],
); );
return NextcloudUserStatusFindStatus( return NextcloudUserStatusGetPublicStatus(
ocs: NextcloudUserStatusFindStatus_Ocs.fromJson(json['ocs'] as Map<String, dynamic>), ocs: NextcloudUserStatusGetPublicStatus_Ocs.fromJson(json['ocs'] as Map<String, dynamic>),
); );
} }
Map<String, dynamic> _$NextcloudUserStatusFindStatusToJson(NextcloudUserStatusFindStatus instance) => <String, dynamic>{ Map<String, dynamic> _$NextcloudUserStatusGetPublicStatusToJson(NextcloudUserStatusGetPublicStatus instance) =>
<String, dynamic>{
'ocs': instance.ocs.toJson(), 'ocs': instance.ocs.toJson(),
}; };

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

@ -1869,7 +1869,7 @@
} }
} }
}, },
"UserStatusFindAllStatuses": { "UserStatusGetPublicStatuses": {
"type": "object", "type": "object",
"required": [ "required": [
"ocs" "ocs"
@ -1895,7 +1895,7 @@
} }
} }
}, },
"UserStatusFindStatus": { "UserStatusGetPublicStatus": {
"type": "object", "type": "object",
"required": [ "required": [
"ocs" "ocs"
@ -3464,7 +3464,7 @@
}, },
"/ocs/v2.php/apps/user_status/api/v1/statuses": { "/ocs/v2.php/apps/user_status/api/v1/statuses": {
"get": { "get": {
"operationId": "find-all-statuses", "operationId": "get-public-statuses",
"tags": [ "tags": [
"user_status" "user_status"
], ],
@ -3474,7 +3474,7 @@
"content": { "content": {
"application/json": { "application/json": {
"schema": { "schema": {
"$ref": "#/components/schemas/UserStatusFindAllStatuses" "$ref": "#/components/schemas/UserStatusGetPublicStatuses"
} }
} }
} }
@ -3494,7 +3494,7 @@
} }
], ],
"get": { "get": {
"operationId": "find-status", "operationId": "get-public-status",
"tags": [ "tags": [
"user_status" "user_status"
], ],
@ -3504,7 +3504,7 @@
"content": { "content": {
"application/json": { "application/json": {
"schema": { "schema": {
"$ref": "#/components/schemas/UserStatusFindStatus" "$ref": "#/components/schemas/UserStatusGetPublicStatus"
} }
} }
} }
@ -3661,7 +3661,7 @@
}, },
"/ocs/v2.php/apps/user_status/api/v1/predefined_statuses": { "/ocs/v2.php/apps/user_status/api/v1/predefined_statuses": {
"get": { "get": {
"operationId": "find-all-predefined-statuses", "operationId": "get-predefined-statuses",
"tags": [ "tags": [
"user_status" "user_status"
], ],

8
packages/nextcloud/test/user_status.dart

@ -19,7 +19,7 @@ Future run(final DockerImage image) async {
test('Find all predefined statuses', () async { test('Find all predefined statuses', () async {
final expectedStatusIDs = ['meeting', 'commuting', 'remote-work', 'sick-leave', 'vacationing']; final expectedStatusIDs = ['meeting', 'commuting', 'remote-work', 'sick-leave', 'vacationing'];
final response = await client.userStatus.findAllPredefinedStatuses(); final response = await client.userStatus.getPredefinedStatuses();
expect(response.ocs.data, hasLength(5)); expect(response.ocs.data, hasLength(5));
final responseIDs = response.ocs.data.map((final status) => status.id); final responseIDs = response.ocs.data.map((final status) => status.id);
expect(expectedStatusIDs.map(responseIDs.contains).contains(false), false); expect(expectedStatusIDs.map(responseIDs.contains).contains(false), false);
@ -81,12 +81,12 @@ Future run(final DockerImage image) async {
}); });
test('Find all statuses', () async { test('Find all statuses', () async {
var response = await client.userStatus.findAllStatuses(); var response = await client.userStatus.getPublicStatuses();
expect(response.ocs.data, hasLength(0)); expect(response.ocs.data, hasLength(0));
await client.userStatus.setStatus(statusType: NextcloudUserStatusType.online); await client.userStatus.setStatus(statusType: NextcloudUserStatusType.online);
response = await client.userStatus.findAllStatuses(); response = await client.userStatus.getPublicStatuses();
expect(response.ocs.data, hasLength(1)); expect(response.ocs.data, hasLength(1));
expect(response.ocs.data[0].userId, 'user1'); expect(response.ocs.data[0].userId, 'user1');
expect(response.ocs.data[0].message, null); expect(response.ocs.data[0].message, null);
@ -100,7 +100,7 @@ Future run(final DockerImage image) async {
// Same as getting status // Same as getting status
await client.userStatus.setStatus(statusType: NextcloudUserStatusType.online); await client.userStatus.setStatus(statusType: NextcloudUserStatusType.online);
final response = await client.userStatus.findStatus(userId: 'user1'); final response = await client.userStatus.getPublicStatus(userId: 'user1');
expect(response.ocs.data.userStatusPublicUserStatus!.userId, 'user1'); expect(response.ocs.data.userStatusPublicUserStatus!.userId, 'user1');
expect(response.ocs.data.userStatusPublicUserStatus!.message, null); expect(response.ocs.data.userStatusPublicUserStatus!.message, null);
expect(response.ocs.data.userStatusPublicUserStatus!.icon, null); expect(response.ocs.data.userStatusPublicUserStatus!.icon, null);

14
specs/user_status.json

@ -206,7 +206,7 @@
} }
} }
}, },
"UserStatusFindAllStatuses": { "UserStatusGetPublicStatuses": {
"type": "object", "type": "object",
"required": [ "required": [
"ocs" "ocs"
@ -232,7 +232,7 @@
} }
} }
}, },
"UserStatusFindStatus": { "UserStatusGetPublicStatus": {
"type": "object", "type": "object",
"required": [ "required": [
"ocs" "ocs"
@ -347,7 +347,7 @@
"paths": { "paths": {
"/ocs/v2.php/apps/user_status/api/v1/statuses": { "/ocs/v2.php/apps/user_status/api/v1/statuses": {
"get": { "get": {
"operationId": "find-all-statuses", "operationId": "get-public-statuses",
"tags": [ "tags": [
"user_status" "user_status"
], ],
@ -357,7 +357,7 @@
"content": { "content": {
"application/json": { "application/json": {
"schema": { "schema": {
"$ref": "#/components/schemas/UserStatusFindAllStatuses" "$ref": "#/components/schemas/UserStatusGetPublicStatuses"
} }
} }
} }
@ -377,7 +377,7 @@
} }
], ],
"get": { "get": {
"operationId": "find-status", "operationId": "get-public-status",
"tags": [ "tags": [
"user_status" "user_status"
], ],
@ -387,7 +387,7 @@
"content": { "content": {
"application/json": { "application/json": {
"schema": { "schema": {
"$ref": "#/components/schemas/UserStatusFindStatus" "$ref": "#/components/schemas/UserStatusGetPublicStatus"
} }
} }
} }
@ -544,7 +544,7 @@
}, },
"/ocs/v2.php/apps/user_status/api/v1/predefined_statuses": { "/ocs/v2.php/apps/user_status/api/v1/predefined_statuses": {
"get": { "get": {
"operationId": "find-all-predefined-statuses", "operationId": "get-predefined-statuses",
"tags": [ "tags": [
"user_status" "user_status"
], ],

Loading…
Cancel
Save