Browse Source

tool,specs,nextcloud: Add empty ocs response

pull/126/head
jld3103 2 years ago
parent
commit
fbd6ae286b
No known key found for this signature in database
GPG Key ID: 9062417B9E8EB7B3
  1. 53
      packages/nextcloud/lib/src/nextcloud.openapi.dart
  2. 12
      packages/nextcloud/lib/src/nextcloud.openapi.g.dart
  3. 53
      packages/nextcloud/lib/src/nextcloud.openapi.json
  4. 23
      specs/core.json
  5. 23
      specs/news.json
  6. 23
      specs/notes.json
  7. 11
      specs/notifications.json
  8. 23
      specs/provisioning_api.json
  9. 23
      specs/user_status.json
  10. 24
      tool/generate-nextcloud.sh

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

@ -2713,33 +2713,33 @@ class NotificationsGetNotification {
}
@JsonSerializable()
class NotificationsEmpty_Ocs {
NotificationsEmpty_Ocs({
class EmptyOCS_Ocs {
EmptyOCS_Ocs({
required this.meta,
required this.data,
});
factory NotificationsEmpty_Ocs.fromJson(Map<String, dynamic> json) => _$NotificationsEmpty_OcsFromJson(json);
factory EmptyOCS_Ocs.fromJson(Map<String, dynamic> json) => _$EmptyOCS_OcsFromJson(json);
final OCSMeta meta;
final List<String> data;
final List data;
// coverage:ignore-start
Map<String, dynamic> toJson() => _$NotificationsEmpty_OcsToJson(this);
Map<String, dynamic> toJson() => _$EmptyOCS_OcsToJson(this);
// coverage:ignore-end
}
@JsonSerializable()
class NotificationsEmpty {
NotificationsEmpty({required this.ocs});
class EmptyOCS {
EmptyOCS({required this.ocs});
factory NotificationsEmpty.fromJson(Map<String, dynamic> json) => _$NotificationsEmptyFromJson(json);
factory EmptyOCS.fromJson(Map<String, dynamic> json) => _$EmptyOCSFromJson(json);
final NotificationsEmpty_Ocs ocs;
final EmptyOCS_Ocs ocs;
// coverage:ignore-start
Map<String, dynamic> toJson() => _$NotificationsEmptyToJson(this);
Map<String, dynamic> toJson() => _$EmptyOCSToJson(this);
// coverage:ignore-end
}
@ -2858,7 +2858,7 @@ class NotificationsClient {
throw ApiException.fromResponse(response); // coverage:ignore-line
}
Future<NotificationsEmpty> deleteNotification({required int id}) async {
Future<EmptyOCS> deleteNotification({required int id}) async {
var path = '/ocs/v2.php/apps/notifications/api/v2/notifications/{id}';
final queryParameters = <String, dynamic>{};
final headers = <String, String>{};
@ -2871,7 +2871,7 @@ class NotificationsClient {
body,
);
if (response.statusCode == 200) {
return NotificationsEmpty.fromJson(json.decode(utf8.decode(response.body)) as Map<String, dynamic>);
return EmptyOCS.fromJson(json.decode(utf8.decode(response.body)) as Map<String, dynamic>);
}
throw ApiException.fromResponse(response); // coverage:ignore-line
}
@ -2918,7 +2918,7 @@ class NotificationsClient {
throw ApiException.fromResponse(response); // coverage:ignore-line
}
Future<NotificationsEmpty> sendAdminNotification({
Future<EmptyOCS> sendAdminNotification({
required String userId,
required String shortMessage,
String longMessage = '',
@ -2937,7 +2937,7 @@ class NotificationsClient {
body,
);
if (response.statusCode == 200) {
return NotificationsEmpty.fromJson(json.decode(utf8.decode(response.body)) as Map<String, dynamic>);
return EmptyOCS.fromJson(json.decode(utf8.decode(response.body)) as Map<String, dynamic>);
}
throw ApiException.fromResponse(response); // coverage:ignore-line
}
@ -4342,14 +4342,12 @@ final _deserializers = <Type, dynamic Function(dynamic)>{
.map<NotificationsGetNotification_Ocs>(
(final e) => NotificationsGetNotification_Ocs.fromJson(e as Map<String, dynamic>))
.toList(),
NotificationsEmpty: (final data) => NotificationsEmpty.fromJson(data as Map<String, dynamic>),
List<NotificationsEmpty>: (final data) => (data as List)
.map<NotificationsEmpty>((final e) => NotificationsEmpty.fromJson(e as Map<String, dynamic>))
.toList(),
NotificationsEmpty_Ocs: (final data) => NotificationsEmpty_Ocs.fromJson(data as Map<String, dynamic>),
List<NotificationsEmpty_Ocs>: (final data) => (data as List)
.map<NotificationsEmpty_Ocs>((final e) => NotificationsEmpty_Ocs.fromJson(e as Map<String, dynamic>))
.toList(),
EmptyOCS: (final data) => EmptyOCS.fromJson(data as Map<String, dynamic>),
List<EmptyOCS>: (final data) =>
(data as List).map<EmptyOCS>((final e) => EmptyOCS.fromJson(e as Map<String, dynamic>)).toList(),
EmptyOCS_Ocs: (final data) => EmptyOCS_Ocs.fromJson(data as Map<String, dynamic>),
List<EmptyOCS_Ocs>: (final data) =>
(data as List).map<EmptyOCS_Ocs>((final e) => EmptyOCS_Ocs.fromJson(e as Map<String, dynamic>)).toList(),
NotificationsPushServerRegistration: (final data) =>
NotificationsPushServerRegistration.fromJson(data as Map<String, dynamic>),
List<NotificationsPushServerRegistration>: (final data) => (data as List)
@ -4821,12 +4819,11 @@ final _serializers = <Type, dynamic Function(dynamic)>{
List<NotificationsGetNotification_Ocs>: (final data) => (data as List<NotificationsGetNotification_Ocs>)
.map((final e) => (e as NotificationsGetNotification_Ocs).toJson())
.toList(),
NotificationsEmpty: (final data) => (data as NotificationsEmpty).toJson(),
List<NotificationsEmpty>: (final data) =>
(data as List<NotificationsEmpty>).map((final e) => (e as NotificationsEmpty).toJson()).toList(),
NotificationsEmpty_Ocs: (final data) => (data as NotificationsEmpty_Ocs).toJson(),
List<NotificationsEmpty_Ocs>: (final data) =>
(data as List<NotificationsEmpty_Ocs>).map((final e) => (e as NotificationsEmpty_Ocs).toJson()).toList(),
EmptyOCS: (final data) => (data as EmptyOCS).toJson(),
List<EmptyOCS>: (final data) => (data as List<EmptyOCS>).map((final e) => (e as EmptyOCS).toJson()).toList(),
EmptyOCS_Ocs: (final data) => (data as EmptyOCS_Ocs).toJson(),
List<EmptyOCS_Ocs>: (final data) =>
(data as List<EmptyOCS_Ocs>).map((final e) => (e as EmptyOCS_Ocs).toJson()).toList(),
NotificationsPushServerRegistration: (final data) => (data as NotificationsPushServerRegistration).toJson(),
List<NotificationsPushServerRegistration>: (final data) => (data as List<NotificationsPushServerRegistration>)
.map((final e) => (e as NotificationsPushServerRegistration).toJson())

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

@ -1260,21 +1260,21 @@ Map<String, dynamic> _$NotificationsGetNotificationToJson(NotificationsGetNotifi
'ocs': instance.ocs.toJson(),
};
NotificationsEmpty_Ocs _$NotificationsEmpty_OcsFromJson(Map<String, dynamic> json) => NotificationsEmpty_Ocs(
EmptyOCS_Ocs _$EmptyOCS_OcsFromJson(Map<String, dynamic> json) => EmptyOCS_Ocs(
meta: OCSMeta.fromJson(json['meta'] as Map<String, dynamic>),
data: (json['data'] as List<dynamic>).map((e) => e as String).toList(),
data: json['data'] as List<dynamic>,
);
Map<String, dynamic> _$NotificationsEmpty_OcsToJson(NotificationsEmpty_Ocs instance) => <String, dynamic>{
Map<String, dynamic> _$EmptyOCS_OcsToJson(EmptyOCS_Ocs instance) => <String, dynamic>{
'meta': instance.meta.toJson(),
'data': instance.data,
};
NotificationsEmpty _$NotificationsEmptyFromJson(Map<String, dynamic> json) => NotificationsEmpty(
ocs: NotificationsEmpty_Ocs.fromJson(json['ocs'] as Map<String, dynamic>),
EmptyOCS _$EmptyOCSFromJson(Map<String, dynamic> json) => EmptyOCS(
ocs: EmptyOCS_Ocs.fromJson(json['ocs'] as Map<String, dynamic>),
);
Map<String, dynamic> _$NotificationsEmptyToJson(NotificationsEmpty instance) => <String, dynamic>{
Map<String, dynamic> _$EmptyOCSToJson(EmptyOCS instance) => <String, dynamic>{
'ocs': instance.ocs.toJson(),
};

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

@ -72,6 +72,29 @@
}
}
},
"EmptyOCS": {
"type": "object",
"required": [
"ocs"
],
"properties": {
"ocs": {
"type": "object",
"required": [
"meta",
"data"
],
"properties": {
"meta": {
"$ref": "#/components/schemas/OCSMeta"
},
"data": {
"type": "array"
}
}
}
}
},
"CoreServerStatus": {
"type": "object",
"required": [
@ -1360,32 +1383,6 @@
}
}
},
"NotificationsEmpty": {
"type": "object",
"required": [
"ocs"
],
"properties": {
"ocs": {
"type": "object",
"required": [
"meta",
"data"
],
"properties": {
"meta": {
"$ref": "#/components/schemas/OCSMeta"
},
"data": {
"type": "array",
"items": {
"type": "string"
}
}
}
}
}
},
"NotificationsNotification": {
"type": "object",
"required": [
@ -3335,7 +3332,7 @@
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/NotificationsEmpty"
"$ref": "#/components/schemas/EmptyOCS"
}
}
}
@ -3449,7 +3446,7 @@
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/NotificationsEmpty"
"$ref": "#/components/schemas/EmptyOCS"
}
}
}

23
specs/core.json

@ -58,6 +58,29 @@
}
}
},
"EmptyOCS": {
"type": "object",
"required": [
"ocs"
],
"properties": {
"ocs": {
"type": "object",
"required": [
"meta",
"data"
],
"properties": {
"meta": {
"$ref": "#/components/schemas/OCSMeta"
},
"data": {
"type": "array"
}
}
}
}
},
"CoreServerStatus": {
"type": "object",
"required": [

23
specs/news.json

@ -58,6 +58,29 @@
}
}
},
"EmptyOCS": {
"type": "object",
"required": [
"ocs"
],
"properties": {
"ocs": {
"type": "object",
"required": [
"meta",
"data"
],
"properties": {
"meta": {
"$ref": "#/components/schemas/OCSMeta"
},
"data": {
"type": "array"
}
}
}
}
},
"NewsListFeeds": {
"type": "object",
"required": [

23
specs/notes.json

@ -58,6 +58,29 @@
}
}
},
"EmptyOCS": {
"type": "object",
"required": [
"ocs"
],
"properties": {
"ocs": {
"type": "object",
"required": [
"meta",
"data"
],
"properties": {
"meta": {
"$ref": "#/components/schemas/OCSMeta"
},
"data": {
"type": "array"
}
}
}
}
},
"NotesNote": {
"type": "object",
"required": [

11
specs/notifications.json

@ -58,7 +58,7 @@
}
}
},
"NotificationsEmpty": {
"EmptyOCS": {
"type": "object",
"required": [
"ocs"
@ -75,10 +75,7 @@
"$ref": "#/components/schemas/OCSMeta"
},
"data": {
"type": "array",
"items": {
"type": "string"
}
"type": "array"
}
}
}
@ -416,7 +413,7 @@
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/NotificationsEmpty"
"$ref": "#/components/schemas/EmptyOCS"
}
}
}
@ -530,7 +527,7 @@
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/NotificationsEmpty"
"$ref": "#/components/schemas/EmptyOCS"
}
}
}

