fixed warnings

This commit is contained in:
2023-01-04 21:43:18 -07:00
parent c350a8487e
commit 8fec96ce5c
6 changed files with 22 additions and 24 deletions

View File

@@ -29,6 +29,9 @@ public record SubmissionModel
[property: JsonPropertyName("workflow_state")] [property: JsonPropertyName("workflow_state")]
string WorkflowState, string WorkflowState,
[property: JsonPropertyName("late_policy_status")]
string LatePolicyStatus,
[property: JsonPropertyName("assignment")] [property: JsonPropertyName("assignment")]
AssignmentModel? Assignment = null, AssignmentModel? Assignment = null,
@@ -74,9 +77,6 @@ public record SubmissionModel
[property: JsonPropertyName("missing")] [property: JsonPropertyName("missing")]
bool? Missing = null, bool? Missing = null,
[property: JsonPropertyName("late_policy_status")]
string LatePolicyStatus = null,
[property: JsonPropertyName("points_deducted")] [property: JsonPropertyName("points_deducted")]
double? PointsDeducted = null, double? PointsDeducted = null,

View File

@@ -66,7 +66,7 @@ public record ActivityStreamObjectModel
bool? UserHasPosted = null, bool? UserHasPosted = null,
[property: JsonPropertyName("root_discussion_entries")] [property: JsonPropertyName("root_discussion_entries")]
object RootDiscussionEntries = null, object? RootDiscussionEntries = null,
[property: JsonPropertyName("discussion_topic_id")] [property: JsonPropertyName("discussion_topic_id")]
ulong? DiscussionTopicId = null, ulong? DiscussionTopicId = null,

View File

@@ -2,7 +2,6 @@ namespace CanvasModel.Users;
public record PageViewModel public record PageViewModel
( (
[property: JsonPropertyName("id")] [property: JsonPropertyName("id")]
string Id, string Id,
@@ -30,6 +29,15 @@ public record PageViewModel
[property: JsonPropertyName("links")] [property: JsonPropertyName("links")]
PageViewLinksModel 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")] [property: JsonPropertyName("interaction_seconds")]
decimal? InteractionSeconds = null, decimal? InteractionSeconds = null,
@@ -39,15 +47,7 @@ public record PageViewModel
[property: JsonPropertyName("render_time")] [property: JsonPropertyName("render_time")]
double? RenderTime = null, double? RenderTime = null,
[property: JsonPropertyName("user_agent")]
string UserAgent = null,
[property: JsonPropertyName("participated")] [property: JsonPropertyName("participated")]
bool? Participated = null, bool? Participated = null
[property: JsonPropertyName("http_method")]
string HttpMethod = null,
[property: JsonPropertyName("remote_ip")]
string RemoteIp = null
); );

View File

@@ -8,6 +8,9 @@ public record UserDisplayModel
[property: JsonPropertyName("html_url")] [property: JsonPropertyName("html_url")]
string HtmlUrl, string HtmlUrl,
[property: JsonPropertyName("anonymous_id")]
string AnonymousId,
[property: JsonPropertyName("id")] [property: JsonPropertyName("id")]
ulong? Id = null, ulong? Id = null,
@@ -18,8 +21,5 @@ public record UserDisplayModel
string? DisplayName = null, string? DisplayName = null,
[property: JsonPropertyName("pronouns")] [property: JsonPropertyName("pronouns")]
string? Pronouns = null, string? Pronouns = null
[property: JsonPropertyName("anonymous_id")]
string AnonymousId = null
); );

View File

@@ -5,7 +5,6 @@ public class CanvasService
{ {
private const string BaseUrl = "https://snow.instructure.com/api/v1/"; private const string BaseUrl = "https://snow.instructure.com/api/v1/";
private readonly IWebRequestor webRequestor; private readonly IWebRequestor webRequestor;
private RestClient client;
private string courseid { get; } private string courseid { get; }
public CanvasService(IWebRequestor webRequestor) public CanvasService(IWebRequestor webRequestor)
{ {

View File

@@ -6,13 +6,12 @@ public class WebRequestor : IWebRequestor
private string token; private string token;
private RestClient client; private RestClient client;
private string courseid { get; } private string courseid { get; }
public WebRequestor(RestClient client) public WebRequestor()
{ {
// token = Environment.GetEnvironmentVariable("CANVAS_TOKEN"); token = Environment.GetEnvironmentVariable("CANVAS_TOKEN") ?? throw new Exception("CANVAS_TOKEN not in environment");
// client = new RestClient(BaseUrl); client = new RestClient(BaseUrl);
// client.AddDefaultHeader("Authorization", $"Bearer {token}"); client.AddDefaultHeader("Authorization", $"Bearer {token}");
this.client = client;
courseid = "774898"; courseid = "774898";
} }
public async Task<RestResponse<T[]>> GetManyAsync<T>(RestRequest request) public async Task<RestResponse<T[]>> GetManyAsync<T>(RestRequest request)