-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Operation "backend.test.update" was added
Operation "backend.test.run" was added Operation "backend.test.refresh" was added Operation "backend.test.get" was added Operation "backend.test.getAll" was added Type "Backend_Test" was added Type "Backend_TestCollection" was added Type "Backend_TestConfig" was added
- Loading branch information
SDKgen-Bot
committed
Jul 25, 2024
1 parent
c036dd8
commit 36cf6a0
Showing
6 changed files
with
221 additions
and
1 deletion.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
/** | ||
* BackendTest automatically generated by SDKgen please do not edit this file manually | ||
* @see https://sdkgen.app | ||
*/ | ||
|
||
using System.Text.Json.Serialization; | ||
namespace Fusio.SDK; | ||
public class BackendTest | ||
{ | ||
[JsonPropertyName("id")] | ||
public int? Id { get; set; } | ||
[JsonPropertyName("status")] | ||
public int? Status { get; set; } | ||
[JsonPropertyName("operationName")] | ||
public string? OperationName { get; set; } | ||
[JsonPropertyName("message")] | ||
public string? Message { get; set; } | ||
[JsonPropertyName("response")] | ||
public string? Response { get; set; } | ||
[JsonPropertyName("config")] | ||
public BackendTestConfig? Config { 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
/** | ||
* BackendTestCollection automatically generated by SDKgen please do not edit this file manually | ||
* @see https://sdkgen.app | ||
*/ | ||
|
||
using System.Text.Json.Serialization; | ||
namespace Fusio.SDK; | ||
public class BackendTestCollection : CommonCollection<BackendTest> | ||
{ | ||
} |
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,10 @@ | ||
/** | ||
* BackendTestConfig automatically generated by SDKgen please do not edit this file manually | ||
* @see https://sdkgen.app | ||
*/ | ||
|
||
using System.Text.Json.Serialization; | ||
namespace Fusio.SDK; | ||
public class BackendTestConfig : BackendActionExecuteRequest | ||
{ | ||
} |
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,170 @@ | ||
/** | ||
* BackendTestTag automatically generated by SDKgen please do not edit this file manually | ||
* @see https://sdkgen.app | ||
*/ | ||
|
||
|
||
using System.Collections.Generic; | ||
using System.Text.Json; | ||
using System.Threading.Tasks; | ||
using RestSharp; | ||
using Sdkgen.Client; | ||
using Sdkgen.Client.Exception; | ||
|
||
namespace Fusio.SDK; | ||
|
||
public class BackendTestTag : TagAbstract { | ||
public BackendTestTag(RestClient httpClient, Parser parser): base(httpClient, parser) | ||
{ | ||
} | ||
|
||
|
||
public async Task<CommonMessage> Update(string testId, BackendTestConfig payload) | ||
{ | ||
Dictionary<string, object> pathParams = new(); | ||
pathParams.Add("test_id", testId); | ||
|
||
Dictionary<string, object> queryParams = new(); | ||
|
||
List<string> queryStructNames = new(); | ||
|
||
RestRequest request = new(this.Parser.Url("/backend/test/$test_id<[0-9]+>", pathParams), Method.Put); | ||
this.Parser.Query(request, queryParams, queryStructNames); | ||
request.AddJsonBody(JsonSerializer.Serialize(payload)); | ||
|
||
RestResponse response = await this.HttpClient.ExecuteAsync(request); | ||
|
||
if (response.IsSuccessful) | ||
{ | ||
return this.Parser.Parse<CommonMessage>(response.Content); | ||
} | ||
|
||
throw (int) response.StatusCode switch | ||
{ | ||
400 => new CommonMessageException(this.Parser.Parse<CommonMessage>(response.Content)), | ||
401 => new CommonMessageException(this.Parser.Parse<CommonMessage>(response.Content)), | ||
404 => new CommonMessageException(this.Parser.Parse<CommonMessage>(response.Content)), | ||
410 => new CommonMessageException(this.Parser.Parse<CommonMessage>(response.Content)), | ||
500 => new CommonMessageException(this.Parser.Parse<CommonMessage>(response.Content)), | ||
_ => throw new UnknownStatusCodeException("The server returned an unknown status code"), | ||
}; | ||
} | ||
|
||
public async Task<CommonMessage> Run() | ||
{ | ||
Dictionary<string, object> pathParams = new(); | ||
|
||
Dictionary<string, object> queryParams = new(); | ||
|
||
List<string> queryStructNames = new(); | ||
|
||
RestRequest request = new(this.Parser.Url("/backend/test", pathParams), Method.Post); | ||
this.Parser.Query(request, queryParams, queryStructNames); | ||
|
||
RestResponse response = await this.HttpClient.ExecuteAsync(request); | ||
|
||
if (response.IsSuccessful) | ||
{ | ||
return this.Parser.Parse<CommonMessage>(response.Content); | ||
} | ||
|
||
throw (int) response.StatusCode switch | ||
{ | ||
401 => new CommonMessageException(this.Parser.Parse<CommonMessage>(response.Content)), | ||
404 => new CommonMessageException(this.Parser.Parse<CommonMessage>(response.Content)), | ||
410 => new CommonMessageException(this.Parser.Parse<CommonMessage>(response.Content)), | ||
500 => new CommonMessageException(this.Parser.Parse<CommonMessage>(response.Content)), | ||
_ => throw new UnknownStatusCodeException("The server returned an unknown status code"), | ||
}; | ||
} | ||
|
||
public async Task<CommonMessage> Refresh() | ||
{ | ||
Dictionary<string, object> pathParams = new(); | ||
|
||
Dictionary<string, object> queryParams = new(); | ||
|
||
List<string> queryStructNames = new(); | ||
|
||
RestRequest request = new(this.Parser.Url("/backend/test", pathParams), Method.Put); | ||
this.Parser.Query(request, queryParams, queryStructNames); | ||
|
||
RestResponse response = await this.HttpClient.ExecuteAsync(request); | ||
|
||
if (response.IsSuccessful) | ||
{ | ||
return this.Parser.Parse<CommonMessage>(response.Content); | ||
} | ||
|
||
throw (int) response.StatusCode switch | ||
{ | ||
401 => new CommonMessageException(this.Parser.Parse<CommonMessage>(response.Content)), | ||
404 => new CommonMessageException(this.Parser.Parse<CommonMessage>(response.Content)), | ||
410 => new CommonMessageException(this.Parser.Parse<CommonMessage>(response.Content)), | ||
500 => new CommonMessageException(this.Parser.Parse<CommonMessage>(response.Content)), | ||
_ => throw new UnknownStatusCodeException("The server returned an unknown status code"), | ||
}; | ||
} | ||
|
||
public async Task<BackendTest> Get(string testId) | ||
{ | ||
Dictionary<string, object> pathParams = new(); | ||
pathParams.Add("test_id", testId); | ||
|
||
Dictionary<string, object> queryParams = new(); | ||
|
||
List<string> queryStructNames = new(); | ||
|
||
RestRequest request = new(this.Parser.Url("/backend/test/$test_id<[0-9]+>", pathParams), Method.Get); | ||
this.Parser.Query(request, queryParams, queryStructNames); | ||
|
||
RestResponse response = await this.HttpClient.ExecuteAsync(request); | ||
|
||
if (response.IsSuccessful) | ||
{ | ||
return this.Parser.Parse<BackendTest>(response.Content); | ||
} | ||
|
||
throw (int) response.StatusCode switch | ||
{ | ||
401 => new CommonMessageException(this.Parser.Parse<CommonMessage>(response.Content)), | ||
404 => new CommonMessageException(this.Parser.Parse<CommonMessage>(response.Content)), | ||
410 => new CommonMessageException(this.Parser.Parse<CommonMessage>(response.Content)), | ||
500 => new CommonMessageException(this.Parser.Parse<CommonMessage>(response.Content)), | ||
_ => throw new UnknownStatusCodeException("The server returned an unknown status code"), | ||
}; | ||
} | ||
|
||
public async Task<BackendTestCollection> GetAll(int startIndex, int count, string search) | ||
{ | ||
Dictionary<string, object> pathParams = new(); | ||
|
||
Dictionary<string, object> queryParams = new(); | ||
queryParams.Add("startIndex", startIndex); | ||
queryParams.Add("count", count); | ||
queryParams.Add("search", search); | ||
|
||
List<string> queryStructNames = new(); | ||
|
||
RestRequest request = new(this.Parser.Url("/backend/test", pathParams), Method.Get); | ||
this.Parser.Query(request, queryParams, queryStructNames); | ||
|
||
RestResponse response = await this.HttpClient.ExecuteAsync(request); | ||
|
||
if (response.IsSuccessful) | ||
{ | ||
return this.Parser.Parse<BackendTestCollection>(response.Content); | ||
} | ||
|
||
throw (int) response.StatusCode switch | ||
{ | ||
401 => new CommonMessageException(this.Parser.Parse<CommonMessage>(response.Content)), | ||
404 => new CommonMessageException(this.Parser.Parse<CommonMessage>(response.Content)), | ||
410 => new CommonMessageException(this.Parser.Parse<CommonMessage>(response.Content)), | ||
500 => new CommonMessageException(this.Parser.Parse<CommonMessage>(response.Content)), | ||
_ => throw new UnknownStatusCodeException("The server returned an unknown status code"), | ||
}; | ||
} | ||
|
||
|
||
} |