mirror of
https://github.com/alexmickelson/canvasManagement.git
synced 2026-03-26 07:38:33 -06:00
passing canvas models tests
This commit is contained in:
@@ -0,0 +1,163 @@
|
||||
using CanvasModel.Assignments;
|
||||
using CanvasModel.Courses;
|
||||
using CanvasModel.Submissions;
|
||||
|
||||
namespace CanvasModel.Users;
|
||||
public record ActivityStreamObjectModel
|
||||
(
|
||||
[property: JsonPropertyName("created_at")]
|
||||
DateTime CreatedAt,
|
||||
|
||||
[property: JsonPropertyName("id")]
|
||||
ulong Id,
|
||||
|
||||
[property: JsonPropertyName("title")]
|
||||
string Title,
|
||||
|
||||
[property: JsonPropertyName("message")]
|
||||
string Message,
|
||||
|
||||
[property: JsonPropertyName("type")]
|
||||
string Type,
|
||||
|
||||
[property: JsonPropertyName("read_state")]
|
||||
bool ReadState,
|
||||
|
||||
[property: JsonPropertyName("context_type")]
|
||||
string ContextType,
|
||||
|
||||
[property: JsonPropertyName("html_url")]
|
||||
string HtmlUrl,
|
||||
|
||||
[property: JsonPropertyName("notification_category")]
|
||||
string NotificationCategory,
|
||||
|
||||
[property: JsonPropertyName("grade")]
|
||||
string Grade,
|
||||
|
||||
[property: JsonPropertyName("preview_url")]
|
||||
string PreviewUrl,
|
||||
|
||||
[property: JsonPropertyName("submission_type")]
|
||||
string SubmissionType,
|
||||
|
||||
[property: JsonPropertyName("late_policy_status")]
|
||||
string LatePolicyStatus,
|
||||
|
||||
[property: JsonPropertyName("workflow_state")]
|
||||
string WorkflowState,
|
||||
|
||||
[property: JsonPropertyName("updated_at")]
|
||||
DateTime? UpdatedAt = null,
|
||||
|
||||
[property: JsonPropertyName("course_id")]
|
||||
ulong? CourseId = null,
|
||||
|
||||
[property: JsonPropertyName("group_id")]
|
||||
ulong? GroupId = null,
|
||||
|
||||
[property: JsonPropertyName("total_root_discussion_entries")]
|
||||
uint? TotalRootDiscussionEntries = null,
|
||||
|
||||
[property: JsonPropertyName("require_initial_post")]
|
||||
bool? RequireInitialPost = null,
|
||||
|
||||
[property: JsonPropertyName("user_has_posted")]
|
||||
bool? UserHasPosted = null,
|
||||
|
||||
[property: JsonPropertyName("root_discussion_entries")]
|
||||
object? RootDiscussionEntries = null,
|
||||
|
||||
[property: JsonPropertyName("discussion_topic_id")]
|
||||
ulong? DiscussionTopicId = null,
|
||||
|
||||
[property: JsonPropertyName("announcement_id")]
|
||||
ulong? AnnouncementId = null,
|
||||
|
||||
[property: JsonPropertyName("conversation_id")]
|
||||
ulong? ConversationId = null,
|
||||
|
||||
[property: JsonPropertyName("private")]
|
||||
bool? Private = null,
|
||||
|
||||
[property: JsonPropertyName("participant_count")]
|
||||
uint? ParticipantCount = null,
|
||||
|
||||
[property: JsonPropertyName("message_id")]
|
||||
ulong? MessageId = null,
|
||||
|
||||
[property: JsonPropertyName("assignment_id")]
|
||||
ulong? AssignmentId = null,
|
||||
|
||||
[property: JsonPropertyName("assignment")]
|
||||
AssignmentModel? Assignment = null,
|
||||
|
||||
[property: JsonPropertyName("course")]
|
||||
CourseModel? Course = null,
|
||||
|
||||
[property: JsonPropertyName("attempt")]
|
||||
uint? Attempt = null,
|
||||
|
||||
[property: JsonPropertyName("body")]
|
||||
string? Body = null,
|
||||
|
||||
[property: JsonPropertyName("grade_matches_current_submission")]
|
||||
bool? GradeMatchesCurrentSubmission = null,
|
||||
|
||||
[property: JsonPropertyName("score")]
|
||||
decimal? Score = null,
|
||||
|
||||
[property: JsonPropertyName("submission_comments")]
|
||||
IEnumerable<SubmissionCommentModel>? SubmissionComments = null,
|
||||
|
||||
[property: JsonPropertyName("submitted_at")]
|
||||
DateTime? SubmittedAt = null,
|
||||
|
||||
[property: JsonPropertyName("url")]
|
||||
string? Url = null,
|
||||
|
||||
[property: JsonPropertyName("user_id")]
|
||||
ulong? UserId = null,
|
||||
|
||||
[property: JsonPropertyName("grader_id")]
|
||||
long? GraderId = null,
|
||||
|
||||
[property: JsonPropertyName("graded_at")]
|
||||
DateTime? GradedAt = null,
|
||||
|
||||
[property: JsonPropertyName("user")]
|
||||
UserModel? User = null,
|
||||
|
||||
[property: JsonPropertyName("late")]
|
||||
bool? Late = null,
|
||||
|
||||
[property: JsonPropertyName("assignment_visible")]
|
||||
bool? AssignmentVisible = null,
|
||||
|
||||
[property: JsonPropertyName("excused")]
|
||||
bool? Excused = null,
|
||||
|
||||
[property: JsonPropertyName("missing")]
|
||||
bool? Missing = null,
|
||||
|
||||
[property: JsonPropertyName("points_deducted")]
|
||||
double? PointsDeducted = null,
|
||||
|
||||
[property: JsonPropertyName("seconds_late")]
|
||||
double? SecondsLate = null,
|
||||
|
||||
[property: JsonPropertyName("extra_attempts")]
|
||||
uint? ExtraAttempts = null,
|
||||
|
||||
[property: JsonPropertyName("anonymous_id")]
|
||||
string? AnonymousId = null,
|
||||
|
||||
[property: JsonPropertyName("web_conference_id")]
|
||||
ulong? WebConferenceId = null,
|
||||
|
||||
[property: JsonPropertyName("collaboration_id")]
|
||||
ulong? CollaborationId = null,
|
||||
|
||||
[property: JsonPropertyName("assignment_request_id")]
|
||||
ulong? AssignmentRequestId = null
|
||||
);
|
||||
@@ -0,0 +1,15 @@
|
||||
|
||||
|
||||
|
||||
namespace CanvasModel.Users;
|
||||
public record ActivityStreamSummaryEntryModel
|
||||
(
|
||||
[property: JsonPropertyName("type")]
|
||||
string Type,
|
||||
|
||||
[property: JsonPropertyName("unread_count")]
|
||||
uint UnreadCount,
|
||||
|
||||
[property: JsonPropertyName("count")]
|
||||
uint Count
|
||||
);
|
||||
@@ -0,0 +1,10 @@
|
||||
namespace CanvasModel.Users;
|
||||
|
||||
public record AnonymousUserDisplayModel
|
||||
(
|
||||
[property: JsonPropertyName("anonymous_id")]
|
||||
string AnonymousId,
|
||||
|
||||
[property: JsonPropertyName("avatar_image_url")]
|
||||
string AvatarImageUrl
|
||||
);
|
||||
28
Management/Models/CanvasModels/Users/AvatarModel.cs
Normal file
28
Management/Models/CanvasModels/Users/AvatarModel.cs
Normal file
@@ -0,0 +1,28 @@
|
||||
namespace CanvasModel.Users;
|
||||
|
||||
public record AvatarModel
|
||||
(
|
||||
[property: JsonPropertyName("type")]
|
||||
string Type,
|
||||
|
||||
[property: JsonPropertyName("url")]
|
||||
string Url,
|
||||
|
||||
[property: JsonPropertyName("token")]
|
||||
string Token,
|
||||
|
||||
[property: JsonPropertyName("display_name")]
|
||||
string DisplayName,
|
||||
|
||||
[property: JsonPropertyName("id")]
|
||||
ulong Id,
|
||||
|
||||
[property: JsonPropertyName("content_type")]
|
||||
string ContentType,
|
||||
|
||||
[property: JsonPropertyName("filename")]
|
||||
string Filename,
|
||||
|
||||
[property: JsonPropertyName("size")]
|
||||
ulong Size
|
||||
);
|
||||
13
Management/Models/CanvasModels/Users/CourseNicknameModel.cs
Normal file
13
Management/Models/CanvasModels/Users/CourseNicknameModel.cs
Normal file
@@ -0,0 +1,13 @@
|
||||
namespace CanvasModel.Users;
|
||||
|
||||
public record CourseNicknameModel
|
||||
(
|
||||
[property: JsonPropertyName("course_id")]
|
||||
ulong CourseId,
|
||||
|
||||
[property: JsonPropertyName("name")]
|
||||
string Name,
|
||||
|
||||
[property: JsonPropertyName("nickname")]
|
||||
string Nickname
|
||||
);
|
||||
19
Management/Models/CanvasModels/Users/PageViewLinksModel.cs
Normal file
19
Management/Models/CanvasModels/Users/PageViewLinksModel.cs
Normal file
@@ -0,0 +1,19 @@
|
||||
namespace CanvasModel.Users;
|
||||
|
||||
public record PageViewLinksModel
|
||||
(
|
||||
[property: JsonPropertyName("user")]
|
||||
ulong User,
|
||||
|
||||
[property: JsonPropertyName("context")]
|
||||
ulong? Context = null,
|
||||
|
||||
[property: JsonPropertyName("asset")]
|
||||
ulong? Asset = null,
|
||||
|
||||
[property: JsonPropertyName("real_user")]
|
||||
ulong? RealUser = null,
|
||||
|
||||
[property: JsonPropertyName("account")]
|
||||
ulong? Account = null
|
||||
);
|
||||
53
Management/Models/CanvasModels/Users/PageViewModel.cs
Normal file
53
Management/Models/CanvasModels/Users/PageViewModel.cs
Normal file
@@ -0,0 +1,53 @@
|
||||
namespace CanvasModel.Users;
|
||||
|
||||
public record PageViewModel
|
||||
(
|
||||
[property: JsonPropertyName("id")]
|
||||
string Id,
|
||||
|
||||
[property: JsonPropertyName("app_name")]
|
||||
string AppName,
|
||||
|
||||
[property: JsonPropertyName("url")]
|
||||
string Url,
|
||||
|
||||
[property: JsonPropertyName("context_type")]
|
||||
string ContextType,
|
||||
|
||||
[property: JsonPropertyName("asset_type")]
|
||||
string AssetType,
|
||||
|
||||
[property: JsonPropertyName("controller")]
|
||||
string Controller,
|
||||
|
||||
[property: JsonPropertyName("action")]
|
||||
string Action,
|
||||
|
||||
[property: JsonPropertyName("created_at")]
|
||||
DateTime CreatedAt,
|
||||
|
||||
[property: JsonPropertyName("links")]
|
||||
PageViewLinksModel Links,
|
||||
|
||||
[property: JsonPropertyName("user_agent")]
|
||||
string UserAgent,
|
||||
|
||||
[property: JsonPropertyName("http_method")]
|
||||
string HttpMethod,
|
||||
|
||||
[property: JsonPropertyName("remote_ip")]
|
||||
string RemoteIp,
|
||||
|
||||
[property: JsonPropertyName("interaction_seconds")]
|
||||
decimal? InteractionSeconds = null,
|
||||
|
||||
[property: JsonPropertyName("user_request")]
|
||||
bool? UserRequest = null,
|
||||
|
||||
[property: JsonPropertyName("render_time")]
|
||||
double? RenderTime = null,
|
||||
|
||||
|
||||
[property: JsonPropertyName("participated")]
|
||||
bool? Participated = null
|
||||
);
|
||||
46
Management/Models/CanvasModels/Users/ProfileModel.cs
Normal file
46
Management/Models/CanvasModels/Users/ProfileModel.cs
Normal file
@@ -0,0 +1,46 @@
|
||||
namespace CanvasModel.Users;
|
||||
|
||||
public record ProfileModel
|
||||
(
|
||||
[property: JsonPropertyName("id")]
|
||||
ulong Id,
|
||||
|
||||
[property: JsonPropertyName("name")]
|
||||
string Name,
|
||||
|
||||
[property: JsonPropertyName("short_name")]
|
||||
string ShortName,
|
||||
|
||||
[property: JsonPropertyName("sortable_name")]
|
||||
string SortableName,
|
||||
|
||||
[property: JsonPropertyName("title")]
|
||||
string Title,
|
||||
|
||||
[property: JsonPropertyName("bio")]
|
||||
string Bio,
|
||||
|
||||
[property: JsonPropertyName("primary_email")]
|
||||
string PrimaryEmail,
|
||||
|
||||
[property: JsonPropertyName("login_id")]
|
||||
string LoginId,
|
||||
|
||||
[property: JsonPropertyName("sis_user_id")]
|
||||
string SisUserId,
|
||||
|
||||
[property: JsonPropertyName("lti_user_id")]
|
||||
string LtiUserId,
|
||||
|
||||
[property: JsonPropertyName("avatar_url")]
|
||||
string AvatarUrl,
|
||||
|
||||
[property: JsonPropertyName("calendar")]
|
||||
object Calendar,
|
||||
|
||||
[property: JsonPropertyName("time_zone")]
|
||||
string TimeZone,
|
||||
|
||||
[property: JsonPropertyName("locale")]
|
||||
string Locale
|
||||
);
|
||||
17
Management/Models/CanvasModels/Users/ShortUserModel.cs
Normal file
17
Management/Models/CanvasModels/Users/ShortUserModel.cs
Normal file
@@ -0,0 +1,17 @@
|
||||
namespace CanvasModel.Users;
|
||||
|
||||
public record ShortUserModel
|
||||
(
|
||||
|
||||
[property: JsonPropertyName("id")]
|
||||
ulong Id,
|
||||
|
||||
[property: JsonPropertyName("display_name")]
|
||||
string DisplayName,
|
||||
|
||||
[property: JsonPropertyName("avatar_image_url")]
|
||||
string AvatarImageUrl,
|
||||
|
||||
[property: JsonPropertyName("html_url")]
|
||||
string HtmlUrl
|
||||
);
|
||||
25
Management/Models/CanvasModels/Users/UserDisplayModel.cs
Normal file
25
Management/Models/CanvasModels/Users/UserDisplayModel.cs
Normal file
@@ -0,0 +1,25 @@
|
||||
namespace CanvasModel.Users;
|
||||
|
||||
public record UserDisplayModel
|
||||
(
|
||||
[property: JsonPropertyName("avatar_image_url")]
|
||||
string AvatarImageUrl,
|
||||
|
||||
[property: JsonPropertyName("html_url")]
|
||||
string HtmlUrl,
|
||||
|
||||
[property: JsonPropertyName("anonymous_id")]
|
||||
string AnonymousId,
|
||||
|
||||
[property: JsonPropertyName("id")]
|
||||
ulong? Id = null,
|
||||
|
||||
[property: JsonPropertyName("short_name")]
|
||||
string? ShortName = null,
|
||||
|
||||
[property: JsonPropertyName("display_name")]
|
||||
string? DisplayName = null,
|
||||
|
||||
[property: JsonPropertyName("pronouns")]
|
||||
string? Pronouns = null
|
||||
);
|
||||
56
Management/Models/CanvasModels/Users/UserModel.cs
Normal file
56
Management/Models/CanvasModels/Users/UserModel.cs
Normal file
@@ -0,0 +1,56 @@
|
||||
using CanvasModel.Enrollments;
|
||||
|
||||
namespace CanvasModel.Users;
|
||||
public record UserModel
|
||||
(
|
||||
[property: JsonPropertyName("id")]
|
||||
ulong Id,
|
||||
|
||||
[property: JsonPropertyName("name")]
|
||||
string Name,
|
||||
|
||||
[property: JsonPropertyName("sortable_name")]
|
||||
string SortableName,
|
||||
|
||||
[property: JsonPropertyName("short_name")]
|
||||
string ShortName,
|
||||
|
||||
[property: JsonPropertyName("sis_user_id")]
|
||||
string SisUserId,
|
||||
|
||||
[property: JsonPropertyName("integration_id")]
|
||||
string IntegrationId,
|
||||
|
||||
[property: JsonPropertyName("login_id")]
|
||||
string LoginId,
|
||||
|
||||
[property: JsonPropertyName("avatar_url")]
|
||||
string AvatarUrl,
|
||||
|
||||
[property: JsonPropertyName("enrollments")]
|
||||
List<EnrollmentModel> Enrollments,
|
||||
|
||||
[property: JsonPropertyName("email")]
|
||||
string Email,
|
||||
|
||||
[property: JsonPropertyName("locale")]
|
||||
string Locale,
|
||||
|
||||
[property: JsonPropertyName("effective_locale")]
|
||||
string EffectiveLocale,
|
||||
|
||||
[property: JsonPropertyName("time_zone")]
|
||||
string TimeZone,
|
||||
|
||||
[property: JsonPropertyName("bio")]
|
||||
string Bio,
|
||||
|
||||
[property: JsonPropertyName("permissions")]
|
||||
Dictionary<string, bool> Permissions,
|
||||
|
||||
[property: JsonPropertyName("sis_import_id")]
|
||||
ulong? SisImportId = null,
|
||||
|
||||
[property: JsonPropertyName("last_login")]
|
||||
DateTime? LastLogin = null
|
||||
);
|
||||
Reference in New Issue
Block a user