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

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

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

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

@ -1869,7 +1869,7 @@
}
}
},
"UserStatusFindAllStatuses": {
"UserStatusGetPublicStatuses": {
"type": "object",
"required": [
"ocs"
@ -1895,7 +1895,7 @@
}
}
},
"UserStatusFindStatus": {
"UserStatusGetPublicStatus": {
"type": "object",
"required": [
"ocs"
@ -3464,7 +3464,7 @@
},
"/ocs/v2.php/apps/user_status/api/v1/statuses": {
"get": {
"operationId": "find-all-statuses",
"operationId": "get-public-statuses",
"tags": [
"user_status"
],
@ -3474,7 +3474,7 @@
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/UserStatusFindAllStatuses"
"$ref": "#/components/schemas/UserStatusGetPublicStatuses"
}
}
}
@ -3494,7 +3494,7 @@
}
],
"get": {
"operationId": "find-status",
"operationId": "get-public-status",
"tags": [
"user_status"
],
@ -3504,7 +3504,7 @@
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/UserStatusFindStatus"
"$ref": "#/components/schemas/UserStatusGetPublicStatus"
}
}
}
@ -3661,7 +3661,7 @@
},
"/ocs/v2.php/apps/user_status/api/v1/predefined_statuses": {
"get": {
"operationId": "find-all-predefined-statuses",
"operationId": "get-predefined-statuses",
"tags": [
"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 {
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));
final responseIDs = response.ocs.data.map((final status) => status.id);
expect(expectedStatusIDs.map(responseIDs.contains).contains(false), false);
@ -81,12 +81,12 @@ Future run(final DockerImage image) async {
});
test('Find all statuses', () async {
var response = await client.userStatus.findAllStatuses();
var response = await client.userStatus.getPublicStatuses();
expect(response.ocs.data, hasLength(0));
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[0].userId, 'user1');
expect(response.ocs.data[0].message, null);
@ -100,7 +100,7 @@ Future run(final DockerImage image) async {
// Same as getting status
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!.message, null);
expect(response.ocs.data.userStatusPublicUserStatus!.icon, null);

14
specs/user_status.json

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

Loading…
Cancel
Save