Skip to content

Commit

Permalink
Merge pull request #15 from phantasma-io/feature-add-missing-components
Browse files Browse the repository at this point in the history
Upgrade API
  • Loading branch information
TeknoPT authored Oct 17, 2023
2 parents 5bfea20 + 9ba3cf9 commit e255040
Show file tree
Hide file tree
Showing 17 changed files with 232 additions and 190 deletions.
32 changes: 16 additions & 16 deletions Phantasma.RPC.Sharp/Api/AccountApi.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,26 +15,26 @@ public interface IAccountApi
/// </summary>
/// <param name="account"></param>
/// <returns>AccountResult</returns>
AccountResult ApiV1GetAccountGet (string account);
AccountResult GetAccount (string account);
/// <summary>
///
/// </summary>
/// <param name="accountText"></param>
/// <returns>List&lt;AccountResult&gt;</returns>
List<AccountResult> ApiV1GetAccountsGet (string accountText);
List<AccountResult> GetAccounts (string accountText);

/// <summary>
///
/// </summary>
/// <param name="symbol"></param>
/// <returns>List&lt;AccountResult&gt;</returns>
List<AccountResult> ApiV1GetAddressesBySymbol (string symbol);
List<AccountResult> GetAddressesBySymbol (string symbol);
/// <summary>
///
/// </summary>
/// <param name="name"></param>
/// <returns>string</returns>
string ApiV1LookUpNameGet (string name);
string LookUpName (string name);
}

