Ad and purchases enabled (still need actual testing)

This commit is contained in:
Courtney Arnold 2026-08-16 18:27:56 -05:00
parent 2fcc6dcab7
commit faf319322a
35 changed files with 1676 additions and 34 deletions

View file

@ -245,6 +245,22 @@ class OneDriveSession implements CloudStorageSession {
return created['id'] as String;
}
@override
Future<String> moveFolder({required String folderId, required String newParentId}) async {
final response = await http.patch(
_graph('/me/drive/${_itemSegment(folderId)}'),
headers: {...await _authHeader(), 'Content-Type': 'application/json'},
body: jsonEncode({
'parentReference': {'id': newParentId},
}),
);
if (response.statusCode != 200) {
throw StateError('OneDrive API error (moveFolder): ${response.statusCode} ${response.body}');
}
final json = jsonDecode(response.body) as Map<String, dynamic>;
return json['id'] as String? ?? folderId;
}
@override
Future<CloudFileInfo?> findFile({required String folderId, required String name}) async {
final uri = _graph('/me/drive/${_itemSegment(folderId)}:/$name');