wip: finish converting some more projects
This commit is contained in:
20
Habittodo.Model/Todoist/Due.cs
Normal file
20
Habittodo.Model/Todoist/Due.cs
Normal file
@@ -0,0 +1,20 @@
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Habittodo.Model.Todoist
|
||||
{
|
||||
public class Due
|
||||
{
|
||||
[JsonProperty("date")]
|
||||
public string Date { get; set; }
|
||||
[JsonProperty("timezone")]
|
||||
public string Timezone { get; set; }
|
||||
[JsonProperty("string")]
|
||||
public string @String { get; set; }
|
||||
|
||||
public string ToJavaScriptDateStr()
|
||||
{
|
||||
try { return Date + "T00:00:00.000Z"; } catch { }
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
33
Habittodo.Model/Todoist/Item.cs
Normal file
33
Habittodo.Model/Todoist/Item.cs
Normal file
@@ -0,0 +1,33 @@
|
||||
using Newtonsoft.Json;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
namespace Habittodo.Model.Todoist
|
||||
{
|
||||
public class Item
|
||||
{
|
||||
[JsonProperty("id")]
|
||||
public string Id { get; set; }
|
||||
[JsonProperty("content")]
|
||||
public string Content { get; set; }
|
||||
[JsonProperty("due")]
|
||||
public Due Due { get; set; }
|
||||
[JsonProperty("priority")]
|
||||
public int Priority { get; set; }
|
||||
[JsonProperty("parent_id")]
|
||||
public string Parent_Id { get; set; }
|
||||
[JsonProperty("is_deleted")]
|
||||
public int Is_deleted { get; set; }
|
||||
[JsonProperty("project_id")]
|
||||
public string Project_id { get; set; }
|
||||
[JsonProperty("date_completed")]
|
||||
public string Date_completed { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// This field will always be false when an item is marked as deleted
|
||||
/// </summary>
|
||||
[JsonIgnore]
|
||||
public bool IsChild => !string.IsNullOrEmpty(Parent_Id);
|
||||
}
|
||||
}
|
||||
17
Habittodo.Model/Todoist/Responses/SyncResponse.cs
Normal file
17
Habittodo.Model/Todoist/Responses/SyncResponse.cs
Normal file
@@ -0,0 +1,17 @@
|
||||
using Newtonsoft.Json;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace Habittodo.Model.Todoist.Responses
|
||||
{
|
||||
public class SyncResponse
|
||||
{
|
||||
[JsonProperty("sync_token")]
|
||||
public string Sync_token { get; set; }
|
||||
[JsonProperty("full_sync")]
|
||||
public bool Full_sync { get; set; }
|
||||
[JsonProperty("items")]
|
||||
public List<Item> Items { get; set; }
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user