/// <summary>
Expand Down Expand Up @@ -95,7 +95,7 @@ public String GetBasePath(String basePath)
/// </summary>
/// <param name="account"></param>
/// <returns>AccountResult</returns>
public AccountResult ApiV1GetAccountGet (string account)
public AccountResult GetAccount (string account)
{

var path = "/api/v1/GetAccount";
Expand All @@ -116,9 +116,9 @@ public AccountResult ApiV1GetAccountGet (string account)
RestResponseBase response = (RestResponseBase) ApiClient.CallApi(path, Method.Get, queryParams, postBody, headerParams, formParams, fileParams, authSettings);

if (((int)response.StatusCode) >= 400)
throw new ApiException ((int)response.StatusCode, "Error calling ApiV1GetAccountGet: " + response.Content, response.Content);
throw new ApiException ((int)response.StatusCode, "Error calling GetAccountGet: " + response.Content, response.Content);
else if (((int)response.StatusCode) == 0)
throw new ApiException ((int)response.StatusCode, "Error calling ApiV1GetAccountGet: " + response.ErrorMessage, response.ErrorMessage);
throw new ApiException ((int)response.StatusCode, "Error calling GetAccountGet: " + response.ErrorMessage, response.ErrorMessage);

return (AccountResult) ApiClient.Deserialize(response.Content, typeof(AccountResult), response.Headers);
}
Expand All @@ -128,7 +128,7 @@ public AccountResult ApiV1GetAccountGet (string account)
/// </summary>
/// <param name="accountText"></param>
/// <returns>List&lt;AccountResult&gt;</returns>
public List<AccountResult> ApiV1GetAccountsGet (string accountText)
public List<AccountResult> GetAccounts (string accountText)
{

var path = "/api/v1/GetAccounts";
Expand All @@ -149,9 +149,9 @@ public List<AccountResult> ApiV1GetAccountsGet (string accountText)
RestResponseBase response = ( RestResponseBase) ApiClient.CallApi(path, Method.Get, queryParams, postBody, headerParams, formParams, fileParams, authSettings);

if (((int)response.StatusCode) >= 400)
throw new ApiException ((int)response.StatusCode, "Error calling ApiV1GetAccountsGet: " + response.Content, response.Content);
throw new ApiException ((int)response.StatusCode, "Error calling GetAccountsGet: " + response.Content, response.Content);
else if (((int)response.StatusCode) == 0)
throw new ApiException ((int)response.StatusCode, "Error calling ApiV1GetAccountsGet: " + response.ErrorMessage, response.ErrorMessage);
throw new ApiException ((int)response.StatusCode, "Error calling GetAccountsGet: " + response.ErrorMessage, response.ErrorMessage);

return (List<AccountResult>) ApiClient.Deserialize(response.Content, typeof(List<AccountResult>), response.Headers);
}
Expand All @@ -161,7 +161,7 @@ public List<AccountResult> ApiV1GetAccountsGet (string accountText)
/// </summary>
/// <param name="accountText"></param>
/// <returns>List&lt;AccountResult&gt;</returns>
public List<AccountResult> ApiV1GetAddressesBySymbol (string symbol)
public List<AccountResult> GetAddressesBySymbol (string symbol)
{

var path = "/api/v1/GetAccounts";
Expand All @@ -182,9 +182,9 @@ public List<AccountResult> ApiV1GetAddressesBySymbol (string symbol)
RestResponseBase response = ( RestResponseBase) ApiClient.CallApi(path, Method.Get, queryParams, postBody, headerParams, formParams, fileParams, authSettings);

if (((int)response.StatusCode) >= 400)
throw new ApiException ((int)response.StatusCode, "Error calling ApiV1GetAccountsGet: " + response.Content, response.Content);
throw new ApiException ((int)response.StatusCode, "Error calling GetAccountsGet: " + response.Content, response.Content);
else if (((int)response.StatusCode) == 0)
throw new ApiException ((int)response.StatusCode, "Error calling ApiV1GetAccountsGet: " + response.ErrorMessage, response.ErrorMessage);
throw new ApiException ((int)response.StatusCode, "Error calling GetAccountsGet: " + response.ErrorMessage, response.ErrorMessage);

return (List<AccountResult>) ApiClient.Deserialize(response.Content, typeof(List<AccountResult>), response.Headers);
}
Expand All @@ -194,7 +194,7 @@ public List<AccountResult> ApiV1GetAddressesBySymbol (string symbol)
/// </summary>
/// <param name="name"></param>
/// <returns>string</returns>
public string ApiV1LookUpNameGet (string name)
public string LookUpName (string name)
{

var path = "/api/v1/LookUpName";
Expand All @@ -215,9 +215,9 @@ public string ApiV1LookUpNameGet (string name)
RestResponseBase response = ( RestResponseBase) ApiClient.CallApi(path, Method.Get, queryParams, postBody, headerParams, formParams, fileParams, authSettings);

if (((int)response.StatusCode) >= 400)
throw new ApiException ((int)response.StatusCode, "Error calling ApiV1LookUpNameGet: " + response.Content, response.Content);
throw new ApiException ((int)response.StatusCode, "Error calling LookUpNameGet: " + response.Content, response.Content);
else if (((int)response.StatusCode) == 0)
throw new ApiException ((int)response.StatusCode, "Error calling ApiV1LookUpNameGet: " + response.ErrorMessage, response.ErrorMessage);
throw new ApiException ((int)response.StatusCode, "Error calling LookUpNameGet: " + response.ErrorMessage, response.ErrorMessage);

return (string) ApiClient.Deserialize(response.Content, typeof(string), response.Headers);
}
Expand Down
24 changes: 12 additions & 12 deletions Phantasma.RPC.Sharp/Api/AuctionApi.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@ public interface IAuctionApi
/// <param name="symbol"></param>
/// <param name="iDtext"></param>
/// <returns>AuctionResult</returns>
AuctionResult ApiV1GetAuctionGet (string chainAddressOrName, string symbol, string iDtext);
AuctionResult GetAuction (string chainAddressOrName, string symbol, string iDtext);
/// <summary>
///
/// </summary>
/// <param name="chainAddressOrName"></param>
/// <param name="symbol"></param>
/// <returns>int?</returns>
int? ApiV1GetAuctionsCountGet (string chainAddressOrName, string symbol);
int? GetAuctionsCount (string chainAddressOrName, string symbol);
/// <summary>
///
/// </summary>
Expand All @@ -32,7 +32,7 @@ public interface IAuctionApi
/// <param name="page"></param>
/// <param name="pageSize"></param>
/// <returns>PaginatedResult</returns>
PaginatedResult ApiV1GetAuctionsGet (string chainAddressOrName, string symbol, int? page, int? pageSize);
PaginatedResult GetAuctions (string chainAddressOrName, string symbol, int? page, int? pageSize);
}

