Skip to content

Commit

Permalink
Fixing issues with URLs
Browse files Browse the repository at this point in the history
  • Loading branch information
kylemiller-rum committed Feb 6, 2024
1 parent a90211c commit dd5aa1e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 17 deletions.
14 changes: 1 addition & 13 deletions RDSServiceClient/RdsServiceClientOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,10 @@ namespace RDSServiceClient;
public class RdsServiceClientOptions
{
public RdsServiceClientOptions() { }
public RdsServiceClientOptions(string baseUrl,
string disconnectUrl = "DisconnectSession",
string logoffUrl = "LogOffSession",
string sessionsUrl = "GetSessions",
string activeManagementServerUrl = "GetActiveManagementServer")
public RdsServiceClientOptions(string baseUrl)
{
BaseUrl = baseUrl;
DisconnectUrl = disconnectUrl;
LogoffUrl = logoffUrl;
SessionsUrl = sessionsUrl;
ActiveManagementServerUrl = activeManagementServerUrl;
}

public string BaseUrl { get; set; }
public string DisconnectUrl { get; set; }
public string LogoffUrl { get; set; }
public string SessionsUrl { get; set; }
public string ActiveManagementServerUrl { get; set; }
}
8 changes: 4 additions & 4 deletions RDSServiceClient/RdsSessionService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,16 @@ public RdsSessionService(IHttpClientFactory httpClientFactory, IOptions<RdsServi
}

public Task<string> GetActiveManagementServer(string? connectionBroker = null) =>
ProcessRequest<string>(_options.Value.ActiveManagementServerUrl);
ProcessRequest<string>("GetActiveManagementServer");

public Task<List<RdsSession>> GetSessions(string? connectionBroker = null) =>

Check warning on line 26 in RDSServiceClient/RdsSessionService.cs

View workflow job for this annotation

GitHub Actions / build

Nullability of reference types in return type of 'Task<List<RdsSession>> RdsSessionService.GetSessions(string? connectionBroker = null)' doesn't match implicitly implemented member 'Task<List<RdsSession>?> IRdsSessionService.GetSessions(string? connectionBroker = null)'.

Check warning on line 26 in RDSServiceClient/RdsSessionService.cs

View workflow job for this annotation

GitHub Actions / build

Nullability of reference types in return type of 'Task<List<RdsSession>> RdsSessionService.GetSessions(string? connectionBroker = null)' doesn't match implicitly implemented member 'Task<List<RdsSession>?> IRdsSessionService.GetSessions(string? connectionBroker = null)'.
ProcessRequest<List<RdsSession>>(_options.Value.SessionsUrl);
ProcessRequest<List<RdsSession>>("GetSessions");

public Task<bool> DisconnectSession(SessionInfo sessionInfo, string? connectionBroker = null) =>
ProcessPostRequest(_options.Value.DisconnectUrl, sessionInfo);
ProcessPostRequest("DisconnectSession", sessionInfo);

public Task<bool> LogOffSession(SessionInfo sessionInfo, string? connectionBroker = null) =>
ProcessPostRequest(_options.Value.LogoffUrl, sessionInfo);
ProcessPostRequest("LogOffSession", sessionInfo);

private async Task<T> ProcessRequest<T>(string url)
{
Expand Down

0 comments on commit dd5aa1e

Please sign in to comment.