Browse Source

specs,nextcloud: Add endpoint for deleting app password

pull/290/head
jld3103 2 years ago
parent
commit
84dde64090
No known key found for this signature in database
GPG Key ID: 9062417B9E8EB7B3
  1. 24
      packages/nextcloud/lib/src/nextcloud.openapi.dart
  2. 20
      packages/nextcloud/lib/src/nextcloud.openapi.json
  3. 20
      specs/core.json

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

@ -433,6 +433,30 @@ class NextcloudCoreClient {
} }
throw NextcloudApiException.fromResponse(response); // coverage:ignore-line throw NextcloudApiException.fromResponse(response); // coverage:ignore-line
} }
Future<dynamic> deleteAppPassword() async {
const path = '/ocs/v2.php/core/apppassword';
final queryParameters = <String, dynamic>{};
final headers = <String, String>{
'Accept': 'application/json',
};
Uint8List? body;
if (rootClient.authentications.map((final a) => a.id).contains('basic_auth')) {
headers.addAll(rootClient.authentications.singleWhere((final a) => a.id == 'basic_auth').headers);
} else {
throw Exception('Missing authentication for basic_auth');
}
final response = await rootClient.doRequest(
'delete',
Uri(path: path, queryParameters: queryParameters.isNotEmpty ? queryParameters : null).toString(),
headers,
body,
);
if (response.statusCode == 200) {
return;
}
throw NextcloudApiException.fromResponse(response); // coverage:ignore-line
}
} }
class NextcloudNewsClient { class NextcloudNewsClient {

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

@ -2343,6 +2343,26 @@
} }
} }
}, },
"/ocs/v2.php/core/apppassword": {
"delete": {
"tags": [
"core"
],
"operationId": "delete-app-password",
"responses": {
"200": {
"description": "App password deleted successfully",
"content": {
"application/json": {
"schema": {
"type": "object"
}
}
}
}
}
}
},
"/index.php/apps/news/api": { "/index.php/apps/news/api": {
"get": { "get": {
"operationId": "get-supported-api-versions", "operationId": "get-supported-api-versions",

20
specs/core.json

@ -1318,6 +1318,26 @@
} }
} }
} }
},
"/ocs/v2.php/core/apppassword": {
"delete": {
"tags": [
"core"
],
"operationId": "delete-app-password",
"responses": {
"200": {
"description": "App password deleted successfully",
"content": {
"application/json": {
"schema": {
"type": "object"
}
}
}
}
}
}
} }
} }
} }

Loading…
Cancel
Save