/// <summary>
Expand Down Expand Up @@ -95,7 +95,7 @@ public String GetBasePath(String basePath)
/// <param name="symbol"></param>
/// <param name="iDtext"></param>
/// <returns>AuctionResult</returns>
public AuctionResult ApiV1GetAuctionGet (string chainAddressOrName, string symbol, string iDtext)
public AuctionResult GetAuction (string chainAddressOrName, string symbol, string iDtext)
{

var path = "/api/v1/GetAuction";
Expand All @@ -118,9 +118,9 @@ public AuctionResult ApiV1GetAuctionGet (string chainAddressOrName, string symbo
RestResponseBase response = ( RestResponseBase) ApiClient.CallApi(path, Method.Get, queryParams, postBody, headerParams, formParams, fileParams, authSettings);

if (((int)response.StatusCode) >= 400)
throw new ApiException ((int)response.StatusCode, "Error calling ApiV1GetAuctionGet: " + response.Content, response.Content);
throw new ApiException ((int)response.StatusCode, "Error calling GetAuctionGet: " + response.Content, response.Content);
else if (((int)response.StatusCode) == 0)
throw new ApiException ((int)response.StatusCode, "Error calling ApiV1GetAuctionGet: " + response.ErrorMessage, response.ErrorMessage);
throw new ApiException ((int)response.StatusCode, "Error calling GetAuctionGet: " + response.ErrorMessage, response.ErrorMessage);

return (AuctionResult) ApiClient.Deserialize(response.Content, typeof(AuctionResult), response.Headers);
}
Expand All @@ -131,7 +131,7 @@ public AuctionResult ApiV1GetAuctionGet (string chainAddressOrName, string symbo
/// <param name="chainAddressOrName"></param>
/// <param name="symbol"></param>
/// <returns>int?</returns>
public int? ApiV1GetAuctionsCountGet (string chainAddressOrName, string symbol)
public int? GetAuctionsCount (string chainAddressOrName, string symbol)
{

var path = "/api/v1/GetAuctionsCount";
Expand All @@ -153,9 +153,9 @@ public AuctionResult ApiV1GetAuctionGet (string chainAddressOrName, string symbo
RestResponseBase response = ( RestResponseBase) ApiClient.CallApi(path, Method.Get, queryParams, postBody, headerParams, formParams, fileParams, authSettings);

if (((int)response.StatusCode) >= 400)
throw new ApiException ((int)response.StatusCode, "Error calling ApiV1GetAuctionsCountGet: " + response.Content, response.Content);
throw new ApiException ((int)response.StatusCode, "Error calling GetAuctionsCountGet: " + response.Content, response.Content);
else if (((int)response.StatusCode) == 0)
throw new ApiException ((int)response.StatusCode, "Error calling ApiV1GetAuctionsCountGet: " + response.ErrorMessage, response.ErrorMessage);
throw new ApiException ((int)response.StatusCode, "Error calling GetAuctionsCountGet: " + response.ErrorMessage, response.ErrorMessage);

return (int?) ApiClient.Deserialize(response.Content, typeof(int?), response.Headers);
}
Expand All @@ -168,7 +168,7 @@ public AuctionResult ApiV1GetAuctionGet (string chainAddressOrName, string symbo
/// <param name="page"></param>
/// <param name="pageSize"></param>
/// <returns>PaginatedResult</returns>
public PaginatedResult ApiV1GetAuctionsGet (string chainAddressOrName, string symbol, int? page, int? pageSize)
public PaginatedResult GetAuctions (string chainAddressOrName, string symbol, int? page, int? pageSize)
{

var path = "/api/v1/GetAuctions";
Expand All @@ -192,9 +192,9 @@ public PaginatedResult ApiV1GetAuctionsGet (string chainAddressOrName, string sy
RestResponseBase response = ( RestResponseBase) ApiClient.CallApi(path, Method.Get, queryParams, postBody, headerParams, formParams, fileParams, authSettings);

if (((int)response.StatusCode) >= 400)
throw new ApiException ((int)response.StatusCode, "Error calling ApiV1GetAuctionsGet: " + response.Content, response.Content);
throw new ApiException ((int)response.StatusCode, "Error calling GetAuctionsGet: " + response.Content, response.Content);
else if (((int)response.StatusCode) == 0)
throw new ApiException ((int)response.StatusCode, "Error calling ApiV1GetAuctionsGet: " + response.ErrorMessage, response.ErrorMessage);
throw new ApiException ((int)response.StatusCode, "Error calling GetAuctionsGet: " + response.ErrorMessage, response.ErrorMessage);

return (PaginatedResult) ApiClient.Deserialize(response.Content, typeof(PaginatedResult), response.Headers);
}
Expand Down
Loading

0 comments on commit e255040

Please sign in to comment.