|
6 | 6 | using System.Threading.Tasks;
|
7 | 7 | using Microsoft.Extensions.Logging;
|
8 | 8 | using RestSharp;
|
| 9 | +using Shield.Client.Extensions; |
9 | 10 | using Shield.Client.Helpers;
|
10 | 11 | using Shield.Client.Models;
|
11 | 12 | using Shield.Client.Models.API.Application;
|
@@ -47,7 +48,7 @@ public async Task<DirectUploadDto> UploadApplicationDirectlyAsync(string project
|
47 | 48 | {
|
48 | 49 | Parent.CustomLogger?.LogDebug("Initiating the request to upload an application to project.");
|
49 | 50 |
|
50 |
| - var request = new RestRequest("/app/direct") |
| 51 | + var request = new RestRequest("/app/direct".ToApiRoute()) |
51 | 52 | .AddJsonBody(projectKey)
|
52 | 53 | .AddFile("file", file.FileContent, file.FileName, MimeTypeMap.GetMimeType(file.FileName))
|
53 | 54 | .AddDependencies(dependencies?.Select(x => (x.FileContent, x.FileName)).ToList());
|
@@ -79,7 +80,7 @@ public DirectUploadDto UploadApplicationDirectly(string projectKey, ShieldFile f
|
79 | 80 | {
|
80 | 81 | Parent.CustomLogger?.LogDebug("Initiating the request to upload an application to project.");
|
81 | 82 |
|
82 |
| - var request = new RestRequest("/app/direct") |
| 83 | + var request = new RestRequest("/app/direct".ToApiRoute()) |
83 | 84 | .AddJsonBody(projectKey)
|
84 | 85 | .AddFile("file", file.FileContent, file.FileName, MimeTypeMap.GetMimeType(file.FileName))
|
85 | 86 | .AddDependencies(dependencies?.Select(x => (x.FileContent, x.FileName)).ToList());
|
@@ -111,7 +112,7 @@ public async Task<DirectUploadDto> UploadApplicationDirectlyAsync(string project
|
111 | 112 | {
|
112 | 113 | Parent.CustomLogger?.LogDebug("Initiating the request to upload an application to project.");
|
113 | 114 |
|
114 |
| - var request = new RestRequest("/app/direct") |
| 115 | + var request = new RestRequest("/app/direct".ToApiRoute()) |
115 | 116 | .AddQueryParameter("projectKey", projectKey)
|
116 | 117 | .AddFileFromPath(filePath)
|
117 | 118 | .AddDependencies(dependenciesPaths);
|
@@ -144,7 +145,7 @@ public DirectUploadDto UploadApplicationDirectly(string projectKey, string fileP
|
144 | 145 | {
|
145 | 146 | Parent.CustomLogger?.LogDebug("Initiating the request to upload an application to project.");
|
146 | 147 |
|
147 |
| - var request = new RestRequest("/app/direct") |
| 148 | + var request = new RestRequest("/app/direct".ToApiRoute()) |
148 | 149 | .AddQueryParameter("projectKey", projectKey)
|
149 | 150 | .AddFileFromPath(filePath)
|
150 | 151 | .AddDependencies(dependenciesPaths);
|
@@ -227,7 +228,7 @@ internal async Task<MemoryStream> DownloadApplicationAsync(string downloadKey, D
|
227 | 228 |
|
228 | 229 | Parent.CustomLogger?.LogDebug("Initiating the request to download an application.");
|
229 | 230 | using var stream = new MemoryStream();
|
230 |
| - var request = new RestRequest("/app/download") |
| 231 | + var request = new RestRequest("/app/download".ToApiRoute()) |
231 | 232 | {
|
232 | 233 | ResponseWriter = async responseStream =>
|
233 | 234 | {
|
@@ -271,7 +272,7 @@ internal MemoryStream DownloadApplication(string downloadKey, DownloadFormat for
|
271 | 272 |
|
272 | 273 | Parent.CustomLogger?.LogDebug("Initiating the request to download an application.");
|
273 | 274 | using var stream = new MemoryStream();
|
274 |
| - var request = new RestRequest("/app/download") |
| 275 | + var request = new RestRequest("/app/download".ToApiRoute()) |
275 | 276 | {
|
276 | 277 | ResponseWriter = responseStream =>
|
277 | 278 | {
|
|
0 commit comments