Skip to content

Commit

Permalink
Operation "backend.test.update" was added
Browse files Browse the repository at this point in the history
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
Show file tree
Hide file tree
Showing 6 changed files with 221 additions and 1 deletion.
2 changes: 1 addition & 1 deletion sdkgen.lock

Large diffs are not rendered by default.

8 changes: 8 additions & 0 deletions src/Fusio.SDK/BackendTag.cs
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,14 @@ public BackendTokenTag Token()
);
}

public BackendTestTag Test()
{
return new BackendTestTag(
this.HttpClient,
this.Parser
);
}

public BackendTenantTag Tenant()
{
return new BackendTenantTag(
Expand Down
22 changes: 22 additions & 0 deletions src/Fusio.SDK/BackendTest.cs
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; }
}
10 changes: 10 additions & 0 deletions src/Fusio.SDK/BackendTestCollection.cs
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>
{
}
10 changes: 10 additions & 0 deletions src/Fusio.SDK/BackendTestConfig.cs
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
{
}
170 changes: 170 additions & 0 deletions src/Fusio.SDK/BackendTestTag.cs
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"),
};
}


}

0 comments on commit 36cf6a0

Please sign in to comment.