-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
- Loading branch information
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
{ | ||
"name": "DCL.EventsApi", | ||
"rootNamespace": "", | ||
"references": [ | ||
"GUID:f51ebe6a0ceec4240a699833d6309b23", | ||
"GUID:4a12c0b1b77ec6b418a8d7bd5c925be3", | ||
"GUID:9b4463c7170cb485aaf17878a8b7281e", | ||
"GUID:fa7b3fdbb04d67549916da7bd2af58ab", | ||
"GUID:8322ea9340a544c59ddc56d4793eac74", | ||
"GUID:3640f3c0b42946b0b8794a1ed8e06ca5", | ||
"GUID:91cf8206af184dac8e30eb46747e9939" | ||
], | ||
"includePlatforms": [], | ||
"excludePlatforms": [], | ||
"allowUnsafeCode": false, | ||
"overrideReferences": false, | ||
"precompiledReferences": [], | ||
"autoReferenced": true, | ||
"defineConstraints": [], | ||
"versionDefines": [], | ||
"noEngineReferences": false | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
using System; | ||
|
||
namespace DCL.EventsApi | ||
{ | ||
[Serializable] | ||
public struct EventDTO | ||
{ | ||
public string id; | ||
public string name; | ||
public string image; | ||
public string description; | ||
public string next_start_at; | ||
public string next_finish_at; | ||
public string finish_at; | ||
public string scene_name; | ||
public int[] coordinates; | ||
public string server; | ||
public int total_attendees; | ||
public bool live; | ||
public string user_name; | ||
public bool highlighted; | ||
public bool trending; | ||
public bool attending; | ||
public string[] categories; | ||
public bool recurrent; | ||
public double duration; | ||
public string start_at; | ||
public string[] recurrent_dates; | ||
public bool world; | ||
public int x; | ||
public int y; | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
namespace DCL.EventsApi | ||
{ | ||
public struct EventDTOListResponse | ||
{ | ||
public bool ok; | ||
public EventDTO[] data; | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
using System; | ||
|
||
namespace DCL.EventsApi | ||
{ | ||
public class EventsApiException : Exception | ||
{ | ||
public EventsApiException(string message) : base(message) { } | ||
|
||
public EventsApiException(string message, Exception innerException) : base(message, innerException) { } | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
using CommunicationData.URLHelpers; | ||
using DCL.Browser; | ||
using System; | ||
|
||
namespace DCL.EventsApi | ||
{ | ||
public class GoogleUserCalendar : IUserCalendar | ||
{ | ||
private const string GOOGLE_CALENDAR_DOMAIN = "https://www.google.com/calendar/event"; | ||
private const string ACTION_PARAM = "action"; | ||
private const string ACTION_TEMPLATE = "TEMPLATE"; | ||
private const string TITLE_PARAM = "text"; | ||
private const string DATES_PARAM = "dates"; | ||
private const string DESCRIPTION_PARAM = "details"; | ||
|
||
private readonly IWebBrowser webBrowser; | ||
private readonly URLBuilder urlBuilder = new (); | ||
|
||
public GoogleUserCalendar(IWebBrowser webBrowser) | ||
{ | ||
this.webBrowser = webBrowser; | ||
} | ||
|
||
public void Add(string title, string description, DateTime startAt, DateTime endAt) | ||
{ | ||
urlBuilder.Clear(); | ||
|
||
urlBuilder.AppendDomain(URLDomain.FromString(GOOGLE_CALENDAR_DOMAIN)) | ||
.AppendParameter(new URLParameter(ACTION_PARAM, ACTION_TEMPLATE)) | ||
.AppendParameter(new URLParameter(TITLE_PARAM, title)) | ||
.AppendParameter(new URLParameter(DATES_PARAM, $"{startAt:yyyyMMddTHHmmssZ}/{endAt:yyyyMMddTHHmmssZ}")) | ||
.AppendParameter(new URLParameter(DESCRIPTION_PARAM, description)); | ||
|
||
webBrowser.OpenUrl(urlBuilder.Build()); | ||
} | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.