reformatted models

This commit is contained in:
2023-01-04 17:22:36 -07:00
parent c8175971b7
commit c28230691e
122 changed files with 3812 additions and 4005 deletions

View File

@@ -1,54 +1,53 @@
namespace Model.Calendar
namespace CanvasModel.Calendar;
public record AssignmentEventModel
{
public record AssignmentEventModel
{
// // A synthetic ID for the assignment
// "id": "assignment_987",
[JsonPropertyName("id")]
public string Id { get; set; }
// // The title of the assignment
// "title": "Essay",
[JsonPropertyName("title")]
public string Title { get; set; }
// // The due_at timestamp of the assignment
// "start_at": "2012-07-19T23:59:00-06:00",
[JsonPropertyName("start_at")]
public DateTime StartAt { get; set; }
// // The due_at timestamp of the assignment
// "end_at": "2012-07-19T23:59:00-06:00",
[JsonPropertyName("end_at")]
public DateTime EndAt { get; set; }
// // The HTML description of the assignment
// "description": "<b>Write an essay. Whatever you want.</b>",
[JsonPropertyName("description")]
public string Description { get; set; }
// // the context code of the (course) calendar this assignment belongs to
// "context_code": "course_123",
// // Current state of the assignment ('published' or 'deleted')
// "workflow_state": "published",
// // URL for this assignment (note that updating/deleting should be done via the
// // Assignments API)
// "url": "https://example.com/api/v1/calendar_events/assignment_987",
// // URL for a user to view this assignment
// "html_url": "http://example.com/courses/123/assignments/987",
// // The due date of this assignment
// "all_day_date": "2012-07-19",
// // Boolean indicating whether this is an all-day event (e.g. assignment due at
// // midnight)
// "all_day": true,
// // When the assignment was created
// "created_at": "2012-07-12T10:55:20-06:00",
// // When the assignment was last updated
// "updated_at": "2012-07-12T10:55:20-06:00",
// // The full assignment JSON data (See the Assignments API)
// "assignment": null,
// // The list of AssignmentOverrides that apply to this event (See the Assignments
// // API). This information is useful for determining which students or sections
// // this assignment-due event applies to.
// "assignment_overrides": null,
// // Boolean indicating whether this has important dates.
// "important_dates": true
// // A synthetic ID for the assignment
// "id": "assignment_987",
[JsonPropertyName("id")]
public string Id { get; set; }
// // The title of the assignment
// "title": "Essay",
[JsonPropertyName("title")]
public string Title { get; set; }
// // The due_at timestamp of the assignment
// "start_at": "2012-07-19T23:59:00-06:00",
[JsonPropertyName("start_at")]
public DateTime StartAt { get; set; }
// // The due_at timestamp of the assignment
// "end_at": "2012-07-19T23:59:00-06:00",
[JsonPropertyName("end_at")]
public DateTime EndAt { get; set; }
// // The HTML description of the assignment
// "description": "<b>Write an essay. Whatever you want.</b>",
[JsonPropertyName("description")]
public string Description { get; set; }
// // the context code of the (course) calendar this assignment belongs to
// "context_code": "course_123",
// // Current state of the assignment ('published' or 'deleted')
// "workflow_state": "published",
// // URL for this assignment (note that updating/deleting should be done via the
// // Assignments API)
// "url": "https://example.com/api/v1/calendar_events/assignment_987",
// // URL for a user to view this assignment
// "html_url": "http://example.com/courses/123/assignments/987",
// // The due date of this assignment
// "all_day_date": "2012-07-19",
// // Boolean indicating whether this is an all-day event (e.g. assignment due at
// // midnight)
// "all_day": true,
// // When the assignment was created
// "created_at": "2012-07-12T10:55:20-06:00",
// // When the assignment was last updated
// "updated_at": "2012-07-12T10:55:20-06:00",
// // The full assignment JSON data (See the Assignments API)
// "assignment": null,
// // The list of AssignmentOverrides that apply to this event (See the Assignments
// // API). This information is useful for determining which students or sections
// // this assignment-due event applies to.
// "assignment_overrides": null,
// // Boolean indicating whether this has important dates.
// "important_dates": true
}
}

View File

@@ -2,126 +2,125 @@ using System;
using System.Collections.Generic;
using Model.Assignments;
using Model.Groups;
using Model.Users;
using CanvasModel.Assignments;
using CanvasModel.Groups;
using CanvasModel.Users;
namespace Model.Calendar
namespace CanvasModel.Calendar;
/*
* This class combines the fields of normal, reservation, time-slot, and assignment calendar events.
* Concrete structure classes will specialize to these types and inherit from a common base.
*/
public record CalendarEventModel
{
/*
* This class combines the fields of normal, reservation, time-slot, and assignment calendar events.
* Concrete structure classes will specialize to these types and inherit from a common base.
*/
[JsonPropertyName("id")]
public ulong Id { get; set; }
public record CalendarEventModel {
[JsonPropertyName("id")]
public ulong Id { get; set; }
[JsonPropertyName("title")]
public string Title { get; set; }
[JsonPropertyName("start_at")]
public DateTime StartAt { get; set; }
[JsonPropertyName("end_at")]
public DateTime EndAt { get; set; }
[JsonPropertyName("type")]
public string Type { get; set; }
[JsonPropertyName("description")]
public string Description { get; set; }
[JsonPropertyName("location_name")]
public string LocationName { get; set; }
[JsonPropertyName("location_address")]
public string LocationAddress { get; set; }
[JsonPropertyName("context_code")]
public string ContextCode { get; set; }
[JsonPropertyName("effective_context_code")]
public string? EffectiveContextCode { get; set; }
[JsonPropertyName("all_context_codes")]
public string AllContextCodes { get; set; } // comma separated
[JsonPropertyName("workflow_state")]
public string WorkflowState { get; set; }
[JsonPropertyName("hidden")]
public bool Hidden { get; set; }
[JsonPropertyName("parent_event_id")]
public string? ParentEventId { get; set; }
[JsonPropertyName("child_events_count")]
public uint? ChildEventsCount { get; set; }
[JsonPropertyName("child_events")]
public IEnumerable<CalendarEventModel>? ChildEvents { get; set; }
[JsonPropertyName("url")]
public string Url { get; set; }
[JsonPropertyName("html_url")]
public string HtmlUrl { get; set; }
[JsonPropertyName("all_day_date")]
public DateTime? AllDayDate { get; set; }
[JsonPropertyName("all_day")]
public bool AllDay { get; set; }
[JsonPropertyName("created_at")]
public DateTime CreatedAt { get; set; }
[JsonPropertyName("updated_at")]
public DateTime UpdatedAt { get; set; }
[JsonPropertyName("appointment_group_id")]
public ulong AppointmentGroupId { get; set; }
[JsonPropertyName("appointment_group_url")]
public string AppointmentGroupUrl { get; set; }
[JsonPropertyName("own_reservation")]
public bool? OwnReservation { get; set; }
[JsonPropertyName("reserve_url")]
public string? ReserveUrl { get; set; }
[JsonPropertyName("reserved")]
public bool? Reserved { get; set; }
[JsonPropertyName("participant_type")]
public string ParticipantType { get; set; } // User|Group
[JsonPropertyName("participant_limit")]
public uint? ParticipantLimit { get; set; }
[JsonPropertyName("available_slots")]
public uint? AvailableSlots { get; set; }
[JsonPropertyName("user")]
public UserModel? User { get; set; }
[JsonPropertyName("group")]
public GroupModel? Group { get; set; }
[JsonPropertyName("assignment")]
public AssignmentModel? Assignment { get; set; }
[JsonPropertyName("assignment_overrides")]
public IEnumerable<AssignmentOverrideModel>? AssignmentOverrides { get; set; }
[JsonPropertyName("can_manage_appointment_group")]
public bool? CanManageAppointmentGroup { get; set; } // undocumented
[JsonPropertyName("participants_per_appointment")]
public uint? ParticipantsPerAppointment { get; set; }
}
[JsonPropertyName("title")]
public string Title { get; set; }
[JsonPropertyName("start_at")]
public DateTime StartAt { get; set; }
[JsonPropertyName("end_at")]
public DateTime EndAt { get; set; }
[JsonPropertyName("type")]
public string Type { get; set; }
[JsonPropertyName("description")]
public string Description { get; set; }
[JsonPropertyName("location_name")]
public string LocationName { get; set; }
[JsonPropertyName("location_address")]
public string LocationAddress { get; set; }
[JsonPropertyName("context_code")]
public string ContextCode { get; set; }
[JsonPropertyName("effective_context_code")]
public string? EffectiveContextCode { get; set; }
[JsonPropertyName("all_context_codes")]
public string AllContextCodes { get; set; } // comma separated
[JsonPropertyName("workflow_state")]
public string WorkflowState { get; set; }
[JsonPropertyName("hidden")]
public bool Hidden { get; set; }
[JsonPropertyName("parent_event_id")]
public string? ParentEventId { get; set; }
[JsonPropertyName("child_events_count")]
public uint? ChildEventsCount { get; set; }
[JsonPropertyName("child_events")]
public IEnumerable<CalendarEventModel>? ChildEvents { get; set; }
[JsonPropertyName("url")]
public string Url { get; set; }
[JsonPropertyName("html_url")]
public string HtmlUrl { get; set; }
[JsonPropertyName("all_day_date")]
public DateTime? AllDayDate { get; set; }
[JsonPropertyName("all_day")]
public bool AllDay { get; set; }
[JsonPropertyName("created_at")]
public DateTime CreatedAt { get; set; }
[JsonPropertyName("updated_at")]
public DateTime UpdatedAt { get; set; }
[JsonPropertyName("appointment_group_id")]
public ulong AppointmentGroupId { get; set; }
[JsonPropertyName("appointment_group_url")]
public string AppointmentGroupUrl { get; set; }
[JsonPropertyName("own_reservation")]
public bool? OwnReservation { get; set; }
[JsonPropertyName("reserve_url")]
public string? ReserveUrl { get; set; }
[JsonPropertyName("reserved")]
public bool? Reserved { get; set; }
[JsonPropertyName("participant_type")]
public string ParticipantType { get; set; } // User|Group
[JsonPropertyName("participant_limit")]
public uint? ParticipantLimit { get; set; }
[JsonPropertyName("available_slots")]
public uint? AvailableSlots { get; set; }
[JsonPropertyName("user")]
public UserModel? User { get; set; }
[JsonPropertyName("group")]
public GroupModel? Group { get; set; }
[JsonPropertyName("assignment")]
public AssignmentModel? Assignment { get; set; }
[JsonPropertyName("assignment_overrides")]
public IEnumerable<AssignmentOverrideModel>? AssignmentOverrides { get; set; }
[JsonPropertyName("can_manage_appointment_group")]
public bool? CanManageAppointmentGroup { get; set; } // undocumented
[JsonPropertyName("participants_per_appointment")]
public uint? ParticipantsPerAppointment { get; set; }
}