Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Event Create/Update/Delete access for existing Calendar API #47

Open
ScottBTR opened this issue Dec 5, 2019 · 2 comments
Open

Add Event Create/Update/Delete access for existing Calendar API #47

ScottBTR opened this issue Dec 5, 2019 · 2 comments

Comments

@ScottBTR
Copy link

ScottBTR commented Dec 5, 2019

Calendar API

Calendar API Update to no longer be read-only but will now have CRUD access to events for calendars seamlessly across uwp, iOS and Android.

API

Calendar

Methods

API Description
Task<IEnumerable<DeviceCalendar>> GetCalendarsAsync() Retrieve all calendars for device
Task<IEnumerable<DeviceEvent>> GetEventsAsync( string calendarId = null, DateTimeOffset? startDate = null, DateTimeOffset? endDate = null) Retrieve all events for a specified range/calendar, null will use defaults: calendarId will default to all Calendars retrieved, startDate will default to use, DefaultStartDate , endDate will default to use DefaultEndDate
Task<DeviceEvent> GetEventByIdAsync(string eventId) Gets more detailed information about a specific event by the event id
Task<string> CreateEvent(DeviceEvent newEvent) Create event with parameters passed in via newEvent, returns id of created event.
Task<bool> UpdateEvent(DeviceEvent updatedEvent) Update event to match parameters provided via updatedEvent, returns bool indicating whether update was successful.
Task<bool> DeleteEvent(string eventId) Delete event by Id, returns bool indicating whether deletion was successful
Task<bool> AddAttendee(DeviceEventAttendee newAttendee, string eventId) Add a new attendee to an event by event Id, returns bool indicating whether adding the attendee was successful.
Task<bool> RemoveAttendee(string attendeeEmail, string eventId) Remove attendee from event based on attendee email and event Id, returns bool indicating whether removing attendee from event was successful

Classes

public class DeviceCalendar
{
    public string Id { get; set; }

    public string Name { get; set; }

    public bool IsReadOnly { get; set; }
}

public class DeviceEvent
{
    public string Id { get; set; }

    public string CalendarId { get; set; }

    public string Title { get; set; }

    public string Description { get; set; }

    public string Location { get; set; }

    public bool AllDay { get; set; }

    public DateTimeOffset StartDate { get; set; }

     public TimeSpan? Duration { get; set; }

    public DateTimeOffset? EndDate { get; set; }

    public IEnumberable<Attendee> Attendees { get; set; }
}

public class DeviceEventAttendee
{
    public string Name { get; set; }

    public string Email { get; set; }
}

Scenarios

  • User wants to an event.
  • User wants to update an event.
  • User wants to delete an event.
  • User wants to add more attendees to an existing event.
  • User wants to remove attendees from an existing event.

Platform Compatibility

  • Target Frameworks:
    • iOS: Support on iOS for the API
    • Android: Support on Android for the API
    • UWP: Support on UWP for the API

Backward Compatibility

Difficulty : medium

@ScottBTR
Copy link
Author

ScottBTR commented Dec 5, 2019

I'm unsure at this stage whether I want to encapsulate adding/removal of attendees within UpdateEvent.

@nickrandolph
Copy link

I think we can remove the methods that were part of the read spec, since they haven't changed
I think for consistency create, update and delete should all accept an DeviceEvent as a parameter
Let's remove the attendee methods and use the update method instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants