-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds support for extended_transparency on Events APIs
- Loading branch information
Showing
9 changed files
with
246 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
1.12.7 | ||
1.12.8 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
namespace Cronofy | ||
{ | ||
/// <summary> | ||
/// Potential extended_transparency values. | ||
/// </summary> | ||
public static class ExtendedTransparency | ||
{ | ||
/// <summary> | ||
/// The account should appear as busy for the duration of the event. | ||
/// </summary> | ||
public const string Opaque = "opaque"; | ||
|
||
/// <summary> | ||
/// The account should not appear as busy for the duration of the event. | ||
/// </summary> | ||
public const string Transparent = "transparent"; | ||
|
||
/// <summary> | ||
/// Indicates the user is working away from their normal site. | ||
/// </summary> | ||
public const string WorkingElsewhere = "working_elsewhere"; | ||
|
||
/// <summary> | ||
/// Indicates an event being only tentatively accepted. | ||
/// </summary> | ||
public const string Tentative = "tentative"; | ||
|
||
/// <summary> | ||
/// Indicates the user is unavailable due to being out of the office, such as being on vacation. | ||
/// </summary> | ||
public const string OutOfOffice = "out_of_office"; | ||
|
||
/// <summary> | ||
/// The appearance of the account for the duration of the event is not | ||
/// known. | ||
/// </summary> | ||
public const string Unknown = "unknown"; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -554,6 +554,100 @@ public void CanGetEventWithMeetingUrl() | |
events); | ||
} | ||
|
||
[Test] | ||
public void CanGetEventWithExtendedTransparency() | ||
{ | ||
this.Http.Stub( | ||
HttpGet | ||
.Url("https://api.cronofy.com/v1/events?tzid=Etc%2FUTC&localized_times=true") | ||
.RequestHeader("Authorization", "Bearer " + AccessToken) | ||
.ResponseCode(200) | ||
.ResponseBody( | ||
@"{ | ||
""pages"": { | ||
""current"": 1, | ||
""total"": 1 | ||
}, | ||
""events"": [ | ||
{ | ||
""calendar_id"": ""cal_U9uuErStTG@EAAAB_IsAsykA2DBTWqQTf-f0kJw"", | ||
""event_uid"": ""evt_external_54008b1a4a41730f8d5c6037"", | ||
""summary"": ""Company Retreat"", | ||
""description"": ""Escape to the country"", | ||
""start"": ""2014-09-06"", | ||
""end"": ""2014-09-08"", | ||
""deleted"": false, | ||
""recurring"": true, | ||
""series_identifier"": ""identifier"", | ||
""participation_status"": ""needs_action"", | ||
""transparency"": ""opaque"", | ||
""extended_transparency"": ""working_elsewhere"", | ||
""status"": ""confirmed"", | ||
""categories"": [], | ||
""attendees"": [ | ||
{ | ||
""email"": ""[email protected]"", | ||
""display_name"": ""Example Person"", | ||
""status"": ""needs_action"" | ||
} | ||
], | ||
""created"": ""2014-09-01T08:00:01Z"", | ||
""updated"": ""2014-09-01T09:24:16Z"", | ||
""options"": { | ||
""delete"": true, | ||
""update"": true, | ||
""change_participation_status"": true | ||
}, | ||
""meeting_url"": ""https://meet.example.com/ABCD1234"" | ||
} | ||
] | ||
}")); | ||
|
||
var events = this.Client.GetEvents(); | ||
|
||
CollectionAssert.AreEqual( | ||
new List<Event> | ||
{ | ||
new Event | ||
{ | ||
CalendarId = "cal_U9uuErStTG@EAAAB_IsAsykA2DBTWqQTf-f0kJw", | ||
EventUid = "evt_external_54008b1a4a41730f8d5c6037", | ||
Summary = "Company Retreat", | ||
Description = "Escape to the country", | ||
Start = new EventTime(new Date(2014, 9, 6), "Etc/UTC"), | ||
End = new EventTime(new Date(2014, 9, 8), "Etc/UTC"), | ||
Location = null, | ||
Deleted = false, | ||
Recurring = true, | ||
SeriesIdentifier = "identifier", | ||
ParticipationStatus = AttendeeStatus.NeedsAction, | ||
Transparency = Transparency.Opaque, | ||
ExtendedTransparency = ExtendedTransparency.WorkingElsewhere, | ||
EventStatus = EventStatus.Confirmed, | ||
Categories = new string[] { }, | ||
Created = new DateTime(2014, 9, 1, 8, 0, 1, DateTimeKind.Utc), | ||
Updated = new DateTime(2014, 9, 1, 9, 24, 16, DateTimeKind.Utc), | ||
Attendees = new[] | ||
{ | ||
new Attendee | ||
{ | ||
Email = "[email protected]", | ||
DisplayName = "Example Person", | ||
Status = AttendeeStatus.NeedsAction, | ||
}, | ||
}, | ||
Options = new EventOptions() | ||
{ | ||
Delete = true, | ||
Update = true, | ||
ChangeParticipationStatus = true, | ||
}, | ||
MeetingUrl = "https://meet.example.com/ABCD1234", | ||
}, | ||
}, | ||
events); | ||
} | ||
|
||
[Test] | ||
public void CanGetEventWithOldAuditTimes() | ||
{ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters