-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
changes to make the ApiClient abstract and then inherited so it can b…
…e setup to use the correct api
- Loading branch information
Showing
6 changed files
with
79 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
src/SFA.DAS.EmployerFinance/Infrastructure/CommitmentsApiClient.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Net.Http; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
using SFA.DAS.EmployerFinance.Configuration; | ||
|
||
namespace SFA.DAS.EmployerFinance.Infrastructure | ||
{ | ||
public class CommitmentsApiClient : ApiClient | ||
{ | ||
public CommitmentsApiClient(HttpClient httpClient, EmployerFinanceConfiguration configuration) : base(httpClient) | ||
{ | ||
httpClient.BaseAddress = new Uri(configuration.EmployerCommitmentsBaseUrl); | ||
} | ||
|
||
protected override void AddHeaders() | ||
{ | ||
|
||
} | ||
} | ||
} |
27 changes: 27 additions & 0 deletions
27
src/SFA.DAS.EmployerFinance/Infrastructure/ManageApprenticeshipsApiClient.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Net.Http; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
using SFA.DAS.EmployerFinance.Configuration; | ||
|
||
namespace SFA.DAS.EmployerFinance.Infrastructure | ||
{ | ||
public class ManageApprenticeshipsApiClient : ApiClient | ||
{ | ||
private readonly ManageApprenticeshipsOuterApiConfiguration _config; | ||
|
||
public ManageApprenticeshipsApiClient(HttpClient httpClient, ManageApprenticeshipsOuterApiConfiguration options) : base(httpClient) | ||
{ | ||
_config = options; | ||
httpClient.BaseAddress = new Uri(_config.BaseUrl); | ||
} | ||
|
||
protected override void AddHeaders() | ||
{ | ||
HttpClient.DefaultRequestHeaders.Add("Ocp-Apim-Subscription-Key", _config.Key); | ||
HttpClient.DefaultRequestHeaders.Add("X-Version", "1"); | ||
} | ||
} | ||
} |
15 changes: 15 additions & 0 deletions
15
src/SFA.DAS.EmployerFinance/Infrastructure/OuterApiResponses/GetCohortsResponse.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
using SFA.DAS.CommitmentsV2.Types; | ||
using SFA.DAS.EmployerFinance.Interfaces.OuterApi; | ||
|
||
namespace SFA.DAS.EmployerFinance.Infrastructure.OuterApiResponses | ||
{ | ||
public class GetCohortsResponse | ||
{ | ||
public List<CohortSummary> Cohorts { get; set; } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters