forked from olsh/todoist-net
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathNotesService.cs
32 lines (28 loc) · 966 Bytes
/
NotesService.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
using System.Threading;
using System.Threading.Tasks;
using Todoist.Net.Models;
namespace Todoist.Net.Services
{
/// <summary>
/// Contains operations for notes management.
/// </summary>
/// <seealso cref="Todoist.Net.Services.NotesCommandService" />
/// <seealso cref="Todoist.Net.Services.INotesServices" />
internal class NotesService : NotesCommandService, INotesServices
{
internal NotesService(IAdvancedTodoistClient todoistClient)
: base(todoistClient)
{
}
/// <inheritdoc/>
public async Task<NotesInfo> GetAsync(CancellationToken cancellationToken = default)
{
var response = await TodoistClient.GetResourcesAsync(cancellationToken, ResourceType.Notes).ConfigureAwait(false);
return new NotesInfo
{
ItemNotes = response.Notes,
ProjectNotes = response.ProjectNotes
};
}
}
}