mirror of
https://github.com/alexmickelson/canvasManagement.git
synced 2026-03-25 23:28:33 -06:00
fixed warnings
This commit is contained in:
@@ -29,6 +29,9 @@ public record SubmissionModel
|
||||
[property: JsonPropertyName("workflow_state")]
|
||||
string WorkflowState,
|
||||
|
||||
[property: JsonPropertyName("late_policy_status")]
|
||||
string LatePolicyStatus,
|
||||
|
||||
[property: JsonPropertyName("assignment")]
|
||||
AssignmentModel? Assignment = null,
|
||||
|
||||
@@ -74,9 +77,6 @@ public record SubmissionModel
|
||||
[property: JsonPropertyName("missing")]
|
||||
bool? Missing = null,
|
||||
|
||||
[property: JsonPropertyName("late_policy_status")]
|
||||
string LatePolicyStatus = null,
|
||||
|
||||
[property: JsonPropertyName("points_deducted")]
|
||||
double? PointsDeducted = null,
|
||||
|
||||
|
||||
@@ -66,7 +66,7 @@ public record ActivityStreamObjectModel
|
||||
bool? UserHasPosted = null,
|
||||
|
||||
[property: JsonPropertyName("root_discussion_entries")]
|
||||
object RootDiscussionEntries = null,
|
||||
object? RootDiscussionEntries = null,
|
||||
|
||||
[property: JsonPropertyName("discussion_topic_id")]
|
||||
ulong? DiscussionTopicId = null,
|
||||
|
||||
@@ -2,7 +2,6 @@ namespace CanvasModel.Users;
|
||||
|
||||
public record PageViewModel
|
||||
(
|
||||
|
||||
[property: JsonPropertyName("id")]
|
||||
string Id,
|
||||
|
||||
@@ -30,6 +29,15 @@ public record PageViewModel
|
||||
[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,
|
||||
|
||||
@@ -39,15 +47,7 @@ public record PageViewModel
|
||||
[property: JsonPropertyName("render_time")]
|
||||
double? RenderTime = null,
|
||||
|
||||
[property: JsonPropertyName("user_agent")]
|
||||
string UserAgent = null,
|
||||
|
||||
[property: JsonPropertyName("participated")]
|
||||
bool? Participated = null,
|
||||
|
||||
[property: JsonPropertyName("http_method")]
|
||||
string HttpMethod = null,
|
||||
|
||||
[property: JsonPropertyName("remote_ip")]
|
||||
string RemoteIp = null
|
||||
bool? Participated = null
|
||||
);
|
||||
@@ -8,6 +8,9 @@ public record UserDisplayModel
|
||||
[property: JsonPropertyName("html_url")]
|
||||
string HtmlUrl,
|
||||
|
||||
[property: JsonPropertyName("anonymous_id")]
|
||||
string AnonymousId,
|
||||
|
||||
[property: JsonPropertyName("id")]
|
||||
ulong? Id = null,
|
||||
|
||||
@@ -18,8 +21,5 @@ public record UserDisplayModel
|
||||
string? DisplayName = null,
|
||||
|
||||
[property: JsonPropertyName("pronouns")]
|
||||
string? Pronouns = null,
|
||||
|
||||
[property: JsonPropertyName("anonymous_id")]
|
||||
string AnonymousId = null
|
||||
string? Pronouns = null
|
||||
);
|
||||
@@ -5,7 +5,6 @@ public class CanvasService
|
||||
{
|
||||
private const string BaseUrl = "https://snow.instructure.com/api/v1/";
|
||||
private readonly IWebRequestor webRequestor;
|
||||
private RestClient client;
|
||||
private string courseid { get; }
|
||||
public CanvasService(IWebRequestor webRequestor)
|
||||
{
|
||||
|
||||
@@ -6,13 +6,12 @@ public class WebRequestor : IWebRequestor
|
||||
private string token;
|
||||
private RestClient client;
|
||||
private string courseid { get; }
|
||||
public WebRequestor(RestClient client)
|
||||
public WebRequestor()
|
||||
{
|
||||
// token = Environment.GetEnvironmentVariable("CANVAS_TOKEN");
|
||||
// client = new RestClient(BaseUrl);
|
||||
// client.AddDefaultHeader("Authorization", $"Bearer {token}");
|
||||
token = Environment.GetEnvironmentVariable("CANVAS_TOKEN") ?? throw new Exception("CANVAS_TOKEN not in environment");
|
||||
client = new RestClient(BaseUrl);
|
||||
client.AddDefaultHeader("Authorization", $"Bearer {token}");
|
||||
|
||||
this.client = client;
|
||||
courseid = "774898";
|
||||
}
|
||||
public async Task<RestResponse<T[]>> GetManyAsync<T>(RestRequest request)
|
||||
|
||||
Reference in New Issue
Block a user