Browse Source

specs,tool,nextcloud: Add uppush support

pull/208/head
jld3103 2 years ago
parent
commit
20357a1fc7
No known key found for this signature in database
GPG Key ID: 9062417B9E8EB7B3
  1. 3
      .gitmodules
  2. 1
      external/nextcloud-uppush
  3. 689
      packages/nextcloud/lib/src/nextcloud.openapi.dart
  4. 229
      packages/nextcloud/lib/src/nextcloud.openapi.g.dart
  5. 416
      packages/nextcloud/lib/src/nextcloud.openapi.json
  6. 66
      packages/nextcloud/test/uppush.dart
  7. 444
      specs/uppush.json
  8. 1
      tool/Dockerfile.dev
  9. 4
      tool/generate-nextcloud.sh

3
.gitmodules vendored

@ -13,3 +13,6 @@
[submodule "external/nextcloud-notifications"]
path = external/nextcloud-notifications
url = https://github.com/nextcloud/notifications
[submodule "external/nextcloud-uppush"]
path = external/nextcloud-uppush
url = git@github.com:UP-NextPush/server-app.git

1
external/nextcloud-uppush vendored

@ -0,0 +1 @@
Subproject commit ea2264cc05443f295a662030ad13c4a40c744eb9

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

@ -157,6 +157,7 @@ class NextcloudClient {
NextcloudNotesClient get notes => NextcloudNotesClient(this);
NextcloudNotificationsClient get notifications => NextcloudNotificationsClient(this);
NextcloudProvisioningApiClient get provisioningApi => NextcloudProvisioningApiClient(this);
NextcloudUnifiedPushProviderClient get unifiedPushProvider => NextcloudUnifiedPushProviderClient(this);
NextcloudUserStatusClient get userStatus => NextcloudUserStatusClient(this);
}
@ -1177,6 +1178,240 @@ class NextcloudProvisioningApiClient {
}
}
class NextcloudUnifiedPushProviderClient {
NextcloudUnifiedPushProviderClient(this.rootClient);
final NextcloudClient rootClient;
/// Check if the UnifiedPush provider is present
Future<NextcloudUnifiedPushProviderCheckResponse200ApplicationJson> check() async {
var path = '/index.php/apps/uppush';
final queryParameters = <String, dynamic>{};
final headers = <String, String>{};
Uint8List? body;
final response = await rootClient.doRequest(
'get',
Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null).toString(),
headers,
body,
);
if (response.statusCode == 200) {
return NextcloudUnifiedPushProviderCheckResponse200ApplicationJson.fromJson(
json.decode(utf8.decode(response.body) as String) as Map<String, dynamic>);
}
throw NextcloudApiException.fromResponse(response); // coverage:ignore-line
}
/// Set keepalive interval.
Future<NextcloudUnifiedPushProviderSetKeepaliveResponse200ApplicationJson> setKeepalive(
{required String keepalive}) async {
var path = '/index.php/apps/uppush/keepalive';
final queryParameters = <String, dynamic>{};
final headers = <String, String>{};
Uint8List? body;
queryParameters['keepalive'] = keepalive;
final response = await rootClient.doRequest(
'put',
Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null).toString(),
headers,
body,
);
if (response.statusCode == 200) {
return NextcloudUnifiedPushProviderSetKeepaliveResponse200ApplicationJson.fromJson(
json.decode(utf8.decode(response.body) as String) as Map<String, dynamic>);
}
throw NextcloudApiException.fromResponse(response); // coverage:ignore-line
}
/// Request to create a new deviceId.
Future<NextcloudUnifiedPushProviderCreateDeviceResponse200ApplicationJson> createDevice(
{required String deviceName}) async {
var path = '/index.php/apps/uppush/device';
final queryParameters = <String, dynamic>{};
final headers = <String, String>{};
Uint8List? body;
queryParameters['deviceName'] = deviceName;
final response = await rootClient.doRequest(
'put',
Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null).toString(),
headers,
body,
);
if (response.statusCode == 200) {
return NextcloudUnifiedPushProviderCreateDeviceResponse200ApplicationJson.fromJson(
json.decode(utf8.decode(response.body) as String) as Map<String, dynamic>);
}
throw NextcloudApiException.fromResponse(response); // coverage:ignore-line
}
/// Request to get push messages.
/// This is a public page since it has to be handle by the non-connected app (NextPush app and not Nextcloud-app)
Future<NextcloudUnifiedPushProviderSyncDeviceResponse401ApplicationJson> syncDevice(
{required String deviceId}) async {
var path = '/index.php/apps/uppush/device/{deviceId}';
final queryParameters = <String, dynamic>{};
final headers = <String, String>{};
Uint8List? body;
path = path.replaceAll('{deviceId}', Uri.encodeQueryComponent(deviceId));
final response = await rootClient.doRequest(
'get',
Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null).toString(),
headers,
body,
);
if (response.statusCode == 401) {
return NextcloudUnifiedPushProviderSyncDeviceResponse401ApplicationJson.fromJson(
json.decode(utf8.decode(response.body) as String) as Map<String, dynamic>);
}
throw NextcloudApiException.fromResponse(response); // coverage:ignore-line
}
/// Delete a device.
Future<NextcloudUnifiedPushProviderDeleteDeviceResponse200ApplicationJson> deleteDevice(
{required String deviceId}) async {
var path = '/index.php/apps/uppush/device/{deviceId}';
final queryParameters = <String, dynamic>{};
final headers = <String, String>{};
Uint8List? body;
path = path.replaceAll('{deviceId}', Uri.encodeQueryComponent(deviceId));
final response = await rootClient.doRequest(
'delete',
Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null).toString(),
headers,
body,
);
if (response.statusCode == 200) {
return NextcloudUnifiedPushProviderDeleteDeviceResponse200ApplicationJson.fromJson(
json.decode(utf8.decode(response.body) as String) as Map<String, dynamic>);
}
throw NextcloudApiException.fromResponse(response); // coverage:ignore-line
}
/// Create an authorization token for a new 3rd party service.
Future<NextcloudUnifiedPushProviderCreateAppResponse200ApplicationJson> createApp({
required String deviceId,
required String appName,
}) async {
var path = '/index.php/apps/uppush/app';
final queryParameters = <String, dynamic>{};
final headers = <String, String>{};
Uint8List? body;
queryParameters['deviceId'] = deviceId;
queryParameters['appName'] = appName;
final response = await rootClient.doRequest(
'put',
Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null).toString(),
headers,
body,
);
if (response.statusCode == 200) {
return NextcloudUnifiedPushProviderCreateAppResponse200ApplicationJson.fromJson(
json.decode(utf8.decode(response.body) as String) as Map<String, dynamic>);
}
throw NextcloudApiException.fromResponse(response); // coverage:ignore-line
}
/// Delete an authorization token.
Future<NextcloudUnifiedPushProviderDeleteAppResponse200ApplicationJson> deleteApp({required String token}) async {
var path = '/index.php/apps/uppush/app/{token}';
final queryParameters = <String, dynamic>{};
final headers = <String, String>{};
Uint8List? body;
path = path.replaceAll('{token}', Uri.encodeQueryComponent(token));
final response = await rootClient.doRequest(
'delete',
Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null).toString(),
headers,
body,
);
if (response.statusCode == 200) {
return NextcloudUnifiedPushProviderDeleteAppResponse200ApplicationJson.fromJson(
json.decode(utf8.decode(response.body) as String) as Map<String, dynamic>);
}
throw NextcloudApiException.fromResponse(response); // coverage:ignore-line
}
/// Unifiedpush discovery Following specifications
Future<NextcloudUnifiedPushProviderUnifiedpushDiscoveryResponse200ApplicationJson> unifiedpushDiscovery(
{required String token}) async {
var path = '/index.php/apps/uppush/push/{token}';
final queryParameters = <String, dynamic>{};
final headers = <String, String>{};
Uint8List? body;
path = path.replaceAll('{token}', Uri.encodeQueryComponent(token));
final response = await rootClient.doRequest(
'get',
Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null).toString(),
headers,
body,
);
if (response.statusCode == 200) {
return NextcloudUnifiedPushProviderUnifiedpushDiscoveryResponse200ApplicationJson.fromJson(
json.decode(utf8.decode(response.body) as String) as Map<String, dynamic>);
}
throw NextcloudApiException.fromResponse(response); // coverage:ignore-line
}
/// Receive notifications from 3rd parties.
Future<NextcloudUnifiedPushProviderPushResponse201ApplicationJson> push({required String token}) async {
var path = '/index.php/apps/uppush/push/{token}';
final queryParameters = <String, dynamic>{};
final headers = <String, String>{};
Uint8List? body;
path = path.replaceAll('{token}', Uri.encodeQueryComponent(token));
final response = await rootClient.doRequest(
'post',
Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null).toString(),
headers,
body,
);
if (response.statusCode == 201) {
return NextcloudUnifiedPushProviderPushResponse201ApplicationJson.fromJson(
json.decode(utf8.decode(response.body) as String) as Map<String, dynamic>);
}
throw NextcloudApiException.fromResponse(response); // coverage:ignore-line
}
/// Matrix Gateway discovery
Future<NextcloudUnifiedPushProviderGatewayMatrixDiscoveryResponse200ApplicationJson> gatewayMatrixDiscovery() async {
var path = '/index.php/apps/uppush/gateway/matrix';
final queryParameters = <String, dynamic>{};
final headers = <String, String>{};
Uint8List? body;
final response = await rootClient.doRequest(
'get',
Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null).toString(),
headers,
body,
);
if (response.statusCode == 200) {
return NextcloudUnifiedPushProviderGatewayMatrixDiscoveryResponse200ApplicationJson.fromJson(
json.decode(utf8.decode(response.body) as String) as Map<String, dynamic>);
}
throw NextcloudApiException.fromResponse(response); // coverage:ignore-line
}
/// Matrix Gateway
Future<NextcloudUnifiedPushProviderGatewayMatrixResponse200ApplicationJson> gatewayMatrix() async {
var path = '/index.php/apps/uppush/gateway/matrix';
final queryParameters = <String, dynamic>{};
final headers = <String, String>{};
Uint8List? body;
final response = await rootClient.doRequest(
'post',
Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null).toString(),
headers,
body,
);
if (response.statusCode == 200) {
return NextcloudUnifiedPushProviderGatewayMatrixResponse200ApplicationJson.fromJson(
json.decode(utf8.decode(response.body) as String) as Map<String, dynamic>);
}
throw NextcloudApiException.fromResponse(response); // coverage:ignore-line
}
}
class NextcloudUserStatusClient {
NextcloudUserStatusClient(this.rootClient);
@ -4523,6 +4758,338 @@ class NextcloudProvisioningApiUser {
static String? toJsonString(NextcloudProvisioningApiUser? data) => data == null ? null : json.encode(data.toJson());
}
@JsonSerializable()
class NextcloudUnifiedPushProviderCheckResponse200ApplicationJson {
NextcloudUnifiedPushProviderCheckResponse200ApplicationJson({required this.success});
// coverage:ignore-start
factory NextcloudUnifiedPushProviderCheckResponse200ApplicationJson.fromJson(Map<String, dynamic> json) =>
_$NextcloudUnifiedPushProviderCheckResponse200ApplicationJsonFromJson(json);
// coverage:ignore-end
// coverage:ignore-start
factory NextcloudUnifiedPushProviderCheckResponse200ApplicationJson.fromJsonString(String data) =>
NextcloudUnifiedPushProviderCheckResponse200ApplicationJson.fromJson(json.decode(data) as Map<String, dynamic>);
// coverage:ignore-end
final bool success;
// coverage:ignore-start
Map<String, dynamic> toJson() => _$NextcloudUnifiedPushProviderCheckResponse200ApplicationJsonToJson(this);
// coverage:ignore-end
static String? toJsonString(NextcloudUnifiedPushProviderCheckResponse200ApplicationJson? data) =>
data == null ? null : json.encode(data.toJson());
}
@JsonSerializable()
class NextcloudUnifiedPushProviderSetKeepaliveResponse200ApplicationJson {
NextcloudUnifiedPushProviderSetKeepaliveResponse200ApplicationJson({required this.success});
// coverage:ignore-start
factory NextcloudUnifiedPushProviderSetKeepaliveResponse200ApplicationJson.fromJson(Map<String, dynamic> json) =>
_$NextcloudUnifiedPushProviderSetKeepaliveResponse200ApplicationJsonFromJson(json);
// coverage:ignore-end
// coverage:ignore-start
factory NextcloudUnifiedPushProviderSetKeepaliveResponse200ApplicationJson.fromJsonString(String data) =>
NextcloudUnifiedPushProviderSetKeepaliveResponse200ApplicationJson.fromJson(
json.decode(data) as Map<String, dynamic>);
// coverage:ignore-end
final bool success;
// coverage:ignore-start
Map<String, dynamic> toJson() => _$NextcloudUnifiedPushProviderSetKeepaliveResponse200ApplicationJsonToJson(this);
// coverage:ignore-end
static String? toJsonString(NextcloudUnifiedPushProviderSetKeepaliveResponse200ApplicationJson? data) =>
data == null ? null : json.encode(data.toJson());
}
@JsonSerializable()
class NextcloudUnifiedPushProviderCreateDeviceResponse200ApplicationJson {
NextcloudUnifiedPushProviderCreateDeviceResponse200ApplicationJson({
required this.success,
required this.deviceId,
});
// coverage:ignore-start
factory NextcloudUnifiedPushProviderCreateDeviceResponse200ApplicationJson.fromJson(Map<String, dynamic> json) =>
_$NextcloudUnifiedPushProviderCreateDeviceResponse200ApplicationJsonFromJson(json);
// coverage:ignore-end
// coverage:ignore-start
factory NextcloudUnifiedPushProviderCreateDeviceResponse200ApplicationJson.fromJsonString(String data) =>
NextcloudUnifiedPushProviderCreateDeviceResponse200ApplicationJson.fromJson(
json.decode(data) as Map<String, dynamic>);
// coverage:ignore-end
final bool success;
final String deviceId;
// coverage:ignore-start
Map<String, dynamic> toJson() => _$NextcloudUnifiedPushProviderCreateDeviceResponse200ApplicationJsonToJson(this);
// coverage:ignore-end
static String? toJsonString(NextcloudUnifiedPushProviderCreateDeviceResponse200ApplicationJson? data) =>
data == null ? null : json.encode(data.toJson());
}
@JsonSerializable()
class NextcloudUnifiedPushProviderSyncDeviceResponse401ApplicationJson {
NextcloudUnifiedPushProviderSyncDeviceResponse401ApplicationJson({required this.success});
// coverage:ignore-start
factory NextcloudUnifiedPushProviderSyncDeviceResponse401ApplicationJson.fromJson(Map<String, dynamic> json) =>
_$NextcloudUnifiedPushProviderSyncDeviceResponse401ApplicationJsonFromJson(json);
// coverage:ignore-end
// coverage:ignore-start
factory NextcloudUnifiedPushProviderSyncDeviceResponse401ApplicationJson.fromJsonString(String data) =>
NextcloudUnifiedPushProviderSyncDeviceResponse401ApplicationJson.fromJson(
json.decode(data) as Map<String, dynamic>);
// coverage:ignore-end
final bool success;
// coverage:ignore-start
Map<String, dynamic> toJson() => _$NextcloudUnifiedPushProviderSyncDeviceResponse401ApplicationJsonToJson(this);
// coverage:ignore-end
static String? toJsonString(NextcloudUnifiedPushProviderSyncDeviceResponse401ApplicationJson? data) =>
data == null ? null : json.encode(data.toJson());
}
@JsonSerializable()
class NextcloudUnifiedPushProviderDeleteDeviceResponse200ApplicationJson {
NextcloudUnifiedPushProviderDeleteDeviceResponse200ApplicationJson({required this.success});
// coverage:ignore-start
factory NextcloudUnifiedPushProviderDeleteDeviceResponse200ApplicationJson.fromJson(Map<String, dynamic> json) =>
_$NextcloudUnifiedPushProviderDeleteDeviceResponse200ApplicationJsonFromJson(json);
// coverage:ignore-end
// coverage:ignore-start
factory NextcloudUnifiedPushProviderDeleteDeviceResponse200ApplicationJson.fromJsonString(String data) =>
NextcloudUnifiedPushProviderDeleteDeviceResponse200ApplicationJson.fromJson(
json.decode(data) as Map<String, dynamic>);
// coverage:ignore-end
final bool success;
// coverage:ignore-start
Map<String, dynamic> toJson() => _$NextcloudUnifiedPushProviderDeleteDeviceResponse200ApplicationJsonToJson(this);
// coverage:ignore-end
static String? toJsonString(NextcloudUnifiedPushProviderDeleteDeviceResponse200ApplicationJson? data) =>
data == null ? null : json.encode(data.toJson());
}
@JsonSerializable()
class NextcloudUnifiedPushProviderCreateAppResponse200ApplicationJson {
NextcloudUnifiedPushProviderCreateAppResponse200ApplicationJson({
required this.success,
required this.token,
});
// coverage:ignore-start
factory NextcloudUnifiedPushProviderCreateAppResponse200ApplicationJson.fromJson(Map<String, dynamic> json) =>
_$NextcloudUnifiedPushProviderCreateAppResponse200ApplicationJsonFromJson(json);
// coverage:ignore-end
// coverage:ignore-start
factory NextcloudUnifiedPushProviderCreateAppResponse200ApplicationJson.fromJsonString(String data) =>
NextcloudUnifiedPushProviderCreateAppResponse200ApplicationJson.fromJson(
json.decode(data) as Map<String, dynamic>);
// coverage:ignore-end
final bool success;
final String token;
// coverage:ignore-start
Map<String, dynamic> toJson() => _$NextcloudUnifiedPushProviderCreateAppResponse200ApplicationJsonToJson(this);
// coverage:ignore-end
static String? toJsonString(NextcloudUnifiedPushProviderCreateAppResponse200ApplicationJson? data) =>
data == null ? null : json.encode(data.toJson());
}
@JsonSerializable()
class NextcloudUnifiedPushProviderDeleteAppResponse200ApplicationJson {
NextcloudUnifiedPushProviderDeleteAppResponse200ApplicationJson({required this.success});
// coverage:ignore-start
factory NextcloudUnifiedPushProviderDeleteAppResponse200ApplicationJson.fromJson(Map<String, dynamic> json) =>
_$NextcloudUnifiedPushProviderDeleteAppResponse200ApplicationJsonFromJson(json);
// coverage:ignore-end
// coverage:ignore-start
factory NextcloudUnifiedPushProviderDeleteAppResponse200ApplicationJson.fromJsonString(String data) =>
NextcloudUnifiedPushProviderDeleteAppResponse200ApplicationJson.fromJson(
json.decode(data) as Map<String, dynamic>);
// coverage:ignore-end
final bool success;
// coverage:ignore-start
Map<String, dynamic> toJson() => _$NextcloudUnifiedPushProviderDeleteAppResponse200ApplicationJsonToJson(this);
// coverage:ignore-end
static String? toJsonString(NextcloudUnifiedPushProviderDeleteAppResponse200ApplicationJson? data) =>
data == null ? null : json.encode(data.toJson());
}
@JsonSerializable()
class NextcloudUnifiedPushProviderUnifiedpushDiscoveryResponse200ApplicationJson_Unifiedpush {
NextcloudUnifiedPushProviderUnifiedpushDiscoveryResponse200ApplicationJson_Unifiedpush({required this.version});
// coverage:ignore-start
factory NextcloudUnifiedPushProviderUnifiedpushDiscoveryResponse200ApplicationJson_Unifiedpush.fromJson(
Map<String, dynamic> json) =>
_$NextcloudUnifiedPushProviderUnifiedpushDiscoveryResponse200ApplicationJson_UnifiedpushFromJson(json);
// coverage:ignore-end
// coverage:ignore-start
factory NextcloudUnifiedPushProviderUnifiedpushDiscoveryResponse200ApplicationJson_Unifiedpush.fromJsonString(
String data) =>
NextcloudUnifiedPushProviderUnifiedpushDiscoveryResponse200ApplicationJson_Unifiedpush.fromJson(
json.decode(data) as Map<String, dynamic>);
// coverage:ignore-end
final int version;
// coverage:ignore-start
Map<String, dynamic> toJson() =>
_$NextcloudUnifiedPushProviderUnifiedpushDiscoveryResponse200ApplicationJson_UnifiedpushToJson(this);
// coverage:ignore-end
static String? toJsonString(
NextcloudUnifiedPushProviderUnifiedpushDiscoveryResponse200ApplicationJson_Unifiedpush? data) =>
data == null ? null : json.encode(data.toJson());
}
@JsonSerializable()
class NextcloudUnifiedPushProviderUnifiedpushDiscoveryResponse200ApplicationJson {
NextcloudUnifiedPushProviderUnifiedpushDiscoveryResponse200ApplicationJson({required this.unifiedpush});
// coverage:ignore-start
factory NextcloudUnifiedPushProviderUnifiedpushDiscoveryResponse200ApplicationJson.fromJson(
Map<String, dynamic> json) =>
_$NextcloudUnifiedPushProviderUnifiedpushDiscoveryResponse200ApplicationJsonFromJson(json);
// coverage:ignore-end
// coverage:ignore-start
factory NextcloudUnifiedPushProviderUnifiedpushDiscoveryResponse200ApplicationJson.fromJsonString(String data) =>
NextcloudUnifiedPushProviderUnifiedpushDiscoveryResponse200ApplicationJson.fromJson(
json.decode(data) as Map<String, dynamic>);
// coverage:ignore-end
final NextcloudUnifiedPushProviderUnifiedpushDiscoveryResponse200ApplicationJson_Unifiedpush unifiedpush;
// coverage:ignore-start
Map<String, dynamic> toJson() =>
_$NextcloudUnifiedPushProviderUnifiedpushDiscoveryResponse200ApplicationJsonToJson(this);
// coverage:ignore-end
static String? toJsonString(NextcloudUnifiedPushProviderUnifiedpushDiscoveryResponse200ApplicationJson? data) =>
data == null ? null : json.encode(data.toJson());
}
@JsonSerializable()
class NextcloudUnifiedPushProviderPushResponse201ApplicationJson {
NextcloudUnifiedPushProviderPushResponse201ApplicationJson({required this.success});
// coverage:ignore-start
factory NextcloudUnifiedPushProviderPushResponse201ApplicationJson.fromJson(Map<String, dynamic> json) =>
_$NextcloudUnifiedPushProviderPushResponse201ApplicationJsonFromJson(json);
// coverage:ignore-end
// coverage:ignore-start
factory NextcloudUnifiedPushProviderPushResponse201ApplicationJson.fromJsonString(String data) =>
NextcloudUnifiedPushProviderPushResponse201ApplicationJson.fromJson(json.decode(data) as Map<String, dynamic>);
// coverage:ignore-end
final bool success;
// coverage:ignore-start
Map<String, dynamic> toJson() => _$NextcloudUnifiedPushProviderPushResponse201ApplicationJsonToJson(this);
// coverage:ignore-end
static String? toJsonString(NextcloudUnifiedPushProviderPushResponse201ApplicationJson? data) =>
data == null ? null : json.encode(data.toJson());
}
@JsonSerializable()
class NextcloudUnifiedPushProviderGatewayMatrixDiscoveryResponse200ApplicationJson_Unifiedpush {
NextcloudUnifiedPushProviderGatewayMatrixDiscoveryResponse200ApplicationJson_Unifiedpush({required this.gateway});
// coverage:ignore-start
factory NextcloudUnifiedPushProviderGatewayMatrixDiscoveryResponse200ApplicationJson_Unifiedpush.fromJson(
Map<String, dynamic> json) =>
_$NextcloudUnifiedPushProviderGatewayMatrixDiscoveryResponse200ApplicationJson_UnifiedpushFromJson(json);
// coverage:ignore-end
// coverage:ignore-start
factory NextcloudUnifiedPushProviderGatewayMatrixDiscoveryResponse200ApplicationJson_Unifiedpush.fromJsonString(
String data) =>
NextcloudUnifiedPushProviderGatewayMatrixDiscoveryResponse200ApplicationJson_Unifiedpush.fromJson(
json.decode(data) as Map<String, dynamic>);
// coverage:ignore-end
final String gateway;
// coverage:ignore-start
Map<String, dynamic> toJson() =>
_$NextcloudUnifiedPushProviderGatewayMatrixDiscoveryResponse200ApplicationJson_UnifiedpushToJson(this);
// coverage:ignore-end
static String? toJsonString(
NextcloudUnifiedPushProviderGatewayMatrixDiscoveryResponse200ApplicationJson_Unifiedpush? data) =>
data == null ? null : json.encode(data.toJson());
}
@JsonSerializable()
class NextcloudUnifiedPushProviderGatewayMatrixDiscoveryResponse200ApplicationJson {
NextcloudUnifiedPushProviderGatewayMatrixDiscoveryResponse200ApplicationJson({required this.unifiedpush});
// coverage:ignore-start
factory NextcloudUnifiedPushProviderGatewayMatrixDiscoveryResponse200ApplicationJson.fromJson(
Map<String, dynamic> json) =>
_$NextcloudUnifiedPushProviderGatewayMatrixDiscoveryResponse200ApplicationJsonFromJson(json);
// coverage:ignore-end
// coverage:ignore-start
factory NextcloudUnifiedPushProviderGatewayMatrixDiscoveryResponse200ApplicationJson.fromJsonString(String data) =>
NextcloudUnifiedPushProviderGatewayMatrixDiscoveryResponse200ApplicationJson.fromJson(
json.decode(data) as Map<String, dynamic>);
// coverage:ignore-end
final NextcloudUnifiedPushProviderGatewayMatrixDiscoveryResponse200ApplicationJson_Unifiedpush unifiedpush;
// coverage:ignore-start
Map<String, dynamic> toJson() =>
_$NextcloudUnifiedPushProviderGatewayMatrixDiscoveryResponse200ApplicationJsonToJson(this);
// coverage:ignore-end
static String? toJsonString(NextcloudUnifiedPushProviderGatewayMatrixDiscoveryResponse200ApplicationJson? data) =>
data == null ? null : json.encode(data.toJson());
}
@JsonSerializable()
class NextcloudUnifiedPushProviderGatewayMatrixResponse200ApplicationJson {
NextcloudUnifiedPushProviderGatewayMatrixResponse200ApplicationJson({required this.rejected});
// coverage:ignore-start
factory NextcloudUnifiedPushProviderGatewayMatrixResponse200ApplicationJson.fromJson(Map<String, dynamic> json) =>
_$NextcloudUnifiedPushProviderGatewayMatrixResponse200ApplicationJsonFromJson(json);
// coverage:ignore-end
// coverage:ignore-start
factory NextcloudUnifiedPushProviderGatewayMatrixResponse200ApplicationJson.fromJsonString(String data) =>
NextcloudUnifiedPushProviderGatewayMatrixResponse200ApplicationJson.fromJson(
json.decode(data) as Map<String, dynamic>);
// coverage:ignore-end
final List<String> rejected;
// coverage:ignore-start
Map<String, dynamic> toJson() => _$NextcloudUnifiedPushProviderGatewayMatrixResponse200ApplicationJsonToJson(this);
// coverage:ignore-end
static String? toJsonString(NextcloudUnifiedPushProviderGatewayMatrixResponse200ApplicationJson? data) =>
data == null ? null : json.encode(data.toJson());
}
enum NextcloudUserStatusClearAt_Type {
period('period'),
@JsonValue('end-of')
@ -5690,6 +6257,88 @@ 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(),
NextcloudUnifiedPushProviderCheckResponse200ApplicationJson: (final data) =>
NextcloudUnifiedPushProviderCheckResponse200ApplicationJson.fromJson(data as Map<String, dynamic>),
List<NextcloudUnifiedPushProviderCheckResponse200ApplicationJson>: (final data) => (data as List)
.map((final e) => NextcloudUnifiedPushProviderCheckResponse200ApplicationJson.fromJson(e as Map<String, dynamic>))
.toList(),
NextcloudUnifiedPushProviderSetKeepaliveResponse200ApplicationJson: (final data) =>
NextcloudUnifiedPushProviderSetKeepaliveResponse200ApplicationJson.fromJson(data as Map<String, dynamic>),
List<NextcloudUnifiedPushProviderSetKeepaliveResponse200ApplicationJson>: (final data) => (data as List)
.map((final e) =>
NextcloudUnifiedPushProviderSetKeepaliveResponse200ApplicationJson.fromJson(e as Map<String, dynamic>))
.toList(),
NextcloudUnifiedPushProviderCreateDeviceResponse200ApplicationJson: (final data) =>
NextcloudUnifiedPushProviderCreateDeviceResponse200ApplicationJson.fromJson(data as Map<String, dynamic>),
List<NextcloudUnifiedPushProviderCreateDeviceResponse200ApplicationJson>: (final data) => (data as List)
.map((final e) =>
NextcloudUnifiedPushProviderCreateDeviceResponse200ApplicationJson.fromJson(e as Map<String, dynamic>))
.toList(),
NextcloudUnifiedPushProviderSyncDeviceResponse401ApplicationJson: (final data) =>
NextcloudUnifiedPushProviderSyncDeviceResponse401ApplicationJson.fromJson(data as Map<String, dynamic>),
List<NextcloudUnifiedPushProviderSyncDeviceResponse401ApplicationJson>: (final data) => (data as List)
.map((final e) =>
NextcloudUnifiedPushProviderSyncDeviceResponse401ApplicationJson.fromJson(e as Map<String, dynamic>))
.toList(),
NextcloudUnifiedPushProviderDeleteDeviceResponse200ApplicationJson: (final data) =>
NextcloudUnifiedPushProviderDeleteDeviceResponse200ApplicationJson.fromJson(data as Map<String, dynamic>),
List<NextcloudUnifiedPushProviderDeleteDeviceResponse200ApplicationJson>: (final data) => (data as List)
.map((final e) =>
NextcloudUnifiedPushProviderDeleteDeviceResponse200ApplicationJson.fromJson(e as Map<String, dynamic>))
.toList(),
NextcloudUnifiedPushProviderCreateAppResponse200ApplicationJson: (final data) =>
NextcloudUnifiedPushProviderCreateAppResponse200ApplicationJson.fromJson(data as Map<String, dynamic>),
List<NextcloudUnifiedPushProviderCreateAppResponse200ApplicationJson>: (final data) => (data as List)
.map((final e) =>
NextcloudUnifiedPushProviderCreateAppResponse200ApplicationJson.fromJson(e as Map<String, dynamic>))
.toList(),
NextcloudUnifiedPushProviderDeleteAppResponse200ApplicationJson: (final data) =>
NextcloudUnifiedPushProviderDeleteAppResponse200ApplicationJson.fromJson(data as Map<String, dynamic>),
List<NextcloudUnifiedPushProviderDeleteAppResponse200ApplicationJson>: (final data) => (data as List)
.map((final e) =>
NextcloudUnifiedPushProviderDeleteAppResponse200ApplicationJson.fromJson(e as Map<String, dynamic>))
.toList(),
NextcloudUnifiedPushProviderUnifiedpushDiscoveryResponse200ApplicationJson: (final data) =>
NextcloudUnifiedPushProviderUnifiedpushDiscoveryResponse200ApplicationJson.fromJson(data as Map<String, dynamic>),
List<NextcloudUnifiedPushProviderUnifiedpushDiscoveryResponse200ApplicationJson>: (final data) => (data as List)
.map((final e) => NextcloudUnifiedPushProviderUnifiedpushDiscoveryResponse200ApplicationJson.fromJson(
e as Map<String, dynamic>))
.toList(),
NextcloudUnifiedPushProviderUnifiedpushDiscoveryResponse200ApplicationJson_Unifiedpush: (final data) =>
NextcloudUnifiedPushProviderUnifiedpushDiscoveryResponse200ApplicationJson_Unifiedpush.fromJson(
data as Map<String, dynamic>),
List<NextcloudUnifiedPushProviderUnifiedpushDiscoveryResponse200ApplicationJson_Unifiedpush>: (final data) => (data
as List)
.map((final e) => NextcloudUnifiedPushProviderUnifiedpushDiscoveryResponse200ApplicationJson_Unifiedpush.fromJson(
e as Map<String, dynamic>))
.toList(),
NextcloudUnifiedPushProviderPushResponse201ApplicationJson: (final data) =>
NextcloudUnifiedPushProviderPushResponse201ApplicationJson.fromJson(data as Map<String, dynamic>),
List<NextcloudUnifiedPushProviderPushResponse201ApplicationJson>: (final data) => (data as List)
.map((final e) => NextcloudUnifiedPushProviderPushResponse201ApplicationJson.fromJson(e as Map<String, dynamic>))
.toList(),
NextcloudUnifiedPushProviderGatewayMatrixDiscoveryResponse200ApplicationJson: (final data) =>
NextcloudUnifiedPushProviderGatewayMatrixDiscoveryResponse200ApplicationJson.fromJson(
data as Map<String, dynamic>),
List<NextcloudUnifiedPushProviderGatewayMatrixDiscoveryResponse200ApplicationJson>: (final data) => (data as List)
.map((final e) => NextcloudUnifiedPushProviderGatewayMatrixDiscoveryResponse200ApplicationJson.fromJson(
e as Map<String, dynamic>))
.toList(),
NextcloudUnifiedPushProviderGatewayMatrixDiscoveryResponse200ApplicationJson_Unifiedpush: (final data) =>
NextcloudUnifiedPushProviderGatewayMatrixDiscoveryResponse200ApplicationJson_Unifiedpush.fromJson(
data as Map<String, dynamic>),
List<NextcloudUnifiedPushProviderGatewayMatrixDiscoveryResponse200ApplicationJson_Unifiedpush>: (final data) =>
(data as List)
.map((final e) =>
NextcloudUnifiedPushProviderGatewayMatrixDiscoveryResponse200ApplicationJson_Unifiedpush.fromJson(
e as Map<String, dynamic>))
.toList(),
NextcloudUnifiedPushProviderGatewayMatrixResponse200ApplicationJson: (final data) =>
NextcloudUnifiedPushProviderGatewayMatrixResponse200ApplicationJson.fromJson(data as Map<String, dynamic>),
List<NextcloudUnifiedPushProviderGatewayMatrixResponse200ApplicationJson>: (final data) => (data as List)
.map((final e) =>
NextcloudUnifiedPushProviderGatewayMatrixResponse200ApplicationJson.fromJson(e as Map<String, dynamic>))
.toList(),
NextcloudUserStatusGetPublicStatuses: (final data) =>
NextcloudUserStatusGetPublicStatuses.fromJson(data as Map<String, dynamic>),
List<NextcloudUserStatusGetPublicStatuses>: (final data) => (data as List)
@ -5974,6 +6623,46 @@ final _serializers = <Type, dynamic Function(dynamic)>{
NextcloudProvisioningApiUserDetails_BackendCapabilities: (final data) => data.toJson(),
List<NextcloudProvisioningApiUserDetails_BackendCapabilities>: (final data) =>
data.map((final e) => e.toJson()).toList(),
NextcloudUnifiedPushProviderCheckResponse200ApplicationJson: (final data) => data.toJson(),
List<NextcloudUnifiedPushProviderCheckResponse200ApplicationJson>: (final data) =>
data.map((final e) => e.toJson()).toList(),
NextcloudUnifiedPushProviderSetKeepaliveResponse200ApplicationJson: (final data) => data.toJson(),
List<NextcloudUnifiedPushProviderSetKeepaliveResponse200ApplicationJson>: (final data) =>
data.map((final e) => e.toJson()).toList(),
NextcloudUnifiedPushProviderCreateDeviceResponse200ApplicationJson: (final data) => data.toJson(),
List<NextcloudUnifiedPushProviderCreateDeviceResponse200ApplicationJson>: (final data) =>
data.map((final e) => e.toJson()).toList(),
NextcloudUnifiedPushProviderSyncDeviceResponse401ApplicationJson: (final data) => data.toJson(),
List<NextcloudUnifiedPushProviderSyncDeviceResponse401ApplicationJson>: (final data) =>
data.map((final e) => e.toJson()).toList(),
NextcloudUnifiedPushProviderDeleteDeviceResponse200ApplicationJson: (final data) => data.toJson(),
List<NextcloudUnifiedPushProviderDeleteDeviceResponse200ApplicationJson>: (final data) =>
data.map((final e) => e.toJson()).toList(),
NextcloudUnifiedPushProviderCreateAppResponse200ApplicationJson: (final data) => data.toJson(),
List<NextcloudUnifiedPushProviderCreateAppResponse200ApplicationJson>: (final data) =>
data.map((final e) => e.toJson()).toList(),
NextcloudUnifiedPushProviderDeleteAppResponse200ApplicationJson: (final data) => data.toJson(),
List<NextcloudUnifiedPushProviderDeleteAppResponse200ApplicationJson>: (final data) =>
data.map((final e) => e.toJson()).toList(),
NextcloudUnifiedPushProviderUnifiedpushDiscoveryResponse200ApplicationJson: (final data) => data.toJson(),
List<NextcloudUnifiedPushProviderUnifiedpushDiscoveryResponse200ApplicationJson>: (final data) =>
data.map((final e) => e.toJson()).toList(),
NextcloudUnifiedPushProviderUnifiedpushDiscoveryResponse200ApplicationJson_Unifiedpush: (final data) => data.toJson(),
List<NextcloudUnifiedPushProviderUnifiedpushDiscoveryResponse200ApplicationJson_Unifiedpush>: (final data) =>
data.map((final e) => e.toJson()).toList(),
NextcloudUnifiedPushProviderPushResponse201ApplicationJson: (final data) => data.toJson(),
List<NextcloudUnifiedPushProviderPushResponse201ApplicationJson>: (final data) =>
data.map((final e) => e.toJson()).toList(),
NextcloudUnifiedPushProviderGatewayMatrixDiscoveryResponse200ApplicationJson: (final data) => data.toJson(),
List<NextcloudUnifiedPushProviderGatewayMatrixDiscoveryResponse200ApplicationJson>: (final data) =>
data.map((final e) => e.toJson()).toList(),
NextcloudUnifiedPushProviderGatewayMatrixDiscoveryResponse200ApplicationJson_Unifiedpush: (final data) =>
data.toJson(),
List<NextcloudUnifiedPushProviderGatewayMatrixDiscoveryResponse200ApplicationJson_Unifiedpush>: (final data) =>
data.map((final e) => e.toJson()).toList(),
NextcloudUnifiedPushProviderGatewayMatrixResponse200ApplicationJson: (final data) => data.toJson(),
List<NextcloudUnifiedPushProviderGatewayMatrixResponse200ApplicationJson>: (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(),

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

@ -1949,6 +1949,235 @@ Map<String, dynamic> _$NextcloudProvisioningApiUserToJson(NextcloudProvisioningA
'ocs': instance.ocs.toJson(),
};
NextcloudUnifiedPushProviderCheckResponse200ApplicationJson
_$NextcloudUnifiedPushProviderCheckResponse200ApplicationJsonFromJson(Map<String, dynamic> json) {
$checkKeys(
json,
allowedKeys: const ['success'],
);
return NextcloudUnifiedPushProviderCheckResponse200ApplicationJson(
success: json['success'] as bool,
);
}
Map<String, dynamic> _$NextcloudUnifiedPushProviderCheckResponse200ApplicationJsonToJson(
NextcloudUnifiedPushProviderCheckResponse200ApplicationJson instance) =>
<String, dynamic>{
'success': instance.success,
};
NextcloudUnifiedPushProviderSetKeepaliveResponse200ApplicationJson
_$NextcloudUnifiedPushProviderSetKeepaliveResponse200ApplicationJsonFromJson(Map<String, dynamic> json) {
$checkKeys(
json,
allowedKeys: const ['success'],
);
return NextcloudUnifiedPushProviderSetKeepaliveResponse200ApplicationJson(
success: json['success'] as bool,
);
}
Map<String, dynamic> _$NextcloudUnifiedPushProviderSetKeepaliveResponse200ApplicationJsonToJson(
NextcloudUnifiedPushProviderSetKeepaliveResponse200ApplicationJson instance) =>
<String, dynamic>{
'success': instance.success,
};
NextcloudUnifiedPushProviderCreateDeviceResponse200ApplicationJson
_$NextcloudUnifiedPushProviderCreateDeviceResponse200ApplicationJsonFromJson(Map<String, dynamic> json) {
$checkKeys(
json,
allowedKeys: const ['success', 'deviceId'],
);
return NextcloudUnifiedPushProviderCreateDeviceResponse200ApplicationJson(
success: json['success'] as bool,
deviceId: json['deviceId'] as String,
);
}
Map<String, dynamic> _$NextcloudUnifiedPushProviderCreateDeviceResponse200ApplicationJsonToJson(
NextcloudUnifiedPushProviderCreateDeviceResponse200ApplicationJson instance) =>
<String, dynamic>{
'success': instance.success,
'deviceId': instance.deviceId,
};
NextcloudUnifiedPushProviderSyncDeviceResponse401ApplicationJson
_$NextcloudUnifiedPushProviderSyncDeviceResponse401ApplicationJsonFromJson(Map<String, dynamic> json) {
$checkKeys(
json,
allowedKeys: const ['success'],
);
return NextcloudUnifiedPushProviderSyncDeviceResponse401ApplicationJson(
success: json['success'] as bool,
);
}
Map<String, dynamic> _$NextcloudUnifiedPushProviderSyncDeviceResponse401ApplicationJsonToJson(
NextcloudUnifiedPushProviderSyncDeviceResponse401ApplicationJson instance) =>
<String, dynamic>{
'success': instance.success,
};
NextcloudUnifiedPushProviderDeleteDeviceResponse200ApplicationJson
_$NextcloudUnifiedPushProviderDeleteDeviceResponse200ApplicationJsonFromJson(Map<String, dynamic> json) {
$checkKeys(
json,
allowedKeys: const ['success'],
);
return NextcloudUnifiedPushProviderDeleteDeviceResponse200ApplicationJson(
success: json['success'] as bool,
);
}
Map<String, dynamic> _$NextcloudUnifiedPushProviderDeleteDeviceResponse200ApplicationJsonToJson(
NextcloudUnifiedPushProviderDeleteDeviceResponse200ApplicationJson instance) =>
<String, dynamic>{
'success': instance.success,
};
NextcloudUnifiedPushProviderCreateAppResponse200ApplicationJson
_$NextcloudUnifiedPushProviderCreateAppResponse200ApplicationJsonFromJson(Map<String, dynamic> json) {
$checkKeys(
json,
allowedKeys: const ['success', 'token'],
);
return NextcloudUnifiedPushProviderCreateAppResponse200ApplicationJson(
success: json['success'] as bool,
token: json['token'] as String,
);
}
Map<String, dynamic> _$NextcloudUnifiedPushProviderCreateAppResponse200ApplicationJsonToJson(
NextcloudUnifiedPushProviderCreateAppResponse200ApplicationJson instance) =>
<String, dynamic>{
'success': instance.success,
'token': instance.token,
};
NextcloudUnifiedPushProviderDeleteAppResponse200ApplicationJson
_$NextcloudUnifiedPushProviderDeleteAppResponse200ApplicationJsonFromJson(Map<String, dynamic> json) {
$checkKeys(
json,
allowedKeys: const ['success'],
);
return NextcloudUnifiedPushProviderDeleteAppResponse200ApplicationJson(
success: json['success'] as bool,
);
}
Map<String, dynamic> _$NextcloudUnifiedPushProviderDeleteAppResponse200ApplicationJsonToJson(
NextcloudUnifiedPushProviderDeleteAppResponse200ApplicationJson instance) =>
<String, dynamic>{
'success': instance.success,
};
NextcloudUnifiedPushProviderUnifiedpushDiscoveryResponse200ApplicationJson_Unifiedpush
_$NextcloudUnifiedPushProviderUnifiedpushDiscoveryResponse200ApplicationJson_UnifiedpushFromJson(
Map<String, dynamic> json) {
$checkKeys(
json,
allowedKeys: const ['version'],
);
return NextcloudUnifiedPushProviderUnifiedpushDiscoveryResponse200ApplicationJson_Unifiedpush(
version: json['version'] as int,
);
}
Map<String, dynamic> _$NextcloudUnifiedPushProviderUnifiedpushDiscoveryResponse200ApplicationJson_UnifiedpushToJson(
NextcloudUnifiedPushProviderUnifiedpushDiscoveryResponse200ApplicationJson_Unifiedpush instance) =>
<String, dynamic>{
'version': instance.version,
};
NextcloudUnifiedPushProviderUnifiedpushDiscoveryResponse200ApplicationJson
_$NextcloudUnifiedPushProviderUnifiedpushDiscoveryResponse200ApplicationJsonFromJson(Map<String, dynamic> json) {
$checkKeys(
json,
allowedKeys: const ['unifiedpush'],
);
return NextcloudUnifiedPushProviderUnifiedpushDiscoveryResponse200ApplicationJson(
unifiedpush: NextcloudUnifiedPushProviderUnifiedpushDiscoveryResponse200ApplicationJson_Unifiedpush.fromJson(
json['unifiedpush'] as Map<String, dynamic>),
);
}
Map<String, dynamic> _$NextcloudUnifiedPushProviderUnifiedpushDiscoveryResponse200ApplicationJsonToJson(
NextcloudUnifiedPushProviderUnifiedpushDiscoveryResponse200ApplicationJson instance) =>
<String, dynamic>{
'unifiedpush': instance.unifiedpush.toJson(),
};
NextcloudUnifiedPushProviderPushResponse201ApplicationJson
_$NextcloudUnifiedPushProviderPushResponse201ApplicationJsonFromJson(Map<String, dynamic> json) {
$checkKeys(
json,
allowedKeys: const ['success'],
);
return NextcloudUnifiedPushProviderPushResponse201ApplicationJson(
success: json['success'] as bool,
);
}
Map<String, dynamic> _$NextcloudUnifiedPushProviderPushResponse201ApplicationJsonToJson(
NextcloudUnifiedPushProviderPushResponse201ApplicationJson instance) =>
<String, dynamic>{
'success': instance.success,
};
NextcloudUnifiedPushProviderGatewayMatrixDiscoveryResponse200ApplicationJson_Unifiedpush
_$NextcloudUnifiedPushProviderGatewayMatrixDiscoveryResponse200ApplicationJson_UnifiedpushFromJson(
Map<String, dynamic> json) {
$checkKeys(
json,
allowedKeys: const ['gateway'],
);
return NextcloudUnifiedPushProviderGatewayMatrixDiscoveryResponse200ApplicationJson_Unifiedpush(
gateway: json['gateway'] as String,
);
}
Map<String, dynamic> _$NextcloudUnifiedPushProviderGatewayMatrixDiscoveryResponse200ApplicationJson_UnifiedpushToJson(
NextcloudUnifiedPushProviderGatewayMatrixDiscoveryResponse200ApplicationJson_Unifiedpush instance) =>
<String, dynamic>{
'gateway': instance.gateway,
};
NextcloudUnifiedPushProviderGatewayMatrixDiscoveryResponse200ApplicationJson
_$NextcloudUnifiedPushProviderGatewayMatrixDiscoveryResponse200ApplicationJsonFromJson(Map<String, dynamic> json) {
$checkKeys(
json,
allowedKeys: const ['unifiedpush'],
);
return NextcloudUnifiedPushProviderGatewayMatrixDiscoveryResponse200ApplicationJson(
unifiedpush: NextcloudUnifiedPushProviderGatewayMatrixDiscoveryResponse200ApplicationJson_Unifiedpush.fromJson(
json['unifiedpush'] as Map<String, dynamic>),
);
}
Map<String, dynamic> _$NextcloudUnifiedPushProviderGatewayMatrixDiscoveryResponse200ApplicationJsonToJson(
NextcloudUnifiedPushProviderGatewayMatrixDiscoveryResponse200ApplicationJson instance) =>
<String, dynamic>{
'unifiedpush': instance.unifiedpush.toJson(),
};
NextcloudUnifiedPushProviderGatewayMatrixResponse200ApplicationJson
_$NextcloudUnifiedPushProviderGatewayMatrixResponse200ApplicationJsonFromJson(Map<String, dynamic> json) {
$checkKeys(
json,
allowedKeys: const ['rejected'],
);
return NextcloudUnifiedPushProviderGatewayMatrixResponse200ApplicationJson(
rejected: (json['rejected'] as List<dynamic>).map((e) => e as String).toList(),
);
}
Map<String, dynamic> _$NextcloudUnifiedPushProviderGatewayMatrixResponse200ApplicationJsonToJson(
NextcloudUnifiedPushProviderGatewayMatrixResponse200ApplicationJson instance) =>
<String, dynamic>{
'rejected': instance.rejected,
};
NextcloudUserStatusClearAt _$NextcloudUserStatusClearAtFromJson(Map<String, dynamic> json) {
$checkKeys(
json,

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

@ -3419,6 +3419,422 @@
}
}
},
"/index.php/apps/uppush": {
"get": {
"tags": [
"unified_push_provider"
],
"summary": "Check if the UnifiedPush provider is present",
"operationId": "unified_push_provider-check",
"responses": {
"200": {
"description": "",
"content": {
"application/json": {
"schema": {
"required": [
"success"
],
"type": "object",
"properties": {
"success": {
"type": "boolean"
}
}
}
}
}
}
}
}
},
"/index.php/apps/uppush/keepalive": {
"put": {
"tags": [
"unified_push_provider"
],
"summary": "Set keepalive interval.",
"operationId": "unified_push_provider-set-keepalive",
"parameters": [
{
"name": "keepalive",
"in": "query",
"description": "Keep alive value in seconds",
"required": true,
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "",
"content": {
"application/json": {
"schema": {
"required": [
"success"
],
"type": "object",
"properties": {
"success": {
"type": "boolean"
}
}
}
}
}
}
}
}
},
"/index.php/apps/uppush/device": {
"put": {
"tags": [
"unified_push_provider"
],
"summary": "Request to create a new deviceId.",
"operationId": "unified_push_provider-create-device",
"parameters": [
{
"name": "deviceName",
"in": "query",
"description": "Name of the device",
"required": true,
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "",
"content": {
"application/json": {
"schema": {
"required": [
"success",
"deviceId"
],
"type": "object",
"properties": {
"success": {
"type": "boolean"
},
"deviceId": {
"type": "string"
}
}
}
}
}
}
}
}
},
"/index.php/apps/uppush/device/{deviceId}": {
"parameters": [
{
"name": "deviceId",
"in": "path",
"description": "ID of the device",
"required": true,
"schema": {
"type": "string"
}
}
],
"get": {
"tags": [
"unified_push_provider"
],
"summary": "Request to get push messages.",
"description": "This is a public page since it has to be handle by the non-connected app (NextPush app and not Nextcloud-app)",
"operationId": "unified_push_provider-sync-device",
"responses": {
"401": {
"description": "Missing permissions to sync device",
"content": {
"application/json": {
"schema": {
"required": [
"success"
],
"type": "object",
"properties": {
"success": {
"type": "boolean"
}
}
}
}
}
}
}
},
"delete": {
"tags": [
"unified_push_provider"
],
"summary": "Delete a device.",
"operationId": "unified_push_provider-delete-device",
"responses": {
"200": {
"description": "Device deleted successfully",
"content": {
"application/json": {
"schema": {
"required": [
"success"
],
"type": "object",
"properties": {
"success": {
"type": "boolean"
}
}
}
}
}
}
}
}
},
"/index.php/apps/uppush/app": {
"put": {
"tags": [
"unified_push_provider"
],
"summary": "Create an authorization token for a new 3rd party service.",
"operationId": "unified_push_provider-create-app",
"parameters": [
{
"name": "deviceId",
"in": "query",
"description": "ID of the device",
"required": true,
"schema": {
"type": "string"
}
},
{
"name": "appName",
"in": "query",
"description": "Name of the app",
"required": true,
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "App created successfully",
"content": {
"application/json": {
"schema": {
"required": [
"success",
"token"
],
"type": "object",
"properties": {
"success": {
"type": "boolean"
},
"token": {
"type": "string"
}
}
}
}
}
}
}
}
},
"/index.php/apps/uppush/app/{token}": {
"parameters": [
{
"name": "token",
"in": "path",
"description": "Token of the app",
"required": true,
"schema": {
"type": "string"
}
}
],
"delete": {
"tags": [
"unified_push_provider"
],
"summary": "Delete an authorization token.",
"operationId": "unified_push_provider-delete-app",
"responses": {
"200": {
"description": "App deleted successfully",
"content": {
"application/json": {
"schema": {
"required": [
"success"
],
"type": "object",
"properties": {
"success": {
"type": "boolean"
}
}
}
}
}
}
}
}
},
"/index.php/apps/uppush/push/{token}": {
"parameters": [
{
"name": "token",
"in": "path",
"description": "Token of the app to push to",
"required": true,
"schema": {
"type": "string"
}
}
],
"post": {
"tags": [
"unified_push_provider"
],
"summary": "Receive notifications from 3rd parties.",
"operationId": "unified_push_provider-push",
"responses": {
"201": {
"description": "Notification pushed successfully",
"content": {
"application/json": {
"schema": {
"required": [
"success"
],
"type": "object",
"properties": {
"success": {
"type": "boolean"
}
}
}
}
}
}
}
},
"get": {
"tags": [
"unified_push_provider"
],
"summary": "Unifiedpush discovery Following specifications",
"operationId": "unified_push_provider-unifiedpush-discovery",
"responses": {
"200": {
"description": "",
"content": {
"application/json": {
"schema": {
"required": [
"unifiedpush"
],
"type": "object",
"properties": {
"unifiedpush": {
"required": [
"version"
],
"type": "object",
"properties": {
"version": {
"type": "integer"
}
}
}
}
}
}
}
}
}
}
},
"/index.php/apps/uppush/gateway/matrix": {
"get": {
"tags": [
"unified_push_provider"
],
"summary": "Matrix Gateway discovery",
"operationId": "unified_push_provider-gateway-matrix-discovery",
"responses": {
"200": {
"description": "",
"content": {
"application/json": {
"schema": {
"required": [
"unifiedpush"
],
"type": "object",
"properties": {
"unifiedpush": {
"required": [
"gateway"
],
"type": "object",
"properties": {
"gateway": {
"type": "string"
}
}
}
}
}
}
}
}
}
},
"post": {
"tags": [
"unified_push_provider"
],
"summary": "Matrix Gateway",
"operationId": "unified_push_provider-gateway-matrix",
"responses": {
"200": {
"description": "",
"content": {
"application/json": {
"schema": {
"required": [
"rejected"
],
"type": "object",
"properties": {
"rejected": {
"type": "array",
"items": {
"type": "string"
}
}
}
}
}
}
}
}
}
},
"/ocs/v2.php/apps/user_status/api/v1/statuses": {
"get": {
"operationId": "get-public-statuses",

66
packages/nextcloud/test/uppush.dart

@ -0,0 +1,66 @@
import 'package:test/test.dart';
import 'helper.dart';
Future main() async {
await run(await getDockerImage());
}
Future run(final DockerImage image) async {
group('uppush', () {
late DockerContainer container;
late TestNextcloudClient client;
setUp(() async {
container = await getDockerContainer(image);
client = await getTestClient(
container,
username: 'admin',
password: 'admin',
);
});
tearDown(() => container.destroy());
test('Is installed', () async {
final response = await client.unifiedPushProvider.check();
expect(response.success, isTrue);
});
test('Set keepalive', () async {
final response = await client.unifiedPushProvider.setKeepalive(keepalive: '10');
expect(response.success, isTrue);
});
test('Create device', () async {
final response = await client.unifiedPushProvider.createDevice(deviceName: 'Test');
expect(response.success, isTrue);
expect(response.deviceId, isNotEmpty);
});
test('Delete device', () async {
final deviceId = (await client.unifiedPushProvider.createDevice(deviceName: 'Test')).deviceId;
final response = await client.unifiedPushProvider.deleteDevice(deviceId: deviceId);
expect(response.success, isTrue);
});
test('Create app', () async {
final deviceId = (await client.unifiedPushProvider.createDevice(deviceName: 'Test')).deviceId;
final response = await client.unifiedPushProvider.createApp(deviceId: deviceId, appName: 'Test');
expect(response.success, isTrue);
expect(response.token, isNotEmpty);
});
test('UnifiedPush discovery', () async {
final response = await client.unifiedPushProvider.unifiedpushDiscovery(token: 'example');
expect(response.unifiedpush.version, 1);
});
test('Matrix gateway discovery', () async {
final response = await client.unifiedPushProvider.gatewayMatrixDiscovery();
expect(response.unifiedpush.gateway, 'matrix');
});
// Deleting an app, sending a notification (also via matrix gateway) or listening for notifications is not possible because redis is not set up
});
}

444
specs/uppush.json

@ -0,0 +1,444 @@
{
"openapi": "3.0.3",
"info": {
"title": "UnifiedPush Provider",
"description": "Use Nextcloud as a push provider for mobile phones' notifications",
"license": {
"name": "agpl"
},
"version": "1.2.0"
},
"paths": {
"/index.php/apps/uppush": {
"get": {
"tags": [
"unified_push_provider"
],
"summary": "Check if the UnifiedPush provider is present",
"operationId": "unified_push_provider-check",
"responses": {
"200": {
"description": "",
"content": {
"application/json": {
"schema": {
"required": [
"success"
],
"type": "object",
"properties": {
"success": {
"type": "boolean"
}
}
}
}
}
}
}
}
},
"/index.php/apps/uppush/keepalive": {
"put": {
"tags": [
"unified_push_provider"
],
"summary": "Set keepalive interval.",
"operationId": "unified_push_provider-set-keepalive",
"parameters": [
{
"name": "keepalive",
"in": "query",
"description": "Keep alive value in seconds",
"required": true,
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "",
"content": {
"application/json": {
"schema": {
"required": [
"success"
],
"type": "object",
"properties": {
"success": {
"type": "boolean"
}
}
}
}
}
}
}
}
},
"/index.php/apps/uppush/device": {
"put": {
"tags": [
"unified_push_provider"
],
"summary": "Request to create a new deviceId.",
"operationId": "unified_push_provider-create-device",
"parameters": [
{
"name": "deviceName",
"in": "query",
"description": "Name of the device",
"required": true,
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "",
"content": {
"application/json": {
"schema": {
"required": [
"success",
"deviceId"
],
"type": "object",
"properties": {
"success": {
"type": "boolean"
},
"deviceId": {
"type": "string"
}
}
}
}
}
}
}
}
},
"/index.php/apps/uppush/device/{deviceId}": {
"parameters": [
{
"name": "deviceId",
"in": "path",
"description": "ID of the device",
"required": true,
"schema": {
"type": "string"
}
}
],
"get": {
"tags": [
"unified_push_provider"
],
"summary": "Request to get push messages.",
"description": "This is a public page since it has to be handle by the non-connected app (NextPush app and not Nextcloud-app)",
"operationId": "unified_push_provider-sync-device",
"responses": {
"401": {
"description": "Missing permissions to sync device",
"content": {
"application/json": {
"schema": {
"required": [
"success"
],
"type": "object",
"properties": {
"success": {
"type": "boolean"
}
}
}
}
}
}
}
},
"delete": {
"tags": [
"unified_push_provider"
],
"summary": "Delete a device.",
"operationId": "unified_push_provider-delete-device",
"responses": {
"200": {
"description": "Device deleted successfully",
"content": {
"application/json": {
"schema": {
"required": [
"success"
],
"type": "object",
"properties": {
"success": {
"type": "boolean"
}
}
}
}
}
}
}
}
},
"/index.php/apps/uppush/app": {
"put": {
"tags": [
"unified_push_provider"
],
"summary": "Create an authorization token for a new 3rd party service.",
"operationId": "unified_push_provider-create-app",
"parameters": [
{
"name": "deviceId",
"in": "query",
"description": "ID of the device",
"required": true,
"schema": {
"type": "string"
}
},
{
"name": "appName",
"in": "query",
"description": "Name of the app",
"required": true,
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "App created successfully",
"content": {
"application/json": {
"schema": {
"required": [
"success",
"token"
],
"type": "object",
"properties": {
"success": {
"type": "boolean"
},
"token": {
"type": "string"
}
}
}
}
}
}
}
}
},
"/index.php/apps/uppush/app/{token}": {
"parameters": [
{
"name": "token",
"in": "path",
"description": "Token of the app",
"required": true,
"schema": {
"type": "string"
}
}
],
"delete": {
"tags": [
"unified_push_provider"
],
"summary": "Delete an authorization token.",
"operationId": "unified_push_provider-delete-app",
"responses": {
"200": {
"description": "App deleted successfully",
"content": {
"application/json": {
"schema": {
"required": [
"success"
],
"type": "object",
"properties": {
"success": {
"type": "boolean"
}
}
}
}
}
}
}
}
},
"/index.php/apps/uppush/push/{token}": {
"parameters": [
{
"name": "token",
"in": "path",
"description": "Token of the app to push to",
"required": true,
"schema": {
"type": "string"
}
}
],
"post": {
"tags": [
"unified_push_provider"
],
"summary": "Receive notifications from 3rd parties.",
"operationId": "unified_push_provider-push",
"responses": {
"201": {
"description": "Notification pushed successfully",
"content": {
"application/json": {
"schema": {
"required": [
"success"
],
"type": "object",
"properties": {
"success": {
"type": "boolean"
}
}
}
}
}
}
}
},
"get": {
"tags": [
"unified_push_provider"
],
"summary": "Unifiedpush discovery Following specifications",
"operationId": "unified_push_provider-unifiedpush-discovery",
"responses": {
"200": {
"description": "",
"content": {
"application/json": {
"schema": {
"required": [
"unifiedpush"
],
"type": "object",
"properties": {
"unifiedpush": {
"required": [
"version"
],
"type": "object",
"properties": {
"version": {
"type": "integer"
}
}
}
}
}
}
}
}
}
}
},
"/index.php/apps/uppush/gateway/matrix": {
"get": {
"tags": [
"unified_push_provider"
],
"summary": "Matrix Gateway discovery",
"operationId": "unified_push_provider-gateway-matrix-discovery",
"responses": {
"200": {
"description": "",
"content": {
"application/json": {
"schema": {
"required": [
"unifiedpush"
],
"type": "object",
"properties": {
"unifiedpush": {
"required": [
"gateway"
],
"type": "object",
"properties": {
"gateway": {
"type": "string"
}
}
}
}
}
}
}
}
}
},
"post": {
"tags": [
"unified_push_provider"
],
"summary": "Matrix Gateway",
"operationId": "unified_push_provider-gateway-matrix",
"responses": {
"200": {
"description": "",
"content": {
"application/json": {
"schema": {
"required": [
"rejected"
],
"type": "object",
"properties": {
"rejected": {
"type": "array",
"items": {
"type": "string"
}
}
}
}
}
}
}
}
}
}
},
"components": {
"schemas": {},
"securitySchemes": {
"basic_auth": {
"type": "http",
"scheme": "basic"
}
}
},
"security": [
{
"basic_auth": []
}
],
"tags": []
}

1
tool/Dockerfile.dev

@ -13,6 +13,7 @@ RUN OC_PASS="user2" ./occ user:add --password-from-env --display-name "User Two"
RUN ./occ app:install news # 21.0.0
RUN ./occ app:install notes # 4.6.0
RUN ./occ app:install uppush # 1.2.0
RUN ./occ app:enable password_policy
# TODO: This stopped working randomly with apache not being able to bind to the port during build. Must be some docker changes?

4
tool/generate-nextcloud.sh

@ -5,8 +5,8 @@ cd "$(dirname "$0")/.."
rm -rf /tmp/nextcloud-neon
mkdir -p /tmp/nextcloud-neon
codenames=(core news notes notifications provisioning_api user_status)
prefixes=(Core News Notes Notifications ProvisioningApi UserStatus)
codenames=(core news notes notifications provisioning_api uppush user_status)
prefixes=(Core News Notes Notifications ProvisioningApi UnifiedPushProvider UserStatus)
base_spec=/tmp/nextcloud-neon/base.json
merged_spec=/tmp/nextcloud-neon/merged.json

Loading…
Cancel
Save