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() @JsonSerializable()
class NotificationsEmpty_Ocs { class EmptyOCS_Ocs {
NotificationsEmpty_Ocs({ EmptyOCS_Ocs({
required this.meta, required this.meta,
required this.data, 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 OCSMeta meta;
final List<String> data; final List data;
// coverage:ignore-start // coverage:ignore-start
Map<String, dynamic> toJson() => _$NotificationsEmpty_OcsToJson(this); Map<String, dynamic> toJson() => _$EmptyOCS_OcsToJson(this);
// coverage:ignore-end // coverage:ignore-end
} }
@JsonSerializable() @JsonSerializable()
class NotificationsEmpty { class EmptyOCS {
NotificationsEmpty({required this.ocs}); 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 // coverage:ignore-start
Map<String, dynamic> toJson() => _$NotificationsEmptyToJson(this); Map<String, dynamic> toJson() => _$EmptyOCSToJson(this);
// coverage:ignore-end // coverage:ignore-end
} }
@ -2858,7 +2858,7 @@ class NotificationsClient {
throw ApiException.fromResponse(response); // coverage:ignore-line 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}'; var path = '/ocs/v2.php/apps/notifications/api/v2/notifications/{id}';
final queryParameters = <String, dynamic>{}; final queryParameters = <String, dynamic>{};
final headers = <String, String>{}; final headers = <String, String>{};
@ -2871,7 +2871,7 @@ class NotificationsClient {
body, body,
); );
if (response.statusCode == 200) { 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 throw ApiException.fromResponse(response); // coverage:ignore-line
} }
@ -2918,7 +2918,7 @@ class NotificationsClient {
throw ApiException.fromResponse(response); // coverage:ignore-line throw ApiException.fromResponse(response); // coverage:ignore-line
} }
Future<NotificationsEmpty> sendAdminNotification({ Future<EmptyOCS> sendAdminNotification({
required String userId, required String userId,
required String shortMessage, required String shortMessage,
String longMessage = '', String longMessage = '',
@ -2937,7 +2937,7 @@ class NotificationsClient {
body, body,
); );
if (response.statusCode == 200) { 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 throw ApiException.fromResponse(response); // coverage:ignore-line
} }
@ -4342,14 +4342,12 @@ final _deserializers = <Type, dynamic Function(dynamic)>{
.map<NotificationsGetNotification_Ocs>( .map<NotificationsGetNotification_Ocs>(
(final e) => NotificationsGetNotification_Ocs.fromJson(e as Map<String, dynamic>)) (final e) => NotificationsGetNotification_Ocs.fromJson(e as Map<String, dynamic>))
.toList(), .toList(),
NotificationsEmpty: (final data) => NotificationsEmpty.fromJson(data as Map<String, dynamic>), EmptyOCS: (final data) => EmptyOCS.fromJson(data as Map<String, dynamic>),
List<NotificationsEmpty>: (final data) => (data as List) List<EmptyOCS>: (final data) =>
.map<NotificationsEmpty>((final e) => NotificationsEmpty.fromJson(e as Map<String, dynamic>)) (data as List).map<EmptyOCS>((final e) => EmptyOCS.fromJson(e as Map<String, dynamic>)).toList(),
.toList(), EmptyOCS_Ocs: (final data) => EmptyOCS_Ocs.fromJson(data as Map<String, dynamic>),
NotificationsEmpty_Ocs: (final data) => NotificationsEmpty_Ocs.fromJson(data as Map<String, dynamic>), List<EmptyOCS_Ocs>: (final data) =>
List<NotificationsEmpty_Ocs>: (final data) => (data as List) (data as List).map<EmptyOCS_Ocs>((final e) => EmptyOCS_Ocs.fromJson(e as Map<String, dynamic>)).toList(),
.map<NotificationsEmpty_Ocs>((final e) => NotificationsEmpty_Ocs.fromJson(e as Map<String, dynamic>))
.toList(),
NotificationsPushServerRegistration: (final data) => NotificationsPushServerRegistration: (final data) =>
NotificationsPushServerRegistration.fromJson(data as Map<String, dynamic>), NotificationsPushServerRegistration.fromJson(data as Map<String, dynamic>),
List<NotificationsPushServerRegistration>: (final data) => (data as List) 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>) List<NotificationsGetNotification_Ocs>: (final data) => (data as List<NotificationsGetNotification_Ocs>)
.map((final e) => (e as NotificationsGetNotification_Ocs).toJson()) .map((final e) => (e as NotificationsGetNotification_Ocs).toJson())
.toList(), .toList(),
NotificationsEmpty: (final data) => (data as NotificationsEmpty).toJson(), EmptyOCS: (final data) => (data as EmptyOCS).toJson(),
List<NotificationsEmpty>: (final data) => List<EmptyOCS>: (final data) => (data as List<EmptyOCS>).map((final e) => (e as EmptyOCS).toJson()).toList(),
(data as List<NotificationsEmpty>).map((final e) => (e as NotificationsEmpty).toJson()).toList(), EmptyOCS_Ocs: (final data) => (data as EmptyOCS_Ocs).toJson(),
NotificationsEmpty_Ocs: (final data) => (data as NotificationsEmpty_Ocs).toJson(), List<EmptyOCS_Ocs>: (final data) =>
List<NotificationsEmpty_Ocs>: (final data) => (data as List<EmptyOCS_Ocs>).map((final e) => (e as EmptyOCS_Ocs).toJson()).toList(),
(data as List<NotificationsEmpty_Ocs>).map((final e) => (e as NotificationsEmpty_Ocs).toJson()).toList(),
NotificationsPushServerRegistration: (final data) => (data as NotificationsPushServerRegistration).toJson(), NotificationsPushServerRegistration: (final data) => (data as NotificationsPushServerRegistration).toJson(),
List<NotificationsPushServerRegistration>: (final data) => (data as List<NotificationsPushServerRegistration>) List<NotificationsPushServerRegistration>: (final data) => (data as List<NotificationsPushServerRegistration>)
.map((final e) => (e as NotificationsPushServerRegistration).toJson()) .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(), '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>), 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(), 'meta': instance.meta.toJson(),
'data': instance.data, 'data': instance.data,
}; };
NotificationsEmpty _$NotificationsEmptyFromJson(Map<String, dynamic> json) => NotificationsEmpty( EmptyOCS _$EmptyOCSFromJson(Map<String, dynamic> json) => EmptyOCS(
ocs: NotificationsEmpty_Ocs.fromJson(json['ocs'] as Map<String, dynamic>), 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(), '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": { "CoreServerStatus": {
"type": "object", "type": "object",
"required": [ "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": { "NotificationsNotification": {
"type": "object", "type": "object",
"required": [ "required": [
@ -3335,7 +3332,7 @@
"content": { "content": {
"application/json": { "application/json": {
"schema": { "schema": {
"$ref": "#/components/schemas/NotificationsEmpty" "$ref": "#/components/schemas/EmptyOCS"
} }
} }
} }
@ -3449,7 +3446,7 @@
"content": { "content": {
"application/json": { "application/json": {
"schema": { "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": { "CoreServerStatus": {
"type": "object", "type": "object",
"required": [ "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": { "NewsListFeeds": {
"type": "object", "type": "object",
"required": [ "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": { "NotesNote": {
"type": "object", "type": "object",
"required": [ "required": [

11
specs/notifications.json

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

24
tool/generate-nextcloud.sh

@ -92,6 +92,30 @@ for codename in ${codenames[*]}; do
type: "string" 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 \ specs/templates/"$codename".json \

Loading…
Cancel
Save