23
specs/provisioning_api.json

@ -58,6 +58,29 @@
}
}
},
"EmptyOCS": {
"type": "object",
"required": [
"ocs"
],
"properties": {
"ocs": {
"type": "object",
"required": [
"meta",
"data"
],
"properties": {
"meta": {
"$ref": "#/components/schemas/OCSMeta"
},
"data": {
"type": "array"
}
}
}
}
},
"ProvisioningApiUser": {
"type": "object",
"required": [

23
specs/user_status.json

@ -58,6 +58,29 @@
}
}
},
"EmptyOCS": {
"type": "object",
"required": [
"ocs"
],
"properties": {
"ocs": {
"type": "object",
"required": [
"meta",
"data"
],
"properties": {
"meta": {
"$ref": "#/components/schemas/OCSMeta"
},
"data": {
"type": "array"
}
}
}
}
},
"UserStatusPredefinedStatuses": {
"type": "object",
"required": [

24
tool/generate-nextcloud.sh

@ -92,6 +92,30 @@ for codename in ${codenames[*]}; do
type: "string"
}
}
} |
.components.schemas.EmptyOCS =
{
type: "object",
required: [
"ocs"
],
properties: {
ocs: {
type: "object",
required: [
"meta",
"data"
],
properties: {
meta: {
"$ref": "#/components/schemas/OCSMeta"
},
data: {
type: "array"
}
}
}
}
}
' \
specs/templates/"$codename".json \

Loading…
Cancel
Save