diff --git a/.editorconfig b/.editorconfig index 534d9a04..7dd8dac9 100644 --- a/.editorconfig +++ b/.editorconfig @@ -15,6 +15,3 @@ indent_size = 2 # C# files [*.cs] - -# CA1014: Mark assemblies with CLSCompliant -dotnet_diagnostic.CA1014.severity = none # Not interested in feature diff --git a/.github/workflows/myget-unstable-deploy.yml b/.github/workflows/myget-unstable-deploy.yml index d59a2950..272760ab 100644 --- a/.github/workflows/myget-unstable-deploy.yml +++ b/.github/workflows/myget-unstable-deploy.yml @@ -11,7 +11,8 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@master + - name: Checkout + uses: actions/checkout@master with: fetch-depth: 0 diff --git a/.github/workflows/nuget-stable-deploy.yml b/.github/workflows/nuget-stable-deploy.yml index 6e02337c..a040dd13 100644 --- a/.github/workflows/nuget-stable-deploy.yml +++ b/.github/workflows/nuget-stable-deploy.yml @@ -10,7 +10,8 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@master + - name: Checkout + uses: actions/checkout@master with: fetch-depth: 0 diff --git a/README.md b/README.md index 0ed9941d..dca4a0cf 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ Bee.Net is a .Net client for the [Bee Swarm](https://github.com/ethersphere/bee) With this client you can consume public and debug api of any Bee node exposing them. -Current release is compatible with Bee nodes from version `1.4.1` to `1.4.3`. Other versions could have issues. +Current release is compatible with Bee nodes from version `1.4.1` to `1.5.0`. Other versions could have issues. Package repositories -------------------- diff --git a/src/BeeNet/BeeNet.csproj b/src/BeeNet/BeeNet.csproj index 4727fdf7..7b842151 100644 --- a/src/BeeNet/BeeNet.csproj +++ b/src/BeeNet/BeeNet.csproj @@ -4,8 +4,10 @@ netstandard2.0 true Etherna.BeeNet + Etherna Sagl A .Net client for Swarm Bee + 9.0 enable true @@ -32,7 +34,7 @@ runtime; build; native; contentfiles; analyzers; buildtransitive - + diff --git a/src/BeeNet/BeeNodeClient.cs b/src/BeeNet/BeeNodeClient.cs index 1d5f56d0..02f7b034 100644 --- a/src/BeeNet/BeeNodeClient.cs +++ b/src/BeeNet/BeeNodeClient.cs @@ -35,12 +35,10 @@ public BeeNodeClient( string baseUrl = "http://localhost/", int? gatewayApiPort = 1633, int? debugApiPort = 1635, - GatewayApiVersion gatewayApiVersion = GatewayApiVersion.v2_0_0, - DebugApiVersion debugApiVersion = DebugApiVersion.v1_2_0) + GatewayApiVersion gatewayApiVersion = GatewayApiVersion.v3_0_0, + DebugApiVersion debugApiVersion = DebugApiVersion.v2_0_0) { httpClient = new HttpClient(); - DebugApiVersion = debugApiVersion; - GatewayApiVersion = gatewayApiVersion; if (debugApiPort is not null) { @@ -76,10 +74,8 @@ protected virtual void Dispose(bool disposing) // Properties. public Uri? DebugApiUrl { get; } - public DebugApiVersion DebugApiVersion { get; } public IBeeDebugClient? DebugClient { get; } public Uri? GatewayApiUrl { get; } - public GatewayApiVersion GatewayApiVersion { get; } public IBeeGatewayClient? GatewayClient { get; } // Helpers. diff --git a/src/BeeNet/Clients/DebugApi/BeeDebugClient.cs b/src/BeeNet/Clients/DebugApi/BeeDebugClient.cs index 58591af1..763dcc10 100644 --- a/src/BeeNet/Clients/DebugApi/BeeDebugClient.cs +++ b/src/BeeNet/Clients/DebugApi/BeeDebugClient.cs @@ -14,9 +14,11 @@ using Etherna.BeeNet.Clients.DebugApi.V1_2_0; using Etherna.BeeNet.Clients.DebugApi.V1_2_1; +using Etherna.BeeNet.Clients.DebugApi.V2_0_0; using Etherna.BeeNet.DtoModels; using System; using System.Collections.Generic; +using System.Globalization; using System.Linq; using System.Net.Http; using System.Text.Json; @@ -29,6 +31,7 @@ public class BeeDebugClient : IBeeDebugClient // Fields. private readonly IBeeDebugClient_1_2_0 beeDebugClient_1_2_0; private readonly IBeeDebugClient_1_2_1 beeDebugClient_1_2_1; + private readonly IBeeDebugClient_2_0_0 beeDebugClient_2_0_0; // Constructors. public BeeDebugClient(HttpClient httpClient, Uri baseUrl, DebugApiVersion apiVersion) @@ -38,6 +41,7 @@ public BeeDebugClient(HttpClient httpClient, Uri baseUrl, DebugApiVersion apiVer beeDebugClient_1_2_0 = new BeeDebugClient_1_2_0(httpClient) { BaseUrl = baseUrl.ToString() }; beeDebugClient_1_2_1 = new BeeDebugClient_1_2_1(httpClient) { BaseUrl = baseUrl.ToString() }; + beeDebugClient_2_0_0 = new BeeDebugClient_2_0_0(httpClient) { BaseUrl = baseUrl.ToString() }; CurrentApiVersion = apiVersion; } @@ -46,26 +50,28 @@ public BeeDebugClient(HttpClient httpClient, Uri baseUrl, DebugApiVersion apiVer // Methods. public async Task BuyPostageBatchAsync( - int amount, + long amount, int depth, string? label = null, bool? immutable = null, - int? gasPrice = null) => + long? gasPrice = null) => CurrentApiVersion switch { DebugApiVersion.v1_2_0 => ((JsonElement)(await beeDebugClient_1_2_0.StampsPostAsync(amount, depth, label, immutable, gasPrice).ConfigureAwait(false)).BatchID).ToString(), DebugApiVersion.v1_2_1 => (await beeDebugClient_1_2_1.StampsPostAsync(amount, depth, label, immutable, gasPrice).ConfigureAwait(false)).BatchID, + DebugApiVersion.v2_0_0 => (await beeDebugClient_2_0_0.StampsPostAsync(amount.ToString(CultureInfo.InvariantCulture), depth, label, immutable, gasPrice).ConfigureAwait(false)).BatchID, _ => throw new InvalidOperationException() }; public async Task CashoutChequeForPeerAsync( string peerId, - int? gasPrice = null, + long? gasPrice = null, long? gasLimit = null) => CurrentApiVersion switch { DebugApiVersion.v1_2_0 => (await beeDebugClient_1_2_0.ChequebookCashoutPostAsync(peerId, gasPrice, gasLimit).ConfigureAwait(false)).TransactionHash, DebugApiVersion.v1_2_1 => (await beeDebugClient_1_2_1.ChequebookCashoutPostAsync(peerId, gasPrice, gasLimit).ConfigureAwait(false)).TransactionHash, + DebugApiVersion.v2_0_0 => (await beeDebugClient_2_0_0.ChequebookCashoutPostAsync(peerId, gasPrice, gasLimit).ConfigureAwait(false)).TransactionHash, _ => throw new InvalidOperationException() }; @@ -74,6 +80,7 @@ public async Task ConnectToPeerAsync(string address) => { DebugApiVersion.v1_2_0 => (await beeDebugClient_1_2_0.ConnectAsync(address).ConfigureAwait(false)).Address, DebugApiVersion.v1_2_1 => (await beeDebugClient_1_2_1.ConnectAsync(address).ConfigureAwait(false)).Address, + DebugApiVersion.v2_0_0 => (await beeDebugClient_2_0_0.ConnectAsync(address).ConfigureAwait(false)).Address, _ => throw new InvalidOperationException() }; @@ -82,6 +89,7 @@ public async Task DeleteChunkAsync(string address) => { DebugApiVersion.v1_2_0 => new MessageResponseDto(await beeDebugClient_1_2_0.ChunksDeleteAsync(address).ConfigureAwait(false)), DebugApiVersion.v1_2_1 => new MessageResponseDto(await beeDebugClient_1_2_1.ChunksDeleteAsync(address).ConfigureAwait(false)), + DebugApiVersion.v2_0_0 => new MessageResponseDto(await beeDebugClient_2_0_0.ChunksDeleteAsync(address).ConfigureAwait(false)), _ => throw new InvalidOperationException() }; @@ -90,26 +98,29 @@ public async Task DeletePeerAsync(string address) => { DebugApiVersion.v1_2_0 => new MessageResponseDto(await beeDebugClient_1_2_0.PeersDeleteAsync(address).ConfigureAwait(false)), DebugApiVersion.v1_2_1 => new MessageResponseDto(await beeDebugClient_1_2_1.PeersDeleteAsync(address).ConfigureAwait(false)), + DebugApiVersion.v2_0_0 => new MessageResponseDto(await beeDebugClient_2_0_0.PeersDeleteAsync(address).ConfigureAwait(false)), _ => throw new InvalidOperationException() }; public async Task DeleteTransactionAsync( string txHash, - int? gasPrice = null) => + long? gasPrice = null) => CurrentApiVersion switch { - DebugApiVersion.v1_2_0 => (await beeDebugClient_1_2_0.TransactionsDeleteAsync(txHash).ConfigureAwait(false)).TransactionHash, - DebugApiVersion.v1_2_1 => (await beeDebugClient_1_2_1.TransactionsDeleteAsync(txHash).ConfigureAwait(false)).TransactionHash, + DebugApiVersion.v1_2_0 => (await beeDebugClient_1_2_0.TransactionsDeleteAsync(txHash, gasPrice).ConfigureAwait(false)).TransactionHash, + DebugApiVersion.v1_2_1 => (await beeDebugClient_1_2_1.TransactionsDeleteAsync(txHash, gasPrice).ConfigureAwait(false)).TransactionHash, + DebugApiVersion.v2_0_0 => (await beeDebugClient_2_0_0.TransactionsDeleteAsync(txHash, gasPrice).ConfigureAwait(false)).TransactionHash, _ => throw new InvalidOperationException() }; public async Task DepositIntoChequeBookAsync( - int amount, - int? gasPrice = null) => + long amount, + long? gasPrice = null) => CurrentApiVersion switch { DebugApiVersion.v1_2_0 => (await beeDebugClient_1_2_0.ChequebookDepositAsync(amount, gasPrice).ConfigureAwait(false)).TransactionHash, DebugApiVersion.v1_2_1 => (await beeDebugClient_1_2_1.ChequebookDepositAsync(amount, gasPrice).ConfigureAwait(false)).TransactionHash, + DebugApiVersion.v2_0_0 => (await beeDebugClient_2_0_0.ChequebookDepositAsync(amount, gasPrice).ConfigureAwait(false)).TransactionHash, _ => throw new InvalidOperationException() }; @@ -120,6 +131,7 @@ public async Task DilutePostageBatchAsync( { DebugApiVersion.v1_2_0 => ((JsonElement)(await beeDebugClient_1_2_0.StampsDiluteAsync(id, depth).ConfigureAwait(false)).BatchID).ToString(), DebugApiVersion.v1_2_1 => (await beeDebugClient_1_2_1.StampsDiluteAsync(id, depth).ConfigureAwait(false)).BatchID, + DebugApiVersion.v2_0_0 => (await beeDebugClient_2_0_0.StampsDiluteAsync(id, depth).ConfigureAwait(false)).BatchID, _ => throw new InvalidOperationException() }; @@ -128,6 +140,7 @@ public async Task GetAddressesAsync() => { DebugApiVersion.v1_2_0 => new AddressDetailDto(await beeDebugClient_1_2_0.AddressesAsync().ConfigureAwait(false)), DebugApiVersion.v1_2_1 => new AddressDetailDto(await beeDebugClient_1_2_1.AddressesAsync().ConfigureAwait(false)), + DebugApiVersion.v2_0_0 => new AddressDetailDto(await beeDebugClient_2_0_0.AddressesAsync().ConfigureAwait(false)), _ => throw new InvalidOperationException() }; @@ -136,22 +149,16 @@ public async Task> GetAllBalancesAsync() => { DebugApiVersion.v1_2_0 => (await beeDebugClient_1_2_0.BalancesGetAsync().ConfigureAwait(false)).Balances.Select(i => new BalanceDto(i)), DebugApiVersion.v1_2_1 => (await beeDebugClient_1_2_1.BalancesGetAsync().ConfigureAwait(false)).Balances.Select(i => new BalanceDto(i)), - _ => throw new InvalidOperationException() - }; - - public async Task> GetAllBatchesFromAllNodesAsync() => - CurrentApiVersion switch - { - DebugApiVersion.v1_2_0 => throw new InvalidOperationException($"Debug API {CurrentApiVersion} doesn't implement this function"), - DebugApiVersion.v1_2_1 => (await beeDebugClient_1_2_1.BatchesAsync().ConfigureAwait(false)).Stamps.Select(i => new ValidPostageBatchDto(i)), + DebugApiVersion.v2_0_0 => (await beeDebugClient_2_0_0.BalancesGetAsync().ConfigureAwait(false)).Balances.Select(i => new BalanceDto(i)), _ => throw new InvalidOperationException() }; public async Task> GetAllChequeBookChequesAsync() => CurrentApiVersion switch { - DebugApiVersion.v1_2_0 => (await beeDebugClient_1_2_0.ChequebookChequeGetAsync().ConfigureAwait(false)).Lastcheques.Select(i => new ChequeBookChequeGetDto(i)), - DebugApiVersion.v1_2_1 => (await beeDebugClient_1_2_1.ChequebookChequeGetAsync().ConfigureAwait(false)).Lastcheques.Select(i => new ChequeBookChequeGetDto(i)), + DebugApiVersion.v1_2_0 => ((await beeDebugClient_1_2_0.ChequebookChequeGetAsync().ConfigureAwait(false)).Lastcheques ?? Array.Empty()).Select(i => new ChequeBookChequeGetDto(i)), + DebugApiVersion.v1_2_1 => ((await beeDebugClient_1_2_1.ChequebookChequeGetAsync().ConfigureAwait(false)).Lastcheques ?? Array.Empty()).Select(i => new ChequeBookChequeGetDto(i)), + DebugApiVersion.v2_0_0 => (await beeDebugClient_2_0_0.ChequebookChequeGetAsync().ConfigureAwait(false)).Lastcheques.Select(i => new ChequeBookChequeGetDto(i)), _ => throw new InvalidOperationException() }; @@ -160,14 +167,16 @@ public async Task> GetAllConsumedBalancesAsync() => { DebugApiVersion.v1_2_0 => (await beeDebugClient_1_2_0.ConsumedGetAsync().ConfigureAwait(false)).Balances.Select(i => new BalanceDto(i)), DebugApiVersion.v1_2_1 => (await beeDebugClient_1_2_1.ConsumedGetAsync().ConfigureAwait(false)).Balances.Select(i => new BalanceDto(i)), + DebugApiVersion.v2_0_0 => (await beeDebugClient_2_0_0.ConsumedGetAsync().ConfigureAwait(false)).Balances.Select(i => new BalanceDto(i)), _ => throw new InvalidOperationException() }; public async Task> GetAllPeerAddressesAsync() => CurrentApiVersion switch { - DebugApiVersion.v1_2_0 => (await beeDebugClient_1_2_0.PeersGetAsync().ConfigureAwait(false)).Peers.Select(i => i.Address), - DebugApiVersion.v1_2_1 => (await beeDebugClient_1_2_1.PeersGetAsync().ConfigureAwait(false)).Peers.Select(i => i.Address), + DebugApiVersion.v1_2_0 => ((await beeDebugClient_1_2_0.PeersGetAsync().ConfigureAwait(false)).Peers ?? Array.Empty()).Select(i => i.Address), + DebugApiVersion.v1_2_1 => ((await beeDebugClient_1_2_1.PeersGetAsync().ConfigureAwait(false)).Peers ?? Array.Empty()).Select(i => i.Address), + DebugApiVersion.v2_0_0 => (await beeDebugClient_2_0_0.PeersGetAsync().ConfigureAwait(false)).Peers.Select(i => i.Address), _ => throw new InvalidOperationException() }; @@ -176,22 +185,25 @@ public async Task GetAllSettlementsAsync() => { DebugApiVersion.v1_2_0 => new SettlementDto(await beeDebugClient_1_2_0.SettlementsGetAsync().ConfigureAwait(false)), DebugApiVersion.v1_2_1 => new SettlementDto(await beeDebugClient_1_2_1.SettlementsGetAsync().ConfigureAwait(false)), + DebugApiVersion.v2_0_0 => new SettlementDto(await beeDebugClient_2_0_0.SettlementsGetAsync().ConfigureAwait(false)), _ => throw new InvalidOperationException() }; - public async Task> GetAllStampsAsync() => + public async Task GetAllTimeSettlementsAsync() => CurrentApiVersion switch { - DebugApiVersion.v1_2_0 => (await beeDebugClient_1_2_0.StampsGetAsync().ConfigureAwait(false)).Stamps.Select(i => new StampsGetDto(i)), - DebugApiVersion.v1_2_1 => (await beeDebugClient_1_2_1.StampsGetAsync().ConfigureAwait(false)).Stamps.Select(i => new StampsGetDto(i)), + DebugApiVersion.v1_2_0 => new TimeSettlementsDto(await beeDebugClient_1_2_0.TimesettlementsAsync().ConfigureAwait(false)), + DebugApiVersion.v1_2_1 => new TimeSettlementsDto(await beeDebugClient_1_2_1.TimesettlementsAsync().ConfigureAwait(false)), + DebugApiVersion.v2_0_0 => new TimeSettlementsDto(await beeDebugClient_2_0_0.TimesettlementsAsync().ConfigureAwait(false)), _ => throw new InvalidOperationException() }; - public async Task GetAllTimeSettlementsAsync() => + public async Task> GetAllValidPostageBatchesFromAllNodesAsync() => CurrentApiVersion switch { - DebugApiVersion.v1_2_0 => new TimeSettlementsDto(await beeDebugClient_1_2_0.TimesettlementsAsync().ConfigureAwait(false)), - DebugApiVersion.v1_2_1 => new TimeSettlementsDto(await beeDebugClient_1_2_1.TimesettlementsAsync().ConfigureAwait(false)), + DebugApiVersion.v1_2_0 => throw new InvalidOperationException($"Debug API {CurrentApiVersion} doesn't implement this function"), + DebugApiVersion.v1_2_1 => ((await beeDebugClient_1_2_1.BatchesAsync().ConfigureAwait(false)).Stamps ?? Array.Empty()).Select(i => new BatchDto(i)), + DebugApiVersion.v2_0_0 => (await beeDebugClient_2_0_0.BatchesAsync().ConfigureAwait(false)).Batches.Select(i => new BatchDto(i)), _ => throw new InvalidOperationException() }; @@ -200,14 +212,16 @@ public async Task> GetBalanceWithPeerAsync(string addres { DebugApiVersion.v1_2_0 => (await beeDebugClient_1_2_0.BalancesGetAsync().ConfigureAwait(false)).Balances.Select(i => new BalanceDto(i)), DebugApiVersion.v1_2_1 => (await beeDebugClient_1_2_1.BalancesGetAsync().ConfigureAwait(false)).Balances.Select(i => new BalanceDto(i)), + DebugApiVersion.v2_0_0 => (await beeDebugClient_2_0_0.BalancesGetAsync().ConfigureAwait(false)).Balances.Select(i => new BalanceDto(i)), _ => throw new InvalidOperationException() }; public async Task> GetBlocklistedPeerAddressesAsync() => CurrentApiVersion switch { - DebugApiVersion.v1_2_0 => (await beeDebugClient_1_2_0.BlocklistAsync().ConfigureAwait(false)).Peers.Select(i => i.Address), - DebugApiVersion.v1_2_1 => (await beeDebugClient_1_2_1.BlocklistAsync().ConfigureAwait(false)).Peers.Select(i => i.Address), + DebugApiVersion.v1_2_0 => ((await beeDebugClient_1_2_0.BlocklistAsync().ConfigureAwait(false)).Peers ?? Array.Empty()).Select(i => i.Address), + DebugApiVersion.v1_2_1 => ((await beeDebugClient_1_2_1.BlocklistAsync().ConfigureAwait(false)).Peers ?? Array.Empty()).Select(i => i.Address), + DebugApiVersion.v2_0_0 => (await beeDebugClient_2_0_0.BlocklistAsync().ConfigureAwait(false)).Peers.Select(i => i.Address), _ => throw new InvalidOperationException() }; @@ -216,6 +230,7 @@ public async Task GetChainStateAsync() => { DebugApiVersion.v1_2_0 => new ChainStateDto(await beeDebugClient_1_2_0.ChainstateAsync().ConfigureAwait(false)), DebugApiVersion.v1_2_1 => new ChainStateDto(await beeDebugClient_1_2_1.ChainstateAsync().ConfigureAwait(false)), + DebugApiVersion.v2_0_0 => new ChainStateDto(await beeDebugClient_2_0_0.ChainstateAsync().ConfigureAwait(false)), _ => throw new InvalidOperationException() }; @@ -224,6 +239,7 @@ public async Task GetChequeBookAddressAsync() => { DebugApiVersion.v1_2_0 => (await beeDebugClient_1_2_0.ChequebookAddressAsync().ConfigureAwait(false)).ChequebookAddress, DebugApiVersion.v1_2_1 => (await beeDebugClient_1_2_1.ChequebookAddressAsync().ConfigureAwait(false)).ChequebookAddress, + DebugApiVersion.v2_0_0 => (await beeDebugClient_2_0_0.ChequebookAddressAsync().ConfigureAwait(false)).ChequebookAddress, _ => throw new InvalidOperationException() }; @@ -232,6 +248,7 @@ public async Task GetChequeBookBalanceAsync() => { DebugApiVersion.v1_2_0 => new ChequeBookBalanceDto(await beeDebugClient_1_2_0.ChequebookBalanceAsync().ConfigureAwait(false)), DebugApiVersion.v1_2_1 => new ChequeBookBalanceDto(await beeDebugClient_1_2_1.ChequebookBalanceAsync().ConfigureAwait(false)), + DebugApiVersion.v2_0_0 => new ChequeBookBalanceDto(await beeDebugClient_2_0_0.ChequebookBalanceAsync().ConfigureAwait(false)), _ => throw new InvalidOperationException() }; @@ -240,6 +257,7 @@ public async Task GetChequeBookCashoutForPeerAsync(stri { DebugApiVersion.v1_2_0 => new ChequeBookCashoutGetDto(await beeDebugClient_1_2_0.ChequebookCashoutGetAsync(peerId).ConfigureAwait(false)), DebugApiVersion.v1_2_1 => new ChequeBookCashoutGetDto(await beeDebugClient_1_2_1.ChequebookCashoutGetAsync(peerId).ConfigureAwait(false)), + DebugApiVersion.v2_0_0 => new ChequeBookCashoutGetDto(await beeDebugClient_2_0_0.ChequebookCashoutGetAsync(peerId).ConfigureAwait(false)), _ => throw new InvalidOperationException() }; @@ -248,6 +266,7 @@ public async Task GetChequeBookChequeForPeerAsync(string { DebugApiVersion.v1_2_0 => new ChequeBookChequeGetDto(await beeDebugClient_1_2_0.ChequebookChequeGetAsync(peerId).ConfigureAwait(false)), DebugApiVersion.v1_2_1 => new ChequeBookChequeGetDto(await beeDebugClient_1_2_1.ChequebookChequeGetAsync(peerId).ConfigureAwait(false)), + DebugApiVersion.v2_0_0 => new ChequeBookChequeGetDto(await beeDebugClient_2_0_0.ChequebookChequeGetAsync(peerId).ConfigureAwait(false)), _ => throw new InvalidOperationException() }; @@ -256,6 +275,7 @@ public async Task GetChunkAsync(string address) => { DebugApiVersion.v1_2_0 => new MessageResponseDto(await beeDebugClient_1_2_0.ChunksGetAsync(address).ConfigureAwait(false)), DebugApiVersion.v1_2_1 => new MessageResponseDto(await beeDebugClient_1_2_1.ChunksGetAsync(address).ConfigureAwait(false)), + DebugApiVersion.v2_0_0 => new MessageResponseDto(await beeDebugClient_2_0_0.ChunksGetAsync(address).ConfigureAwait(false)), _ => throw new InvalidOperationException() }; @@ -264,6 +284,7 @@ public async Task> GetConsumedBalanceWithPeerAsync(strin { DebugApiVersion.v1_2_0 => (await beeDebugClient_1_2_0.ConsumedGetAsync().ConfigureAwait(false)).Balances.Select(i => new BalanceDto(i)), DebugApiVersion.v1_2_1 => (await beeDebugClient_1_2_1.ConsumedGetAsync().ConfigureAwait(false)).Balances.Select(i => new BalanceDto(i)), + DebugApiVersion.v2_0_0 => (await beeDebugClient_2_0_0.ConsumedGetAsync().ConfigureAwait(false)).Balances.Select(i => new BalanceDto(i)), _ => throw new InvalidOperationException() }; @@ -272,6 +293,7 @@ public async Task GetHealthAsync() => { DebugApiVersion.v1_2_0 => new VersionDto(await beeDebugClient_1_2_0.HealthAsync().ConfigureAwait(false)), DebugApiVersion.v1_2_1 => new VersionDto(await beeDebugClient_1_2_1.HealthAsync().ConfigureAwait(false)), + DebugApiVersion.v2_0_0 => new VersionDto(await beeDebugClient_2_0_0.HealthAsync().ConfigureAwait(false)), _ => throw new InvalidOperationException() }; @@ -280,22 +302,34 @@ public async Task GetNodeInfoAsync() => { DebugApiVersion.v1_2_0 => throw new InvalidOperationException($"Debug API {CurrentApiVersion} doesn't implement this function"), DebugApiVersion.v1_2_1 => new NodeInfoDto(await beeDebugClient_1_2_1.NodeAsync().ConfigureAwait(false)), + DebugApiVersion.v2_0_0 => new NodeInfoDto(await beeDebugClient_2_0_0.NodeAsync().ConfigureAwait(false)), + _ => throw new InvalidOperationException() + }; + + public async Task> GetOwnedPostageBatchesByNodeAsync() => + CurrentApiVersion switch + { + DebugApiVersion.v1_2_0 => ((await beeDebugClient_1_2_0.StampsGetAsync().ConfigureAwait(false)).Stamps ?? Array.Empty()).Select(i => new PostageBatchDto(i)), + DebugApiVersion.v1_2_1 => ((await beeDebugClient_1_2_1.StampsGetAsync().ConfigureAwait(false)).Stamps ?? Array.Empty()).Select(i => new PostageBatchDto(i)), + DebugApiVersion.v2_0_0 => (await beeDebugClient_2_0_0.StampsGetAsync().ConfigureAwait(false)).Stamps.Select(i => new PostageBatchDto(i)), _ => throw new InvalidOperationException() }; public async Task> GetPendingTransactionsAsync() => CurrentApiVersion switch { - DebugApiVersion.v1_2_0 => (await beeDebugClient_1_2_0.TransactionsGetAsync().ConfigureAwait(false)).PendingTransactions.Select(i => new PendingTransactionDto(i)), - DebugApiVersion.v1_2_1 => (await beeDebugClient_1_2_1.TransactionsGetAsync().ConfigureAwait(false)).PendingTransactions.Select(i => new PendingTransactionDto(i)), + DebugApiVersion.v1_2_0 => ((await beeDebugClient_1_2_0.TransactionsGetAsync().ConfigureAwait(false)).PendingTransactions ?? Array.Empty()).Select(i => new PendingTransactionDto(i)), + DebugApiVersion.v1_2_1 => ((await beeDebugClient_1_2_1.TransactionsGetAsync().ConfigureAwait(false)).PendingTransactions ?? Array.Empty()).Select(i => new PendingTransactionDto(i)), + DebugApiVersion.v2_0_0 => (await beeDebugClient_2_0_0.TransactionsGetAsync().ConfigureAwait(false)).PendingTransactions.Select(i => new PendingTransactionDto(i)), _ => throw new InvalidOperationException() }; - public async Task GetPostageBatchStatusAsync(string id) => + public async Task GetPostageBatchAsync(string id) => CurrentApiVersion switch { - DebugApiVersion.v1_2_0 => new StampsGetDto(await beeDebugClient_1_2_0.StampsGetAsync(id).ConfigureAwait(false)), - DebugApiVersion.v1_2_1 => new StampsGetDto(await beeDebugClient_1_2_1.StampsGetAsync(id).ConfigureAwait(false)), + DebugApiVersion.v1_2_0 => new PostageBatchDto(await beeDebugClient_1_2_0.StampsGetAsync(id).ConfigureAwait(false)), + DebugApiVersion.v1_2_1 => new PostageBatchDto(await beeDebugClient_1_2_1.StampsGetAsync(id).ConfigureAwait(false)), + DebugApiVersion.v2_0_0 => new PostageBatchDto(await beeDebugClient_2_0_0.StampsGetAsync(id).ConfigureAwait(false)), _ => throw new InvalidOperationException() }; @@ -304,6 +338,7 @@ public async Task GetReadinessAsync() => { DebugApiVersion.v1_2_0 => new VersionDto(await beeDebugClient_1_2_0.ReadinessAsync().ConfigureAwait(false)), DebugApiVersion.v1_2_1 => new VersionDto(await beeDebugClient_1_2_1.ReadinessAsync().ConfigureAwait(false)), + DebugApiVersion.v2_0_0 => new VersionDto(await beeDebugClient_2_0_0.ReadinessAsync().ConfigureAwait(false)), _ => throw new InvalidOperationException() }; @@ -312,14 +347,16 @@ public async Task GetReserveStateAsync() => { DebugApiVersion.v1_2_0 => new ReserveStateDto(await beeDebugClient_1_2_0.ReservestateAsync().ConfigureAwait(false)), DebugApiVersion.v1_2_1 => new ReserveStateDto(await beeDebugClient_1_2_1.ReservestateAsync().ConfigureAwait(false)), + DebugApiVersion.v2_0_0 => new ReserveStateDto(await beeDebugClient_2_0_0.ReservestateAsync().ConfigureAwait(false)), _ => throw new InvalidOperationException() }; public async Task> GetSettlementsWithPeerAsync(string address) => CurrentApiVersion switch { - DebugApiVersion.v1_2_0 => (await beeDebugClient_1_2_0.SettlementsGetAsync().ConfigureAwait(false)).Settlements.Select(i => new SettlementDataDto(i)), - DebugApiVersion.v1_2_1 => (await beeDebugClient_1_2_1.SettlementsGetAsync().ConfigureAwait(false)).Settlements.Select(i => new SettlementDataDto(i)), + DebugApiVersion.v1_2_0 => ((await beeDebugClient_1_2_0.SettlementsGetAsync().ConfigureAwait(false)).Settlements ?? Array.Empty()).Select(i => new SettlementDataDto(i)), + DebugApiVersion.v1_2_1 => ((await beeDebugClient_1_2_1.SettlementsGetAsync().ConfigureAwait(false)).Settlements ?? Array.Empty()).Select(i => new SettlementDataDto(i)), + DebugApiVersion.v2_0_0 => (await beeDebugClient_2_0_0.SettlementsGetAsync().ConfigureAwait(false)).Settlements.Select(i => new SettlementDataDto(i)), _ => throw new InvalidOperationException() }; @@ -328,6 +365,7 @@ public async Task GetStampsBucketsForBatchAsync(string batchId { DebugApiVersion.v1_2_0 => new StampsBucketsDto(await beeDebugClient_1_2_0.StampsBucketsAsync(batchId).ConfigureAwait(false)), DebugApiVersion.v1_2_1 => new StampsBucketsDto(await beeDebugClient_1_2_1.StampsBucketsAsync(batchId).ConfigureAwait(false)), + DebugApiVersion.v2_0_0 => new StampsBucketsDto(await beeDebugClient_2_0_0.StampsBucketsAsync(batchId).ConfigureAwait(false)), _ => throw new InvalidOperationException() }; @@ -336,6 +374,7 @@ public async Task GetSwarmTopologyAsync() => { DebugApiVersion.v1_2_0 => new TopologyDto(await beeDebugClient_1_2_0.TopologyAsync().ConfigureAwait(false)), DebugApiVersion.v1_2_1 => new TopologyDto(await beeDebugClient_1_2_1.TopologyAsync().ConfigureAwait(false)), + DebugApiVersion.v2_0_0 => new TopologyDto(await beeDebugClient_2_0_0.TopologyAsync().ConfigureAwait(false)), _ => throw new InvalidOperationException() }; @@ -344,6 +383,7 @@ public async Task GetTagInfoAsync(int uid) => { DebugApiVersion.v1_2_0 => new TagDto(await beeDebugClient_1_2_0.TagsAsync(uid).ConfigureAwait(false)), DebugApiVersion.v1_2_1 => new TagDto(await beeDebugClient_1_2_1.TagsAsync(uid).ConfigureAwait(false)), + DebugApiVersion.v2_0_0 => new TagDto(await beeDebugClient_2_0_0.TagsAsync(uid).ConfigureAwait(false)), _ => throw new InvalidOperationException() }; @@ -352,6 +392,7 @@ public async Task GetTransactionInfoAsync(string txHash) => { DebugApiVersion.v1_2_0 => new TransactionsDto(await beeDebugClient_1_2_0.TransactionsGetAsync(txHash).ConfigureAwait(false)), DebugApiVersion.v1_2_1 => new TransactionsDto(await beeDebugClient_1_2_1.TransactionsGetAsync(txHash).ConfigureAwait(false)), + DebugApiVersion.v2_0_0 => new TransactionsDto(await beeDebugClient_2_0_0.TransactionsGetAsync(txHash).ConfigureAwait(false)), _ => throw new InvalidOperationException() }; @@ -360,6 +401,7 @@ public async Task GetWelcomeMessageAsync() => { DebugApiVersion.v1_2_0 => (await beeDebugClient_1_2_0.WelcomeMessageGetAsync().ConfigureAwait(false)).WelcomeMessage, DebugApiVersion.v1_2_1 => (await beeDebugClient_1_2_1.WelcomeMessageGetAsync().ConfigureAwait(false)).WelcomeMessage, + DebugApiVersion.v2_0_0 => (await beeDebugClient_2_0_0.WelcomeMessageGetAsync().ConfigureAwait(false)).WelcomeMessage, _ => throw new InvalidOperationException() }; @@ -368,6 +410,7 @@ public async Task RebroadcastTransactionAsync(string txHash) => { DebugApiVersion.v1_2_0 => (await beeDebugClient_1_2_0.TransactionsPostAsync(txHash).ConfigureAwait(false)).TransactionHash, DebugApiVersion.v1_2_1 => (await beeDebugClient_1_2_1.TransactionsPostAsync(txHash).ConfigureAwait(false)).TransactionHash, + DebugApiVersion.v2_0_0 => (await beeDebugClient_2_0_0.TransactionsPostAsync(txHash).ConfigureAwait(false)).TransactionHash, _ => throw new InvalidOperationException() }; @@ -384,16 +427,22 @@ public async Task SetWelcomeMessageAsync(string welcomeMessage) => { WelcomeMessage = welcomeMessage }).ConfigureAwait(false)), + DebugApiVersion.v2_0_0 => new VersionDto(await beeDebugClient_2_0_0.WelcomeMessagePostAsync( + new DebugApi.V2_0_0.Body + { + WelcomeMessage = welcomeMessage + }).ConfigureAwait(false)), _ => throw new InvalidOperationException() }; public async Task TopUpPostageBatchAsync( string id, - int amount) => + long amount) => CurrentApiVersion switch { DebugApiVersion.v1_2_0 => ((JsonElement)(await beeDebugClient_1_2_0.StampsTopupAsync(id, amount).ConfigureAwait(false)).BatchID).ToString(), DebugApiVersion.v1_2_1 => (await beeDebugClient_1_2_1.StampsTopupAsync(id, amount).ConfigureAwait(false)).BatchID, + DebugApiVersion.v2_0_0 => (await beeDebugClient_2_0_0.StampsTopupAsync(id, amount).ConfigureAwait(false)).BatchID, _ => throw new InvalidOperationException() }; @@ -402,16 +451,18 @@ public async Task TryConnectToPeerAsync(string peerId) => { DebugApiVersion.v1_2_0 => (await beeDebugClient_1_2_0.PingpongAsync(peerId).ConfigureAwait(false)).Rtt, DebugApiVersion.v1_2_1 => (await beeDebugClient_1_2_1.PingpongAsync(peerId).ConfigureAwait(false)).Rtt, + DebugApiVersion.v2_0_0 => (await beeDebugClient_2_0_0.PingpongAsync(peerId).ConfigureAwait(false)).Rtt, _ => throw new InvalidOperationException() }; public async Task WithdrawFromChequeBookAsync( - int amount, - int? gasPrice = null) => + long amount, + long? gasPrice = null) => CurrentApiVersion switch { DebugApiVersion.v1_2_0 => (await beeDebugClient_1_2_0.ChequebookDepositAsync(amount, gasPrice).ConfigureAwait(false)).TransactionHash, DebugApiVersion.v1_2_1 => (await beeDebugClient_1_2_1.ChequebookDepositAsync(amount, gasPrice).ConfigureAwait(false)).TransactionHash, + DebugApiVersion.v2_0_0 => (await beeDebugClient_2_0_0.ChequebookDepositAsync(amount, gasPrice).ConfigureAwait(false)).TransactionHash, _ => throw new InvalidOperationException() }; } diff --git a/src/BeeNet/Clients/DebugApi/DebugApiVersion.cs b/src/BeeNet/Clients/DebugApi/DebugApiVersion.cs index 0ee6ae3f..ca438fe1 100644 --- a/src/BeeNet/Clients/DebugApi/DebugApiVersion.cs +++ b/src/BeeNet/Clients/DebugApi/DebugApiVersion.cs @@ -17,6 +17,7 @@ namespace Etherna.BeeNet.Clients.DebugApi public enum DebugApiVersion { v1_2_0, - v1_2_1 + v1_2_1, + v2_0_0 } } diff --git a/src/BeeNet/Clients/DebugApi/DtoFixer/PostageBatchDto.cs b/src/BeeNet/Clients/DebugApi/DtoFixer/PostageBatchDto.cs new file mode 100644 index 00000000..d456c3fa --- /dev/null +++ b/src/BeeNet/Clients/DebugApi/DtoFixer/PostageBatchDto.cs @@ -0,0 +1,67 @@ +// Copyright 2021-present Etherna Sagl +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +namespace Etherna.BeeNet.Clients.DebugApi.DtoFixer +{ + public class PostageBatchDto + { + /// + /// Internal debugging property. It indicates if the batch is expired. + /// + [System.Text.Json.Serialization.JsonPropertyName("exists")] + public bool Exists { get; set; } = default!; + + /// + /// The time (in seconds) remaining until the batch expires; -1 signals that the batch never expires; 0 signals that the batch has already expired. + /// + + [System.Text.Json.Serialization.JsonPropertyName("batchTTL")] + public int BatchTTL { get; set; } = default!; + + [System.Text.Json.Serialization.JsonPropertyName("batchID")] + public string BatchID { get; set; } = default!; + + [System.Text.Json.Serialization.JsonPropertyName("utilization")] + public int Utilization { get; set; } = default!; + + /// + /// Indicate that the batch was discovered by the Bee node, but it awaits enough on-chain confirmations before declaring the batch as usable. + /// + + [System.Text.Json.Serialization.JsonPropertyName("usable")] + public bool Usable { get; set; } = default!; + + [System.Text.Json.Serialization.JsonPropertyName("label")] + public string Label { get; set; } = default!; + + [System.Text.Json.Serialization.JsonPropertyName("depth")] + public int Depth { get; set; } = default!; + + /// + /// Numeric string that represents integer which might exceeds `Number.MAX_SAFE_INTEGER` limit (2^53-1) + /// + + [System.Text.Json.Serialization.JsonPropertyName("amount")] + public string Amount { get; set; } = default!; + + [System.Text.Json.Serialization.JsonPropertyName("bucketDepth")] + public int BucketDepth { get; set; } = default!; + + [System.Text.Json.Serialization.JsonPropertyName("blockNumber")] + public int BlockNumber { get; set; } = default!; + + [System.Text.Json.Serialization.JsonPropertyName("immutableFlag")] + public bool ImmutableFlag { get; set; } = default!; + } +} diff --git a/src/BeeNet/Clients/DebugApi/IBeeDebugClient.cs b/src/BeeNet/Clients/DebugApi/IBeeDebugClient.cs index 86a9679c..550eff89 100644 --- a/src/BeeNet/Clients/DebugApi/IBeeDebugClient.cs +++ b/src/BeeNet/Clients/DebugApi/IBeeDebugClient.cs @@ -32,11 +32,11 @@ public interface IBeeDebugClient /// Returns the newly created postage batch ID /// A server side error occurred. Task BuyPostageBatchAsync( - int amount, + long amount, int depth, string? label = null, bool? immutable = null, - int? gasPrice = null); + long? gasPrice = null); /// Cashout the last cheque for the peer /// Swarm address of peer @@ -46,7 +46,7 @@ Task BuyPostageBatchAsync( /// A server side error occurred. Task CashoutChequeForPeerAsync( string peerId, - int? gasPrice = null, + long? gasPrice = null, long? gasLimit = null); /// Connect to address @@ -74,7 +74,7 @@ Task CashoutChequeForPeerAsync( /// A server side error occurred. Task DeleteTransactionAsync( string txHash, - int? gasPrice = null); + long? gasPrice = null); /// Deposit tokens from overlay address into chequebook /// amount of tokens to deposit @@ -82,8 +82,8 @@ Task DeleteTransactionAsync( /// Transaction hash of the deposit transaction /// A server side error occurred. Task DepositIntoChequeBookAsync( - int amount, - int? gasPrice = null); + long amount, + long? gasPrice = null); /// Dilute an existing postage batch. /// Batch ID to dilute @@ -102,14 +102,6 @@ Task DepositIntoChequeBookAsync( /// A server side error occurred. Task> GetAllBalancesAsync(); - /// - /// Get all globally available batches that were purchased by all nodes. - /// - /// - /// Returns an array of all available and currently valid postage batches. - /// A server side error occurred. - Task> GetAllBatchesFromAllNodesAsync(); - /// Get last cheques for all peers /// Last cheques /// A server side error occurred. @@ -130,16 +122,19 @@ Task DepositIntoChequeBookAsync( /// A server side error occurred. Task GetAllSettlementsAsync(); - /// Get all available stamps for this node - /// Returns an array of all available postage batches. - /// A server side error occurred. - Task> GetAllStampsAsync(); - /// Get time based settlements with all known peers and total amount sent or received /// Time based settlements with all known peers and total amount sent or received /// A server side error occurred. Task GetAllTimeSettlementsAsync(); + /// + /// Get all globally available batches that were purchased by all nodes. + /// + /// + /// Returns an array of all available and currently valid postage batches. + /// A server side error occurred. + Task> GetAllValidPostageBatchesFromAllNodesAsync(); + /// Get the balances with a specific peer including prepaid services /// Swarm address of peer /// Balance with the specific peer @@ -202,6 +197,11 @@ Task DepositIntoChequeBookAsync( /// A server side error occurred. Task GetNodeInfoAsync(); + /// Get all owned postage batches by this node + /// List of all owned postage batches + /// A server side error occurred + Task> GetOwnedPostageBatchesByNodeAsync(); + /// Get list of pending transactions /// List of pending transactions /// A server side error occurred. @@ -211,7 +211,7 @@ Task DepositIntoChequeBookAsync( /// Swarm address of the stamp /// Returns an individual postage batch state /// A server side error occurred. - Task GetPostageBatchStatusAsync(string id); + Task GetPostageBatchAsync(string id); /// Get readiness state of node /// Health State of node @@ -272,7 +272,7 @@ Task DepositIntoChequeBookAsync( /// Amount of BZZ per chunk to top up to an existing postage batch. /// Returns the postage batch ID that was topped up /// A server side error occurred. - Task TopUpPostageBatchAsync(string id, int amount); + Task TopUpPostageBatchAsync(string id, long amount); /// Try connection to node /// Swarm address of peer @@ -286,7 +286,7 @@ Task DepositIntoChequeBookAsync( /// Transaction hash of the withdraw transaction /// A server side error occurred. Task WithdrawFromChequeBookAsync( - int amount, - int? gasPrice = null); + long amount, + long? gasPrice = null); } } diff --git a/src/BeeNet/Clients/DebugApi/V1_2_1/BeeDebugClient_1_2_1.cs b/src/BeeNet/Clients/DebugApi/V1_2_1/BeeDebugClient_1_2_1.cs index ee5d177a..7a0232ba 100644 --- a/src/BeeNet/Clients/DebugApi/V1_2_1/BeeDebugClient_1_2_1.cs +++ b/src/BeeNet/Clients/DebugApi/V1_2_1/BeeDebugClient_1_2_1.cs @@ -14,7 +14,7 @@ //---------------------- // -// Generated using the NSwag toolchain v13.15.7.0 (NJsonSchema v10.6.7.0 (Newtonsoft.Json v12.0.0.0)) (http://NSwag.org) +// Generated using the NSwag toolchain v13.15.9.0 (NJsonSchema v10.6.8.0 (Newtonsoft.Json v12.0.0.0)) (http://NSwag.org) // //---------------------- @@ -35,7 +35,7 @@ namespace Etherna.BeeNet.Clients.DebugApi.V1_2_1 { using System = global::System; - [System.CodeDom.Compiler.GeneratedCode("NSwag", "13.15.7.0 (NJsonSchema v10.6.7.0 (Newtonsoft.Json v12.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NSwag", "13.15.9.0 (NJsonSchema v10.6.8.0 (Newtonsoft.Json v12.0.0.0))")] public partial interface IBeeDebugClient_1_2_1 { @@ -262,7 +262,7 @@ public partial interface IBeeDebugClient_1_2_1 /// Gas limit for transaction /// OK /// A server side error occurred. - System.Threading.Tasks.Task ChequebookCashoutPostAsync(string peer_id, int? gas_price = null, long? gas_limit = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task ChequebookCashoutPostAsync(string peer_id, long? gas_price = null, long? gas_limit = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// @@ -289,7 +289,7 @@ public partial interface IBeeDebugClient_1_2_1 /// Gas price for transaction /// Transaction hash of the deposit transaction /// A server side error occurred. - System.Threading.Tasks.Task ChequebookDepositAsync(int amount, int? gas_price = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task ChequebookDepositAsync(long amount, long? gas_price = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// @@ -299,7 +299,7 @@ public partial interface IBeeDebugClient_1_2_1 /// Gas price for transaction /// Transaction hash of the withdraw transaction /// A server side error occurred. - System.Threading.Tasks.Task ChequebookWithdrawAsync(int amount, int? gas_price = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task ChequebookWithdrawAsync(long amount, long? gas_price = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// @@ -344,7 +344,7 @@ public partial interface IBeeDebugClient_1_2_1 /// Gas price for transaction /// Hash of the transaction /// A server side error occurred. - System.Threading.Tasks.Task TransactionsDeleteAsync(string txHash, int? gas_price = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task TransactionsDeleteAsync(string txHash, long? gas_price = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// @@ -382,7 +382,7 @@ public partial interface IBeeDebugClient_1_2_1 /// Gas price for transaction /// Returns the newly created postage batch ID /// A server side error occurred. - System.Threading.Tasks.Task StampsPostAsync(int amount, int depth, string? label = null, bool? immutable = null, int? gas_price = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task StampsPostAsync(long amount, int depth, string? label = null, bool? immutable = null, long? gas_price = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// @@ -392,7 +392,7 @@ public partial interface IBeeDebugClient_1_2_1 /// Amount of BZZ per chunk to top up to an existing postage batch. /// Returns the postage batch ID that was topped up /// A server side error occurred. - System.Threading.Tasks.Task StampsTopupAsync(string id, int amount, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task StampsTopupAsync(string id, long amount, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// @@ -414,7 +414,7 @@ public partial interface IBeeDebugClient_1_2_1 } - [System.CodeDom.Compiler.GeneratedCode("NSwag", "13.15.7.0 (NJsonSchema v10.6.7.0 (Newtonsoft.Json v12.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NSwag", "13.15.9.0 (NJsonSchema v10.6.8.0 (Newtonsoft.Json v12.0.0.0))")] public partial class BeeDebugClient_1_2_1 : IBeeDebugClient_1_2_1 { private string _baseUrl = "http://{apiRoot}:{port}"; @@ -2614,7 +2614,7 @@ public string BaseUrl /// Gas limit for transaction /// OK /// A server side error occurred. - public virtual async System.Threading.Tasks.Task ChequebookCashoutPostAsync(string peer_id, int? gas_price = null, long? gas_limit = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public virtual async System.Threading.Tasks.Task ChequebookCashoutPostAsync(string peer_id, long? gas_price = null, long? gas_limit = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { if (peer_id == null) throw new System.ArgumentNullException("peer_id"); @@ -2912,7 +2912,7 @@ public string BaseUrl /// Gas price for transaction /// Transaction hash of the deposit transaction /// A server side error occurred. - public virtual async System.Threading.Tasks.Task ChequebookDepositAsync(int amount, int? gas_price = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public virtual async System.Threading.Tasks.Task ChequebookDepositAsync(long amount, long? gas_price = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { if (amount == null) throw new System.ArgumentNullException("amount"); @@ -3013,7 +3013,7 @@ public string BaseUrl /// Gas price for transaction /// Transaction hash of the withdraw transaction /// A server side error occurred. - public virtual async System.Threading.Tasks.Task ChequebookWithdrawAsync(int amount, int? gas_price = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public virtual async System.Threading.Tasks.Task ChequebookWithdrawAsync(long amount, long? gas_price = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { if (amount == null) throw new System.ArgumentNullException("amount"); @@ -3480,7 +3480,7 @@ public string BaseUrl /// Gas price for transaction /// Hash of the transaction /// A server side error occurred. - public virtual async System.Threading.Tasks.Task TransactionsDeleteAsync(string txHash, int? gas_price = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public virtual async System.Threading.Tasks.Task TransactionsDeleteAsync(string txHash, long? gas_price = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { if (txHash == null) throw new System.ArgumentNullException("txHash"); @@ -3821,7 +3821,7 @@ public string BaseUrl /// Gas price for transaction /// Returns the newly created postage batch ID /// A server side error occurred. - public virtual async System.Threading.Tasks.Task StampsPostAsync(int amount, int depth, string? label = null, bool? immutable = null, int? gas_price = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public virtual async System.Threading.Tasks.Task StampsPostAsync(long amount, int depth, string? label = null, bool? immutable = null, long? gas_price = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { if (amount == null) throw new System.ArgumentNullException("amount"); @@ -3943,7 +3943,7 @@ public string BaseUrl /// Amount of BZZ per chunk to top up to an existing postage batch. /// Returns the postage batch ID that was topped up /// A server side error occurred. - public virtual async System.Threading.Tasks.Task StampsTopupAsync(string id, int amount, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public virtual async System.Threading.Tasks.Task StampsTopupAsync(string id, long amount, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { if (id == null) throw new System.ArgumentNullException("id"); @@ -4337,7 +4337,7 @@ private string ConvertToString(object? value, System.Globalization.CultureInfo c } } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.7.0 (NJsonSchema v10.6.7.0 (Newtonsoft.Json v12.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.9.0 (NJsonSchema v10.6.8.0 (Newtonsoft.Json v12.0.0.0))")] public partial class Body { @@ -4355,7 +4355,7 @@ public System.Collections.Generic.IDictionary AdditionalProperti } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.7.0 (NJsonSchema v10.6.7.0 (Newtonsoft.Json v12.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.9.0 (NJsonSchema v10.6.8.0 (Newtonsoft.Json v12.0.0.0))")] public partial class Response { @@ -4389,7 +4389,7 @@ public System.Collections.Generic.IDictionary AdditionalProperti } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.7.0 (NJsonSchema v10.6.7.0 (Newtonsoft.Json v12.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.9.0 (NJsonSchema v10.6.8.0 (Newtonsoft.Json v12.0.0.0))")] public partial class Response2 { @@ -4407,7 +4407,7 @@ public System.Collections.Generic.IDictionary AdditionalProperti } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.7.0 (NJsonSchema v10.6.7.0 (Newtonsoft.Json v12.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.9.0 (NJsonSchema v10.6.8.0 (Newtonsoft.Json v12.0.0.0))")] public partial class Response3 { @@ -4433,7 +4433,7 @@ public System.Collections.Generic.IDictionary AdditionalProperti } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.7.0 (NJsonSchema v10.6.7.0 (Newtonsoft.Json v12.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.9.0 (NJsonSchema v10.6.8.0 (Newtonsoft.Json v12.0.0.0))")] public partial class Response4 { @@ -4451,7 +4451,7 @@ public System.Collections.Generic.IDictionary AdditionalProperti } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.7.0 (NJsonSchema v10.6.7.0 (Newtonsoft.Json v12.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.9.0 (NJsonSchema v10.6.8.0 (Newtonsoft.Json v12.0.0.0))")] public partial class Response5 { @@ -4469,7 +4469,7 @@ public System.Collections.Generic.IDictionary AdditionalProperti } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.7.0 (NJsonSchema v10.6.7.0 (Newtonsoft.Json v12.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.9.0 (NJsonSchema v10.6.8.0 (Newtonsoft.Json v12.0.0.0))")] public partial class Response6 { @@ -4495,7 +4495,7 @@ public System.Collections.Generic.IDictionary AdditionalProperti } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.7.0 (NJsonSchema v10.6.7.0 (Newtonsoft.Json v12.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.9.0 (NJsonSchema v10.6.8.0 (Newtonsoft.Json v12.0.0.0))")] public partial class Response7 { @@ -4514,7 +4514,7 @@ public System.Collections.Generic.IDictionary AdditionalProperti } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.7.0 (NJsonSchema v10.6.7.0 (Newtonsoft.Json v12.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.9.0 (NJsonSchema v10.6.8.0 (Newtonsoft.Json v12.0.0.0))")] public partial class Response8 { /// @@ -4542,7 +4542,7 @@ public System.Collections.Generic.IDictionary AdditionalProperti } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.7.0 (NJsonSchema v10.6.7.0 (Newtonsoft.Json v12.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.9.0 (NJsonSchema v10.6.8.0 (Newtonsoft.Json v12.0.0.0))")] public partial class Response9 { @@ -4563,7 +4563,7 @@ public System.Collections.Generic.IDictionary AdditionalProperti } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.7.0 (NJsonSchema v10.6.7.0 (Newtonsoft.Json v12.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.9.0 (NJsonSchema v10.6.8.0 (Newtonsoft.Json v12.0.0.0))")] public partial class Response10 { @@ -4584,7 +4584,7 @@ public System.Collections.Generic.IDictionary AdditionalProperti } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.7.0 (NJsonSchema v10.6.7.0 (Newtonsoft.Json v12.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.9.0 (NJsonSchema v10.6.8.0 (Newtonsoft.Json v12.0.0.0))")] public partial class Response11 { @@ -4603,7 +4603,7 @@ public System.Collections.Generic.IDictionary AdditionalProperti } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.7.0 (NJsonSchema v10.6.7.0 (Newtonsoft.Json v12.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.9.0 (NJsonSchema v10.6.8.0 (Newtonsoft.Json v12.0.0.0))")] public partial class Response12 { @@ -4638,7 +4638,7 @@ public System.Collections.Generic.IDictionary AdditionalProperti } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.7.0 (NJsonSchema v10.6.7.0 (Newtonsoft.Json v12.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.9.0 (NJsonSchema v10.6.8.0 (Newtonsoft.Json v12.0.0.0))")] public partial class Response13 { @@ -4662,7 +4662,7 @@ public System.Collections.Generic.IDictionary AdditionalProperti } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.7.0 (NJsonSchema v10.6.7.0 (Newtonsoft.Json v12.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.9.0 (NJsonSchema v10.6.8.0 (Newtonsoft.Json v12.0.0.0))")] public partial class Response14 { /// @@ -4694,7 +4694,7 @@ public System.Collections.Generic.IDictionary AdditionalProperti } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.7.0 (NJsonSchema v10.6.7.0 (Newtonsoft.Json v12.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.9.0 (NJsonSchema v10.6.8.0 (Newtonsoft.Json v12.0.0.0))")] public partial class Response15 { @@ -4729,7 +4729,7 @@ public System.Collections.Generic.IDictionary AdditionalProperti } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.7.0 (NJsonSchema v10.6.7.0 (Newtonsoft.Json v12.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.9.0 (NJsonSchema v10.6.8.0 (Newtonsoft.Json v12.0.0.0))")] public partial class Response16 { @@ -4747,7 +4747,7 @@ public System.Collections.Generic.IDictionary AdditionalProperti } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.7.0 (NJsonSchema v10.6.7.0 (Newtonsoft.Json v12.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.9.0 (NJsonSchema v10.6.8.0 (Newtonsoft.Json v12.0.0.0))")] public partial class Response17 { @@ -4768,7 +4768,7 @@ public System.Collections.Generic.IDictionary AdditionalProperti } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.7.0 (NJsonSchema v10.6.7.0 (Newtonsoft.Json v12.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.9.0 (NJsonSchema v10.6.8.0 (Newtonsoft.Json v12.0.0.0))")] public partial class Response18 { /// @@ -4789,7 +4789,7 @@ public System.Collections.Generic.IDictionary AdditionalProperti } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.7.0 (NJsonSchema v10.6.7.0 (Newtonsoft.Json v12.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.9.0 (NJsonSchema v10.6.8.0 (Newtonsoft.Json v12.0.0.0))")] public partial class Response19 { @@ -4824,7 +4824,7 @@ public System.Collections.Generic.IDictionary AdditionalProperti } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.7.0 (NJsonSchema v10.6.7.0 (Newtonsoft.Json v12.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.9.0 (NJsonSchema v10.6.8.0 (Newtonsoft.Json v12.0.0.0))")] public partial class Response20 { @@ -4849,7 +4849,7 @@ public System.Collections.Generic.IDictionary AdditionalProperti } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.7.0 (NJsonSchema v10.6.7.0 (Newtonsoft.Json v12.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.9.0 (NJsonSchema v10.6.8.0 (Newtonsoft.Json v12.0.0.0))")] public partial class Response21 { @@ -4873,7 +4873,7 @@ public System.Collections.Generic.IDictionary AdditionalProperti } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.7.0 (NJsonSchema v10.6.7.0 (Newtonsoft.Json v12.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.9.0 (NJsonSchema v10.6.8.0 (Newtonsoft.Json v12.0.0.0))")] public partial class Response22 { @@ -4897,7 +4897,7 @@ public System.Collections.Generic.IDictionary AdditionalProperti } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.7.0 (NJsonSchema v10.6.7.0 (Newtonsoft.Json v12.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.9.0 (NJsonSchema v10.6.8.0 (Newtonsoft.Json v12.0.0.0))")] public partial class Response23 { @@ -4934,7 +4934,7 @@ public System.Collections.Generic.IDictionary AdditionalProperti } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.7.0 (NJsonSchema v10.6.7.0 (Newtonsoft.Json v12.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.9.0 (NJsonSchema v10.6.8.0 (Newtonsoft.Json v12.0.0.0))")] public partial class Response24 { @@ -4952,7 +4952,7 @@ public System.Collections.Generic.IDictionary AdditionalProperti } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.7.0 (NJsonSchema v10.6.7.0 (Newtonsoft.Json v12.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.9.0 (NJsonSchema v10.6.8.0 (Newtonsoft.Json v12.0.0.0))")] public partial class Response25 { @@ -4987,7 +4987,7 @@ public System.Collections.Generic.IDictionary AdditionalProperti } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.7.0 (NJsonSchema v10.6.7.0 (Newtonsoft.Json v12.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.9.0 (NJsonSchema v10.6.8.0 (Newtonsoft.Json v12.0.0.0))")] public partial class Response26 { @@ -5023,7 +5023,7 @@ public System.Collections.Generic.IDictionary AdditionalProperti } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.7.0 (NJsonSchema v10.6.7.0 (Newtonsoft.Json v12.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.9.0 (NJsonSchema v10.6.8.0 (Newtonsoft.Json v12.0.0.0))")] public partial class Response27 { @@ -5042,7 +5042,7 @@ public System.Collections.Generic.IDictionary AdditionalProperti } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.7.0 (NJsonSchema v10.6.7.0 (Newtonsoft.Json v12.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.9.0 (NJsonSchema v10.6.8.0 (Newtonsoft.Json v12.0.0.0))")] public partial class Response28 { @@ -5067,7 +5067,7 @@ public System.Collections.Generic.IDictionary AdditionalProperti } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.7.0 (NJsonSchema v10.6.7.0 (Newtonsoft.Json v12.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.9.0 (NJsonSchema v10.6.8.0 (Newtonsoft.Json v12.0.0.0))")] public partial class Response29 { @@ -5085,7 +5085,7 @@ public System.Collections.Generic.IDictionary AdditionalProperti } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.7.0 (NJsonSchema v10.6.7.0 (Newtonsoft.Json v12.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.9.0 (NJsonSchema v10.6.8.0 (Newtonsoft.Json v12.0.0.0))")] public partial class Response30 { @@ -5104,7 +5104,7 @@ public System.Collections.Generic.IDictionary AdditionalProperti } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.7.0 (NJsonSchema v10.6.7.0 (Newtonsoft.Json v12.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.9.0 (NJsonSchema v10.6.8.0 (Newtonsoft.Json v12.0.0.0))")] public partial class Response31 { @@ -5123,7 +5123,7 @@ public System.Collections.Generic.IDictionary AdditionalProperti } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.7.0 (NJsonSchema v10.6.7.0 (Newtonsoft.Json v12.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.9.0 (NJsonSchema v10.6.8.0 (Newtonsoft.Json v12.0.0.0))")] public partial class Response32 { @@ -5166,7 +5166,7 @@ public System.Collections.Generic.IDictionary AdditionalProperti } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.7.0 (NJsonSchema v10.6.7.0 (Newtonsoft.Json v12.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.9.0 (NJsonSchema v10.6.8.0 (Newtonsoft.Json v12.0.0.0))")] public partial class Response33 { @@ -5184,7 +5184,7 @@ public System.Collections.Generic.IDictionary AdditionalProperti } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.7.0 (NJsonSchema v10.6.7.0 (Newtonsoft.Json v12.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.9.0 (NJsonSchema v10.6.8.0 (Newtonsoft.Json v12.0.0.0))")] public partial class Response34 { @@ -5207,7 +5207,7 @@ public partial class Response34 public string GasPrice { get; set; } = default!; [System.Text.Json.Serialization.JsonPropertyName("gasLimit")] - public int GasLimit { get; set; } = default!; + public long GasLimit { get; set; } = default!; [System.Text.Json.Serialization.JsonPropertyName("data")] public string Data { get; set; } = default!; @@ -5236,7 +5236,7 @@ public System.Collections.Generic.IDictionary AdditionalProperti } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.7.0 (NJsonSchema v10.6.7.0 (Newtonsoft.Json v12.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.9.0 (NJsonSchema v10.6.8.0 (Newtonsoft.Json v12.0.0.0))")] public partial class Response35 { @@ -5255,7 +5255,7 @@ public System.Collections.Generic.IDictionary AdditionalProperti } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.7.0 (NJsonSchema v10.6.7.0 (Newtonsoft.Json v12.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.9.0 (NJsonSchema v10.6.8.0 (Newtonsoft.Json v12.0.0.0))")] public partial class Response36 { @@ -5274,7 +5274,7 @@ public System.Collections.Generic.IDictionary AdditionalProperti } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.7.0 (NJsonSchema v10.6.7.0 (Newtonsoft.Json v12.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.9.0 (NJsonSchema v10.6.8.0 (Newtonsoft.Json v12.0.0.0))")] public partial class Response37 { @@ -5292,7 +5292,7 @@ public System.Collections.Generic.IDictionary AdditionalProperti } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.7.0 (NJsonSchema v10.6.7.0 (Newtonsoft.Json v12.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.9.0 (NJsonSchema v10.6.8.0 (Newtonsoft.Json v12.0.0.0))")] public partial class Response38 : Anonymous2 { /// @@ -5311,7 +5311,7 @@ public partial class Response38 : Anonymous2 } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.7.0 (NJsonSchema v10.6.7.0 (Newtonsoft.Json v12.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.9.0 (NJsonSchema v10.6.8.0 (Newtonsoft.Json v12.0.0.0))")] public partial class Response39 { @@ -5338,7 +5338,7 @@ public System.Collections.Generic.IDictionary AdditionalProperti } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.7.0 (NJsonSchema v10.6.7.0 (Newtonsoft.Json v12.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.9.0 (NJsonSchema v10.6.8.0 (Newtonsoft.Json v12.0.0.0))")] public partial class Response40 { @@ -5357,7 +5357,7 @@ public System.Collections.Generic.IDictionary AdditionalProperti } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.7.0 (NJsonSchema v10.6.7.0 (Newtonsoft.Json v12.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.9.0 (NJsonSchema v10.6.8.0 (Newtonsoft.Json v12.0.0.0))")] public partial class Response41 { @@ -5376,7 +5376,7 @@ public System.Collections.Generic.IDictionary AdditionalProperti } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.7.0 (NJsonSchema v10.6.7.0 (Newtonsoft.Json v12.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.9.0 (NJsonSchema v10.6.8.0 (Newtonsoft.Json v12.0.0.0))")] public partial class Response42 { @@ -5395,7 +5395,7 @@ public System.Collections.Generic.IDictionary AdditionalProperti } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.7.0 (NJsonSchema v10.6.7.0 (Newtonsoft.Json v12.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.9.0 (NJsonSchema v10.6.8.0 (Newtonsoft.Json v12.0.0.0))")] public partial class Response43 { @@ -5413,7 +5413,7 @@ public System.Collections.Generic.IDictionary AdditionalProperti } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.7.0 (NJsonSchema v10.6.7.0 (Newtonsoft.Json v12.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.9.0 (NJsonSchema v10.6.8.0 (Newtonsoft.Json v12.0.0.0))")] public partial class Response44 { @@ -5434,7 +5434,7 @@ public System.Collections.Generic.IDictionary AdditionalProperti } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.7.0 (NJsonSchema v10.6.7.0 (Newtonsoft.Json v12.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.9.0 (NJsonSchema v10.6.8.0 (Newtonsoft.Json v12.0.0.0))")] public partial class Response45 { @@ -5455,7 +5455,7 @@ public System.Collections.Generic.IDictionary AdditionalProperti } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.7.0 (NJsonSchema v10.6.7.0 (Newtonsoft.Json v12.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.9.0 (NJsonSchema v10.6.8.0 (Newtonsoft.Json v12.0.0.0))")] public partial class Response46 { @@ -5476,7 +5476,7 @@ public System.Collections.Generic.IDictionary AdditionalProperti } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.7.0 (NJsonSchema v10.6.7.0 (Newtonsoft.Json v12.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.9.0 (NJsonSchema v10.6.8.0 (Newtonsoft.Json v12.0.0.0))")] public partial class Response47 { @@ -5497,7 +5497,7 @@ public System.Collections.Generic.IDictionary AdditionalProperti } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.7.0 (NJsonSchema v10.6.7.0 (Newtonsoft.Json v12.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.9.0 (NJsonSchema v10.6.8.0 (Newtonsoft.Json v12.0.0.0))")] public partial class Response48 { @@ -5518,7 +5518,7 @@ public System.Collections.Generic.IDictionary AdditionalProperti } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.7.0 (NJsonSchema v10.6.7.0 (Newtonsoft.Json v12.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.9.0 (NJsonSchema v10.6.8.0 (Newtonsoft.Json v12.0.0.0))")] public partial class Response49 { @@ -5539,7 +5539,7 @@ public System.Collections.Generic.IDictionary AdditionalProperti } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.7.0 (NJsonSchema v10.6.7.0 (Newtonsoft.Json v12.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.9.0 (NJsonSchema v10.6.8.0 (Newtonsoft.Json v12.0.0.0))")] public partial class Response50 { @@ -5560,7 +5560,7 @@ public System.Collections.Generic.IDictionary AdditionalProperti } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.7.0 (NJsonSchema v10.6.7.0 (Newtonsoft.Json v12.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.9.0 (NJsonSchema v10.6.8.0 (Newtonsoft.Json v12.0.0.0))")] public partial class Response51 { @@ -5581,7 +5581,7 @@ public System.Collections.Generic.IDictionary AdditionalProperti } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.7.0 (NJsonSchema v10.6.7.0 (Newtonsoft.Json v12.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.9.0 (NJsonSchema v10.6.8.0 (Newtonsoft.Json v12.0.0.0))")] public partial class Response52 { @@ -5602,7 +5602,7 @@ public System.Collections.Generic.IDictionary AdditionalProperti } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.7.0 (NJsonSchema v10.6.7.0 (Newtonsoft.Json v12.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.9.0 (NJsonSchema v10.6.8.0 (Newtonsoft.Json v12.0.0.0))")] public partial class Response53 { @@ -5623,7 +5623,7 @@ public System.Collections.Generic.IDictionary AdditionalProperti } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.7.0 (NJsonSchema v10.6.7.0 (Newtonsoft.Json v12.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.9.0 (NJsonSchema v10.6.8.0 (Newtonsoft.Json v12.0.0.0))")] public partial class Response54 { @@ -5644,7 +5644,7 @@ public System.Collections.Generic.IDictionary AdditionalProperti } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.7.0 (NJsonSchema v10.6.7.0 (Newtonsoft.Json v12.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.9.0 (NJsonSchema v10.6.8.0 (Newtonsoft.Json v12.0.0.0))")] public partial class Response55 { @@ -5665,7 +5665,7 @@ public System.Collections.Generic.IDictionary AdditionalProperti } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.7.0 (NJsonSchema v10.6.7.0 (Newtonsoft.Json v12.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.9.0 (NJsonSchema v10.6.8.0 (Newtonsoft.Json v12.0.0.0))")] public partial class Response56 { @@ -5686,7 +5686,7 @@ public System.Collections.Generic.IDictionary AdditionalProperti } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.7.0 (NJsonSchema v10.6.7.0 (Newtonsoft.Json v12.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.9.0 (NJsonSchema v10.6.8.0 (Newtonsoft.Json v12.0.0.0))")] public partial class Response57 { @@ -5707,7 +5707,7 @@ public System.Collections.Generic.IDictionary AdditionalProperti } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.7.0 (NJsonSchema v10.6.7.0 (Newtonsoft.Json v12.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.9.0 (NJsonSchema v10.6.8.0 (Newtonsoft.Json v12.0.0.0))")] public partial class Response58 { @@ -5728,7 +5728,7 @@ public System.Collections.Generic.IDictionary AdditionalProperti } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.7.0 (NJsonSchema v10.6.7.0 (Newtonsoft.Json v12.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.9.0 (NJsonSchema v10.6.8.0 (Newtonsoft.Json v12.0.0.0))")] public partial class Response59 { @@ -5749,7 +5749,7 @@ public System.Collections.Generic.IDictionary AdditionalProperti } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.7.0 (NJsonSchema v10.6.7.0 (Newtonsoft.Json v12.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.9.0 (NJsonSchema v10.6.8.0 (Newtonsoft.Json v12.0.0.0))")] public partial class Response60 { @@ -5770,7 +5770,7 @@ public System.Collections.Generic.IDictionary AdditionalProperti } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.7.0 (NJsonSchema v10.6.7.0 (Newtonsoft.Json v12.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.9.0 (NJsonSchema v10.6.8.0 (Newtonsoft.Json v12.0.0.0))")] public partial class Response61 { @@ -5791,7 +5791,7 @@ public System.Collections.Generic.IDictionary AdditionalProperti } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.7.0 (NJsonSchema v10.6.7.0 (Newtonsoft.Json v12.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.9.0 (NJsonSchema v10.6.8.0 (Newtonsoft.Json v12.0.0.0))")] public partial class Response62 { @@ -5812,7 +5812,7 @@ public System.Collections.Generic.IDictionary AdditionalProperti } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.7.0 (NJsonSchema v10.6.7.0 (Newtonsoft.Json v12.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.9.0 (NJsonSchema v10.6.8.0 (Newtonsoft.Json v12.0.0.0))")] public partial class Response63 { @@ -5833,7 +5833,7 @@ public System.Collections.Generic.IDictionary AdditionalProperti } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.7.0 (NJsonSchema v10.6.7.0 (Newtonsoft.Json v12.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.9.0 (NJsonSchema v10.6.8.0 (Newtonsoft.Json v12.0.0.0))")] public partial class Response64 { @@ -5854,7 +5854,7 @@ public System.Collections.Generic.IDictionary AdditionalProperti } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.7.0 (NJsonSchema v10.6.7.0 (Newtonsoft.Json v12.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.9.0 (NJsonSchema v10.6.8.0 (Newtonsoft.Json v12.0.0.0))")] public partial class Response65 { @@ -5875,7 +5875,7 @@ public System.Collections.Generic.IDictionary AdditionalProperti } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.7.0 (NJsonSchema v10.6.7.0 (Newtonsoft.Json v12.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.9.0 (NJsonSchema v10.6.8.0 (Newtonsoft.Json v12.0.0.0))")] public partial class Response66 { @@ -5896,7 +5896,7 @@ public System.Collections.Generic.IDictionary AdditionalProperti } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.7.0 (NJsonSchema v10.6.7.0 (Newtonsoft.Json v12.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.9.0 (NJsonSchema v10.6.8.0 (Newtonsoft.Json v12.0.0.0))")] public partial class Response67 { @@ -5917,7 +5917,7 @@ public System.Collections.Generic.IDictionary AdditionalProperti } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.7.0 (NJsonSchema v10.6.7.0 (Newtonsoft.Json v12.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.9.0 (NJsonSchema v10.6.8.0 (Newtonsoft.Json v12.0.0.0))")] public partial class Response68 { @@ -5938,7 +5938,7 @@ public System.Collections.Generic.IDictionary AdditionalProperti } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.7.0 (NJsonSchema v10.6.7.0 (Newtonsoft.Json v12.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.9.0 (NJsonSchema v10.6.8.0 (Newtonsoft.Json v12.0.0.0))")] public partial class Response69 { @@ -5959,7 +5959,7 @@ public System.Collections.Generic.IDictionary AdditionalProperti } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.7.0 (NJsonSchema v10.6.7.0 (Newtonsoft.Json v12.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.9.0 (NJsonSchema v10.6.8.0 (Newtonsoft.Json v12.0.0.0))")] public partial class Response70 { @@ -5980,7 +5980,7 @@ public System.Collections.Generic.IDictionary AdditionalProperti } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.7.0 (NJsonSchema v10.6.7.0 (Newtonsoft.Json v12.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.9.0 (NJsonSchema v10.6.8.0 (Newtonsoft.Json v12.0.0.0))")] public partial class Response71 { @@ -6001,7 +6001,7 @@ public System.Collections.Generic.IDictionary AdditionalProperti } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.7.0 (NJsonSchema v10.6.7.0 (Newtonsoft.Json v12.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.9.0 (NJsonSchema v10.6.8.0 (Newtonsoft.Json v12.0.0.0))")] public partial class Response72 { @@ -6022,7 +6022,7 @@ public System.Collections.Generic.IDictionary AdditionalProperti } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.7.0 (NJsonSchema v10.6.7.0 (Newtonsoft.Json v12.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.9.0 (NJsonSchema v10.6.8.0 (Newtonsoft.Json v12.0.0.0))")] public partial class Response73 { @@ -6043,7 +6043,7 @@ public System.Collections.Generic.IDictionary AdditionalProperti } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.7.0 (NJsonSchema v10.6.7.0 (Newtonsoft.Json v12.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.9.0 (NJsonSchema v10.6.8.0 (Newtonsoft.Json v12.0.0.0))")] public partial class Response74 { @@ -6064,7 +6064,7 @@ public System.Collections.Generic.IDictionary AdditionalProperti } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.7.0 (NJsonSchema v10.6.7.0 (Newtonsoft.Json v12.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.9.0 (NJsonSchema v10.6.8.0 (Newtonsoft.Json v12.0.0.0))")] public partial class Response75 { @@ -6085,7 +6085,7 @@ public System.Collections.Generic.IDictionary AdditionalProperti } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.7.0 (NJsonSchema v10.6.7.0 (Newtonsoft.Json v12.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.9.0 (NJsonSchema v10.6.8.0 (Newtonsoft.Json v12.0.0.0))")] public partial class Response76 { @@ -6106,7 +6106,7 @@ public System.Collections.Generic.IDictionary AdditionalProperti } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.7.0 (NJsonSchema v10.6.7.0 (Newtonsoft.Json v12.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.9.0 (NJsonSchema v10.6.8.0 (Newtonsoft.Json v12.0.0.0))")] public partial class Response77 { @@ -6127,7 +6127,7 @@ public System.Collections.Generic.IDictionary AdditionalProperti } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.7.0 (NJsonSchema v10.6.7.0 (Newtonsoft.Json v12.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.9.0 (NJsonSchema v10.6.8.0 (Newtonsoft.Json v12.0.0.0))")] public partial class Response78 { @@ -6148,7 +6148,7 @@ public System.Collections.Generic.IDictionary AdditionalProperti } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.7.0 (NJsonSchema v10.6.7.0 (Newtonsoft.Json v12.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.9.0 (NJsonSchema v10.6.8.0 (Newtonsoft.Json v12.0.0.0))")] public partial class Response79 { @@ -6169,7 +6169,7 @@ public System.Collections.Generic.IDictionary AdditionalProperti } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.7.0 (NJsonSchema v10.6.7.0 (Newtonsoft.Json v12.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.9.0 (NJsonSchema v10.6.8.0 (Newtonsoft.Json v12.0.0.0))")] public partial class Response80 { @@ -6190,7 +6190,7 @@ public System.Collections.Generic.IDictionary AdditionalProperti } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.7.0 (NJsonSchema v10.6.7.0 (Newtonsoft.Json v12.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.9.0 (NJsonSchema v10.6.8.0 (Newtonsoft.Json v12.0.0.0))")] public partial class Response81 { @@ -6211,7 +6211,7 @@ public System.Collections.Generic.IDictionary AdditionalProperti } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.7.0 (NJsonSchema v10.6.7.0 (Newtonsoft.Json v12.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.9.0 (NJsonSchema v10.6.8.0 (Newtonsoft.Json v12.0.0.0))")] public partial class Response82 { @@ -6232,7 +6232,7 @@ public System.Collections.Generic.IDictionary AdditionalProperti } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.7.0 (NJsonSchema v10.6.7.0 (Newtonsoft.Json v12.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.9.0 (NJsonSchema v10.6.8.0 (Newtonsoft.Json v12.0.0.0))")] public partial class Response83 { @@ -6253,7 +6253,7 @@ public System.Collections.Generic.IDictionary AdditionalProperti } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.7.0 (NJsonSchema v10.6.7.0 (Newtonsoft.Json v12.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.9.0 (NJsonSchema v10.6.8.0 (Newtonsoft.Json v12.0.0.0))")] public partial class Response84 { @@ -6274,7 +6274,7 @@ public System.Collections.Generic.IDictionary AdditionalProperti } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.7.0 (NJsonSchema v10.6.7.0 (Newtonsoft.Json v12.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.9.0 (NJsonSchema v10.6.8.0 (Newtonsoft.Json v12.0.0.0))")] public partial class Response85 { @@ -6295,7 +6295,7 @@ public System.Collections.Generic.IDictionary AdditionalProperti } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.7.0 (NJsonSchema v10.6.7.0 (Newtonsoft.Json v12.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.9.0 (NJsonSchema v10.6.8.0 (Newtonsoft.Json v12.0.0.0))")] public partial class Response86 { @@ -6316,7 +6316,7 @@ public System.Collections.Generic.IDictionary AdditionalProperti } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.7.0 (NJsonSchema v10.6.7.0 (Newtonsoft.Json v12.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.9.0 (NJsonSchema v10.6.8.0 (Newtonsoft.Json v12.0.0.0))")] public partial class Response87 { @@ -6337,7 +6337,7 @@ public System.Collections.Generic.IDictionary AdditionalProperti } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.7.0 (NJsonSchema v10.6.7.0 (Newtonsoft.Json v12.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.9.0 (NJsonSchema v10.6.8.0 (Newtonsoft.Json v12.0.0.0))")] public partial class Response88 { @@ -6358,7 +6358,7 @@ public System.Collections.Generic.IDictionary AdditionalProperti } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.7.0 (NJsonSchema v10.6.7.0 (Newtonsoft.Json v12.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.9.0 (NJsonSchema v10.6.8.0 (Newtonsoft.Json v12.0.0.0))")] public partial class Response89 { @@ -6379,7 +6379,7 @@ public System.Collections.Generic.IDictionary AdditionalProperti } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.7.0 (NJsonSchema v10.6.7.0 (Newtonsoft.Json v12.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.9.0 (NJsonSchema v10.6.8.0 (Newtonsoft.Json v12.0.0.0))")] public partial class Response90 { @@ -6400,7 +6400,7 @@ public System.Collections.Generic.IDictionary AdditionalProperti } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.7.0 (NJsonSchema v10.6.7.0 (Newtonsoft.Json v12.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.9.0 (NJsonSchema v10.6.8.0 (Newtonsoft.Json v12.0.0.0))")] public partial class Response91 { @@ -6421,7 +6421,7 @@ public System.Collections.Generic.IDictionary AdditionalProperti } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.7.0 (NJsonSchema v10.6.7.0 (Newtonsoft.Json v12.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.9.0 (NJsonSchema v10.6.8.0 (Newtonsoft.Json v12.0.0.0))")] public partial class Response92 { @@ -6442,7 +6442,7 @@ public System.Collections.Generic.IDictionary AdditionalProperti } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.7.0 (NJsonSchema v10.6.7.0 (Newtonsoft.Json v12.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.9.0 (NJsonSchema v10.6.8.0 (Newtonsoft.Json v12.0.0.0))")] public partial class Response93 { @@ -6463,7 +6463,7 @@ public System.Collections.Generic.IDictionary AdditionalProperti } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.7.0 (NJsonSchema v10.6.7.0 (Newtonsoft.Json v12.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.9.0 (NJsonSchema v10.6.8.0 (Newtonsoft.Json v12.0.0.0))")] public partial class Response94 { @@ -6484,7 +6484,7 @@ public System.Collections.Generic.IDictionary AdditionalProperti } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.7.0 (NJsonSchema v10.6.7.0 (Newtonsoft.Json v12.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.9.0 (NJsonSchema v10.6.8.0 (Newtonsoft.Json v12.0.0.0))")] public partial class Response95 { @@ -6505,7 +6505,7 @@ public System.Collections.Generic.IDictionary AdditionalProperti } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.7.0 (NJsonSchema v10.6.7.0 (Newtonsoft.Json v12.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.9.0 (NJsonSchema v10.6.8.0 (Newtonsoft.Json v12.0.0.0))")] public partial class Response96 { @@ -6526,7 +6526,7 @@ public System.Collections.Generic.IDictionary AdditionalProperti } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.7.0 (NJsonSchema v10.6.7.0 (Newtonsoft.Json v12.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.9.0 (NJsonSchema v10.6.8.0 (Newtonsoft.Json v12.0.0.0))")] public partial class Response97 { @@ -6547,7 +6547,7 @@ public System.Collections.Generic.IDictionary AdditionalProperti } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.7.0 (NJsonSchema v10.6.7.0 (Newtonsoft.Json v12.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.9.0 (NJsonSchema v10.6.8.0 (Newtonsoft.Json v12.0.0.0))")] public partial class Response98 { @@ -6568,7 +6568,7 @@ public System.Collections.Generic.IDictionary AdditionalProperti } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.7.0 (NJsonSchema v10.6.7.0 (Newtonsoft.Json v12.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.9.0 (NJsonSchema v10.6.8.0 (Newtonsoft.Json v12.0.0.0))")] public partial class Response99 { @@ -6589,7 +6589,7 @@ public System.Collections.Generic.IDictionary AdditionalProperti } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.7.0 (NJsonSchema v10.6.7.0 (Newtonsoft.Json v12.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.9.0 (NJsonSchema v10.6.8.0 (Newtonsoft.Json v12.0.0.0))")] public partial class Response100 { @@ -6610,7 +6610,7 @@ public System.Collections.Generic.IDictionary AdditionalProperti } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.7.0 (NJsonSchema v10.6.7.0 (Newtonsoft.Json v12.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.9.0 (NJsonSchema v10.6.8.0 (Newtonsoft.Json v12.0.0.0))")] public partial class Response101 { @@ -6631,7 +6631,7 @@ public System.Collections.Generic.IDictionary AdditionalProperti } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.7.0 (NJsonSchema v10.6.7.0 (Newtonsoft.Json v12.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.9.0 (NJsonSchema v10.6.8.0 (Newtonsoft.Json v12.0.0.0))")] public partial class Response102 { @@ -6652,7 +6652,7 @@ public System.Collections.Generic.IDictionary AdditionalProperti } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.7.0 (NJsonSchema v10.6.7.0 (Newtonsoft.Json v12.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.9.0 (NJsonSchema v10.6.8.0 (Newtonsoft.Json v12.0.0.0))")] public partial class Response103 { @@ -6673,7 +6673,7 @@ public System.Collections.Generic.IDictionary AdditionalProperti } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.7.0 (NJsonSchema v10.6.7.0 (Newtonsoft.Json v12.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.9.0 (NJsonSchema v10.6.8.0 (Newtonsoft.Json v12.0.0.0))")] public partial class Response104 { @@ -6694,7 +6694,7 @@ public System.Collections.Generic.IDictionary AdditionalProperti } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.7.0 (NJsonSchema v10.6.7.0 (Newtonsoft.Json v12.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.9.0 (NJsonSchema v10.6.8.0 (Newtonsoft.Json v12.0.0.0))")] public partial class Balances { @@ -6720,7 +6720,7 @@ public System.Collections.Generic.IDictionary AdditionalProperti } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.7.0 (NJsonSchema v10.6.7.0 (Newtonsoft.Json v12.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.9.0 (NJsonSchema v10.6.8.0 (Newtonsoft.Json v12.0.0.0))")] public partial class Peers { @@ -6739,7 +6739,7 @@ public System.Collections.Generic.IDictionary AdditionalProperti } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.7.0 (NJsonSchema v10.6.7.0 (Newtonsoft.Json v12.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.9.0 (NJsonSchema v10.6.8.0 (Newtonsoft.Json v12.0.0.0))")] public partial class Balances2 { @@ -6765,7 +6765,7 @@ public System.Collections.Generic.IDictionary AdditionalProperti } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.7.0 (NJsonSchema v10.6.7.0 (Newtonsoft.Json v12.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.9.0 (NJsonSchema v10.6.8.0 (Newtonsoft.Json v12.0.0.0))")] public enum Response14BeeMode { @@ -6780,7 +6780,7 @@ public enum Response14BeeMode } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.7.0 (NJsonSchema v10.6.7.0 (Newtonsoft.Json v12.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.9.0 (NJsonSchema v10.6.8.0 (Newtonsoft.Json v12.0.0.0))")] public partial class Peers2 { @@ -6799,7 +6799,7 @@ public System.Collections.Generic.IDictionary AdditionalProperti } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.7.0 (NJsonSchema v10.6.7.0 (Newtonsoft.Json v12.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.9.0 (NJsonSchema v10.6.8.0 (Newtonsoft.Json v12.0.0.0))")] public partial class Settlements { @@ -6824,7 +6824,7 @@ public System.Collections.Generic.IDictionary AdditionalProperti } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.7.0 (NJsonSchema v10.6.7.0 (Newtonsoft.Json v12.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.9.0 (NJsonSchema v10.6.8.0 (Newtonsoft.Json v12.0.0.0))")] public partial class Settlements2 { @@ -6849,7 +6849,7 @@ public System.Collections.Generic.IDictionary AdditionalProperti } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.7.0 (NJsonSchema v10.6.7.0 (Newtonsoft.Json v12.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.9.0 (NJsonSchema v10.6.8.0 (Newtonsoft.Json v12.0.0.0))")] public partial class Anonymous { @@ -6876,7 +6876,7 @@ public System.Collections.Generic.IDictionary AdditionalProperti } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.7.0 (NJsonSchema v10.6.7.0 (Newtonsoft.Json v12.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.9.0 (NJsonSchema v10.6.8.0 (Newtonsoft.Json v12.0.0.0))")] public partial class LastCashedCheque { @@ -6906,7 +6906,7 @@ public System.Collections.Generic.IDictionary AdditionalProperti } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.7.0 (NJsonSchema v10.6.7.0 (Newtonsoft.Json v12.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.9.0 (NJsonSchema v10.6.8.0 (Newtonsoft.Json v12.0.0.0))")] public partial class Result { @@ -6935,7 +6935,7 @@ public System.Collections.Generic.IDictionary AdditionalProperti } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.7.0 (NJsonSchema v10.6.7.0 (Newtonsoft.Json v12.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.9.0 (NJsonSchema v10.6.8.0 (Newtonsoft.Json v12.0.0.0))")] public partial class Lastreceived { @@ -6965,7 +6965,7 @@ public System.Collections.Generic.IDictionary AdditionalProperti } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.7.0 (NJsonSchema v10.6.7.0 (Newtonsoft.Json v12.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.9.0 (NJsonSchema v10.6.8.0 (Newtonsoft.Json v12.0.0.0))")] public partial class Lastsent { @@ -6995,7 +6995,7 @@ public System.Collections.Generic.IDictionary AdditionalProperti } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.7.0 (NJsonSchema v10.6.7.0 (Newtonsoft.Json v12.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.9.0 (NJsonSchema v10.6.8.0 (Newtonsoft.Json v12.0.0.0))")] public partial class Lastcheques { @@ -7020,7 +7020,7 @@ public System.Collections.Generic.IDictionary AdditionalProperti } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.7.0 (NJsonSchema v10.6.7.0 (Newtonsoft.Json v12.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.9.0 (NJsonSchema v10.6.8.0 (Newtonsoft.Json v12.0.0.0))")] public partial class PendingTransactions { @@ -7043,7 +7043,7 @@ public partial class PendingTransactions public string GasPrice { get; set; } = default!; [System.Text.Json.Serialization.JsonPropertyName("gasLimit")] - public int GasLimit { get; set; } = default!; + public long GasLimit { get; set; } = default!; [System.Text.Json.Serialization.JsonPropertyName("data")] public string Data { get; set; } = default!; @@ -7141,7 +7141,7 @@ public System.Collections.Generic.IDictionary AdditionalProperti } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.7.0 (NJsonSchema v10.6.7.0 (Newtonsoft.Json v12.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.9.0 (NJsonSchema v10.6.8.0 (Newtonsoft.Json v12.0.0.0))")] public partial class Buckets { @@ -7162,7 +7162,7 @@ public System.Collections.Generic.IDictionary AdditionalProperti } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.7.0 (NJsonSchema v10.6.7.0 (Newtonsoft.Json v12.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.9.0 (NJsonSchema v10.6.8.0 (Newtonsoft.Json v12.0.0.0))")] public partial class Stamps2 { @@ -7207,7 +7207,7 @@ public System.Collections.Generic.IDictionary AdditionalProperti } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.7.0 (NJsonSchema v10.6.7.0 (Newtonsoft.Json v12.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.9.0 (NJsonSchema v10.6.8.0 (Newtonsoft.Json v12.0.0.0))")] public partial class DisconnectedPeers { @@ -7229,7 +7229,7 @@ public System.Collections.Generic.IDictionary AdditionalProperti } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.7.0 (NJsonSchema v10.6.7.0 (Newtonsoft.Json v12.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.9.0 (NJsonSchema v10.6.8.0 (Newtonsoft.Json v12.0.0.0))")] public partial class ConnectedPeers { @@ -7251,7 +7251,7 @@ public System.Collections.Generic.IDictionary AdditionalProperti } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.7.0 (NJsonSchema v10.6.7.0 (Newtonsoft.Json v12.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.9.0 (NJsonSchema v10.6.8.0 (Newtonsoft.Json v12.0.0.0))")] public partial class Lastreceived2 { @@ -7281,7 +7281,7 @@ public System.Collections.Generic.IDictionary AdditionalProperti } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.7.0 (NJsonSchema v10.6.7.0 (Newtonsoft.Json v12.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.9.0 (NJsonSchema v10.6.8.0 (Newtonsoft.Json v12.0.0.0))")] public partial class Lastsent2 { @@ -7361,7 +7361,7 @@ public System.Collections.Generic.IDictionary AdditionalProperti } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.7.0 (NJsonSchema v10.6.7.0 (Newtonsoft.Json v12.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.9.0 (NJsonSchema v10.6.8.0 (Newtonsoft.Json v12.0.0.0))")] public partial class Metrics { @@ -7394,7 +7394,7 @@ public System.Collections.Generic.IDictionary AdditionalProperti } - [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.7.0 (NJsonSchema v10.6.7.0 (Newtonsoft.Json v12.0.0.0))")] + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.9.0 (NJsonSchema v10.6.8.0 (Newtonsoft.Json v12.0.0.0))")] public partial class Metrics2 { diff --git a/src/BeeNet/Clients/DebugApi/V2_0_0/BeeDebugClient_2_0_0.cs b/src/BeeNet/Clients/DebugApi/V2_0_0/BeeDebugClient_2_0_0.cs new file mode 100644 index 00000000..fae35d48 --- /dev/null +++ b/src/BeeNet/Clients/DebugApi/V2_0_0/BeeDebugClient_2_0_0.cs @@ -0,0 +1,7331 @@ +// Copyright 2021-present Etherna Sagl +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//---------------------- +// +// Generated using the NSwag toolchain v13.15.10.0 (NJsonSchema v10.6.10.0 (Newtonsoft.Json v12.0.0.0)) (http://NSwag.org) +// +//---------------------- + +#nullable enable + +using Etherna.BeeNet.Exceptions; + +#pragma warning disable 108 // Disable "CS0108 '{derivedDto}.ToJson()' hides inherited member '{dtoBase}.ToJson()'. Use the new keyword if hiding was intended." +#pragma warning disable 114 // Disable "CS0114 '{derivedDto}.RaisePropertyChanged(String)' hides inherited member 'dtoBase.RaisePropertyChanged(String)'. To make the current member override that implementation, add the override keyword. Otherwise add the new keyword." +#pragma warning disable 472 // Disable "CS0472 The result of the expression is always 'false' since a value of type 'Int32' is never equal to 'null' of type 'Int32?' +#pragma warning disable 1573 // Disable "CS1573 Parameter '...' has no matching param tag in the XML comment for ... +#pragma warning disable 1591 // Disable "CS1591 Missing XML comment for publicly visible type or member ..." +#pragma warning disable 8073 // Disable "CS8073 The result of the expression is always 'false' since a value of type 'T' is never equal to 'null' of type 'T?'" +#pragma warning disable 3016 // Disable "CS3016 Arrays as attribute arguments is not CLS-compliant" +#pragma warning disable 8603 // Disable "CS8603 Possible null reference return" + +namespace Etherna.BeeNet.Clients.DebugApi.V2_0_0 +{ + using System = global::System; + + [System.CodeDom.Compiler.GeneratedCode("NSwag", "13.15.10.0 (NJsonSchema v10.6.10.0 (Newtonsoft.Json v12.0.0.0))")] + public partial interface IBeeDebugClient_2_0_0 + { + + /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. + /// + /// Get overlay and underlay addresses of the node + /// + /// Own node underlay and overlay addresses + /// A server side error occurred. + System.Threading.Tasks.Task AddressesAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. + /// + /// Get the balances with all known peers including prepaid services + /// + /// Own balances with all known peers + /// A server side error occurred. + System.Threading.Tasks.Task BalancesGetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. + /// + /// Get the balances with a specific peer including prepaid services + /// + /// Swarm address of peer + /// Balance with the specific peer + /// A server side error occurred. + System.Threading.Tasks.Task BalancesGetAsync(string address, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. + /// + /// Get a list of blocklisted peers + /// + /// Returns overlay addresses of blocklisted peers + /// A server side error occurred. + System.Threading.Tasks.Task BlocklistAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. + /// + /// Get the past due consumption balances with all known peers + /// + /// Own past due consumption balances with all known peers + /// A server side error occurred. + System.Threading.Tasks.Task ConsumedGetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. + /// + /// Get the past due consumption balance with a specific peer + /// + /// Swarm address of peer + /// Past-due consumption balance with the specific peer + /// A server side error occurred. + System.Threading.Tasks.Task ConsumedGetAsync(string address, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. + /// + /// Get the address of the chequebook contract used + /// + /// Ethereum address of chequebook contract + /// A server side error occurred. + System.Threading.Tasks.Task ChequebookAddressAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. + /// + /// Get the balance of the chequebook + /// + /// Balance of the chequebook + /// A server side error occurred. + System.Threading.Tasks.Task ChequebookBalanceAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. + /// + /// Check if chunk at address exists locally + /// + /// Swarm address of chunk + /// Chunk exists + /// A server side error occurred. + System.Threading.Tasks.Task ChunksGetAsync(string address, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. + /// + /// Delete a chunk from local storage + /// + /// Swarm address of chunk + /// Chunk exists + /// A server side error occurred. + System.Threading.Tasks.Task ChunksDeleteAsync(string address, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. + /// + /// Connect to address + /// + /// Underlay address of peer + /// Returns overlay address of connected peer + /// A server side error occurred. + System.Threading.Tasks.Task ConnectAsync(string multiAddress, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. + /// + /// Get reserve state + /// + /// Reserve State + /// A server side error occurred. + System.Threading.Tasks.Task ReservestateAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. + /// + /// Get chain state + /// + /// Chain State + /// A server side error occurred. + System.Threading.Tasks.Task ChainstateAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. + /// + /// Get information about the node + /// + /// Information about the node + /// A server side error occurred. + System.Threading.Tasks.Task NodeAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. + /// + /// Get health of node + /// + /// Health State of node + /// A server side error occurred. + System.Threading.Tasks.Task HealthAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. + /// + /// Get a list of peers + /// + /// Returns overlay addresses of connected peers + /// A server side error occurred. + System.Threading.Tasks.Task PeersGetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. + /// + /// Remove peer + /// + /// Swarm address of peer + /// Disconnected peer + /// A server side error occurred. + System.Threading.Tasks.Task PeersDeleteAsync(string address, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. + /// + /// Try connection to node + /// + /// Swarm address of peer + /// Returns round trip time for given peer + /// A server side error occurred. + System.Threading.Tasks.Task PingpongAsync(string peer_id, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. + /// + /// Get readiness state of node + /// + /// Health State of node + /// A server side error occurred. + System.Threading.Tasks.Task ReadinessAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. + /// + /// Get amount of sent and received from settlements with a peer + /// + /// Swarm address of peer + /// Amount of sent or received from settlements with a peer + /// A server side error occurred. + System.Threading.Tasks.Task SettlementsGetAsync(string address, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. + /// + /// Get settlements with all known peers and total amount sent or received + /// + /// Settlements with all known peers and total amount sent or received + /// A server side error occurred. + System.Threading.Tasks.Task SettlementsGetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. + /// + /// Get time based settlements with all known peers and total amount sent or received + /// + /// Time based settlements with all known peers and total amount sent or received + /// A server side error occurred. + System.Threading.Tasks.Task TimesettlementsAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. + /// Swarm topology of the bee node + /// A server side error occurred. + System.Threading.Tasks.Task TopologyAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. + /// + /// Get configured P2P welcome message + /// + /// Welcome message + /// A server side error occurred. + System.Threading.Tasks.Task WelcomeMessageGetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. + /// + /// Set P2P welcome message + /// + /// OK + /// A server side error occurred. + System.Threading.Tasks.Task WelcomeMessagePostAsync(Body? body = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. + /// + /// Get last cashout action for the peer + /// + /// Swarm address of peer + /// Cashout status + /// A server side error occurred. + System.Threading.Tasks.Task ChequebookCashoutGetAsync(string peer_id, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. + /// + /// Cashout the last cheque for the peer + /// + /// Swarm address of peer + /// Gas price for transaction + /// Gas limit for transaction + /// OK + /// A server side error occurred. + System.Threading.Tasks.Task ChequebookCashoutPostAsync(string peer_id, long? gas_price = null, long? gas_limit = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. + /// + /// Get last cheques for the peer + /// + /// Swarm address of peer + /// Last cheques + /// A server side error occurred. + System.Threading.Tasks.Task ChequebookChequeGetAsync(string peer_id, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. + /// + /// Get last cheques for all peers + /// + /// Last cheques + /// A server side error occurred. + System.Threading.Tasks.Task ChequebookChequeGetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. + /// + /// Deposit tokens from overlay address into chequebook + /// + /// amount of tokens to deposit + /// Gas price for transaction + /// Transaction hash of the deposit transaction + /// A server side error occurred. + System.Threading.Tasks.Task ChequebookDepositAsync(long amount, long? gas_price = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. + /// + /// Withdraw tokens from the chequebook to the overlay address + /// + /// amount of tokens to withdraw + /// Gas price for transaction + /// Transaction hash of the withdraw transaction + /// A server side error occurred. + System.Threading.Tasks.Task ChequebookWithdrawAsync(long amount, long? gas_price = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. + /// + /// Get Tag information using Uid + /// + /// Uid + /// Tag info + /// A server side error occurred. + System.Threading.Tasks.Task TagsAsync(int uid, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. + /// + /// Get list of pending transactions + /// + /// List of pending transactions + /// A server side error occurred. + System.Threading.Tasks.Task TransactionsGetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. + /// + /// Get information about a sent transaction + /// + /// Hash of the transaction + /// Get info about transaction + /// A server side error occurred. + System.Threading.Tasks.Task TransactionsGetAsync(string txHash, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. + /// + /// Rebroadcast existing transaction + /// + /// Hash of the transaction + /// Hash of the transaction + /// A server side error occurred. + System.Threading.Tasks.Task TransactionsPostAsync(string txHash, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. + /// + /// Cancel existing transaction + /// + /// Hash of the transaction + /// Gas price for transaction + /// Hash of the transaction + /// A server side error occurred. + System.Threading.Tasks.Task TransactionsDeleteAsync(string txHash, long? gas_price = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. + /// + /// Get all available stamps for this node + /// + /// Returns an array of all available postage batches. + /// A server side error occurred. + System.Threading.Tasks.Task StampsGetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. + /// + /// Get an individual postage batch status + /// + /// Swarm address of the stamp + /// Returns an individual postage batch state + /// A server side error occurred. + System.Threading.Tasks.Task StampsGetAsync(string id, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. + /// + /// Get extended bucket data of a batch + /// + /// Swarm address of the stamp + /// Returns extended bucket data of the provided batch ID + /// A server side error occurred. + System.Threading.Tasks.Task StampsBucketsAsync(string id, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. + /// + /// Buy a new postage batch. + /// + /// Amount of BZZ added that the postage batch will have. + /// Batch depth which specifies how many chunks can be signed with the batch. It is a logarithm. Must be higher than default bucket depth (16) + /// An optional label for this batch + /// Gas price for transaction + /// Returns the newly created postage batch ID + /// A server side error occurred. + System.Threading.Tasks.Task StampsPostAsync(string amount, int depth, string? label = null, bool? immutable = null, long? gas_price = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. + /// + /// Top up an existing postage batch. + /// + /// Batch ID to top up + /// Amount of BZZ per chunk to top up to an existing postage batch. + /// Returns the postage batch ID that was topped up + /// A server side error occurred. + System.Threading.Tasks.Task StampsTopupAsync(string id, long amount, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. + /// + /// Dilute an existing postage batch. + /// + /// Batch ID to dilute + /// New batch depth. Must be higher than the previous depth. + /// Returns the postage batch ID that was diluted. + /// A server side error occurred. + System.Threading.Tasks.Task StampsDiluteAsync(string id, int depth, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. + /// + /// Get all globally available batches that were purchased by all nodes. + /// + /// Returns an array of all available and currently valid postage batches. + /// A server side error occurred. + System.Threading.Tasks.Task BatchesAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + } + + [System.CodeDom.Compiler.GeneratedCode("NSwag", "13.15.10.0 (NJsonSchema v10.6.10.0 (Newtonsoft.Json v12.0.0.0))")] + public partial class BeeDebugClient_2_0_0 : IBeeDebugClient_2_0_0 + { + private string _baseUrl = "http://{apiRoot}:{port}"; + private System.Net.Http.HttpClient _httpClient; + private System.Lazy _settings; + + public BeeDebugClient_2_0_0(System.Net.Http.HttpClient httpClient) + { + _httpClient = httpClient; + _settings = new System.Lazy(CreateSerializerSettings); + } + + private System.Text.Json.JsonSerializerOptions CreateSerializerSettings() + { + var settings = new System.Text.Json.JsonSerializerOptions(); + UpdateJsonSerializerSettings(settings); + return settings; + } + + public string BaseUrl + { + get { return _baseUrl; } + set { _baseUrl = value; } + } + + protected System.Text.Json.JsonSerializerOptions JsonSerializerSettings { get { return _settings.Value; } } + + partial void UpdateJsonSerializerSettings(System.Text.Json.JsonSerializerOptions settings); + + partial void PrepareRequest(System.Net.Http.HttpClient client, System.Net.Http.HttpRequestMessage request, string url); + partial void PrepareRequest(System.Net.Http.HttpClient client, System.Net.Http.HttpRequestMessage request, System.Text.StringBuilder urlBuilder); + partial void ProcessResponse(System.Net.Http.HttpClient client, System.Net.Http.HttpResponseMessage response); + + /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. + /// + /// Get overlay and underlay addresses of the node + /// + /// Own node underlay and overlay addresses + /// A server side error occurred. + public virtual async System.Threading.Tasks.Task AddressesAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + var urlBuilder_ = new System.Text.StringBuilder(); + urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/addresses"); + + var client_ = _httpClient; + var disposeClient_ = false; + try + { + using (var request_ = new System.Net.Http.HttpRequestMessage()) + { + request_.Method = new System.Net.Http.HttpMethod("GET"); + request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); + + PrepareRequest(client_, request_, urlBuilder_); + + var url_ = urlBuilder_.ToString(); + request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); + + PrepareRequest(client_, request_, url_); + + var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); + var disposeResponse_ = true; + try + { + var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + if (response_.Content != null && response_.Content.Headers != null) + { + foreach (var item_ in response_.Content.Headers) + headers_[item_.Key] = item_.Value; + } + + ProcessResponse(client_, response_); + + var status_ = (int)response_.StatusCode; + if (status_ == 200) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new BeeNetDebugApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + return objectResponse_.Object; + } + else + if (status_ == 500) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new BeeNetDebugApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new BeeNetDebugApiException("Internal Server Error", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else + { + var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); + throw new BeeNetDebugApiException("Default response", status_, responseData_, headers_, null); + } + } + finally + { + if (disposeResponse_) + response_.Dispose(); + } + } + } + finally + { + if (disposeClient_) + client_.Dispose(); + } + } + + /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. + /// + /// Get the balances with all known peers including prepaid services + /// + /// Own balances with all known peers + /// A server side error occurred. + public virtual async System.Threading.Tasks.Task BalancesGetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + var urlBuilder_ = new System.Text.StringBuilder(); + urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/balances"); + + var client_ = _httpClient; + var disposeClient_ = false; + try + { + using (var request_ = new System.Net.Http.HttpRequestMessage()) + { + request_.Method = new System.Net.Http.HttpMethod("GET"); + request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); + + PrepareRequest(client_, request_, urlBuilder_); + + var url_ = urlBuilder_.ToString(); + request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); + + PrepareRequest(client_, request_, url_); + + var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); + var disposeResponse_ = true; + try + { + var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + if (response_.Content != null && response_.Content.Headers != null) + { + foreach (var item_ in response_.Content.Headers) + headers_[item_.Key] = item_.Value; + } + + ProcessResponse(client_, response_); + + var status_ = (int)response_.StatusCode; + if (status_ == 200) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new BeeNetDebugApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + return objectResponse_.Object; + } + else + if (status_ == 500) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new BeeNetDebugApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new BeeNetDebugApiException("Internal Server Error", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else + { + var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); + throw new BeeNetDebugApiException("Default response", status_, responseData_, headers_, null); + } + } + finally + { + if (disposeResponse_) + response_.Dispose(); + } + } + } + finally + { + if (disposeClient_) + client_.Dispose(); + } + } + + /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. + /// + /// Get the balances with a specific peer including prepaid services + /// + /// Swarm address of peer + /// Balance with the specific peer + /// A server side error occurred. + public virtual async System.Threading.Tasks.Task BalancesGetAsync(string address, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + if (address == null) + throw new System.ArgumentNullException("address"); + + var urlBuilder_ = new System.Text.StringBuilder(); + urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/balances/{address}"); + urlBuilder_.Replace("{address}", System.Uri.EscapeDataString(ConvertToString(address, System.Globalization.CultureInfo.InvariantCulture))); + + var client_ = _httpClient; + var disposeClient_ = false; + try + { + using (var request_ = new System.Net.Http.HttpRequestMessage()) + { + request_.Method = new System.Net.Http.HttpMethod("GET"); + request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); + + PrepareRequest(client_, request_, urlBuilder_); + + var url_ = urlBuilder_.ToString(); + request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); + + PrepareRequest(client_, request_, url_); + + var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); + var disposeResponse_ = true; + try + { + var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + if (response_.Content != null && response_.Content.Headers != null) + { + foreach (var item_ in response_.Content.Headers) + headers_[item_.Key] = item_.Value; + } + + ProcessResponse(client_, response_); + + var status_ = (int)response_.StatusCode; + if (status_ == 200) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new BeeNetDebugApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + return objectResponse_.Object; + } + else + if (status_ == 404) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new BeeNetDebugApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new BeeNetDebugApiException("Not Found", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else + if (status_ == 500) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new BeeNetDebugApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new BeeNetDebugApiException("Internal Server Error", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else + { + var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); + throw new BeeNetDebugApiException("Default response", status_, responseData_, headers_, null); + } + } + finally + { + if (disposeResponse_) + response_.Dispose(); + } + } + } + finally + { + if (disposeClient_) + client_.Dispose(); + } + } + + /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. + /// + /// Get a list of blocklisted peers + /// + /// Returns overlay addresses of blocklisted peers + /// A server side error occurred. + public virtual async System.Threading.Tasks.Task BlocklistAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + var urlBuilder_ = new System.Text.StringBuilder(); + urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/blocklist"); + + var client_ = _httpClient; + var disposeClient_ = false; + try + { + using (var request_ = new System.Net.Http.HttpRequestMessage()) + { + request_.Method = new System.Net.Http.HttpMethod("GET"); + request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); + + PrepareRequest(client_, request_, urlBuilder_); + + var url_ = urlBuilder_.ToString(); + request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); + + PrepareRequest(client_, request_, url_); + + var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); + var disposeResponse_ = true; + try + { + var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + if (response_.Content != null && response_.Content.Headers != null) + { + foreach (var item_ in response_.Content.Headers) + headers_[item_.Key] = item_.Value; + } + + ProcessResponse(client_, response_); + + var status_ = (int)response_.StatusCode; + if (status_ == 200) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new BeeNetDebugApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + return objectResponse_.Object; + } + else + if (status_ == 500) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new BeeNetDebugApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new BeeNetDebugApiException("Internal Server Error", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else + { + var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); + throw new BeeNetDebugApiException("Default response", status_, responseData_, headers_, null); + } + } + finally + { + if (disposeResponse_) + response_.Dispose(); + } + } + } + finally + { + if (disposeClient_) + client_.Dispose(); + } + } + + /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. + /// + /// Get the past due consumption balances with all known peers + /// + /// Own past due consumption balances with all known peers + /// A server side error occurred. + public virtual async System.Threading.Tasks.Task ConsumedGetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + var urlBuilder_ = new System.Text.StringBuilder(); + urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/consumed"); + + var client_ = _httpClient; + var disposeClient_ = false; + try + { + using (var request_ = new System.Net.Http.HttpRequestMessage()) + { + request_.Method = new System.Net.Http.HttpMethod("GET"); + request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); + + PrepareRequest(client_, request_, urlBuilder_); + + var url_ = urlBuilder_.ToString(); + request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); + + PrepareRequest(client_, request_, url_); + + var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); + var disposeResponse_ = true; + try + { + var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + if (response_.Content != null && response_.Content.Headers != null) + { + foreach (var item_ in response_.Content.Headers) + headers_[item_.Key] = item_.Value; + } + + ProcessResponse(client_, response_); + + var status_ = (int)response_.StatusCode; + if (status_ == 200) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new BeeNetDebugApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + return objectResponse_.Object; + } + else + if (status_ == 500) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new BeeNetDebugApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new BeeNetDebugApiException("Internal Server Error", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else + { + var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); + throw new BeeNetDebugApiException("Default response", status_, responseData_, headers_, null); + } + } + finally + { + if (disposeResponse_) + response_.Dispose(); + } + } + } + finally + { + if (disposeClient_) + client_.Dispose(); + } + } + + /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. + /// + /// Get the past due consumption balance with a specific peer + /// + /// Swarm address of peer + /// Past-due consumption balance with the specific peer + /// A server side error occurred. + public virtual async System.Threading.Tasks.Task ConsumedGetAsync(string address, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + if (address == null) + throw new System.ArgumentNullException("address"); + + var urlBuilder_ = new System.Text.StringBuilder(); + urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/consumed/{address}"); + urlBuilder_.Replace("{address}", System.Uri.EscapeDataString(ConvertToString(address, System.Globalization.CultureInfo.InvariantCulture))); + + var client_ = _httpClient; + var disposeClient_ = false; + try + { + using (var request_ = new System.Net.Http.HttpRequestMessage()) + { + request_.Method = new System.Net.Http.HttpMethod("GET"); + request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); + + PrepareRequest(client_, request_, urlBuilder_); + + var url_ = urlBuilder_.ToString(); + request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); + + PrepareRequest(client_, request_, url_); + + var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); + var disposeResponse_ = true; + try + { + var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + if (response_.Content != null && response_.Content.Headers != null) + { + foreach (var item_ in response_.Content.Headers) + headers_[item_.Key] = item_.Value; + } + + ProcessResponse(client_, response_); + + var status_ = (int)response_.StatusCode; + if (status_ == 200) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new BeeNetDebugApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + return objectResponse_.Object; + } + else + if (status_ == 404) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new BeeNetDebugApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new BeeNetDebugApiException("Not Found", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else + if (status_ == 500) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new BeeNetDebugApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new BeeNetDebugApiException("Internal Server Error", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else + { + var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); + throw new BeeNetDebugApiException("Default response", status_, responseData_, headers_, null); + } + } + finally + { + if (disposeResponse_) + response_.Dispose(); + } + } + } + finally + { + if (disposeClient_) + client_.Dispose(); + } + } + + /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. + /// + /// Get the address of the chequebook contract used + /// + /// Ethereum address of chequebook contract + /// A server side error occurred. + public virtual async System.Threading.Tasks.Task ChequebookAddressAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + var urlBuilder_ = new System.Text.StringBuilder(); + urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/chequebook/address"); + + var client_ = _httpClient; + var disposeClient_ = false; + try + { + using (var request_ = new System.Net.Http.HttpRequestMessage()) + { + request_.Method = new System.Net.Http.HttpMethod("GET"); + request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); + + PrepareRequest(client_, request_, urlBuilder_); + + var url_ = urlBuilder_.ToString(); + request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); + + PrepareRequest(client_, request_, url_); + + var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); + var disposeResponse_ = true; + try + { + var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + if (response_.Content != null && response_.Content.Headers != null) + { + foreach (var item_ in response_.Content.Headers) + headers_[item_.Key] = item_.Value; + } + + ProcessResponse(client_, response_); + + var status_ = (int)response_.StatusCode; + if (status_ == 200) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new BeeNetDebugApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + return objectResponse_.Object; + } + else + { + var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); + throw new BeeNetDebugApiException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); + } + } + finally + { + if (disposeResponse_) + response_.Dispose(); + } + } + } + finally + { + if (disposeClient_) + client_.Dispose(); + } + } + + /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. + /// + /// Get the balance of the chequebook + /// + /// Balance of the chequebook + /// A server side error occurred. + public virtual async System.Threading.Tasks.Task ChequebookBalanceAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + var urlBuilder_ = new System.Text.StringBuilder(); + urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/chequebook/balance"); + + var client_ = _httpClient; + var disposeClient_ = false; + try + { + using (var request_ = new System.Net.Http.HttpRequestMessage()) + { + request_.Method = new System.Net.Http.HttpMethod("GET"); + request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); + + PrepareRequest(client_, request_, urlBuilder_); + + var url_ = urlBuilder_.ToString(); + request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); + + PrepareRequest(client_, request_, url_); + + var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); + var disposeResponse_ = true; + try + { + var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + if (response_.Content != null && response_.Content.Headers != null) + { + foreach (var item_ in response_.Content.Headers) + headers_[item_.Key] = item_.Value; + } + + ProcessResponse(client_, response_); + + var status_ = (int)response_.StatusCode; + if (status_ == 200) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new BeeNetDebugApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + return objectResponse_.Object; + } + else + if (status_ == 500) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new BeeNetDebugApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new BeeNetDebugApiException("Internal Server Error", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else + { + var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); + throw new BeeNetDebugApiException("Default response", status_, responseData_, headers_, null); + } + } + finally + { + if (disposeResponse_) + response_.Dispose(); + } + } + } + finally + { + if (disposeClient_) + client_.Dispose(); + } + } + + /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. + /// + /// Check if chunk at address exists locally + /// + /// Swarm address of chunk + /// Chunk exists + /// A server side error occurred. + public virtual async System.Threading.Tasks.Task ChunksGetAsync(string address, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + if (address == null) + throw new System.ArgumentNullException("address"); + + var urlBuilder_ = new System.Text.StringBuilder(); + urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/chunks/{address}"); + urlBuilder_.Replace("{address}", System.Uri.EscapeDataString(ConvertToString(address, System.Globalization.CultureInfo.InvariantCulture))); + + var client_ = _httpClient; + var disposeClient_ = false; + try + { + using (var request_ = new System.Net.Http.HttpRequestMessage()) + { + request_.Method = new System.Net.Http.HttpMethod("GET"); + request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); + + PrepareRequest(client_, request_, urlBuilder_); + + var url_ = urlBuilder_.ToString(); + request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); + + PrepareRequest(client_, request_, url_); + + var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); + var disposeResponse_ = true; + try + { + var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + if (response_.Content != null && response_.Content.Headers != null) + { + foreach (var item_ in response_.Content.Headers) + headers_[item_.Key] = item_.Value; + } + + ProcessResponse(client_, response_); + + var status_ = (int)response_.StatusCode; + if (status_ == 200) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new BeeNetDebugApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + return objectResponse_.Object; + } + else + if (status_ == 400) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new BeeNetDebugApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new BeeNetDebugApiException("Bad request", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else + if (status_ == 404) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new BeeNetDebugApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new BeeNetDebugApiException("Not Found", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else + { + var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); + throw new BeeNetDebugApiException("Default response", status_, responseData_, headers_, null); + } + } + finally + { + if (disposeResponse_) + response_.Dispose(); + } + } + } + finally + { + if (disposeClient_) + client_.Dispose(); + } + } + + /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. + /// + /// Delete a chunk from local storage + /// + /// Swarm address of chunk + /// Chunk exists + /// A server side error occurred. + public virtual async System.Threading.Tasks.Task ChunksDeleteAsync(string address, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + if (address == null) + throw new System.ArgumentNullException("address"); + + var urlBuilder_ = new System.Text.StringBuilder(); + urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/chunks/{address}"); + urlBuilder_.Replace("{address}", System.Uri.EscapeDataString(ConvertToString(address, System.Globalization.CultureInfo.InvariantCulture))); + + var client_ = _httpClient; + var disposeClient_ = false; + try + { + using (var request_ = new System.Net.Http.HttpRequestMessage()) + { + request_.Method = new System.Net.Http.HttpMethod("DELETE"); + request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); + + PrepareRequest(client_, request_, urlBuilder_); + + var url_ = urlBuilder_.ToString(); + request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); + + PrepareRequest(client_, request_, url_); + + var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); + var disposeResponse_ = true; + try + { + var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + if (response_.Content != null && response_.Content.Headers != null) + { + foreach (var item_ in response_.Content.Headers) + headers_[item_.Key] = item_.Value; + } + + ProcessResponse(client_, response_); + + var status_ = (int)response_.StatusCode; + if (status_ == 200) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new BeeNetDebugApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + return objectResponse_.Object; + } + else + if (status_ == 400) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new BeeNetDebugApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new BeeNetDebugApiException("Bad request", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else + if (status_ == 404) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new BeeNetDebugApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new BeeNetDebugApiException("Not Found", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else + { + var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); + throw new BeeNetDebugApiException("Default response", status_, responseData_, headers_, null); + } + } + finally + { + if (disposeResponse_) + response_.Dispose(); + } + } + } + finally + { + if (disposeClient_) + client_.Dispose(); + } + } + + /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. + /// + /// Connect to address + /// + /// Underlay address of peer + /// Returns overlay address of connected peer + /// A server side error occurred. + public virtual async System.Threading.Tasks.Task ConnectAsync(string multiAddress, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + if (multiAddress == null) + throw new System.ArgumentNullException("multiAddress"); + + var urlBuilder_ = new System.Text.StringBuilder(); + urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/connect/{multiAddress}"); + urlBuilder_.Replace("{multiAddress}", System.Uri.EscapeDataString(ConvertToString(multiAddress, System.Globalization.CultureInfo.InvariantCulture))); + + var client_ = _httpClient; + var disposeClient_ = false; + try + { + using (var request_ = new System.Net.Http.HttpRequestMessage()) + { + request_.Content = new System.Net.Http.StringContent(string.Empty, System.Text.Encoding.UTF8, "application/json"); + request_.Method = new System.Net.Http.HttpMethod("POST"); + request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); + + PrepareRequest(client_, request_, urlBuilder_); + + var url_ = urlBuilder_.ToString(); + request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); + + PrepareRequest(client_, request_, url_); + + var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); + var disposeResponse_ = true; + try + { + var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + if (response_.Content != null && response_.Content.Headers != null) + { + foreach (var item_ in response_.Content.Headers) + headers_[item_.Key] = item_.Value; + } + + ProcessResponse(client_, response_); + + var status_ = (int)response_.StatusCode; + if (status_ == 200) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new BeeNetDebugApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + return objectResponse_.Object; + } + else + if (status_ == 400) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new BeeNetDebugApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new BeeNetDebugApiException("Bad request", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else + if (status_ == 500) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new BeeNetDebugApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new BeeNetDebugApiException("Internal Server Error", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else + { + var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); + throw new BeeNetDebugApiException("Default response", status_, responseData_, headers_, null); + } + } + finally + { + if (disposeResponse_) + response_.Dispose(); + } + } + } + finally + { + if (disposeClient_) + client_.Dispose(); + } + } + + /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. + /// + /// Get reserve state + /// + /// Reserve State + /// A server side error occurred. + public virtual async System.Threading.Tasks.Task ReservestateAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + var urlBuilder_ = new System.Text.StringBuilder(); + urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/reservestate"); + + var client_ = _httpClient; + var disposeClient_ = false; + try + { + using (var request_ = new System.Net.Http.HttpRequestMessage()) + { + request_.Method = new System.Net.Http.HttpMethod("GET"); + request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); + + PrepareRequest(client_, request_, urlBuilder_); + + var url_ = urlBuilder_.ToString(); + request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); + + PrepareRequest(client_, request_, url_); + + var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); + var disposeResponse_ = true; + try + { + var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + if (response_.Content != null && response_.Content.Headers != null) + { + foreach (var item_ in response_.Content.Headers) + headers_[item_.Key] = item_.Value; + } + + ProcessResponse(client_, response_); + + var status_ = (int)response_.StatusCode; + if (status_ == 200) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new BeeNetDebugApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + return objectResponse_.Object; + } + else + { + var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); + throw new BeeNetDebugApiException("Default response", status_, responseData_, headers_, null); + } + } + finally + { + if (disposeResponse_) + response_.Dispose(); + } + } + } + finally + { + if (disposeClient_) + client_.Dispose(); + } + } + + /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. + /// + /// Get chain state + /// + /// Chain State + /// A server side error occurred. + public virtual async System.Threading.Tasks.Task ChainstateAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + var urlBuilder_ = new System.Text.StringBuilder(); + urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/chainstate"); + + var client_ = _httpClient; + var disposeClient_ = false; + try + { + using (var request_ = new System.Net.Http.HttpRequestMessage()) + { + request_.Method = new System.Net.Http.HttpMethod("GET"); + request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); + + PrepareRequest(client_, request_, urlBuilder_); + + var url_ = urlBuilder_.ToString(); + request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); + + PrepareRequest(client_, request_, url_); + + var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); + var disposeResponse_ = true; + try + { + var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + if (response_.Content != null && response_.Content.Headers != null) + { + foreach (var item_ in response_.Content.Headers) + headers_[item_.Key] = item_.Value; + } + + ProcessResponse(client_, response_); + + var status_ = (int)response_.StatusCode; + if (status_ == 200) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new BeeNetDebugApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + return objectResponse_.Object; + } + else + { + var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); + throw new BeeNetDebugApiException("Default response", status_, responseData_, headers_, null); + } + } + finally + { + if (disposeResponse_) + response_.Dispose(); + } + } + } + finally + { + if (disposeClient_) + client_.Dispose(); + } + } + + /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. + /// + /// Get information about the node + /// + /// Information about the node + /// A server side error occurred. + public virtual async System.Threading.Tasks.Task NodeAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + var urlBuilder_ = new System.Text.StringBuilder(); + urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/node"); + + var client_ = _httpClient; + var disposeClient_ = false; + try + { + using (var request_ = new System.Net.Http.HttpRequestMessage()) + { + request_.Method = new System.Net.Http.HttpMethod("GET"); + request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); + + PrepareRequest(client_, request_, urlBuilder_); + + var url_ = urlBuilder_.ToString(); + request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); + + PrepareRequest(client_, request_, url_); + + var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); + var disposeResponse_ = true; + try + { + var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + if (response_.Content != null && response_.Content.Headers != null) + { + foreach (var item_ in response_.Content.Headers) + headers_[item_.Key] = item_.Value; + } + + ProcessResponse(client_, response_); + + var status_ = (int)response_.StatusCode; + if (status_ == 200) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new BeeNetDebugApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + return objectResponse_.Object; + } + else + { + var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); + throw new BeeNetDebugApiException("Default response", status_, responseData_, headers_, null); + } + } + finally + { + if (disposeResponse_) + response_.Dispose(); + } + } + } + finally + { + if (disposeClient_) + client_.Dispose(); + } + } + + /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. + /// + /// Get health of node + /// + /// Health State of node + /// A server side error occurred. + public virtual async System.Threading.Tasks.Task HealthAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + var urlBuilder_ = new System.Text.StringBuilder(); + urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/health"); + + var client_ = _httpClient; + var disposeClient_ = false; + try + { + using (var request_ = new System.Net.Http.HttpRequestMessage()) + { + request_.Method = new System.Net.Http.HttpMethod("GET"); + request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); + + PrepareRequest(client_, request_, urlBuilder_); + + var url_ = urlBuilder_.ToString(); + request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); + + PrepareRequest(client_, request_, url_); + + var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); + var disposeResponse_ = true; + try + { + var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + if (response_.Content != null && response_.Content.Headers != null) + { + foreach (var item_ in response_.Content.Headers) + headers_[item_.Key] = item_.Value; + } + + ProcessResponse(client_, response_); + + var status_ = (int)response_.StatusCode; + if (status_ == 200) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new BeeNetDebugApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + return objectResponse_.Object; + } + else + { + var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); + throw new BeeNetDebugApiException("Default response", status_, responseData_, headers_, null); + } + } + finally + { + if (disposeResponse_) + response_.Dispose(); + } + } + } + finally + { + if (disposeClient_) + client_.Dispose(); + } + } + + /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. + /// + /// Get a list of peers + /// + /// Returns overlay addresses of connected peers + /// A server side error occurred. + public virtual async System.Threading.Tasks.Task PeersGetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + var urlBuilder_ = new System.Text.StringBuilder(); + urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/peers"); + + var client_ = _httpClient; + var disposeClient_ = false; + try + { + using (var request_ = new System.Net.Http.HttpRequestMessage()) + { + request_.Method = new System.Net.Http.HttpMethod("GET"); + request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); + + PrepareRequest(client_, request_, urlBuilder_); + + var url_ = urlBuilder_.ToString(); + request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); + + PrepareRequest(client_, request_, url_); + + var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); + var disposeResponse_ = true; + try + { + var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + if (response_.Content != null && response_.Content.Headers != null) + { + foreach (var item_ in response_.Content.Headers) + headers_[item_.Key] = item_.Value; + } + + ProcessResponse(client_, response_); + + var status_ = (int)response_.StatusCode; + if (status_ == 200) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new BeeNetDebugApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + return objectResponse_.Object; + } + else + { + var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); + throw new BeeNetDebugApiException("Default response", status_, responseData_, headers_, null); + } + } + finally + { + if (disposeResponse_) + response_.Dispose(); + } + } + } + finally + { + if (disposeClient_) + client_.Dispose(); + } + } + + /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. + /// + /// Remove peer + /// + /// Swarm address of peer + /// Disconnected peer + /// A server side error occurred. + public virtual async System.Threading.Tasks.Task PeersDeleteAsync(string address, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + if (address == null) + throw new System.ArgumentNullException("address"); + + var urlBuilder_ = new System.Text.StringBuilder(); + urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/peers/{address}"); + urlBuilder_.Replace("{address}", System.Uri.EscapeDataString(ConvertToString(address, System.Globalization.CultureInfo.InvariantCulture))); + + var client_ = _httpClient; + var disposeClient_ = false; + try + { + using (var request_ = new System.Net.Http.HttpRequestMessage()) + { + request_.Method = new System.Net.Http.HttpMethod("DELETE"); + request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); + + PrepareRequest(client_, request_, urlBuilder_); + + var url_ = urlBuilder_.ToString(); + request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); + + PrepareRequest(client_, request_, url_); + + var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); + var disposeResponse_ = true; + try + { + var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + if (response_.Content != null && response_.Content.Headers != null) + { + foreach (var item_ in response_.Content.Headers) + headers_[item_.Key] = item_.Value; + } + + ProcessResponse(client_, response_); + + var status_ = (int)response_.StatusCode; + if (status_ == 200) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new BeeNetDebugApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + return objectResponse_.Object; + } + else + if (status_ == 400) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new BeeNetDebugApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new BeeNetDebugApiException("Bad request", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else + if (status_ == 500) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new BeeNetDebugApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new BeeNetDebugApiException("Internal Server Error", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else + { + var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); + throw new BeeNetDebugApiException("Default response", status_, responseData_, headers_, null); + } + } + finally + { + if (disposeResponse_) + response_.Dispose(); + } + } + } + finally + { + if (disposeClient_) + client_.Dispose(); + } + } + + /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. + /// + /// Try connection to node + /// + /// Swarm address of peer + /// Returns round trip time for given peer + /// A server side error occurred. + public virtual async System.Threading.Tasks.Task PingpongAsync(string peer_id, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + if (peer_id == null) + throw new System.ArgumentNullException("peer_id"); + + var urlBuilder_ = new System.Text.StringBuilder(); + urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/pingpong/{peer-id}"); + urlBuilder_.Replace("{peer-id}", System.Uri.EscapeDataString(ConvertToString(peer_id, System.Globalization.CultureInfo.InvariantCulture))); + + var client_ = _httpClient; + var disposeClient_ = false; + try + { + using (var request_ = new System.Net.Http.HttpRequestMessage()) + { + request_.Content = new System.Net.Http.StringContent(string.Empty, System.Text.Encoding.UTF8, "application/json"); + request_.Method = new System.Net.Http.HttpMethod("POST"); + request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); + + PrepareRequest(client_, request_, urlBuilder_); + + var url_ = urlBuilder_.ToString(); + request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); + + PrepareRequest(client_, request_, url_); + + var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); + var disposeResponse_ = true; + try + { + var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + if (response_.Content != null && response_.Content.Headers != null) + { + foreach (var item_ in response_.Content.Headers) + headers_[item_.Key] = item_.Value; + } + + ProcessResponse(client_, response_); + + var status_ = (int)response_.StatusCode; + if (status_ == 200) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new BeeNetDebugApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + return objectResponse_.Object; + } + else + if (status_ == 400) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new BeeNetDebugApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new BeeNetDebugApiException("Bad request", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else + if (status_ == 404) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new BeeNetDebugApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new BeeNetDebugApiException("Not Found", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else + if (status_ == 500) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new BeeNetDebugApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new BeeNetDebugApiException("Internal Server Error", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else + { + var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); + throw new BeeNetDebugApiException("Default response", status_, responseData_, headers_, null); + } + } + finally + { + if (disposeResponse_) + response_.Dispose(); + } + } + } + finally + { + if (disposeClient_) + client_.Dispose(); + } + } + + /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. + /// + /// Get readiness state of node + /// + /// Health State of node + /// A server side error occurred. + public virtual async System.Threading.Tasks.Task ReadinessAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + var urlBuilder_ = new System.Text.StringBuilder(); + urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/readiness"); + + var client_ = _httpClient; + var disposeClient_ = false; + try + { + using (var request_ = new System.Net.Http.HttpRequestMessage()) + { + request_.Method = new System.Net.Http.HttpMethod("GET"); + request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); + + PrepareRequest(client_, request_, urlBuilder_); + + var url_ = urlBuilder_.ToString(); + request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); + + PrepareRequest(client_, request_, url_); + + var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); + var disposeResponse_ = true; + try + { + var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + if (response_.Content != null && response_.Content.Headers != null) + { + foreach (var item_ in response_.Content.Headers) + headers_[item_.Key] = item_.Value; + } + + ProcessResponse(client_, response_); + + var status_ = (int)response_.StatusCode; + if (status_ == 200) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new BeeNetDebugApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + return objectResponse_.Object; + } + else + { + var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); + throw new BeeNetDebugApiException("Default response", status_, responseData_, headers_, null); + } + } + finally + { + if (disposeResponse_) + response_.Dispose(); + } + } + } + finally + { + if (disposeClient_) + client_.Dispose(); + } + } + + /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. + /// + /// Get amount of sent and received from settlements with a peer + /// + /// Swarm address of peer + /// Amount of sent or received from settlements with a peer + /// A server side error occurred. + public virtual async System.Threading.Tasks.Task SettlementsGetAsync(string address, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + if (address == null) + throw new System.ArgumentNullException("address"); + + var urlBuilder_ = new System.Text.StringBuilder(); + urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/settlements/{address}"); + urlBuilder_.Replace("{address}", System.Uri.EscapeDataString(ConvertToString(address, System.Globalization.CultureInfo.InvariantCulture))); + + var client_ = _httpClient; + var disposeClient_ = false; + try + { + using (var request_ = new System.Net.Http.HttpRequestMessage()) + { + request_.Method = new System.Net.Http.HttpMethod("GET"); + request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); + + PrepareRequest(client_, request_, urlBuilder_); + + var url_ = urlBuilder_.ToString(); + request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); + + PrepareRequest(client_, request_, url_); + + var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); + var disposeResponse_ = true; + try + { + var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + if (response_.Content != null && response_.Content.Headers != null) + { + foreach (var item_ in response_.Content.Headers) + headers_[item_.Key] = item_.Value; + } + + ProcessResponse(client_, response_); + + var status_ = (int)response_.StatusCode; + if (status_ == 200) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new BeeNetDebugApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + return objectResponse_.Object; + } + else + if (status_ == 404) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new BeeNetDebugApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new BeeNetDebugApiException("Not Found", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else + if (status_ == 500) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new BeeNetDebugApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new BeeNetDebugApiException("Internal Server Error", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else + { + var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); + throw new BeeNetDebugApiException("Default response", status_, responseData_, headers_, null); + } + } + finally + { + if (disposeResponse_) + response_.Dispose(); + } + } + } + finally + { + if (disposeClient_) + client_.Dispose(); + } + } + + /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. + /// + /// Get settlements with all known peers and total amount sent or received + /// + /// Settlements with all known peers and total amount sent or received + /// A server side error occurred. + public virtual async System.Threading.Tasks.Task SettlementsGetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + var urlBuilder_ = new System.Text.StringBuilder(); + urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/settlements"); + + var client_ = _httpClient; + var disposeClient_ = false; + try + { + using (var request_ = new System.Net.Http.HttpRequestMessage()) + { + request_.Method = new System.Net.Http.HttpMethod("GET"); + request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); + + PrepareRequest(client_, request_, urlBuilder_); + + var url_ = urlBuilder_.ToString(); + request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); + + PrepareRequest(client_, request_, url_); + + var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); + var disposeResponse_ = true; + try + { + var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + if (response_.Content != null && response_.Content.Headers != null) + { + foreach (var item_ in response_.Content.Headers) + headers_[item_.Key] = item_.Value; + } + + ProcessResponse(client_, response_); + + var status_ = (int)response_.StatusCode; + if (status_ == 200) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new BeeNetDebugApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + return objectResponse_.Object; + } + else + if (status_ == 500) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new BeeNetDebugApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new BeeNetDebugApiException("Internal Server Error", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else + { + var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); + throw new BeeNetDebugApiException("Default response", status_, responseData_, headers_, null); + } + } + finally + { + if (disposeResponse_) + response_.Dispose(); + } + } + } + finally + { + if (disposeClient_) + client_.Dispose(); + } + } + + /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. + /// + /// Get time based settlements with all known peers and total amount sent or received + /// + /// Time based settlements with all known peers and total amount sent or received + /// A server side error occurred. + public virtual async System.Threading.Tasks.Task TimesettlementsAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + var urlBuilder_ = new System.Text.StringBuilder(); + urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/timesettlements"); + + var client_ = _httpClient; + var disposeClient_ = false; + try + { + using (var request_ = new System.Net.Http.HttpRequestMessage()) + { + request_.Method = new System.Net.Http.HttpMethod("GET"); + request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); + + PrepareRequest(client_, request_, urlBuilder_); + + var url_ = urlBuilder_.ToString(); + request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); + + PrepareRequest(client_, request_, url_); + + var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); + var disposeResponse_ = true; + try + { + var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + if (response_.Content != null && response_.Content.Headers != null) + { + foreach (var item_ in response_.Content.Headers) + headers_[item_.Key] = item_.Value; + } + + ProcessResponse(client_, response_); + + var status_ = (int)response_.StatusCode; + if (status_ == 200) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new BeeNetDebugApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + return objectResponse_.Object; + } + else + if (status_ == 500) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new BeeNetDebugApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new BeeNetDebugApiException("Internal Server Error", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else + { + var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); + throw new BeeNetDebugApiException("Default response", status_, responseData_, headers_, null); + } + } + finally + { + if (disposeResponse_) + response_.Dispose(); + } + } + } + finally + { + if (disposeClient_) + client_.Dispose(); + } + } + + /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. + /// Swarm topology of the bee node + /// A server side error occurred. + public virtual async System.Threading.Tasks.Task TopologyAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + var urlBuilder_ = new System.Text.StringBuilder(); + urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/topology"); + + var client_ = _httpClient; + var disposeClient_ = false; + try + { + using (var request_ = new System.Net.Http.HttpRequestMessage()) + { + request_.Method = new System.Net.Http.HttpMethod("GET"); + request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); + + PrepareRequest(client_, request_, urlBuilder_); + + var url_ = urlBuilder_.ToString(); + request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); + + PrepareRequest(client_, request_, url_); + + var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); + var disposeResponse_ = true; + try + { + var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + if (response_.Content != null && response_.Content.Headers != null) + { + foreach (var item_ in response_.Content.Headers) + headers_[item_.Key] = item_.Value; + } + + ProcessResponse(client_, response_); + + var status_ = (int)response_.StatusCode; + if (status_ == 200) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new BeeNetDebugApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + return objectResponse_.Object; + } + else + { + var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); + throw new BeeNetDebugApiException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null); + } + } + finally + { + if (disposeResponse_) + response_.Dispose(); + } + } + } + finally + { + if (disposeClient_) + client_.Dispose(); + } + } + + /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. + /// + /// Get configured P2P welcome message + /// + /// Welcome message + /// A server side error occurred. + public virtual async System.Threading.Tasks.Task WelcomeMessageGetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + var urlBuilder_ = new System.Text.StringBuilder(); + urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/welcome-message"); + + var client_ = _httpClient; + var disposeClient_ = false; + try + { + using (var request_ = new System.Net.Http.HttpRequestMessage()) + { + request_.Method = new System.Net.Http.HttpMethod("GET"); + request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); + + PrepareRequest(client_, request_, urlBuilder_); + + var url_ = urlBuilder_.ToString(); + request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); + + PrepareRequest(client_, request_, url_); + + var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); + var disposeResponse_ = true; + try + { + var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + if (response_.Content != null && response_.Content.Headers != null) + { + foreach (var item_ in response_.Content.Headers) + headers_[item_.Key] = item_.Value; + } + + ProcessResponse(client_, response_); + + var status_ = (int)response_.StatusCode; + if (status_ == 200) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new BeeNetDebugApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + return objectResponse_.Object; + } + else + if (status_ == 500) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new BeeNetDebugApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new BeeNetDebugApiException("Internal Server Error", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else + { + var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); + throw new BeeNetDebugApiException("Default response", status_, responseData_, headers_, null); + } + } + finally + { + if (disposeResponse_) + response_.Dispose(); + } + } + } + finally + { + if (disposeClient_) + client_.Dispose(); + } + } + + /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. + /// + /// Set P2P welcome message + /// + /// OK + /// A server side error occurred. + public virtual async System.Threading.Tasks.Task WelcomeMessagePostAsync(Body? body = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + var urlBuilder_ = new System.Text.StringBuilder(); + urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/welcome-message"); + + var client_ = _httpClient; + var disposeClient_ = false; + try + { + using (var request_ = new System.Net.Http.HttpRequestMessage()) + { + var content_ = new System.Net.Http.StringContent(System.Text.Json.JsonSerializer.Serialize(body, _settings.Value)); + content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + request_.Content = content_; + request_.Method = new System.Net.Http.HttpMethod("POST"); + request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); + + PrepareRequest(client_, request_, urlBuilder_); + + var url_ = urlBuilder_.ToString(); + request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); + + PrepareRequest(client_, request_, url_); + + var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); + var disposeResponse_ = true; + try + { + var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + if (response_.Content != null && response_.Content.Headers != null) + { + foreach (var item_ in response_.Content.Headers) + headers_[item_.Key] = item_.Value; + } + + ProcessResponse(client_, response_); + + var status_ = (int)response_.StatusCode; + if (status_ == 200) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new BeeNetDebugApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + return objectResponse_.Object; + } + else + if (status_ == 400) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new BeeNetDebugApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new BeeNetDebugApiException("Bad request", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else + if (status_ == 500) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new BeeNetDebugApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new BeeNetDebugApiException("Internal Server Error", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else + { + var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); + throw new BeeNetDebugApiException("Default response", status_, responseData_, headers_, null); + } + } + finally + { + if (disposeResponse_) + response_.Dispose(); + } + } + } + finally + { + if (disposeClient_) + client_.Dispose(); + } + } + + /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. + /// + /// Get last cashout action for the peer + /// + /// Swarm address of peer + /// Cashout status + /// A server side error occurred. + public virtual async System.Threading.Tasks.Task ChequebookCashoutGetAsync(string peer_id, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + if (peer_id == null) + throw new System.ArgumentNullException("peer_id"); + + var urlBuilder_ = new System.Text.StringBuilder(); + urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/chequebook/cashout/{peer-id}"); + urlBuilder_.Replace("{peer-id}", System.Uri.EscapeDataString(ConvertToString(peer_id, System.Globalization.CultureInfo.InvariantCulture))); + + var client_ = _httpClient; + var disposeClient_ = false; + try + { + using (var request_ = new System.Net.Http.HttpRequestMessage()) + { + request_.Method = new System.Net.Http.HttpMethod("GET"); + request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); + + PrepareRequest(client_, request_, urlBuilder_); + + var url_ = urlBuilder_.ToString(); + request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); + + PrepareRequest(client_, request_, url_); + + var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); + var disposeResponse_ = true; + try + { + var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + if (response_.Content != null && response_.Content.Headers != null) + { + foreach (var item_ in response_.Content.Headers) + headers_[item_.Key] = item_.Value; + } + + ProcessResponse(client_, response_); + + var status_ = (int)response_.StatusCode; + if (status_ == 200) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new BeeNetDebugApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + return objectResponse_.Object; + } + else + if (status_ == 404) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new BeeNetDebugApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new BeeNetDebugApiException("Not Found", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else + if (status_ == 500) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new BeeNetDebugApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new BeeNetDebugApiException("Internal Server Error", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else + { + var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); + throw new BeeNetDebugApiException("Default response", status_, responseData_, headers_, null); + } + } + finally + { + if (disposeResponse_) + response_.Dispose(); + } + } + } + finally + { + if (disposeClient_) + client_.Dispose(); + } + } + + /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. + /// + /// Cashout the last cheque for the peer + /// + /// Swarm address of peer + /// Gas price for transaction + /// Gas limit for transaction + /// OK + /// A server side error occurred. + public virtual async System.Threading.Tasks.Task ChequebookCashoutPostAsync(string peer_id, long? gas_price = null, long? gas_limit = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + if (peer_id == null) + throw new System.ArgumentNullException("peer_id"); + + var urlBuilder_ = new System.Text.StringBuilder(); + urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/chequebook/cashout/{peer-id}"); + urlBuilder_.Replace("{peer-id}", System.Uri.EscapeDataString(ConvertToString(peer_id, System.Globalization.CultureInfo.InvariantCulture))); + + var client_ = _httpClient; + var disposeClient_ = false; + try + { + using (var request_ = new System.Net.Http.HttpRequestMessage()) + { + + if (gas_price != null) + request_.Headers.TryAddWithoutValidation("gas-price", ConvertToString(gas_price, System.Globalization.CultureInfo.InvariantCulture)); + + if (gas_limit != null) + request_.Headers.TryAddWithoutValidation("gas-limit", ConvertToString(gas_limit, System.Globalization.CultureInfo.InvariantCulture)); + request_.Content = new System.Net.Http.StringContent(string.Empty, System.Text.Encoding.UTF8, "application/json"); + request_.Method = new System.Net.Http.HttpMethod("POST"); + request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); + + PrepareRequest(client_, request_, urlBuilder_); + + var url_ = urlBuilder_.ToString(); + request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); + + PrepareRequest(client_, request_, url_); + + var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); + var disposeResponse_ = true; + try + { + var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + if (response_.Content != null && response_.Content.Headers != null) + { + foreach (var item_ in response_.Content.Headers) + headers_[item_.Key] = item_.Value; + } + + ProcessResponse(client_, response_); + + var status_ = (int)response_.StatusCode; + if (status_ == 201) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new BeeNetDebugApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + return objectResponse_.Object; + } + else + if (status_ == 404) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new BeeNetDebugApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new BeeNetDebugApiException("Not Found", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else + if (status_ == 429) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new BeeNetDebugApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new BeeNetDebugApiException("Too many requests", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else + if (status_ == 500) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new BeeNetDebugApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new BeeNetDebugApiException("Internal Server Error", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else + { + var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); + throw new BeeNetDebugApiException("Default response", status_, responseData_, headers_, null); + } + } + finally + { + if (disposeResponse_) + response_.Dispose(); + } + } + } + finally + { + if (disposeClient_) + client_.Dispose(); + } + } + + /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. + /// + /// Get last cheques for the peer + /// + /// Swarm address of peer + /// Last cheques + /// A server side error occurred. + public virtual async System.Threading.Tasks.Task ChequebookChequeGetAsync(string peer_id, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + if (peer_id == null) + throw new System.ArgumentNullException("peer_id"); + + var urlBuilder_ = new System.Text.StringBuilder(); + urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/chequebook/cheque/{peer-id}"); + urlBuilder_.Replace("{peer-id}", System.Uri.EscapeDataString(ConvertToString(peer_id, System.Globalization.CultureInfo.InvariantCulture))); + + var client_ = _httpClient; + var disposeClient_ = false; + try + { + using (var request_ = new System.Net.Http.HttpRequestMessage()) + { + request_.Method = new System.Net.Http.HttpMethod("GET"); + request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); + + PrepareRequest(client_, request_, urlBuilder_); + + var url_ = urlBuilder_.ToString(); + request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); + + PrepareRequest(client_, request_, url_); + + var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); + var disposeResponse_ = true; + try + { + var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + if (response_.Content != null && response_.Content.Headers != null) + { + foreach (var item_ in response_.Content.Headers) + headers_[item_.Key] = item_.Value; + } + + ProcessResponse(client_, response_); + + var status_ = (int)response_.StatusCode; + if (status_ == 200) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new BeeNetDebugApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + return objectResponse_.Object; + } + else + if (status_ == 404) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new BeeNetDebugApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new BeeNetDebugApiException("Not Found", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else + if (status_ == 500) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new BeeNetDebugApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new BeeNetDebugApiException("Internal Server Error", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else + { + var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); + throw new BeeNetDebugApiException("Default response", status_, responseData_, headers_, null); + } + } + finally + { + if (disposeResponse_) + response_.Dispose(); + } + } + } + finally + { + if (disposeClient_) + client_.Dispose(); + } + } + + /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. + /// + /// Get last cheques for all peers + /// + /// Last cheques + /// A server side error occurred. + public virtual async System.Threading.Tasks.Task ChequebookChequeGetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + var urlBuilder_ = new System.Text.StringBuilder(); + urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/chequebook/cheque"); + + var client_ = _httpClient; + var disposeClient_ = false; + try + { + using (var request_ = new System.Net.Http.HttpRequestMessage()) + { + request_.Method = new System.Net.Http.HttpMethod("GET"); + request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); + + PrepareRequest(client_, request_, urlBuilder_); + + var url_ = urlBuilder_.ToString(); + request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); + + PrepareRequest(client_, request_, url_); + + var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); + var disposeResponse_ = true; + try + { + var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + if (response_.Content != null && response_.Content.Headers != null) + { + foreach (var item_ in response_.Content.Headers) + headers_[item_.Key] = item_.Value; + } + + ProcessResponse(client_, response_); + + var status_ = (int)response_.StatusCode; + if (status_ == 200) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new BeeNetDebugApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + return objectResponse_.Object; + } + else + if (status_ == 404) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new BeeNetDebugApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new BeeNetDebugApiException("Not Found", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else + if (status_ == 500) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new BeeNetDebugApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new BeeNetDebugApiException("Internal Server Error", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else + { + var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); + throw new BeeNetDebugApiException("Default response", status_, responseData_, headers_, null); + } + } + finally + { + if (disposeResponse_) + response_.Dispose(); + } + } + } + finally + { + if (disposeClient_) + client_.Dispose(); + } + } + + /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. + /// + /// Deposit tokens from overlay address into chequebook + /// + /// amount of tokens to deposit + /// Gas price for transaction + /// Transaction hash of the deposit transaction + /// A server side error occurred. + public virtual async System.Threading.Tasks.Task ChequebookDepositAsync(long amount, long? gas_price = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + if (amount == null) + throw new System.ArgumentNullException("amount"); + + var urlBuilder_ = new System.Text.StringBuilder(); + urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/chequebook/deposit?"); + urlBuilder_.Append(System.Uri.EscapeDataString("amount") + "=").Append(System.Uri.EscapeDataString(ConvertToString(amount, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); + urlBuilder_.Length--; + + var client_ = _httpClient; + var disposeClient_ = false; + try + { + using (var request_ = new System.Net.Http.HttpRequestMessage()) + { + + if (gas_price != null) + request_.Headers.TryAddWithoutValidation("gas-price", ConvertToString(gas_price, System.Globalization.CultureInfo.InvariantCulture)); + request_.Content = new System.Net.Http.StringContent(string.Empty, System.Text.Encoding.UTF8, "application/json"); + request_.Method = new System.Net.Http.HttpMethod("POST"); + request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); + + PrepareRequest(client_, request_, urlBuilder_); + + var url_ = urlBuilder_.ToString(); + request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); + + PrepareRequest(client_, request_, url_); + + var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); + var disposeResponse_ = true; + try + { + var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + if (response_.Content != null && response_.Content.Headers != null) + { + foreach (var item_ in response_.Content.Headers) + headers_[item_.Key] = item_.Value; + } + + ProcessResponse(client_, response_); + + var status_ = (int)response_.StatusCode; + if (status_ == 201) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new BeeNetDebugApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + return objectResponse_.Object; + } + else + if (status_ == 400) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new BeeNetDebugApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new BeeNetDebugApiException("Not Found", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else + if (status_ == 500) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new BeeNetDebugApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new BeeNetDebugApiException("Internal Server Error", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else + { + var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); + throw new BeeNetDebugApiException("Default response", status_, responseData_, headers_, null); + } + } + finally + { + if (disposeResponse_) + response_.Dispose(); + } + } + } + finally + { + if (disposeClient_) + client_.Dispose(); + } + } + + /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. + /// + /// Withdraw tokens from the chequebook to the overlay address + /// + /// amount of tokens to withdraw + /// Gas price for transaction + /// Transaction hash of the withdraw transaction + /// A server side error occurred. + public virtual async System.Threading.Tasks.Task ChequebookWithdrawAsync(long amount, long? gas_price = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + if (amount == null) + throw new System.ArgumentNullException("amount"); + + var urlBuilder_ = new System.Text.StringBuilder(); + urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/chequebook/withdraw?"); + urlBuilder_.Append(System.Uri.EscapeDataString("amount") + "=").Append(System.Uri.EscapeDataString(ConvertToString(amount, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); + urlBuilder_.Length--; + + var client_ = _httpClient; + var disposeClient_ = false; + try + { + using (var request_ = new System.Net.Http.HttpRequestMessage()) + { + + if (gas_price != null) + request_.Headers.TryAddWithoutValidation("gas-price", ConvertToString(gas_price, System.Globalization.CultureInfo.InvariantCulture)); + request_.Content = new System.Net.Http.StringContent(string.Empty, System.Text.Encoding.UTF8, "application/json"); + request_.Method = new System.Net.Http.HttpMethod("POST"); + request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); + + PrepareRequest(client_, request_, urlBuilder_); + + var url_ = urlBuilder_.ToString(); + request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); + + PrepareRequest(client_, request_, url_); + + var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); + var disposeResponse_ = true; + try + { + var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + if (response_.Content != null && response_.Content.Headers != null) + { + foreach (var item_ in response_.Content.Headers) + headers_[item_.Key] = item_.Value; + } + + ProcessResponse(client_, response_); + + var status_ = (int)response_.StatusCode; + if (status_ == 201) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new BeeNetDebugApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + return objectResponse_.Object; + } + else + if (status_ == 400) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new BeeNetDebugApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new BeeNetDebugApiException("Not Found", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else + if (status_ == 500) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new BeeNetDebugApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new BeeNetDebugApiException("Internal Server Error", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else + { + var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); + throw new BeeNetDebugApiException("Default response", status_, responseData_, headers_, null); + } + } + finally + { + if (disposeResponse_) + response_.Dispose(); + } + } + } + finally + { + if (disposeClient_) + client_.Dispose(); + } + } + + /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. + /// + /// Get Tag information using Uid + /// + /// Uid + /// Tag info + /// A server side error occurred. + public virtual async System.Threading.Tasks.Task TagsAsync(int uid, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + if (uid == null) + throw new System.ArgumentNullException("uid"); + + var urlBuilder_ = new System.Text.StringBuilder(); + urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/tags/{uid}"); + urlBuilder_.Replace("{uid}", System.Uri.EscapeDataString(ConvertToString(uid, System.Globalization.CultureInfo.InvariantCulture))); + + var client_ = _httpClient; + var disposeClient_ = false; + try + { + using (var request_ = new System.Net.Http.HttpRequestMessage()) + { + request_.Method = new System.Net.Http.HttpMethod("GET"); + request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); + + PrepareRequest(client_, request_, urlBuilder_); + + var url_ = urlBuilder_.ToString(); + request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); + + PrepareRequest(client_, request_, url_); + + var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); + var disposeResponse_ = true; + try + { + var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + if (response_.Content != null && response_.Content.Headers != null) + { + foreach (var item_ in response_.Content.Headers) + headers_[item_.Key] = item_.Value; + } + + ProcessResponse(client_, response_); + + var status_ = (int)response_.StatusCode; + if (status_ == 200) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new BeeNetDebugApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + return objectResponse_.Object; + } + else + if (status_ == 400) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new BeeNetDebugApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new BeeNetDebugApiException("Bad request", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else + if (status_ == 500) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new BeeNetDebugApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new BeeNetDebugApiException("Internal Server Error", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else + { + var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); + throw new BeeNetDebugApiException("Default response", status_, responseData_, headers_, null); + } + } + finally + { + if (disposeResponse_) + response_.Dispose(); + } + } + } + finally + { + if (disposeClient_) + client_.Dispose(); + } + } + + /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. + /// + /// Get list of pending transactions + /// + /// List of pending transactions + /// A server side error occurred. + public virtual async System.Threading.Tasks.Task TransactionsGetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + var urlBuilder_ = new System.Text.StringBuilder(); + urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/transactions"); + + var client_ = _httpClient; + var disposeClient_ = false; + try + { + using (var request_ = new System.Net.Http.HttpRequestMessage()) + { + request_.Method = new System.Net.Http.HttpMethod("GET"); + request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); + + PrepareRequest(client_, request_, urlBuilder_); + + var url_ = urlBuilder_.ToString(); + request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); + + PrepareRequest(client_, request_, url_); + + var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); + var disposeResponse_ = true; + try + { + var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + if (response_.Content != null && response_.Content.Headers != null) + { + foreach (var item_ in response_.Content.Headers) + headers_[item_.Key] = item_.Value; + } + + ProcessResponse(client_, response_); + + var status_ = (int)response_.StatusCode; + if (status_ == 200) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new BeeNetDebugApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + return objectResponse_.Object; + } + else + if (status_ == 500) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new BeeNetDebugApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new BeeNetDebugApiException("Internal Server Error", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else + { + var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); + throw new BeeNetDebugApiException("Default response", status_, responseData_, headers_, null); + } + } + finally + { + if (disposeResponse_) + response_.Dispose(); + } + } + } + finally + { + if (disposeClient_) + client_.Dispose(); + } + } + + /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. + /// + /// Get information about a sent transaction + /// + /// Hash of the transaction + /// Get info about transaction + /// A server side error occurred. + public virtual async System.Threading.Tasks.Task TransactionsGetAsync(string txHash, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + if (txHash == null) + throw new System.ArgumentNullException("txHash"); + + var urlBuilder_ = new System.Text.StringBuilder(); + urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/transactions/{txHash}"); + urlBuilder_.Replace("{txHash}", System.Uri.EscapeDataString(ConvertToString(txHash, System.Globalization.CultureInfo.InvariantCulture))); + + var client_ = _httpClient; + var disposeClient_ = false; + try + { + using (var request_ = new System.Net.Http.HttpRequestMessage()) + { + request_.Method = new System.Net.Http.HttpMethod("GET"); + request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); + + PrepareRequest(client_, request_, urlBuilder_); + + var url_ = urlBuilder_.ToString(); + request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); + + PrepareRequest(client_, request_, url_); + + var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); + var disposeResponse_ = true; + try + { + var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + if (response_.Content != null && response_.Content.Headers != null) + { + foreach (var item_ in response_.Content.Headers) + headers_[item_.Key] = item_.Value; + } + + ProcessResponse(client_, response_); + + var status_ = (int)response_.StatusCode; + if (status_ == 200) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new BeeNetDebugApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + return objectResponse_.Object; + } + else + if (status_ == 404) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new BeeNetDebugApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new BeeNetDebugApiException("Not Found", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else + if (status_ == 500) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new BeeNetDebugApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new BeeNetDebugApiException("Internal Server Error", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else + { + var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); + throw new BeeNetDebugApiException("Default response", status_, responseData_, headers_, null); + } + } + finally + { + if (disposeResponse_) + response_.Dispose(); + } + } + } + finally + { + if (disposeClient_) + client_.Dispose(); + } + } + + /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. + /// + /// Rebroadcast existing transaction + /// + /// Hash of the transaction + /// Hash of the transaction + /// A server side error occurred. + public virtual async System.Threading.Tasks.Task TransactionsPostAsync(string txHash, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + if (txHash == null) + throw new System.ArgumentNullException("txHash"); + + var urlBuilder_ = new System.Text.StringBuilder(); + urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/transactions/{txHash}"); + urlBuilder_.Replace("{txHash}", System.Uri.EscapeDataString(ConvertToString(txHash, System.Globalization.CultureInfo.InvariantCulture))); + + var client_ = _httpClient; + var disposeClient_ = false; + try + { + using (var request_ = new System.Net.Http.HttpRequestMessage()) + { + request_.Content = new System.Net.Http.StringContent(string.Empty, System.Text.Encoding.UTF8, "application/json"); + request_.Method = new System.Net.Http.HttpMethod("POST"); + request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); + + PrepareRequest(client_, request_, urlBuilder_); + + var url_ = urlBuilder_.ToString(); + request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); + + PrepareRequest(client_, request_, url_); + + var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); + var disposeResponse_ = true; + try + { + var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + if (response_.Content != null && response_.Content.Headers != null) + { + foreach (var item_ in response_.Content.Headers) + headers_[item_.Key] = item_.Value; + } + + ProcessResponse(client_, response_); + + var status_ = (int)response_.StatusCode; + if (status_ == 200) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new BeeNetDebugApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + return objectResponse_.Object; + } + else + if (status_ == 404) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new BeeNetDebugApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new BeeNetDebugApiException("Not Found", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else + if (status_ == 500) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new BeeNetDebugApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new BeeNetDebugApiException("Internal Server Error", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else + { + var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); + throw new BeeNetDebugApiException("Default response", status_, responseData_, headers_, null); + } + } + finally + { + if (disposeResponse_) + response_.Dispose(); + } + } + } + finally + { + if (disposeClient_) + client_.Dispose(); + } + } + + /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. + /// + /// Cancel existing transaction + /// + /// Hash of the transaction + /// Gas price for transaction + /// Hash of the transaction + /// A server side error occurred. + public virtual async System.Threading.Tasks.Task TransactionsDeleteAsync(string txHash, long? gas_price = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + if (txHash == null) + throw new System.ArgumentNullException("txHash"); + + var urlBuilder_ = new System.Text.StringBuilder(); + urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/transactions/{txHash}"); + urlBuilder_.Replace("{txHash}", System.Uri.EscapeDataString(ConvertToString(txHash, System.Globalization.CultureInfo.InvariantCulture))); + + var client_ = _httpClient; + var disposeClient_ = false; + try + { + using (var request_ = new System.Net.Http.HttpRequestMessage()) + { + + if (gas_price != null) + request_.Headers.TryAddWithoutValidation("gas-price", ConvertToString(gas_price, System.Globalization.CultureInfo.InvariantCulture)); + request_.Method = new System.Net.Http.HttpMethod("DELETE"); + request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); + + PrepareRequest(client_, request_, urlBuilder_); + + var url_ = urlBuilder_.ToString(); + request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); + + PrepareRequest(client_, request_, url_); + + var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); + var disposeResponse_ = true; + try + { + var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + if (response_.Content != null && response_.Content.Headers != null) + { + foreach (var item_ in response_.Content.Headers) + headers_[item_.Key] = item_.Value; + } + + ProcessResponse(client_, response_); + + var status_ = (int)response_.StatusCode; + if (status_ == 200) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new BeeNetDebugApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + return objectResponse_.Object; + } + else + if (status_ == 404) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new BeeNetDebugApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new BeeNetDebugApiException("Not Found", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else + if (status_ == 500) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new BeeNetDebugApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new BeeNetDebugApiException("Internal Server Error", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else + { + var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); + throw new BeeNetDebugApiException("Default response", status_, responseData_, headers_, null); + } + } + finally + { + if (disposeResponse_) + response_.Dispose(); + } + } + } + finally + { + if (disposeClient_) + client_.Dispose(); + } + } + + /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. + /// + /// Get all available stamps for this node + /// + /// Returns an array of all available postage batches. + /// A server side error occurred. + public virtual async System.Threading.Tasks.Task StampsGetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + var urlBuilder_ = new System.Text.StringBuilder(); + urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/stamps"); + + var client_ = _httpClient; + var disposeClient_ = false; + try + { + using (var request_ = new System.Net.Http.HttpRequestMessage()) + { + request_.Method = new System.Net.Http.HttpMethod("GET"); + request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); + + PrepareRequest(client_, request_, urlBuilder_); + + var url_ = urlBuilder_.ToString(); + request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); + + PrepareRequest(client_, request_, url_); + + var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); + var disposeResponse_ = true; + try + { + var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + if (response_.Content != null && response_.Content.Headers != null) + { + foreach (var item_ in response_.Content.Headers) + headers_[item_.Key] = item_.Value; + } + + ProcessResponse(client_, response_); + + var status_ = (int)response_.StatusCode; + if (status_ == 200) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new BeeNetDebugApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + return objectResponse_.Object; + } + else + { + var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); + throw new BeeNetDebugApiException("Default response", status_, responseData_, headers_, null); + } + } + finally + { + if (disposeResponse_) + response_.Dispose(); + } + } + } + finally + { + if (disposeClient_) + client_.Dispose(); + } + } + + /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. + /// + /// Get an individual postage batch status + /// + /// Swarm address of the stamp + /// Returns an individual postage batch state + /// A server side error occurred. + public virtual async System.Threading.Tasks.Task StampsGetAsync(string id, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + if (id == null) + throw new System.ArgumentNullException("id"); + + var urlBuilder_ = new System.Text.StringBuilder(); + urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/stamps/{id}"); + urlBuilder_.Replace("{id}", System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))); + + var client_ = _httpClient; + var disposeClient_ = false; + try + { + using (var request_ = new System.Net.Http.HttpRequestMessage()) + { + request_.Method = new System.Net.Http.HttpMethod("GET"); + request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); + + PrepareRequest(client_, request_, urlBuilder_); + + var url_ = urlBuilder_.ToString(); + request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); + + PrepareRequest(client_, request_, url_); + + var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); + var disposeResponse_ = true; + try + { + var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + if (response_.Content != null && response_.Content.Headers != null) + { + foreach (var item_ in response_.Content.Headers) + headers_[item_.Key] = item_.Value; + } + + ProcessResponse(client_, response_); + + var status_ = (int)response_.StatusCode; + if (status_ == 200) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new BeeNetDebugApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + return objectResponse_.Object; + } + else + if (status_ == 400) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new BeeNetDebugApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new BeeNetDebugApiException("Bad request", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else + { + var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); + throw new BeeNetDebugApiException("Default response", status_, responseData_, headers_, null); + } + } + finally + { + if (disposeResponse_) + response_.Dispose(); + } + } + } + finally + { + if (disposeClient_) + client_.Dispose(); + } + } + + /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. + /// + /// Get extended bucket data of a batch + /// + /// Swarm address of the stamp + /// Returns extended bucket data of the provided batch ID + /// A server side error occurred. + public virtual async System.Threading.Tasks.Task StampsBucketsAsync(string id, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + if (id == null) + throw new System.ArgumentNullException("id"); + + var urlBuilder_ = new System.Text.StringBuilder(); + urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/stamps/{id}/buckets"); + urlBuilder_.Replace("{id}", System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))); + + var client_ = _httpClient; + var disposeClient_ = false; + try + { + using (var request_ = new System.Net.Http.HttpRequestMessage()) + { + request_.Method = new System.Net.Http.HttpMethod("GET"); + request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); + + PrepareRequest(client_, request_, urlBuilder_); + + var url_ = urlBuilder_.ToString(); + request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); + + PrepareRequest(client_, request_, url_); + + var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); + var disposeResponse_ = true; + try + { + var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + if (response_.Content != null && response_.Content.Headers != null) + { + foreach (var item_ in response_.Content.Headers) + headers_[item_.Key] = item_.Value; + } + + ProcessResponse(client_, response_); + + var status_ = (int)response_.StatusCode; + if (status_ == 200) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new BeeNetDebugApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + return objectResponse_.Object; + } + else + if (status_ == 400) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new BeeNetDebugApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new BeeNetDebugApiException("Bad request", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else + { + var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); + throw new BeeNetDebugApiException("Default response", status_, responseData_, headers_, null); + } + } + finally + { + if (disposeResponse_) + response_.Dispose(); + } + } + } + finally + { + if (disposeClient_) + client_.Dispose(); + } + } + + /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. + /// + /// Buy a new postage batch. + /// + /// Amount of BZZ added that the postage batch will have. + /// Batch depth which specifies how many chunks can be signed with the batch. It is a logarithm. Must be higher than default bucket depth (16) + /// An optional label for this batch + /// Gas price for transaction + /// Returns the newly created postage batch ID + /// A server side error occurred. + public virtual async System.Threading.Tasks.Task StampsPostAsync(string amount, int depth, string? label = null, bool? immutable = null, long? gas_price = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + if (amount == null) + throw new System.ArgumentNullException("amount"); + + if (depth == null) + throw new System.ArgumentNullException("depth"); + + var urlBuilder_ = new System.Text.StringBuilder(); + urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/stamps/{amount}/{depth}?"); + urlBuilder_.Replace("{amount}", System.Uri.EscapeDataString(ConvertToString(amount, System.Globalization.CultureInfo.InvariantCulture))); + urlBuilder_.Replace("{depth}", System.Uri.EscapeDataString(ConvertToString(depth, System.Globalization.CultureInfo.InvariantCulture))); + if (label != null) + { + urlBuilder_.Append(System.Uri.EscapeDataString("label") + "=").Append(System.Uri.EscapeDataString(ConvertToString(label, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); + } + urlBuilder_.Length--; + + var client_ = _httpClient; + var disposeClient_ = false; + try + { + using (var request_ = new System.Net.Http.HttpRequestMessage()) + { + + if (immutable != null) + request_.Headers.TryAddWithoutValidation("immutable", ConvertToString(immutable, System.Globalization.CultureInfo.InvariantCulture)); + + if (gas_price != null) + request_.Headers.TryAddWithoutValidation("gas-price", ConvertToString(gas_price, System.Globalization.CultureInfo.InvariantCulture)); + request_.Content = new System.Net.Http.StringContent(string.Empty, System.Text.Encoding.UTF8, "application/json"); + request_.Method = new System.Net.Http.HttpMethod("POST"); + request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); + + PrepareRequest(client_, request_, urlBuilder_); + + var url_ = urlBuilder_.ToString(); + request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); + + PrepareRequest(client_, request_, url_); + + var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); + var disposeResponse_ = true; + try + { + var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + if (response_.Content != null && response_.Content.Headers != null) + { + foreach (var item_ in response_.Content.Headers) + headers_[item_.Key] = item_.Value; + } + + ProcessResponse(client_, response_); + + var status_ = (int)response_.StatusCode; + if (status_ == 201) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new BeeNetDebugApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + return objectResponse_.Object; + } + else + if (status_ == 400) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new BeeNetDebugApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new BeeNetDebugApiException("Bad request", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else + if (status_ == 429) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new BeeNetDebugApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new BeeNetDebugApiException("Too many requests", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else + if (status_ == 500) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new BeeNetDebugApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new BeeNetDebugApiException("Internal Server Error", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else + { + var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); + throw new BeeNetDebugApiException("Default response", status_, responseData_, headers_, null); + } + } + finally + { + if (disposeResponse_) + response_.Dispose(); + } + } + } + finally + { + if (disposeClient_) + client_.Dispose(); + } + } + + /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. + /// + /// Top up an existing postage batch. + /// + /// Batch ID to top up + /// Amount of BZZ per chunk to top up to an existing postage batch. + /// Returns the postage batch ID that was topped up + /// A server side error occurred. + public virtual async System.Threading.Tasks.Task StampsTopupAsync(string id, long amount, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + if (id == null) + throw new System.ArgumentNullException("id"); + + if (amount == null) + throw new System.ArgumentNullException("amount"); + + var urlBuilder_ = new System.Text.StringBuilder(); + urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/stamps/topup/{id}/{amount}"); + urlBuilder_.Replace("{id}", System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))); + urlBuilder_.Replace("{amount}", System.Uri.EscapeDataString(ConvertToString(amount, System.Globalization.CultureInfo.InvariantCulture))); + + var client_ = _httpClient; + var disposeClient_ = false; + try + { + using (var request_ = new System.Net.Http.HttpRequestMessage()) + { + request_.Content = new System.Net.Http.StringContent(string.Empty, System.Text.Encoding.UTF8, "application/json"); + request_.Method = new System.Net.Http.HttpMethod("PATCH"); + request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); + + PrepareRequest(client_, request_, urlBuilder_); + + var url_ = urlBuilder_.ToString(); + request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); + + PrepareRequest(client_, request_, url_); + + var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); + var disposeResponse_ = true; + try + { + var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + if (response_.Content != null && response_.Content.Headers != null) + { + foreach (var item_ in response_.Content.Headers) + headers_[item_.Key] = item_.Value; + } + + ProcessResponse(client_, response_); + + var status_ = (int)response_.StatusCode; + if (status_ == 202) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new BeeNetDebugApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + return objectResponse_.Object; + } + else + if (status_ == 400) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new BeeNetDebugApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new BeeNetDebugApiException("Bad request", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else + if (status_ == 402) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new BeeNetDebugApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new BeeNetDebugApiException("Payment Required", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else + if (status_ == 429) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new BeeNetDebugApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new BeeNetDebugApiException("Too many requests", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else + if (status_ == 500) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new BeeNetDebugApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new BeeNetDebugApiException("Internal Server Error", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else + { + var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); + throw new BeeNetDebugApiException("Default response", status_, responseData_, headers_, null); + } + } + finally + { + if (disposeResponse_) + response_.Dispose(); + } + } + } + finally + { + if (disposeClient_) + client_.Dispose(); + } + } + + /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. + /// + /// Dilute an existing postage batch. + /// + /// Batch ID to dilute + /// New batch depth. Must be higher than the previous depth. + /// Returns the postage batch ID that was diluted. + /// A server side error occurred. + public virtual async System.Threading.Tasks.Task StampsDiluteAsync(string id, int depth, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + if (id == null) + throw new System.ArgumentNullException("id"); + + if (depth == null) + throw new System.ArgumentNullException("depth"); + + var urlBuilder_ = new System.Text.StringBuilder(); + urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/stamps/dilute/{id}/{depth}"); + urlBuilder_.Replace("{id}", System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))); + urlBuilder_.Replace("{depth}", System.Uri.EscapeDataString(ConvertToString(depth, System.Globalization.CultureInfo.InvariantCulture))); + + var client_ = _httpClient; + var disposeClient_ = false; + try + { + using (var request_ = new System.Net.Http.HttpRequestMessage()) + { + request_.Content = new System.Net.Http.StringContent(string.Empty, System.Text.Encoding.UTF8, "application/json"); + request_.Method = new System.Net.Http.HttpMethod("PATCH"); + request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); + + PrepareRequest(client_, request_, urlBuilder_); + + var url_ = urlBuilder_.ToString(); + request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); + + PrepareRequest(client_, request_, url_); + + var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); + var disposeResponse_ = true; + try + { + var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + if (response_.Content != null && response_.Content.Headers != null) + { + foreach (var item_ in response_.Content.Headers) + headers_[item_.Key] = item_.Value; + } + + ProcessResponse(client_, response_); + + var status_ = (int)response_.StatusCode; + if (status_ == 202) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new BeeNetDebugApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + return objectResponse_.Object; + } + else + if (status_ == 400) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new BeeNetDebugApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new BeeNetDebugApiException("Bad request", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else + if (status_ == 429) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new BeeNetDebugApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new BeeNetDebugApiException("Too many requests", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else + if (status_ == 500) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new BeeNetDebugApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new BeeNetDebugApiException("Internal Server Error", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else + { + var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); + throw new BeeNetDebugApiException("Default response", status_, responseData_, headers_, null); + } + } + finally + { + if (disposeResponse_) + response_.Dispose(); + } + } + } + finally + { + if (disposeClient_) + client_.Dispose(); + } + } + + /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. + /// + /// Get all globally available batches that were purchased by all nodes. + /// + /// Returns an array of all available and currently valid postage batches. + /// A server side error occurred. + public virtual async System.Threading.Tasks.Task BatchesAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + var urlBuilder_ = new System.Text.StringBuilder(); + urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/batches"); + + var client_ = _httpClient; + var disposeClient_ = false; + try + { + using (var request_ = new System.Net.Http.HttpRequestMessage()) + { + request_.Method = new System.Net.Http.HttpMethod("GET"); + request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); + + PrepareRequest(client_, request_, urlBuilder_); + + var url_ = urlBuilder_.ToString(); + request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); + + PrepareRequest(client_, request_, url_); + + var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); + var disposeResponse_ = true; + try + { + var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + if (response_.Content != null && response_.Content.Headers != null) + { + foreach (var item_ in response_.Content.Headers) + headers_[item_.Key] = item_.Value; + } + + ProcessResponse(client_, response_); + + var status_ = (int)response_.StatusCode; + if (status_ == 200) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new BeeNetDebugApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + return objectResponse_.Object; + } + else + { + var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); + throw new BeeNetDebugApiException("Default response", status_, responseData_, headers_, null); + } + } + finally + { + if (disposeResponse_) + response_.Dispose(); + } + } + } + finally + { + if (disposeClient_) + client_.Dispose(); + } + } + + protected struct ObjectResponseResult + { + public ObjectResponseResult(T responseObject, string responseText) + { + this.Object = responseObject; + this.Text = responseText; + } + + public T Object { get; } + + public string Text { get; } + } + + public bool ReadResponseAsString { get; set; } + + protected virtual async System.Threading.Tasks.Task> ReadObjectResponseAsync(System.Net.Http.HttpResponseMessage response, System.Collections.Generic.IReadOnlyDictionary> headers, System.Threading.CancellationToken cancellationToken) + { + if (response == null || response.Content == null) + { + return new ObjectResponseResult(default(T)!, string.Empty); + } + + if (ReadResponseAsString) + { + var responseText = await response.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + var typedBody = System.Text.Json.JsonSerializer.Deserialize(responseText, JsonSerializerSettings); + return new ObjectResponseResult(typedBody!, responseText); + } + catch (System.Text.Json.JsonException exception) + { + var message = "Could not deserialize the response body string as " + typeof(T).FullName + "."; + throw new BeeNetDebugApiException(message, (int)response.StatusCode, responseText, headers, exception); + } + } + else + { + try + { + using (var responseStream = await response.Content.ReadAsStreamAsync().ConfigureAwait(false)) + { + var typedBody = await System.Text.Json.JsonSerializer.DeserializeAsync(responseStream, JsonSerializerSettings, cancellationToken).ConfigureAwait(false); + return new ObjectResponseResult(typedBody!, string.Empty); + } + } + catch (System.Text.Json.JsonException exception) + { + var message = "Could not deserialize the response body stream as " + typeof(T).FullName + "."; + throw new BeeNetDebugApiException(message, (int)response.StatusCode, string.Empty, headers, exception); + } + } + } + + private string ConvertToString(object? value, System.Globalization.CultureInfo cultureInfo) + { + if (value == null) + { + return ""; + } + + if (value is System.Enum) + { + var name = System.Enum.GetName(value.GetType(), value); + if (name != null) + { + var field = System.Reflection.IntrospectionExtensions.GetTypeInfo(value.GetType()).GetDeclaredField(name); + if (field != null) + { + var attribute = System.Reflection.CustomAttributeExtensions.GetCustomAttribute(field, typeof(System.Runtime.Serialization.EnumMemberAttribute)) + as System.Runtime.Serialization.EnumMemberAttribute; + if (attribute != null) + { + return attribute.Value != null ? attribute.Value : name; + } + } + + var converted = System.Convert.ToString(System.Convert.ChangeType(value, System.Enum.GetUnderlyingType(value.GetType()), cultureInfo)); + return converted == null ? string.Empty : converted; + } + } + else if (value is bool) + { + return System.Convert.ToString((bool)value, cultureInfo).ToLowerInvariant(); + } + else if (value is byte[]) + { + return System.Convert.ToBase64String((byte[]) value); + } + else if (value.GetType().IsArray) + { + var array = System.Linq.Enumerable.OfType((System.Array) value); + return string.Join(",", System.Linq.Enumerable.Select(array, o => ConvertToString(o, cultureInfo))); + } + + var result = System.Convert.ToString(value, cultureInfo); + return result == null ? "" : result; + } + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.10.0 (NJsonSchema v10.6.10.0 (Newtonsoft.Json v12.0.0.0))")] + public partial class Body + { + + [System.Text.Json.Serialization.JsonPropertyName("welcomeMessage")] + public string WelcomeMessage { get; set; } = default!; + + private System.Collections.Generic.IDictionary _additionalProperties = new System.Collections.Generic.Dictionary(); + + [System.Text.Json.Serialization.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties; } + set { _additionalProperties = value; } + } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.10.0 (NJsonSchema v10.6.10.0 (Newtonsoft.Json v12.0.0.0))")] + public partial class Response + { + + [System.Text.Json.Serialization.JsonPropertyName("overlay")] + [System.ComponentModel.DataAnnotations.RegularExpression(@"^[A-Fa-f0-9]{64}$")] + public string Overlay { get; set; } = default!; + + [System.Text.Json.Serialization.JsonPropertyName("underlay")] + public System.Collections.Generic.ICollection Underlay { get; set; } = default!; + + [System.Text.Json.Serialization.JsonPropertyName("ethereum")] + [System.ComponentModel.DataAnnotations.RegularExpression(@"^[A-Fa-f0-9]{40}$")] + public string Ethereum { get; set; } = default!; + + [System.Text.Json.Serialization.JsonPropertyName("publicKey")] + [System.ComponentModel.DataAnnotations.RegularExpression(@"^[A-Fa-f0-9]{66}$")] + public string PublicKey { get; set; } = default!; + + [System.Text.Json.Serialization.JsonPropertyName("pssPublicKey")] + [System.ComponentModel.DataAnnotations.RegularExpression(@"^[A-Fa-f0-9]{66}$")] + public string PssPublicKey { get; set; } = default!; + + private System.Collections.Generic.IDictionary _additionalProperties = new System.Collections.Generic.Dictionary(); + + [System.Text.Json.Serialization.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties; } + set { _additionalProperties = value; } + } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.10.0 (NJsonSchema v10.6.10.0 (Newtonsoft.Json v12.0.0.0))")] + public partial class Response2 + { + + [System.Text.Json.Serialization.JsonPropertyName("balances")] + public System.Collections.Generic.ICollection Balances { get; set; } = default!; + + private System.Collections.Generic.IDictionary _additionalProperties = new System.Collections.Generic.Dictionary(); + + [System.Text.Json.Serialization.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties; } + set { _additionalProperties = value; } + } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.10.0 (NJsonSchema v10.6.10.0 (Newtonsoft.Json v12.0.0.0))")] + public partial class Response3 + { + + [System.Text.Json.Serialization.JsonPropertyName("peer")] + [System.ComponentModel.DataAnnotations.RegularExpression(@"^[A-Fa-f0-9]{64}$")] + public string Peer { get; set; } = default!; + + /// + /// Numeric string that represents integer which might exceeds `Number.MAX_SAFE_INTEGER` limit (2^53-1) + /// + + [System.Text.Json.Serialization.JsonPropertyName("balance")] + public string Balance { get; set; } = default!; + + private System.Collections.Generic.IDictionary _additionalProperties = new System.Collections.Generic.Dictionary(); + + [System.Text.Json.Serialization.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties; } + set { _additionalProperties = value; } + } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.10.0 (NJsonSchema v10.6.10.0 (Newtonsoft.Json v12.0.0.0))")] + public partial class Response4 + { + + [System.Text.Json.Serialization.JsonPropertyName("peers")] + public System.Collections.Generic.ICollection Peers { get; set; } = default!; + + private System.Collections.Generic.IDictionary _additionalProperties = new System.Collections.Generic.Dictionary(); + + [System.Text.Json.Serialization.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties; } + set { _additionalProperties = value; } + } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.10.0 (NJsonSchema v10.6.10.0 (Newtonsoft.Json v12.0.0.0))")] + public partial class Response5 + { + + [System.Text.Json.Serialization.JsonPropertyName("balances")] + public System.Collections.Generic.ICollection Balances { get; set; } = default!; + + private System.Collections.Generic.IDictionary _additionalProperties = new System.Collections.Generic.Dictionary(); + + [System.Text.Json.Serialization.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties; } + set { _additionalProperties = value; } + } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.10.0 (NJsonSchema v10.6.10.0 (Newtonsoft.Json v12.0.0.0))")] + public partial class Response6 + { + + [System.Text.Json.Serialization.JsonPropertyName("peer")] + [System.ComponentModel.DataAnnotations.RegularExpression(@"^[A-Fa-f0-9]{64}$")] + public string Peer { get; set; } = default!; + + /// + /// Numeric string that represents integer which might exceeds `Number.MAX_SAFE_INTEGER` limit (2^53-1) + /// + + [System.Text.Json.Serialization.JsonPropertyName("balance")] + public string Balance { get; set; } = default!; + + private System.Collections.Generic.IDictionary _additionalProperties = new System.Collections.Generic.Dictionary(); + + [System.Text.Json.Serialization.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties; } + set { _additionalProperties = value; } + } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.10.0 (NJsonSchema v10.6.10.0 (Newtonsoft.Json v12.0.0.0))")] + public partial class Response7 + { + + [System.Text.Json.Serialization.JsonPropertyName("chequebookAddress")] + [System.ComponentModel.DataAnnotations.RegularExpression(@"^[A-Fa-f0-9]{40}$")] + public string ChequebookAddress { get; set; } = default!; + + private System.Collections.Generic.IDictionary _additionalProperties = new System.Collections.Generic.Dictionary(); + + [System.Text.Json.Serialization.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties; } + set { _additionalProperties = value; } + } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.10.0 (NJsonSchema v10.6.10.0 (Newtonsoft.Json v12.0.0.0))")] + public partial class Response8 + { + /// + /// Numeric string that represents integer which might exceeds `Number.MAX_SAFE_INTEGER` limit (2^53-1) + /// + + [System.Text.Json.Serialization.JsonPropertyName("totalBalance")] + public string TotalBalance { get; set; } = default!; + + /// + /// Numeric string that represents integer which might exceeds `Number.MAX_SAFE_INTEGER` limit (2^53-1) + /// + + [System.Text.Json.Serialization.JsonPropertyName("availableBalance")] + public string AvailableBalance { get; set; } = default!; + + private System.Collections.Generic.IDictionary _additionalProperties = new System.Collections.Generic.Dictionary(); + + [System.Text.Json.Serialization.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties; } + set { _additionalProperties = value; } + } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.10.0 (NJsonSchema v10.6.10.0 (Newtonsoft.Json v12.0.0.0))")] + public partial class Response9 + { + + [System.Text.Json.Serialization.JsonPropertyName("message")] + public string Message { get; set; } = default!; + + [System.Text.Json.Serialization.JsonPropertyName("code")] + public int Code { get; set; } = default!; + + private System.Collections.Generic.IDictionary _additionalProperties = new System.Collections.Generic.Dictionary(); + + [System.Text.Json.Serialization.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties; } + set { _additionalProperties = value; } + } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.10.0 (NJsonSchema v10.6.10.0 (Newtonsoft.Json v12.0.0.0))")] + public partial class Response10 + { + + [System.Text.Json.Serialization.JsonPropertyName("message")] + public string Message { get; set; } = default!; + + [System.Text.Json.Serialization.JsonPropertyName("code")] + public int Code { get; set; } = default!; + + private System.Collections.Generic.IDictionary _additionalProperties = new System.Collections.Generic.Dictionary(); + + [System.Text.Json.Serialization.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties; } + set { _additionalProperties = value; } + } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.10.0 (NJsonSchema v10.6.10.0 (Newtonsoft.Json v12.0.0.0))")] + public partial class Response11 + { + + [System.Text.Json.Serialization.JsonPropertyName("address")] + [System.ComponentModel.DataAnnotations.RegularExpression(@"^[A-Fa-f0-9]{64}$")] + public string Address { get; set; } = default!; + + private System.Collections.Generic.IDictionary _additionalProperties = new System.Collections.Generic.Dictionary(); + + [System.Text.Json.Serialization.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties; } + set { _additionalProperties = value; } + } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.10.0 (NJsonSchema v10.6.10.0 (Newtonsoft.Json v12.0.0.0))")] + public partial class Response12 + { + + [System.Text.Json.Serialization.JsonPropertyName("radius")] + public int Radius { get; set; } = default!; + + [System.Text.Json.Serialization.JsonPropertyName("available")] + public int Available { get; set; } = default!; + + /// + /// Numeric string that represents integer which might exceeds `Number.MAX_SAFE_INTEGER` limit (2^53-1) + /// + + [System.Text.Json.Serialization.JsonPropertyName("outer")] + public string Outer { get; set; } = default!; + + /// + /// Numeric string that represents integer which might exceeds `Number.MAX_SAFE_INTEGER` limit (2^53-1) + /// + + [System.Text.Json.Serialization.JsonPropertyName("inner")] + public string Inner { get; set; } = default!; + + private System.Collections.Generic.IDictionary _additionalProperties = new System.Collections.Generic.Dictionary(); + + [System.Text.Json.Serialization.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties; } + set { _additionalProperties = value; } + } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.10.0 (NJsonSchema v10.6.10.0 (Newtonsoft.Json v12.0.0.0))")] + public partial class Response13 + { + + [System.Text.Json.Serialization.JsonPropertyName("block")] + public int Block { get; set; } = default!; + + [System.Text.Json.Serialization.JsonPropertyName("totalAmount")] + public int TotalAmount { get; set; } = default!; + + [System.Text.Json.Serialization.JsonPropertyName("currentPrice")] + public int CurrentPrice { get; set; } = default!; + + private System.Collections.Generic.IDictionary _additionalProperties = new System.Collections.Generic.Dictionary(); + + [System.Text.Json.Serialization.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties; } + set { _additionalProperties = value; } + } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.10.0 (NJsonSchema v10.6.10.0 (Newtonsoft.Json v12.0.0.0))")] + public partial class Response14 + { + /// + /// Gives back in what mode the Bee client has been started. The modes are mutually exclusive * `light` - light node; does not participate in forwarding or storing chunks * `full` - full node * `dev` - development mode; Bee client for development purposes, blockchain operations are mocked + ///
+ ///
+ + [System.Text.Json.Serialization.JsonPropertyName("beeMode")] + [System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.JsonStringEnumConverter))] + public Response14BeeMode BeeMode { get; set; } = default!; + + [System.Text.Json.Serialization.JsonPropertyName("gatewayMode")] + public bool GatewayMode { get; set; } = default!; + + [System.Text.Json.Serialization.JsonPropertyName("chequebookEnabled")] + public bool ChequebookEnabled { get; set; } = default!; + + [System.Text.Json.Serialization.JsonPropertyName("swapEnabled")] + public bool SwapEnabled { get; set; } = default!; + + private System.Collections.Generic.IDictionary _additionalProperties = new System.Collections.Generic.Dictionary(); + + [System.Text.Json.Serialization.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties; } + set { _additionalProperties = value; } + } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.10.0 (NJsonSchema v10.6.10.0 (Newtonsoft.Json v12.0.0.0))")] + public partial class Response15 + { + + [System.Text.Json.Serialization.JsonPropertyName("status")] + public string Status { get; set; } = default!; + + [System.Text.Json.Serialization.JsonPropertyName("version")] + public string Version { get; set; } = default!; + + /// + /// The default value is set in case the bee binary was not build correctly. + /// + + [System.Text.Json.Serialization.JsonPropertyName("apiVersion")] + public string ApiVersion { get; set; } = "0.0.0"; + + /// + /// The default value is set in case the bee binary was not build correctly. + /// + + [System.Text.Json.Serialization.JsonPropertyName("debugApiVersion")] + public string DebugApiVersion { get; set; } = "0.0.0"; + + private System.Collections.Generic.IDictionary _additionalProperties = new System.Collections.Generic.Dictionary(); + + [System.Text.Json.Serialization.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties; } + set { _additionalProperties = value; } + } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.10.0 (NJsonSchema v10.6.10.0 (Newtonsoft.Json v12.0.0.0))")] + public partial class Response16 + { + + [System.Text.Json.Serialization.JsonPropertyName("peers")] + public System.Collections.Generic.ICollection Peers { get; set; } = default!; + + private System.Collections.Generic.IDictionary _additionalProperties = new System.Collections.Generic.Dictionary(); + + [System.Text.Json.Serialization.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties; } + set { _additionalProperties = value; } + } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.10.0 (NJsonSchema v10.6.10.0 (Newtonsoft.Json v12.0.0.0))")] + public partial class Response17 + { + + [System.Text.Json.Serialization.JsonPropertyName("message")] + public string Message { get; set; } = default!; + + [System.Text.Json.Serialization.JsonPropertyName("code")] + public int Code { get; set; } = default!; + + private System.Collections.Generic.IDictionary _additionalProperties = new System.Collections.Generic.Dictionary(); + + [System.Text.Json.Serialization.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties; } + set { _additionalProperties = value; } + } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.10.0 (NJsonSchema v10.6.10.0 (Newtonsoft.Json v12.0.0.0))")] + public partial class Response18 + { + /// + /// Go time.Duration format + /// + + [System.Text.Json.Serialization.JsonPropertyName("rtt")] + public string Rtt { get; set; } = default!; + + private System.Collections.Generic.IDictionary _additionalProperties = new System.Collections.Generic.Dictionary(); + + [System.Text.Json.Serialization.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties; } + set { _additionalProperties = value; } + } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.10.0 (NJsonSchema v10.6.10.0 (Newtonsoft.Json v12.0.0.0))")] + public partial class Response19 + { + + [System.Text.Json.Serialization.JsonPropertyName("status")] + public string Status { get; set; } = default!; + + [System.Text.Json.Serialization.JsonPropertyName("version")] + public string Version { get; set; } = default!; + + /// + /// The default value is set in case the bee binary was not build correctly. + /// + + [System.Text.Json.Serialization.JsonPropertyName("apiVersion")] + public string ApiVersion { get; set; } = "0.0.0"; + + /// + /// The default value is set in case the bee binary was not build correctly. + /// + + [System.Text.Json.Serialization.JsonPropertyName("debugApiVersion")] + public string DebugApiVersion { get; set; } = "0.0.0"; + + private System.Collections.Generic.IDictionary _additionalProperties = new System.Collections.Generic.Dictionary(); + + [System.Text.Json.Serialization.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties; } + set { _additionalProperties = value; } + } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.10.0 (NJsonSchema v10.6.10.0 (Newtonsoft.Json v12.0.0.0))")] + public partial class Response20 + { + + [System.Text.Json.Serialization.JsonPropertyName("peer")] + [System.ComponentModel.DataAnnotations.RegularExpression(@"^[A-Fa-f0-9]{64}$")] + public string Peer { get; set; } = default!; + + [System.Text.Json.Serialization.JsonPropertyName("received")] + public int Received { get; set; } = default!; + + [System.Text.Json.Serialization.JsonPropertyName("sent")] + public int Sent { get; set; } = default!; + + private System.Collections.Generic.IDictionary _additionalProperties = new System.Collections.Generic.Dictionary(); + + [System.Text.Json.Serialization.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties; } + set { _additionalProperties = value; } + } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.10.0 (NJsonSchema v10.6.10.0 (Newtonsoft.Json v12.0.0.0))")] + public partial class Response21 + { + + [System.Text.Json.Serialization.JsonPropertyName("totalReceived")] + public int TotalReceived { get; set; } = default!; + + [System.Text.Json.Serialization.JsonPropertyName("totalSent")] + public int TotalSent { get; set; } = default!; + + [System.Text.Json.Serialization.JsonPropertyName("settlements")] + public System.Collections.Generic.ICollection Settlements { get; set; } = default!; + + private System.Collections.Generic.IDictionary _additionalProperties = new System.Collections.Generic.Dictionary(); + + [System.Text.Json.Serialization.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties; } + set { _additionalProperties = value; } + } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.10.0 (NJsonSchema v10.6.10.0 (Newtonsoft.Json v12.0.0.0))")] + public partial class Response22 + { + + [System.Text.Json.Serialization.JsonPropertyName("totalReceived")] + public int TotalReceived { get; set; } = default!; + + [System.Text.Json.Serialization.JsonPropertyName("totalSent")] + public int TotalSent { get; set; } = default!; + + [System.Text.Json.Serialization.JsonPropertyName("settlements")] + public System.Collections.Generic.ICollection Settlements { get; set; } = default!; + + private System.Collections.Generic.IDictionary _additionalProperties = new System.Collections.Generic.Dictionary(); + + [System.Text.Json.Serialization.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties; } + set { _additionalProperties = value; } + } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.10.0 (NJsonSchema v10.6.10.0 (Newtonsoft.Json v12.0.0.0))")] + public partial class Response23 + { + + [System.Text.Json.Serialization.JsonPropertyName("baseAddr")] + [System.ComponentModel.DataAnnotations.RegularExpression(@"^[A-Fa-f0-9]{64}$")] + public string BaseAddr { get; set; } = default!; + + [System.Text.Json.Serialization.JsonPropertyName("population")] + public int Population { get; set; } = default!; + + [System.Text.Json.Serialization.JsonPropertyName("connected")] + public int Connected { get; set; } = default!; + + [System.Text.Json.Serialization.JsonPropertyName("timestamp")] + public string Timestamp { get; set; } = default!; + + [System.Text.Json.Serialization.JsonPropertyName("nnLowWatermark")] + public int NnLowWatermark { get; set; } = default!; + + [System.Text.Json.Serialization.JsonPropertyName("depth")] + public int Depth { get; set; } = default!; + + [System.Text.Json.Serialization.JsonPropertyName("bins")] + public System.Collections.Generic.IDictionary Bins { get; set; } = default!; + + private System.Collections.Generic.IDictionary _additionalProperties = new System.Collections.Generic.Dictionary(); + + [System.Text.Json.Serialization.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties; } + set { _additionalProperties = value; } + } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.10.0 (NJsonSchema v10.6.10.0 (Newtonsoft.Json v12.0.0.0))")] + public partial class Response24 + { + + [System.Text.Json.Serialization.JsonPropertyName("welcomeMessage")] + public string WelcomeMessage { get; set; } = default!; + + private System.Collections.Generic.IDictionary _additionalProperties = new System.Collections.Generic.Dictionary(); + + [System.Text.Json.Serialization.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties; } + set { _additionalProperties = value; } + } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.10.0 (NJsonSchema v10.6.10.0 (Newtonsoft.Json v12.0.0.0))")] + public partial class Response25 + { + + [System.Text.Json.Serialization.JsonPropertyName("status")] + public string Status { get; set; } = default!; + + [System.Text.Json.Serialization.JsonPropertyName("version")] + public string Version { get; set; } = default!; + + /// + /// The default value is set in case the bee binary was not build correctly. + /// + + [System.Text.Json.Serialization.JsonPropertyName("apiVersion")] + public string ApiVersion { get; set; } = "0.0.0"; + + /// + /// The default value is set in case the bee binary was not build correctly. + /// + + [System.Text.Json.Serialization.JsonPropertyName("debugApiVersion")] + public string DebugApiVersion { get; set; } = "0.0.0"; + + private System.Collections.Generic.IDictionary _additionalProperties = new System.Collections.Generic.Dictionary(); + + [System.Text.Json.Serialization.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties; } + set { _additionalProperties = value; } + } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.10.0 (NJsonSchema v10.6.10.0 (Newtonsoft.Json v12.0.0.0))")] + public partial class Response26 + { + + [System.Text.Json.Serialization.JsonPropertyName("peer")] + [System.ComponentModel.DataAnnotations.RegularExpression(@"^[A-Fa-f0-9]{64}$")] + public string Peer { get; set; } = default!; + + [System.Text.Json.Serialization.JsonPropertyName("lastCashedCheque")] + public LastCashedCheque LastCashedCheque { get; set; } = default!; + + [System.Text.Json.Serialization.JsonPropertyName("transactionHash")] + [System.ComponentModel.DataAnnotations.RegularExpression(@"^0x[A-Fa-f0-9]{64}$")] + public string TransactionHash { get; set; } = default!; + + [System.Text.Json.Serialization.JsonPropertyName("result")] + public Result Result { get; set; } = default!; + + /// + /// Numeric string that represents integer which might exceeds `Number.MAX_SAFE_INTEGER` limit (2^53-1) + /// + + [System.Text.Json.Serialization.JsonPropertyName("uncashedAmount")] + public string UncashedAmount { get; set; } = default!; + + private System.Collections.Generic.IDictionary _additionalProperties = new System.Collections.Generic.Dictionary(); + + [System.Text.Json.Serialization.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties; } + set { _additionalProperties = value; } + } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.10.0 (NJsonSchema v10.6.10.0 (Newtonsoft.Json v12.0.0.0))")] + public partial class Response27 + { + + [System.Text.Json.Serialization.JsonPropertyName("transactionHash")] + [System.ComponentModel.DataAnnotations.RegularExpression(@"^0x[A-Fa-f0-9]{64}$")] + public string TransactionHash { get; set; } = default!; + + private System.Collections.Generic.IDictionary _additionalProperties = new System.Collections.Generic.Dictionary(); + + [System.Text.Json.Serialization.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties; } + set { _additionalProperties = value; } + } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.10.0 (NJsonSchema v10.6.10.0 (Newtonsoft.Json v12.0.0.0))")] + public partial class Response28 + { + + [System.Text.Json.Serialization.JsonPropertyName("peer")] + [System.ComponentModel.DataAnnotations.RegularExpression(@"^[A-Fa-f0-9]{64}$")] + public string Peer { get; set; } = default!; + + [System.Text.Json.Serialization.JsonPropertyName("lastreceived")] + public Lastreceived Lastreceived { get; set; } = default!; + + [System.Text.Json.Serialization.JsonPropertyName("lastsent")] + public Lastsent Lastsent { get; set; } = default!; + + private System.Collections.Generic.IDictionary _additionalProperties = new System.Collections.Generic.Dictionary(); + + [System.Text.Json.Serialization.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties; } + set { _additionalProperties = value; } + } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.10.0 (NJsonSchema v10.6.10.0 (Newtonsoft.Json v12.0.0.0))")] + public partial class Response29 + { + + [System.Text.Json.Serialization.JsonPropertyName("lastcheques")] + public System.Collections.Generic.ICollection Lastcheques { get; set; } = default!; + + private System.Collections.Generic.IDictionary _additionalProperties = new System.Collections.Generic.Dictionary(); + + [System.Text.Json.Serialization.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties; } + set { _additionalProperties = value; } + } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.10.0 (NJsonSchema v10.6.10.0 (Newtonsoft.Json v12.0.0.0))")] + public partial class Response30 + { + + [System.Text.Json.Serialization.JsonPropertyName("transactionHash")] + [System.ComponentModel.DataAnnotations.RegularExpression(@"^0x[A-Fa-f0-9]{64}$")] + public string TransactionHash { get; set; } = default!; + + private System.Collections.Generic.IDictionary _additionalProperties = new System.Collections.Generic.Dictionary(); + + [System.Text.Json.Serialization.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties; } + set { _additionalProperties = value; } + } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.10.0 (NJsonSchema v10.6.10.0 (Newtonsoft.Json v12.0.0.0))")] + public partial class Response31 + { + + [System.Text.Json.Serialization.JsonPropertyName("transactionHash")] + [System.ComponentModel.DataAnnotations.RegularExpression(@"^0x[A-Fa-f0-9]{64}$")] + public string TransactionHash { get; set; } = default!; + + private System.Collections.Generic.IDictionary _additionalProperties = new System.Collections.Generic.Dictionary(); + + [System.Text.Json.Serialization.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties; } + set { _additionalProperties = value; } + } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.10.0 (NJsonSchema v10.6.10.0 (Newtonsoft.Json v12.0.0.0))")] + public partial class Response32 + { + + [System.Text.Json.Serialization.JsonPropertyName("total")] + public int Total { get; set; } = default!; + + [System.Text.Json.Serialization.JsonPropertyName("split")] + public int Split { get; set; } = default!; + + [System.Text.Json.Serialization.JsonPropertyName("seen")] + public int Seen { get; set; } = default!; + + [System.Text.Json.Serialization.JsonPropertyName("stored")] + public int Stored { get; set; } = default!; + + [System.Text.Json.Serialization.JsonPropertyName("sent")] + public int Sent { get; set; } = default!; + + [System.Text.Json.Serialization.JsonPropertyName("synced")] + public int Synced { get; set; } = default!; + + [System.Text.Json.Serialization.JsonPropertyName("uid")] + public int Uid { get; set; } = default!; + + [System.Text.Json.Serialization.JsonPropertyName("address")] + [System.ComponentModel.DataAnnotations.RegularExpression(@"^[A-Fa-f0-9]{64}$")] + public string Address { get; set; } = default!; + + [System.Text.Json.Serialization.JsonPropertyName("startedAt")] + public System.DateTimeOffset StartedAt { get; set; } = default!; + + private System.Collections.Generic.IDictionary _additionalProperties = new System.Collections.Generic.Dictionary(); + + [System.Text.Json.Serialization.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties; } + set { _additionalProperties = value; } + } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.10.0 (NJsonSchema v10.6.10.0 (Newtonsoft.Json v12.0.0.0))")] + public partial class Response33 + { + + [System.Text.Json.Serialization.JsonPropertyName("pendingTransactions")] + public System.Collections.Generic.ICollection PendingTransactions { get; set; } = default!; + + private System.Collections.Generic.IDictionary _additionalProperties = new System.Collections.Generic.Dictionary(); + + [System.Text.Json.Serialization.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties; } + set { _additionalProperties = value; } + } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.10.0 (NJsonSchema v10.6.10.0 (Newtonsoft.Json v12.0.0.0))")] + public partial class Response34 + { + + [System.Text.Json.Serialization.JsonPropertyName("transactionHash")] + [System.ComponentModel.DataAnnotations.RegularExpression(@"^0x[A-Fa-f0-9]{64}$")] + public string TransactionHash { get; set; } = default!; + + [System.Text.Json.Serialization.JsonPropertyName("to")] + [System.ComponentModel.DataAnnotations.RegularExpression(@"^[A-Fa-f0-9]{40}$")] + public string To { get; set; } = default!; + + [System.Text.Json.Serialization.JsonPropertyName("nonce")] + public int Nonce { get; set; } = default!; + + /// + /// Numeric string that represents integer which might exceeds `Number.MAX_SAFE_INTEGER` limit (2^53-1) + /// + + [System.Text.Json.Serialization.JsonPropertyName("gasPrice")] + public string GasPrice { get; set; } = default!; + + [System.Text.Json.Serialization.JsonPropertyName("gasLimit")] + public long GasLimit { get; set; } = default!; + + [System.Text.Json.Serialization.JsonPropertyName("data")] + public string Data { get; set; } = default!; + + [System.Text.Json.Serialization.JsonPropertyName("created")] + public System.DateTimeOffset Created { get; set; } = default!; + + [System.Text.Json.Serialization.JsonPropertyName("description")] + public string Description { get; set; } = default!; + + /// + /// Numeric string that represents integer which might exceeds `Number.MAX_SAFE_INTEGER` limit (2^53-1) + /// + + [System.Text.Json.Serialization.JsonPropertyName("value")] + public string Value { get; set; } = default!; + + private System.Collections.Generic.IDictionary _additionalProperties = new System.Collections.Generic.Dictionary(); + + [System.Text.Json.Serialization.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties; } + set { _additionalProperties = value; } + } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.10.0 (NJsonSchema v10.6.10.0 (Newtonsoft.Json v12.0.0.0))")] + public partial class Response35 + { + + [System.Text.Json.Serialization.JsonPropertyName("transactionHash")] + [System.ComponentModel.DataAnnotations.RegularExpression(@"^0x[A-Fa-f0-9]{64}$")] + public string TransactionHash { get; set; } = default!; + + private System.Collections.Generic.IDictionary _additionalProperties = new System.Collections.Generic.Dictionary(); + + [System.Text.Json.Serialization.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties; } + set { _additionalProperties = value; } + } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.10.0 (NJsonSchema v10.6.10.0 (Newtonsoft.Json v12.0.0.0))")] + public partial class Response36 + { + + [System.Text.Json.Serialization.JsonPropertyName("transactionHash")] + [System.ComponentModel.DataAnnotations.RegularExpression(@"^0x[A-Fa-f0-9]{64}$")] + public string TransactionHash { get; set; } = default!; + + private System.Collections.Generic.IDictionary _additionalProperties = new System.Collections.Generic.Dictionary(); + + [System.Text.Json.Serialization.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties; } + set { _additionalProperties = value; } + } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.10.0 (NJsonSchema v10.6.10.0 (Newtonsoft.Json v12.0.0.0))")] + public partial class Response37 + { + + [System.Text.Json.Serialization.JsonPropertyName("stamps")] + public System.Collections.Generic.ICollection Stamps { get; set; } = default!; + + private System.Collections.Generic.IDictionary _additionalProperties = new System.Collections.Generic.Dictionary(); + + [System.Text.Json.Serialization.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties; } + set { _additionalProperties = value; } + } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.10.0 (NJsonSchema v10.6.10.0 (Newtonsoft.Json v12.0.0.0))")] + public partial class Response38 : Etherna.BeeNet.Clients.DebugApi.DtoFixer.PostageBatchDto + { + + private System.Collections.Generic.IDictionary _additionalProperties = new System.Collections.Generic.Dictionary(); + + [System.Text.Json.Serialization.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties; } + set { _additionalProperties = value; } + } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.10.0 (NJsonSchema v10.6.10.0 (Newtonsoft.Json v12.0.0.0))")] + public partial class Response39 + { + + [System.Text.Json.Serialization.JsonPropertyName("depth")] + public int Depth { get; set; } = default!; + + [System.Text.Json.Serialization.JsonPropertyName("bucketDepth")] + public int BucketDepth { get; set; } = default!; + + [System.Text.Json.Serialization.JsonPropertyName("bucketUpperBound")] + public int BucketUpperBound { get; set; } = default!; + + [System.Text.Json.Serialization.JsonPropertyName("buckets")] + public System.Collections.Generic.ICollection Buckets { get; set; } = default!; + + private System.Collections.Generic.IDictionary _additionalProperties = new System.Collections.Generic.Dictionary(); + + [System.Text.Json.Serialization.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties; } + set { _additionalProperties = value; } + } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.10.0 (NJsonSchema v10.6.10.0 (Newtonsoft.Json v12.0.0.0))")] + public partial class Response40 + { + + [System.Text.Json.Serialization.JsonPropertyName("batchID")] + [System.ComponentModel.DataAnnotations.RegularExpression(@"^[A-Fa-f0-9]{64}$")] + public string BatchID { get; set; } = default!; + + private System.Collections.Generic.IDictionary _additionalProperties = new System.Collections.Generic.Dictionary(); + + [System.Text.Json.Serialization.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties; } + set { _additionalProperties = value; } + } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.10.0 (NJsonSchema v10.6.10.0 (Newtonsoft.Json v12.0.0.0))")] + public partial class Response41 + { + + [System.Text.Json.Serialization.JsonPropertyName("batchID")] + [System.ComponentModel.DataAnnotations.RegularExpression(@"^[A-Fa-f0-9]{64}$")] + public string BatchID { get; set; } = default!; + + private System.Collections.Generic.IDictionary _additionalProperties = new System.Collections.Generic.Dictionary(); + + [System.Text.Json.Serialization.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties; } + set { _additionalProperties = value; } + } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.10.0 (NJsonSchema v10.6.10.0 (Newtonsoft.Json v12.0.0.0))")] + public partial class Response42 + { + + [System.Text.Json.Serialization.JsonPropertyName("batchID")] + [System.ComponentModel.DataAnnotations.RegularExpression(@"^[A-Fa-f0-9]{64}$")] + public string BatchID { get; set; } = default!; + + private System.Collections.Generic.IDictionary _additionalProperties = new System.Collections.Generic.Dictionary(); + + [System.Text.Json.Serialization.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties; } + set { _additionalProperties = value; } + } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.10.0 (NJsonSchema v10.6.10.0 (Newtonsoft.Json v12.0.0.0))")] + public partial class Response43 + { + + [System.Text.Json.Serialization.JsonPropertyName("batches")] + public System.Collections.Generic.ICollection Batches { get; set; } = default!; + + private System.Collections.Generic.IDictionary _additionalProperties = new System.Collections.Generic.Dictionary(); + + [System.Text.Json.Serialization.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties; } + set { _additionalProperties = value; } + } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.10.0 (NJsonSchema v10.6.10.0 (Newtonsoft.Json v12.0.0.0))")] + public partial class Response44 + { + + [System.Text.Json.Serialization.JsonPropertyName("message")] + public string Message { get; set; } = default!; + + [System.Text.Json.Serialization.JsonPropertyName("code")] + public int Code { get; set; } = default!; + + private System.Collections.Generic.IDictionary _additionalProperties = new System.Collections.Generic.Dictionary(); + + [System.Text.Json.Serialization.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties; } + set { _additionalProperties = value; } + } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.10.0 (NJsonSchema v10.6.10.0 (Newtonsoft.Json v12.0.0.0))")] + public partial class Response45 + { + + [System.Text.Json.Serialization.JsonPropertyName("message")] + public string Message { get; set; } = default!; + + [System.Text.Json.Serialization.JsonPropertyName("code")] + public int Code { get; set; } = default!; + + private System.Collections.Generic.IDictionary _additionalProperties = new System.Collections.Generic.Dictionary(); + + [System.Text.Json.Serialization.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties; } + set { _additionalProperties = value; } + } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.10.0 (NJsonSchema v10.6.10.0 (Newtonsoft.Json v12.0.0.0))")] + public partial class Response46 + { + + [System.Text.Json.Serialization.JsonPropertyName("message")] + public string Message { get; set; } = default!; + + [System.Text.Json.Serialization.JsonPropertyName("code")] + public int Code { get; set; } = default!; + + private System.Collections.Generic.IDictionary _additionalProperties = new System.Collections.Generic.Dictionary(); + + [System.Text.Json.Serialization.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties; } + set { _additionalProperties = value; } + } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.10.0 (NJsonSchema v10.6.10.0 (Newtonsoft.Json v12.0.0.0))")] + public partial class Response47 + { + + [System.Text.Json.Serialization.JsonPropertyName("message")] + public string Message { get; set; } = default!; + + [System.Text.Json.Serialization.JsonPropertyName("code")] + public int Code { get; set; } = default!; + + private System.Collections.Generic.IDictionary _additionalProperties = new System.Collections.Generic.Dictionary(); + + [System.Text.Json.Serialization.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties; } + set { _additionalProperties = value; } + } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.10.0 (NJsonSchema v10.6.10.0 (Newtonsoft.Json v12.0.0.0))")] + public partial class Response48 + { + + [System.Text.Json.Serialization.JsonPropertyName("message")] + public string Message { get; set; } = default!; + + [System.Text.Json.Serialization.JsonPropertyName("code")] + public int Code { get; set; } = default!; + + private System.Collections.Generic.IDictionary _additionalProperties = new System.Collections.Generic.Dictionary(); + + [System.Text.Json.Serialization.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties; } + set { _additionalProperties = value; } + } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.10.0 (NJsonSchema v10.6.10.0 (Newtonsoft.Json v12.0.0.0))")] + public partial class Response49 + { + + [System.Text.Json.Serialization.JsonPropertyName("message")] + public string Message { get; set; } = default!; + + [System.Text.Json.Serialization.JsonPropertyName("code")] + public int Code { get; set; } = default!; + + private System.Collections.Generic.IDictionary _additionalProperties = new System.Collections.Generic.Dictionary(); + + [System.Text.Json.Serialization.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties; } + set { _additionalProperties = value; } + } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.10.0 (NJsonSchema v10.6.10.0 (Newtonsoft.Json v12.0.0.0))")] + public partial class Response50 + { + + [System.Text.Json.Serialization.JsonPropertyName("message")] + public string Message { get; set; } = default!; + + [System.Text.Json.Serialization.JsonPropertyName("code")] + public int Code { get; set; } = default!; + + private System.Collections.Generic.IDictionary _additionalProperties = new System.Collections.Generic.Dictionary(); + + [System.Text.Json.Serialization.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties; } + set { _additionalProperties = value; } + } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.10.0 (NJsonSchema v10.6.10.0 (Newtonsoft.Json v12.0.0.0))")] + public partial class Response51 + { + + [System.Text.Json.Serialization.JsonPropertyName("message")] + public string Message { get; set; } = default!; + + [System.Text.Json.Serialization.JsonPropertyName("code")] + public int Code { get; set; } = default!; + + private System.Collections.Generic.IDictionary _additionalProperties = new System.Collections.Generic.Dictionary(); + + [System.Text.Json.Serialization.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties; } + set { _additionalProperties = value; } + } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.10.0 (NJsonSchema v10.6.10.0 (Newtonsoft.Json v12.0.0.0))")] + public partial class Response52 + { + + [System.Text.Json.Serialization.JsonPropertyName("message")] + public string Message { get; set; } = default!; + + [System.Text.Json.Serialization.JsonPropertyName("code")] + public int Code { get; set; } = default!; + + private System.Collections.Generic.IDictionary _additionalProperties = new System.Collections.Generic.Dictionary(); + + [System.Text.Json.Serialization.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties; } + set { _additionalProperties = value; } + } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.10.0 (NJsonSchema v10.6.10.0 (Newtonsoft.Json v12.0.0.0))")] + public partial class Response53 + { + + [System.Text.Json.Serialization.JsonPropertyName("message")] + public string Message { get; set; } = default!; + + [System.Text.Json.Serialization.JsonPropertyName("code")] + public int Code { get; set; } = default!; + + private System.Collections.Generic.IDictionary _additionalProperties = new System.Collections.Generic.Dictionary(); + + [System.Text.Json.Serialization.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties; } + set { _additionalProperties = value; } + } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.10.0 (NJsonSchema v10.6.10.0 (Newtonsoft.Json v12.0.0.0))")] + public partial class Response54 + { + + [System.Text.Json.Serialization.JsonPropertyName("message")] + public string Message { get; set; } = default!; + + [System.Text.Json.Serialization.JsonPropertyName("code")] + public int Code { get; set; } = default!; + + private System.Collections.Generic.IDictionary _additionalProperties = new System.Collections.Generic.Dictionary(); + + [System.Text.Json.Serialization.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties; } + set { _additionalProperties = value; } + } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.10.0 (NJsonSchema v10.6.10.0 (Newtonsoft.Json v12.0.0.0))")] + public partial class Response55 + { + + [System.Text.Json.Serialization.JsonPropertyName("message")] + public string Message { get; set; } = default!; + + [System.Text.Json.Serialization.JsonPropertyName("code")] + public int Code { get; set; } = default!; + + private System.Collections.Generic.IDictionary _additionalProperties = new System.Collections.Generic.Dictionary(); + + [System.Text.Json.Serialization.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties; } + set { _additionalProperties = value; } + } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.10.0 (NJsonSchema v10.6.10.0 (Newtonsoft.Json v12.0.0.0))")] + public partial class Response56 + { + + [System.Text.Json.Serialization.JsonPropertyName("message")] + public string Message { get; set; } = default!; + + [System.Text.Json.Serialization.JsonPropertyName("code")] + public int Code { get; set; } = default!; + + private System.Collections.Generic.IDictionary _additionalProperties = new System.Collections.Generic.Dictionary(); + + [System.Text.Json.Serialization.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties; } + set { _additionalProperties = value; } + } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.10.0 (NJsonSchema v10.6.10.0 (Newtonsoft.Json v12.0.0.0))")] + public partial class Response57 + { + + [System.Text.Json.Serialization.JsonPropertyName("message")] + public string Message { get; set; } = default!; + + [System.Text.Json.Serialization.JsonPropertyName("code")] + public int Code { get; set; } = default!; + + private System.Collections.Generic.IDictionary _additionalProperties = new System.Collections.Generic.Dictionary(); + + [System.Text.Json.Serialization.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties; } + set { _additionalProperties = value; } + } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.10.0 (NJsonSchema v10.6.10.0 (Newtonsoft.Json v12.0.0.0))")] + public partial class Response58 + { + + [System.Text.Json.Serialization.JsonPropertyName("message")] + public string Message { get; set; } = default!; + + [System.Text.Json.Serialization.JsonPropertyName("code")] + public int Code { get; set; } = default!; + + private System.Collections.Generic.IDictionary _additionalProperties = new System.Collections.Generic.Dictionary(); + + [System.Text.Json.Serialization.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties; } + set { _additionalProperties = value; } + } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.10.0 (NJsonSchema v10.6.10.0 (Newtonsoft.Json v12.0.0.0))")] + public partial class Response59 + { + + [System.Text.Json.Serialization.JsonPropertyName("message")] + public string Message { get; set; } = default!; + + [System.Text.Json.Serialization.JsonPropertyName("code")] + public int Code { get; set; } = default!; + + private System.Collections.Generic.IDictionary _additionalProperties = new System.Collections.Generic.Dictionary(); + + [System.Text.Json.Serialization.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties; } + set { _additionalProperties = value; } + } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.10.0 (NJsonSchema v10.6.10.0 (Newtonsoft.Json v12.0.0.0))")] + public partial class Response60 + { + + [System.Text.Json.Serialization.JsonPropertyName("message")] + public string Message { get; set; } = default!; + + [System.Text.Json.Serialization.JsonPropertyName("code")] + public int Code { get; set; } = default!; + + private System.Collections.Generic.IDictionary _additionalProperties = new System.Collections.Generic.Dictionary(); + + [System.Text.Json.Serialization.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties; } + set { _additionalProperties = value; } + } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.10.0 (NJsonSchema v10.6.10.0 (Newtonsoft.Json v12.0.0.0))")] + public partial class Response61 + { + + [System.Text.Json.Serialization.JsonPropertyName("message")] + public string Message { get; set; } = default!; + + [System.Text.Json.Serialization.JsonPropertyName("code")] + public int Code { get; set; } = default!; + + private System.Collections.Generic.IDictionary _additionalProperties = new System.Collections.Generic.Dictionary(); + + [System.Text.Json.Serialization.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties; } + set { _additionalProperties = value; } + } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.10.0 (NJsonSchema v10.6.10.0 (Newtonsoft.Json v12.0.0.0))")] + public partial class Response62 + { + + [System.Text.Json.Serialization.JsonPropertyName("message")] + public string Message { get; set; } = default!; + + [System.Text.Json.Serialization.JsonPropertyName("code")] + public int Code { get; set; } = default!; + + private System.Collections.Generic.IDictionary _additionalProperties = new System.Collections.Generic.Dictionary(); + + [System.Text.Json.Serialization.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties; } + set { _additionalProperties = value; } + } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.10.0 (NJsonSchema v10.6.10.0 (Newtonsoft.Json v12.0.0.0))")] + public partial class Response63 + { + + [System.Text.Json.Serialization.JsonPropertyName("message")] + public string Message { get; set; } = default!; + + [System.Text.Json.Serialization.JsonPropertyName("code")] + public int Code { get; set; } = default!; + + private System.Collections.Generic.IDictionary _additionalProperties = new System.Collections.Generic.Dictionary(); + + [System.Text.Json.Serialization.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties; } + set { _additionalProperties = value; } + } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.10.0 (NJsonSchema v10.6.10.0 (Newtonsoft.Json v12.0.0.0))")] + public partial class Response64 + { + + [System.Text.Json.Serialization.JsonPropertyName("message")] + public string Message { get; set; } = default!; + + [System.Text.Json.Serialization.JsonPropertyName("code")] + public int Code { get; set; } = default!; + + private System.Collections.Generic.IDictionary _additionalProperties = new System.Collections.Generic.Dictionary(); + + [System.Text.Json.Serialization.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties; } + set { _additionalProperties = value; } + } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.10.0 (NJsonSchema v10.6.10.0 (Newtonsoft.Json v12.0.0.0))")] + public partial class Response65 + { + + [System.Text.Json.Serialization.JsonPropertyName("message")] + public string Message { get; set; } = default!; + + [System.Text.Json.Serialization.JsonPropertyName("code")] + public int Code { get; set; } = default!; + + private System.Collections.Generic.IDictionary _additionalProperties = new System.Collections.Generic.Dictionary(); + + [System.Text.Json.Serialization.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties; } + set { _additionalProperties = value; } + } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.10.0 (NJsonSchema v10.6.10.0 (Newtonsoft.Json v12.0.0.0))")] + public partial class Response66 + { + + [System.Text.Json.Serialization.JsonPropertyName("message")] + public string Message { get; set; } = default!; + + [System.Text.Json.Serialization.JsonPropertyName("code")] + public int Code { get; set; } = default!; + + private System.Collections.Generic.IDictionary _additionalProperties = new System.Collections.Generic.Dictionary(); + + [System.Text.Json.Serialization.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties; } + set { _additionalProperties = value; } + } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.10.0 (NJsonSchema v10.6.10.0 (Newtonsoft.Json v12.0.0.0))")] + public partial class Response67 + { + + [System.Text.Json.Serialization.JsonPropertyName("message")] + public string Message { get; set; } = default!; + + [System.Text.Json.Serialization.JsonPropertyName("code")] + public int Code { get; set; } = default!; + + private System.Collections.Generic.IDictionary _additionalProperties = new System.Collections.Generic.Dictionary(); + + [System.Text.Json.Serialization.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties; } + set { _additionalProperties = value; } + } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.10.0 (NJsonSchema v10.6.10.0 (Newtonsoft.Json v12.0.0.0))")] + public partial class Response68 + { + + [System.Text.Json.Serialization.JsonPropertyName("message")] + public string Message { get; set; } = default!; + + [System.Text.Json.Serialization.JsonPropertyName("code")] + public int Code { get; set; } = default!; + + private System.Collections.Generic.IDictionary _additionalProperties = new System.Collections.Generic.Dictionary(); + + [System.Text.Json.Serialization.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties; } + set { _additionalProperties = value; } + } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.10.0 (NJsonSchema v10.6.10.0 (Newtonsoft.Json v12.0.0.0))")] + public partial class Response69 + { + + [System.Text.Json.Serialization.JsonPropertyName("message")] + public string Message { get; set; } = default!; + + [System.Text.Json.Serialization.JsonPropertyName("code")] + public int Code { get; set; } = default!; + + private System.Collections.Generic.IDictionary _additionalProperties = new System.Collections.Generic.Dictionary(); + + [System.Text.Json.Serialization.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties; } + set { _additionalProperties = value; } + } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.10.0 (NJsonSchema v10.6.10.0 (Newtonsoft.Json v12.0.0.0))")] + public partial class Response70 + { + + [System.Text.Json.Serialization.JsonPropertyName("message")] + public string Message { get; set; } = default!; + + [System.Text.Json.Serialization.JsonPropertyName("code")] + public int Code { get; set; } = default!; + + private System.Collections.Generic.IDictionary _additionalProperties = new System.Collections.Generic.Dictionary(); + + [System.Text.Json.Serialization.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties; } + set { _additionalProperties = value; } + } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.10.0 (NJsonSchema v10.6.10.0 (Newtonsoft.Json v12.0.0.0))")] + public partial class Response71 + { + + [System.Text.Json.Serialization.JsonPropertyName("message")] + public string Message { get; set; } = default!; + + [System.Text.Json.Serialization.JsonPropertyName("code")] + public int Code { get; set; } = default!; + + private System.Collections.Generic.IDictionary _additionalProperties = new System.Collections.Generic.Dictionary(); + + [System.Text.Json.Serialization.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties; } + set { _additionalProperties = value; } + } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.10.0 (NJsonSchema v10.6.10.0 (Newtonsoft.Json v12.0.0.0))")] + public partial class Response72 + { + + [System.Text.Json.Serialization.JsonPropertyName("message")] + public string Message { get; set; } = default!; + + [System.Text.Json.Serialization.JsonPropertyName("code")] + public int Code { get; set; } = default!; + + private System.Collections.Generic.IDictionary _additionalProperties = new System.Collections.Generic.Dictionary(); + + [System.Text.Json.Serialization.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties; } + set { _additionalProperties = value; } + } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.10.0 (NJsonSchema v10.6.10.0 (Newtonsoft.Json v12.0.0.0))")] + public partial class Response73 + { + + [System.Text.Json.Serialization.JsonPropertyName("message")] + public string Message { get; set; } = default!; + + [System.Text.Json.Serialization.JsonPropertyName("code")] + public int Code { get; set; } = default!; + + private System.Collections.Generic.IDictionary _additionalProperties = new System.Collections.Generic.Dictionary(); + + [System.Text.Json.Serialization.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties; } + set { _additionalProperties = value; } + } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.10.0 (NJsonSchema v10.6.10.0 (Newtonsoft.Json v12.0.0.0))")] + public partial class Response74 + { + + [System.Text.Json.Serialization.JsonPropertyName("message")] + public string Message { get; set; } = default!; + + [System.Text.Json.Serialization.JsonPropertyName("code")] + public int Code { get; set; } = default!; + + private System.Collections.Generic.IDictionary _additionalProperties = new System.Collections.Generic.Dictionary(); + + [System.Text.Json.Serialization.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties; } + set { _additionalProperties = value; } + } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.10.0 (NJsonSchema v10.6.10.0 (Newtonsoft.Json v12.0.0.0))")] + public partial class Response75 + { + + [System.Text.Json.Serialization.JsonPropertyName("message")] + public string Message { get; set; } = default!; + + [System.Text.Json.Serialization.JsonPropertyName("code")] + public int Code { get; set; } = default!; + + private System.Collections.Generic.IDictionary _additionalProperties = new System.Collections.Generic.Dictionary(); + + [System.Text.Json.Serialization.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties; } + set { _additionalProperties = value; } + } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.10.0 (NJsonSchema v10.6.10.0 (Newtonsoft.Json v12.0.0.0))")] + public partial class Response76 + { + + [System.Text.Json.Serialization.JsonPropertyName("message")] + public string Message { get; set; } = default!; + + [System.Text.Json.Serialization.JsonPropertyName("code")] + public int Code { get; set; } = default!; + + private System.Collections.Generic.IDictionary _additionalProperties = new System.Collections.Generic.Dictionary(); + + [System.Text.Json.Serialization.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties; } + set { _additionalProperties = value; } + } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.10.0 (NJsonSchema v10.6.10.0 (Newtonsoft.Json v12.0.0.0))")] + public partial class Response77 + { + + [System.Text.Json.Serialization.JsonPropertyName("message")] + public string Message { get; set; } = default!; + + [System.Text.Json.Serialization.JsonPropertyName("code")] + public int Code { get; set; } = default!; + + private System.Collections.Generic.IDictionary _additionalProperties = new System.Collections.Generic.Dictionary(); + + [System.Text.Json.Serialization.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties; } + set { _additionalProperties = value; } + } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.10.0 (NJsonSchema v10.6.10.0 (Newtonsoft.Json v12.0.0.0))")] + public partial class Response78 + { + + [System.Text.Json.Serialization.JsonPropertyName("message")] + public string Message { get; set; } = default!; + + [System.Text.Json.Serialization.JsonPropertyName("code")] + public int Code { get; set; } = default!; + + private System.Collections.Generic.IDictionary _additionalProperties = new System.Collections.Generic.Dictionary(); + + [System.Text.Json.Serialization.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties; } + set { _additionalProperties = value; } + } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.10.0 (NJsonSchema v10.6.10.0 (Newtonsoft.Json v12.0.0.0))")] + public partial class Response79 + { + + [System.Text.Json.Serialization.JsonPropertyName("message")] + public string Message { get; set; } = default!; + + [System.Text.Json.Serialization.JsonPropertyName("code")] + public int Code { get; set; } = default!; + + private System.Collections.Generic.IDictionary _additionalProperties = new System.Collections.Generic.Dictionary(); + + [System.Text.Json.Serialization.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties; } + set { _additionalProperties = value; } + } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.10.0 (NJsonSchema v10.6.10.0 (Newtonsoft.Json v12.0.0.0))")] + public partial class Response80 + { + + [System.Text.Json.Serialization.JsonPropertyName("message")] + public string Message { get; set; } = default!; + + [System.Text.Json.Serialization.JsonPropertyName("code")] + public int Code { get; set; } = default!; + + private System.Collections.Generic.IDictionary _additionalProperties = new System.Collections.Generic.Dictionary(); + + [System.Text.Json.Serialization.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties; } + set { _additionalProperties = value; } + } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.10.0 (NJsonSchema v10.6.10.0 (Newtonsoft.Json v12.0.0.0))")] + public partial class Response81 + { + + [System.Text.Json.Serialization.JsonPropertyName("message")] + public string Message { get; set; } = default!; + + [System.Text.Json.Serialization.JsonPropertyName("code")] + public int Code { get; set; } = default!; + + private System.Collections.Generic.IDictionary _additionalProperties = new System.Collections.Generic.Dictionary(); + + [System.Text.Json.Serialization.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties; } + set { _additionalProperties = value; } + } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.10.0 (NJsonSchema v10.6.10.0 (Newtonsoft.Json v12.0.0.0))")] + public partial class Response82 + { + + [System.Text.Json.Serialization.JsonPropertyName("message")] + public string Message { get; set; } = default!; + + [System.Text.Json.Serialization.JsonPropertyName("code")] + public int Code { get; set; } = default!; + + private System.Collections.Generic.IDictionary _additionalProperties = new System.Collections.Generic.Dictionary(); + + [System.Text.Json.Serialization.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties; } + set { _additionalProperties = value; } + } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.10.0 (NJsonSchema v10.6.10.0 (Newtonsoft.Json v12.0.0.0))")] + public partial class Response83 + { + + [System.Text.Json.Serialization.JsonPropertyName("message")] + public string Message { get; set; } = default!; + + [System.Text.Json.Serialization.JsonPropertyName("code")] + public int Code { get; set; } = default!; + + private System.Collections.Generic.IDictionary _additionalProperties = new System.Collections.Generic.Dictionary(); + + [System.Text.Json.Serialization.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties; } + set { _additionalProperties = value; } + } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.10.0 (NJsonSchema v10.6.10.0 (Newtonsoft.Json v12.0.0.0))")] + public partial class Response84 + { + + [System.Text.Json.Serialization.JsonPropertyName("message")] + public string Message { get; set; } = default!; + + [System.Text.Json.Serialization.JsonPropertyName("code")] + public int Code { get; set; } = default!; + + private System.Collections.Generic.IDictionary _additionalProperties = new System.Collections.Generic.Dictionary(); + + [System.Text.Json.Serialization.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties; } + set { _additionalProperties = value; } + } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.10.0 (NJsonSchema v10.6.10.0 (Newtonsoft.Json v12.0.0.0))")] + public partial class Response85 + { + + [System.Text.Json.Serialization.JsonPropertyName("message")] + public string Message { get; set; } = default!; + + [System.Text.Json.Serialization.JsonPropertyName("code")] + public int Code { get; set; } = default!; + + private System.Collections.Generic.IDictionary _additionalProperties = new System.Collections.Generic.Dictionary(); + + [System.Text.Json.Serialization.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties; } + set { _additionalProperties = value; } + } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.10.0 (NJsonSchema v10.6.10.0 (Newtonsoft.Json v12.0.0.0))")] + public partial class Response86 + { + + [System.Text.Json.Serialization.JsonPropertyName("message")] + public string Message { get; set; } = default!; + + [System.Text.Json.Serialization.JsonPropertyName("code")] + public int Code { get; set; } = default!; + + private System.Collections.Generic.IDictionary _additionalProperties = new System.Collections.Generic.Dictionary(); + + [System.Text.Json.Serialization.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties; } + set { _additionalProperties = value; } + } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.10.0 (NJsonSchema v10.6.10.0 (Newtonsoft.Json v12.0.0.0))")] + public partial class Response87 + { + + [System.Text.Json.Serialization.JsonPropertyName("message")] + public string Message { get; set; } = default!; + + [System.Text.Json.Serialization.JsonPropertyName("code")] + public int Code { get; set; } = default!; + + private System.Collections.Generic.IDictionary _additionalProperties = new System.Collections.Generic.Dictionary(); + + [System.Text.Json.Serialization.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties; } + set { _additionalProperties = value; } + } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.10.0 (NJsonSchema v10.6.10.0 (Newtonsoft.Json v12.0.0.0))")] + public partial class Response88 + { + + [System.Text.Json.Serialization.JsonPropertyName("message")] + public string Message { get; set; } = default!; + + [System.Text.Json.Serialization.JsonPropertyName("code")] + public int Code { get; set; } = default!; + + private System.Collections.Generic.IDictionary _additionalProperties = new System.Collections.Generic.Dictionary(); + + [System.Text.Json.Serialization.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties; } + set { _additionalProperties = value; } + } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.10.0 (NJsonSchema v10.6.10.0 (Newtonsoft.Json v12.0.0.0))")] + public partial class Response89 + { + + [System.Text.Json.Serialization.JsonPropertyName("message")] + public string Message { get; set; } = default!; + + [System.Text.Json.Serialization.JsonPropertyName("code")] + public int Code { get; set; } = default!; + + private System.Collections.Generic.IDictionary _additionalProperties = new System.Collections.Generic.Dictionary(); + + [System.Text.Json.Serialization.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties; } + set { _additionalProperties = value; } + } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.10.0 (NJsonSchema v10.6.10.0 (Newtonsoft.Json v12.0.0.0))")] + public partial class Response90 + { + + [System.Text.Json.Serialization.JsonPropertyName("message")] + public string Message { get; set; } = default!; + + [System.Text.Json.Serialization.JsonPropertyName("code")] + public int Code { get; set; } = default!; + + private System.Collections.Generic.IDictionary _additionalProperties = new System.Collections.Generic.Dictionary(); + + [System.Text.Json.Serialization.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties; } + set { _additionalProperties = value; } + } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.10.0 (NJsonSchema v10.6.10.0 (Newtonsoft.Json v12.0.0.0))")] + public partial class Response91 + { + + [System.Text.Json.Serialization.JsonPropertyName("message")] + public string Message { get; set; } = default!; + + [System.Text.Json.Serialization.JsonPropertyName("code")] + public int Code { get; set; } = default!; + + private System.Collections.Generic.IDictionary _additionalProperties = new System.Collections.Generic.Dictionary(); + + [System.Text.Json.Serialization.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties; } + set { _additionalProperties = value; } + } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.10.0 (NJsonSchema v10.6.10.0 (Newtonsoft.Json v12.0.0.0))")] + public partial class Response92 + { + + [System.Text.Json.Serialization.JsonPropertyName("message")] + public string Message { get; set; } = default!; + + [System.Text.Json.Serialization.JsonPropertyName("code")] + public int Code { get; set; } = default!; + + private System.Collections.Generic.IDictionary _additionalProperties = new System.Collections.Generic.Dictionary(); + + [System.Text.Json.Serialization.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties; } + set { _additionalProperties = value; } + } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.10.0 (NJsonSchema v10.6.10.0 (Newtonsoft.Json v12.0.0.0))")] + public partial class Response93 + { + + [System.Text.Json.Serialization.JsonPropertyName("message")] + public string Message { get; set; } = default!; + + [System.Text.Json.Serialization.JsonPropertyName("code")] + public int Code { get; set; } = default!; + + private System.Collections.Generic.IDictionary _additionalProperties = new System.Collections.Generic.Dictionary(); + + [System.Text.Json.Serialization.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties; } + set { _additionalProperties = value; } + } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.10.0 (NJsonSchema v10.6.10.0 (Newtonsoft.Json v12.0.0.0))")] + public partial class Response94 + { + + [System.Text.Json.Serialization.JsonPropertyName("message")] + public string Message { get; set; } = default!; + + [System.Text.Json.Serialization.JsonPropertyName("code")] + public int Code { get; set; } = default!; + + private System.Collections.Generic.IDictionary _additionalProperties = new System.Collections.Generic.Dictionary(); + + [System.Text.Json.Serialization.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties; } + set { _additionalProperties = value; } + } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.10.0 (NJsonSchema v10.6.10.0 (Newtonsoft.Json v12.0.0.0))")] + public partial class Response95 + { + + [System.Text.Json.Serialization.JsonPropertyName("message")] + public string Message { get; set; } = default!; + + [System.Text.Json.Serialization.JsonPropertyName("code")] + public int Code { get; set; } = default!; + + private System.Collections.Generic.IDictionary _additionalProperties = new System.Collections.Generic.Dictionary(); + + [System.Text.Json.Serialization.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties; } + set { _additionalProperties = value; } + } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.10.0 (NJsonSchema v10.6.10.0 (Newtonsoft.Json v12.0.0.0))")] + public partial class Response96 + { + + [System.Text.Json.Serialization.JsonPropertyName("message")] + public string Message { get; set; } = default!; + + [System.Text.Json.Serialization.JsonPropertyName("code")] + public int Code { get; set; } = default!; + + private System.Collections.Generic.IDictionary _additionalProperties = new System.Collections.Generic.Dictionary(); + + [System.Text.Json.Serialization.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties; } + set { _additionalProperties = value; } + } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.10.0 (NJsonSchema v10.6.10.0 (Newtonsoft.Json v12.0.0.0))")] + public partial class Response97 + { + + [System.Text.Json.Serialization.JsonPropertyName("message")] + public string Message { get; set; } = default!; + + [System.Text.Json.Serialization.JsonPropertyName("code")] + public int Code { get; set; } = default!; + + private System.Collections.Generic.IDictionary _additionalProperties = new System.Collections.Generic.Dictionary(); + + [System.Text.Json.Serialization.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties; } + set { _additionalProperties = value; } + } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.10.0 (NJsonSchema v10.6.10.0 (Newtonsoft.Json v12.0.0.0))")] + public partial class Response98 + { + + [System.Text.Json.Serialization.JsonPropertyName("message")] + public string Message { get; set; } = default!; + + [System.Text.Json.Serialization.JsonPropertyName("code")] + public int Code { get; set; } = default!; + + private System.Collections.Generic.IDictionary _additionalProperties = new System.Collections.Generic.Dictionary(); + + [System.Text.Json.Serialization.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties; } + set { _additionalProperties = value; } + } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.10.0 (NJsonSchema v10.6.10.0 (Newtonsoft.Json v12.0.0.0))")] + public partial class Response99 + { + + [System.Text.Json.Serialization.JsonPropertyName("message")] + public string Message { get; set; } = default!; + + [System.Text.Json.Serialization.JsonPropertyName("code")] + public int Code { get; set; } = default!; + + private System.Collections.Generic.IDictionary _additionalProperties = new System.Collections.Generic.Dictionary(); + + [System.Text.Json.Serialization.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties; } + set { _additionalProperties = value; } + } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.10.0 (NJsonSchema v10.6.10.0 (Newtonsoft.Json v12.0.0.0))")] + public partial class Response100 + { + + [System.Text.Json.Serialization.JsonPropertyName("message")] + public string Message { get; set; } = default!; + + [System.Text.Json.Serialization.JsonPropertyName("code")] + public int Code { get; set; } = default!; + + private System.Collections.Generic.IDictionary _additionalProperties = new System.Collections.Generic.Dictionary(); + + [System.Text.Json.Serialization.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties; } + set { _additionalProperties = value; } + } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.10.0 (NJsonSchema v10.6.10.0 (Newtonsoft.Json v12.0.0.0))")] + public partial class Response101 + { + + [System.Text.Json.Serialization.JsonPropertyName("message")] + public string Message { get; set; } = default!; + + [System.Text.Json.Serialization.JsonPropertyName("code")] + public int Code { get; set; } = default!; + + private System.Collections.Generic.IDictionary _additionalProperties = new System.Collections.Generic.Dictionary(); + + [System.Text.Json.Serialization.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties; } + set { _additionalProperties = value; } + } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.10.0 (NJsonSchema v10.6.10.0 (Newtonsoft.Json v12.0.0.0))")] + public partial class Response102 + { + + [System.Text.Json.Serialization.JsonPropertyName("message")] + public string Message { get; set; } = default!; + + [System.Text.Json.Serialization.JsonPropertyName("code")] + public int Code { get; set; } = default!; + + private System.Collections.Generic.IDictionary _additionalProperties = new System.Collections.Generic.Dictionary(); + + [System.Text.Json.Serialization.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties; } + set { _additionalProperties = value; } + } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.10.0 (NJsonSchema v10.6.10.0 (Newtonsoft.Json v12.0.0.0))")] + public partial class Response103 + { + + [System.Text.Json.Serialization.JsonPropertyName("message")] + public string Message { get; set; } = default!; + + [System.Text.Json.Serialization.JsonPropertyName("code")] + public int Code { get; set; } = default!; + + private System.Collections.Generic.IDictionary _additionalProperties = new System.Collections.Generic.Dictionary(); + + [System.Text.Json.Serialization.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties; } + set { _additionalProperties = value; } + } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.10.0 (NJsonSchema v10.6.10.0 (Newtonsoft.Json v12.0.0.0))")] + public partial class Response104 + { + + [System.Text.Json.Serialization.JsonPropertyName("message")] + public string Message { get; set; } = default!; + + [System.Text.Json.Serialization.JsonPropertyName("code")] + public int Code { get; set; } = default!; + + private System.Collections.Generic.IDictionary _additionalProperties = new System.Collections.Generic.Dictionary(); + + [System.Text.Json.Serialization.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties; } + set { _additionalProperties = value; } + } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.10.0 (NJsonSchema v10.6.10.0 (Newtonsoft.Json v12.0.0.0))")] + public partial class Balances + { + + [System.Text.Json.Serialization.JsonPropertyName("peer")] + [System.ComponentModel.DataAnnotations.RegularExpression(@"^[A-Fa-f0-9]{64}$")] + public string Peer { get; set; } = default!; + + /// + /// Numeric string that represents integer which might exceeds `Number.MAX_SAFE_INTEGER` limit (2^53-1) + /// + + [System.Text.Json.Serialization.JsonPropertyName("balance")] + public string Balance { get; set; } = default!; + + private System.Collections.Generic.IDictionary _additionalProperties = new System.Collections.Generic.Dictionary(); + + [System.Text.Json.Serialization.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties; } + set { _additionalProperties = value; } + } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.10.0 (NJsonSchema v10.6.10.0 (Newtonsoft.Json v12.0.0.0))")] + public partial class Peers + { + + [System.Text.Json.Serialization.JsonPropertyName("address")] + [System.ComponentModel.DataAnnotations.RegularExpression(@"^[A-Fa-f0-9]{64}$")] + public string Address { get; set; } = default!; + + private System.Collections.Generic.IDictionary _additionalProperties = new System.Collections.Generic.Dictionary(); + + [System.Text.Json.Serialization.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties; } + set { _additionalProperties = value; } + } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.10.0 (NJsonSchema v10.6.10.0 (Newtonsoft.Json v12.0.0.0))")] + public partial class Balances2 + { + + [System.Text.Json.Serialization.JsonPropertyName("peer")] + [System.ComponentModel.DataAnnotations.RegularExpression(@"^[A-Fa-f0-9]{64}$")] + public string Peer { get; set; } = default!; + + /// + /// Numeric string that represents integer which might exceeds `Number.MAX_SAFE_INTEGER` limit (2^53-1) + /// + + [System.Text.Json.Serialization.JsonPropertyName("balance")] + public string Balance { get; set; } = default!; + + private System.Collections.Generic.IDictionary _additionalProperties = new System.Collections.Generic.Dictionary(); + + [System.Text.Json.Serialization.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties; } + set { _additionalProperties = value; } + } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.10.0 (NJsonSchema v10.6.10.0 (Newtonsoft.Json v12.0.0.0))")] + public enum Response14BeeMode + { + + [System.Runtime.Serialization.EnumMember(Value = @"light")] + Light = 0, + + [System.Runtime.Serialization.EnumMember(Value = @"full")] + Full = 1, + + [System.Runtime.Serialization.EnumMember(Value = @"dev")] + Dev = 2, + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.10.0 (NJsonSchema v10.6.10.0 (Newtonsoft.Json v12.0.0.0))")] + public partial class Peers2 + { + + [System.Text.Json.Serialization.JsonPropertyName("address")] + [System.ComponentModel.DataAnnotations.RegularExpression(@"^[A-Fa-f0-9]{64}$")] + public string Address { get; set; } = default!; + + private System.Collections.Generic.IDictionary _additionalProperties = new System.Collections.Generic.Dictionary(); + + [System.Text.Json.Serialization.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties; } + set { _additionalProperties = value; } + } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.10.0 (NJsonSchema v10.6.10.0 (Newtonsoft.Json v12.0.0.0))")] + public partial class Settlements + { + + [System.Text.Json.Serialization.JsonPropertyName("peer")] + [System.ComponentModel.DataAnnotations.RegularExpression(@"^[A-Fa-f0-9]{64}$")] + public string Peer { get; set; } = default!; + + [System.Text.Json.Serialization.JsonPropertyName("received")] + public int Received { get; set; } = default!; + + [System.Text.Json.Serialization.JsonPropertyName("sent")] + public int Sent { get; set; } = default!; + + private System.Collections.Generic.IDictionary _additionalProperties = new System.Collections.Generic.Dictionary(); + + [System.Text.Json.Serialization.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties; } + set { _additionalProperties = value; } + } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.10.0 (NJsonSchema v10.6.10.0 (Newtonsoft.Json v12.0.0.0))")] + public partial class Settlements2 + { + + [System.Text.Json.Serialization.JsonPropertyName("peer")] + [System.ComponentModel.DataAnnotations.RegularExpression(@"^[A-Fa-f0-9]{64}$")] + public string Peer { get; set; } = default!; + + [System.Text.Json.Serialization.JsonPropertyName("received")] + public int Received { get; set; } = default!; + + [System.Text.Json.Serialization.JsonPropertyName("sent")] + public int Sent { get; set; } = default!; + + private System.Collections.Generic.IDictionary _additionalProperties = new System.Collections.Generic.Dictionary(); + + [System.Text.Json.Serialization.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties; } + set { _additionalProperties = value; } + } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.10.0 (NJsonSchema v10.6.10.0 (Newtonsoft.Json v12.0.0.0))")] + public partial class Anonymous + { + + [System.Text.Json.Serialization.JsonPropertyName("population")] + public int Population { get; set; } = default!; + + [System.Text.Json.Serialization.JsonPropertyName("connected")] + public int Connected { get; set; } = default!; + + [System.Text.Json.Serialization.JsonPropertyName("disconnectedPeers")] + public System.Collections.Generic.ICollection DisconnectedPeers { get; set; } = default!; + + [System.Text.Json.Serialization.JsonPropertyName("connectedPeers")] + public System.Collections.Generic.ICollection ConnectedPeers { get; set; } = default!; + + private System.Collections.Generic.IDictionary _additionalProperties = new System.Collections.Generic.Dictionary(); + + [System.Text.Json.Serialization.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties; } + set { _additionalProperties = value; } + } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.10.0 (NJsonSchema v10.6.10.0 (Newtonsoft.Json v12.0.0.0))")] + public partial class LastCashedCheque + { + + [System.Text.Json.Serialization.JsonPropertyName("beneficiary")] + [System.ComponentModel.DataAnnotations.RegularExpression(@"^[A-Fa-f0-9]{40}$")] + public string Beneficiary { get; set; } = default!; + + [System.Text.Json.Serialization.JsonPropertyName("chequebook")] + [System.ComponentModel.DataAnnotations.RegularExpression(@"^[A-Fa-f0-9]{40}$")] + public string Chequebook { get; set; } = default!; + + /// + /// Numeric string that represents integer which might exceeds `Number.MAX_SAFE_INTEGER` limit (2^53-1) + /// + + [System.Text.Json.Serialization.JsonPropertyName("payout")] + public string Payout { get; set; } = default!; + + private System.Collections.Generic.IDictionary _additionalProperties = new System.Collections.Generic.Dictionary(); + + [System.Text.Json.Serialization.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties; } + set { _additionalProperties = value; } + } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.10.0 (NJsonSchema v10.6.10.0 (Newtonsoft.Json v12.0.0.0))")] + public partial class Result + { + + [System.Text.Json.Serialization.JsonPropertyName("recipient")] + [System.ComponentModel.DataAnnotations.RegularExpression(@"^[A-Fa-f0-9]{40}$")] + public string Recipient { get; set; } = default!; + + /// + /// Numeric string that represents integer which might exceeds `Number.MAX_SAFE_INTEGER` limit (2^53-1) + /// + + [System.Text.Json.Serialization.JsonPropertyName("lastPayout")] + public string LastPayout { get; set; } = default!; + + [System.Text.Json.Serialization.JsonPropertyName("bounced")] + public bool Bounced { get; set; } = default!; + + private System.Collections.Generic.IDictionary _additionalProperties = new System.Collections.Generic.Dictionary(); + + [System.Text.Json.Serialization.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties; } + set { _additionalProperties = value; } + } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.10.0 (NJsonSchema v10.6.10.0 (Newtonsoft.Json v12.0.0.0))")] + public partial class Lastreceived + { + + [System.Text.Json.Serialization.JsonPropertyName("beneficiary")] + [System.ComponentModel.DataAnnotations.RegularExpression(@"^[A-Fa-f0-9]{40}$")] + public string Beneficiary { get; set; } = default!; + + [System.Text.Json.Serialization.JsonPropertyName("chequebook")] + [System.ComponentModel.DataAnnotations.RegularExpression(@"^[A-Fa-f0-9]{40}$")] + public string Chequebook { get; set; } = default!; + + /// + /// Numeric string that represents integer which might exceeds `Number.MAX_SAFE_INTEGER` limit (2^53-1) + /// + + [System.Text.Json.Serialization.JsonPropertyName("payout")] + public string Payout { get; set; } = default!; + + private System.Collections.Generic.IDictionary _additionalProperties = new System.Collections.Generic.Dictionary(); + + [System.Text.Json.Serialization.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties; } + set { _additionalProperties = value; } + } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.10.0 (NJsonSchema v10.6.10.0 (Newtonsoft.Json v12.0.0.0))")] + public partial class Lastsent + { + + [System.Text.Json.Serialization.JsonPropertyName("beneficiary")] + [System.ComponentModel.DataAnnotations.RegularExpression(@"^[A-Fa-f0-9]{40}$")] + public string Beneficiary { get; set; } = default!; + + [System.Text.Json.Serialization.JsonPropertyName("chequebook")] + [System.ComponentModel.DataAnnotations.RegularExpression(@"^[A-Fa-f0-9]{40}$")] + public string Chequebook { get; set; } = default!; + + /// + /// Numeric string that represents integer which might exceeds `Number.MAX_SAFE_INTEGER` limit (2^53-1) + /// + + [System.Text.Json.Serialization.JsonPropertyName("payout")] + public string Payout { get; set; } = default!; + + private System.Collections.Generic.IDictionary _additionalProperties = new System.Collections.Generic.Dictionary(); + + [System.Text.Json.Serialization.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties; } + set { _additionalProperties = value; } + } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.10.0 (NJsonSchema v10.6.10.0 (Newtonsoft.Json v12.0.0.0))")] + public partial class Lastcheques + { + + [System.Text.Json.Serialization.JsonPropertyName("peer")] + [System.ComponentModel.DataAnnotations.RegularExpression(@"^[A-Fa-f0-9]{64}$")] + public string Peer { get; set; } = default!; + + [System.Text.Json.Serialization.JsonPropertyName("lastreceived")] + public Lastreceived2 Lastreceived { get; set; } = default!; + + [System.Text.Json.Serialization.JsonPropertyName("lastsent")] + public Lastsent2 Lastsent { get; set; } = default!; + + private System.Collections.Generic.IDictionary _additionalProperties = new System.Collections.Generic.Dictionary(); + + [System.Text.Json.Serialization.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties; } + set { _additionalProperties = value; } + } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.10.0 (NJsonSchema v10.6.10.0 (Newtonsoft.Json v12.0.0.0))")] + public partial class PendingTransactions + { + + [System.Text.Json.Serialization.JsonPropertyName("transactionHash")] + [System.ComponentModel.DataAnnotations.RegularExpression(@"^0x[A-Fa-f0-9]{64}$")] + public string TransactionHash { get; set; } = default!; + + [System.Text.Json.Serialization.JsonPropertyName("to")] + [System.ComponentModel.DataAnnotations.RegularExpression(@"^[A-Fa-f0-9]{40}$")] + public string To { get; set; } = default!; + + [System.Text.Json.Serialization.JsonPropertyName("nonce")] + public int Nonce { get; set; } = default!; + + /// + /// Numeric string that represents integer which might exceeds `Number.MAX_SAFE_INTEGER` limit (2^53-1) + /// + + [System.Text.Json.Serialization.JsonPropertyName("gasPrice")] + public string GasPrice { get; set; } = default!; + + [System.Text.Json.Serialization.JsonPropertyName("gasLimit")] + public long GasLimit { get; set; } = default!; + + [System.Text.Json.Serialization.JsonPropertyName("data")] + public string Data { get; set; } = default!; + + [System.Text.Json.Serialization.JsonPropertyName("created")] + public System.DateTimeOffset Created { get; set; } = default!; + + [System.Text.Json.Serialization.JsonPropertyName("description")] + public string Description { get; set; } = default!; + + /// + /// Numeric string that represents integer which might exceeds `Number.MAX_SAFE_INTEGER` limit (2^53-1) + /// + + [System.Text.Json.Serialization.JsonPropertyName("value")] + public string Value { get; set; } = default!; + + private System.Collections.Generic.IDictionary _additionalProperties = new System.Collections.Generic.Dictionary(); + + [System.Text.Json.Serialization.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties; } + set { _additionalProperties = value; } + } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.10.0 (NJsonSchema v10.6.10.0 (Newtonsoft.Json v12.0.0.0))")] + public partial class Stamps : Etherna.BeeNet.Clients.DebugApi.DtoFixer.PostageBatchDto + { + + private System.Collections.Generic.IDictionary _additionalProperties = new System.Collections.Generic.Dictionary(); + + [System.Text.Json.Serialization.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties; } + set { _additionalProperties = value; } + } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.10.0 (NJsonSchema v10.6.10.0 (Newtonsoft.Json v12.0.0.0))")] + public partial class Buckets + { + + [System.Text.Json.Serialization.JsonPropertyName("bucketID")] + public int BucketID { get; set; } = default!; + + [System.Text.Json.Serialization.JsonPropertyName("collisions")] + public int Collisions { get; set; } = default!; + + private System.Collections.Generic.IDictionary _additionalProperties = new System.Collections.Generic.Dictionary(); + + [System.Text.Json.Serialization.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties; } + set { _additionalProperties = value; } + } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.10.0 (NJsonSchema v10.6.10.0 (Newtonsoft.Json v12.0.0.0))")] + public partial class Batches + { + + [System.Text.Json.Serialization.JsonPropertyName("batchID")] + [System.ComponentModel.DataAnnotations.RegularExpression(@"^[A-Fa-f0-9]{64}$")] + public string BatchID { get; set; } = default!; + + [System.Text.Json.Serialization.JsonPropertyName("depth")] + public int Depth { get; set; } = default!; + + /// + /// Numeric string that represents integer which might exceeds `Number.MAX_SAFE_INTEGER` limit (2^53-1) + /// + + [System.Text.Json.Serialization.JsonPropertyName("value")] + public string Value { get; set; } = default!; + + [System.Text.Json.Serialization.JsonPropertyName("bucketDepth")] + public int BucketDepth { get; set; } = default!; + + [System.Text.Json.Serialization.JsonPropertyName("blockNumber")] + public int BlockNumber { get; set; } = default!; + + [System.Text.Json.Serialization.JsonPropertyName("immutableFlag")] + public bool ImmutableFlag { get; set; } = default!; + + [System.Text.Json.Serialization.JsonPropertyName("batchTTL")] + public int BatchTTL { get; set; } = default!; + + [System.Text.Json.Serialization.JsonPropertyName("owner")] + [System.ComponentModel.DataAnnotations.RegularExpression(@"^[A-Fa-f0-9]{40}$")] + public string Owner { get; set; } = default!; + + private System.Collections.Generic.IDictionary _additionalProperties = new System.Collections.Generic.Dictionary(); + + [System.Text.Json.Serialization.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties; } + set { _additionalProperties = value; } + } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.10.0 (NJsonSchema v10.6.10.0 (Newtonsoft.Json v12.0.0.0))")] + public partial class DisconnectedPeers + { + + [System.Text.Json.Serialization.JsonPropertyName("address")] + [System.ComponentModel.DataAnnotations.RegularExpression(@"^[A-Fa-f0-9]{64}$")] + public string Address { get; set; } = default!; + + [System.Text.Json.Serialization.JsonPropertyName("metrics")] + public Metrics Metrics { get; set; } = default!; + + private System.Collections.Generic.IDictionary _additionalProperties = new System.Collections.Generic.Dictionary(); + + [System.Text.Json.Serialization.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties; } + set { _additionalProperties = value; } + } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.10.0 (NJsonSchema v10.6.10.0 (Newtonsoft.Json v12.0.0.0))")] + public partial class ConnectedPeers + { + + [System.Text.Json.Serialization.JsonPropertyName("address")] + [System.ComponentModel.DataAnnotations.RegularExpression(@"^[A-Fa-f0-9]{64}$")] + public string Address { get; set; } = default!; + + [System.Text.Json.Serialization.JsonPropertyName("metrics")] + public Metrics2 Metrics { get; set; } = default!; + + private System.Collections.Generic.IDictionary _additionalProperties = new System.Collections.Generic.Dictionary(); + + [System.Text.Json.Serialization.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties; } + set { _additionalProperties = value; } + } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.10.0 (NJsonSchema v10.6.10.0 (Newtonsoft.Json v12.0.0.0))")] + public partial class Lastreceived2 + { + + [System.Text.Json.Serialization.JsonPropertyName("beneficiary")] + [System.ComponentModel.DataAnnotations.RegularExpression(@"^[A-Fa-f0-9]{40}$")] + public string Beneficiary { get; set; } = default!; + + [System.Text.Json.Serialization.JsonPropertyName("chequebook")] + [System.ComponentModel.DataAnnotations.RegularExpression(@"^[A-Fa-f0-9]{40}$")] + public string Chequebook { get; set; } = default!; + + /// + /// Numeric string that represents integer which might exceeds `Number.MAX_SAFE_INTEGER` limit (2^53-1) + /// + + [System.Text.Json.Serialization.JsonPropertyName("payout")] + public string Payout { get; set; } = default!; + + private System.Collections.Generic.IDictionary _additionalProperties = new System.Collections.Generic.Dictionary(); + + [System.Text.Json.Serialization.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties; } + set { _additionalProperties = value; } + } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.10.0 (NJsonSchema v10.6.10.0 (Newtonsoft.Json v12.0.0.0))")] + public partial class Lastsent2 + { + + [System.Text.Json.Serialization.JsonPropertyName("beneficiary")] + [System.ComponentModel.DataAnnotations.RegularExpression(@"^[A-Fa-f0-9]{40}$")] + public string Beneficiary { get; set; } = default!; + + [System.Text.Json.Serialization.JsonPropertyName("chequebook")] + [System.ComponentModel.DataAnnotations.RegularExpression(@"^[A-Fa-f0-9]{40}$")] + public string Chequebook { get; set; } = default!; + + /// + /// Numeric string that represents integer which might exceeds `Number.MAX_SAFE_INTEGER` limit (2^53-1) + /// + + [System.Text.Json.Serialization.JsonPropertyName("payout")] + public string Payout { get; set; } = default!; + + private System.Collections.Generic.IDictionary _additionalProperties = new System.Collections.Generic.Dictionary(); + + [System.Text.Json.Serialization.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties; } + set { _additionalProperties = value; } + } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.10.0 (NJsonSchema v10.6.10.0 (Newtonsoft.Json v12.0.0.0))")] + public partial class Metrics + { + + [System.Text.Json.Serialization.JsonPropertyName("lastSeenTimestamp")] + public int LastSeenTimestamp { get; set; } = default!; + + [System.Text.Json.Serialization.JsonPropertyName("sessionConnectionRetry")] + public int SessionConnectionRetry { get; set; } = default!; + + [System.Text.Json.Serialization.JsonPropertyName("connectionTotalDuration")] + public double ConnectionTotalDuration { get; set; } = default!; + + [System.Text.Json.Serialization.JsonPropertyName("sessionConnectionDuration")] + public double SessionConnectionDuration { get; set; } = default!; + + [System.Text.Json.Serialization.JsonPropertyName("sessionConnectionDirection")] + public string SessionConnectionDirection { get; set; } = default!; + + [System.Text.Json.Serialization.JsonPropertyName("latencyEWMA")] + public int LatencyEWMA { get; set; } = default!; + + private System.Collections.Generic.IDictionary _additionalProperties = new System.Collections.Generic.Dictionary(); + + [System.Text.Json.Serialization.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties; } + set { _additionalProperties = value; } + } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.10.0 (NJsonSchema v10.6.10.0 (Newtonsoft.Json v12.0.0.0))")] + public partial class Metrics2 + { + + [System.Text.Json.Serialization.JsonPropertyName("lastSeenTimestamp")] + public int LastSeenTimestamp { get; set; } = default!; + + [System.Text.Json.Serialization.JsonPropertyName("sessionConnectionRetry")] + public int SessionConnectionRetry { get; set; } = default!; + + [System.Text.Json.Serialization.JsonPropertyName("connectionTotalDuration")] + public double ConnectionTotalDuration { get; set; } = default!; + + [System.Text.Json.Serialization.JsonPropertyName("sessionConnectionDuration")] + public double SessionConnectionDuration { get; set; } = default!; + + [System.Text.Json.Serialization.JsonPropertyName("sessionConnectionDirection")] + public string SessionConnectionDirection { get; set; } = default!; + + [System.Text.Json.Serialization.JsonPropertyName("latencyEWMA")] + public int LatencyEWMA { get; set; } = default!; + + private System.Collections.Generic.IDictionary _additionalProperties = new System.Collections.Generic.Dictionary(); + + [System.Text.Json.Serialization.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties; } + set { _additionalProperties = value; } + } + + } + + +} + +#pragma warning restore 1591 +#pragma warning restore 1573 +#pragma warning restore 472 +#pragma warning restore 114 +#pragma warning restore 108 +#pragma warning restore 3016 +#pragma warning restore 8603 \ No newline at end of file diff --git a/src/BeeNet/Clients/DebugApi/v1_2_0/BeeDebugClient_1_2_0.cs b/src/BeeNet/Clients/DebugApi/v1_2_0/BeeDebugClient_1_2_0.cs index 3a65dcd0..b75d63c9 100644 --- a/src/BeeNet/Clients/DebugApi/v1_2_0/BeeDebugClient_1_2_0.cs +++ b/src/BeeNet/Clients/DebugApi/v1_2_0/BeeDebugClient_1_2_0.cs @@ -254,7 +254,7 @@ public partial interface IBeeDebugClient_1_2_0 /// Gas limit for transaction /// OK /// A server side error occurred. - System.Threading.Tasks.Task ChequebookCashoutPostAsync(string peer_id, int? gas_price = null, long? gas_limit = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task ChequebookCashoutPostAsync(string peer_id, long? gas_price = null, long? gas_limit = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// @@ -281,7 +281,7 @@ public partial interface IBeeDebugClient_1_2_0 /// Gas price for transaction /// Transaction hash of the deposit transaction /// A server side error occurred. - System.Threading.Tasks.Task ChequebookDepositAsync(int amount, int? gas_price = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task ChequebookDepositAsync(long amount, long? gas_price = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// @@ -336,7 +336,7 @@ public partial interface IBeeDebugClient_1_2_0 /// Gas price for transaction /// Hash of the transaction /// A server side error occurred. - System.Threading.Tasks.Task TransactionsDeleteAsync(string txHash, int? gas_price = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task TransactionsDeleteAsync(string txHash, long? gas_price = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// @@ -374,7 +374,7 @@ public partial interface IBeeDebugClient_1_2_0 /// Gas price for transaction /// Returns the newly created postage batch ID /// A server side error occurred. - System.Threading.Tasks.Task StampsPostAsync(int amount, int depth, string? label = null, bool? immutable = null, int? gas_price = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task StampsPostAsync(long amount, int depth, string? label = null, bool? immutable = null, long? gas_price = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// @@ -384,7 +384,7 @@ public partial interface IBeeDebugClient_1_2_0 /// Amount of BZZ per chunk to top up to an existing postage batch. /// Returns the postage batch ID that was topped up /// A server side error occurred. - System.Threading.Tasks.Task StampsTopupAsync(object id, int amount, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task StampsTopupAsync(object id, long amount, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// @@ -2528,7 +2528,7 @@ public string BaseUrl /// Gas limit for transaction /// OK /// A server side error occurred. - public virtual async System.Threading.Tasks.Task ChequebookCashoutPostAsync(string peer_id, int? gas_price = null, long? gas_limit = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public virtual async System.Threading.Tasks.Task ChequebookCashoutPostAsync(string peer_id, long? gas_price = null, long? gas_limit = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { if (peer_id == null) throw new System.ArgumentNullException("peer_id"); @@ -2826,7 +2826,7 @@ public string BaseUrl /// Gas price for transaction /// Transaction hash of the deposit transaction /// A server side error occurred. - public virtual async System.Threading.Tasks.Task ChequebookDepositAsync(int amount, int? gas_price = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public virtual async System.Threading.Tasks.Task ChequebookDepositAsync(long amount, long? gas_price = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { if (amount == null) throw new System.ArgumentNullException("amount"); @@ -3394,7 +3394,7 @@ public string BaseUrl /// Gas price for transaction /// Hash of the transaction /// A server side error occurred. - public virtual async System.Threading.Tasks.Task TransactionsDeleteAsync(string txHash, int? gas_price = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public virtual async System.Threading.Tasks.Task TransactionsDeleteAsync(string txHash, long? gas_price = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { if (txHash == null) throw new System.ArgumentNullException("txHash"); @@ -3735,7 +3735,7 @@ public string BaseUrl /// Gas price for transaction /// Returns the newly created postage batch ID /// A server side error occurred. - public virtual async System.Threading.Tasks.Task StampsPostAsync(int amount, int depth, string? label = null, bool? immutable = null, int? gas_price = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public virtual async System.Threading.Tasks.Task StampsPostAsync(long amount, int depth, string? label = null, bool? immutable = null, long? gas_price = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { if (amount == null) throw new System.ArgumentNullException("amount"); @@ -3857,7 +3857,7 @@ public string BaseUrl /// Amount of BZZ per chunk to top up to an existing postage batch. /// Returns the postage batch ID that was topped up /// A server side error occurred. - public virtual async System.Threading.Tasks.Task StampsTopupAsync(object id, int amount, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public virtual async System.Threading.Tasks.Task StampsTopupAsync(object id, long amount, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { if (id == null) throw new System.ArgumentNullException("id"); diff --git a/src/BeeNet/Clients/GatewayApi/BeeGatewayClient.cs b/src/BeeNet/Clients/GatewayApi/BeeGatewayClient.cs index 21d7334a..db76fc5b 100644 --- a/src/BeeNet/Clients/GatewayApi/BeeGatewayClient.cs +++ b/src/BeeNet/Clients/GatewayApi/BeeGatewayClient.cs @@ -13,6 +13,7 @@ // limitations under the License. using Etherna.BeeNet.Clients.GatewayApi.V2_0_0; +using Etherna.BeeNet.Clients.GatewayApi.V3_0_0; using Etherna.BeeNet.DtoModels; using Etherna.BeeNet.InputModels; using System; @@ -29,6 +30,7 @@ public class BeeGatewayClient : IBeeGatewayClient { // Fields. private readonly IBeeGatewayClient_2_0_0 beeGatewayApiClient_2_0_0; + private readonly IBeeGatewayClient_3_0_0 beeGatewayApiClient_3_0_0; // Constructors. public BeeGatewayClient(HttpClient httpClient, Uri baseUrl, GatewayApiVersion apiVersion) @@ -37,6 +39,7 @@ public BeeGatewayClient(HttpClient httpClient, Uri baseUrl, GatewayApiVersion ap throw new ArgumentNullException(nameof(baseUrl)); beeGatewayApiClient_2_0_0 = new BeeGatewayClient_2_0_0(httpClient) { BaseUrl = baseUrl.ToString() }; + beeGatewayApiClient_3_0_0 = new BeeGatewayClient_3_0_0(httpClient) { BaseUrl = baseUrl.ToString() }; CurrentApiVersion = apiVersion; } @@ -48,7 +51,13 @@ public async Task AuthenticateAsync(string role, int expiry) => CurrentApiVersion switch { GatewayApiVersion.v2_0_0 => new AuthDto(await beeGatewayApiClient_2_0_0.AuthAsync( - new Body + new V2_0_0.Body + { + Role = role, + Expiry = expiry + }).ConfigureAwait(false)), + GatewayApiVersion.v3_0_0 => new AuthDto(await beeGatewayApiClient_3_0_0.AuthAsync( + new V3_0_0.Body { Role = role, Expiry = expiry @@ -60,6 +69,7 @@ public async Task CheckIsContentAvailableAsync(string referen CurrentApiVersion switch { GatewayApiVersion.v2_0_0 => new StewardShipGetDto(await beeGatewayApiClient_2_0_0.StewardshipGetAsync(reference).ConfigureAwait(false)), + GatewayApiVersion.v3_0_0 => new StewardShipGetDto(await beeGatewayApiClient_3_0_0.StewardshipGetAsync(reference).ConfigureAwait(false)), _ => throw new InvalidOperationException() }; @@ -72,6 +82,7 @@ public async Task CreateFeedAsync( CurrentApiVersion switch { GatewayApiVersion.v2_0_0 => (await beeGatewayApiClient_2_0_0.FeedsPostAsync(owner, topic, swarmPostageBatchId, type, swarmPin).ConfigureAwait(false)).Reference, + GatewayApiVersion.v3_0_0 => (await beeGatewayApiClient_3_0_0.FeedsPostAsync(owner, topic, swarmPostageBatchId, type, swarmPin).ConfigureAwait(false)).Reference, _ => throw new InvalidOperationException() }; @@ -79,6 +90,7 @@ public async Task CreatePinAsync(string reference) => CurrentApiVersion switch { GatewayApiVersion.v2_0_0 => new MessageResponseDto(await beeGatewayApiClient_2_0_0.PinsPostAsync(reference).ConfigureAwait(false)), + GatewayApiVersion.v3_0_0 => new MessageResponseDto(await beeGatewayApiClient_3_0_0.PinsPostAsync(reference).ConfigureAwait(false)), _ => throw new InvalidOperationException() }; @@ -86,7 +98,12 @@ public async Task CreateTagAsync(string address) => CurrentApiVersion switch { GatewayApiVersion.v2_0_0 => new TagInfoDto(await beeGatewayApiClient_2_0_0.TagsPostAsync( - new Body3 + new V2_0_0.Body3 + { + Address = address + }).ConfigureAwait(false)), + GatewayApiVersion.v3_0_0 => new TagInfoDto(await beeGatewayApiClient_3_0_0.TagsPostAsync( + new V3_0_0.Body3 { Address = address }).ConfigureAwait(false)), @@ -97,6 +114,7 @@ public async Task DeletePinAsync(string reference) => CurrentApiVersion switch { GatewayApiVersion.v2_0_0 => new MessageResponseDto(await beeGatewayApiClient_2_0_0.PinsDeleteAsync(reference).ConfigureAwait(false)), + GatewayApiVersion.v3_0_0 => new MessageResponseDto(await beeGatewayApiClient_3_0_0.PinsDeleteAsync(reference).ConfigureAwait(false)), _ => throw new InvalidOperationException() }; @@ -104,6 +122,7 @@ public Task DeleteTagAsync(int uid) => CurrentApiVersion switch { GatewayApiVersion.v2_0_0 => beeGatewayApiClient_2_0_0.TagsDeleteAsync(uid), + GatewayApiVersion.v3_0_0 => beeGatewayApiClient_3_0_0.TagsDeleteAsync(uid), _ => throw new InvalidOperationException() }; @@ -111,6 +130,7 @@ public async Task> GetAllPinsAsync() => CurrentApiVersion switch { GatewayApiVersion.v2_0_0 => (await beeGatewayApiClient_2_0_0.PinsGetAsync().ConfigureAwait(false)).Addresses ?? Array.Empty(), + GatewayApiVersion.v3_0_0 => (await beeGatewayApiClient_3_0_0.PinsGetAsync().ConfigureAwait(false)).References, _ => throw new InvalidOperationException() }; @@ -118,6 +138,7 @@ public async Task GetChunkStreamAsync(string reference, string? targets CurrentApiVersion switch { GatewayApiVersion.v2_0_0 => (await beeGatewayApiClient_2_0_0.ChunksGetAsync(reference, targets).ConfigureAwait(false)).Stream, + GatewayApiVersion.v3_0_0 => (await beeGatewayApiClient_3_0_0.ChunksGetAsync(reference, targets).ConfigureAwait(false)).Stream, _ => throw new InvalidOperationException() }; @@ -125,6 +146,7 @@ public async Task GetDataAsync(string reference) => CurrentApiVersion switch { GatewayApiVersion.v2_0_0 => (await beeGatewayApiClient_2_0_0.BytesGetAsync(reference).ConfigureAwait(false)).Stream, + GatewayApiVersion.v3_0_0 => (await beeGatewayApiClient_3_0_0.BytesGetAsync(reference).ConfigureAwait(false)).Stream, _ => throw new InvalidOperationException() }; @@ -136,6 +158,7 @@ public async Task GetFeedAsync( CurrentApiVersion switch { GatewayApiVersion.v2_0_0 => (await beeGatewayApiClient_2_0_0.FeedsGetAsync(owner, topic, at, type).ConfigureAwait(false)).Reference, + GatewayApiVersion.v3_0_0 => (await beeGatewayApiClient_3_0_0.FeedsGetAsync(owner, topic, at, type).ConfigureAwait(false)).Reference, _ => throw new InvalidOperationException() }; @@ -143,6 +166,7 @@ public async Task GetFileAsync(string reference, string path, string? ta CurrentApiVersion switch { GatewayApiVersion.v2_0_0 => (await beeGatewayApiClient_2_0_0.BzzGetAsync(reference, path, targets).ConfigureAwait(false)).Stream, + GatewayApiVersion.v3_0_0 => (await beeGatewayApiClient_3_0_0.BzzGetAsync(reference, path, targets).ConfigureAwait(false)).Stream, _ => throw new InvalidOperationException() }; @@ -150,6 +174,7 @@ public async Task GetFileAsync(string reference, string? targets = null) CurrentApiVersion switch { GatewayApiVersion.v2_0_0 => (await beeGatewayApiClient_2_0_0.BzzGetAsync(reference, targets, CancellationToken.None).ConfigureAwait(false)).Stream, + GatewayApiVersion.v3_0_0 => (await beeGatewayApiClient_3_0_0.BzzGetAsync(reference, targets, CancellationToken.None).ConfigureAwait(false)).Stream, _ => throw new InvalidOperationException() }; @@ -157,6 +182,7 @@ public async Task GetPinStatusAsync(string reference) => CurrentApiVersion switch { GatewayApiVersion.v2_0_0 => await beeGatewayApiClient_2_0_0.PinsGetAsync(reference).ConfigureAwait(false), + GatewayApiVersion.v3_0_0 => await beeGatewayApiClient_3_0_0.PinsGetAsync(reference).ConfigureAwait(false), _ => throw new InvalidOperationException() }; @@ -164,6 +190,7 @@ public async Task GetTagInfoAsync(int uid) => CurrentApiVersion switch { GatewayApiVersion.v2_0_0 => new TagInfoDto(await beeGatewayApiClient_2_0_0.TagsGetAsync(uid).ConfigureAwait(false)), + GatewayApiVersion.v3_0_0 => new TagInfoDto(await beeGatewayApiClient_3_0_0.TagsGetAsync(uid).ConfigureAwait(false)), _ => throw new InvalidOperationException() }; @@ -171,6 +198,7 @@ public async Task> GetTagsListAsync(int? offset = null, CurrentApiVersion switch { GatewayApiVersion.v2_0_0 => (await beeGatewayApiClient_2_0_0.TagsGetAsync(offset, limit).ConfigureAwait(false)).Tags.Select(i => new TagInfoDto(i)), + GatewayApiVersion.v3_0_0 => (await beeGatewayApiClient_3_0_0.TagsGetAsync(offset, limit).ConfigureAwait(false)).Tags.Select(i => new TagInfoDto(i)), _ => throw new InvalidOperationException() }; @@ -178,7 +206,13 @@ public async Task RefreshAuthAsync(string role, int expiry) => CurrentApiVersion switch { GatewayApiVersion.v2_0_0 => (await beeGatewayApiClient_2_0_0.RefreshAsync( - new Body2 + new V2_0_0.Body2 + { + Role = role, + Expiry = expiry + }).ConfigureAwait(false)).Key, + GatewayApiVersion.v3_0_0 => (await beeGatewayApiClient_3_0_0.RefreshAsync( + new V3_0_0.Body2 { Role = role, Expiry = expiry @@ -190,6 +224,7 @@ public Task ReuploadContentAsync(string reference) => CurrentApiVersion switch { GatewayApiVersion.v2_0_0 => beeGatewayApiClient_2_0_0.StewardshipPutAsync(reference), + GatewayApiVersion.v3_0_0 => beeGatewayApiClient_3_0_0.StewardshipPutAsync(reference), _ => throw new InvalidOperationException() }; @@ -201,6 +236,7 @@ public Task SendPssAsync( CurrentApiVersion switch { GatewayApiVersion.v2_0_0 => beeGatewayApiClient_2_0_0.PssSendAsync(topic, targets, swarmPostageBatchId, recipient), + GatewayApiVersion.v3_0_0 => beeGatewayApiClient_3_0_0.PssSendAsync(topic, targets, swarmPostageBatchId, recipient), _ => throw new InvalidOperationException() }; @@ -208,6 +244,7 @@ public Task SubscribeToPssAsync(string topic) => CurrentApiVersion switch { GatewayApiVersion.v2_0_0 => beeGatewayApiClient_2_0_0.PssSubscribeAsync(topic), + GatewayApiVersion.v3_0_0 => beeGatewayApiClient_3_0_0.PssSubscribeAsync(topic), _ => throw new InvalidOperationException() }; @@ -218,7 +255,12 @@ public async Task UpdateTagAsync(int uid, string? address = null) => uid, address is null ? null : - new Body4 { Address = address }).ConfigureAwait(false)), + new V2_0_0.Body4 { Address = address }).ConfigureAwait(false)), + GatewayApiVersion.v3_0_0 => new VersionDto(await beeGatewayApiClient_3_0_0.TagsPatchAsync( + uid, + address is null ? + null : + new V3_0_0.Body4 { Address = address }).ConfigureAwait(false)), _ => throw new InvalidOperationException() }; @@ -236,6 +278,12 @@ public async Task UploadChunkAsync( swarmPin, swarmDeferredUpload, body).ConfigureAwait(false)), + GatewayApiVersion.v3_0_0 => new VersionDto(await beeGatewayApiClient_3_0_0.ChunksPostAsync( + swarmPostageBatchId, + swarmTag, + swarmPin, + swarmDeferredUpload, + body).ConfigureAwait(false)), _ => throw new InvalidOperationException() }; @@ -246,6 +294,7 @@ public Task UploadChunksStreamAsync( CurrentApiVersion switch { GatewayApiVersion.v2_0_0 => beeGatewayApiClient_2_0_0.ChunksStreamAsync(swarmPostageBatchId, swarmTag, swarmPin), + GatewayApiVersion.v3_0_0 => beeGatewayApiClient_3_0_0.ChunksStreamAsync(swarmPostageBatchId, swarmTag, swarmPin), _ => throw new InvalidOperationException() }; @@ -265,6 +314,13 @@ public async Task UploadDataAsync( swarmEncrypt, swarmDeferredUpload, body).ConfigureAwait(false)).Reference, + GatewayApiVersion.v3_0_0 => (await beeGatewayApiClient_3_0_0.BytesPostAsync( + swarmPostageBatchId, + swarmTag, + swarmPin, + swarmEncrypt, + swarmDeferredUpload, + body).ConfigureAwait(false)).Reference, _ => throw new InvalidOperationException() }; @@ -293,7 +349,19 @@ public async Task UploadFileAsync( swarmIndexDocument, swarmErrorDocument, swarmDeferredUpload, - file.Select(f => new FileParameter(f.Data, f.FileName, f.ContentType))).ConfigureAwait(false)).Reference, + file.Select(f => new V2_0_0.FileParameter(f.Data, f.FileName, f.ContentType))).ConfigureAwait(false)).Reference, + GatewayApiVersion.v3_0_0 => (await beeGatewayApiClient_3_0_0.BzzPostAsync( + swarmPostageBatchId, + name, + swarmTag, + swarmPin, + swarmEncrypt, + contentType, + swarmCollection, + swarmIndexDocument, + swarmErrorDocument, + swarmDeferredUpload, + file.Select(f => new V3_0_0.FileParameter(f.Data, f.FileName, f.ContentType))).ConfigureAwait(false)).Reference, _ => throw new InvalidOperationException() }; @@ -305,6 +373,7 @@ public async Task UploadSocAsync( CurrentApiVersion switch { GatewayApiVersion.v2_0_0 => (await beeGatewayApiClient_2_0_0.SocAsync(owner, id, sig, swarmPin).ConfigureAwait(false)).Reference, + GatewayApiVersion.v3_0_0 => (await beeGatewayApiClient_3_0_0.SocAsync(owner, id, sig, swarmPin).ConfigureAwait(false)).Reference, _ => throw new InvalidOperationException() }; } diff --git a/src/BeeNet/Clients/GatewayApi/GatewayApiVersion.cs b/src/BeeNet/Clients/GatewayApi/GatewayApiVersion.cs index 8a780c97..9edc0205 100644 --- a/src/BeeNet/Clients/GatewayApi/GatewayApiVersion.cs +++ b/src/BeeNet/Clients/GatewayApi/GatewayApiVersion.cs @@ -16,6 +16,7 @@ namespace Etherna.BeeNet.Clients.GatewayApi { public enum GatewayApiVersion { - v2_0_0 + v2_0_0, + v3_0_0 } } diff --git a/src/BeeNet/Clients/GatewayApi/v3_0_0/BeeGatewayClient_3_0_0.cs b/src/BeeNet/Clients/GatewayApi/v3_0_0/BeeGatewayClient_3_0_0.cs new file mode 100644 index 00000000..b1565fb8 --- /dev/null +++ b/src/BeeNet/Clients/GatewayApi/v3_0_0/BeeGatewayClient_3_0_0.cs @@ -0,0 +1,5748 @@ +// Copyright 2021-present Etherna Sagl +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//---------------------- +// +// Generated using the NSwag toolchain v13.15.10.0 (NJsonSchema v10.6.10.0 (Newtonsoft.Json v12.0.0.0)) (http://NSwag.org) +// +//---------------------- + +#nullable enable + +using Etherna.BeeNet.Exceptions; + +#pragma warning disable 108 // Disable "CS0108 '{derivedDto}.ToJson()' hides inherited member '{dtoBase}.ToJson()'. Use the new keyword if hiding was intended." +#pragma warning disable 114 // Disable "CS0114 '{derivedDto}.RaisePropertyChanged(String)' hides inherited member 'dtoBase.RaisePropertyChanged(String)'. To make the current member override that implementation, add the override keyword. Otherwise add the new keyword." +#pragma warning disable 472 // Disable "CS0472 The result of the expression is always 'false' since a value of type 'Int32' is never equal to 'null' of type 'Int32?' +#pragma warning disable 1573 // Disable "CS1573 Parameter '...' has no matching param tag in the XML comment for ... +#pragma warning disable 1591 // Disable "CS1591 Missing XML comment for publicly visible type or member ..." +#pragma warning disable 8073 // Disable "CS8073 The result of the expression is always 'false' since a value of type 'T' is never equal to 'null' of type 'T?'" +#pragma warning disable 3016 // Disable "CS3016 Arrays as attribute arguments is not CLS-compliant" +#pragma warning disable 8603 // Disable "CS8603 Possible null reference return" + +namespace Etherna.BeeNet.Clients.GatewayApi.V3_0_0 +{ + using System = global::System; + + [System.CodeDom.Compiler.GeneratedCode("NSwag", "13.15.10.0 (NJsonSchema v10.6.10.0 (Newtonsoft.Json v12.0.0.0))")] + public partial interface IBeeGatewayClient_3_0_0 + { + + /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. + /// + /// Authenticate - This endpoint is experimental + /// + /// Ok + /// A server side error occurred. + System.Threading.Tasks.Task AuthAsync(Body body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. + /// + /// Refresh the auth token - This endpoint is experimental + /// + /// Ok + /// A server side error occurred. + System.Threading.Tasks.Task RefreshAsync(Body2 body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. + /// + /// Upload data + /// + /// ID of Postage Batch that is used to upload data with + /// Associate upload with an existing Tag UID + /// Represents if the uploaded data should be also locally pinned on the node. + ///
Warning! Not available for nodes that run in Gateway mode! + /// Represents the encrypting state of the file + ///
Warning! Not available for nodes that run in Gateway mode! + /// Determines if the uploaded data should be sent to the network immediately or in a deferred fashion. By default the upload will be deferred. + /// Ok + /// A server side error occurred. + System.Threading.Tasks.Task BytesPostAsync(string swarm_postage_batch_id, int? swarm_tag = null, bool? swarm_pin = null, bool? swarm_encrypt = null, bool? swarm_deferred_upload = null, System.IO.Stream? body = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. + /// + /// Get referenced data + /// + /// Swarm address reference to content + /// Retrieved content specified by reference + /// A server side error occurred. + System.Threading.Tasks.Task BytesGetAsync(string reference, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. + /// + /// Get Chunk + /// + /// Swarm address of chunk + /// Global pinning targets prefix + /// Retrieved chunk content + /// A server side error occurred. + System.Threading.Tasks.Task ChunksGetAsync(string reference, string? targets = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. + /// + /// Upload Chunk + /// + /// ID of Postage Batch that is used to upload data with + /// Associate upload with an existing Tag UID + /// Represents if the uploaded data should be also locally pinned on the node. + ///
Warning! Not available for nodes that run in Gateway mode! + /// Determines if the uploaded data should be sent to the network immediately or in a deferred fashion. By default the upload will be deferred. + /// Chunk binary data that has to have at least 8 bytes. + /// Ok + /// A server side error occurred. + System.Threading.Tasks.Task ChunksPostAsync(string swarm_postage_batch_id, int? swarm_tag = null, bool? swarm_pin = null, bool? swarm_deferred_upload = null, System.IO.Stream? body = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. + /// + /// Upload stream of chunks + /// + /// ID of Postage Batch that is used to upload data with + /// Associate upload with an existing Tag UID + /// Represents if the uploaded data should be also locally pinned on the node. + ///
Warning! Not available for nodes that run in Gateway mode! + /// Returns a Websocket connection on which stream of chunks can be uploaded. Each chunk sent is acknowledged using a binary response `0` which serves as confirmation of upload of single chunk. Chunks should be packaged as binary messages for uploading. + /// A server side error occurred. + System.Threading.Tasks.Task ChunksStreamAsync(string swarm_postage_batch_id, int? swarm_tag = null, bool? swarm_pin = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. + /// + /// Upload file or a collection of files + /// + /// ID of Postage Batch that is used to upload data with + /// Filename when uploading single file + /// Associate upload with an existing Tag UID + /// Represents if the uploaded data should be also locally pinned on the node. + ///
Warning! Not available for nodes that run in Gateway mode! + /// Represents the encrypting state of the file + ///
Warning! Not available for nodes that run in Gateway mode! + /// The specified content-type is preserved for download of the asset + /// Upload file/files as a collection + /// Default file to be referenced on path, if exists under that path + /// Configure custom error document to be returned when a specified path can not be found in collection + /// Determines if the uploaded data should be sent to the network immediately or in a deferred fashion. By default the upload will be deferred. + /// Ok + /// A server side error occurred. + System.Threading.Tasks.Task BzzPostAsync(string swarm_postage_batch_id, string? name = null, int? swarm_tag = null, bool? swarm_pin = null, bool? swarm_encrypt = null, string? content_Type = null, bool? swarm_collection = null, string? swarm_index_document = null, string? swarm_error_document = null, bool? swarm_deferred_upload = null, System.Collections.Generic.IEnumerable? file = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. + /// + /// Reupload a root hash to the network; deprecated: use /stewardship/{reference} instead + /// + /// Root hash of content (can be of any type: collection, file, chunk) + /// Ok + /// A server side error occurred. + [System.Obsolete] + System.Threading.Tasks.Task BzzPatchAsync(string reference, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. + /// + /// Get file or index document from a collection of files + /// + /// Swarm address of content + /// Global pinning targets prefix + /// Ok + /// A server side error occurred. + System.Threading.Tasks.Task BzzGetAsync(string reference, string? targets = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. + /// + /// Get referenced file from a collection of files + /// + /// Swarm address of content + /// Path to the file in the collection. + /// Global pinning targets prefix + /// Ok + /// A server side error occurred. + System.Threading.Tasks.Task BzzGetAsync(string reference, string path, string? targets = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. + /// + /// Get list of tags + /// + /// The number of items to skip before starting to collect the result set. + /// The numbers of items to return. + /// List of tags + /// A server side error occurred. + System.Threading.Tasks.Task TagsGetAsync(int? offset = null, int? limit = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. + /// + /// Create Tag + /// + /// New Tag Info + /// A server side error occurred. + System.Threading.Tasks.Task TagsPostAsync(Body3 body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. + /// + /// Get Tag information using Uid + /// + /// Uid + /// Tag info + /// A server side error occurred. + System.Threading.Tasks.Task TagsGetAsync(int uid, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. + /// + /// Delete Tag information using Uid + /// + /// Uid + /// The resource was deleted successfully. + /// A server side error occurred. + System.Threading.Tasks.Task TagsDeleteAsync(int uid, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. + /// + /// Update Total Count and swarm hash for a tag of an input stream of unknown size using Uid + /// + /// Uid + /// Can contain swarm hash to use for the tag + /// Ok + /// A server side error occurred. + System.Threading.Tasks.Task TagsPatchAsync(int uid, Body4? body = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. + /// + /// Pin the root hash with the given reference + /// + /// Swarm reference of the root hash + /// Pin already exists, so no operation + /// A server side error occurred. + System.Threading.Tasks.Task PinsPostAsync(string reference, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. + /// + /// Unpin the root hash with the given reference + /// + /// Swarm reference of the root hash + /// Unpinning root hash with reference + /// A server side error occurred. + System.Threading.Tasks.Task PinsDeleteAsync(string reference, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. + /// + /// Get pinning status of the root hash with the given reference + /// + /// Swarm reference of the root hash + /// Reference of the pinned root hash + /// A server side error occurred. + System.Threading.Tasks.Task PinsGetAsync(string reference, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. + /// + /// Get the list of pinned root hash references + /// + /// List of pinned root hash references + /// A server side error occurred. + System.Threading.Tasks.Task PinsGetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. + /// + /// Send to recipient or target with Postal Service for Swarm + /// + /// Topic name + /// Target message address prefix. If multiple targets are specified, only one would be matched. + /// ID of Postage Batch that is used to upload data with + /// Recipient publickey + /// Subscribed to topic + /// A server side error occurred. + System.Threading.Tasks.Task PssSendAsync(string topic, string targets, string swarm_postage_batch_id, string? recipient = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. + /// + /// Subscribe for messages on the given topic. + /// + /// Topic name + /// Returns a WebSocket with a subscription for incoming message data on the requested topic. + /// A server side error occurred. + System.Threading.Tasks.Task PssSubscribeAsync(string topic, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. + /// + /// Upload single owner chunk + /// + /// Owner + /// Id + /// Signature + /// Represents if the uploaded data should be also locally pinned on the node. + ///
Warning! Not available for nodes that run in Gateway mode! + /// Created + /// A server side error occurred. + System.Threading.Tasks.Task SocAsync(string owner, string id, string sig, bool? swarm_pin = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. + /// + /// Create an initial feed root manifest + /// + /// Owner + /// Topic + /// ID of Postage Batch that is used to upload data with + /// Feed indexing scheme (default: sequence) + /// Represents if the uploaded data should be also locally pinned on the node. + ///
Warning! Not available for nodes that run in Gateway mode! + /// Created + /// A server side error occurred. + System.Threading.Tasks.Task FeedsPostAsync(string owner, string topic, string swarm_postage_batch_id, string? type = null, bool? swarm_pin = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. + /// + /// Find feed update + /// + /// Owner + /// Topic + /// Timestamp of the update (default: now) + /// Feed indexing scheme (default: sequence) + /// Latest feed update + /// A server side error occurred. + System.Threading.Tasks.Task FeedsGetAsync(string owner, string topic, int? at = null, string? type = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. + /// + /// Check if content is available + /// + /// Root hash of content (can be of any type: collection, file, chunk) + /// Returns if the content is retrievable + /// A server side error occurred. + System.Threading.Tasks.Task StewardshipGetAsync(string reference, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. + /// + /// Reupload a root hash to the network + /// + /// Root hash of content (can be of any type: collection, file, chunk) + /// Ok + /// A server side error occurred. + System.Threading.Tasks.Task StewardshipPutAsync(string reference, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + } + + [System.CodeDom.Compiler.GeneratedCode("NSwag", "13.15.10.0 (NJsonSchema v10.6.10.0 (Newtonsoft.Json v12.0.0.0))")] + public partial class BeeGatewayClient_3_0_0 : IBeeGatewayClient_3_0_0 + { + private string _baseUrl = "http://{apiRoot}:{port}/v1"; + private System.Net.Http.HttpClient _httpClient; + private System.Lazy _settings; + + public BeeGatewayClient_3_0_0(System.Net.Http.HttpClient httpClient) + { + _httpClient = httpClient; + _settings = new System.Lazy(CreateSerializerSettings); + } + + private System.Text.Json.JsonSerializerOptions CreateSerializerSettings() + { + var settings = new System.Text.Json.JsonSerializerOptions(); + UpdateJsonSerializerSettings(settings); + return settings; + } + + public string BaseUrl + { + get { return _baseUrl; } + set { _baseUrl = value; } + } + + protected System.Text.Json.JsonSerializerOptions JsonSerializerSettings { get { return _settings.Value; } } + + partial void UpdateJsonSerializerSettings(System.Text.Json.JsonSerializerOptions settings); + + partial void PrepareRequest(System.Net.Http.HttpClient client, System.Net.Http.HttpRequestMessage request, string url); + partial void PrepareRequest(System.Net.Http.HttpClient client, System.Net.Http.HttpRequestMessage request, System.Text.StringBuilder urlBuilder); + partial void ProcessResponse(System.Net.Http.HttpClient client, System.Net.Http.HttpResponseMessage response); + + /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. + /// + /// Authenticate - This endpoint is experimental + /// + /// Ok + /// A server side error occurred. + public virtual async System.Threading.Tasks.Task AuthAsync(Body body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + if (body == null) + throw new System.ArgumentNullException("body"); + + var urlBuilder_ = new System.Text.StringBuilder(); + urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/auth"); + + var client_ = _httpClient; + var disposeClient_ = false; + try + { + using (var request_ = new System.Net.Http.HttpRequestMessage()) + { + var content_ = new System.Net.Http.StringContent(System.Text.Json.JsonSerializer.Serialize(body, _settings.Value)); + content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + request_.Content = content_; + request_.Method = new System.Net.Http.HttpMethod("POST"); + request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); + + PrepareRequest(client_, request_, urlBuilder_); + + var url_ = urlBuilder_.ToString(); + request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); + + PrepareRequest(client_, request_, url_); + + var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); + var disposeResponse_ = true; + try + { + var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + if (response_.Content != null && response_.Content.Headers != null) + { + foreach (var item_ in response_.Content.Headers) + headers_[item_.Key] = item_.Value; + } + + ProcessResponse(client_, response_); + + var status_ = (int)response_.StatusCode; + if (status_ == 201) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new BeeNetGatewayApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + return objectResponse_.Object; + } + else + if (status_ == 400) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new BeeNetGatewayApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new BeeNetGatewayApiException("Bad request", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else + if (status_ == 401) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new BeeNetGatewayApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new BeeNetGatewayApiException("Unauthorized", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else + if (status_ == 500) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new BeeNetGatewayApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new BeeNetGatewayApiException("Internal Server Error", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else + { + var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); + throw new BeeNetGatewayApiException("Default response", status_, responseData_, headers_, null); + } + } + finally + { + if (disposeResponse_) + response_.Dispose(); + } + } + } + finally + { + if (disposeClient_) + client_.Dispose(); + } + } + + /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. + /// + /// Refresh the auth token - This endpoint is experimental + /// + /// Ok + /// A server side error occurred. + public virtual async System.Threading.Tasks.Task RefreshAsync(Body2 body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + if (body == null) + throw new System.ArgumentNullException("body"); + + var urlBuilder_ = new System.Text.StringBuilder(); + urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/refresh"); + + var client_ = _httpClient; + var disposeClient_ = false; + try + { + using (var request_ = new System.Net.Http.HttpRequestMessage()) + { + var content_ = new System.Net.Http.StringContent(System.Text.Json.JsonSerializer.Serialize(body, _settings.Value)); + content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + request_.Content = content_; + request_.Method = new System.Net.Http.HttpMethod("POST"); + request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); + + PrepareRequest(client_, request_, urlBuilder_); + + var url_ = urlBuilder_.ToString(); + request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); + + PrepareRequest(client_, request_, url_); + + var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); + var disposeResponse_ = true; + try + { + var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + if (response_.Content != null && response_.Content.Headers != null) + { + foreach (var item_ in response_.Content.Headers) + headers_[item_.Key] = item_.Value; + } + + ProcessResponse(client_, response_); + + var status_ = (int)response_.StatusCode; + if (status_ == 201) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new BeeNetGatewayApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + return objectResponse_.Object; + } + else + if (status_ == 400) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new BeeNetGatewayApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new BeeNetGatewayApiException("Bad request", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else + if (status_ == 401) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new BeeNetGatewayApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new BeeNetGatewayApiException("Unauthorized", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else + if (status_ == 500) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new BeeNetGatewayApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new BeeNetGatewayApiException("Internal Server Error", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else + { + var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); + throw new BeeNetGatewayApiException("Default response", status_, responseData_, headers_, null); + } + } + finally + { + if (disposeResponse_) + response_.Dispose(); + } + } + } + finally + { + if (disposeClient_) + client_.Dispose(); + } + } + + /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. + /// + /// Upload data + /// + /// ID of Postage Batch that is used to upload data with + /// Associate upload with an existing Tag UID + /// Represents if the uploaded data should be also locally pinned on the node. + ///
Warning! Not available for nodes that run in Gateway mode! + /// Represents the encrypting state of the file + ///
Warning! Not available for nodes that run in Gateway mode! + /// Determines if the uploaded data should be sent to the network immediately or in a deferred fashion. By default the upload will be deferred. + /// Ok + /// A server side error occurred. + public virtual async System.Threading.Tasks.Task BytesPostAsync(string swarm_postage_batch_id, int? swarm_tag = null, bool? swarm_pin = null, bool? swarm_encrypt = null, bool? swarm_deferred_upload = null, System.IO.Stream? body = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + var urlBuilder_ = new System.Text.StringBuilder(); + urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/bytes"); + + var client_ = _httpClient; + var disposeClient_ = false; + try + { + using (var request_ = new System.Net.Http.HttpRequestMessage()) + { + + if (swarm_postage_batch_id == null) + throw new System.ArgumentNullException("swarm_postage_batch_id"); + request_.Headers.TryAddWithoutValidation("swarm-postage-batch-id", ConvertToString(swarm_postage_batch_id, System.Globalization.CultureInfo.InvariantCulture)); + + if (swarm_tag != null) + request_.Headers.TryAddWithoutValidation("swarm-tag", ConvertToString(swarm_tag, System.Globalization.CultureInfo.InvariantCulture)); + + if (swarm_pin != null) + request_.Headers.TryAddWithoutValidation("swarm-pin", ConvertToString(swarm_pin, System.Globalization.CultureInfo.InvariantCulture)); + + if (swarm_encrypt != null) + request_.Headers.TryAddWithoutValidation("swarm-encrypt", ConvertToString(swarm_encrypt, System.Globalization.CultureInfo.InvariantCulture)); + + if (swarm_deferred_upload != null) + request_.Headers.TryAddWithoutValidation("swarm-deferred-upload", ConvertToString(swarm_deferred_upload, System.Globalization.CultureInfo.InvariantCulture)); + var content_ = new System.Net.Http.StreamContent(body); + content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/octet-stream"); + request_.Content = content_; + request_.Method = new System.Net.Http.HttpMethod("POST"); + request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); + + PrepareRequest(client_, request_, urlBuilder_); + + var url_ = urlBuilder_.ToString(); + request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); + + PrepareRequest(client_, request_, url_); + + var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); + var disposeResponse_ = true; + try + { + var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + if (response_.Content != null && response_.Content.Headers != null) + { + foreach (var item_ in response_.Content.Headers) + headers_[item_.Key] = item_.Value; + } + + ProcessResponse(client_, response_); + + var status_ = (int)response_.StatusCode; + if (status_ == 201) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new BeeNetGatewayApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + return objectResponse_.Object; + } + else + if (status_ == 400) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new BeeNetGatewayApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new BeeNetGatewayApiException("Bad request", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else + if (status_ == 402) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new BeeNetGatewayApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new BeeNetGatewayApiException("Payment Required", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else + if (status_ == 403) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new BeeNetGatewayApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new BeeNetGatewayApiException("Endpoint or header (pinning or encryption headers) forbidden in Gateway mode", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else + if (status_ == 500) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new BeeNetGatewayApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new BeeNetGatewayApiException("Internal Server Error", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else + { + var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); + throw new BeeNetGatewayApiException("Default response", status_, responseData_, headers_, null); + } + } + finally + { + if (disposeResponse_) + response_.Dispose(); + } + } + } + finally + { + if (disposeClient_) + client_.Dispose(); + } + } + + /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. + /// + /// Get referenced data + /// + /// Swarm address reference to content + /// Retrieved content specified by reference + /// A server side error occurred. + public virtual async System.Threading.Tasks.Task BytesGetAsync(string reference, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + if (reference == null) + throw new System.ArgumentNullException("reference"); + + var urlBuilder_ = new System.Text.StringBuilder(); + urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/bytes/{reference}"); + urlBuilder_.Replace("{reference}", System.Uri.EscapeDataString(ConvertToString(reference, System.Globalization.CultureInfo.InvariantCulture))); + + var client_ = _httpClient; + var disposeClient_ = false; + try + { + using (var request_ = new System.Net.Http.HttpRequestMessage()) + { + request_.Method = new System.Net.Http.HttpMethod("GET"); + request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/octet-stream")); + + PrepareRequest(client_, request_, urlBuilder_); + + var url_ = urlBuilder_.ToString(); + request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); + + PrepareRequest(client_, request_, url_); + + var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); + var disposeResponse_ = true; + try + { + var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + if (response_.Content != null && response_.Content.Headers != null) + { + foreach (var item_ in response_.Content.Headers) + headers_[item_.Key] = item_.Value; + } + + ProcessResponse(client_, response_); + + var status_ = (int)response_.StatusCode; + if (status_ == 200 || status_ == 206) + { + var responseStream_ = response_.Content == null ? System.IO.Stream.Null : await response_.Content.ReadAsStreamAsync().ConfigureAwait(false); + var fileResponse_ = new FileResponse(status_, headers_, responseStream_, null, response_); + disposeClient_ = false; disposeResponse_ = false; // response and client are disposed by FileResponse + return fileResponse_; + } + else + if (status_ == 404) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new BeeNetGatewayApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new BeeNetGatewayApiException("Not Found", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else + { + var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); + throw new BeeNetGatewayApiException("Default response", status_, responseData_, headers_, null); + } + } + finally + { + if (disposeResponse_) + response_.Dispose(); + } + } + } + finally + { + if (disposeClient_) + client_.Dispose(); + } + } + + /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. + /// + /// Get Chunk + /// + /// Swarm address of chunk + /// Global pinning targets prefix + /// Retrieved chunk content + /// A server side error occurred. + public virtual async System.Threading.Tasks.Task ChunksGetAsync(string reference, string? targets = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + if (reference == null) + throw new System.ArgumentNullException("reference"); + + var urlBuilder_ = new System.Text.StringBuilder(); + urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/chunks/{reference}?"); + urlBuilder_.Replace("{reference}", System.Uri.EscapeDataString(ConvertToString(reference, System.Globalization.CultureInfo.InvariantCulture))); + if (targets != null) + { + urlBuilder_.Append(System.Uri.EscapeDataString("targets") + "=").Append(System.Uri.EscapeDataString(ConvertToString(targets, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); + } + urlBuilder_.Length--; + + var client_ = _httpClient; + var disposeClient_ = false; + try + { + using (var request_ = new System.Net.Http.HttpRequestMessage()) + { + request_.Method = new System.Net.Http.HttpMethod("GET"); + request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/octet-stream")); + + PrepareRequest(client_, request_, urlBuilder_); + + var url_ = urlBuilder_.ToString(); + request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); + + PrepareRequest(client_, request_, url_); + + var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); + var disposeResponse_ = true; + try + { + var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + if (response_.Content != null && response_.Content.Headers != null) + { + foreach (var item_ in response_.Content.Headers) + headers_[item_.Key] = item_.Value; + } + + ProcessResponse(client_, response_); + + var status_ = (int)response_.StatusCode; + if (status_ == 200 || status_ == 206) + { + var responseStream_ = response_.Content == null ? System.IO.Stream.Null : await response_.Content.ReadAsStreamAsync().ConfigureAwait(false); + var fileResponse_ = new FileResponse(status_, headers_, responseStream_, null, response_); + disposeClient_ = false; disposeResponse_ = false; // response and client are disposed by FileResponse + return fileResponse_; + } + else + if (status_ == 202) + { + string responseText_ = ( response_.Content == null ) ? string.Empty : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); + throw new BeeNetGatewayApiException("chunk recovery initiated. retry after sometime.", status_, responseText_, headers_, null); + } + else + if (status_ == 400) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new BeeNetGatewayApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new BeeNetGatewayApiException("Bad request", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else + if (status_ == 404) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new BeeNetGatewayApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new BeeNetGatewayApiException("Not Found", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else + if (status_ == 500) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new BeeNetGatewayApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new BeeNetGatewayApiException("Internal Server Error", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else + { + var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); + throw new BeeNetGatewayApiException("Default response", status_, responseData_, headers_, null); + } + } + finally + { + if (disposeResponse_) + response_.Dispose(); + } + } + } + finally + { + if (disposeClient_) + client_.Dispose(); + } + } + + /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. + /// + /// Upload Chunk + /// + /// ID of Postage Batch that is used to upload data with + /// Associate upload with an existing Tag UID + /// Represents if the uploaded data should be also locally pinned on the node. + ///
Warning! Not available for nodes that run in Gateway mode! + /// Determines if the uploaded data should be sent to the network immediately or in a deferred fashion. By default the upload will be deferred. + /// Chunk binary data that has to have at least 8 bytes. + /// Ok + /// A server side error occurred. + public virtual async System.Threading.Tasks.Task ChunksPostAsync(string swarm_postage_batch_id, int? swarm_tag = null, bool? swarm_pin = null, bool? swarm_deferred_upload = null, System.IO.Stream? body = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + var urlBuilder_ = new System.Text.StringBuilder(); + urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/chunks"); + + var client_ = _httpClient; + var disposeClient_ = false; + try + { + using (var request_ = new System.Net.Http.HttpRequestMessage()) + { + + if (swarm_postage_batch_id == null) + throw new System.ArgumentNullException("swarm_postage_batch_id"); + request_.Headers.TryAddWithoutValidation("swarm-postage-batch-id", ConvertToString(swarm_postage_batch_id, System.Globalization.CultureInfo.InvariantCulture)); + + if (swarm_tag != null) + request_.Headers.TryAddWithoutValidation("swarm-tag", ConvertToString(swarm_tag, System.Globalization.CultureInfo.InvariantCulture)); + + if (swarm_pin != null) + request_.Headers.TryAddWithoutValidation("swarm-pin", ConvertToString(swarm_pin, System.Globalization.CultureInfo.InvariantCulture)); + + if (swarm_deferred_upload != null) + request_.Headers.TryAddWithoutValidation("swarm-deferred-upload", ConvertToString(swarm_deferred_upload, System.Globalization.CultureInfo.InvariantCulture)); + var content_ = new System.Net.Http.StreamContent(body); + content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/octet-stream"); + request_.Content = content_; + request_.Method = new System.Net.Http.HttpMethod("POST"); + request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); + + PrepareRequest(client_, request_, urlBuilder_); + + var url_ = urlBuilder_.ToString(); + request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); + + PrepareRequest(client_, request_, url_); + + var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); + var disposeResponse_ = true; + try + { + var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + if (response_.Content != null && response_.Content.Headers != null) + { + foreach (var item_ in response_.Content.Headers) + headers_[item_.Key] = item_.Value; + } + + ProcessResponse(client_, response_); + + var status_ = (int)response_.StatusCode; + if (status_ == 201) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new BeeNetGatewayApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + return objectResponse_.Object; + } + else + if (status_ == 400) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new BeeNetGatewayApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new BeeNetGatewayApiException("Bad request", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else + if (status_ == 402) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new BeeNetGatewayApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new BeeNetGatewayApiException("Payment Required", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else + if (status_ == 403) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new BeeNetGatewayApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new BeeNetGatewayApiException("Endpoint or header (pinning or encryption headers) forbidden in Gateway mode", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else + if (status_ == 500) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new BeeNetGatewayApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new BeeNetGatewayApiException("Internal Server Error", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else + { + var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); + throw new BeeNetGatewayApiException("Default response", status_, responseData_, headers_, null); + } + } + finally + { + if (disposeResponse_) + response_.Dispose(); + } + } + } + finally + { + if (disposeClient_) + client_.Dispose(); + } + } + + /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. + /// + /// Upload stream of chunks + /// + /// ID of Postage Batch that is used to upload data with + /// Associate upload with an existing Tag UID + /// Represents if the uploaded data should be also locally pinned on the node. + ///
Warning! Not available for nodes that run in Gateway mode! + /// Returns a Websocket connection on which stream of chunks can be uploaded. Each chunk sent is acknowledged using a binary response `0` which serves as confirmation of upload of single chunk. Chunks should be packaged as binary messages for uploading. + /// A server side error occurred. + public virtual async System.Threading.Tasks.Task ChunksStreamAsync(string swarm_postage_batch_id, int? swarm_tag = null, bool? swarm_pin = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + var urlBuilder_ = new System.Text.StringBuilder(); + urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/chunks/stream"); + + var client_ = _httpClient; + var disposeClient_ = false; + try + { + using (var request_ = new System.Net.Http.HttpRequestMessage()) + { + + if (swarm_postage_batch_id == null) + throw new System.ArgumentNullException("swarm_postage_batch_id"); + request_.Headers.TryAddWithoutValidation("swarm-postage-batch-id", ConvertToString(swarm_postage_batch_id, System.Globalization.CultureInfo.InvariantCulture)); + + if (swarm_tag != null) + request_.Headers.TryAddWithoutValidation("swarm-tag", ConvertToString(swarm_tag, System.Globalization.CultureInfo.InvariantCulture)); + + if (swarm_pin != null) + request_.Headers.TryAddWithoutValidation("swarm-pin", ConvertToString(swarm_pin, System.Globalization.CultureInfo.InvariantCulture)); + request_.Method = new System.Net.Http.HttpMethod("GET"); + + PrepareRequest(client_, request_, urlBuilder_); + + var url_ = urlBuilder_.ToString(); + request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); + + PrepareRequest(client_, request_, url_); + + var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); + var disposeResponse_ = true; + try + { + var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + if (response_.Content != null && response_.Content.Headers != null) + { + foreach (var item_ in response_.Content.Headers) + headers_[item_.Key] = item_.Value; + } + + ProcessResponse(client_, response_); + + var status_ = (int)response_.StatusCode; + if (status_ == 200) + { + return; + } + else + if (status_ == 400) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new BeeNetGatewayApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new BeeNetGatewayApiException("Bad request", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else + { + var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); + throw new BeeNetGatewayApiException("Default response", status_, responseData_, headers_, null); + } + } + finally + { + if (disposeResponse_) + response_.Dispose(); + } + } + } + finally + { + if (disposeClient_) + client_.Dispose(); + } + } + + /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. + /// + /// Upload file or a collection of files + /// + /// ID of Postage Batch that is used to upload data with + /// Filename when uploading single file + /// Associate upload with an existing Tag UID + /// Represents if the uploaded data should be also locally pinned on the node. + ///
Warning! Not available for nodes that run in Gateway mode! + /// Represents the encrypting state of the file + ///
Warning! Not available for nodes that run in Gateway mode! + /// The specified content-type is preserved for download of the asset + /// Upload file/files as a collection + /// Default file to be referenced on path, if exists under that path + /// Configure custom error document to be returned when a specified path can not be found in collection + /// Determines if the uploaded data should be sent to the network immediately or in a deferred fashion. By default the upload will be deferred. + /// Ok + /// A server side error occurred. + public virtual async System.Threading.Tasks.Task BzzPostAsync(string swarm_postage_batch_id, string? name = null, int? swarm_tag = null, bool? swarm_pin = null, bool? swarm_encrypt = null, string? content_Type = null, bool? swarm_collection = null, string? swarm_index_document = null, string? swarm_error_document = null, bool? swarm_deferred_upload = null, System.Collections.Generic.IEnumerable? file = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + var urlBuilder_ = new System.Text.StringBuilder(); + urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/bzz?"); + if (name != null) + { + urlBuilder_.Append(System.Uri.EscapeDataString("name") + "=").Append(System.Uri.EscapeDataString(ConvertToString(name, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); + } + urlBuilder_.Length--; + + var client_ = _httpClient; + var disposeClient_ = false; + try + { + using (var request_ = new System.Net.Http.HttpRequestMessage()) + { + + if (swarm_postage_batch_id == null) + throw new System.ArgumentNullException("swarm_postage_batch_id"); + request_.Headers.TryAddWithoutValidation("swarm-postage-batch-id", ConvertToString(swarm_postage_batch_id, System.Globalization.CultureInfo.InvariantCulture)); + + if (swarm_tag != null) + request_.Headers.TryAddWithoutValidation("swarm-tag", ConvertToString(swarm_tag, System.Globalization.CultureInfo.InvariantCulture)); + + if (swarm_pin != null) + request_.Headers.TryAddWithoutValidation("swarm-pin", ConvertToString(swarm_pin, System.Globalization.CultureInfo.InvariantCulture)); + + if (swarm_encrypt != null) + request_.Headers.TryAddWithoutValidation("swarm-encrypt", ConvertToString(swarm_encrypt, System.Globalization.CultureInfo.InvariantCulture)); + + if (content_Type != null) + request_.Headers.TryAddWithoutValidation("Content-Type", ConvertToString(content_Type, System.Globalization.CultureInfo.InvariantCulture)); + + if (swarm_collection != null) + request_.Headers.TryAddWithoutValidation("swarm-collection", ConvertToString(swarm_collection, System.Globalization.CultureInfo.InvariantCulture)); + + if (swarm_index_document != null) + request_.Headers.TryAddWithoutValidation("swarm-index-document", ConvertToString(swarm_index_document, System.Globalization.CultureInfo.InvariantCulture)); + + if (swarm_error_document != null) + request_.Headers.TryAddWithoutValidation("swarm-error-document", ConvertToString(swarm_error_document, System.Globalization.CultureInfo.InvariantCulture)); + + if (swarm_deferred_upload != null) + request_.Headers.TryAddWithoutValidation("swarm-deferred-upload", ConvertToString(swarm_deferred_upload, System.Globalization.CultureInfo.InvariantCulture)); + var boundary_ = System.Guid.NewGuid().ToString(); + var content_ = new System.Net.Http.MultipartFormDataContent(boundary_); + content_.Headers.Remove("Content-Type"); + content_.Headers.TryAddWithoutValidation("Content-Type", "multipart/form-data; boundary=" + boundary_); + + if (file == null) + throw new System.ArgumentNullException("file"); + else + { + foreach (var item_ in file) + { + var content_file_ = new System.Net.Http.StreamContent(item_.Data); + if (!string.IsNullOrEmpty(item_.ContentType)) + content_file_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse(item_.ContentType); + content_.Add(content_file_, "file", item_.FileName ?? "file"); + } + } + request_.Content = content_; + request_.Method = new System.Net.Http.HttpMethod("POST"); + request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); + + PrepareRequest(client_, request_, urlBuilder_); + + var url_ = urlBuilder_.ToString(); + request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); + + PrepareRequest(client_, request_, url_); + + var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); + var disposeResponse_ = true; + try + { + var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + if (response_.Content != null && response_.Content.Headers != null) + { + foreach (var item_ in response_.Content.Headers) + headers_[item_.Key] = item_.Value; + } + + ProcessResponse(client_, response_); + + var status_ = (int)response_.StatusCode; + if (status_ == 201) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new BeeNetGatewayApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + return objectResponse_.Object; + } + else + if (status_ == 400) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new BeeNetGatewayApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new BeeNetGatewayApiException("Bad request", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else + if (status_ == 402) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new BeeNetGatewayApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new BeeNetGatewayApiException("Payment Required", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else + if (status_ == 403) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new BeeNetGatewayApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new BeeNetGatewayApiException("Endpoint or header (pinning or encryption headers) forbidden in Gateway mode", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else + if (status_ == 500) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new BeeNetGatewayApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new BeeNetGatewayApiException("Internal Server Error", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else + { + var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); + throw new BeeNetGatewayApiException("Default response", status_, responseData_, headers_, null); + } + } + finally + { + if (disposeResponse_) + response_.Dispose(); + } + } + } + finally + { + if (disposeClient_) + client_.Dispose(); + } + } + + /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. + /// + /// Reupload a root hash to the network; deprecated: use /stewardship/{reference} instead + /// + /// Root hash of content (can be of any type: collection, file, chunk) + /// Ok + /// A server side error occurred. + [System.Obsolete] + public virtual async System.Threading.Tasks.Task BzzPatchAsync(string reference, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + if (reference == null) + throw new System.ArgumentNullException("reference"); + + var urlBuilder_ = new System.Text.StringBuilder(); + urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/bzz/{reference}"); + urlBuilder_.Replace("{reference}", System.Uri.EscapeDataString(ConvertToString(reference, System.Globalization.CultureInfo.InvariantCulture))); + + var client_ = _httpClient; + var disposeClient_ = false; + try + { + using (var request_ = new System.Net.Http.HttpRequestMessage()) + { + request_.Content = new System.Net.Http.StringContent(string.Empty, System.Text.Encoding.UTF8, "application/json"); + request_.Method = new System.Net.Http.HttpMethod("PATCH"); + + PrepareRequest(client_, request_, urlBuilder_); + + var url_ = urlBuilder_.ToString(); + request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); + + PrepareRequest(client_, request_, url_); + + var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); + var disposeResponse_ = true; + try + { + var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + if (response_.Content != null && response_.Content.Headers != null) + { + foreach (var item_ in response_.Content.Headers) + headers_[item_.Key] = item_.Value; + } + + ProcessResponse(client_, response_); + + var status_ = (int)response_.StatusCode; + if (status_ == 200) + { + return; + } + else + if (status_ == 500) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new BeeNetGatewayApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new BeeNetGatewayApiException("Internal Server Error", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else + { + var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); + throw new BeeNetGatewayApiException("Default response", status_, responseData_, headers_, null); + } + } + finally + { + if (disposeResponse_) + response_.Dispose(); + } + } + } + finally + { + if (disposeClient_) + client_.Dispose(); + } + } + + /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. + /// + /// Get file or index document from a collection of files + /// + /// Swarm address of content + /// Global pinning targets prefix + /// Ok + /// A server side error occurred. + public virtual async System.Threading.Tasks.Task BzzGetAsync(string reference, string? targets = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + if (reference == null) + throw new System.ArgumentNullException("reference"); + + var urlBuilder_ = new System.Text.StringBuilder(); + urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/bzz/{reference}?"); + urlBuilder_.Replace("{reference}", System.Uri.EscapeDataString(ConvertToString(reference, System.Globalization.CultureInfo.InvariantCulture))); + if (targets != null) + { + urlBuilder_.Append(System.Uri.EscapeDataString("targets") + "=").Append(System.Uri.EscapeDataString(ConvertToString(targets, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); + } + urlBuilder_.Length--; + + var client_ = _httpClient; + var disposeClient_ = false; + try + { + using (var request_ = new System.Net.Http.HttpRequestMessage()) + { + request_.Method = new System.Net.Http.HttpMethod("GET"); + request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/octet-stream")); + + PrepareRequest(client_, request_, urlBuilder_); + + var url_ = urlBuilder_.ToString(); + request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); + + PrepareRequest(client_, request_, url_); + + var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); + var disposeResponse_ = true; + try + { + var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + if (response_.Content != null && response_.Content.Headers != null) + { + foreach (var item_ in response_.Content.Headers) + headers_[item_.Key] = item_.Value; + } + + ProcessResponse(client_, response_); + + var status_ = (int)response_.StatusCode; + if (status_ == 200 || status_ == 206) + { + var responseStream_ = response_.Content == null ? System.IO.Stream.Null : await response_.Content.ReadAsStreamAsync().ConfigureAwait(false); + var fileResponse_ = new FileResponse(status_, headers_, responseStream_, null, response_); + disposeClient_ = false; disposeResponse_ = false; // response and client are disposed by FileResponse + return fileResponse_; + } + else + if (status_ == 400) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new BeeNetGatewayApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new BeeNetGatewayApiException("Bad request", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else + if (status_ == 404) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new BeeNetGatewayApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new BeeNetGatewayApiException("Not Found", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else + if (status_ == 500) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new BeeNetGatewayApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new BeeNetGatewayApiException("Internal Server Error", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else + { + var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); + throw new BeeNetGatewayApiException("Default response", status_, responseData_, headers_, null); + } + } + finally + { + if (disposeResponse_) + response_.Dispose(); + } + } + } + finally + { + if (disposeClient_) + client_.Dispose(); + } + } + + /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. + /// + /// Get referenced file from a collection of files + /// + /// Swarm address of content + /// Path to the file in the collection. + /// Global pinning targets prefix + /// Ok + /// A server side error occurred. + public virtual async System.Threading.Tasks.Task BzzGetAsync(string reference, string path, string? targets = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + if (reference == null) + throw new System.ArgumentNullException("reference"); + + if (path == null) + throw new System.ArgumentNullException("path"); + + var urlBuilder_ = new System.Text.StringBuilder(); + urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/bzz/{reference}/{path}?"); + urlBuilder_.Replace("{reference}", System.Uri.EscapeDataString(ConvertToString(reference, System.Globalization.CultureInfo.InvariantCulture))); + urlBuilder_.Replace("{path}", System.Uri.EscapeDataString(ConvertToString(path, System.Globalization.CultureInfo.InvariantCulture))); + if (targets != null) + { + urlBuilder_.Append(System.Uri.EscapeDataString("targets") + "=").Append(System.Uri.EscapeDataString(ConvertToString(targets, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); + } + urlBuilder_.Length--; + + var client_ = _httpClient; + var disposeClient_ = false; + try + { + using (var request_ = new System.Net.Http.HttpRequestMessage()) + { + request_.Method = new System.Net.Http.HttpMethod("GET"); + request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/octet-stream")); + + PrepareRequest(client_, request_, urlBuilder_); + + var url_ = urlBuilder_.ToString(); + request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); + + PrepareRequest(client_, request_, url_); + + var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); + var disposeResponse_ = true; + try + { + var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + if (response_.Content != null && response_.Content.Headers != null) + { + foreach (var item_ in response_.Content.Headers) + headers_[item_.Key] = item_.Value; + } + + ProcessResponse(client_, response_); + + var status_ = (int)response_.StatusCode; + if (status_ == 200 || status_ == 206) + { + var responseStream_ = response_.Content == null ? System.IO.Stream.Null : await response_.Content.ReadAsStreamAsync().ConfigureAwait(false); + var fileResponse_ = new FileResponse(status_, headers_, responseStream_, null, response_); + disposeClient_ = false; disposeResponse_ = false; // response and client are disposed by FileResponse + return fileResponse_; + } + else + if (status_ == 400) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new BeeNetGatewayApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new BeeNetGatewayApiException("Bad request", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else + if (status_ == 404) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new BeeNetGatewayApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new BeeNetGatewayApiException("Not Found", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else + if (status_ == 500) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new BeeNetGatewayApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new BeeNetGatewayApiException("Internal Server Error", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else + { + var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); + throw new BeeNetGatewayApiException("Default response", status_, responseData_, headers_, null); + } + } + finally + { + if (disposeResponse_) + response_.Dispose(); + } + } + } + finally + { + if (disposeClient_) + client_.Dispose(); + } + } + + /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. + /// + /// Get list of tags + /// + /// The number of items to skip before starting to collect the result set. + /// The numbers of items to return. + /// List of tags + /// A server side error occurred. + public virtual async System.Threading.Tasks.Task TagsGetAsync(int? offset = null, int? limit = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + var urlBuilder_ = new System.Text.StringBuilder(); + urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/tags?"); + if (offset != null) + { + urlBuilder_.Append(System.Uri.EscapeDataString("offset") + "=").Append(System.Uri.EscapeDataString(ConvertToString(offset, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); + } + if (limit != null) + { + urlBuilder_.Append(System.Uri.EscapeDataString("limit") + "=").Append(System.Uri.EscapeDataString(ConvertToString(limit, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); + } + urlBuilder_.Length--; + + var client_ = _httpClient; + var disposeClient_ = false; + try + { + using (var request_ = new System.Net.Http.HttpRequestMessage()) + { + request_.Method = new System.Net.Http.HttpMethod("GET"); + request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); + + PrepareRequest(client_, request_, urlBuilder_); + + var url_ = urlBuilder_.ToString(); + request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); + + PrepareRequest(client_, request_, url_); + + var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); + var disposeResponse_ = true; + try + { + var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + if (response_.Content != null && response_.Content.Headers != null) + { + foreach (var item_ in response_.Content.Headers) + headers_[item_.Key] = item_.Value; + } + + ProcessResponse(client_, response_); + + var status_ = (int)response_.StatusCode; + if (status_ == 200) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new BeeNetGatewayApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + return objectResponse_.Object; + } + else + if (status_ == 403) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new BeeNetGatewayApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new BeeNetGatewayApiException("Endpoint or header (pinning or encryption headers) forbidden in Gateway mode", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else + if (status_ == 500) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new BeeNetGatewayApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new BeeNetGatewayApiException("Internal Server Error", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else + { + var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); + throw new BeeNetGatewayApiException("Default response", status_, responseData_, headers_, null); + } + } + finally + { + if (disposeResponse_) + response_.Dispose(); + } + } + } + finally + { + if (disposeClient_) + client_.Dispose(); + } + } + + /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. + /// + /// Create Tag + /// + /// New Tag Info + /// A server side error occurred. + public virtual async System.Threading.Tasks.Task TagsPostAsync(Body3 body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + if (body == null) + throw new System.ArgumentNullException("body"); + + var urlBuilder_ = new System.Text.StringBuilder(); + urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/tags"); + + var client_ = _httpClient; + var disposeClient_ = false; + try + { + using (var request_ = new System.Net.Http.HttpRequestMessage()) + { + var content_ = new System.Net.Http.StringContent(System.Text.Json.JsonSerializer.Serialize(body, _settings.Value)); + content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + request_.Content = content_; + request_.Method = new System.Net.Http.HttpMethod("POST"); + request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); + + PrepareRequest(client_, request_, urlBuilder_); + + var url_ = urlBuilder_.ToString(); + request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); + + PrepareRequest(client_, request_, url_); + + var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); + var disposeResponse_ = true; + try + { + var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + if (response_.Content != null && response_.Content.Headers != null) + { + foreach (var item_ in response_.Content.Headers) + headers_[item_.Key] = item_.Value; + } + + ProcessResponse(client_, response_); + + var status_ = (int)response_.StatusCode; + if (status_ == 201) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new BeeNetGatewayApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + return objectResponse_.Object; + } + else + if (status_ == 403) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new BeeNetGatewayApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new BeeNetGatewayApiException("Endpoint or header (pinning or encryption headers) forbidden in Gateway mode", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else + if (status_ == 500) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new BeeNetGatewayApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new BeeNetGatewayApiException("Internal Server Error", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else + { + var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); + throw new BeeNetGatewayApiException("Default response", status_, responseData_, headers_, null); + } + } + finally + { + if (disposeResponse_) + response_.Dispose(); + } + } + } + finally + { + if (disposeClient_) + client_.Dispose(); + } + } + + /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. + /// + /// Get Tag information using Uid + /// + /// Uid + /// Tag info + /// A server side error occurred. + public virtual async System.Threading.Tasks.Task TagsGetAsync(int uid, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + if (uid == null) + throw new System.ArgumentNullException("uid"); + + var urlBuilder_ = new System.Text.StringBuilder(); + urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/tags/{uid}"); + urlBuilder_.Replace("{uid}", System.Uri.EscapeDataString(ConvertToString(uid, System.Globalization.CultureInfo.InvariantCulture))); + + var client_ = _httpClient; + var disposeClient_ = false; + try + { + using (var request_ = new System.Net.Http.HttpRequestMessage()) + { + request_.Method = new System.Net.Http.HttpMethod("GET"); + request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); + + PrepareRequest(client_, request_, urlBuilder_); + + var url_ = urlBuilder_.ToString(); + request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); + + PrepareRequest(client_, request_, url_); + + var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); + var disposeResponse_ = true; + try + { + var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + if (response_.Content != null && response_.Content.Headers != null) + { + foreach (var item_ in response_.Content.Headers) + headers_[item_.Key] = item_.Value; + } + + ProcessResponse(client_, response_); + + var status_ = (int)response_.StatusCode; + if (status_ == 200) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new BeeNetGatewayApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + return objectResponse_.Object; + } + else + if (status_ == 400) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new BeeNetGatewayApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new BeeNetGatewayApiException("Bad request", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else + if (status_ == 403) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new BeeNetGatewayApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new BeeNetGatewayApiException("Endpoint or header (pinning or encryption headers) forbidden in Gateway mode", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else + if (status_ == 404) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new BeeNetGatewayApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new BeeNetGatewayApiException("Not Found", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else + if (status_ == 500) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new BeeNetGatewayApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new BeeNetGatewayApiException("Internal Server Error", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else + { + var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); + throw new BeeNetGatewayApiException("Default response", status_, responseData_, headers_, null); + } + } + finally + { + if (disposeResponse_) + response_.Dispose(); + } + } + } + finally + { + if (disposeClient_) + client_.Dispose(); + } + } + + /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. + /// + /// Delete Tag information using Uid + /// + /// Uid + /// The resource was deleted successfully. + /// A server side error occurred. + public virtual async System.Threading.Tasks.Task TagsDeleteAsync(int uid, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + if (uid == null) + throw new System.ArgumentNullException("uid"); + + var urlBuilder_ = new System.Text.StringBuilder(); + urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/tags/{uid}"); + urlBuilder_.Replace("{uid}", System.Uri.EscapeDataString(ConvertToString(uid, System.Globalization.CultureInfo.InvariantCulture))); + + var client_ = _httpClient; + var disposeClient_ = false; + try + { + using (var request_ = new System.Net.Http.HttpRequestMessage()) + { + request_.Method = new System.Net.Http.HttpMethod("DELETE"); + + PrepareRequest(client_, request_, urlBuilder_); + + var url_ = urlBuilder_.ToString(); + request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); + + PrepareRequest(client_, request_, url_); + + var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); + var disposeResponse_ = true; + try + { + var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + if (response_.Content != null && response_.Content.Headers != null) + { + foreach (var item_ in response_.Content.Headers) + headers_[item_.Key] = item_.Value; + } + + ProcessResponse(client_, response_); + + var status_ = (int)response_.StatusCode; + if (status_ == 204) + { + return; + } + else + if (status_ == 400) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new BeeNetGatewayApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new BeeNetGatewayApiException("Bad request", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else + if (status_ == 403) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new BeeNetGatewayApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new BeeNetGatewayApiException("Endpoint or header (pinning or encryption headers) forbidden in Gateway mode", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else + if (status_ == 404) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new BeeNetGatewayApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new BeeNetGatewayApiException("Not Found", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else + if (status_ == 500) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new BeeNetGatewayApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new BeeNetGatewayApiException("Internal Server Error", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else + { + var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); + throw new BeeNetGatewayApiException("Default response", status_, responseData_, headers_, null); + } + } + finally + { + if (disposeResponse_) + response_.Dispose(); + } + } + } + finally + { + if (disposeClient_) + client_.Dispose(); + } + } + + /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. + /// + /// Update Total Count and swarm hash for a tag of an input stream of unknown size using Uid + /// + /// Uid + /// Can contain swarm hash to use for the tag + /// Ok + /// A server side error occurred. + public virtual async System.Threading.Tasks.Task TagsPatchAsync(int uid, Body4? body = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + if (uid == null) + throw new System.ArgumentNullException("uid"); + + var urlBuilder_ = new System.Text.StringBuilder(); + urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/tags/{uid}"); + urlBuilder_.Replace("{uid}", System.Uri.EscapeDataString(ConvertToString(uid, System.Globalization.CultureInfo.InvariantCulture))); + + var client_ = _httpClient; + var disposeClient_ = false; + try + { + using (var request_ = new System.Net.Http.HttpRequestMessage()) + { + var content_ = new System.Net.Http.StringContent(System.Text.Json.JsonSerializer.Serialize(body, _settings.Value)); + content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + request_.Content = content_; + request_.Method = new System.Net.Http.HttpMethod("PATCH"); + request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); + + PrepareRequest(client_, request_, urlBuilder_); + + var url_ = urlBuilder_.ToString(); + request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); + + PrepareRequest(client_, request_, url_); + + var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); + var disposeResponse_ = true; + try + { + var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + if (response_.Content != null && response_.Content.Headers != null) + { + foreach (var item_ in response_.Content.Headers) + headers_[item_.Key] = item_.Value; + } + + ProcessResponse(client_, response_); + + var status_ = (int)response_.StatusCode; + if (status_ == 200) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new BeeNetGatewayApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + return objectResponse_.Object; + } + else + if (status_ == 403) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new BeeNetGatewayApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new BeeNetGatewayApiException("Endpoint or header (pinning or encryption headers) forbidden in Gateway mode", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else + if (status_ == 404) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new BeeNetGatewayApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new BeeNetGatewayApiException("Not Found", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else + if (status_ == 500) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new BeeNetGatewayApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new BeeNetGatewayApiException("Internal Server Error", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else + { + var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); + throw new BeeNetGatewayApiException("Default response", status_, responseData_, headers_, null); + } + } + finally + { + if (disposeResponse_) + response_.Dispose(); + } + } + } + finally + { + if (disposeClient_) + client_.Dispose(); + } + } + + /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. + /// + /// Pin the root hash with the given reference + /// + /// Swarm reference of the root hash + /// Pin already exists, so no operation + /// A server side error occurred. + public virtual async System.Threading.Tasks.Task PinsPostAsync(string reference, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + if (reference == null) + throw new System.ArgumentNullException("reference"); + + var urlBuilder_ = new System.Text.StringBuilder(); + urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/pins/{reference}"); + urlBuilder_.Replace("{reference}", System.Uri.EscapeDataString(ConvertToString(reference, System.Globalization.CultureInfo.InvariantCulture))); + + var client_ = _httpClient; + var disposeClient_ = false; + try + { + using (var request_ = new System.Net.Http.HttpRequestMessage()) + { + request_.Content = new System.Net.Http.StringContent(string.Empty, System.Text.Encoding.UTF8, "application/json"); + request_.Method = new System.Net.Http.HttpMethod("POST"); + request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); + + PrepareRequest(client_, request_, urlBuilder_); + + var url_ = urlBuilder_.ToString(); + request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); + + PrepareRequest(client_, request_, url_); + + var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); + var disposeResponse_ = true; + try + { + var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + if (response_.Content != null && response_.Content.Headers != null) + { + foreach (var item_ in response_.Content.Headers) + headers_[item_.Key] = item_.Value; + } + + ProcessResponse(client_, response_); + + var status_ = (int)response_.StatusCode; + if (status_ == 200) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new BeeNetGatewayApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + return objectResponse_.Object; + } + else + if (status_ == 201) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new BeeNetGatewayApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new BeeNetGatewayApiException("New pin with root reference was created", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else + if (status_ == 400) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new BeeNetGatewayApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new BeeNetGatewayApiException("Bad request", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else + if (status_ == 403) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new BeeNetGatewayApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new BeeNetGatewayApiException("Endpoint or header (pinning or encryption headers) forbidden in Gateway mode", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else + if (status_ == 404) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new BeeNetGatewayApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new BeeNetGatewayApiException("Not Found", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else + if (status_ == 500) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new BeeNetGatewayApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new BeeNetGatewayApiException("Internal Server Error", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else + { + var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); + throw new BeeNetGatewayApiException("Default response", status_, responseData_, headers_, null); + } + } + finally + { + if (disposeResponse_) + response_.Dispose(); + } + } + } + finally + { + if (disposeClient_) + client_.Dispose(); + } + } + + /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. + /// + /// Unpin the root hash with the given reference + /// + /// Swarm reference of the root hash + /// Unpinning root hash with reference + /// A server side error occurred. + public virtual async System.Threading.Tasks.Task PinsDeleteAsync(string reference, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + if (reference == null) + throw new System.ArgumentNullException("reference"); + + var urlBuilder_ = new System.Text.StringBuilder(); + urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/pins/{reference}"); + urlBuilder_.Replace("{reference}", System.Uri.EscapeDataString(ConvertToString(reference, System.Globalization.CultureInfo.InvariantCulture))); + + var client_ = _httpClient; + var disposeClient_ = false; + try + { + using (var request_ = new System.Net.Http.HttpRequestMessage()) + { + request_.Method = new System.Net.Http.HttpMethod("DELETE"); + request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); + + PrepareRequest(client_, request_, urlBuilder_); + + var url_ = urlBuilder_.ToString(); + request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); + + PrepareRequest(client_, request_, url_); + + var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); + var disposeResponse_ = true; + try + { + var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + if (response_.Content != null && response_.Content.Headers != null) + { + foreach (var item_ in response_.Content.Headers) + headers_[item_.Key] = item_.Value; + } + + ProcessResponse(client_, response_); + + var status_ = (int)response_.StatusCode; + if (status_ == 200) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new BeeNetGatewayApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + return objectResponse_.Object; + } + else + if (status_ == 400) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new BeeNetGatewayApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new BeeNetGatewayApiException("Bad request", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else + if (status_ == 403) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new BeeNetGatewayApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new BeeNetGatewayApiException("Endpoint or header (pinning or encryption headers) forbidden in Gateway mode", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else + if (status_ == 500) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new BeeNetGatewayApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new BeeNetGatewayApiException("Internal Server Error", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else + { + var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); + throw new BeeNetGatewayApiException("Default response", status_, responseData_, headers_, null); + } + } + finally + { + if (disposeResponse_) + response_.Dispose(); + } + } + } + finally + { + if (disposeClient_) + client_.Dispose(); + } + } + + /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. + /// + /// Get pinning status of the root hash with the given reference + /// + /// Swarm reference of the root hash + /// Reference of the pinned root hash + /// A server side error occurred. + public virtual async System.Threading.Tasks.Task PinsGetAsync(string reference, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + if (reference == null) + throw new System.ArgumentNullException("reference"); + + var urlBuilder_ = new System.Text.StringBuilder(); + urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/pins/{reference}"); + urlBuilder_.Replace("{reference}", System.Uri.EscapeDataString(ConvertToString(reference, System.Globalization.CultureInfo.InvariantCulture))); + + var client_ = _httpClient; + var disposeClient_ = false; + try + { + using (var request_ = new System.Net.Http.HttpRequestMessage()) + { + request_.Method = new System.Net.Http.HttpMethod("GET"); + request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); + + PrepareRequest(client_, request_, urlBuilder_); + + var url_ = urlBuilder_.ToString(); + request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); + + PrepareRequest(client_, request_, url_); + + var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); + var disposeResponse_ = true; + try + { + var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + if (response_.Content != null && response_.Content.Headers != null) + { + foreach (var item_ in response_.Content.Headers) + headers_[item_.Key] = item_.Value; + } + + ProcessResponse(client_, response_); + + var status_ = (int)response_.StatusCode; + if (status_ == 200) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new BeeNetGatewayApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + return objectResponse_.Object; + } + else + if (status_ == 400) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new BeeNetGatewayApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new BeeNetGatewayApiException("Bad request", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else + if (status_ == 403) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new BeeNetGatewayApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new BeeNetGatewayApiException("Endpoint or header (pinning or encryption headers) forbidden in Gateway mode", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else + if (status_ == 404) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new BeeNetGatewayApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new BeeNetGatewayApiException("Not Found", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else + if (status_ == 500) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new BeeNetGatewayApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new BeeNetGatewayApiException("Internal Server Error", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else + { + var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); + throw new BeeNetGatewayApiException("Default response", status_, responseData_, headers_, null); + } + } + finally + { + if (disposeResponse_) + response_.Dispose(); + } + } + } + finally + { + if (disposeClient_) + client_.Dispose(); + } + } + + /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. + /// + /// Get the list of pinned root hash references + /// + /// List of pinned root hash references + /// A server side error occurred. + public virtual async System.Threading.Tasks.Task PinsGetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + var urlBuilder_ = new System.Text.StringBuilder(); + urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/pins"); + + var client_ = _httpClient; + var disposeClient_ = false; + try + { + using (var request_ = new System.Net.Http.HttpRequestMessage()) + { + request_.Method = new System.Net.Http.HttpMethod("GET"); + request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); + + PrepareRequest(client_, request_, urlBuilder_); + + var url_ = urlBuilder_.ToString(); + request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); + + PrepareRequest(client_, request_, url_); + + var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); + var disposeResponse_ = true; + try + { + var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + if (response_.Content != null && response_.Content.Headers != null) + { + foreach (var item_ in response_.Content.Headers) + headers_[item_.Key] = item_.Value; + } + + ProcessResponse(client_, response_); + + var status_ = (int)response_.StatusCode; + if (status_ == 200) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new BeeNetGatewayApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + return objectResponse_.Object; + } + else + if (status_ == 403) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new BeeNetGatewayApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new BeeNetGatewayApiException("Endpoint or header (pinning or encryption headers) forbidden in Gateway mode", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else + if (status_ == 500) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new BeeNetGatewayApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new BeeNetGatewayApiException("Internal Server Error", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else + { + var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); + throw new BeeNetGatewayApiException("Default response", status_, responseData_, headers_, null); + } + } + finally + { + if (disposeResponse_) + response_.Dispose(); + } + } + } + finally + { + if (disposeClient_) + client_.Dispose(); + } + } + + /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. + /// + /// Send to recipient or target with Postal Service for Swarm + /// + /// Topic name + /// Target message address prefix. If multiple targets are specified, only one would be matched. + /// ID of Postage Batch that is used to upload data with + /// Recipient publickey + /// Subscribed to topic + /// A server side error occurred. + public virtual async System.Threading.Tasks.Task PssSendAsync(string topic, string targets, string swarm_postage_batch_id, string? recipient = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + if (topic == null) + throw new System.ArgumentNullException("topic"); + + if (targets == null) + throw new System.ArgumentNullException("targets"); + + var urlBuilder_ = new System.Text.StringBuilder(); + urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/pss/send/{topic}/{targets}?"); + urlBuilder_.Replace("{topic}", System.Uri.EscapeDataString(ConvertToString(topic, System.Globalization.CultureInfo.InvariantCulture))); + urlBuilder_.Replace("{targets}", System.Uri.EscapeDataString(ConvertToString(targets, System.Globalization.CultureInfo.InvariantCulture))); + if (recipient != null) + { + urlBuilder_.Append(System.Uri.EscapeDataString("recipient") + "=").Append(System.Uri.EscapeDataString(ConvertToString(recipient, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); + } + urlBuilder_.Length--; + + var client_ = _httpClient; + var disposeClient_ = false; + try + { + using (var request_ = new System.Net.Http.HttpRequestMessage()) + { + + if (swarm_postage_batch_id == null) + throw new System.ArgumentNullException("swarm_postage_batch_id"); + request_.Headers.TryAddWithoutValidation("swarm-postage-batch-id", ConvertToString(swarm_postage_batch_id, System.Globalization.CultureInfo.InvariantCulture)); + request_.Content = new System.Net.Http.StringContent(string.Empty, System.Text.Encoding.UTF8, "application/json"); + request_.Method = new System.Net.Http.HttpMethod("POST"); + + PrepareRequest(client_, request_, urlBuilder_); + + var url_ = urlBuilder_.ToString(); + request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); + + PrepareRequest(client_, request_, url_); + + var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); + var disposeResponse_ = true; + try + { + var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + if (response_.Content != null && response_.Content.Headers != null) + { + foreach (var item_ in response_.Content.Headers) + headers_[item_.Key] = item_.Value; + } + + ProcessResponse(client_, response_); + + var status_ = (int)response_.StatusCode; + if (status_ == 201) + { + return; + } + else + if (status_ == 400) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new BeeNetGatewayApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new BeeNetGatewayApiException("Bad request", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else + if (status_ == 402) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new BeeNetGatewayApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new BeeNetGatewayApiException("Payment Required", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else + if (status_ == 403) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new BeeNetGatewayApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new BeeNetGatewayApiException("Endpoint or header (pinning or encryption headers) forbidden in Gateway mode", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else + if (status_ == 500) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new BeeNetGatewayApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new BeeNetGatewayApiException("Internal Server Error", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else + { + var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); + throw new BeeNetGatewayApiException("Default response", status_, responseData_, headers_, null); + } + } + finally + { + if (disposeResponse_) + response_.Dispose(); + } + } + } + finally + { + if (disposeClient_) + client_.Dispose(); + } + } + + /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. + /// + /// Subscribe for messages on the given topic. + /// + /// Topic name + /// Returns a WebSocket with a subscription for incoming message data on the requested topic. + /// A server side error occurred. + public virtual async System.Threading.Tasks.Task PssSubscribeAsync(string topic, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + if (topic == null) + throw new System.ArgumentNullException("topic"); + + var urlBuilder_ = new System.Text.StringBuilder(); + urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/pss/subscribe/{topic}"); + urlBuilder_.Replace("{topic}", System.Uri.EscapeDataString(ConvertToString(topic, System.Globalization.CultureInfo.InvariantCulture))); + + var client_ = _httpClient; + var disposeClient_ = false; + try + { + using (var request_ = new System.Net.Http.HttpRequestMessage()) + { + request_.Method = new System.Net.Http.HttpMethod("GET"); + + PrepareRequest(client_, request_, urlBuilder_); + + var url_ = urlBuilder_.ToString(); + request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); + + PrepareRequest(client_, request_, url_); + + var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); + var disposeResponse_ = true; + try + { + var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + if (response_.Content != null && response_.Content.Headers != null) + { + foreach (var item_ in response_.Content.Headers) + headers_[item_.Key] = item_.Value; + } + + ProcessResponse(client_, response_); + + var status_ = (int)response_.StatusCode; + if (status_ == 200) + { + return; + } + else + if (status_ == 403) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new BeeNetGatewayApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new BeeNetGatewayApiException("Endpoint or header (pinning or encryption headers) forbidden in Gateway mode", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else + if (status_ == 500) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new BeeNetGatewayApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new BeeNetGatewayApiException("Internal Server Error", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else + { + var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); + throw new BeeNetGatewayApiException("Default response", status_, responseData_, headers_, null); + } + } + finally + { + if (disposeResponse_) + response_.Dispose(); + } + } + } + finally + { + if (disposeClient_) + client_.Dispose(); + } + } + + /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. + /// + /// Upload single owner chunk + /// + /// Owner + /// Id + /// Signature + /// Represents if the uploaded data should be also locally pinned on the node. + ///
Warning! Not available for nodes that run in Gateway mode! + /// Created + /// A server side error occurred. + public virtual async System.Threading.Tasks.Task SocAsync(string owner, string id, string sig, bool? swarm_pin = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + if (owner == null) + throw new System.ArgumentNullException("owner"); + + if (id == null) + throw new System.ArgumentNullException("id"); + + if (sig == null) + throw new System.ArgumentNullException("sig"); + + var urlBuilder_ = new System.Text.StringBuilder(); + urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/soc/{owner}/{id}?"); + urlBuilder_.Replace("{owner}", System.Uri.EscapeDataString(ConvertToString(owner, System.Globalization.CultureInfo.InvariantCulture))); + urlBuilder_.Replace("{id}", System.Uri.EscapeDataString(ConvertToString(id, System.Globalization.CultureInfo.InvariantCulture))); + urlBuilder_.Append(System.Uri.EscapeDataString("sig") + "=").Append(System.Uri.EscapeDataString(ConvertToString(sig, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); + urlBuilder_.Length--; + + var client_ = _httpClient; + var disposeClient_ = false; + try + { + using (var request_ = new System.Net.Http.HttpRequestMessage()) + { + + if (swarm_pin != null) + request_.Headers.TryAddWithoutValidation("swarm-pin", ConvertToString(swarm_pin, System.Globalization.CultureInfo.InvariantCulture)); + request_.Content = new System.Net.Http.StringContent(string.Empty, System.Text.Encoding.UTF8, "application/json"); + request_.Method = new System.Net.Http.HttpMethod("POST"); + request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); + + PrepareRequest(client_, request_, urlBuilder_); + + var url_ = urlBuilder_.ToString(); + request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); + + PrepareRequest(client_, request_, url_); + + var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); + var disposeResponse_ = true; + try + { + var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + if (response_.Content != null && response_.Content.Headers != null) + { + foreach (var item_ in response_.Content.Headers) + headers_[item_.Key] = item_.Value; + } + + ProcessResponse(client_, response_); + + var status_ = (int)response_.StatusCode; + if (status_ == 201) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new BeeNetGatewayApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + return objectResponse_.Object; + } + else + if (status_ == 400) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new BeeNetGatewayApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new BeeNetGatewayApiException("Bad request", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else + if (status_ == 401) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new BeeNetGatewayApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new BeeNetGatewayApiException("Unauthorized", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else + if (status_ == 402) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new BeeNetGatewayApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new BeeNetGatewayApiException("Payment Required", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else + if (status_ == 403) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new BeeNetGatewayApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new BeeNetGatewayApiException("Endpoint or header (pinning or encryption headers) forbidden in Gateway mode", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else + if (status_ == 500) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new BeeNetGatewayApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new BeeNetGatewayApiException("Internal Server Error", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else + { + var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); + throw new BeeNetGatewayApiException("Default response", status_, responseData_, headers_, null); + } + } + finally + { + if (disposeResponse_) + response_.Dispose(); + } + } + } + finally + { + if (disposeClient_) + client_.Dispose(); + } + } + + /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. + /// + /// Create an initial feed root manifest + /// + /// Owner + /// Topic + /// ID of Postage Batch that is used to upload data with + /// Feed indexing scheme (default: sequence) + /// Represents if the uploaded data should be also locally pinned on the node. + ///
Warning! Not available for nodes that run in Gateway mode! + /// Created + /// A server side error occurred. + public virtual async System.Threading.Tasks.Task FeedsPostAsync(string owner, string topic, string swarm_postage_batch_id, string? type = null, bool? swarm_pin = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + if (owner == null) + throw new System.ArgumentNullException("owner"); + + if (topic == null) + throw new System.ArgumentNullException("topic"); + + var urlBuilder_ = new System.Text.StringBuilder(); + urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/feeds/{owner}/{topic}?"); + urlBuilder_.Replace("{owner}", System.Uri.EscapeDataString(ConvertToString(owner, System.Globalization.CultureInfo.InvariantCulture))); + urlBuilder_.Replace("{topic}", System.Uri.EscapeDataString(ConvertToString(topic, System.Globalization.CultureInfo.InvariantCulture))); + if (type != null) + { + urlBuilder_.Append(System.Uri.EscapeDataString("type") + "=").Append(System.Uri.EscapeDataString(ConvertToString(type, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); + } + urlBuilder_.Length--; + + var client_ = _httpClient; + var disposeClient_ = false; + try + { + using (var request_ = new System.Net.Http.HttpRequestMessage()) + { + + if (swarm_postage_batch_id == null) + throw new System.ArgumentNullException("swarm_postage_batch_id"); + request_.Headers.TryAddWithoutValidation("swarm-postage-batch-id", ConvertToString(swarm_postage_batch_id, System.Globalization.CultureInfo.InvariantCulture)); + + if (swarm_pin != null) + request_.Headers.TryAddWithoutValidation("swarm-pin", ConvertToString(swarm_pin, System.Globalization.CultureInfo.InvariantCulture)); + request_.Content = new System.Net.Http.StringContent(string.Empty, System.Text.Encoding.UTF8, "application/json"); + request_.Method = new System.Net.Http.HttpMethod("POST"); + request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); + + PrepareRequest(client_, request_, urlBuilder_); + + var url_ = urlBuilder_.ToString(); + request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); + + PrepareRequest(client_, request_, url_); + + var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); + var disposeResponse_ = true; + try + { + var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + if (response_.Content != null && response_.Content.Headers != null) + { + foreach (var item_ in response_.Content.Headers) + headers_[item_.Key] = item_.Value; + } + + ProcessResponse(client_, response_); + + var status_ = (int)response_.StatusCode; + if (status_ == 201) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new BeeNetGatewayApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + return objectResponse_.Object; + } + else + if (status_ == 400) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new BeeNetGatewayApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new BeeNetGatewayApiException("Bad request", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else + if (status_ == 401) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new BeeNetGatewayApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new BeeNetGatewayApiException("Unauthorized", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else + if (status_ == 402) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new BeeNetGatewayApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new BeeNetGatewayApiException("Payment Required", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else + if (status_ == 403) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new BeeNetGatewayApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new BeeNetGatewayApiException("Endpoint or header (pinning or encryption headers) forbidden in Gateway mode", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else + if (status_ == 500) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new BeeNetGatewayApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new BeeNetGatewayApiException("Internal Server Error", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else + { + var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); + throw new BeeNetGatewayApiException("Default response", status_, responseData_, headers_, null); + } + } + finally + { + if (disposeResponse_) + response_.Dispose(); + } + } + } + finally + { + if (disposeClient_) + client_.Dispose(); + } + } + + /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. + /// + /// Find feed update + /// + /// Owner + /// Topic + /// Timestamp of the update (default: now) + /// Feed indexing scheme (default: sequence) + /// Latest feed update + /// A server side error occurred. + public virtual async System.Threading.Tasks.Task FeedsGetAsync(string owner, string topic, int? at = null, string? type = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + if (owner == null) + throw new System.ArgumentNullException("owner"); + + if (topic == null) + throw new System.ArgumentNullException("topic"); + + var urlBuilder_ = new System.Text.StringBuilder(); + urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/feeds/{owner}/{topic}?"); + urlBuilder_.Replace("{owner}", System.Uri.EscapeDataString(ConvertToString(owner, System.Globalization.CultureInfo.InvariantCulture))); + urlBuilder_.Replace("{topic}", System.Uri.EscapeDataString(ConvertToString(topic, System.Globalization.CultureInfo.InvariantCulture))); + if (at != null) + { + urlBuilder_.Append(System.Uri.EscapeDataString("at") + "=").Append(System.Uri.EscapeDataString(ConvertToString(at, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); + } + if (type != null) + { + urlBuilder_.Append(System.Uri.EscapeDataString("type") + "=").Append(System.Uri.EscapeDataString(ConvertToString(type, System.Globalization.CultureInfo.InvariantCulture))).Append("&"); + } + urlBuilder_.Length--; + + var client_ = _httpClient; + var disposeClient_ = false; + try + { + using (var request_ = new System.Net.Http.HttpRequestMessage()) + { + request_.Method = new System.Net.Http.HttpMethod("GET"); + request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); + + PrepareRequest(client_, request_, urlBuilder_); + + var url_ = urlBuilder_.ToString(); + request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); + + PrepareRequest(client_, request_, url_); + + var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); + var disposeResponse_ = true; + try + { + var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + if (response_.Content != null && response_.Content.Headers != null) + { + foreach (var item_ in response_.Content.Headers) + headers_[item_.Key] = item_.Value; + } + + ProcessResponse(client_, response_); + + var status_ = (int)response_.StatusCode; + if (status_ == 200) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new BeeNetGatewayApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + return objectResponse_.Object; + } + else + if (status_ == 400) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new BeeNetGatewayApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new BeeNetGatewayApiException("Bad request", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else + if (status_ == 401) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new BeeNetGatewayApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new BeeNetGatewayApiException("Unauthorized", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else + if (status_ == 500) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new BeeNetGatewayApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new BeeNetGatewayApiException("Internal Server Error", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else + { + var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); + throw new BeeNetGatewayApiException("Default response", status_, responseData_, headers_, null); + } + } + finally + { + if (disposeResponse_) + response_.Dispose(); + } + } + } + finally + { + if (disposeClient_) + client_.Dispose(); + } + } + + /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. + /// + /// Check if content is available + /// + /// Root hash of content (can be of any type: collection, file, chunk) + /// Returns if the content is retrievable + /// A server side error occurred. + public virtual async System.Threading.Tasks.Task StewardshipGetAsync(string reference, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + if (reference == null) + throw new System.ArgumentNullException("reference"); + + var urlBuilder_ = new System.Text.StringBuilder(); + urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/stewardship/{reference}"); + urlBuilder_.Replace("{reference}", System.Uri.EscapeDataString(ConvertToString(reference, System.Globalization.CultureInfo.InvariantCulture))); + + var client_ = _httpClient; + var disposeClient_ = false; + try + { + using (var request_ = new System.Net.Http.HttpRequestMessage()) + { + request_.Method = new System.Net.Http.HttpMethod("GET"); + request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json")); + + PrepareRequest(client_, request_, urlBuilder_); + + var url_ = urlBuilder_.ToString(); + request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); + + PrepareRequest(client_, request_, url_); + + var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); + var disposeResponse_ = true; + try + { + var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + if (response_.Content != null && response_.Content.Headers != null) + { + foreach (var item_ in response_.Content.Headers) + headers_[item_.Key] = item_.Value; + } + + ProcessResponse(client_, response_); + + var status_ = (int)response_.StatusCode; + if (status_ == 200) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new BeeNetGatewayApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + return objectResponse_.Object; + } + else + if (status_ == 404) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new BeeNetGatewayApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new BeeNetGatewayApiException("Not Found", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else + if (status_ == 500) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new BeeNetGatewayApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new BeeNetGatewayApiException("Internal Server Error", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else + { + var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); + throw new BeeNetGatewayApiException("Default response", status_, responseData_, headers_, null); + } + } + finally + { + if (disposeResponse_) + response_.Dispose(); + } + } + } + finally + { + if (disposeClient_) + client_.Dispose(); + } + } + + /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. + /// + /// Reupload a root hash to the network + /// + /// Root hash of content (can be of any type: collection, file, chunk) + /// Ok + /// A server side error occurred. + public virtual async System.Threading.Tasks.Task StewardshipPutAsync(string reference, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + if (reference == null) + throw new System.ArgumentNullException("reference"); + + var urlBuilder_ = new System.Text.StringBuilder(); + urlBuilder_.Append(BaseUrl != null ? BaseUrl.TrimEnd('/') : "").Append("/stewardship/{reference}"); + urlBuilder_.Replace("{reference}", System.Uri.EscapeDataString(ConvertToString(reference, System.Globalization.CultureInfo.InvariantCulture))); + + var client_ = _httpClient; + var disposeClient_ = false; + try + { + using (var request_ = new System.Net.Http.HttpRequestMessage()) + { + request_.Content = new System.Net.Http.StringContent(string.Empty, System.Text.Encoding.UTF8, "application/json"); + request_.Method = new System.Net.Http.HttpMethod("PUT"); + + PrepareRequest(client_, request_, urlBuilder_); + + var url_ = urlBuilder_.ToString(); + request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute); + + PrepareRequest(client_, request_, url_); + + var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false); + var disposeResponse_ = true; + try + { + var headers_ = System.Linq.Enumerable.ToDictionary(response_.Headers, h_ => h_.Key, h_ => h_.Value); + if (response_.Content != null && response_.Content.Headers != null) + { + foreach (var item_ in response_.Content.Headers) + headers_[item_.Key] = item_.Value; + } + + ProcessResponse(client_, response_); + + var status_ = (int)response_.StatusCode; + if (status_ == 200) + { + return; + } + else + if (status_ == 404) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new BeeNetGatewayApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new BeeNetGatewayApiException("Not Found", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else + if (status_ == 500) + { + var objectResponse_ = await ReadObjectResponseAsync(response_, headers_, cancellationToken).ConfigureAwait(false); + if (objectResponse_.Object == null) + { + throw new BeeNetGatewayApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null); + } + throw new BeeNetGatewayApiException("Internal Server Error", status_, objectResponse_.Text, headers_, objectResponse_.Object, null); + } + else + { + var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false); + throw new BeeNetGatewayApiException("Default response", status_, responseData_, headers_, null); + } + } + finally + { + if (disposeResponse_) + response_.Dispose(); + } + } + } + finally + { + if (disposeClient_) + client_.Dispose(); + } + } + + protected struct ObjectResponseResult + { + public ObjectResponseResult(T responseObject, string responseText) + { + this.Object = responseObject; + this.Text = responseText; + } + + public T Object { get; } + + public string Text { get; } + } + + public bool ReadResponseAsString { get; set; } + + protected virtual async System.Threading.Tasks.Task> ReadObjectResponseAsync(System.Net.Http.HttpResponseMessage response, System.Collections.Generic.IReadOnlyDictionary> headers, System.Threading.CancellationToken cancellationToken) + { + if (response == null || response.Content == null) + { + return new ObjectResponseResult(default(T)!, string.Empty); + } + + if (ReadResponseAsString) + { + var responseText = await response.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + var typedBody = System.Text.Json.JsonSerializer.Deserialize(responseText, JsonSerializerSettings); + return new ObjectResponseResult(typedBody!, responseText); + } + catch (System.Text.Json.JsonException exception) + { + var message = "Could not deserialize the response body string as " + typeof(T).FullName + "."; + throw new BeeNetGatewayApiException(message, (int)response.StatusCode, responseText, headers, exception); + } + } + else + { + try + { + using (var responseStream = await response.Content.ReadAsStreamAsync().ConfigureAwait(false)) + { + var typedBody = await System.Text.Json.JsonSerializer.DeserializeAsync(responseStream, JsonSerializerSettings, cancellationToken).ConfigureAwait(false); + return new ObjectResponseResult(typedBody!, string.Empty); + } + } + catch (System.Text.Json.JsonException exception) + { + var message = "Could not deserialize the response body stream as " + typeof(T).FullName + "."; + throw new BeeNetGatewayApiException(message, (int)response.StatusCode, string.Empty, headers, exception); + } + } + } + + private string ConvertToString(object? value, System.Globalization.CultureInfo cultureInfo) + { + if (value == null) + { + return ""; + } + + if (value is System.Enum) + { + var name = System.Enum.GetName(value.GetType(), value); + if (name != null) + { + var field = System.Reflection.IntrospectionExtensions.GetTypeInfo(value.GetType()).GetDeclaredField(name); + if (field != null) + { + var attribute = System.Reflection.CustomAttributeExtensions.GetCustomAttribute(field, typeof(System.Runtime.Serialization.EnumMemberAttribute)) + as System.Runtime.Serialization.EnumMemberAttribute; + if (attribute != null) + { + return attribute.Value != null ? attribute.Value : name; + } + } + + var converted = System.Convert.ToString(System.Convert.ChangeType(value, System.Enum.GetUnderlyingType(value.GetType()), cultureInfo)); + return converted == null ? string.Empty : converted; + } + } + else if (value is bool) + { + return System.Convert.ToString((bool)value, cultureInfo).ToLowerInvariant(); + } + else if (value is byte[]) + { + return System.Convert.ToBase64String((byte[]) value); + } + else if (value.GetType().IsArray) + { + var array = System.Linq.Enumerable.OfType((System.Array) value); + return string.Join(",", System.Linq.Enumerable.Select(array, o => ConvertToString(o, cultureInfo))); + } + + var result = System.Convert.ToString(value, cultureInfo); + return result == null ? "" : result; + } + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.10.0 (NJsonSchema v10.6.10.0 (Newtonsoft.Json v12.0.0.0))")] + public partial class Body + { + + [System.Text.Json.Serialization.JsonPropertyName("role")] + public string Role { get; set; } = default!; + + /// + /// Expiration time in seconds + /// + + [System.Text.Json.Serialization.JsonPropertyName("expiry")] + public int Expiry { get; set; } = default!; + + private System.Collections.Generic.IDictionary _additionalProperties = new System.Collections.Generic.Dictionary(); + + [System.Text.Json.Serialization.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties; } + set { _additionalProperties = value; } + } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.10.0 (NJsonSchema v10.6.10.0 (Newtonsoft.Json v12.0.0.0))")] + public partial class Body2 + { + + [System.Text.Json.Serialization.JsonPropertyName("role")] + public string Role { get; set; } = default!; + + /// + /// Expiration time in seconds + /// + + [System.Text.Json.Serialization.JsonPropertyName("expiry")] + public int Expiry { get; set; } = default!; + + private System.Collections.Generic.IDictionary _additionalProperties = new System.Collections.Generic.Dictionary(); + + [System.Text.Json.Serialization.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties; } + set { _additionalProperties = value; } + } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.10.0 (NJsonSchema v10.6.10.0 (Newtonsoft.Json v12.0.0.0))")] + public partial class Body3 + { + + [System.Text.Json.Serialization.JsonPropertyName("address")] + [System.ComponentModel.DataAnnotations.RegularExpression(@"^[A-Fa-f0-9]{64}$")] + public string Address { get; set; } = default!; + + private System.Collections.Generic.IDictionary _additionalProperties = new System.Collections.Generic.Dictionary(); + + [System.Text.Json.Serialization.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties; } + set { _additionalProperties = value; } + } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.10.0 (NJsonSchema v10.6.10.0 (Newtonsoft.Json v12.0.0.0))")] + public partial class Body4 + { + + [System.Text.Json.Serialization.JsonPropertyName("address")] + [System.ComponentModel.DataAnnotations.RegularExpression(@"^[A-Fa-f0-9]{64}$")] + public string Address { get; set; } = default!; + + private System.Collections.Generic.IDictionary _additionalProperties = new System.Collections.Generic.Dictionary(); + + [System.Text.Json.Serialization.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties; } + set { _additionalProperties = value; } + } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.10.0 (NJsonSchema v10.6.10.0 (Newtonsoft.Json v12.0.0.0))")] + public partial class Response + { + + [System.Text.Json.Serialization.JsonPropertyName("key")] + public string Key { get; set; } = default!; + + private System.Collections.Generic.IDictionary _additionalProperties = new System.Collections.Generic.Dictionary(); + + [System.Text.Json.Serialization.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties; } + set { _additionalProperties = value; } + } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.10.0 (NJsonSchema v10.6.10.0 (Newtonsoft.Json v12.0.0.0))")] + public partial class Response2 + { + + [System.Text.Json.Serialization.JsonPropertyName("key")] + public string Key { get; set; } = default!; + + private System.Collections.Generic.IDictionary _additionalProperties = new System.Collections.Generic.Dictionary(); + + [System.Text.Json.Serialization.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties; } + set { _additionalProperties = value; } + } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.10.0 (NJsonSchema v10.6.10.0 (Newtonsoft.Json v12.0.0.0))")] + public partial class Response3 + { + + [System.Text.Json.Serialization.JsonPropertyName("reference")] + public string Reference { get; set; } = default!; + + private System.Collections.Generic.IDictionary _additionalProperties = new System.Collections.Generic.Dictionary(); + + [System.Text.Json.Serialization.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties; } + set { _additionalProperties = value; } + } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.10.0 (NJsonSchema v10.6.10.0 (Newtonsoft.Json v12.0.0.0))")] + public partial class Response4 + { + + [System.Text.Json.Serialization.JsonPropertyName("status")] + public string Status { get; set; } = default!; + + [System.Text.Json.Serialization.JsonPropertyName("version")] + public string Version { get; set; } = default!; + + /// + /// The default value is set in case the bee binary was not build correctly. + /// + + [System.Text.Json.Serialization.JsonPropertyName("apiVersion")] + public string ApiVersion { get; set; } = "0.0.0"; + + /// + /// The default value is set in case the bee binary was not build correctly. + /// + + [System.Text.Json.Serialization.JsonPropertyName("debugApiVersion")] + public string DebugApiVersion { get; set; } = "0.0.0"; + + private System.Collections.Generic.IDictionary _additionalProperties = new System.Collections.Generic.Dictionary(); + + [System.Text.Json.Serialization.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties; } + set { _additionalProperties = value; } + } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.10.0 (NJsonSchema v10.6.10.0 (Newtonsoft.Json v12.0.0.0))")] + public partial class Response5 + { + + [System.Text.Json.Serialization.JsonPropertyName("reference")] + public string Reference { get; set; } = default!; + + private System.Collections.Generic.IDictionary _additionalProperties = new System.Collections.Generic.Dictionary(); + + [System.Text.Json.Serialization.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties; } + set { _additionalProperties = value; } + } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.10.0 (NJsonSchema v10.6.10.0 (Newtonsoft.Json v12.0.0.0))")] + public partial class Response6 + { + + [System.Text.Json.Serialization.JsonPropertyName("tags")] + public System.Collections.Generic.ICollection? Tags { get; set; } = default!; + + private System.Collections.Generic.IDictionary _additionalProperties = new System.Collections.Generic.Dictionary(); + + [System.Text.Json.Serialization.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties; } + set { _additionalProperties = value; } + } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.10.0 (NJsonSchema v10.6.10.0 (Newtonsoft.Json v12.0.0.0))")] + public partial class Response7 + { + + [System.Text.Json.Serialization.JsonPropertyName("uid")] + public int Uid { get; set; } = default!; + + [System.Text.Json.Serialization.JsonPropertyName("startedAt")] + public System.DateTimeOffset StartedAt { get; set; } = default!; + + [System.Text.Json.Serialization.JsonPropertyName("total")] + public int Total { get; set; } = default!; + + [System.Text.Json.Serialization.JsonPropertyName("processed")] + public int Processed { get; set; } = default!; + + [System.Text.Json.Serialization.JsonPropertyName("synced")] + public int Synced { get; set; } = default!; + + private System.Collections.Generic.IDictionary _additionalProperties = new System.Collections.Generic.Dictionary(); + + [System.Text.Json.Serialization.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties; } + set { _additionalProperties = value; } + } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.10.0 (NJsonSchema v10.6.10.0 (Newtonsoft.Json v12.0.0.0))")] + public partial class Response8 + { + + [System.Text.Json.Serialization.JsonPropertyName("uid")] + public int Uid { get; set; } = default!; + + [System.Text.Json.Serialization.JsonPropertyName("startedAt")] + public System.DateTimeOffset StartedAt { get; set; } = default!; + + [System.Text.Json.Serialization.JsonPropertyName("total")] + public int Total { get; set; } = default!; + + [System.Text.Json.Serialization.JsonPropertyName("processed")] + public int Processed { get; set; } = default!; + + [System.Text.Json.Serialization.JsonPropertyName("synced")] + public int Synced { get; set; } = default!; + + private System.Collections.Generic.IDictionary _additionalProperties = new System.Collections.Generic.Dictionary(); + + [System.Text.Json.Serialization.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties; } + set { _additionalProperties = value; } + } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.10.0 (NJsonSchema v10.6.10.0 (Newtonsoft.Json v12.0.0.0))")] + public partial class Response9 + { + + [System.Text.Json.Serialization.JsonPropertyName("status")] + public string Status { get; set; } = default!; + + [System.Text.Json.Serialization.JsonPropertyName("version")] + public string Version { get; set; } = default!; + + /// + /// The default value is set in case the bee binary was not build correctly. + /// + + [System.Text.Json.Serialization.JsonPropertyName("apiVersion")] + public string ApiVersion { get; set; } = "0.0.0"; + + /// + /// The default value is set in case the bee binary was not build correctly. + /// + + [System.Text.Json.Serialization.JsonPropertyName("debugApiVersion")] + public string DebugApiVersion { get; set; } = "0.0.0"; + + private System.Collections.Generic.IDictionary _additionalProperties = new System.Collections.Generic.Dictionary(); + + [System.Text.Json.Serialization.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties; } + set { _additionalProperties = value; } + } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.10.0 (NJsonSchema v10.6.10.0 (Newtonsoft.Json v12.0.0.0))")] + public partial class Response10 + { + + [System.Text.Json.Serialization.JsonPropertyName("message")] + public string Message { get; set; } = default!; + + [System.Text.Json.Serialization.JsonPropertyName("code")] + public int Code { get; set; } = default!; + + private System.Collections.Generic.IDictionary _additionalProperties = new System.Collections.Generic.Dictionary(); + + [System.Text.Json.Serialization.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties; } + set { _additionalProperties = value; } + } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.10.0 (NJsonSchema v10.6.10.0 (Newtonsoft.Json v12.0.0.0))")] + public partial class Response11 + { + + [System.Text.Json.Serialization.JsonPropertyName("message")] + public string Message { get; set; } = default!; + + [System.Text.Json.Serialization.JsonPropertyName("code")] + public int Code { get; set; } = default!; + + private System.Collections.Generic.IDictionary _additionalProperties = new System.Collections.Generic.Dictionary(); + + [System.Text.Json.Serialization.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties; } + set { _additionalProperties = value; } + } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.10.0 (NJsonSchema v10.6.10.0 (Newtonsoft.Json v12.0.0.0))")] + public partial class Response12 + { + + [System.Text.Json.Serialization.JsonPropertyName("message")] + public string Message { get; set; } = default!; + + [System.Text.Json.Serialization.JsonPropertyName("code")] + public int Code { get; set; } = default!; + + private System.Collections.Generic.IDictionary _additionalProperties = new System.Collections.Generic.Dictionary(); + + [System.Text.Json.Serialization.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties; } + set { _additionalProperties = value; } + } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.10.0 (NJsonSchema v10.6.10.0 (Newtonsoft.Json v12.0.0.0))")] + public partial class Response13 + { + + [System.Text.Json.Serialization.JsonPropertyName("references")] + public System.Collections.Generic.ICollection References { get; set; } = default!; + + private System.Collections.Generic.IDictionary _additionalProperties = new System.Collections.Generic.Dictionary(); + + [System.Text.Json.Serialization.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties; } + set { _additionalProperties = value; } + } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.10.0 (NJsonSchema v10.6.10.0 (Newtonsoft.Json v12.0.0.0))")] + public partial class Response14 + { + + [System.Text.Json.Serialization.JsonPropertyName("reference")] + public string Reference { get; set; } = default!; + + private System.Collections.Generic.IDictionary _additionalProperties = new System.Collections.Generic.Dictionary(); + + [System.Text.Json.Serialization.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties; } + set { _additionalProperties = value; } + } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.10.0 (NJsonSchema v10.6.10.0 (Newtonsoft.Json v12.0.0.0))")] + public partial class Response15 + { + + [System.Text.Json.Serialization.JsonPropertyName("reference")] + public string Reference { get; set; } = default!; + + private System.Collections.Generic.IDictionary _additionalProperties = new System.Collections.Generic.Dictionary(); + + [System.Text.Json.Serialization.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties; } + set { _additionalProperties = value; } + } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.10.0 (NJsonSchema v10.6.10.0 (Newtonsoft.Json v12.0.0.0))")] + public partial class Response16 + { + + [System.Text.Json.Serialization.JsonPropertyName("reference")] + public string Reference { get; set; } = default!; + + private System.Collections.Generic.IDictionary _additionalProperties = new System.Collections.Generic.Dictionary(); + + [System.Text.Json.Serialization.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties; } + set { _additionalProperties = value; } + } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.10.0 (NJsonSchema v10.6.10.0 (Newtonsoft.Json v12.0.0.0))")] + public partial class Response17 + { + + [System.Text.Json.Serialization.JsonPropertyName("isRetrievable")] + public bool IsRetrievable { get; set; } = default!; + + private System.Collections.Generic.IDictionary _additionalProperties = new System.Collections.Generic.Dictionary(); + + [System.Text.Json.Serialization.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties; } + set { _additionalProperties = value; } + } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.10.0 (NJsonSchema v10.6.10.0 (Newtonsoft.Json v12.0.0.0))")] + public partial class Response18 + { + + [System.Text.Json.Serialization.JsonPropertyName("message")] + public string Message { get; set; } = default!; + + [System.Text.Json.Serialization.JsonPropertyName("code")] + public int Code { get; set; } = default!; + + private System.Collections.Generic.IDictionary _additionalProperties = new System.Collections.Generic.Dictionary(); + + [System.Text.Json.Serialization.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties; } + set { _additionalProperties = value; } + } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.10.0 (NJsonSchema v10.6.10.0 (Newtonsoft.Json v12.0.0.0))")] + public partial class Response19 + { + + [System.Text.Json.Serialization.JsonPropertyName("message")] + public string Message { get; set; } = default!; + + [System.Text.Json.Serialization.JsonPropertyName("code")] + public int Code { get; set; } = default!; + + private System.Collections.Generic.IDictionary _additionalProperties = new System.Collections.Generic.Dictionary(); + + [System.Text.Json.Serialization.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties; } + set { _additionalProperties = value; } + } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.10.0 (NJsonSchema v10.6.10.0 (Newtonsoft.Json v12.0.0.0))")] + public partial class Response20 + { + + [System.Text.Json.Serialization.JsonPropertyName("message")] + public string Message { get; set; } = default!; + + [System.Text.Json.Serialization.JsonPropertyName("code")] + public int Code { get; set; } = default!; + + private System.Collections.Generic.IDictionary _additionalProperties = new System.Collections.Generic.Dictionary(); + + [System.Text.Json.Serialization.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties; } + set { _additionalProperties = value; } + } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.10.0 (NJsonSchema v10.6.10.0 (Newtonsoft.Json v12.0.0.0))")] + public partial class Response21 + { + + [System.Text.Json.Serialization.JsonPropertyName("message")] + public string Message { get; set; } = default!; + + [System.Text.Json.Serialization.JsonPropertyName("code")] + public int Code { get; set; } = default!; + + private System.Collections.Generic.IDictionary _additionalProperties = new System.Collections.Generic.Dictionary(); + + [System.Text.Json.Serialization.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties; } + set { _additionalProperties = value; } + } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.10.0 (NJsonSchema v10.6.10.0 (Newtonsoft.Json v12.0.0.0))")] + public partial class Response22 + { + + [System.Text.Json.Serialization.JsonPropertyName("message")] + public string Message { get; set; } = default!; + + [System.Text.Json.Serialization.JsonPropertyName("code")] + public int Code { get; set; } = default!; + + private System.Collections.Generic.IDictionary _additionalProperties = new System.Collections.Generic.Dictionary(); + + [System.Text.Json.Serialization.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties; } + set { _additionalProperties = value; } + } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.10.0 (NJsonSchema v10.6.10.0 (Newtonsoft.Json v12.0.0.0))")] + public partial class Response23 + { + + [System.Text.Json.Serialization.JsonPropertyName("message")] + public string Message { get; set; } = default!; + + [System.Text.Json.Serialization.JsonPropertyName("code")] + public int Code { get; set; } = default!; + + private System.Collections.Generic.IDictionary _additionalProperties = new System.Collections.Generic.Dictionary(); + + [System.Text.Json.Serialization.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties; } + set { _additionalProperties = value; } + } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.10.0 (NJsonSchema v10.6.10.0 (Newtonsoft.Json v12.0.0.0))")] + public partial class Response24 + { + + [System.Text.Json.Serialization.JsonPropertyName("message")] + public string Message { get; set; } = default!; + + [System.Text.Json.Serialization.JsonPropertyName("code")] + public int Code { get; set; } = default!; + + private System.Collections.Generic.IDictionary _additionalProperties = new System.Collections.Generic.Dictionary(); + + [System.Text.Json.Serialization.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties; } + set { _additionalProperties = value; } + } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.10.0 (NJsonSchema v10.6.10.0 (Newtonsoft.Json v12.0.0.0))")] + public partial class Response25 + { + + [System.Text.Json.Serialization.JsonPropertyName("message")] + public string Message { get; set; } = default!; + + [System.Text.Json.Serialization.JsonPropertyName("code")] + public int Code { get; set; } = default!; + + private System.Collections.Generic.IDictionary _additionalProperties = new System.Collections.Generic.Dictionary(); + + [System.Text.Json.Serialization.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties; } + set { _additionalProperties = value; } + } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.10.0 (NJsonSchema v10.6.10.0 (Newtonsoft.Json v12.0.0.0))")] + public partial class Response26 + { + + [System.Text.Json.Serialization.JsonPropertyName("message")] + public string Message { get; set; } = default!; + + [System.Text.Json.Serialization.JsonPropertyName("code")] + public int Code { get; set; } = default!; + + private System.Collections.Generic.IDictionary _additionalProperties = new System.Collections.Generic.Dictionary(); + + [System.Text.Json.Serialization.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties; } + set { _additionalProperties = value; } + } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.10.0 (NJsonSchema v10.6.10.0 (Newtonsoft.Json v12.0.0.0))")] + public partial class Response27 + { + + [System.Text.Json.Serialization.JsonPropertyName("message")] + public string Message { get; set; } = default!; + + [System.Text.Json.Serialization.JsonPropertyName("code")] + public int Code { get; set; } = default!; + + private System.Collections.Generic.IDictionary _additionalProperties = new System.Collections.Generic.Dictionary(); + + [System.Text.Json.Serialization.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties; } + set { _additionalProperties = value; } + } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.10.0 (NJsonSchema v10.6.10.0 (Newtonsoft.Json v12.0.0.0))")] + public partial class Response28 + { + + [System.Text.Json.Serialization.JsonPropertyName("message")] + public string Message { get; set; } = default!; + + [System.Text.Json.Serialization.JsonPropertyName("code")] + public int Code { get; set; } = default!; + + private System.Collections.Generic.IDictionary _additionalProperties = new System.Collections.Generic.Dictionary(); + + [System.Text.Json.Serialization.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties; } + set { _additionalProperties = value; } + } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.10.0 (NJsonSchema v10.6.10.0 (Newtonsoft.Json v12.0.0.0))")] + public partial class Response29 + { + + [System.Text.Json.Serialization.JsonPropertyName("message")] + public string Message { get; set; } = default!; + + [System.Text.Json.Serialization.JsonPropertyName("code")] + public int Code { get; set; } = default!; + + private System.Collections.Generic.IDictionary _additionalProperties = new System.Collections.Generic.Dictionary(); + + [System.Text.Json.Serialization.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties; } + set { _additionalProperties = value; } + } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.10.0 (NJsonSchema v10.6.10.0 (Newtonsoft.Json v12.0.0.0))")] + public partial class Response30 + { + + [System.Text.Json.Serialization.JsonPropertyName("message")] + public string Message { get; set; } = default!; + + [System.Text.Json.Serialization.JsonPropertyName("code")] + public int Code { get; set; } = default!; + + private System.Collections.Generic.IDictionary _additionalProperties = new System.Collections.Generic.Dictionary(); + + [System.Text.Json.Serialization.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties; } + set { _additionalProperties = value; } + } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.10.0 (NJsonSchema v10.6.10.0 (Newtonsoft.Json v12.0.0.0))")] + public partial class Response31 + { + + [System.Text.Json.Serialization.JsonPropertyName("message")] + public string Message { get; set; } = default!; + + [System.Text.Json.Serialization.JsonPropertyName("code")] + public int Code { get; set; } = default!; + + private System.Collections.Generic.IDictionary _additionalProperties = new System.Collections.Generic.Dictionary(); + + [System.Text.Json.Serialization.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties; } + set { _additionalProperties = value; } + } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.10.0 (NJsonSchema v10.6.10.0 (Newtonsoft.Json v12.0.0.0))")] + public partial class Response32 + { + + [System.Text.Json.Serialization.JsonPropertyName("message")] + public string Message { get; set; } = default!; + + [System.Text.Json.Serialization.JsonPropertyName("code")] + public int Code { get; set; } = default!; + + private System.Collections.Generic.IDictionary _additionalProperties = new System.Collections.Generic.Dictionary(); + + [System.Text.Json.Serialization.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties; } + set { _additionalProperties = value; } + } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.10.0 (NJsonSchema v10.6.10.0 (Newtonsoft.Json v12.0.0.0))")] + public partial class Response33 + { + + [System.Text.Json.Serialization.JsonPropertyName("message")] + public string Message { get; set; } = default!; + + [System.Text.Json.Serialization.JsonPropertyName("code")] + public int Code { get; set; } = default!; + + private System.Collections.Generic.IDictionary _additionalProperties = new System.Collections.Generic.Dictionary(); + + [System.Text.Json.Serialization.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties; } + set { _additionalProperties = value; } + } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.10.0 (NJsonSchema v10.6.10.0 (Newtonsoft.Json v12.0.0.0))")] + public partial class Response34 + { + + [System.Text.Json.Serialization.JsonPropertyName("message")] + public string Message { get; set; } = default!; + + [System.Text.Json.Serialization.JsonPropertyName("code")] + public int Code { get; set; } = default!; + + private System.Collections.Generic.IDictionary _additionalProperties = new System.Collections.Generic.Dictionary(); + + [System.Text.Json.Serialization.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties; } + set { _additionalProperties = value; } + } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.10.0 (NJsonSchema v10.6.10.0 (Newtonsoft.Json v12.0.0.0))")] + public partial class Response35 + { + + [System.Text.Json.Serialization.JsonPropertyName("message")] + public string Message { get; set; } = default!; + + [System.Text.Json.Serialization.JsonPropertyName("code")] + public int Code { get; set; } = default!; + + private System.Collections.Generic.IDictionary _additionalProperties = new System.Collections.Generic.Dictionary(); + + [System.Text.Json.Serialization.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties; } + set { _additionalProperties = value; } + } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.10.0 (NJsonSchema v10.6.10.0 (Newtonsoft.Json v12.0.0.0))")] + public partial class Response36 + { + + [System.Text.Json.Serialization.JsonPropertyName("message")] + public string Message { get; set; } = default!; + + [System.Text.Json.Serialization.JsonPropertyName("code")] + public int Code { get; set; } = default!; + + private System.Collections.Generic.IDictionary _additionalProperties = new System.Collections.Generic.Dictionary(); + + [System.Text.Json.Serialization.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties; } + set { _additionalProperties = value; } + } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.10.0 (NJsonSchema v10.6.10.0 (Newtonsoft.Json v12.0.0.0))")] + public partial class Response37 + { + + [System.Text.Json.Serialization.JsonPropertyName("message")] + public string Message { get; set; } = default!; + + [System.Text.Json.Serialization.JsonPropertyName("code")] + public int Code { get; set; } = default!; + + private System.Collections.Generic.IDictionary _additionalProperties = new System.Collections.Generic.Dictionary(); + + [System.Text.Json.Serialization.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties; } + set { _additionalProperties = value; } + } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.10.0 (NJsonSchema v10.6.10.0 (Newtonsoft.Json v12.0.0.0))")] + public partial class Response38 + { + + [System.Text.Json.Serialization.JsonPropertyName("message")] + public string Message { get; set; } = default!; + + [System.Text.Json.Serialization.JsonPropertyName("code")] + public int Code { get; set; } = default!; + + private System.Collections.Generic.IDictionary _additionalProperties = new System.Collections.Generic.Dictionary(); + + [System.Text.Json.Serialization.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties; } + set { _additionalProperties = value; } + } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.10.0 (NJsonSchema v10.6.10.0 (Newtonsoft.Json v12.0.0.0))")] + public partial class Response39 + { + + [System.Text.Json.Serialization.JsonPropertyName("message")] + public string Message { get; set; } = default!; + + [System.Text.Json.Serialization.JsonPropertyName("code")] + public int Code { get; set; } = default!; + + private System.Collections.Generic.IDictionary _additionalProperties = new System.Collections.Generic.Dictionary(); + + [System.Text.Json.Serialization.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties; } + set { _additionalProperties = value; } + } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.10.0 (NJsonSchema v10.6.10.0 (Newtonsoft.Json v12.0.0.0))")] + public partial class Response40 + { + + [System.Text.Json.Serialization.JsonPropertyName("message")] + public string Message { get; set; } = default!; + + [System.Text.Json.Serialization.JsonPropertyName("code")] + public int Code { get; set; } = default!; + + private System.Collections.Generic.IDictionary _additionalProperties = new System.Collections.Generic.Dictionary(); + + [System.Text.Json.Serialization.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties; } + set { _additionalProperties = value; } + } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.10.0 (NJsonSchema v10.6.10.0 (Newtonsoft.Json v12.0.0.0))")] + public partial class Response41 + { + + [System.Text.Json.Serialization.JsonPropertyName("message")] + public string Message { get; set; } = default!; + + [System.Text.Json.Serialization.JsonPropertyName("code")] + public int Code { get; set; } = default!; + + private System.Collections.Generic.IDictionary _additionalProperties = new System.Collections.Generic.Dictionary(); + + [System.Text.Json.Serialization.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties; } + set { _additionalProperties = value; } + } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.10.0 (NJsonSchema v10.6.10.0 (Newtonsoft.Json v12.0.0.0))")] + public partial class Response42 + { + + [System.Text.Json.Serialization.JsonPropertyName("message")] + public string Message { get; set; } = default!; + + [System.Text.Json.Serialization.JsonPropertyName("code")] + public int Code { get; set; } = default!; + + private System.Collections.Generic.IDictionary _additionalProperties = new System.Collections.Generic.Dictionary(); + + [System.Text.Json.Serialization.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties; } + set { _additionalProperties = value; } + } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.10.0 (NJsonSchema v10.6.10.0 (Newtonsoft.Json v12.0.0.0))")] + public partial class Response43 + { + + [System.Text.Json.Serialization.JsonPropertyName("message")] + public string Message { get; set; } = default!; + + [System.Text.Json.Serialization.JsonPropertyName("code")] + public int Code { get; set; } = default!; + + private System.Collections.Generic.IDictionary _additionalProperties = new System.Collections.Generic.Dictionary(); + + [System.Text.Json.Serialization.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties; } + set { _additionalProperties = value; } + } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.10.0 (NJsonSchema v10.6.10.0 (Newtonsoft.Json v12.0.0.0))")] + public partial class Response44 + { + + [System.Text.Json.Serialization.JsonPropertyName("message")] + public string Message { get; set; } = default!; + + [System.Text.Json.Serialization.JsonPropertyName("code")] + public int Code { get; set; } = default!; + + private System.Collections.Generic.IDictionary _additionalProperties = new System.Collections.Generic.Dictionary(); + + [System.Text.Json.Serialization.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties; } + set { _additionalProperties = value; } + } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.10.0 (NJsonSchema v10.6.10.0 (Newtonsoft.Json v12.0.0.0))")] + public partial class Response45 + { + + [System.Text.Json.Serialization.JsonPropertyName("message")] + public string Message { get; set; } = default!; + + [System.Text.Json.Serialization.JsonPropertyName("code")] + public int Code { get; set; } = default!; + + private System.Collections.Generic.IDictionary _additionalProperties = new System.Collections.Generic.Dictionary(); + + [System.Text.Json.Serialization.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties; } + set { _additionalProperties = value; } + } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.10.0 (NJsonSchema v10.6.10.0 (Newtonsoft.Json v12.0.0.0))")] + public partial class Response46 + { + + [System.Text.Json.Serialization.JsonPropertyName("message")] + public string Message { get; set; } = default!; + + [System.Text.Json.Serialization.JsonPropertyName("code")] + public int Code { get; set; } = default!; + + private System.Collections.Generic.IDictionary _additionalProperties = new System.Collections.Generic.Dictionary(); + + [System.Text.Json.Serialization.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties; } + set { _additionalProperties = value; } + } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.10.0 (NJsonSchema v10.6.10.0 (Newtonsoft.Json v12.0.0.0))")] + public partial class Response47 + { + + [System.Text.Json.Serialization.JsonPropertyName("message")] + public string Message { get; set; } = default!; + + [System.Text.Json.Serialization.JsonPropertyName("code")] + public int Code { get; set; } = default!; + + private System.Collections.Generic.IDictionary _additionalProperties = new System.Collections.Generic.Dictionary(); + + [System.Text.Json.Serialization.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties; } + set { _additionalProperties = value; } + } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.10.0 (NJsonSchema v10.6.10.0 (Newtonsoft.Json v12.0.0.0))")] + public partial class Response48 + { + + [System.Text.Json.Serialization.JsonPropertyName("message")] + public string Message { get; set; } = default!; + + [System.Text.Json.Serialization.JsonPropertyName("code")] + public int Code { get; set; } = default!; + + private System.Collections.Generic.IDictionary _additionalProperties = new System.Collections.Generic.Dictionary(); + + [System.Text.Json.Serialization.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties; } + set { _additionalProperties = value; } + } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.10.0 (NJsonSchema v10.6.10.0 (Newtonsoft.Json v12.0.0.0))")] + public partial class Response49 + { + + [System.Text.Json.Serialization.JsonPropertyName("message")] + public string Message { get; set; } = default!; + + [System.Text.Json.Serialization.JsonPropertyName("code")] + public int Code { get; set; } = default!; + + private System.Collections.Generic.IDictionary _additionalProperties = new System.Collections.Generic.Dictionary(); + + [System.Text.Json.Serialization.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties; } + set { _additionalProperties = value; } + } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.10.0 (NJsonSchema v10.6.10.0 (Newtonsoft.Json v12.0.0.0))")] + public partial class Response50 + { + + [System.Text.Json.Serialization.JsonPropertyName("message")] + public string Message { get; set; } = default!; + + [System.Text.Json.Serialization.JsonPropertyName("code")] + public int Code { get; set; } = default!; + + private System.Collections.Generic.IDictionary _additionalProperties = new System.Collections.Generic.Dictionary(); + + [System.Text.Json.Serialization.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties; } + set { _additionalProperties = value; } + } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.10.0 (NJsonSchema v10.6.10.0 (Newtonsoft.Json v12.0.0.0))")] + public partial class Response51 + { + + [System.Text.Json.Serialization.JsonPropertyName("message")] + public string Message { get; set; } = default!; + + [System.Text.Json.Serialization.JsonPropertyName("code")] + public int Code { get; set; } = default!; + + private System.Collections.Generic.IDictionary _additionalProperties = new System.Collections.Generic.Dictionary(); + + [System.Text.Json.Serialization.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties; } + set { _additionalProperties = value; } + } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.10.0 (NJsonSchema v10.6.10.0 (Newtonsoft.Json v12.0.0.0))")] + public partial class Response52 + { + + [System.Text.Json.Serialization.JsonPropertyName("message")] + public string Message { get; set; } = default!; + + [System.Text.Json.Serialization.JsonPropertyName("code")] + public int Code { get; set; } = default!; + + private System.Collections.Generic.IDictionary _additionalProperties = new System.Collections.Generic.Dictionary(); + + [System.Text.Json.Serialization.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties; } + set { _additionalProperties = value; } + } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.10.0 (NJsonSchema v10.6.10.0 (Newtonsoft.Json v12.0.0.0))")] + public partial class Response53 + { + + [System.Text.Json.Serialization.JsonPropertyName("message")] + public string Message { get; set; } = default!; + + [System.Text.Json.Serialization.JsonPropertyName("code")] + public int Code { get; set; } = default!; + + private System.Collections.Generic.IDictionary _additionalProperties = new System.Collections.Generic.Dictionary(); + + [System.Text.Json.Serialization.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties; } + set { _additionalProperties = value; } + } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.10.0 (NJsonSchema v10.6.10.0 (Newtonsoft.Json v12.0.0.0))")] + public partial class Response54 + { + + [System.Text.Json.Serialization.JsonPropertyName("message")] + public string Message { get; set; } = default!; + + [System.Text.Json.Serialization.JsonPropertyName("code")] + public int Code { get; set; } = default!; + + private System.Collections.Generic.IDictionary _additionalProperties = new System.Collections.Generic.Dictionary(); + + [System.Text.Json.Serialization.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties; } + set { _additionalProperties = value; } + } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.10.0 (NJsonSchema v10.6.10.0 (Newtonsoft.Json v12.0.0.0))")] + public partial class Response55 + { + + [System.Text.Json.Serialization.JsonPropertyName("message")] + public string Message { get; set; } = default!; + + [System.Text.Json.Serialization.JsonPropertyName("code")] + public int Code { get; set; } = default!; + + private System.Collections.Generic.IDictionary _additionalProperties = new System.Collections.Generic.Dictionary(); + + [System.Text.Json.Serialization.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties; } + set { _additionalProperties = value; } + } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.10.0 (NJsonSchema v10.6.10.0 (Newtonsoft.Json v12.0.0.0))")] + public partial class Response56 + { + + [System.Text.Json.Serialization.JsonPropertyName("message")] + public string Message { get; set; } = default!; + + [System.Text.Json.Serialization.JsonPropertyName("code")] + public int Code { get; set; } = default!; + + private System.Collections.Generic.IDictionary _additionalProperties = new System.Collections.Generic.Dictionary(); + + [System.Text.Json.Serialization.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties; } + set { _additionalProperties = value; } + } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.10.0 (NJsonSchema v10.6.10.0 (Newtonsoft.Json v12.0.0.0))")] + public partial class Response57 + { + + [System.Text.Json.Serialization.JsonPropertyName("message")] + public string Message { get; set; } = default!; + + [System.Text.Json.Serialization.JsonPropertyName("code")] + public int Code { get; set; } = default!; + + private System.Collections.Generic.IDictionary _additionalProperties = new System.Collections.Generic.Dictionary(); + + [System.Text.Json.Serialization.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties; } + set { _additionalProperties = value; } + } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.10.0 (NJsonSchema v10.6.10.0 (Newtonsoft.Json v12.0.0.0))")] + public partial class Response58 + { + + [System.Text.Json.Serialization.JsonPropertyName("message")] + public string Message { get; set; } = default!; + + [System.Text.Json.Serialization.JsonPropertyName("code")] + public int Code { get; set; } = default!; + + private System.Collections.Generic.IDictionary _additionalProperties = new System.Collections.Generic.Dictionary(); + + [System.Text.Json.Serialization.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties; } + set { _additionalProperties = value; } + } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.10.0 (NJsonSchema v10.6.10.0 (Newtonsoft.Json v12.0.0.0))")] + public partial class Response59 + { + + [System.Text.Json.Serialization.JsonPropertyName("message")] + public string Message { get; set; } = default!; + + [System.Text.Json.Serialization.JsonPropertyName("code")] + public int Code { get; set; } = default!; + + private System.Collections.Generic.IDictionary _additionalProperties = new System.Collections.Generic.Dictionary(); + + [System.Text.Json.Serialization.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties; } + set { _additionalProperties = value; } + } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.10.0 (NJsonSchema v10.6.10.0 (Newtonsoft.Json v12.0.0.0))")] + public partial class Response60 + { + + [System.Text.Json.Serialization.JsonPropertyName("message")] + public string Message { get; set; } = default!; + + [System.Text.Json.Serialization.JsonPropertyName("code")] + public int Code { get; set; } = default!; + + private System.Collections.Generic.IDictionary _additionalProperties = new System.Collections.Generic.Dictionary(); + + [System.Text.Json.Serialization.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties; } + set { _additionalProperties = value; } + } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.10.0 (NJsonSchema v10.6.10.0 (Newtonsoft.Json v12.0.0.0))")] + public partial class Response61 + { + + [System.Text.Json.Serialization.JsonPropertyName("message")] + public string Message { get; set; } = default!; + + [System.Text.Json.Serialization.JsonPropertyName("code")] + public int Code { get; set; } = default!; + + private System.Collections.Generic.IDictionary _additionalProperties = new System.Collections.Generic.Dictionary(); + + [System.Text.Json.Serialization.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties; } + set { _additionalProperties = value; } + } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.10.0 (NJsonSchema v10.6.10.0 (Newtonsoft.Json v12.0.0.0))")] + public partial class Response62 + { + + [System.Text.Json.Serialization.JsonPropertyName("message")] + public string Message { get; set; } = default!; + + [System.Text.Json.Serialization.JsonPropertyName("code")] + public int Code { get; set; } = default!; + + private System.Collections.Generic.IDictionary _additionalProperties = new System.Collections.Generic.Dictionary(); + + [System.Text.Json.Serialization.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties; } + set { _additionalProperties = value; } + } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.10.0 (NJsonSchema v10.6.10.0 (Newtonsoft.Json v12.0.0.0))")] + public partial class Response63 + { + + [System.Text.Json.Serialization.JsonPropertyName("message")] + public string Message { get; set; } = default!; + + [System.Text.Json.Serialization.JsonPropertyName("code")] + public int Code { get; set; } = default!; + + private System.Collections.Generic.IDictionary _additionalProperties = new System.Collections.Generic.Dictionary(); + + [System.Text.Json.Serialization.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties; } + set { _additionalProperties = value; } + } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.10.0 (NJsonSchema v10.6.10.0 (Newtonsoft.Json v12.0.0.0))")] + public partial class Response64 + { + + [System.Text.Json.Serialization.JsonPropertyName("message")] + public string Message { get; set; } = default!; + + [System.Text.Json.Serialization.JsonPropertyName("code")] + public int Code { get; set; } = default!; + + private System.Collections.Generic.IDictionary _additionalProperties = new System.Collections.Generic.Dictionary(); + + [System.Text.Json.Serialization.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties; } + set { _additionalProperties = value; } + } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.10.0 (NJsonSchema v10.6.10.0 (Newtonsoft.Json v12.0.0.0))")] + public partial class Response65 + { + + [System.Text.Json.Serialization.JsonPropertyName("message")] + public string Message { get; set; } = default!; + + [System.Text.Json.Serialization.JsonPropertyName("code")] + public int Code { get; set; } = default!; + + private System.Collections.Generic.IDictionary _additionalProperties = new System.Collections.Generic.Dictionary(); + + [System.Text.Json.Serialization.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties; } + set { _additionalProperties = value; } + } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.10.0 (NJsonSchema v10.6.10.0 (Newtonsoft.Json v12.0.0.0))")] + public partial class Response66 + { + + [System.Text.Json.Serialization.JsonPropertyName("message")] + public string Message { get; set; } = default!; + + [System.Text.Json.Serialization.JsonPropertyName("code")] + public int Code { get; set; } = default!; + + private System.Collections.Generic.IDictionary _additionalProperties = new System.Collections.Generic.Dictionary(); + + [System.Text.Json.Serialization.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties; } + set { _additionalProperties = value; } + } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.10.0 (NJsonSchema v10.6.10.0 (Newtonsoft.Json v12.0.0.0))")] + public partial class Response67 + { + + [System.Text.Json.Serialization.JsonPropertyName("message")] + public string Message { get; set; } = default!; + + [System.Text.Json.Serialization.JsonPropertyName("code")] + public int Code { get; set; } = default!; + + private System.Collections.Generic.IDictionary _additionalProperties = new System.Collections.Generic.Dictionary(); + + [System.Text.Json.Serialization.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties; } + set { _additionalProperties = value; } + } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.10.0 (NJsonSchema v10.6.10.0 (Newtonsoft.Json v12.0.0.0))")] + public partial class Response68 + { + + [System.Text.Json.Serialization.JsonPropertyName("message")] + public string Message { get; set; } = default!; + + [System.Text.Json.Serialization.JsonPropertyName("code")] + public int Code { get; set; } = default!; + + private System.Collections.Generic.IDictionary _additionalProperties = new System.Collections.Generic.Dictionary(); + + [System.Text.Json.Serialization.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties; } + set { _additionalProperties = value; } + } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.10.0 (NJsonSchema v10.6.10.0 (Newtonsoft.Json v12.0.0.0))")] + public partial class Response69 + { + + [System.Text.Json.Serialization.JsonPropertyName("message")] + public string Message { get; set; } = default!; + + [System.Text.Json.Serialization.JsonPropertyName("code")] + public int Code { get; set; } = default!; + + private System.Collections.Generic.IDictionary _additionalProperties = new System.Collections.Generic.Dictionary(); + + [System.Text.Json.Serialization.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties; } + set { _additionalProperties = value; } + } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.10.0 (NJsonSchema v10.6.10.0 (Newtonsoft.Json v12.0.0.0))")] + public partial class Response70 + { + + [System.Text.Json.Serialization.JsonPropertyName("message")] + public string Message { get; set; } = default!; + + [System.Text.Json.Serialization.JsonPropertyName("code")] + public int Code { get; set; } = default!; + + private System.Collections.Generic.IDictionary _additionalProperties = new System.Collections.Generic.Dictionary(); + + [System.Text.Json.Serialization.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties; } + set { _additionalProperties = value; } + } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.10.0 (NJsonSchema v10.6.10.0 (Newtonsoft.Json v12.0.0.0))")] + public partial class Response71 + { + + [System.Text.Json.Serialization.JsonPropertyName("message")] + public string Message { get; set; } = default!; + + [System.Text.Json.Serialization.JsonPropertyName("code")] + public int Code { get; set; } = default!; + + private System.Collections.Generic.IDictionary _additionalProperties = new System.Collections.Generic.Dictionary(); + + [System.Text.Json.Serialization.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties; } + set { _additionalProperties = value; } + } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.10.0 (NJsonSchema v10.6.10.0 (Newtonsoft.Json v12.0.0.0))")] + public partial class Response72 + { + + [System.Text.Json.Serialization.JsonPropertyName("message")] + public string Message { get; set; } = default!; + + [System.Text.Json.Serialization.JsonPropertyName("code")] + public int Code { get; set; } = default!; + + private System.Collections.Generic.IDictionary _additionalProperties = new System.Collections.Generic.Dictionary(); + + [System.Text.Json.Serialization.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties; } + set { _additionalProperties = value; } + } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.10.0 (NJsonSchema v10.6.10.0 (Newtonsoft.Json v12.0.0.0))")] + public partial class Response73 + { + + [System.Text.Json.Serialization.JsonPropertyName("message")] + public string Message { get; set; } = default!; + + [System.Text.Json.Serialization.JsonPropertyName("code")] + public int Code { get; set; } = default!; + + private System.Collections.Generic.IDictionary _additionalProperties = new System.Collections.Generic.Dictionary(); + + [System.Text.Json.Serialization.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties; } + set { _additionalProperties = value; } + } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.10.0 (NJsonSchema v10.6.10.0 (Newtonsoft.Json v12.0.0.0))")] + public partial class Response74 + { + + [System.Text.Json.Serialization.JsonPropertyName("message")] + public string Message { get; set; } = default!; + + [System.Text.Json.Serialization.JsonPropertyName("code")] + public int Code { get; set; } = default!; + + private System.Collections.Generic.IDictionary _additionalProperties = new System.Collections.Generic.Dictionary(); + + [System.Text.Json.Serialization.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties; } + set { _additionalProperties = value; } + } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.10.0 (NJsonSchema v10.6.10.0 (Newtonsoft.Json v12.0.0.0))")] + public partial class Response75 + { + + [System.Text.Json.Serialization.JsonPropertyName("message")] + public string Message { get; set; } = default!; + + [System.Text.Json.Serialization.JsonPropertyName("code")] + public int Code { get; set; } = default!; + + private System.Collections.Generic.IDictionary _additionalProperties = new System.Collections.Generic.Dictionary(); + + [System.Text.Json.Serialization.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties; } + set { _additionalProperties = value; } + } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.10.0 (NJsonSchema v10.6.10.0 (Newtonsoft.Json v12.0.0.0))")] + public partial class Response76 + { + + [System.Text.Json.Serialization.JsonPropertyName("message")] + public string Message { get; set; } = default!; + + [System.Text.Json.Serialization.JsonPropertyName("code")] + public int Code { get; set; } = default!; + + private System.Collections.Generic.IDictionary _additionalProperties = new System.Collections.Generic.Dictionary(); + + [System.Text.Json.Serialization.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties; } + set { _additionalProperties = value; } + } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.10.0 (NJsonSchema v10.6.10.0 (Newtonsoft.Json v12.0.0.0))")] + public partial class Response77 + { + + [System.Text.Json.Serialization.JsonPropertyName("message")] + public string Message { get; set; } = default!; + + [System.Text.Json.Serialization.JsonPropertyName("code")] + public int Code { get; set; } = default!; + + private System.Collections.Generic.IDictionary _additionalProperties = new System.Collections.Generic.Dictionary(); + + [System.Text.Json.Serialization.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties; } + set { _additionalProperties = value; } + } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.10.0 (NJsonSchema v10.6.10.0 (Newtonsoft.Json v12.0.0.0))")] + public partial class Response78 + { + + [System.Text.Json.Serialization.JsonPropertyName("message")] + public string Message { get; set; } = default!; + + [System.Text.Json.Serialization.JsonPropertyName("code")] + public int Code { get; set; } = default!; + + private System.Collections.Generic.IDictionary _additionalProperties = new System.Collections.Generic.Dictionary(); + + [System.Text.Json.Serialization.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties; } + set { _additionalProperties = value; } + } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.10.0 (NJsonSchema v10.6.10.0 (Newtonsoft.Json v12.0.0.0))")] + public partial class Response79 + { + + [System.Text.Json.Serialization.JsonPropertyName("message")] + public string Message { get; set; } = default!; + + [System.Text.Json.Serialization.JsonPropertyName("code")] + public int Code { get; set; } = default!; + + private System.Collections.Generic.IDictionary _additionalProperties = new System.Collections.Generic.Dictionary(); + + [System.Text.Json.Serialization.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties; } + set { _additionalProperties = value; } + } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.10.0 (NJsonSchema v10.6.10.0 (Newtonsoft.Json v12.0.0.0))")] + public partial class Response80 + { + + [System.Text.Json.Serialization.JsonPropertyName("message")] + public string Message { get; set; } = default!; + + [System.Text.Json.Serialization.JsonPropertyName("code")] + public int Code { get; set; } = default!; + + private System.Collections.Generic.IDictionary _additionalProperties = new System.Collections.Generic.Dictionary(); + + [System.Text.Json.Serialization.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties; } + set { _additionalProperties = value; } + } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.10.0 (NJsonSchema v10.6.10.0 (Newtonsoft.Json v12.0.0.0))")] + public partial class Response81 + { + + [System.Text.Json.Serialization.JsonPropertyName("message")] + public string Message { get; set; } = default!; + + [System.Text.Json.Serialization.JsonPropertyName("code")] + public int Code { get; set; } = default!; + + private System.Collections.Generic.IDictionary _additionalProperties = new System.Collections.Generic.Dictionary(); + + [System.Text.Json.Serialization.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties; } + set { _additionalProperties = value; } + } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.10.0 (NJsonSchema v10.6.10.0 (Newtonsoft.Json v12.0.0.0))")] + public partial class Response82 + { + + [System.Text.Json.Serialization.JsonPropertyName("message")] + public string Message { get; set; } = default!; + + [System.Text.Json.Serialization.JsonPropertyName("code")] + public int Code { get; set; } = default!; + + private System.Collections.Generic.IDictionary _additionalProperties = new System.Collections.Generic.Dictionary(); + + [System.Text.Json.Serialization.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties; } + set { _additionalProperties = value; } + } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.10.0 (NJsonSchema v10.6.10.0 (Newtonsoft.Json v12.0.0.0))")] + public partial class Response83 + { + + [System.Text.Json.Serialization.JsonPropertyName("message")] + public string Message { get; set; } = default!; + + [System.Text.Json.Serialization.JsonPropertyName("code")] + public int Code { get; set; } = default!; + + private System.Collections.Generic.IDictionary _additionalProperties = new System.Collections.Generic.Dictionary(); + + [System.Text.Json.Serialization.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties; } + set { _additionalProperties = value; } + } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.10.0 (NJsonSchema v10.6.10.0 (Newtonsoft.Json v12.0.0.0))")] + public partial class Response84 + { + + [System.Text.Json.Serialization.JsonPropertyName("message")] + public string Message { get; set; } = default!; + + [System.Text.Json.Serialization.JsonPropertyName("code")] + public int Code { get; set; } = default!; + + private System.Collections.Generic.IDictionary _additionalProperties = new System.Collections.Generic.Dictionary(); + + [System.Text.Json.Serialization.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties; } + set { _additionalProperties = value; } + } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.10.0 (NJsonSchema v10.6.10.0 (Newtonsoft.Json v12.0.0.0))")] + public partial class Response85 + { + + [System.Text.Json.Serialization.JsonPropertyName("message")] + public string Message { get; set; } = default!; + + [System.Text.Json.Serialization.JsonPropertyName("code")] + public int Code { get; set; } = default!; + + private System.Collections.Generic.IDictionary _additionalProperties = new System.Collections.Generic.Dictionary(); + + [System.Text.Json.Serialization.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties; } + set { _additionalProperties = value; } + } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.10.0 (NJsonSchema v10.6.10.0 (Newtonsoft.Json v12.0.0.0))")] + public partial class Response86 + { + + [System.Text.Json.Serialization.JsonPropertyName("message")] + public string Message { get; set; } = default!; + + [System.Text.Json.Serialization.JsonPropertyName("code")] + public int Code { get; set; } = default!; + + private System.Collections.Generic.IDictionary _additionalProperties = new System.Collections.Generic.Dictionary(); + + [System.Text.Json.Serialization.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties; } + set { _additionalProperties = value; } + } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.10.0 (NJsonSchema v10.6.10.0 (Newtonsoft.Json v12.0.0.0))")] + public partial class Response87 + { + + [System.Text.Json.Serialization.JsonPropertyName("message")] + public string Message { get; set; } = default!; + + [System.Text.Json.Serialization.JsonPropertyName("code")] + public int Code { get; set; } = default!; + + private System.Collections.Generic.IDictionary _additionalProperties = new System.Collections.Generic.Dictionary(); + + [System.Text.Json.Serialization.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties; } + set { _additionalProperties = value; } + } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.10.0 (NJsonSchema v10.6.10.0 (Newtonsoft.Json v12.0.0.0))")] + public partial class Response88 + { + + [System.Text.Json.Serialization.JsonPropertyName("message")] + public string Message { get; set; } = default!; + + [System.Text.Json.Serialization.JsonPropertyName("code")] + public int Code { get; set; } = default!; + + private System.Collections.Generic.IDictionary _additionalProperties = new System.Collections.Generic.Dictionary(); + + [System.Text.Json.Serialization.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties; } + set { _additionalProperties = value; } + } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.10.0 (NJsonSchema v10.6.10.0 (Newtonsoft.Json v12.0.0.0))")] + public partial class Response89 + { + + [System.Text.Json.Serialization.JsonPropertyName("message")] + public string Message { get; set; } = default!; + + [System.Text.Json.Serialization.JsonPropertyName("code")] + public int Code { get; set; } = default!; + + private System.Collections.Generic.IDictionary _additionalProperties = new System.Collections.Generic.Dictionary(); + + [System.Text.Json.Serialization.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties; } + set { _additionalProperties = value; } + } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.10.0 (NJsonSchema v10.6.10.0 (Newtonsoft.Json v12.0.0.0))")] + public partial class Response90 + { + + [System.Text.Json.Serialization.JsonPropertyName("message")] + public string Message { get; set; } = default!; + + [System.Text.Json.Serialization.JsonPropertyName("code")] + public int Code { get; set; } = default!; + + private System.Collections.Generic.IDictionary _additionalProperties = new System.Collections.Generic.Dictionary(); + + [System.Text.Json.Serialization.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties; } + set { _additionalProperties = value; } + } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.10.0 (NJsonSchema v10.6.10.0 (Newtonsoft.Json v12.0.0.0))")] + public partial class Response91 + { + + [System.Text.Json.Serialization.JsonPropertyName("message")] + public string Message { get; set; } = default!; + + [System.Text.Json.Serialization.JsonPropertyName("code")] + public int Code { get; set; } = default!; + + private System.Collections.Generic.IDictionary _additionalProperties = new System.Collections.Generic.Dictionary(); + + [System.Text.Json.Serialization.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties; } + set { _additionalProperties = value; } + } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.10.0 (NJsonSchema v10.6.10.0 (Newtonsoft.Json v12.0.0.0))")] + public partial class Response92 + { + + [System.Text.Json.Serialization.JsonPropertyName("message")] + public string Message { get; set; } = default!; + + [System.Text.Json.Serialization.JsonPropertyName("code")] + public int Code { get; set; } = default!; + + private System.Collections.Generic.IDictionary _additionalProperties = new System.Collections.Generic.Dictionary(); + + [System.Text.Json.Serialization.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties; } + set { _additionalProperties = value; } + } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.10.0 (NJsonSchema v10.6.10.0 (Newtonsoft.Json v12.0.0.0))")] + public partial class Response93 + { + + [System.Text.Json.Serialization.JsonPropertyName("message")] + public string Message { get; set; } = default!; + + [System.Text.Json.Serialization.JsonPropertyName("code")] + public int Code { get; set; } = default!; + + private System.Collections.Generic.IDictionary _additionalProperties = new System.Collections.Generic.Dictionary(); + + [System.Text.Json.Serialization.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties; } + set { _additionalProperties = value; } + } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.10.0 (NJsonSchema v10.6.10.0 (Newtonsoft.Json v12.0.0.0))")] + public partial class Response94 + { + + [System.Text.Json.Serialization.JsonPropertyName("message")] + public string Message { get; set; } = default!; + + [System.Text.Json.Serialization.JsonPropertyName("code")] + public int Code { get; set; } = default!; + + private System.Collections.Generic.IDictionary _additionalProperties = new System.Collections.Generic.Dictionary(); + + [System.Text.Json.Serialization.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties; } + set { _additionalProperties = value; } + } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.10.0 (NJsonSchema v10.6.10.0 (Newtonsoft.Json v12.0.0.0))")] + public partial class Response95 + { + + [System.Text.Json.Serialization.JsonPropertyName("message")] + public string Message { get; set; } = default!; + + [System.Text.Json.Serialization.JsonPropertyName("code")] + public int Code { get; set; } = default!; + + private System.Collections.Generic.IDictionary _additionalProperties = new System.Collections.Generic.Dictionary(); + + [System.Text.Json.Serialization.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties; } + set { _additionalProperties = value; } + } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.10.0 (NJsonSchema v10.6.10.0 (Newtonsoft.Json v12.0.0.0))")] + public partial class Response96 + { + + [System.Text.Json.Serialization.JsonPropertyName("message")] + public string Message { get; set; } = default!; + + [System.Text.Json.Serialization.JsonPropertyName("code")] + public int Code { get; set; } = default!; + + private System.Collections.Generic.IDictionary _additionalProperties = new System.Collections.Generic.Dictionary(); + + [System.Text.Json.Serialization.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties; } + set { _additionalProperties = value; } + } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.10.0 (NJsonSchema v10.6.10.0 (Newtonsoft.Json v12.0.0.0))")] + public partial class Response97 + { + + [System.Text.Json.Serialization.JsonPropertyName("message")] + public string Message { get; set; } = default!; + + [System.Text.Json.Serialization.JsonPropertyName("code")] + public int Code { get; set; } = default!; + + private System.Collections.Generic.IDictionary _additionalProperties = new System.Collections.Generic.Dictionary(); + + [System.Text.Json.Serialization.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties; } + set { _additionalProperties = value; } + } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.10.0 (NJsonSchema v10.6.10.0 (Newtonsoft.Json v12.0.0.0))")] + public partial class Response98 + { + + [System.Text.Json.Serialization.JsonPropertyName("message")] + public string Message { get; set; } = default!; + + [System.Text.Json.Serialization.JsonPropertyName("code")] + public int Code { get; set; } = default!; + + private System.Collections.Generic.IDictionary _additionalProperties = new System.Collections.Generic.Dictionary(); + + [System.Text.Json.Serialization.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties; } + set { _additionalProperties = value; } + } + + } + + [System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "13.15.10.0 (NJsonSchema v10.6.10.0 (Newtonsoft.Json v12.0.0.0))")] + public partial class Tags + { + + [System.Text.Json.Serialization.JsonPropertyName("uid")] + public int Uid { get; set; } = default!; + + [System.Text.Json.Serialization.JsonPropertyName("startedAt")] + public System.DateTimeOffset StartedAt { get; set; } = default!; + + [System.Text.Json.Serialization.JsonPropertyName("total")] + public int Total { get; set; } = default!; + + [System.Text.Json.Serialization.JsonPropertyName("processed")] + public int Processed { get; set; } = default!; + + [System.Text.Json.Serialization.JsonPropertyName("synced")] + public int Synced { get; set; } = default!; + + private System.Collections.Generic.IDictionary _additionalProperties = new System.Collections.Generic.Dictionary(); + + [System.Text.Json.Serialization.JsonExtensionData] + public System.Collections.Generic.IDictionary AdditionalProperties + { + get { return _additionalProperties; } + set { _additionalProperties = value; } + } + + } + + [System.CodeDom.Compiler.GeneratedCode("NSwag", "13.15.10.0 (NJsonSchema v10.6.10.0 (Newtonsoft.Json v12.0.0.0))")] + public partial class FileParameter + { + public FileParameter(System.IO.Stream data) + : this (data, null, null) + { + } + + public FileParameter(System.IO.Stream data, string? fileName) + : this (data, fileName, null) + { + } + + public FileParameter(System.IO.Stream data, string? fileName, string? contentType) + { + Data = data; + FileName = fileName; + ContentType = contentType; + } + + public System.IO.Stream Data { get; private set; } + + public string? FileName { get; private set; } + + public string? ContentType { get; private set; } + } + + [System.CodeDom.Compiler.GeneratedCode("NSwag", "13.15.10.0 (NJsonSchema v10.6.10.0 (Newtonsoft.Json v12.0.0.0))")] + public partial class FileResponse : System.IDisposable + { + private System.IDisposable? _client; + private System.IDisposable? _response; + + public int StatusCode { get; private set; } + + public System.Collections.Generic.IReadOnlyDictionary> Headers { get; private set; } + + public System.IO.Stream Stream { get; private set; } + + public bool IsPartial + { + get { return StatusCode == 206; } + } + + public FileResponse(int statusCode, System.Collections.Generic.IReadOnlyDictionary> headers, System.IO.Stream stream, System.IDisposable? client, System.IDisposable? response) + { + StatusCode = statusCode; + Headers = headers; + Stream = stream; + _client = client; + _response = response; + } + + public void Dispose() + { + Stream.Dispose(); + if (_response != null) + _response.Dispose(); + if (_client != null) + _client.Dispose(); + } + } + + + +} + +#pragma warning restore 1591 +#pragma warning restore 1573 +#pragma warning restore 472 +#pragma warning restore 114 +#pragma warning restore 108 +#pragma warning restore 3016 +#pragma warning restore 8603 \ No newline at end of file diff --git a/src/BeeNet/DtoModels/AddressDetailDto.cs b/src/BeeNet/DtoModels/AddressDetailDto.cs index ee50f6cb..220881a8 100644 --- a/src/BeeNet/DtoModels/AddressDetailDto.cs +++ b/src/BeeNet/DtoModels/AddressDetailDto.cs @@ -44,6 +44,17 @@ public AddressDetailDto(Clients.DebugApi.V1_2_1.Response response) PublicKey = response.PublicKey; PssPublicKey = response.PssPublicKey; } + public AddressDetailDto(Clients.DebugApi.V2_0_0.Response response) + { + if (response is null) + throw new ArgumentNullException(nameof(response)); + + Underlay = response.Underlay.Where(i => !string.IsNullOrWhiteSpace(i)); + Overlay = response.Overlay; + Ethereum = response.Ethereum; + PublicKey = response.PublicKey; + PssPublicKey = response.PssPublicKey; + } // Properties. public string Overlay { get; } diff --git a/src/BeeNet/DtoModels/AnonymousDto.cs b/src/BeeNet/DtoModels/AnonymousDto.cs index 6c2f15e3..d2851a04 100644 --- a/src/BeeNet/DtoModels/AnonymousDto.cs +++ b/src/BeeNet/DtoModels/AnonymousDto.cs @@ -47,6 +47,19 @@ public AnonymousDto(Clients.DebugApi.V1_2_1.Anonymous anonymous) .Select(k => new ConnectedPeersDto(k)); } + public AnonymousDto(Clients.DebugApi.V2_0_0.Anonymous anonymous) + { + if (anonymous is null) + throw new ArgumentNullException(nameof(anonymous)); + + Population = anonymous.Population; + Connected = anonymous.Connected; + DisconnectedPeers = anonymous.DisconnectedPeers + .Select(k => new DisconnectedPeersDto(k)); + ConnectedPeers = anonymous.ConnectedPeers + .Select(k => new ConnectedPeersDto(k)); + } + // Properties. public int Population { get; } public int Connected { get; } diff --git a/src/BeeNet/DtoModels/AuthDto.cs b/src/BeeNet/DtoModels/AuthDto.cs index 843944c5..86b3d929 100644 --- a/src/BeeNet/DtoModels/AuthDto.cs +++ b/src/BeeNet/DtoModels/AuthDto.cs @@ -27,6 +27,14 @@ public AuthDto(Clients.GatewayApi.V2_0_0.Response response) Key = response.Key; } + public AuthDto(Clients.GatewayApi.V3_0_0.Response response) + { + if (response is null) + throw new ArgumentNullException(nameof(response)); + + Key = response.Key; + } + // Properties. public string Key { get; } diff --git a/src/BeeNet/DtoModels/BalanceDto.cs b/src/BeeNet/DtoModels/BalanceDto.cs index 2832bca1..625b222c 100644 --- a/src/BeeNet/DtoModels/BalanceDto.cs +++ b/src/BeeNet/DtoModels/BalanceDto.cs @@ -13,6 +13,7 @@ // limitations under the License. using System; +using System.Globalization; namespace Etherna.BeeNet.DtoModels { @@ -25,7 +26,16 @@ public BalanceDto(Clients.DebugApi.V1_2_0.Balances balance) throw new ArgumentNullException(nameof(balance)); Peer = balance.Peer; - Balance = balance.Balance; + Balance = long.Parse(balance.Balance, CultureInfo.InvariantCulture); + } + + public BalanceDto(Clients.DebugApi.V2_0_0.Balances balance) + { + if (balance is null) + throw new ArgumentNullException(nameof(balance)); + + Peer = balance.Peer; + Balance = long.Parse(balance.Balance, CultureInfo.InvariantCulture); } public BalanceDto(Clients.DebugApi.V1_2_0.Balances2 balance) @@ -34,7 +44,16 @@ public BalanceDto(Clients.DebugApi.V1_2_0.Balances2 balance) throw new ArgumentNullException(nameof(balance)); Peer = balance.Peer; - Balance = balance.Balance; + Balance = long.Parse(balance.Balance, CultureInfo.InvariantCulture); + } + + public BalanceDto(Clients.DebugApi.V2_0_0.Balances2 balance) + { + if (balance is null) + throw new ArgumentNullException(nameof(balance)); + + Peer = balance.Peer; + Balance = long.Parse(balance.Balance, CultureInfo.InvariantCulture); } public BalanceDto(Clients.DebugApi.V1_2_1.Balances balance) @@ -43,7 +62,7 @@ public BalanceDto(Clients.DebugApi.V1_2_1.Balances balance) throw new ArgumentNullException(nameof(balance)); Peer = balance.Peer; - Balance = balance.Balance; + Balance = long.Parse(balance.Balance, CultureInfo.InvariantCulture); } public BalanceDto(Clients.DebugApi.V1_2_1.Balances2 balance) @@ -52,12 +71,11 @@ public BalanceDto(Clients.DebugApi.V1_2_1.Balances2 balance) throw new ArgumentNullException(nameof(balance)); Peer = balance.Peer; - Balance = balance.Balance; + Balance = long.Parse(balance.Balance, CultureInfo.InvariantCulture); } // Properties. public string Peer { get; } - /// Numeric string that represents integer which might exceeds `Number.MAX_SAFE_INTEGER` limit (2^53-1) - public string Balance { get; } + public long Balance { get; } } } diff --git a/src/BeeNet/DtoModels/BatchDto.cs b/src/BeeNet/DtoModels/BatchDto.cs new file mode 100644 index 00000000..acf9d518 --- /dev/null +++ b/src/BeeNet/DtoModels/BatchDto.cs @@ -0,0 +1,61 @@ +// Copyright 2021-present Etherna Sagl +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +using System; + +namespace Etherna.BeeNet.DtoModels +{ + public class BatchDto + { + public BatchDto(Clients.DebugApi.V1_2_1.Stamps2 stamps) + { + if (stamps is null) + throw new ArgumentNullException(nameof(stamps)); + + BatchID = stamps.BatchID; + BatchTTL = stamps.BatchTTL; + BlockNumber = stamps.BlockNumber; + BucketDepth = stamps.BucketDepth; + Depth = stamps.Depth; + ImmutableFlag = stamps.ImmutableFlag; + Value = stamps.Value; + Owner = stamps.Owner; + } + + public BatchDto(Clients.DebugApi.V2_0_0.Batches batch) + { + if (batch is null) + throw new ArgumentNullException(nameof(batch)); + + BatchID = batch.BatchID; + BatchTTL = batch.BatchTTL; + BlockNumber = batch.BlockNumber; + BucketDepth = batch.BucketDepth; + Depth = batch.Depth; + ImmutableFlag = batch.ImmutableFlag; + Value = batch.Value; + Owner = batch.Owner; + } + + // Properties. + public string BatchID { get; set; } = default!; + public int BatchTTL { get; set; } = default!; + public int BlockNumber { get; set; } = default!; + public int BucketDepth { get; set; } = default!; + public int Depth { get; set; } = default!; + public bool ImmutableFlag { get; set; } = default!; + public string Value { get; set; } = default!; + public string Owner { get; set; } = default!; + } +} diff --git a/src/BeeNet/DtoModels/BucketDto.cs b/src/BeeNet/DtoModels/BucketDto.cs index 72236d5f..9be77568 100644 --- a/src/BeeNet/DtoModels/BucketDto.cs +++ b/src/BeeNet/DtoModels/BucketDto.cs @@ -37,6 +37,15 @@ public BucketDto(Clients.DebugApi.V1_2_1.Buckets bucket) Collisions = bucket.Collisions; } + public BucketDto(Clients.DebugApi.V2_0_0.Buckets bucket) + { + if (bucket is null) + throw new ArgumentNullException(nameof(bucket)); + + BucketId = bucket.BucketID; + Collisions = bucket.Collisions; + } + // Properties. public int BucketId { get; } public int Collisions { get; } diff --git a/src/BeeNet/DtoModels/ChainstateDto.cs b/src/BeeNet/DtoModels/ChainstateDto.cs index 8ffb08e5..1969781a 100644 --- a/src/BeeNet/DtoModels/ChainstateDto.cs +++ b/src/BeeNet/DtoModels/ChainstateDto.cs @@ -39,6 +39,16 @@ public ChainStateDto(Clients.DebugApi.V1_2_1.Response13 response) CurrentPrice = response.CurrentPrice; } + public ChainStateDto(Clients.DebugApi.V2_0_0.Response13 response) + { + if (response is null) + throw new ArgumentNullException(nameof(response)); + + Block = response.Block; + TotalAmount = response.TotalAmount; + CurrentPrice = response.CurrentPrice; + } + // Properties. public int Block { get; } public int TotalAmount { get; } diff --git a/src/BeeNet/DtoModels/ChequebookBalanceDto.cs b/src/BeeNet/DtoModels/ChequebookBalanceDto.cs index 02a8855b..dc7faa3e 100644 --- a/src/BeeNet/DtoModels/ChequebookBalanceDto.cs +++ b/src/BeeNet/DtoModels/ChequebookBalanceDto.cs @@ -13,6 +13,7 @@ // limitations under the License. using System; +using System.Globalization; namespace Etherna.BeeNet.DtoModels { @@ -24,8 +25,8 @@ public ChequeBookBalanceDto(Clients.DebugApi.V1_2_0.Response8 response) if (response is null) throw new ArgumentNullException(nameof(response)); - TotalBalance = response.TotalBalance; - AvailableBalance = response.AvailableBalance; + TotalBalance = long.Parse(response.TotalBalance, CultureInfo.InvariantCulture); + AvailableBalance = long.Parse(response.AvailableBalance, CultureInfo.InvariantCulture); } public ChequeBookBalanceDto(Clients.DebugApi.V1_2_1.Response8 response) @@ -33,13 +34,21 @@ public ChequeBookBalanceDto(Clients.DebugApi.V1_2_1.Response8 response) if (response is null) throw new ArgumentNullException(nameof(response)); - TotalBalance = response.TotalBalance; - AvailableBalance = response.AvailableBalance; + TotalBalance = long.Parse(response.TotalBalance, CultureInfo.InvariantCulture); + AvailableBalance = long.Parse(response.AvailableBalance, CultureInfo.InvariantCulture); + } + + public ChequeBookBalanceDto(Clients.DebugApi.V2_0_0.Response8 response) + { + if (response is null) + throw new ArgumentNullException(nameof(response)); + + TotalBalance = long.Parse(response.TotalBalance, CultureInfo.InvariantCulture); + AvailableBalance = long.Parse(response.AvailableBalance, CultureInfo.InvariantCulture); } // Properties. - public string TotalBalance { get; } - /// Numeric string that represents integer which might exceeds `Number.MAX_SAFE_INTEGER` limit (2^53-1) - public string AvailableBalance { get; } + public long TotalBalance { get; } + public long AvailableBalance { get; } } } diff --git a/src/BeeNet/DtoModels/ChequebookCashoutGetDto.cs b/src/BeeNet/DtoModels/ChequebookCashoutGetDto.cs index 526193f4..37982bfd 100644 --- a/src/BeeNet/DtoModels/ChequebookCashoutGetDto.cs +++ b/src/BeeNet/DtoModels/ChequebookCashoutGetDto.cs @@ -13,6 +13,7 @@ // limitations under the License. using System; +using System.Globalization; namespace Etherna.BeeNet.DtoModels { @@ -28,7 +29,7 @@ public ChequeBookCashoutGetDto(Clients.DebugApi.V1_2_0.Response25 response) LastCashedCheque = new LastCashedChequeDto(response.LastCashedCheque); TransactionHash = response.TransactionHash; Result = new ResultChequeBookDto(response.Result); - UncashedAmount = response.UncashedAmount; + UncashedAmount = long.Parse(response.UncashedAmount, CultureInfo.InvariantCulture); } public ChequeBookCashoutGetDto(Clients.DebugApi.V1_2_1.Response26 response) @@ -40,7 +41,19 @@ public ChequeBookCashoutGetDto(Clients.DebugApi.V1_2_1.Response26 response) LastCashedCheque = new LastCashedChequeDto(response.LastCashedCheque); TransactionHash = response.TransactionHash; Result = new ResultChequeBookDto(response.Result); - UncashedAmount = response.UncashedAmount; + UncashedAmount = long.Parse(response.UncashedAmount, CultureInfo.InvariantCulture); + } + + public ChequeBookCashoutGetDto(Clients.DebugApi.V2_0_0.Response26 response) + { + if (response is null) + throw new ArgumentNullException(nameof(response)); + + Peer = response.Peer; + LastCashedCheque = new LastCashedChequeDto(response.LastCashedCheque); + TransactionHash = response.TransactionHash; + Result = new ResultChequeBookDto(response.Result); + UncashedAmount = long.Parse(response.UncashedAmount, CultureInfo.InvariantCulture); } // Properties. @@ -48,8 +61,7 @@ public ChequeBookCashoutGetDto(Clients.DebugApi.V1_2_1.Response26 response) public LastCashedChequeDto LastCashedCheque { get; } public string TransactionHash { get; } public ResultChequeBookDto Result { get; } - /// Numeric string that represents integer which might exceeds `Number.MAX_SAFE_INTEGER` limit (2^53-1) - public string UncashedAmount { get; } + public long UncashedAmount { get; } } } diff --git a/src/BeeNet/DtoModels/ChequebookChequeGetDto.cs b/src/BeeNet/DtoModels/ChequebookChequeGetDto.cs index c6cd03c3..c18b3684 100644 --- a/src/BeeNet/DtoModels/ChequebookChequeGetDto.cs +++ b/src/BeeNet/DtoModels/ChequebookChequeGetDto.cs @@ -59,6 +59,26 @@ public ChequeBookChequeGetDto(Clients.DebugApi.V1_2_1.Response28 response) LastSent = new LastSentDto(response.Lastsent); } + public ChequeBookChequeGetDto(Clients.DebugApi.V2_0_0.Lastcheques lastcheques) + { + if (lastcheques is null) + throw new ArgumentNullException(nameof(lastcheques)); + + Peer = lastcheques.Peer; + LastReceived = new LastReceivedDto(lastcheques.Lastreceived); + LastSent = new LastSentDto(lastcheques.Lastsent); + } + + public ChequeBookChequeGetDto(Clients.DebugApi.V2_0_0.Response28 response) + { + if (response is null) + throw new ArgumentNullException(nameof(response)); + + Peer = response.Peer; + LastReceived = new LastReceivedDto(response.Lastreceived); + LastSent = new LastSentDto(response.Lastsent); + } + // Properties. public string Peer { get; } public LastReceivedDto LastReceived { get; } diff --git a/src/BeeNet/DtoModels/ConnectedPeersDto.cs b/src/BeeNet/DtoModels/ConnectedPeersDto.cs index c04bebb5..74e4afa2 100644 --- a/src/BeeNet/DtoModels/ConnectedPeersDto.cs +++ b/src/BeeNet/DtoModels/ConnectedPeersDto.cs @@ -47,6 +47,20 @@ public ConnectedPeersDto(Clients.DebugApi.V1_2_1.ConnectedPeers connectedPeers) LatencyEWMA = connectedPeers.Metrics.LatencyEWMA; } + public ConnectedPeersDto(Clients.DebugApi.V2_0_0.ConnectedPeers connectedPeers) + { + if (connectedPeers is null) + throw new ArgumentNullException(nameof(connectedPeers)); + + Address = connectedPeers.Address; + LastSeenTimestamp = connectedPeers.Metrics.LastSeenTimestamp; + SessionConnectionRetry = connectedPeers.Metrics.SessionConnectionRetry; + ConnectionTotalDuration = connectedPeers.Metrics.ConnectionTotalDuration; + SessionConnectionDuration = connectedPeers.Metrics.SessionConnectionDuration; + SessionConnectionDirection = connectedPeers.Metrics.SessionConnectionDirection; + LatencyEWMA = connectedPeers.Metrics.LatencyEWMA; + } + // Properties. public string Address { get; } public int LastSeenTimestamp { get; } diff --git a/src/BeeNet/DtoModels/DisconnectedPeersDto.cs b/src/BeeNet/DtoModels/DisconnectedPeersDto.cs index cd2eff08..e31df31c 100644 --- a/src/BeeNet/DtoModels/DisconnectedPeersDto.cs +++ b/src/BeeNet/DtoModels/DisconnectedPeersDto.cs @@ -37,6 +37,15 @@ public DisconnectedPeersDto(Clients.DebugApi.V1_2_1.DisconnectedPeers disconnect Metrics = new MetricsDto(disconnectedPeers.Metrics); } + public DisconnectedPeersDto(Clients.DebugApi.V2_0_0.DisconnectedPeers disconnectedPeers) + { + if (disconnectedPeers is null) + throw new ArgumentNullException(nameof(disconnectedPeers)); + + Address = disconnectedPeers.Address; + Metrics = new MetricsDto(disconnectedPeers.Metrics); + } + // Properties. public string Address { get; } public MetricsDto Metrics { get; } diff --git a/src/BeeNet/DtoModels/LastCashedChequeDto.cs b/src/BeeNet/DtoModels/LastCashedChequeDto.cs index 6d5eb530..46c03ded 100644 --- a/src/BeeNet/DtoModels/LastCashedChequeDto.cs +++ b/src/BeeNet/DtoModels/LastCashedChequeDto.cs @@ -13,6 +13,7 @@ // limitations under the License. using System; +using System.Globalization; namespace Etherna.BeeNet.DtoModels { @@ -26,7 +27,7 @@ public LastCashedChequeDto(Clients.DebugApi.V1_2_0.LastCashedCheque lastCashedCh Beneficiary = lastCashedCheque.Beneficiary; Chequebook = lastCashedCheque.Chequebook; - Payout = lastCashedCheque.Payout; + Payout = long.Parse(lastCashedCheque.Payout, CultureInfo.InvariantCulture); } public LastCashedChequeDto(Clients.DebugApi.V1_2_1.LastCashedCheque lastCashedCheque) @@ -36,13 +37,22 @@ public LastCashedChequeDto(Clients.DebugApi.V1_2_1.LastCashedCheque lastCashedCh Beneficiary = lastCashedCheque.Beneficiary; Chequebook = lastCashedCheque.Chequebook; - Payout = lastCashedCheque.Payout; + Payout = long.Parse(lastCashedCheque.Payout, CultureInfo.InvariantCulture); + } + + public LastCashedChequeDto(Clients.DebugApi.V2_0_0.LastCashedCheque lastCashedCheque) + { + if (lastCashedCheque is null) + throw new ArgumentNullException(nameof(lastCashedCheque)); + + Beneficiary = lastCashedCheque.Beneficiary; + Chequebook = lastCashedCheque.Chequebook; + Payout = long.Parse(lastCashedCheque.Payout, CultureInfo.InvariantCulture); } // Properties. public string Beneficiary { get; } public string Chequebook { get; } - /// Numeric string that represents integer which might exceeds `Number.MAX_SAFE_INTEGER` limit (2^53-1) - public string Payout { get; } + public long Payout { get; } } } diff --git a/src/BeeNet/DtoModels/LastReceivedDto.cs b/src/BeeNet/DtoModels/LastReceivedDto.cs index b6098494..2b383c99 100644 --- a/src/BeeNet/DtoModels/LastReceivedDto.cs +++ b/src/BeeNet/DtoModels/LastReceivedDto.cs @@ -13,6 +13,7 @@ // limitations under the License. using System; +using System.Globalization; namespace Etherna.BeeNet.DtoModels { @@ -26,7 +27,7 @@ public LastReceivedDto(Clients.DebugApi.V1_2_0.Lastreceived lastReceived) Beneficiary = lastReceived.Beneficiary; Chequebook = lastReceived.Chequebook; - Payout = lastReceived.Payout; + Payout = long.Parse(lastReceived.Payout, CultureInfo.InvariantCulture); } public LastReceivedDto(Clients.DebugApi.V1_2_0.Lastreceived2 lastReceived) @@ -36,7 +37,7 @@ public LastReceivedDto(Clients.DebugApi.V1_2_0.Lastreceived2 lastReceived) Beneficiary = lastReceived.Beneficiary; Chequebook = lastReceived.Chequebook; - Payout = lastReceived.Payout; + Payout = long.Parse(lastReceived.Payout, CultureInfo.InvariantCulture); } public LastReceivedDto(Clients.DebugApi.V1_2_1.Lastreceived2 lastReceived) @@ -46,7 +47,7 @@ public LastReceivedDto(Clients.DebugApi.V1_2_1.Lastreceived2 lastReceived) Beneficiary = lastReceived.Beneficiary; Chequebook = lastReceived.Chequebook; - Payout = lastReceived.Payout; + Payout = long.Parse(lastReceived.Payout, CultureInfo.InvariantCulture); } public LastReceivedDto(Clients.DebugApi.V1_2_1.Lastreceived lastReceived) @@ -56,13 +57,32 @@ public LastReceivedDto(Clients.DebugApi.V1_2_1.Lastreceived lastReceived) Beneficiary = lastReceived.Beneficiary; Chequebook = lastReceived.Chequebook; - Payout = lastReceived.Payout; + Payout = long.Parse(lastReceived.Payout, CultureInfo.InvariantCulture); + } + + public LastReceivedDto(Clients.DebugApi.V2_0_0.Lastreceived2 lastReceived) + { + if (lastReceived is null) + throw new ArgumentNullException(nameof(lastReceived)); + + Beneficiary = lastReceived.Beneficiary; + Chequebook = lastReceived.Chequebook; + Payout = long.Parse(lastReceived.Payout, CultureInfo.InvariantCulture); + } + + public LastReceivedDto(Clients.DebugApi.V2_0_0.Lastreceived lastReceived) + { + if (lastReceived is null) + throw new ArgumentNullException(nameof(lastReceived)); + + Beneficiary = lastReceived.Beneficiary; + Chequebook = lastReceived.Chequebook; + Payout = long.Parse(lastReceived.Payout, CultureInfo.InvariantCulture); } // Properties. public string Beneficiary { get; } public string Chequebook { get; } - /// Numeric string that represents integer which might exceeds `Number.MAX_SAFE_INTEGER` limit (2^53-1) - public string Payout { get; } + public long Payout { get; } } } diff --git a/src/BeeNet/DtoModels/LastSentDto.cs b/src/BeeNet/DtoModels/LastSentDto.cs index 5a813f1e..07c97963 100644 --- a/src/BeeNet/DtoModels/LastSentDto.cs +++ b/src/BeeNet/DtoModels/LastSentDto.cs @@ -13,6 +13,7 @@ // limitations under the License. using System; +using System.Globalization; namespace Etherna.BeeNet.DtoModels { @@ -26,7 +27,7 @@ public LastSentDto(Clients.DebugApi.V1_2_0.Lastsent lastsent) Beneficiary = lastsent.Beneficiary; Chequebook = lastsent.Chequebook; - Payout = lastsent.Payout; + Payout = long.Parse(lastsent.Payout, CultureInfo.InvariantCulture); } public LastSentDto(Clients.DebugApi.V1_2_0.Lastsent2 lastsent) @@ -36,7 +37,7 @@ public LastSentDto(Clients.DebugApi.V1_2_0.Lastsent2 lastsent) Beneficiary = lastsent.Beneficiary; Chequebook = lastsent.Chequebook; - Payout = lastsent.Payout; + Payout = long.Parse(lastsent.Payout, CultureInfo.InvariantCulture); } public LastSentDto(Clients.DebugApi.V1_2_1.Lastsent2 lastsent) @@ -46,7 +47,7 @@ public LastSentDto(Clients.DebugApi.V1_2_1.Lastsent2 lastsent) Beneficiary = lastsent.Beneficiary; Chequebook = lastsent.Chequebook; - Payout = lastsent.Payout; + Payout = long.Parse(lastsent.Payout, CultureInfo.InvariantCulture); } public LastSentDto(Clients.DebugApi.V1_2_1.Lastsent lastsent) @@ -56,13 +57,32 @@ public LastSentDto(Clients.DebugApi.V1_2_1.Lastsent lastsent) Beneficiary = lastsent.Beneficiary; Chequebook = lastsent.Chequebook; - Payout = lastsent.Payout; + Payout = long.Parse(lastsent.Payout, CultureInfo.InvariantCulture); + } + + public LastSentDto(Clients.DebugApi.V2_0_0.Lastsent2 lastsent) + { + if (lastsent is null) + throw new ArgumentNullException(nameof(lastsent)); + + Beneficiary = lastsent.Beneficiary; + Chequebook = lastsent.Chequebook; + Payout = long.Parse(lastsent.Payout, CultureInfo.InvariantCulture); + } + + public LastSentDto(Clients.DebugApi.V2_0_0.Lastsent lastsent) + { + if (lastsent is null) + throw new ArgumentNullException(nameof(lastsent)); + + Beneficiary = lastsent.Beneficiary; + Chequebook = lastsent.Chequebook; + Payout = long.Parse(lastsent.Payout, CultureInfo.InvariantCulture); } // Properties. public string Beneficiary { get; } public string Chequebook { get; } - /// Numeric string that represents integer which might exceeds `Number.MAX_SAFE_INTEGER` limit (2^53-1) - public string Payout { get; } + public long Payout { get; } } } diff --git a/src/BeeNet/DtoModels/MessageResponseDto.cs b/src/BeeNet/DtoModels/MessageResponseDto.cs index 666c2288..8a2bef43 100644 --- a/src/BeeNet/DtoModels/MessageResponseDto.cs +++ b/src/BeeNet/DtoModels/MessageResponseDto.cs @@ -73,6 +73,33 @@ public MessageResponseDto(Clients.DebugApi.V1_2_1.Response9 response) Code = response.Code; } + public MessageResponseDto(Clients.DebugApi.V2_0_0.Response10 response) + { + if (response is null) + throw new ArgumentNullException(nameof(response)); + + Message = response.Message; + Code = response.Code; + } + + public MessageResponseDto(Clients.DebugApi.V2_0_0.Response17 response) + { + if (response is null) + throw new ArgumentNullException(nameof(response)); + + Message = response.Message; + Code = response.Code; + } + + public MessageResponseDto(Clients.DebugApi.V2_0_0.Response9 response) + { + if (response is null) + throw new ArgumentNullException(nameof(response)); + + Message = response.Message; + Code = response.Code; + } + public MessageResponseDto(Clients.GatewayApi.V2_0_0.Response10 response) { if (response is null) @@ -91,6 +118,24 @@ public MessageResponseDto(Clients.GatewayApi.V2_0_0.Response12 response) Code = response.Code; } + public MessageResponseDto(Clients.GatewayApi.V3_0_0.Response10 response) + { + if (response is null) + throw new ArgumentNullException(nameof(response)); + + Message = response.Message; + Code = response.Code; + } + + public MessageResponseDto(Clients.GatewayApi.V3_0_0.Response12 response) + { + if (response is null) + throw new ArgumentNullException(nameof(response)); + + Message = response.Message; + Code = response.Code; + } + // Properties. public string Message { get; } public int Code { get; } diff --git a/src/BeeNet/DtoModels/MetricsDto.cs b/src/BeeNet/DtoModels/MetricsDto.cs index 8fbe4916..c405de04 100644 --- a/src/BeeNet/DtoModels/MetricsDto.cs +++ b/src/BeeNet/DtoModels/MetricsDto.cs @@ -45,6 +45,19 @@ public MetricsDto(Clients.DebugApi.V1_2_1.Metrics metrics) LatencyEWMA = metrics.LatencyEWMA; } + public MetricsDto(Clients.DebugApi.V2_0_0.Metrics metrics) + { + if (metrics is null) + throw new ArgumentNullException(nameof(metrics)); + + LastSeenTimestamp = metrics.LastSeenTimestamp; + SessionConnectionRetry = metrics.SessionConnectionRetry; + ConnectionTotalDuration = metrics.ConnectionTotalDuration; + SessionConnectionDuration = metrics.SessionConnectionDuration; + SessionConnectionDirection = metrics.SessionConnectionDirection; + LatencyEWMA = metrics.LatencyEWMA; + } + // Properties. public int LastSeenTimestamp { get; } public int SessionConnectionRetry { get; } diff --git a/src/BeeNet/DtoModels/NodeInfoDto.cs b/src/BeeNet/DtoModels/NodeInfoDto.cs index 6ce1e74f..bd0af464 100644 --- a/src/BeeNet/DtoModels/NodeInfoDto.cs +++ b/src/BeeNet/DtoModels/NodeInfoDto.cs @@ -13,6 +13,7 @@ // limitations under the License. using Etherna.BeeNet.Clients.DebugApi.V1_2_1; +using Etherna.BeeNet.Clients.DebugApi.V2_0_0; using System; namespace Etherna.BeeNet.DtoModels @@ -20,16 +21,33 @@ namespace Etherna.BeeNet.DtoModels public class NodeInfoDto { // Constructors. - public NodeInfoDto(Response14 response) + public NodeInfoDto(Clients.DebugApi.V1_2_1.Response14 response) { if (response is null) throw new ArgumentNullException(nameof(response)); BeeMode = response.BeeMode switch { - Response14BeeMode.Dev => BeeModeDto.Dev, - Response14BeeMode.Full => BeeModeDto.Full, - Response14BeeMode.Light => BeeModeDto.Light, + Clients.DebugApi.V1_2_1.Response14BeeMode.Dev => BeeModeDto.Dev, + Clients.DebugApi.V1_2_1.Response14BeeMode.Full => BeeModeDto.Full, + Clients.DebugApi.V1_2_1.Response14BeeMode.Light => BeeModeDto.Light, + _ => throw new InvalidOperationException() + }; + ChequebookEnabled = response.ChequebookEnabled; + GatewayMode = response.GatewayMode; + SwapEnabled = response.SwapEnabled; + } + + public NodeInfoDto(Clients.DebugApi.V2_0_0.Response14 response) + { + if (response is null) + throw new ArgumentNullException(nameof(response)); + + BeeMode = response.BeeMode switch + { + Clients.DebugApi.V2_0_0.Response14BeeMode.Dev => BeeModeDto.Dev, + Clients.DebugApi.V2_0_0.Response14BeeMode.Full => BeeModeDto.Full, + Clients.DebugApi.V2_0_0.Response14BeeMode.Light => BeeModeDto.Light, _ => throw new InvalidOperationException() }; ChequebookEnabled = response.ChequebookEnabled; diff --git a/src/BeeNet/DtoModels/PendingTransactionDto.cs b/src/BeeNet/DtoModels/PendingTransactionDto.cs index d9a725ad..ffe7c4dc 100644 --- a/src/BeeNet/DtoModels/PendingTransactionDto.cs +++ b/src/BeeNet/DtoModels/PendingTransactionDto.cs @@ -13,6 +13,7 @@ // limitations under the License. using System; +using System.Globalization; namespace Etherna.BeeNet.DtoModels { @@ -27,12 +28,12 @@ public PendingTransactionDto(Clients.DebugApi.V1_2_0.PendingTransactions tx) TransactionHash = tx.TransactionHash; To = tx.To; Nonce = tx.Nonce; - GasPrice = tx.GasPrice; + GasPrice = long.Parse(tx.GasPrice, CultureInfo.InvariantCulture); GasLimit = tx.GasLimit; Data = tx.Data; Created = tx.Created; Description = tx.Description; - Value = tx.Value; + Value = long.Parse(tx.Value, CultureInfo.InvariantCulture); } public PendingTransactionDto(Clients.DebugApi.V1_2_1.PendingTransactions tx) @@ -43,25 +44,39 @@ public PendingTransactionDto(Clients.DebugApi.V1_2_1.PendingTransactions tx) TransactionHash = tx.TransactionHash; To = tx.To; Nonce = tx.Nonce; - GasPrice = tx.GasPrice; + GasPrice = long.Parse(tx.GasPrice, CultureInfo.InvariantCulture); GasLimit = tx.GasLimit; Data = tx.Data; Created = tx.Created; Description = tx.Description; - Value = tx.Value; + Value = long.Parse(tx.Value, CultureInfo.InvariantCulture); + } + + public PendingTransactionDto(Clients.DebugApi.V2_0_0.PendingTransactions tx) + { + if (tx is null) + throw new ArgumentNullException(nameof(tx)); + + TransactionHash = tx.TransactionHash; + To = tx.To; + Nonce = tx.Nonce; + GasPrice = long.Parse(tx.GasPrice, CultureInfo.InvariantCulture); + GasLimit = tx.GasLimit; + Data = tx.Data; + Created = tx.Created; + Description = tx.Description; + Value = long.Parse(tx.Value, CultureInfo.InvariantCulture); } // Properties. public string TransactionHash { get; } public string To { get; } public int Nonce { get; } - /// Numeric string that represents integer which might exceeds `Number.MAX_SAFE_INTEGER` limit (2^53-1) - public string GasPrice { get; } - public int GasLimit { get; } + public long GasPrice { get; } + public long GasLimit { get; } public string Data { get; } public DateTimeOffset Created { get; } public string Description { get; } - /// Numeric string that represents integer which might exceeds `Number.MAX_SAFE_INTEGER` limit (2^53-1) - public string Value { get; } + public long Value { get; } } } diff --git a/src/BeeNet/DtoModels/StampsGetDto.cs b/src/BeeNet/DtoModels/PostageBatchDto.cs similarity index 51% rename from src/BeeNet/DtoModels/StampsGetDto.cs rename to src/BeeNet/DtoModels/PostageBatchDto.cs index ab15a3be..9ad73e51 100644 --- a/src/BeeNet/DtoModels/StampsGetDto.cs +++ b/src/BeeNet/DtoModels/PostageBatchDto.cs @@ -13,99 +13,155 @@ // limitations under the License. using System; +using System.Globalization; +using System.Text.Json; namespace Etherna.BeeNet.DtoModels { - public class StampsGetDto + public class PostageBatchDto { // Constructors. - public StampsGetDto(Clients.DebugApi.V1_2_0.Stamps batch) + public PostageBatchDto(Clients.DebugApi.V1_2_0.Stamps batch) { if (batch is null) throw new ArgumentNullException(nameof(batch)); + AmountPaid = long.Parse(batch.Amount, CultureInfo.InvariantCulture); + BatchTTL = batch.BatchTTL; Exists = batch.Exists; + Id = ((JsonElement)batch.BatchID).ToString(); + Utilization = batch.Utilization; + Usable = batch.Usable; + Label = batch.Label; + Depth = batch.Depth; + BucketDepth = batch.BucketDepth; + BlockNumber = batch.BlockNumber; + ImmutableFlag = batch.ImmutableFlag; + } + + public PostageBatchDto(Clients.DebugApi.V1_2_0.Response37 batch) + { + if (batch is null) + throw new ArgumentNullException(nameof(batch)); + + AmountPaid = long.Parse(batch.Amount, CultureInfo.InvariantCulture); BatchTTL = batch.BatchTTL; - BatchID = batch.BatchID; + Exists = batch.Exists; + Id = ((JsonElement)batch.BatchID).ToString(); Utilization = batch.Utilization; Usable = batch.Usable; Label = batch.Label; Depth = batch.Depth; - Amount = batch.Amount; BucketDepth = batch.BucketDepth; BlockNumber = batch.BlockNumber; ImmutableFlag = batch.ImmutableFlag; } - public StampsGetDto(Clients.DebugApi.V1_2_0.Response37 batch) + public PostageBatchDto(Clients.DebugApi.V1_2_1.Stamps batch) { if (batch is null) throw new ArgumentNullException(nameof(batch)); + AmountPaid = long.Parse(batch.Amount, CultureInfo.InvariantCulture); Exists = batch.Exists; BatchTTL = batch.BatchTTL; - BatchID = batch.BatchID; + Id = ((JsonElement)batch.BatchID).ToString(); Utilization = batch.Utilization; Usable = batch.Usable; Label = batch.Label; Depth = batch.Depth; - Amount = batch.Amount; BucketDepth = batch.BucketDepth; BlockNumber = batch.BlockNumber; ImmutableFlag = batch.ImmutableFlag; } - public StampsGetDto(Clients.DebugApi.V1_2_1.Stamps batch) + public PostageBatchDto(Clients.DebugApi.V1_2_1.Stamps2 batch) { if (batch is null) throw new ArgumentNullException(nameof(batch)); - Exists = batch.Exists; + Id = batch.BatchID; + BatchTTL = batch.BatchTTL; + BlockNumber = batch.BlockNumber; + BucketDepth = batch.BucketDepth; + Depth = batch.Depth; + Exists = true; + ImmutableFlag = batch.ImmutableFlag; + NormalisedBalance = long.Parse(batch.Value, CultureInfo.InvariantCulture); + OwnerAddress = batch.Owner; + Usable = true; + } + + public PostageBatchDto(Clients.DebugApi.V1_2_1.Response38 batch) + { + if (batch is null) + throw new ArgumentNullException(nameof(batch)); + + AmountPaid = long.Parse(batch.Amount, CultureInfo.InvariantCulture); BatchTTL = batch.BatchTTL; - BatchID = batch.BatchID; + Exists = batch.Exists; + Id = batch.BatchID; Utilization = batch.Utilization; Usable = batch.Usable; Label = batch.Label; Depth = batch.Depth; - Amount = batch.Amount; BucketDepth = batch.BucketDepth; BlockNumber = batch.BlockNumber; ImmutableFlag = batch.ImmutableFlag; } - public StampsGetDto(Clients.DebugApi.V1_2_1.Response38 batch) + public PostageBatchDto(Clients.DebugApi.V2_0_0.Stamps batch) { if (batch is null) throw new ArgumentNullException(nameof(batch)); + AmountPaid = long.Parse(batch.Amount, CultureInfo.InvariantCulture); + BatchTTL = batch.BatchTTL; Exists = batch.Exists; + Id = batch.BatchID; + Utilization = batch.Utilization; + Usable = batch.Usable; + Label = batch.Label; + Depth = batch.Depth; + BucketDepth = batch.BucketDepth; + BlockNumber = batch.BlockNumber; + ImmutableFlag = batch.ImmutableFlag; + } + + public PostageBatchDto(Clients.DebugApi.V2_0_0.Response38 batch) + { + if (batch is null) + throw new ArgumentNullException(nameof(batch)); + + AmountPaid = long.Parse(batch.Amount, CultureInfo.InvariantCulture); BatchTTL = batch.BatchTTL; - BatchID = batch.BatchID; + Exists = batch.Exists; + Id = (string)batch.BatchID; Utilization = batch.Utilization; Usable = batch.Usable; Label = batch.Label; Depth = batch.Depth; - Amount = batch.Amount; BucketDepth = batch.BucketDepth; BlockNumber = batch.BlockNumber; ImmutableFlag = batch.ImmutableFlag; } // Properties. - public bool Exists { get; } + public string Id { get; } + public long? AmountPaid { get; } /// The time (in seconds) remaining until the batch expires; -1 signals that the batch never expires; 0 signals that the batch has already expired. public int BatchTTL { get; } - public object BatchID { get; } - public int Utilization { get; } - /// Indicate that the batch was discovered by the Bee node, but it awaits enough on-chain confirmations before declaring the batch as usable. - public bool Usable { get; } - public string Label { get; } - public int Depth { get; } - /// Numeric string that represents integer which might exceeds `Number.MAX_SAFE_INTEGER` limit (2^53-1) - public string Amount { get; } - public int BucketDepth { get; } public int BlockNumber { get; } + public int BucketDepth { get; } + public int Depth { get; } + public bool Exists { get; } public bool ImmutableFlag { get; } + public string? Label { get; } + public long? NormalisedBalance { get; } + public string? OwnerAddress { get; } + /// Indicate that the batch was discovered by the Bee node, but it awaits enough on-chain confirmations before declaring the batch as usable. + public bool Usable { get; } + public int? Utilization { get; } } } diff --git a/src/BeeNet/DtoModels/ReserveStateDto.cs b/src/BeeNet/DtoModels/ReserveStateDto.cs index 8d24ea40..dd3304e9 100644 --- a/src/BeeNet/DtoModels/ReserveStateDto.cs +++ b/src/BeeNet/DtoModels/ReserveStateDto.cs @@ -13,6 +13,7 @@ // limitations under the License. using System; +using System.Globalization; namespace Etherna.BeeNet.DtoModels { @@ -26,8 +27,8 @@ public ReserveStateDto(Clients.DebugApi.V1_2_0.Response12 response) Radius = response.Radius; Available = response.Available; - Outer = response.Outer; - Inner = response.Inner; + Outer = long.Parse(response.Outer, CultureInfo.InvariantCulture); + Inner = long.Parse(response.Inner, CultureInfo.InvariantCulture); } public ReserveStateDto(Clients.DebugApi.V1_2_1.Response12 response) @@ -37,16 +38,25 @@ public ReserveStateDto(Clients.DebugApi.V1_2_1.Response12 response) Radius = response.Radius; Available = response.Available; - Outer = response.Outer; - Inner = response.Inner; + Outer = long.Parse(response.Outer, CultureInfo.InvariantCulture); + Inner = long.Parse(response.Inner, CultureInfo.InvariantCulture); + } + + public ReserveStateDto(Clients.DebugApi.V2_0_0.Response12 response) + { + if (response is null) + throw new ArgumentNullException(nameof(response)); + + Radius = response.Radius; + Available = response.Available; + Outer = long.Parse(response.Outer, CultureInfo.InvariantCulture); + Inner = long.Parse(response.Inner, CultureInfo.InvariantCulture); } // Properties. public int Radius { get; } public int Available { get; } - /// Numeric string that represents integer which might exceeds `Number.MAX_SAFE_INTEGER` limit (2^53-1) - public string Outer { get; } - /// Numeric string that represents integer which might exceeds `Number.MAX_SAFE_INTEGER` limit (2^53-1) - public string Inner { get; } + public long Outer { get; } + public long Inner { get; } } } diff --git a/src/BeeNet/DtoModels/ResultChequebookDto.cs b/src/BeeNet/DtoModels/ResultChequebookDto.cs index 18b5462e..d80bb0a7 100644 --- a/src/BeeNet/DtoModels/ResultChequebookDto.cs +++ b/src/BeeNet/DtoModels/ResultChequebookDto.cs @@ -13,6 +13,7 @@ // limitations under the License. using System; +using System.Globalization; namespace Etherna.BeeNet.DtoModels { @@ -25,7 +26,7 @@ public ResultChequeBookDto(Clients.DebugApi.V1_2_0.Result result) throw new ArgumentNullException(nameof(result)); Recipient = result.Recipient; - LastPayout = result.LastPayout; + LastPayout = long.Parse(result.LastPayout, CultureInfo.InvariantCulture); Bounced = result.Bounced; } @@ -35,14 +36,23 @@ public ResultChequeBookDto(Clients.DebugApi.V1_2_1.Result result) throw new ArgumentNullException(nameof(result)); Recipient = result.Recipient; - LastPayout = result.LastPayout; + LastPayout = long.Parse(result.LastPayout, CultureInfo.InvariantCulture); + Bounced = result.Bounced; + } + + public ResultChequeBookDto(Clients.DebugApi.V2_0_0.Result result) + { + if (result is null) + throw new ArgumentNullException(nameof(result)); + + Recipient = result.Recipient; + LastPayout = long.Parse(result.LastPayout, CultureInfo.InvariantCulture); Bounced = result.Bounced; } // Properties. - public string Recipient { get; } - /// Numeric string that represents integer which might exceeds `Number.MAX_SAFE_INTEGER` limit (2^53-1) - public string LastPayout { get; } public bool Bounced { get; } + public long LastPayout { get; } + public string Recipient { get; } } } diff --git a/src/BeeNet/DtoModels/SettlementDataDto.cs b/src/BeeNet/DtoModels/SettlementDataDto.cs index 05848a28..3aaad9d8 100644 --- a/src/BeeNet/DtoModels/SettlementDataDto.cs +++ b/src/BeeNet/DtoModels/SettlementDataDto.cs @@ -59,6 +59,26 @@ public SettlementDataDto(Clients.DebugApi.V1_2_1.Settlements2 settlement) Sent = settlement.Sent; } + public SettlementDataDto(Clients.DebugApi.V2_0_0.Settlements settlement) + { + if (settlement is null) + throw new ArgumentNullException(nameof(settlement)); + + Peer = settlement.Peer; + Received = settlement.Received; + Sent = settlement.Sent; + } + + public SettlementDataDto(Clients.DebugApi.V2_0_0.Settlements2 settlement) + { + if (settlement is null) + throw new ArgumentNullException(nameof(settlement)); + + Peer = settlement.Peer; + Received = settlement.Received; + Sent = settlement.Sent; + } + // Properties. public string Peer { get; } public int Received { get; } diff --git a/src/BeeNet/DtoModels/SettlementDto.cs b/src/BeeNet/DtoModels/SettlementDto.cs index 6db847fa..2d44bb7d 100644 --- a/src/BeeNet/DtoModels/SettlementDto.cs +++ b/src/BeeNet/DtoModels/SettlementDto.cs @@ -28,11 +28,22 @@ public SettlementDto(Clients.DebugApi.V1_2_0.Response20 response) TotalReceived = response.TotalReceived; TotalSent = response.TotalSent; - Settlements = response.Settlements + Settlements = (response.Settlements ?? Array.Empty()) .Select(i => new SettlementDataDto(i)); } public SettlementDto(Clients.DebugApi.V1_2_1.Response21 response) + { + if (response is null) + throw new ArgumentNullException(nameof(response)); + + TotalReceived = response.TotalReceived; + TotalSent = response.TotalSent; + Settlements = (response.Settlements ?? Array.Empty()) + .Select(i => new SettlementDataDto(i)); + } + + public SettlementDto(Clients.DebugApi.V2_0_0.Response21 response) { if (response is null) throw new ArgumentNullException(nameof(response)); diff --git a/src/BeeNet/DtoModels/StampsBucketsDto.cs b/src/BeeNet/DtoModels/StampsBucketsDto.cs index fdec6f83..79ced866 100644 --- a/src/BeeNet/DtoModels/StampsBucketsDto.cs +++ b/src/BeeNet/DtoModels/StampsBucketsDto.cs @@ -29,7 +29,7 @@ public StampsBucketsDto(Clients.DebugApi.V1_2_0.Response38 response) Depth = response.Depth; BucketDepth = response.BucketDepth; BucketUpperBound = response.BucketUpperBound; - Buckets = response.Buckets?.Select(i => new BucketDto(i)); + Buckets = (response.Buckets ?? Array.Empty()).Select(i => new BucketDto(i)); } public StampsBucketsDto(Clients.DebugApi.V1_2_1.Response39 response) @@ -40,13 +40,24 @@ public StampsBucketsDto(Clients.DebugApi.V1_2_1.Response39 response) Depth = response.Depth; BucketDepth = response.BucketDepth; BucketUpperBound = response.BucketUpperBound; - Buckets = response.Buckets?.Select(i => new BucketDto(i)); + Buckets = (response.Buckets ?? Array.Empty()).Select(i => new BucketDto(i)); + } + + public StampsBucketsDto(Clients.DebugApi.V2_0_0.Response39 response) + { + if (response is null) + throw new ArgumentNullException(nameof(response)); + + Depth = response.Depth; + BucketDepth = response.BucketDepth; + BucketUpperBound = response.BucketUpperBound; + Buckets = response.Buckets.Select(i => new BucketDto(i)); } // Properties. public int Depth { get; } public int BucketDepth { get; } public int BucketUpperBound { get; } - public IEnumerable? Buckets { get; } + public IEnumerable Buckets { get; } } } diff --git a/src/BeeNet/DtoModels/StewardshipGetDto.cs b/src/BeeNet/DtoModels/StewardshipGetDto.cs index f5e4cea1..6f25f620 100644 --- a/src/BeeNet/DtoModels/StewardshipGetDto.cs +++ b/src/BeeNet/DtoModels/StewardshipGetDto.cs @@ -27,6 +27,14 @@ public StewardShipGetDto(Clients.GatewayApi.V2_0_0.Response17 response) IsRetrievable = response.IsRetrievable; } + public StewardShipGetDto(Clients.GatewayApi.V3_0_0.Response17 response) + { + if (response is null) + throw new ArgumentNullException(nameof(response)); + + IsRetrievable = response.IsRetrievable; + } + // Properties. public bool IsRetrievable { get; } diff --git a/src/BeeNet/DtoModels/TagDto.cs b/src/BeeNet/DtoModels/TagDto.cs index 6d7ce6db..4b681031 100644 --- a/src/BeeNet/DtoModels/TagDto.cs +++ b/src/BeeNet/DtoModels/TagDto.cs @@ -51,6 +51,22 @@ public TagDto(Clients.DebugApi.V1_2_1.Response32 response) StartedAt = response.StartedAt; } + public TagDto(Clients.DebugApi.V2_0_0.Response32 response) + { + if (response is null) + throw new ArgumentNullException(nameof(response)); + + Total = response.Total; + Split = response.Split; + Seen = response.Seen; + Stored = response.Stored; + Sent = response.Sent; + Synced = response.Synced; + Uid = response.Uid; + Address = response.Address; + StartedAt = response.StartedAt; + } + // Properties. public int Total { get; } public int Split { get; } diff --git a/src/BeeNet/DtoModels/TagInfoDto.cs b/src/BeeNet/DtoModels/TagInfoDto.cs index 6216be4c..cb131985 100644 --- a/src/BeeNet/DtoModels/TagInfoDto.cs +++ b/src/BeeNet/DtoModels/TagInfoDto.cs @@ -55,6 +55,42 @@ public TagInfoDto(Clients.GatewayApi.V2_0_0.Response8 response) Synced = response.Synced; } + public TagInfoDto(Clients.GatewayApi.V3_0_0.Tags tags) + { + if (tags is null) + throw new ArgumentNullException(nameof(tags)); + + Uid = tags.Uid; + StartedAt = tags.StartedAt; + Total = tags.Total; + Processed = tags.Processed; + Synced = tags.Synced; + } + + public TagInfoDto(Clients.GatewayApi.V3_0_0.Response7 response) + { + if (response is null) + throw new ArgumentNullException(nameof(response)); + + Uid = response.Uid; + StartedAt = response.StartedAt; + Total = response.Total; + Processed = response.Processed; + Synced = response.Synced; + } + + public TagInfoDto(Clients.GatewayApi.V3_0_0.Response8 response) + { + if (response is null) + throw new ArgumentNullException(nameof(response)); + + Uid = response.Uid; + StartedAt = response.StartedAt; + Total = response.Total; + Processed = response.Processed; + Synced = response.Synced; + } + // Properties. public int Uid { get; } diff --git a/src/BeeNet/DtoModels/TimesettlementsDto.cs b/src/BeeNet/DtoModels/TimesettlementsDto.cs index 6d61462e..82651c61 100644 --- a/src/BeeNet/DtoModels/TimesettlementsDto.cs +++ b/src/BeeNet/DtoModels/TimesettlementsDto.cs @@ -28,11 +28,22 @@ public TimeSettlementsDto(Clients.DebugApi.V1_2_0.Response21 response) TotalReceived = response.TotalReceived; TotalSent = response.TotalSent; - Settlements = response.Settlements + Settlements = (response.Settlements ?? Array.Empty()) .Select(i => new SettlementDataDto(i)); } public TimeSettlementsDto(Clients.DebugApi.V1_2_1.Response22 response) + { + if (response is null) + throw new ArgumentNullException(nameof(response)); + + TotalReceived = response.TotalReceived; + TotalSent = response.TotalSent; + Settlements = (response.Settlements ?? Array.Empty()) + .Select(i => new SettlementDataDto(i)); + } + + public TimeSettlementsDto(Clients.DebugApi.V2_0_0.Response22 response) { if (response is null) throw new ArgumentNullException(nameof(response)); diff --git a/src/BeeNet/DtoModels/TopologyDto.cs b/src/BeeNet/DtoModels/TopologyDto.cs index 696f3423..1ba9b549 100644 --- a/src/BeeNet/DtoModels/TopologyDto.cs +++ b/src/BeeNet/DtoModels/TopologyDto.cs @@ -52,6 +52,21 @@ public TopologyDto(Clients.DebugApi.V1_2_1.Response23 response) i => i.Key, i => new AnonymousDto(i.Value)); } + public TopologyDto(Clients.DebugApi.V2_0_0.Response23 response) + { + if (response is null) + throw new ArgumentNullException(nameof(response)); + + BaseAddr = response.BaseAddr; + Population = response.Population; + Connected = response.Connected; + Timestamp = response.Timestamp; + NnLowWatermark = response.NnLowWatermark; + Depth = response.Depth; + Bins = response.Bins.ToDictionary( + i => i.Key, + i => new AnonymousDto(i.Value)); + } // Properties. public string BaseAddr { get; } diff --git a/src/BeeNet/DtoModels/TransactionsDto.cs b/src/BeeNet/DtoModels/TransactionsDto.cs index 89cabd70..a592b498 100644 --- a/src/BeeNet/DtoModels/TransactionsDto.cs +++ b/src/BeeNet/DtoModels/TransactionsDto.cs @@ -13,6 +13,7 @@ // limitations under the License. using System; +using System.Globalization; namespace Etherna.BeeNet.DtoModels { @@ -27,12 +28,12 @@ public TransactionsDto(Clients.DebugApi.V1_2_0.Response33 response) TransactionHash = response.TransactionHash; To = response.To; Nonce = response.Nonce; - GasPrice = response.GasPrice; + GasPrice = long.Parse(response.GasPrice, CultureInfo.InvariantCulture); GasLimit = response.GasLimit; Data = response.Data; Created = response.Created; Description = response.Description; - Value = response.Value; + Value = long.Parse(response.Value, CultureInfo.InvariantCulture); } public TransactionsDto(Clients.DebugApi.V1_2_1.Response34 response) @@ -43,25 +44,39 @@ public TransactionsDto(Clients.DebugApi.V1_2_1.Response34 response) TransactionHash = response.TransactionHash; To = response.To; Nonce = response.Nonce; - GasPrice = response.GasPrice; + GasPrice = long.Parse(response.GasPrice, CultureInfo.InvariantCulture); GasLimit = response.GasLimit; Data = response.Data; Created = response.Created; Description = response.Description; - Value = response.Value; + Value = long.Parse(response.Value, CultureInfo.InvariantCulture); + } + + public TransactionsDto(Clients.DebugApi.V2_0_0.Response34 response) + { + if (response is null) + throw new ArgumentNullException(nameof(response)); + + TransactionHash = response.TransactionHash; + To = response.To; + Nonce = response.Nonce; + GasPrice = long.Parse(response.GasPrice, CultureInfo.InvariantCulture); + GasLimit = response.GasLimit; + Data = response.Data; + Created = response.Created; + Description = response.Description; + Value = long.Parse(response.Value, CultureInfo.InvariantCulture); } // Properties. public string TransactionHash { get; } public string To { get; } public int Nonce { get; } - /// Numeric string that represents integer which might exceeds `Number.MAX_SAFE_INTEGER` limit (2^53-1) - public string GasPrice { get; } - public int GasLimit { get; } + public long GasPrice { get; } + public long GasLimit { get; } public string Data { get; } public DateTimeOffset Created { get; } public string Description { get; } - /// Numeric string that represents integer which might exceeds `Number.MAX_SAFE_INTEGER` limit (2^53-1) - public string Value { get; } + public long Value { get; } } } diff --git a/src/BeeNet/DtoModels/ValidPostageBatchDto.cs b/src/BeeNet/DtoModels/ValidPostageBatchDto.cs deleted file mode 100644 index cf0e81e7..00000000 --- a/src/BeeNet/DtoModels/ValidPostageBatchDto.cs +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright 2021-present Etherna Sagl -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -using Etherna.BeeNet.Clients.DebugApi.V1_2_1; -using System; - -namespace Etherna.BeeNet.DtoModels -{ - public class ValidPostageBatchDto - { - public ValidPostageBatchDto(Stamps2 validBatch) - { - if (validBatch is null) - throw new ArgumentNullException(nameof(validBatch)); - - BatchID = validBatch.BatchID; - BatchTTL = validBatch.BatchTTL; - BlockNumber = validBatch.BlockNumber; - BucketDepth = validBatch.BucketDepth; - Depth = validBatch.Depth; - ImmutableFlag = validBatch.ImmutableFlag; - Owner = validBatch.Owner; - Value = validBatch.Value; - } - - public string BatchID { get; } - public int BatchTTL { get; } - public int BlockNumber { get; } - public int BucketDepth { get; } - public int Depth { get; } - /// - /// Numeric string that represents integer which might exceeds `Number.MAX_SAFE_INTEGER` limit (2^53-1) - /// - public bool ImmutableFlag { get; } - public string Owner { get; } - public string Value { get; } - } -} diff --git a/src/BeeNet/DtoModels/VersionDto.cs b/src/BeeNet/DtoModels/VersionDto.cs index d9750f3e..bbb3286f 100644 --- a/src/BeeNet/DtoModels/VersionDto.cs +++ b/src/BeeNet/DtoModels/VersionDto.cs @@ -84,6 +84,38 @@ public VersionDto(Clients.DebugApi.V1_2_1.Response25 response) ApiVersion = response.ApiVersion; DebugApiVersion = response.DebugApiVersion; } + public VersionDto(Clients.DebugApi.V2_0_0.Response15 response) + { + if (response is null) + throw new ArgumentNullException(nameof(response)); + + Status = response.Status; + Version = response.Version; + ApiVersion = response.ApiVersion; + DebugApiVersion = response.DebugApiVersion; + } + + public VersionDto(Clients.DebugApi.V2_0_0.Response19 response) + { + if (response is null) + throw new ArgumentNullException(nameof(response)); + + Status = response.Status; + Version = response.Version; + ApiVersion = response.ApiVersion; + DebugApiVersion = response.DebugApiVersion; + } + + public VersionDto(Clients.DebugApi.V2_0_0.Response25 response) + { + if (response is null) + throw new ArgumentNullException(nameof(response)); + + Status = response.Status; + Version = response.Version; + ApiVersion = response.ApiVersion; + DebugApiVersion = response.DebugApiVersion; + } public VersionDto(Clients.GatewayApi.V2_0_0.Response4 response) { @@ -107,6 +139,28 @@ public VersionDto(Clients.GatewayApi.V2_0_0.Response9 response) DebugApiVersion = response.DebugApiVersion; } + public VersionDto(Clients.GatewayApi.V3_0_0.Response4 response) + { + if (response is null) + throw new ArgumentNullException(nameof(response)); + + Status = response.Status; + Version = response.Version; + ApiVersion = response.ApiVersion; + DebugApiVersion = response.DebugApiVersion; + } + + public VersionDto(Clients.GatewayApi.V3_0_0.Response9 response) + { + if (response is null) + throw new ArgumentNullException(nameof(response)); + + Status = response.Status; + Version = response.Version; + ApiVersion = response.ApiVersion; + DebugApiVersion = response.DebugApiVersion; + } + // Properties. public string Status { get; } public string Version { get; } diff --git a/src/BeeNet/IBeeNodeClient.cs b/src/BeeNet/IBeeNodeClient.cs index c4fa063a..5cc4198d 100644 --- a/src/BeeNet/IBeeNodeClient.cs +++ b/src/BeeNet/IBeeNodeClient.cs @@ -12,7 +12,6 @@ // See the License for the specific language governing permissions and // limitations under the License. -using Etherna.BeeNet.Clients; using Etherna.BeeNet.Clients.DebugApi; using Etherna.BeeNet.Clients.GatewayApi; @@ -20,9 +19,7 @@ namespace Etherna.BeeNet { public interface IBeeNodeClient { - DebugApiVersion DebugApiVersion { get; } IBeeDebugClient? DebugClient { get; } - GatewayApiVersion GatewayApiVersion { get; } IBeeGatewayClient? GatewayClient { get; } } } \ No newline at end of file diff --git a/src/BeeNet/Properties/AssemblyInfo.cs b/src/BeeNet/Properties/AssemblyInfo.cs new file mode 100644 index 00000000..ee2ad6e9 --- /dev/null +++ b/src/BeeNet/Properties/AssemblyInfo.cs @@ -0,0 +1,17 @@ +// Copyright 2021-present Etherna Sagl +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +using System; + +[assembly: CLSCompliant(false)] \ No newline at end of file diff --git a/tools/openapi/Swarm.yaml b/tools/openapi/Swarm.yaml index a28d6833..e331bbcf 100644 --- a/tools/openapi/Swarm.yaml +++ b/tools/openapi/Swarm.yaml @@ -1,7 +1,7 @@ openapi: 3.0.3 info: - version: 2.0.0 + version: 3.0.0 title: Bee API description: "A list of the currently provided Interfaces to interact with the swarm, implementing file operations and sending messages" diff --git a/tools/openapi/SwarmCommon.yaml b/tools/openapi/SwarmCommon.yaml index 08c9b584..37212a3f 100644 --- a/tools/openapi/SwarmCommon.yaml +++ b/tools/openapi/SwarmCommon.yaml @@ -1,6 +1,6 @@ openapi: 3.0.3 info: - version: 1.0.0 + version: 2.0.0 title: Common Data Types description: | \*****bzzz***** @@ -136,7 +136,7 @@ components: properties: lastcheques: type: array - nullable: true + nullable: false items: $ref: "#/components/schemas/ChequePeerResponse" @@ -185,11 +185,13 @@ components: GasLimit: type: integer + format: int64 minimum: 0 maximum: 18446744073709551615 GasPrice: type: integer + format: int64 Hash: type: object @@ -287,7 +289,7 @@ components: properties: peers: type: array - nullable: true + nullable: false items: $ref: "#/components/schemas/Address" @@ -321,16 +323,16 @@ components: properties: stamps: type: array - nullable: true + nullable: false items: $ref: "#/components/schemas/DebugPostageBatch" DebugPostageAllBatchesResponse: type: object properties: - stamps: + batches: type: array - nullable: true + nullable: false items: $ref: "#/components/schemas/PostageBatchShort" @@ -469,7 +471,7 @@ components: type: integer buckets: type: array - nullable: true + nullable: false items: $ref: "#/components/schemas/StampBucketData" @@ -492,7 +494,7 @@ components: type: integer settlements: type: array - nullable: true + nullable: false items: $ref: "#/components/schemas/Settlement" @@ -529,9 +531,9 @@ components: SwarmOnlyReferencesList: type: object properties: - addresses: + references: type: array - nullable: true + nullable: false items: $ref: "#/components/schemas/SwarmOnlyReference" @@ -592,6 +594,7 @@ components: $ref: "#/components/schemas/BigInt" gasLimit: type: integer + format: int64 data: type: string created: @@ -606,7 +609,7 @@ components: properties: pendingTransactions: type: array - nullable: true + nullable: false items: $ref: "#/components/schemas/TransactionInfo" diff --git a/tools/openapi/SwarmDebug.yaml b/tools/openapi/SwarmDebug.yaml index 6cfc1aba..8c870f41 100644 --- a/tools/openapi/SwarmDebug.yaml +++ b/tools/openapi/SwarmDebug.yaml @@ -1,6 +1,6 @@ openapi: 3.0.3 info: - version: 1.2.1 + version: 2.0.0 title: Bee Debug API description: "A list of the currently provided debug interfaces to interact with the bee node" @@ -612,6 +612,7 @@ paths: name: amount schema: type: integer + format: int64 required: true description: amount of tokens to deposit - $ref: "SwarmCommon.yaml#/components/parameters/GasPriceParameter" @@ -639,6 +640,7 @@ paths: name: amount schema: type: integer + format: int64 required: true description: amount of tokens to withdraw - $ref: "SwarmCommon.yaml#/components/parameters/GasPriceParameter" @@ -850,7 +852,7 @@ paths: - in: path name: amount schema: - type: integer + $ref: "SwarmCommon.yaml#/components/schemas/BigInt" required: true description: Amount of BZZ added that the postage batch will have. - in: path @@ -904,6 +906,7 @@ paths: name: amount schema: type: integer + format: int64 required: true description: Amount of BZZ per chunk to top up to an existing postage batch. responses: diff --git a/tools/swarm-debug-api.nswag b/tools/swarm-debug-api.nswag index ce345b69..ad2e26bf 100644 --- a/tools/swarm-debug-api.nswag +++ b/tools/swarm-debug-api.nswag @@ -3,7 +3,7 @@ "defaultVariables": null, "documentGenerator": { "fromDocument": { - "json": "openapi: 3.0.3\r\ninfo:\r\n version: 1.2.1\r\n title: Bee Debug API\r\n description: A list of the currently provided debug interfaces to interact with\r\n the bee node\r\nsecurity:\r\n - {}\r\nexternalDocs:\r\n description: Browse the documentation @ the Swarm Docs\r\n url: https://docs.ethswarm.org\r\nservers:\r\n - url: http://{apiRoot}:{port}\r\n variables:\r\n apiRoot:\r\n default: localhost\r\n description: Base address of the local bee node debug API\r\n port:\r\n default: \"1635\"\r\n description: Service port provided in bee node config\r\npaths:\r\n /addresses:\r\n get:\r\n summary: Get overlay and underlay addresses of the node\r\n tags:\r\n - Connectivity\r\n responses:\r\n \"200\":\r\n description: Own node underlay and overlay addresses\r\n content:\r\n application/json:\r\n schema:\r\n type: object\r\n properties:\r\n overlay:\r\n type: string\r\n pattern: ^[A-Fa-f0-9]{64}$\r\n example: 36b7efd913ca4cf880b8eeac5093fa27b0825906c600685b6abdd6566e6cfe8f\r\n underlay:\r\n type: array\r\n items:\r\n type: string\r\n example: /ip4/127.0.0.1/tcp/1634/p2p/16Uiu2HAmTm17toLDaPYzRyjKn27iCB76yjKnJ5DjQXneFmifFvaX\r\n ethereum:\r\n type: string\r\n pattern: ^[A-Fa-f0-9]{40}$\r\n example: 36b7efd913ca4cf880b8eeac5093fa27b0825906\r\n publicKey:\r\n &a1\r\n type: string\r\n pattern: ^[A-Fa-f0-9]{66}$\r\n example: 02ab7473879005929d10ce7d4f626412dad9fe56b0a6622038931d26bd79abf0a4\r\n pssPublicKey: *a1\r\n \"500\":\r\n &a2\r\n description: Internal Server Error\r\n content:\r\n application/problem+json:\r\n schema:\r\n type: object\r\n properties:\r\n message:\r\n type: string\r\n code:\r\n type: integer\r\n default:\r\n description: Default response\r\n /balances:\r\n get:\r\n summary: Get the balances with all known peers including prepaid services\r\n tags:\r\n - Balance\r\n responses:\r\n \"200\":\r\n description: Own balances with all known peers\r\n content:\r\n application/json:\r\n schema:\r\n &a3\r\n type: object\r\n properties:\r\n balances:\r\n type: array\r\n items:\r\n type: object\r\n properties:\r\n peer:\r\n type: string\r\n pattern: ^[A-Fa-f0-9]{64}$\r\n example: 36b7efd913ca4cf880b8eeac5093fa27b0825906c600685b6abdd6566e6cfe8f\r\n balance:\r\n description: Numeric string that represents integer which might exceeds\r\n `Number.MAX_SAFE_INTEGER` limit (2^53-1)\r\n type: string\r\n example: \"1000000000000000000\"\r\n \"500\": *a2\r\n default:\r\n description: Default response\r\n \"/balances/{address}\":\r\n get:\r\n summary: Get the balances with a specific peer including prepaid services\r\n tags:\r\n - Balance\r\n parameters:\r\n - in: path\r\n name: address\r\n schema:\r\n &a4\r\n type: string\r\n pattern: ^[A-Fa-f0-9]{64}$\r\n example: 36b7efd913ca4cf880b8eeac5093fa27b0825906c600685b6abdd6566e6cfe8f\r\n required: true\r\n description: Swarm address of peer\r\n responses:\r\n \"200\":\r\n description: Balance with the specific peer\r\n content:\r\n application/json:\r\n schema:\r\n &a5\r\n type: object\r\n properties:\r\n peer:\r\n type: string\r\n pattern: ^[A-Fa-f0-9]{64}$\r\n example: 36b7efd913ca4cf880b8eeac5093fa27b0825906c600685b6abdd6566e6cfe8f\r\n balance:\r\n description: Numeric string that represents integer which might exceeds\r\n `Number.MAX_SAFE_INTEGER` limit (2^53-1)\r\n type: string\r\n example: \"1000000000000000000\"\r\n \"404\":\r\n &a6\r\n description: Not Found\r\n content:\r\n application/problem+json:\r\n schema:\r\n type: object\r\n properties:\r\n message:\r\n type: string\r\n code:\r\n type: integer\r\n \"500\": *a2\r\n default:\r\n description: Default response\r\n /blocklist:\r\n get:\r\n summary: Get a list of blocklisted peers\r\n tags:\r\n - Connectivity\r\n responses:\r\n \"200\":\r\n description: Returns overlay addresses of blocklisted peers\r\n content:\r\n application/json:\r\n schema:\r\n &a11\r\n type: object\r\n properties:\r\n peers:\r\n type: array\r\n nullable: true\r\n items:\r\n type: object\r\n properties:\r\n address:\r\n type: string\r\n pattern: ^[A-Fa-f0-9]{64}$\r\n example: 36b7efd913ca4cf880b8eeac5093fa27b0825906c600685b6abdd6566e6cfe8f\r\n \"500\": *a2\r\n default:\r\n description: Default response\r\n /consumed:\r\n get:\r\n summary: Get the past due consumption balances with all known peers\r\n tags:\r\n - Balance\r\n responses:\r\n \"200\":\r\n description: Own past due consumption balances with all known peers\r\n content:\r\n application/json:\r\n schema: *a3\r\n \"500\": *a2\r\n default:\r\n description: Default response\r\n \"/consumed/{address}\":\r\n get:\r\n summary: Get the past due consumption balance with a specific peer\r\n tags:\r\n - Balance\r\n parameters:\r\n - in: path\r\n name: address\r\n schema: *a4\r\n required: true\r\n description: Swarm address of peer\r\n responses:\r\n \"200\":\r\n description: Past-due consumption balance with the specific peer\r\n content:\r\n application/json:\r\n schema: *a5\r\n \"404\": *a6\r\n \"500\": *a2\r\n default:\r\n description: Default response\r\n /chequebook/address:\r\n get:\r\n summary: Get the address of the chequebook contract used\r\n tags:\r\n - Chequebook\r\n responses:\r\n \"200\":\r\n description: Ethereum address of chequebook contract\r\n content:\r\n application/json:\r\n schema:\r\n type: object\r\n properties:\r\n chequebookAddress:\r\n type: string\r\n pattern: ^[A-Fa-f0-9]{40}$\r\n example: 36b7efd913ca4cf880b8eeac5093fa27b0825906\r\n /chequebook/balance:\r\n get:\r\n summary: Get the balance of the chequebook\r\n tags:\r\n - Chequebook\r\n responses:\r\n \"200\":\r\n description: Balance of the chequebook\r\n content:\r\n application/json:\r\n schema:\r\n type: object\r\n properties:\r\n totalBalance:\r\n &a7\r\n description: Numeric string that represents integer which might exceeds\r\n `Number.MAX_SAFE_INTEGER` limit (2^53-1)\r\n type: string\r\n example: \"1000000000000000000\"\r\n availableBalance: *a7\r\n \"500\": *a2\r\n default:\r\n description: Default response\r\n \"/chunks/{address}\":\r\n get:\r\n summary: Check if chunk at address exists locally\r\n tags:\r\n - Chunk\r\n parameters:\r\n - in: path\r\n name: address\r\n schema: *a4\r\n required: true\r\n description: Swarm address of chunk\r\n responses:\r\n \"200\":\r\n description: Chunk exists\r\n content:\r\n application/json:\r\n schema:\r\n &a8\r\n type: object\r\n properties:\r\n message:\r\n type: string\r\n code:\r\n type: integer\r\n \"400\":\r\n &a9\r\n description: Bad request\r\n content:\r\n application/problem+json:\r\n schema:\r\n type: object\r\n properties:\r\n message:\r\n type: string\r\n code:\r\n type: integer\r\n \"404\": *a6\r\n default:\r\n description: Default response\r\n delete:\r\n summary: Delete a chunk from local storage\r\n tags:\r\n - Chunk\r\n parameters:\r\n - in: path\r\n name: address\r\n schema: *a4\r\n required: true\r\n description: Swarm address of chunk\r\n responses:\r\n \"200\":\r\n description: Chunk exists\r\n content:\r\n application/json:\r\n schema: *a8\r\n \"400\": *a9\r\n \"404\": *a6\r\n default:\r\n description: Default response\r\n \"/connect/{multiAddress}\":\r\n post:\r\n summary: Connect to address\r\n tags:\r\n - Connectivity\r\n parameters:\r\n - in: path\r\n allowReserved: true\r\n name: multiAddress\r\n schema:\r\n type: string\r\n required: true\r\n description: Underlay address of peer\r\n responses:\r\n \"200\":\r\n description: Returns overlay address of connected peer\r\n content:\r\n application/json:\r\n schema:\r\n type: object\r\n properties:\r\n address:\r\n type: string\r\n pattern: ^[A-Fa-f0-9]{64}$\r\n example: 36b7efd913ca4cf880b8eeac5093fa27b0825906c600685b6abdd6566e6cfe8f\r\n \"400\": *a9\r\n \"500\": *a2\r\n default:\r\n description: Default response\r\n /reservestate:\r\n get:\r\n summary: Get reserve state\r\n tags:\r\n - Status\r\n responses:\r\n \"200\":\r\n description: Reserve State\r\n content:\r\n application/json:\r\n schema:\r\n type: object\r\n properties:\r\n radius:\r\n type: integer\r\n available:\r\n type: integer\r\n outer:\r\n &a10\r\n description: Numeric string that represents integer which might exceeds\r\n `Number.MAX_SAFE_INTEGER` limit (2^53-1)\r\n type: string\r\n example: \"1000000000000000000\"\r\n inner: *a10\r\n default:\r\n description: Default response\r\n /chainstate:\r\n get:\r\n summary: Get chain state\r\n tags:\r\n - Status\r\n responses:\r\n \"200\":\r\n description: Chain State\r\n content:\r\n application/json:\r\n schema:\r\n type: object\r\n properties:\r\n block:\r\n type: integer\r\n totalAmount:\r\n type: integer\r\n currentPrice:\r\n type: integer\r\n default:\r\n description: Default response\r\n /node:\r\n get:\r\n summary: Get information about the node\r\n tags:\r\n - Status\r\n responses:\r\n \"200\":\r\n description: Information about the node\r\n content:\r\n application/json:\r\n schema:\r\n type: object\r\n properties:\r\n beeMode:\r\n type: string\r\n enum:\r\n - light\r\n - full\r\n - dev\r\n description: >\r\n Gives back in what mode the Bee client has been started.\r\n The modes are mutually exclusive * `light` - light node;\r\n does not participate in forwarding or storing chunks *\r\n `full` - full node * `dev` - development mode; Bee client\r\n for development purposes, blockchain operations are mocked\r\n gatewayMode:\r\n type: boolean\r\n chequebookEnabled:\r\n type: boolean\r\n swapEnabled:\r\n type: boolean\r\n default:\r\n description: Default response\r\n /health:\r\n get:\r\n summary: Get health of node\r\n tags:\r\n - Status\r\n responses:\r\n \"200\":\r\n description: Health State of node\r\n content:\r\n application/json:\r\n schema:\r\n &a12\r\n type: object\r\n properties:\r\n status:\r\n type: string\r\n version:\r\n type: string\r\n apiVersion:\r\n type: string\r\n default: 0.0.0\r\n description: The default value is set in case the bee binary was not build\r\n correctly.\r\n debugApiVersion:\r\n type: string\r\n default: 0.0.0\r\n description: The default value is set in case the bee binary was not build\r\n correctly.\r\n default:\r\n description: Default response\r\n /peers:\r\n get:\r\n summary: Get a list of peers\r\n tags:\r\n - Connectivity\r\n responses:\r\n \"200\":\r\n description: Returns overlay addresses of connected peers\r\n content:\r\n application/json:\r\n schema: *a11\r\n default:\r\n description: Default response\r\n \"/peers/{address}\":\r\n delete:\r\n summary: Remove peer\r\n tags:\r\n - Connectivity\r\n parameters:\r\n - in: path\r\n name: address\r\n schema: *a4\r\n required: true\r\n description: Swarm address of peer\r\n responses:\r\n \"200\":\r\n description: Disconnected peer\r\n content:\r\n application/json:\r\n schema: *a8\r\n \"400\": *a9\r\n \"500\": *a2\r\n default:\r\n description: Default response\r\n \"/pingpong/{peer-id}\":\r\n post:\r\n summary: Try connection to node\r\n tags:\r\n - Connectivity\r\n parameters:\r\n - in: path\r\n name: peer-id\r\n schema: *a4\r\n required: true\r\n description: Swarm address of peer\r\n responses:\r\n \"200\":\r\n description: Returns round trip time for given peer\r\n content:\r\n application/json:\r\n schema:\r\n type: object\r\n properties:\r\n rtt:\r\n description: Go time.Duration format\r\n type: string\r\n example: 5.0018ms\r\n \"400\": *a9\r\n \"404\": *a6\r\n \"500\": *a2\r\n default:\r\n description: Default response\r\n /readiness:\r\n get:\r\n summary: Get readiness state of node\r\n tags:\r\n - Status\r\n responses:\r\n \"200\":\r\n description: Health State of node\r\n content:\r\n application/json:\r\n schema: *a12\r\n default:\r\n description: Default response\r\n \"/settlements/{address}\":\r\n get:\r\n summary: Get amount of sent and received from settlements with a peer\r\n tags:\r\n - Settlements\r\n parameters:\r\n - in: path\r\n name: address\r\n schema: *a4\r\n required: true\r\n description: Swarm address of peer\r\n responses:\r\n \"200\":\r\n description: Amount of sent or received from settlements with a peer\r\n content:\r\n application/json:\r\n schema:\r\n type: object\r\n properties:\r\n peer:\r\n type: string\r\n pattern: ^[A-Fa-f0-9]{64}$\r\n example: 36b7efd913ca4cf880b8eeac5093fa27b0825906c600685b6abdd6566e6cfe8f\r\n received:\r\n type: integer\r\n sent:\r\n type: integer\r\n \"404\": *a6\r\n \"500\": *a2\r\n default:\r\n description: Default response\r\n /settlements:\r\n get:\r\n summary: Get settlements with all known peers and total amount sent or received\r\n tags:\r\n - Settlements\r\n responses:\r\n \"200\":\r\n description: Settlements with all known peers and total amount sent or received\r\n content:\r\n application/json:\r\n schema:\r\n &a13\r\n type: object\r\n properties:\r\n totalReceived:\r\n type: integer\r\n totalSent:\r\n type: integer\r\n settlements:\r\n type: array\r\n nullable: true\r\n items:\r\n type: object\r\n properties:\r\n peer:\r\n type: string\r\n pattern: ^[A-Fa-f0-9]{64}$\r\n example: 36b7efd913ca4cf880b8eeac5093fa27b0825906c600685b6abdd6566e6cfe8f\r\n received:\r\n type: integer\r\n sent:\r\n type: integer\r\n \"500\": *a2\r\n default:\r\n description: Default response\r\n /timesettlements:\r\n get:\r\n summary: Get time based settlements with all known peers and total amount sent\r\n or received\r\n tags:\r\n - Settlements\r\n responses:\r\n \"200\":\r\n description: Time based settlements with all known peers and total amount sent\r\n or received\r\n content:\r\n application/json:\r\n schema: *a13\r\n \"500\": *a2\r\n default:\r\n description: Default response\r\n /topology:\r\n get:\r\n description: Get topology of known network\r\n tags:\r\n - Connectivity\r\n responses:\r\n \"200\":\r\n description: Swarm topology of the bee node\r\n content:\r\n application/json:\r\n schema:\r\n type: object\r\n properties:\r\n baseAddr:\r\n &a14\r\n type: string\r\n pattern: ^[A-Fa-f0-9]{64}$\r\n example: 36b7efd913ca4cf880b8eeac5093fa27b0825906c600685b6abdd6566e6cfe8f\r\n population:\r\n type: integer\r\n connected:\r\n type: integer\r\n timestamp:\r\n type: string\r\n nnLowWatermark:\r\n type: integer\r\n depth:\r\n type: integer\r\n bins:\r\n type: object\r\n additionalProperties:\r\n type: object\r\n properties:\r\n population:\r\n type: integer\r\n connected:\r\n type: integer\r\n disconnectedPeers:\r\n type: array\r\n items:\r\n type: object\r\n properties:\r\n address: *a14\r\n metrics:\r\n &a15\r\n type: object\r\n properties:\r\n lastSeenTimestamp:\r\n type: integer\r\n nullable: false\r\n sessionConnectionRetry:\r\n type: integer\r\n nullable: false\r\n connectionTotalDuration:\r\n type: number\r\n nullable: false\r\n sessionConnectionDuration:\r\n type: number\r\n nullable: false\r\n sessionConnectionDirection:\r\n type: string\r\n nullable: false\r\n latencyEWMA:\r\n type: integer\r\n nullable: false\r\n connectedPeers:\r\n type: array\r\n items:\r\n type: object\r\n properties:\r\n address: *a14\r\n metrics: *a15\r\n /welcome-message:\r\n get:\r\n summary: Get configured P2P welcome message\r\n tags:\r\n - Connectivity\r\n responses:\r\n \"200\":\r\n description: Welcome message\r\n content:\r\n application/json:\r\n schema:\r\n &a16\r\n type: object\r\n properties:\r\n welcomeMessage:\r\n type: string\r\n \"500\": *a2\r\n default:\r\n description: Default response\r\n post:\r\n summary: Set P2P welcome message\r\n tags:\r\n - Connectivity\r\n requestBody:\r\n content:\r\n application/json:\r\n schema: *a16\r\n responses:\r\n \"200\":\r\n description: OK\r\n content:\r\n application/json:\r\n schema: *a12\r\n \"400\": *a9\r\n \"500\": *a2\r\n default:\r\n description: Default response\r\n \"/chequebook/cashout/{peer-id}\":\r\n get:\r\n summary: Get last cashout action for the peer\r\n parameters:\r\n - in: path\r\n name: peer-id\r\n schema: *a4\r\n required: true\r\n description: Swarm address of peer\r\n tags:\r\n - Chequebook\r\n responses:\r\n \"200\":\r\n description: Cashout status\r\n content:\r\n application/json:\r\n schema:\r\n type: object\r\n properties:\r\n peer:\r\n type: string\r\n pattern: ^[A-Fa-f0-9]{64}$\r\n example: 36b7efd913ca4cf880b8eeac5093fa27b0825906c600685b6abdd6566e6cfe8f\r\n lastCashedCheque:\r\n type: object\r\n properties:\r\n beneficiary:\r\n &a17\r\n type: string\r\n pattern: ^[A-Fa-f0-9]{40}$\r\n example: 36b7efd913ca4cf880b8eeac5093fa27b0825906\r\n chequebook: *a17\r\n payout:\r\n &a18\r\n description: Numeric string that represents integer which might exceeds\r\n `Number.MAX_SAFE_INTEGER` limit (2^53-1)\r\n type: string\r\n example: \"1000000000000000000\"\r\n transactionHash:\r\n type: string\r\n pattern: ^0x[A-Fa-f0-9]{64}$\r\n example: \"0x780cb6a37d1946978087896e1e489c37e30fe3e329510fff8d97360f73529f5a\"\r\n result:\r\n type: object\r\n properties:\r\n recipient: *a17\r\n lastPayout: *a18\r\n bounced:\r\n type: boolean\r\n uncashedAmount: *a18\r\n \"404\": *a6\r\n \"500\": *a2\r\n default:\r\n description: Default response\r\n post:\r\n summary: Cashout the last cheque for the peer\r\n parameters:\r\n - in: path\r\n name: peer-id\r\n schema: *a4\r\n required: true\r\n description: Swarm address of peer\r\n - &a23\r\n in: header\r\n name: gas-price\r\n schema:\r\n type: integer\r\n required: false\r\n description: Gas price for transaction\r\n - in: header\r\n name: gas-limit\r\n schema:\r\n type: integer\r\n minimum: 0\r\n maximum: 18446744073709552000\r\n required: false\r\n description: Gas limit for transaction\r\n tags:\r\n - Chequebook\r\n responses:\r\n \"201\":\r\n description: OK\r\n content:\r\n application/json:\r\n schema:\r\n &a24\r\n type: object\r\n properties:\r\n transactionHash:\r\n type: string\r\n pattern: ^0x[A-Fa-f0-9]{64}$\r\n example: \"0x780cb6a37d1946978087896e1e489c37e30fe3e329510fff8d97360f73529f5a\"\r\n \"404\": *a6\r\n \"429\":\r\n &a31\r\n description: Too many requests\r\n content:\r\n application/problem+json:\r\n schema:\r\n type: object\r\n properties:\r\n message:\r\n type: string\r\n code:\r\n type: integer\r\n \"500\": *a2\r\n default:\r\n description: Default response\r\n \"/chequebook/cheque/{peer-id}\":\r\n get:\r\n summary: Get last cheques for the peer\r\n parameters:\r\n - in: path\r\n name: peer-id\r\n schema: *a4\r\n required: true\r\n description: Swarm address of peer\r\n tags:\r\n - Chequebook\r\n responses:\r\n \"200\":\r\n description: Last cheques\r\n content:\r\n application/json:\r\n schema:\r\n type: object\r\n properties:\r\n peer:\r\n type: string\r\n pattern: ^[A-Fa-f0-9]{64}$\r\n example: 36b7efd913ca4cf880b8eeac5093fa27b0825906c600685b6abdd6566e6cfe8f\r\n lastreceived:\r\n &a20\r\n type: object\r\n properties:\r\n beneficiary:\r\n &a19\r\n type: string\r\n pattern: ^[A-Fa-f0-9]{40}$\r\n example: 36b7efd913ca4cf880b8eeac5093fa27b0825906\r\n chequebook: *a19\r\n payout:\r\n description: Numeric string that represents integer which might exceeds\r\n `Number.MAX_SAFE_INTEGER` limit (2^53-1)\r\n type: string\r\n example: \"1000000000000000000\"\r\n lastsent: *a20\r\n \"404\": *a6\r\n \"500\": *a2\r\n default:\r\n description: Default response\r\n /chequebook/cheque:\r\n get:\r\n summary: Get last cheques for all peers\r\n tags:\r\n - Chequebook\r\n responses:\r\n \"200\":\r\n description: Last cheques\r\n content:\r\n application/json:\r\n schema:\r\n type: object\r\n properties:\r\n lastcheques:\r\n type: array\r\n nullable: true\r\n items:\r\n type: object\r\n properties:\r\n peer:\r\n type: string\r\n pattern: ^[A-Fa-f0-9]{64}$\r\n example: 36b7efd913ca4cf880b8eeac5093fa27b0825906c600685b6abdd6566e6cfe8f\r\n lastreceived:\r\n &a22\r\n type: object\r\n properties:\r\n beneficiary:\r\n &a21\r\n type: string\r\n pattern: ^[A-Fa-f0-9]{40}$\r\n example: 36b7efd913ca4cf880b8eeac5093fa27b0825906\r\n chequebook: *a21\r\n payout:\r\n description: Numeric string that represents integer which might exceeds\r\n `Number.MAX_SAFE_INTEGER` limit (2^53-1)\r\n type: string\r\n example: \"1000000000000000000\"\r\n lastsent: *a22\r\n \"404\": *a6\r\n \"500\": *a2\r\n default:\r\n description: Default response\r\n /chequebook/deposit:\r\n post:\r\n summary: Deposit tokens from overlay address into chequebook\r\n parameters:\r\n - in: query\r\n name: amount\r\n schema:\r\n type: integer\r\n required: true\r\n description: amount of tokens to deposit\r\n - *a23\r\n tags:\r\n - Chequebook\r\n responses:\r\n \"201\":\r\n description: Transaction hash of the deposit transaction\r\n content:\r\n application/json:\r\n schema: *a24\r\n \"400\": *a6\r\n \"500\": *a2\r\n default:\r\n description: Default response\r\n /chequebook/withdraw:\r\n post:\r\n summary: Withdraw tokens from the chequebook to the overlay address\r\n parameters:\r\n - in: query\r\n name: amount\r\n schema:\r\n type: integer\r\n required: true\r\n description: amount of tokens to withdraw\r\n - *a23\r\n tags:\r\n - Chequebook\r\n responses:\r\n \"201\":\r\n description: Transaction hash of the withdraw transaction\r\n content:\r\n application/json:\r\n schema: *a24\r\n \"400\": *a6\r\n \"500\": *a2\r\n default:\r\n description: Default response\r\n \"/tags/{uid}\":\r\n get:\r\n summary: Get Tag information using Uid\r\n tags:\r\n - Tag\r\n parameters:\r\n - in: path\r\n name: uid\r\n schema:\r\n type: integer\r\n required: true\r\n description: Uid\r\n responses:\r\n \"200\":\r\n description: Tag info\r\n content:\r\n application/json:\r\n schema:\r\n type: object\r\n properties:\r\n total:\r\n type: integer\r\n split:\r\n type: integer\r\n seen:\r\n type: integer\r\n stored:\r\n type: integer\r\n sent:\r\n type: integer\r\n synced:\r\n type: integer\r\n uid:\r\n type: integer\r\n address:\r\n type: string\r\n pattern: ^[A-Fa-f0-9]{64}$\r\n example: 36b7efd913ca4cf880b8eeac5093fa27b0825906c600685b6abdd6566e6cfe8f\r\n startedAt:\r\n type: string\r\n format: date-time\r\n example: 2020-06-11T11:26:42.6969797+02:00\r\n \"400\": *a9\r\n \"500\": *a2\r\n default:\r\n description: Default response\r\n /transactions:\r\n get:\r\n summary: Get list of pending transactions\r\n tags:\r\n - Transaction\r\n responses:\r\n \"200\":\r\n description: List of pending transactions\r\n content:\r\n application/json:\r\n schema:\r\n type: object\r\n properties:\r\n pendingTransactions:\r\n type: array\r\n nullable: true\r\n items:\r\n type: object\r\n properties:\r\n transactionHash:\r\n type: string\r\n pattern: ^0x[A-Fa-f0-9]{64}$\r\n example: \"0x780cb6a37d1946978087896e1e489c37e30fe3e329510fff8d97360f73529f5a\"\r\n to:\r\n type: string\r\n pattern: ^[A-Fa-f0-9]{40}$\r\n example: 36b7efd913ca4cf880b8eeac5093fa27b0825906\r\n nonce:\r\n type: integer\r\n gasPrice:\r\n &a25\r\n description: Numeric string that represents integer which might exceeds\r\n `Number.MAX_SAFE_INTEGER` limit (2^53-1)\r\n type: string\r\n example: \"1000000000000000000\"\r\n gasLimit:\r\n type: integer\r\n data:\r\n type: string\r\n created:\r\n type: string\r\n format: date-time\r\n example: 2020-06-11T11:26:42.6969797+02:00\r\n description:\r\n type: string\r\n value: *a25\r\n \"500\": *a2\r\n default:\r\n description: Default response\r\n \"/transactions/{txHash}\":\r\n get:\r\n summary: Get information about a sent transaction\r\n parameters:\r\n - in: path\r\n name: txHash\r\n schema:\r\n &a27\r\n type: string\r\n pattern: ^0x[A-Fa-f0-9]{64}$\r\n example: \"0x780cb6a37d1946978087896e1e489c37e30fe3e329510fff8d97360f73529f5a\"\r\n required: true\r\n description: Hash of the transaction\r\n tags:\r\n - Transaction\r\n responses:\r\n \"200\":\r\n description: Get info about transaction\r\n content:\r\n application/json:\r\n schema:\r\n type: object\r\n properties:\r\n transactionHash:\r\n type: string\r\n pattern: ^0x[A-Fa-f0-9]{64}$\r\n example: \"0x780cb6a37d1946978087896e1e489c37e30fe3e329510fff8d97360f73529f5a\"\r\n to:\r\n type: string\r\n pattern: ^[A-Fa-f0-9]{40}$\r\n example: 36b7efd913ca4cf880b8eeac5093fa27b0825906\r\n nonce:\r\n type: integer\r\n gasPrice:\r\n &a26\r\n description: Numeric string that represents integer which might exceeds\r\n `Number.MAX_SAFE_INTEGER` limit (2^53-1)\r\n type: string\r\n example: \"1000000000000000000\"\r\n gasLimit:\r\n type: integer\r\n data:\r\n type: string\r\n created:\r\n type: string\r\n format: date-time\r\n example: 2020-06-11T11:26:42.6969797+02:00\r\n description:\r\n type: string\r\n value: *a26\r\n \"404\": *a6\r\n \"500\": *a2\r\n default:\r\n description: Default response\r\n post:\r\n summary: Rebroadcast existing transaction\r\n parameters:\r\n - in: path\r\n name: txHash\r\n schema: *a27\r\n required: true\r\n description: Hash of the transaction\r\n tags:\r\n - Transaction\r\n responses:\r\n \"200\":\r\n description: Hash of the transaction\r\n content:\r\n application/json:\r\n schema: *a24\r\n \"404\": *a6\r\n \"500\": *a2\r\n default:\r\n description: Default response\r\n delete:\r\n summary: Cancel existing transaction\r\n parameters:\r\n - in: path\r\n name: txHash\r\n schema: *a27\r\n required: true\r\n description: Hash of the transaction\r\n - *a23\r\n tags:\r\n - Transaction\r\n responses:\r\n \"200\":\r\n description: Hash of the transaction\r\n content:\r\n application/json:\r\n schema: *a24\r\n \"404\": *a6\r\n \"500\": *a2\r\n default:\r\n description: Default response\r\n /stamps:\r\n get:\r\n summary: Get all available stamps for this node\r\n tags:\r\n - Postage Stamps\r\n responses:\r\n \"200\":\r\n description: Returns an array of all available postage batches.\r\n content:\r\n application/json:\r\n schema:\r\n type: object\r\n properties:\r\n stamps:\r\n type: array\r\n nullable: true\r\n items:\r\n anyOf:\r\n - type: object\r\n properties:\r\n batchID:\r\n &a28\r\n type: string\r\n pattern: ^[A-Fa-f0-9]{64}$\r\n example: 36b7efd913ca4cf880b8eeac5093fa27b0825906c600685b6abdd6566e6cfe8f\r\n utilization:\r\n type: integer\r\n usable:\r\n description: Indicate that the batch was discovered by the Bee node, but it\r\n awaits enough on-chain confirmations before\r\n declaring the batch as usable.\r\n type: boolean\r\n label:\r\n type: string\r\n depth:\r\n type: integer\r\n amount:\r\n description: Numeric string that represents integer which might exceeds\r\n `Number.MAX_SAFE_INTEGER` limit (2^53-1)\r\n type: string\r\n example: \"1000000000000000000\"\r\n bucketDepth:\r\n type: integer\r\n blockNumber:\r\n type: integer\r\n immutableFlag:\r\n type: boolean\r\n exists:\r\n type: boolean\r\n batchTTL:\r\n type: integer\r\n - type: object\r\n properties:\r\n batchID: *a28\r\n exists:\r\n type: boolean\r\n batchTTL:\r\n type: integer\r\n default:\r\n description: Default response\r\n \"/stamps/{id}\":\r\n parameters:\r\n - in: path\r\n name: id\r\n schema:\r\n &a30\r\n type: string\r\n pattern: ^[A-Fa-f0-9]{64}$\r\n example: 36b7efd913ca4cf880b8eeac5093fa27b0825906c600685b6abdd6566e6cfe8f\r\n required: true\r\n description: Swarm address of the stamp\r\n get:\r\n summary: Get an individual postage batch status\r\n tags:\r\n - Postage Stamps\r\n responses:\r\n \"200\":\r\n description: Returns an individual postage batch state\r\n content:\r\n application/json:\r\n schema:\r\n anyOf:\r\n - type: object\r\n properties:\r\n batchID:\r\n &a29\r\n type: string\r\n pattern: ^[A-Fa-f0-9]{64}$\r\n example: 36b7efd913ca4cf880b8eeac5093fa27b0825906c600685b6abdd6566e6cfe8f\r\n utilization:\r\n type: integer\r\n usable:\r\n description: Indicate that the batch was discovered by the Bee node, but it\r\n awaits enough on-chain confirmations before declaring\r\n the batch as usable.\r\n type: boolean\r\n label:\r\n type: string\r\n depth:\r\n type: integer\r\n amount:\r\n description: Numeric string that represents integer which might exceeds\r\n `Number.MAX_SAFE_INTEGER` limit (2^53-1)\r\n type: string\r\n example: \"1000000000000000000\"\r\n bucketDepth:\r\n type: integer\r\n blockNumber:\r\n type: integer\r\n immutableFlag:\r\n type: boolean\r\n exists:\r\n type: boolean\r\n batchTTL:\r\n type: integer\r\n - type: object\r\n properties:\r\n batchID: *a29\r\n exists:\r\n type: boolean\r\n batchTTL:\r\n type: integer\r\n \"400\": *a9\r\n default:\r\n description: Default response\r\n \"/stamps/{id}/buckets\":\r\n parameters:\r\n - in: path\r\n name: id\r\n schema: *a30\r\n required: true\r\n description: Swarm address of the stamp\r\n get:\r\n summary: Get extended bucket data of a batch\r\n tags:\r\n - Postage Stamps\r\n responses:\r\n \"200\":\r\n description: Returns extended bucket data of the provided batch ID\r\n content:\r\n application/json:\r\n schema:\r\n type: object\r\n properties:\r\n depth:\r\n type: integer\r\n bucketDepth:\r\n type: integer\r\n bucketUpperBound:\r\n type: integer\r\n buckets:\r\n type: array\r\n nullable: true\r\n items:\r\n type: object\r\n properties:\r\n bucketID:\r\n type: integer\r\n collisions:\r\n type: integer\r\n \"400\": *a9\r\n default:\r\n description: Default response\r\n \"/stamps/{amount}/{depth}\":\r\n post:\r\n summary: Buy a new postage batch.\r\n description: Be aware, this endpoint creates an on-chain transactions and\r\n transfers BZZ from the node's Ethereum account and hence directly\r\n manipulates the wallet balance!\r\n tags:\r\n - Postage Stamps\r\n parameters:\r\n - in: path\r\n name: amount\r\n schema:\r\n type: integer\r\n required: true\r\n description: Amount of BZZ added that the postage batch will have.\r\n - in: path\r\n name: depth\r\n schema:\r\n type: integer\r\n required: true\r\n description: Batch depth which specifies how many chunks can be signed with the\r\n batch. It is a logarithm. Must be higher than default bucket depth\r\n (16)\r\n - in: query\r\n name: label\r\n schema:\r\n type: string\r\n required: false\r\n description: An optional label for this batch\r\n - in: header\r\n name: immutable\r\n schema:\r\n type: boolean\r\n required: false\r\n - *a23\r\n responses:\r\n \"201\":\r\n description: Returns the newly created postage batch ID\r\n content:\r\n application/json:\r\n schema:\r\n &a32\r\n type: object\r\n properties:\r\n batchID:\r\n type: string\r\n pattern: ^[A-Fa-f0-9]{64}$\r\n example: 36b7efd913ca4cf880b8eeac5093fa27b0825906c600685b6abdd6566e6cfe8f\r\n \"400\": *a9\r\n \"429\": *a31\r\n \"500\": *a2\r\n default:\r\n description: Default response\r\n \"/stamps/topup/{id}/{amount}\":\r\n patch:\r\n summary: Top up an existing postage batch.\r\n description: Be aware, this endpoint creates on-chain transactions and transfers\r\n BZZ from the node's Ethereum account and hence directly manipulates the\r\n wallet balance!\r\n tags:\r\n - Postage Stamps\r\n parameters:\r\n - in: path\r\n name: id\r\n schema: *a30\r\n required: true\r\n description: Batch ID to top up\r\n - in: path\r\n name: amount\r\n schema:\r\n type: integer\r\n required: true\r\n description: Amount of BZZ per chunk to top up to an existing postage batch.\r\n responses:\r\n \"202\":\r\n description: Returns the postage batch ID that was topped up\r\n content:\r\n application/json:\r\n schema: *a32\r\n \"400\": *a9\r\n \"402\":\r\n description: Payment Required\r\n content:\r\n application/problem+json:\r\n schema:\r\n type: object\r\n properties:\r\n message:\r\n type: string\r\n code:\r\n type: integer\r\n \"429\": *a31\r\n \"500\": *a2\r\n default:\r\n description: Default response\r\n \"/stamps/dilute/{id}/{depth}\":\r\n patch:\r\n summary: Dilute an existing postage batch.\r\n description: Be aware, this endpoint creates on-chain transactions and transfers\r\n BZZ from the node's Ethereum account and hence directly manipulates the\r\n wallet balance!\r\n tags:\r\n - Postage Stamps\r\n parameters:\r\n - in: path\r\n name: id\r\n schema: *a30\r\n required: true\r\n description: Batch ID to dilute\r\n - in: path\r\n name: depth\r\n schema:\r\n type: integer\r\n required: true\r\n description: New batch depth. Must be higher than the previous depth.\r\n responses:\r\n \"202\":\r\n description: Returns the postage batch ID that was diluted.\r\n content:\r\n application/json:\r\n schema: *a32\r\n \"400\": *a9\r\n \"429\": *a31\r\n \"500\": *a2\r\n default:\r\n description: Default response\r\n /batches:\r\n get:\r\n summary: Get all globally available batches that were purchased by all nodes.\r\n tags:\r\n - Postage Stamps\r\n responses:\r\n \"200\":\r\n description: Returns an array of all available and currently valid postage\r\n batches.\r\n content:\r\n application/json:\r\n schema:\r\n type: object\r\n properties:\r\n stamps:\r\n type: array\r\n nullable: true\r\n items:\r\n type: object\r\n properties:\r\n batchID:\r\n type: string\r\n pattern: ^[A-Fa-f0-9]{64}$\r\n example: 36b7efd913ca4cf880b8eeac5093fa27b0825906c600685b6abdd6566e6cfe8f\r\n depth:\r\n type: integer\r\n value:\r\n description: Numeric string that represents integer which might exceeds\r\n `Number.MAX_SAFE_INTEGER` limit (2^53-1)\r\n type: string\r\n example: \"1000000000000000000\"\r\n bucketDepth:\r\n type: integer\r\n blockNumber:\r\n type: integer\r\n immutableFlag:\r\n type: boolean\r\n batchTTL:\r\n type: integer\r\n owner:\r\n type: string\r\n pattern: ^[A-Fa-f0-9]{40}$\r\n example: 36b7efd913ca4cf880b8eeac5093fa27b0825906\r\n default:\r\n description: Default response\r\n", + "json": "openapi: 3.0.3\r\ninfo:\r\n version: 2.0.0\r\n title: Bee Debug API\r\n description: A list of the currently provided debug interfaces to interact with\r\n the bee node\r\nsecurity:\r\n - {}\r\nexternalDocs:\r\n description: Browse the documentation @ the Swarm Docs\r\n url: https://docs.ethswarm.org\r\nservers:\r\n - url: http://{apiRoot}:{port}\r\n variables:\r\n apiRoot:\r\n default: localhost\r\n description: Base address of the local bee node debug API\r\n port:\r\n default: \"1635\"\r\n description: Service port provided in bee node config\r\npaths:\r\n /addresses:\r\n get:\r\n summary: Get overlay and underlay addresses of the node\r\n tags:\r\n - Connectivity\r\n responses:\r\n \"200\":\r\n description: Own node underlay and overlay addresses\r\n content:\r\n application/json:\r\n schema:\r\n type: object\r\n properties:\r\n overlay:\r\n type: string\r\n pattern: ^[A-Fa-f0-9]{64}$\r\n example: 36b7efd913ca4cf880b8eeac5093fa27b0825906c600685b6abdd6566e6cfe8f\r\n underlay:\r\n type: array\r\n items:\r\n type: string\r\n example: /ip4/127.0.0.1/tcp/1634/p2p/16Uiu2HAmTm17toLDaPYzRyjKn27iCB76yjKnJ5DjQXneFmifFvaX\r\n ethereum:\r\n type: string\r\n pattern: ^[A-Fa-f0-9]{40}$\r\n example: 36b7efd913ca4cf880b8eeac5093fa27b0825906\r\n publicKey:\r\n &a1\r\n type: string\r\n pattern: ^[A-Fa-f0-9]{66}$\r\n example: 02ab7473879005929d10ce7d4f626412dad9fe56b0a6622038931d26bd79abf0a4\r\n pssPublicKey: *a1\r\n \"500\":\r\n &a2\r\n description: Internal Server Error\r\n content:\r\n application/problem+json:\r\n schema:\r\n type: object\r\n properties:\r\n message:\r\n type: string\r\n code:\r\n type: integer\r\n default:\r\n description: Default response\r\n /balances:\r\n get:\r\n summary: Get the balances with all known peers including prepaid services\r\n tags:\r\n - Balance\r\n responses:\r\n \"200\":\r\n description: Own balances with all known peers\r\n content:\r\n application/json:\r\n schema:\r\n &a3\r\n type: object\r\n properties:\r\n balances:\r\n type: array\r\n items:\r\n type: object\r\n properties:\r\n peer:\r\n type: string\r\n pattern: ^[A-Fa-f0-9]{64}$\r\n example: 36b7efd913ca4cf880b8eeac5093fa27b0825906c600685b6abdd6566e6cfe8f\r\n balance:\r\n description: Numeric string that represents integer which might exceeds\r\n `Number.MAX_SAFE_INTEGER` limit (2^53-1)\r\n type: string\r\n example: \"1000000000000000000\"\r\n \"500\": *a2\r\n default:\r\n description: Default response\r\n \"/balances/{address}\":\r\n get:\r\n summary: Get the balances with a specific peer including prepaid services\r\n tags:\r\n - Balance\r\n parameters:\r\n - in: path\r\n name: address\r\n schema:\r\n &a4\r\n type: string\r\n pattern: ^[A-Fa-f0-9]{64}$\r\n example: 36b7efd913ca4cf880b8eeac5093fa27b0825906c600685b6abdd6566e6cfe8f\r\n required: true\r\n description: Swarm address of peer\r\n responses:\r\n \"200\":\r\n description: Balance with the specific peer\r\n content:\r\n application/json:\r\n schema:\r\n &a5\r\n type: object\r\n properties:\r\n peer:\r\n type: string\r\n pattern: ^[A-Fa-f0-9]{64}$\r\n example: 36b7efd913ca4cf880b8eeac5093fa27b0825906c600685b6abdd6566e6cfe8f\r\n balance:\r\n description: Numeric string that represents integer which might exceeds\r\n `Number.MAX_SAFE_INTEGER` limit (2^53-1)\r\n type: string\r\n example: \"1000000000000000000\"\r\n \"404\":\r\n &a6\r\n description: Not Found\r\n content:\r\n application/problem+json:\r\n schema:\r\n type: object\r\n properties:\r\n message:\r\n type: string\r\n code:\r\n type: integer\r\n \"500\": *a2\r\n default:\r\n description: Default response\r\n /blocklist:\r\n get:\r\n summary: Get a list of blocklisted peers\r\n tags:\r\n - Connectivity\r\n responses:\r\n \"200\":\r\n description: Returns overlay addresses of blocklisted peers\r\n content:\r\n application/json:\r\n schema:\r\n &a11\r\n type: object\r\n properties:\r\n peers:\r\n type: array\r\n nullable: false\r\n items:\r\n type: object\r\n properties:\r\n address:\r\n type: string\r\n pattern: ^[A-Fa-f0-9]{64}$\r\n example: 36b7efd913ca4cf880b8eeac5093fa27b0825906c600685b6abdd6566e6cfe8f\r\n \"500\": *a2\r\n default:\r\n description: Default response\r\n /consumed:\r\n get:\r\n summary: Get the past due consumption balances with all known peers\r\n tags:\r\n - Balance\r\n responses:\r\n \"200\":\r\n description: Own past due consumption balances with all known peers\r\n content:\r\n application/json:\r\n schema: *a3\r\n \"500\": *a2\r\n default:\r\n description: Default response\r\n \"/consumed/{address}\":\r\n get:\r\n summary: Get the past due consumption balance with a specific peer\r\n tags:\r\n - Balance\r\n parameters:\r\n - in: path\r\n name: address\r\n schema: *a4\r\n required: true\r\n description: Swarm address of peer\r\n responses:\r\n \"200\":\r\n description: Past-due consumption balance with the specific peer\r\n content:\r\n application/json:\r\n schema: *a5\r\n \"404\": *a6\r\n \"500\": *a2\r\n default:\r\n description: Default response\r\n /chequebook/address:\r\n get:\r\n summary: Get the address of the chequebook contract used\r\n tags:\r\n - Chequebook\r\n responses:\r\n \"200\":\r\n description: Ethereum address of chequebook contract\r\n content:\r\n application/json:\r\n schema:\r\n type: object\r\n properties:\r\n chequebookAddress:\r\n type: string\r\n pattern: ^[A-Fa-f0-9]{40}$\r\n example: 36b7efd913ca4cf880b8eeac5093fa27b0825906\r\n /chequebook/balance:\r\n get:\r\n summary: Get the balance of the chequebook\r\n tags:\r\n - Chequebook\r\n responses:\r\n \"200\":\r\n description: Balance of the chequebook\r\n content:\r\n application/json:\r\n schema:\r\n type: object\r\n properties:\r\n totalBalance:\r\n &a7\r\n description: Numeric string that represents integer which might exceeds\r\n `Number.MAX_SAFE_INTEGER` limit (2^53-1)\r\n type: string\r\n example: \"1000000000000000000\"\r\n availableBalance: *a7\r\n \"500\": *a2\r\n default:\r\n description: Default response\r\n \"/chunks/{address}\":\r\n get:\r\n summary: Check if chunk at address exists locally\r\n tags:\r\n - Chunk\r\n parameters:\r\n - in: path\r\n name: address\r\n schema: *a4\r\n required: true\r\n description: Swarm address of chunk\r\n responses:\r\n \"200\":\r\n description: Chunk exists\r\n content:\r\n application/json:\r\n schema:\r\n &a8\r\n type: object\r\n properties:\r\n message:\r\n type: string\r\n code:\r\n type: integer\r\n \"400\":\r\n &a9\r\n description: Bad request\r\n content:\r\n application/problem+json:\r\n schema:\r\n type: object\r\n properties:\r\n message:\r\n type: string\r\n code:\r\n type: integer\r\n \"404\": *a6\r\n default:\r\n description: Default response\r\n delete:\r\n summary: Delete a chunk from local storage\r\n tags:\r\n - Chunk\r\n parameters:\r\n - in: path\r\n name: address\r\n schema: *a4\r\n required: true\r\n description: Swarm address of chunk\r\n responses:\r\n \"200\":\r\n description: Chunk exists\r\n content:\r\n application/json:\r\n schema: *a8\r\n \"400\": *a9\r\n \"404\": *a6\r\n default:\r\n description: Default response\r\n \"/connect/{multiAddress}\":\r\n post:\r\n summary: Connect to address\r\n tags:\r\n - Connectivity\r\n parameters:\r\n - in: path\r\n allowReserved: true\r\n name: multiAddress\r\n schema:\r\n type: string\r\n required: true\r\n description: Underlay address of peer\r\n responses:\r\n \"200\":\r\n description: Returns overlay address of connected peer\r\n content:\r\n application/json:\r\n schema:\r\n type: object\r\n properties:\r\n address:\r\n type: string\r\n pattern: ^[A-Fa-f0-9]{64}$\r\n example: 36b7efd913ca4cf880b8eeac5093fa27b0825906c600685b6abdd6566e6cfe8f\r\n \"400\": *a9\r\n \"500\": *a2\r\n default:\r\n description: Default response\r\n /reservestate:\r\n get:\r\n summary: Get reserve state\r\n tags:\r\n - Status\r\n responses:\r\n \"200\":\r\n description: Reserve State\r\n content:\r\n application/json:\r\n schema:\r\n type: object\r\n properties:\r\n radius:\r\n type: integer\r\n available:\r\n type: integer\r\n outer:\r\n &a10\r\n description: Numeric string that represents integer which might exceeds\r\n `Number.MAX_SAFE_INTEGER` limit (2^53-1)\r\n type: string\r\n example: \"1000000000000000000\"\r\n inner: *a10\r\n default:\r\n description: Default response\r\n /chainstate:\r\n get:\r\n summary: Get chain state\r\n tags:\r\n - Status\r\n responses:\r\n \"200\":\r\n description: Chain State\r\n content:\r\n application/json:\r\n schema:\r\n type: object\r\n properties:\r\n block:\r\n type: integer\r\n totalAmount:\r\n type: integer\r\n currentPrice:\r\n type: integer\r\n default:\r\n description: Default response\r\n /node:\r\n get:\r\n summary: Get information about the node\r\n tags:\r\n - Status\r\n responses:\r\n \"200\":\r\n description: Information about the node\r\n content:\r\n application/json:\r\n schema:\r\n type: object\r\n properties:\r\n beeMode:\r\n type: string\r\n enum:\r\n - light\r\n - full\r\n - dev\r\n description: >\r\n Gives back in what mode the Bee client has been started.\r\n The modes are mutually exclusive * `light` - light node;\r\n does not participate in forwarding or storing chunks *\r\n `full` - full node * `dev` - development mode; Bee client\r\n for development purposes, blockchain operations are mocked\r\n gatewayMode:\r\n type: boolean\r\n chequebookEnabled:\r\n type: boolean\r\n swapEnabled:\r\n type: boolean\r\n default:\r\n description: Default response\r\n /health:\r\n get:\r\n summary: Get health of node\r\n tags:\r\n - Status\r\n responses:\r\n \"200\":\r\n description: Health State of node\r\n content:\r\n application/json:\r\n schema:\r\n &a12\r\n type: object\r\n properties:\r\n status:\r\n type: string\r\n version:\r\n type: string\r\n apiVersion:\r\n type: string\r\n default: 0.0.0\r\n description: The default value is set in case the bee binary was not build\r\n correctly.\r\n debugApiVersion:\r\n type: string\r\n default: 0.0.0\r\n description: The default value is set in case the bee binary was not build\r\n correctly.\r\n default:\r\n description: Default response\r\n /peers:\r\n get:\r\n summary: Get a list of peers\r\n tags:\r\n - Connectivity\r\n responses:\r\n \"200\":\r\n description: Returns overlay addresses of connected peers\r\n content:\r\n application/json:\r\n schema: *a11\r\n default:\r\n description: Default response\r\n \"/peers/{address}\":\r\n delete:\r\n summary: Remove peer\r\n tags:\r\n - Connectivity\r\n parameters:\r\n - in: path\r\n name: address\r\n schema: *a4\r\n required: true\r\n description: Swarm address of peer\r\n responses:\r\n \"200\":\r\n description: Disconnected peer\r\n content:\r\n application/json:\r\n schema: *a8\r\n \"400\": *a9\r\n \"500\": *a2\r\n default:\r\n description: Default response\r\n \"/pingpong/{peer-id}\":\r\n post:\r\n summary: Try connection to node\r\n tags:\r\n - Connectivity\r\n parameters:\r\n - in: path\r\n name: peer-id\r\n schema: *a4\r\n required: true\r\n description: Swarm address of peer\r\n responses:\r\n \"200\":\r\n description: Returns round trip time for given peer\r\n content:\r\n application/json:\r\n schema:\r\n type: object\r\n properties:\r\n rtt:\r\n description: Go time.Duration format\r\n type: string\r\n example: 5.0018ms\r\n \"400\": *a9\r\n \"404\": *a6\r\n \"500\": *a2\r\n default:\r\n description: Default response\r\n /readiness:\r\n get:\r\n summary: Get readiness state of node\r\n tags:\r\n - Status\r\n responses:\r\n \"200\":\r\n description: Health State of node\r\n content:\r\n application/json:\r\n schema: *a12\r\n default:\r\n description: Default response\r\n \"/settlements/{address}\":\r\n get:\r\n summary: Get amount of sent and received from settlements with a peer\r\n tags:\r\n - Settlements\r\n parameters:\r\n - in: path\r\n name: address\r\n schema: *a4\r\n required: true\r\n description: Swarm address of peer\r\n responses:\r\n \"200\":\r\n description: Amount of sent or received from settlements with a peer\r\n content:\r\n application/json:\r\n schema:\r\n type: object\r\n properties:\r\n peer:\r\n type: string\r\n pattern: ^[A-Fa-f0-9]{64}$\r\n example: 36b7efd913ca4cf880b8eeac5093fa27b0825906c600685b6abdd6566e6cfe8f\r\n received:\r\n type: integer\r\n sent:\r\n type: integer\r\n \"404\": *a6\r\n \"500\": *a2\r\n default:\r\n description: Default response\r\n /settlements:\r\n get:\r\n summary: Get settlements with all known peers and total amount sent or received\r\n tags:\r\n - Settlements\r\n responses:\r\n \"200\":\r\n description: Settlements with all known peers and total amount sent or received\r\n content:\r\n application/json:\r\n schema:\r\n &a13\r\n type: object\r\n properties:\r\n totalReceived:\r\n type: integer\r\n totalSent:\r\n type: integer\r\n settlements:\r\n type: array\r\n nullable: false\r\n items:\r\n type: object\r\n properties:\r\n peer:\r\n type: string\r\n pattern: ^[A-Fa-f0-9]{64}$\r\n example: 36b7efd913ca4cf880b8eeac5093fa27b0825906c600685b6abdd6566e6cfe8f\r\n received:\r\n type: integer\r\n sent:\r\n type: integer\r\n \"500\": *a2\r\n default:\r\n description: Default response\r\n /timesettlements:\r\n get:\r\n summary: Get time based settlements with all known peers and total amount sent\r\n or received\r\n tags:\r\n - Settlements\r\n responses:\r\n \"200\":\r\n description: Time based settlements with all known peers and total amount sent\r\n or received\r\n content:\r\n application/json:\r\n schema: *a13\r\n \"500\": *a2\r\n default:\r\n description: Default response\r\n /topology:\r\n get:\r\n description: Get topology of known network\r\n tags:\r\n - Connectivity\r\n responses:\r\n \"200\":\r\n description: Swarm topology of the bee node\r\n content:\r\n application/json:\r\n schema:\r\n type: object\r\n properties:\r\n baseAddr:\r\n &a14\r\n type: string\r\n pattern: ^[A-Fa-f0-9]{64}$\r\n example: 36b7efd913ca4cf880b8eeac5093fa27b0825906c600685b6abdd6566e6cfe8f\r\n population:\r\n type: integer\r\n connected:\r\n type: integer\r\n timestamp:\r\n type: string\r\n nnLowWatermark:\r\n type: integer\r\n depth:\r\n type: integer\r\n bins:\r\n type: object\r\n additionalProperties:\r\n type: object\r\n properties:\r\n population:\r\n type: integer\r\n connected:\r\n type: integer\r\n disconnectedPeers:\r\n type: array\r\n items:\r\n type: object\r\n properties:\r\n address: *a14\r\n metrics:\r\n &a15\r\n type: object\r\n properties:\r\n lastSeenTimestamp:\r\n type: integer\r\n nullable: false\r\n sessionConnectionRetry:\r\n type: integer\r\n nullable: false\r\n connectionTotalDuration:\r\n type: number\r\n nullable: false\r\n sessionConnectionDuration:\r\n type: number\r\n nullable: false\r\n sessionConnectionDirection:\r\n type: string\r\n nullable: false\r\n latencyEWMA:\r\n type: integer\r\n nullable: false\r\n connectedPeers:\r\n type: array\r\n items:\r\n type: object\r\n properties:\r\n address: *a14\r\n metrics: *a15\r\n /welcome-message:\r\n get:\r\n summary: Get configured P2P welcome message\r\n tags:\r\n - Connectivity\r\n responses:\r\n \"200\":\r\n description: Welcome message\r\n content:\r\n application/json:\r\n schema:\r\n &a16\r\n type: object\r\n properties:\r\n welcomeMessage:\r\n type: string\r\n \"500\": *a2\r\n default:\r\n description: Default response\r\n post:\r\n summary: Set P2P welcome message\r\n tags:\r\n - Connectivity\r\n requestBody:\r\n content:\r\n application/json:\r\n schema: *a16\r\n responses:\r\n \"200\":\r\n description: OK\r\n content:\r\n application/json:\r\n schema: *a12\r\n \"400\": *a9\r\n \"500\": *a2\r\n default:\r\n description: Default response\r\n \"/chequebook/cashout/{peer-id}\":\r\n get:\r\n summary: Get last cashout action for the peer\r\n parameters:\r\n - in: path\r\n name: peer-id\r\n schema: *a4\r\n required: true\r\n description: Swarm address of peer\r\n tags:\r\n - Chequebook\r\n responses:\r\n \"200\":\r\n description: Cashout status\r\n content:\r\n application/json:\r\n schema:\r\n type: object\r\n properties:\r\n peer:\r\n type: string\r\n pattern: ^[A-Fa-f0-9]{64}$\r\n example: 36b7efd913ca4cf880b8eeac5093fa27b0825906c600685b6abdd6566e6cfe8f\r\n lastCashedCheque:\r\n type: object\r\n properties:\r\n beneficiary:\r\n &a17\r\n type: string\r\n pattern: ^[A-Fa-f0-9]{40}$\r\n example: 36b7efd913ca4cf880b8eeac5093fa27b0825906\r\n chequebook: *a17\r\n payout:\r\n &a18\r\n description: Numeric string that represents integer which might exceeds\r\n `Number.MAX_SAFE_INTEGER` limit (2^53-1)\r\n type: string\r\n example: \"1000000000000000000\"\r\n transactionHash:\r\n type: string\r\n pattern: ^0x[A-Fa-f0-9]{64}$\r\n example: \"0x780cb6a37d1946978087896e1e489c37e30fe3e329510fff8d97360f73529f5a\"\r\n result:\r\n type: object\r\n properties:\r\n recipient: *a17\r\n lastPayout: *a18\r\n bounced:\r\n type: boolean\r\n uncashedAmount: *a18\r\n \"404\": *a6\r\n \"500\": *a2\r\n default:\r\n description: Default response\r\n post:\r\n summary: Cashout the last cheque for the peer\r\n parameters:\r\n - in: path\r\n name: peer-id\r\n schema: *a4\r\n required: true\r\n description: Swarm address of peer\r\n - &a23\r\n in: header\r\n name: gas-price\r\n schema:\r\n type: integer\r\n format: int64\r\n required: false\r\n description: Gas price for transaction\r\n - in: header\r\n name: gas-limit\r\n schema:\r\n type: integer\r\n format: int64\r\n minimum: 0\r\n maximum: 18446744073709552000\r\n required: false\r\n description: Gas limit for transaction\r\n tags:\r\n - Chequebook\r\n responses:\r\n \"201\":\r\n description: OK\r\n content:\r\n application/json:\r\n schema:\r\n &a24\r\n type: object\r\n properties:\r\n transactionHash:\r\n type: string\r\n pattern: ^0x[A-Fa-f0-9]{64}$\r\n example: \"0x780cb6a37d1946978087896e1e489c37e30fe3e329510fff8d97360f73529f5a\"\r\n \"404\": *a6\r\n \"429\":\r\n &a31\r\n description: Too many requests\r\n content:\r\n application/problem+json:\r\n schema:\r\n type: object\r\n properties:\r\n message:\r\n type: string\r\n code:\r\n type: integer\r\n \"500\": *a2\r\n default:\r\n description: Default response\r\n \"/chequebook/cheque/{peer-id}\":\r\n get:\r\n summary: Get last cheques for the peer\r\n parameters:\r\n - in: path\r\n name: peer-id\r\n schema: *a4\r\n required: true\r\n description: Swarm address of peer\r\n tags:\r\n - Chequebook\r\n responses:\r\n \"200\":\r\n description: Last cheques\r\n content:\r\n application/json:\r\n schema:\r\n type: object\r\n properties:\r\n peer:\r\n type: string\r\n pattern: ^[A-Fa-f0-9]{64}$\r\n example: 36b7efd913ca4cf880b8eeac5093fa27b0825906c600685b6abdd6566e6cfe8f\r\n lastreceived:\r\n &a20\r\n type: object\r\n properties:\r\n beneficiary:\r\n &a19\r\n type: string\r\n pattern: ^[A-Fa-f0-9]{40}$\r\n example: 36b7efd913ca4cf880b8eeac5093fa27b0825906\r\n chequebook: *a19\r\n payout:\r\n description: Numeric string that represents integer which might exceeds\r\n `Number.MAX_SAFE_INTEGER` limit (2^53-1)\r\n type: string\r\n example: \"1000000000000000000\"\r\n lastsent: *a20\r\n \"404\": *a6\r\n \"500\": *a2\r\n default:\r\n description: Default response\r\n /chequebook/cheque:\r\n get:\r\n summary: Get last cheques for all peers\r\n tags:\r\n - Chequebook\r\n responses:\r\n \"200\":\r\n description: Last cheques\r\n content:\r\n application/json:\r\n schema:\r\n type: object\r\n properties:\r\n lastcheques:\r\n type: array\r\n nullable: false\r\n items:\r\n type: object\r\n properties:\r\n peer:\r\n type: string\r\n pattern: ^[A-Fa-f0-9]{64}$\r\n example: 36b7efd913ca4cf880b8eeac5093fa27b0825906c600685b6abdd6566e6cfe8f\r\n lastreceived:\r\n &a22\r\n type: object\r\n properties:\r\n beneficiary:\r\n &a21\r\n type: string\r\n pattern: ^[A-Fa-f0-9]{40}$\r\n example: 36b7efd913ca4cf880b8eeac5093fa27b0825906\r\n chequebook: *a21\r\n payout:\r\n description: Numeric string that represents integer which might exceeds\r\n `Number.MAX_SAFE_INTEGER` limit (2^53-1)\r\n type: string\r\n example: \"1000000000000000000\"\r\n lastsent: *a22\r\n \"404\": *a6\r\n \"500\": *a2\r\n default:\r\n description: Default response\r\n /chequebook/deposit:\r\n post:\r\n summary: Deposit tokens from overlay address into chequebook\r\n parameters:\r\n - in: query\r\n name: amount\r\n schema:\r\n type: integer\r\n format: int64\r\n required: true\r\n description: amount of tokens to deposit\r\n - *a23\r\n tags:\r\n - Chequebook\r\n responses:\r\n \"201\":\r\n description: Transaction hash of the deposit transaction\r\n content:\r\n application/json:\r\n schema: *a24\r\n \"400\": *a6\r\n \"500\": *a2\r\n default:\r\n description: Default response\r\n /chequebook/withdraw:\r\n post:\r\n summary: Withdraw tokens from the chequebook to the overlay address\r\n parameters:\r\n - in: query\r\n name: amount\r\n schema:\r\n type: integer\r\n format: int64\r\n required: true\r\n description: amount of tokens to withdraw\r\n - *a23\r\n tags:\r\n - Chequebook\r\n responses:\r\n \"201\":\r\n description: Transaction hash of the withdraw transaction\r\n content:\r\n application/json:\r\n schema: *a24\r\n \"400\": *a6\r\n \"500\": *a2\r\n default:\r\n description: Default response\r\n \"/tags/{uid}\":\r\n get:\r\n summary: Get Tag information using Uid\r\n tags:\r\n - Tag\r\n parameters:\r\n - in: path\r\n name: uid\r\n schema:\r\n type: integer\r\n required: true\r\n description: Uid\r\n responses:\r\n \"200\":\r\n description: Tag info\r\n content:\r\n application/json:\r\n schema:\r\n type: object\r\n properties:\r\n total:\r\n type: integer\r\n split:\r\n type: integer\r\n seen:\r\n type: integer\r\n stored:\r\n type: integer\r\n sent:\r\n type: integer\r\n synced:\r\n type: integer\r\n uid:\r\n type: integer\r\n address:\r\n type: string\r\n pattern: ^[A-Fa-f0-9]{64}$\r\n example: 36b7efd913ca4cf880b8eeac5093fa27b0825906c600685b6abdd6566e6cfe8f\r\n startedAt:\r\n type: string\r\n format: date-time\r\n example: 2020-06-11T11:26:42.6969797+02:00\r\n \"400\": *a9\r\n \"500\": *a2\r\n default:\r\n description: Default response\r\n /transactions:\r\n get:\r\n summary: Get list of pending transactions\r\n tags:\r\n - Transaction\r\n responses:\r\n \"200\":\r\n description: List of pending transactions\r\n content:\r\n application/json:\r\n schema:\r\n type: object\r\n properties:\r\n pendingTransactions:\r\n type: array\r\n nullable: false\r\n items:\r\n type: object\r\n properties:\r\n transactionHash:\r\n type: string\r\n pattern: ^0x[A-Fa-f0-9]{64}$\r\n example: \"0x780cb6a37d1946978087896e1e489c37e30fe3e329510fff8d97360f73529f5a\"\r\n to:\r\n type: string\r\n pattern: ^[A-Fa-f0-9]{40}$\r\n example: 36b7efd913ca4cf880b8eeac5093fa27b0825906\r\n nonce:\r\n type: integer\r\n gasPrice:\r\n &a25\r\n description: Numeric string that represents integer which might exceeds\r\n `Number.MAX_SAFE_INTEGER` limit (2^53-1)\r\n type: string\r\n example: \"1000000000000000000\"\r\n gasLimit:\r\n type: integer\r\n format: int64\r\n data:\r\n type: string\r\n created:\r\n type: string\r\n format: date-time\r\n example: 2020-06-11T11:26:42.6969797+02:00\r\n description:\r\n type: string\r\n value: *a25\r\n \"500\": *a2\r\n default:\r\n description: Default response\r\n \"/transactions/{txHash}\":\r\n get:\r\n summary: Get information about a sent transaction\r\n parameters:\r\n - in: path\r\n name: txHash\r\n schema:\r\n &a27\r\n type: string\r\n pattern: ^0x[A-Fa-f0-9]{64}$\r\n example: \"0x780cb6a37d1946978087896e1e489c37e30fe3e329510fff8d97360f73529f5a\"\r\n required: true\r\n description: Hash of the transaction\r\n tags:\r\n - Transaction\r\n responses:\r\n \"200\":\r\n description: Get info about transaction\r\n content:\r\n application/json:\r\n schema:\r\n type: object\r\n properties:\r\n transactionHash:\r\n type: string\r\n pattern: ^0x[A-Fa-f0-9]{64}$\r\n example: \"0x780cb6a37d1946978087896e1e489c37e30fe3e329510fff8d97360f73529f5a\"\r\n to:\r\n type: string\r\n pattern: ^[A-Fa-f0-9]{40}$\r\n example: 36b7efd913ca4cf880b8eeac5093fa27b0825906\r\n nonce:\r\n type: integer\r\n gasPrice:\r\n &a26\r\n description: Numeric string that represents integer which might exceeds\r\n `Number.MAX_SAFE_INTEGER` limit (2^53-1)\r\n type: string\r\n example: \"1000000000000000000\"\r\n gasLimit:\r\n type: integer\r\n format: int64\r\n data:\r\n type: string\r\n created:\r\n type: string\r\n format: date-time\r\n example: 2020-06-11T11:26:42.6969797+02:00\r\n description:\r\n type: string\r\n value: *a26\r\n \"404\": *a6\r\n \"500\": *a2\r\n default:\r\n description: Default response\r\n post:\r\n summary: Rebroadcast existing transaction\r\n parameters:\r\n - in: path\r\n name: txHash\r\n schema: *a27\r\n required: true\r\n description: Hash of the transaction\r\n tags:\r\n - Transaction\r\n responses:\r\n \"200\":\r\n description: Hash of the transaction\r\n content:\r\n application/json:\r\n schema: *a24\r\n \"404\": *a6\r\n \"500\": *a2\r\n default:\r\n description: Default response\r\n delete:\r\n summary: Cancel existing transaction\r\n parameters:\r\n - in: path\r\n name: txHash\r\n schema: *a27\r\n required: true\r\n description: Hash of the transaction\r\n - *a23\r\n tags:\r\n - Transaction\r\n responses:\r\n \"200\":\r\n description: Hash of the transaction\r\n content:\r\n application/json:\r\n schema: *a24\r\n \"404\": *a6\r\n \"500\": *a2\r\n default:\r\n description: Default response\r\n /stamps:\r\n get:\r\n summary: Get all available stamps for this node\r\n tags:\r\n - Postage Stamps\r\n responses:\r\n \"200\":\r\n description: Returns an array of all available postage batches.\r\n content:\r\n application/json:\r\n schema:\r\n type: object\r\n properties:\r\n stamps:\r\n type: array\r\n nullable: false\r\n items:\r\n anyOf:\r\n - type: object\r\n properties:\r\n batchID:\r\n &a28\r\n type: string\r\n pattern: ^[A-Fa-f0-9]{64}$\r\n example: 36b7efd913ca4cf880b8eeac5093fa27b0825906c600685b6abdd6566e6cfe8f\r\n utilization:\r\n type: integer\r\n usable:\r\n description: Indicate that the batch was discovered by the Bee node, but it\r\n awaits enough on-chain confirmations before\r\n declaring the batch as usable.\r\n type: boolean\r\n label:\r\n type: string\r\n depth:\r\n type: integer\r\n amount:\r\n description: Numeric string that represents integer which might exceeds\r\n `Number.MAX_SAFE_INTEGER` limit (2^53-1)\r\n type: string\r\n example: \"1000000000000000000\"\r\n bucketDepth:\r\n type: integer\r\n blockNumber:\r\n type: integer\r\n immutableFlag:\r\n type: boolean\r\n exists:\r\n type: boolean\r\n batchTTL:\r\n type: integer\r\n - type: object\r\n properties:\r\n batchID: *a28\r\n exists:\r\n type: boolean\r\n batchTTL:\r\n type: integer\r\n default:\r\n description: Default response\r\n \"/stamps/{id}\":\r\n parameters:\r\n - in: path\r\n name: id\r\n schema:\r\n &a30\r\n type: string\r\n pattern: ^[A-Fa-f0-9]{64}$\r\n example: 36b7efd913ca4cf880b8eeac5093fa27b0825906c600685b6abdd6566e6cfe8f\r\n required: true\r\n description: Swarm address of the stamp\r\n get:\r\n summary: Get an individual postage batch status\r\n tags:\r\n - Postage Stamps\r\n responses:\r\n \"200\":\r\n description: Returns an individual postage batch state\r\n content:\r\n application/json:\r\n schema:\r\n anyOf:\r\n - type: object\r\n properties:\r\n batchID:\r\n &a29\r\n type: string\r\n pattern: ^[A-Fa-f0-9]{64}$\r\n example: 36b7efd913ca4cf880b8eeac5093fa27b0825906c600685b6abdd6566e6cfe8f\r\n utilization:\r\n type: integer\r\n usable:\r\n description: Indicate that the batch was discovered by the Bee node, but it\r\n awaits enough on-chain confirmations before declaring\r\n the batch as usable.\r\n type: boolean\r\n label:\r\n type: string\r\n depth:\r\n type: integer\r\n amount:\r\n description: Numeric string that represents integer which might exceeds\r\n `Number.MAX_SAFE_INTEGER` limit (2^53-1)\r\n type: string\r\n example: \"1000000000000000000\"\r\n bucketDepth:\r\n type: integer\r\n blockNumber:\r\n type: integer\r\n immutableFlag:\r\n type: boolean\r\n exists:\r\n type: boolean\r\n batchTTL:\r\n type: integer\r\n - type: object\r\n properties:\r\n batchID: *a29\r\n exists:\r\n type: boolean\r\n batchTTL:\r\n type: integer\r\n \"400\": *a9\r\n default:\r\n description: Default response\r\n \"/stamps/{id}/buckets\":\r\n parameters:\r\n - in: path\r\n name: id\r\n schema: *a30\r\n required: true\r\n description: Swarm address of the stamp\r\n get:\r\n summary: Get extended bucket data of a batch\r\n tags:\r\n - Postage Stamps\r\n responses:\r\n \"200\":\r\n description: Returns extended bucket data of the provided batch ID\r\n content:\r\n application/json:\r\n schema:\r\n type: object\r\n properties:\r\n depth:\r\n type: integer\r\n bucketDepth:\r\n type: integer\r\n bucketUpperBound:\r\n type: integer\r\n buckets:\r\n type: array\r\n nullable: false\r\n items:\r\n type: object\r\n properties:\r\n bucketID:\r\n type: integer\r\n collisions:\r\n type: integer\r\n \"400\": *a9\r\n default:\r\n description: Default response\r\n \"/stamps/{amount}/{depth}\":\r\n post:\r\n summary: Buy a new postage batch.\r\n description: Be aware, this endpoint creates an on-chain transactions and\r\n transfers BZZ from the node's Ethereum account and hence directly\r\n manipulates the wallet balance!\r\n tags:\r\n - Postage Stamps\r\n parameters:\r\n - in: path\r\n name: amount\r\n schema:\r\n description: Numeric string that represents integer which might exceeds\r\n `Number.MAX_SAFE_INTEGER` limit (2^53-1)\r\n type: string\r\n example: \"1000000000000000000\"\r\n required: true\r\n description: Amount of BZZ added that the postage batch will have.\r\n - in: path\r\n name: depth\r\n schema:\r\n type: integer\r\n required: true\r\n description: Batch depth which specifies how many chunks can be signed with the\r\n batch. It is a logarithm. Must be higher than default bucket depth\r\n (16)\r\n - in: query\r\n name: label\r\n schema:\r\n type: string\r\n required: false\r\n description: An optional label for this batch\r\n - in: header\r\n name: immutable\r\n schema:\r\n type: boolean\r\n required: false\r\n - *a23\r\n responses:\r\n \"201\":\r\n description: Returns the newly created postage batch ID\r\n content:\r\n application/json:\r\n schema:\r\n &a32\r\n type: object\r\n properties:\r\n batchID:\r\n type: string\r\n pattern: ^[A-Fa-f0-9]{64}$\r\n example: 36b7efd913ca4cf880b8eeac5093fa27b0825906c600685b6abdd6566e6cfe8f\r\n \"400\": *a9\r\n \"429\": *a31\r\n \"500\": *a2\r\n default:\r\n description: Default response\r\n \"/stamps/topup/{id}/{amount}\":\r\n patch:\r\n summary: Top up an existing postage batch.\r\n description: Be aware, this endpoint creates on-chain transactions and transfers\r\n BZZ from the node's Ethereum account and hence directly manipulates the\r\n wallet balance!\r\n tags:\r\n - Postage Stamps\r\n parameters:\r\n - in: path\r\n name: id\r\n schema: *a30\r\n required: true\r\n description: Batch ID to top up\r\n - in: path\r\n name: amount\r\n schema:\r\n type: integer\r\n format: int64\r\n required: true\r\n description: Amount of BZZ per chunk to top up to an existing postage batch.\r\n responses:\r\n \"202\":\r\n description: Returns the postage batch ID that was topped up\r\n content:\r\n application/json:\r\n schema: *a32\r\n \"400\": *a9\r\n \"402\":\r\n description: Payment Required\r\n content:\r\n application/problem+json:\r\n schema:\r\n type: object\r\n properties:\r\n message:\r\n type: string\r\n code:\r\n type: integer\r\n \"429\": *a31\r\n \"500\": *a2\r\n default:\r\n description: Default response\r\n \"/stamps/dilute/{id}/{depth}\":\r\n patch:\r\n summary: Dilute an existing postage batch.\r\n description: Be aware, this endpoint creates on-chain transactions and transfers\r\n BZZ from the node's Ethereum account and hence directly manipulates the\r\n wallet balance!\r\n tags:\r\n - Postage Stamps\r\n parameters:\r\n - in: path\r\n name: id\r\n schema: *a30\r\n required: true\r\n description: Batch ID to dilute\r\n - in: path\r\n name: depth\r\n schema:\r\n type: integer\r\n required: true\r\n description: New batch depth. Must be higher than the previous depth.\r\n responses:\r\n \"202\":\r\n description: Returns the postage batch ID that was diluted.\r\n content:\r\n application/json:\r\n schema: *a32\r\n \"400\": *a9\r\n \"429\": *a31\r\n \"500\": *a2\r\n default:\r\n description: Default response\r\n /batches:\r\n get:\r\n summary: Get all globally available batches that were purchased by all nodes.\r\n tags:\r\n - Postage Stamps\r\n responses:\r\n \"200\":\r\n description: Returns an array of all available and currently valid postage\r\n batches.\r\n content:\r\n application/json:\r\n schema:\r\n type: object\r\n properties:\r\n batches:\r\n type: array\r\n nullable: false\r\n items:\r\n type: object\r\n properties:\r\n batchID:\r\n type: string\r\n pattern: ^[A-Fa-f0-9]{64}$\r\n example: 36b7efd913ca4cf880b8eeac5093fa27b0825906c600685b6abdd6566e6cfe8f\r\n depth:\r\n type: integer\r\n value:\r\n description: Numeric string that represents integer which might exceeds\r\n `Number.MAX_SAFE_INTEGER` limit (2^53-1)\r\n type: string\r\n example: \"1000000000000000000\"\r\n bucketDepth:\r\n type: integer\r\n blockNumber:\r\n type: integer\r\n immutableFlag:\r\n type: boolean\r\n batchTTL:\r\n type: integer\r\n owner:\r\n type: string\r\n pattern: ^[A-Fa-f0-9]{40}$\r\n example: 36b7efd913ca4cf880b8eeac5093fa27b0825906\r\n default:\r\n description: Default response\r\n", "url": "", "output": null, "newLineBehavior": "Auto" @@ -41,7 +41,7 @@ "useRequestAndResponseSerializationSettings": false, "serializeTypeInformation": false, "queryNullValue": "", - "className": "BeeDebugClient_1_2_1", + "className": "BeeDebugClient_2_0_0", "operationGenerationMode": "SingleClientFromPathSegments", "additionalNamespaceUsages": [ "Etherna.BeeNet.Exceptions" @@ -58,7 +58,7 @@ "wrapResponseMethods": [], "generateResponseClasses": true, "responseClass": "SwaggerResponse", - "namespace": "Etherna.BeeNet.Clients.DebugApi.V1_2_1", + "namespace": "Etherna.BeeNet.Clients.DebugApi.V2_0_0", "requiredPropertiesMustBeDefined": true, "dateType": "System.DateTimeOffset", "jsonConverters": null, @@ -95,7 +95,7 @@ "enumNameGeneratorType": null, "serviceHost": null, "serviceSchemes": null, - "output": "../src/BeeNet/Clients/DebugApi/V1_2_1/BeeDebugClient_1_2_1.cs", + "output": "../src/BeeNet/Clients/DebugApi/v2_0_0/BeeDebugClient_2_0_0.cs", "newLineBehavior": "Auto" } } diff --git a/tools/swarm-gateway-api.nswag b/tools/swarm-gateway-api.nswag index 32f2880f..3474fdc1 100644 --- a/tools/swarm-gateway-api.nswag +++ b/tools/swarm-gateway-api.nswag @@ -3,7 +3,7 @@ "defaultVariables": null, "documentGenerator": { "fromDocument": { - "json": "openapi: 3.0.3\ninfo:\n version: 2.0.0\n title: Bee API\n description: A list of the currently provided Interfaces to interact with the\n swarm, implementing file operations and sending messages\nsecurity:\n - {}\nexternalDocs:\n description: Browse the documentation @ the Swarm Docs\n url: https://docs.ethswarm.org\nservers:\n - url: http://{apiRoot}:{port}/v1\n variables:\n apiRoot:\n default: localhost\n description: Base address of the local bee node main API\n port:\n default: \"1633\"\n description: Service port provided in bee node config\n - url: http://{apiRoot}:{port}\n variables:\n apiRoot:\n default: localhost\n description: Base address of the local bee node main API\n port:\n default: \"1633\"\n description: Service port provided in bee node config\npaths:\n /auth:\n post:\n summary: Authenticate - This endpoint is experimental\n tags:\n - Auth\n security:\n - basicAuth: []\n requestBody:\n required: true\n content:\n application/json:\n schema:\n &a1\n type: object\n properties:\n role:\n type: string\n nullable: false\n expiry:\n type: integer\n nullable: false\n description: Expiration time in seconds\n responses:\n \"201\":\n description: Ok\n content:\n application/json:\n schema:\n &a2\n type: object\n properties:\n key:\n type: string\n nullable: false\n \"400\":\n &a3\n description: Bad request\n content:\n application/problem+json:\n schema:\n type: object\n properties:\n message:\n type: string\n code:\n type: integer\n \"401\":\n &a4\n description: Unauthorized\n content:\n application/problem+json:\n schema:\n type: object\n properties:\n message:\n type: string\n code:\n type: integer\n \"500\":\n &a5\n description: Internal Server Error\n content:\n application/problem+json:\n schema:\n type: object\n properties:\n message:\n type: string\n code:\n type: integer\n default:\n description: Default response\n /refresh:\n post:\n summary: Refresh the auth token - This endpoint is experimental\n tags:\n - Auth\n security:\n - bearerAuth: []\n requestBody:\n required: true\n content:\n application/json:\n schema: *a1\n responses:\n \"201\":\n description: Ok\n content:\n application/json:\n schema: *a2\n \"400\": *a3\n \"401\": *a4\n \"500\": *a5\n default:\n description: Default response\n /bytes:\n post:\n summary: Upload data\n tags:\n - Bytes\n parameters:\n - &a9\n in: header\n name: swarm-tag\n schema:\n &a6\n type: integer\n required: false\n description: Associate upload with an existing Tag UID\n - &a10\n in: header\n name: swarm-pin\n schema:\n type: boolean\n required: false\n description: >\n Represents if the uploaded data should be also locally pinned on the\n node.\n\n Warning! Not available for nodes that run in Gateway mode!\n - &a15\n in: header\n name: swarm-encrypt\n schema:\n type: boolean\n required: false\n description: |\n Represents the encrypting state of the file\n Warning! Not available for nodes that run in Gateway mode!\n - &a11\n in: header\n name: swarm-postage-batch-id\n description: ID of Postage Batch that is used to upload data with\n required: true\n schema:\n type: string\n pattern: ^[A-Fa-f0-9]{64}$\n example: 36b7efd913ca4cf880b8eeac5093fa27b0825906c600685b6abdd6566e6cfe8f\n - &a12\n in: header\n name: swarm-deferred-upload\n schema:\n type: boolean\n default: \"true\"\n required: false\n description: >\n Determines if the uploaded data should be sent to the network\n immediately or in a deferred fashion. By default the upload will be\n deferred.\n requestBody:\n content:\n application/octet-stream:\n schema:\n type: string\n format: binary\n responses:\n \"201\":\n description: Ok\n headers:\n swarm-tag:\n &a16\n description: Tag UID\n schema: *a6\n content:\n application/json:\n schema:\n &a17\n type: object\n properties:\n reference:\n oneOf:\n - type: string\n pattern: ^[A-Fa-f0-9]{64}$\n example: 36b7efd913ca4cf880b8eeac5093fa27b0825906c600685b6abdd6566e6cfe8f\n - type: string\n pattern: ^[A-Fa-f0-9]{128}$\n example: 36b7efd913ca4cf880b8eeac5093fa27b0825906c600685b6abdd6566e6cfe8f2d2810619d29b5dbefd5d74abce25d58b81b251baddb9c3871cf0d6967deaae2\n - type: string\n pattern: ^[A-Za-z0-9]+\\.[A-Za-z0-9]+$\n example: swarm.eth\n \"400\": *a3\n \"402\":\n &a13\n description: Payment Required\n content:\n application/problem+json:\n schema:\n type: object\n properties:\n message:\n type: string\n code:\n type: integer\n \"403\":\n &a14\n description: Endpoint or header (pinning or encryption headers) forbidden in\n Gateway mode\n content:\n application/problem+json:\n schema:\n type: object\n properties:\n message:\n type: string\n code:\n type: integer\n \"500\": *a5\n default:\n description: Default response\n \"/bytes/{reference}\":\n get:\n summary: Get referenced data\n tags:\n - Bytes\n parameters:\n - in: path\n name: reference\n schema:\n &a7\n oneOf:\n - type: string\n pattern: ^[A-Fa-f0-9]{64}$\n example: 36b7efd913ca4cf880b8eeac5093fa27b0825906c600685b6abdd6566e6cfe8f\n - type: string\n pattern: ^[A-Fa-f0-9]{128}$\n example: 36b7efd913ca4cf880b8eeac5093fa27b0825906c600685b6abdd6566e6cfe8f2d2810619d29b5dbefd5d74abce25d58b81b251baddb9c3871cf0d6967deaae2\n - type: string\n pattern: ^[A-Za-z0-9]+\\.[A-Za-z0-9]+$\n example: swarm.eth\n required: true\n description: Swarm address reference to content\n responses:\n \"200\":\n description: Retrieved content specified by reference\n content:\n application/octet-stream:\n schema:\n type: string\n format: binary\n \"404\":\n &a8\n description: Not Found\n content:\n application/problem+json:\n schema:\n type: object\n properties:\n message:\n type: string\n code:\n type: integer\n default:\n description: Default response\n \"/chunks/{reference}\":\n get:\n summary: Get Chunk\n tags:\n - Chunk\n parameters:\n - in: path\n name: reference\n schema: *a7\n required: true\n description: Swarm address of chunk\n - &a18\n in: query\n name: targets\n schema:\n type: string\n required: false\n description: Global pinning targets prefix\n responses:\n \"200\":\n description: Retrieved chunk content\n headers:\n swarm-recovery-targets:\n &a19\n description: The targets provided for recovery\n schema:\n type: string\n content:\n application/octet-stream:\n schema:\n type: string\n format: binary\n \"202\":\n description: chunk recovery initiated. retry after sometime.\n \"400\": *a3\n \"404\": *a8\n \"500\": *a5\n default:\n description: Default response\n /chunks:\n post:\n summary: Upload Chunk\n tags:\n - Chunk\n parameters:\n - *a9\n - *a10\n - *a11\n - *a12\n requestBody:\n description: Chunk binary data that has to have at least 8 bytes.\n content:\n application/octet-stream:\n schema:\n type: string\n format: binary\n responses:\n \"201\":\n description: Ok\n headers:\n swarm-tag:\n description: Tag UID if it was passed to the request `swarm-tag` header.\n schema: *a6\n content:\n application/json:\n schema:\n &a21\n type: object\n properties:\n status:\n type: string\n version:\n type: string\n apiVersion:\n type: string\n default: 0.0.0\n description: The default value is set in case the bee binary was not build\n correctly.\n debugApiVersion:\n type: string\n default: 0.0.0\n description: The default value is set in case the bee binary was not build\n correctly.\n \"400\": *a3\n \"402\": *a13\n \"403\": *a14\n \"500\": *a5\n default:\n description: Default response\n /chunks/stream:\n get:\n summary: Upload stream of chunks\n tags:\n - Chunk\n parameters:\n - *a9\n - *a10\n - *a11\n responses:\n \"200\":\n description: Returns a Websocket connection on which stream of chunks can be\n uploaded. Each chunk sent is acknowledged using a binary response\n `0` which serves as confirmation of upload of single chunk. Chunks\n should be packaged as binary messages for uploading.\n \"400\": *a3\n default:\n description: Default response\n /bzz:\n post:\n summary: Upload file or a collection of files\n description: >-\n In order to upload a collection, user can send a multipart request with\n all the files populated in the form data with appropriate headers.\n\n User can also upload a tar file along with the swarm-collection header. This will upload the tar file after extracting the entire directory structure.\n\n If the swarm-collection header is absent, all requests (including tar files) are considered as single file uploads.\n\n A multipart request is treated as a collection regardless of whether the swarm-collection header is present. This means in order to serve single files uploaded as a multipart request, the swarm-index-document header should be used with the name of the file.\n tags:\n - BZZ\n parameters:\n - in: query\n name: name\n schema:\n type: string\n required: false\n description: Filename when uploading single file\n - *a9\n - *a10\n - *a15\n - in: header\n name: Content-Type\n schema:\n type: string\n description: The specified content-type is preserved for download of the asset\n - in: header\n name: swarm-collection\n schema:\n type: boolean\n required: false\n description: Upload file/files as a collection\n - in: header\n name: swarm-index-document\n schema:\n type: string\n example: index.html\n required: false\n description: Default file to be referenced on path, if exists under that path\n - in: header\n name: swarm-error-document\n schema:\n type: string\n example: error.html\n required: false\n description: Configure custom error document to be returned when a specified\n path can not be found in collection\n - *a11\n - *a12\n requestBody:\n content:\n multipart/form-data:\n schema:\n properties:\n file:\n type: array\n items:\n type: string\n format: binary\n application/octet-stream:\n schema:\n type: string\n format: binary\n application/x-tar:\n schema:\n type: string\n format: binary\n responses:\n \"201\":\n description: Ok\n headers:\n swarm-tag: *a16\n etag:\n description: >\n The RFC7232 ETag header field in a response provides the current\n entity-\n\n tag for the selected resource. An entity-tag is an opaque identifier for\n\n different versions of a resource over time, regardless whether multiple\n\n versions are valid at the same time. An entity-tag consists of an opaque\n\n quoted string, possibly prefixed by a weakness indicator.\n schema:\n type: string\n content:\n application/json:\n schema: *a17\n \"400\": *a3\n \"402\": *a13\n \"403\": *a14\n \"500\": *a5\n default:\n description: Default response\n \"/bzz/{reference}\":\n patch:\n summary: \"Reupload a root hash to the network; deprecated: use\n /stewardship/{reference} instead\"\n deprecated: true\n tags:\n - BZZ\n parameters:\n - in: path\n name: reference\n schema: *a7\n required: true\n description: \"Root hash of content (can be of any type: collection, file, chunk)\"\n responses:\n \"200\":\n description: Ok\n \"500\": *a5\n default:\n description: Default response\n get:\n summary: Get file or index document from a collection of files\n tags:\n - BZZ\n parameters:\n - in: path\n name: reference\n schema: *a7\n required: true\n description: Swarm address of content\n - *a18\n responses:\n \"200\":\n description: Ok\n headers:\n swarm-recovery-targets: *a19\n content:\n application/octet-stream:\n schema:\n type: string\n format: binary\n \"400\": *a3\n \"404\": *a8\n \"500\": *a5\n default:\n description: Default response\n \"/bzz/{reference}/{path}\":\n get:\n summary: Get referenced file from a collection of files\n tags:\n - BZZ\n parameters:\n - in: path\n name: reference\n schema: *a7\n required: true\n description: Swarm address of content\n - in: path\n name: path\n schema:\n type: string\n required: true\n description: Path to the file in the collection.\n - *a18\n responses:\n \"200\":\n description: Ok\n headers:\n swarm-recovery-targets: *a19\n content:\n application/octet-stream:\n schema:\n type: string\n format: binary\n \"400\": *a3\n \"404\": *a8\n \"500\": *a5\n default:\n description: Default response\n /tags:\n get:\n summary: Get list of tags\n tags:\n - Tag\n parameters:\n - in: query\n name: offset\n schema:\n type: integer\n minimum: 0\n default: 0\n required: false\n description: The number of items to skip before starting to collect the result\n set.\n - in: query\n name: limit\n schema:\n type: integer\n minimum: 1\n maximum: 1000\n default: 100\n required: false\n description: The numbers of items to return.\n responses:\n \"200\":\n description: List of tags\n content:\n application/json:\n schema:\n type: object\n properties:\n tags:\n type: array\n nullable: true\n items:\n type: object\n properties:\n uid:\n type: integer\n startedAt:\n type: string\n format: date-time\n example: 2020-06-11T11:26:42.6969797+02:00\n total:\n type: integer\n processed:\n type: integer\n synced:\n type: integer\n \"403\": *a14\n \"500\": *a5\n default:\n description: Default response\n post:\n summary: Create Tag\n tags:\n - Tag\n requestBody:\n required: true\n content:\n application/json:\n schema:\n type: object\n properties:\n address:\n type: string\n pattern: ^[A-Fa-f0-9]{64}$\n example: 36b7efd913ca4cf880b8eeac5093fa27b0825906c600685b6abdd6566e6cfe8f\n responses:\n \"201\":\n description: New Tag Info\n content:\n application/json:\n schema:\n &a20\n type: object\n properties:\n uid:\n type: integer\n startedAt:\n type: string\n format: date-time\n example: 2020-06-11T11:26:42.6969797+02:00\n total:\n type: integer\n processed:\n type: integer\n synced:\n type: integer\n \"403\": *a14\n \"500\": *a5\n default:\n description: Default response\n \"/tags/{uid}\":\n get:\n summary: Get Tag information using Uid\n tags:\n - Tag\n parameters:\n - in: path\n name: uid\n schema: *a6\n required: true\n description: Uid\n responses:\n \"200\":\n description: Tag info\n content:\n application/json:\n schema: *a20\n \"400\": *a3\n \"403\": *a14\n \"404\": *a8\n \"500\": *a5\n default:\n description: Default response\n delete:\n summary: Delete Tag information using Uid\n tags:\n - Tag\n parameters:\n - in: path\n name: uid\n schema: *a6\n required: true\n description: Uid\n responses:\n \"204\":\n description: The resource was deleted successfully.\n \"400\": *a3\n \"403\": *a14\n \"404\": *a8\n \"500\": *a5\n default:\n description: Default response\n patch:\n summary: Update Total Count and swarm hash for a tag of an input stream of\n unknown size using Uid\n tags:\n - Tag\n parameters:\n - in: path\n name: uid\n schema: *a6\n required: true\n description: Uid\n requestBody:\n description: Can contain swarm hash to use for the tag\n required: false\n content:\n application/json:\n schema:\n type: object\n properties:\n address:\n type: string\n pattern: ^[A-Fa-f0-9]{64}$\n example: 36b7efd913ca4cf880b8eeac5093fa27b0825906c600685b6abdd6566e6cfe8f\n responses:\n \"200\":\n description: Ok\n content:\n application/json:\n schema: *a21\n \"403\": *a14\n \"404\": *a8\n \"500\": *a5\n default:\n description: Default response\n \"/pins/{reference}\":\n parameters:\n - in: path\n name: reference\n schema:\n &a23\n oneOf:\n - type: string\n pattern: ^[A-Fa-f0-9]{64}$\n example: 36b7efd913ca4cf880b8eeac5093fa27b0825906c600685b6abdd6566e6cfe8f\n - type: string\n pattern: ^[A-Fa-f0-9]{128}$\n example: 36b7efd913ca4cf880b8eeac5093fa27b0825906c600685b6abdd6566e6cfe8f2d2810619d29b5dbefd5d74abce25d58b81b251baddb9c3871cf0d6967deaae2\n required: true\n description: Swarm reference of the root hash\n post:\n summary: Pin the root hash with the given reference\n tags:\n - Pinning\n responses:\n \"200\":\n description: Pin already exists, so no operation\n content:\n application/json:\n schema:\n &a22\n type: object\n properties:\n message:\n type: string\n code:\n type: integer\n \"201\":\n description: New pin with root reference was created\n content:\n application/json:\n schema: *a22\n \"400\": *a3\n \"403\": *a14\n \"404\": *a8\n \"500\": *a5\n default:\n description: Default response\n delete:\n summary: Unpin the root hash with the given reference\n tags:\n - Pinning\n responses:\n \"200\":\n description: Unpinning root hash with reference\n content:\n application/json:\n schema: *a22\n \"400\": *a3\n \"403\": *a14\n \"500\": *a5\n default:\n description: Default response\n get:\n summary: Get pinning status of the root hash with the given reference\n tags:\n - Pinning\n responses:\n \"200\":\n description: Reference of the pinned root hash\n content:\n application/json:\n schema: *a23\n \"400\": *a3\n \"403\": *a14\n \"404\": *a8\n \"500\": *a5\n default:\n description: Default response\n /pins:\n get:\n summary: Get the list of pinned root hash references\n tags:\n - Pinning\n responses:\n \"200\":\n description: List of pinned root hash references\n content:\n application/json:\n schema:\n type: object\n properties:\n addresses:\n type: array\n nullable: true\n items:\n oneOf:\n - type: string\n pattern: ^[A-Fa-f0-9]{64}$\n example: 36b7efd913ca4cf880b8eeac5093fa27b0825906c600685b6abdd6566e6cfe8f\n - type: string\n pattern: ^[A-Fa-f0-9]{128}$\n example: 36b7efd913ca4cf880b8eeac5093fa27b0825906c600685b6abdd6566e6cfe8f2d2810619d29b5dbefd5d74abce25d58b81b251baddb9c3871cf0d6967deaae2\n \"403\": *a14\n \"500\": *a5\n default:\n description: Default response\n \"/pss/send/{topic}/{targets}\":\n post:\n summary: Send to recipient or target with Postal Service for Swarm\n tags:\n - Postal Service for Swarm\n parameters:\n - in: path\n name: topic\n schema:\n &a24\n type: string\n required: true\n description: Topic name\n - in: path\n name: targets\n schema:\n pattern: ^[0-9a-fA-F]{1,6}(,[0-9a-fA-F]{1,6})*$\n description: List of hex string targets that are comma seprated and can have\n maximum length of 6\n type: string\n required: true\n description: Target message address prefix. If multiple targets are specified,\n only one would be matched.\n - in: query\n name: recipient\n schema:\n type: string\n required: false\n description: Recipient publickey\n - *a11\n responses:\n \"201\":\n description: Subscribed to topic\n \"400\": *a3\n \"402\": *a13\n \"403\": *a14\n \"500\": *a5\n default:\n description: Default response\n \"/pss/subscribe/{topic}\":\n get:\n summary: Subscribe for messages on the given topic.\n tags:\n - Postal Service for Swarm\n parameters:\n - in: path\n name: topic\n schema: *a24\n required: true\n description: Topic name\n responses:\n \"200\":\n description: Returns a WebSocket with a subscription for incoming message data\n on the requested topic.\n \"403\": *a14\n \"500\": *a5\n default:\n description: Default response\n \"/soc/{owner}/{id}\":\n post:\n summary: Upload single owner chunk\n tags:\n - Single owner chunk\n parameters:\n - in: path\n name: owner\n schema:\n &a26\n type: string\n pattern: ^[A-Fa-f0-9]{40}$\n example: 36b7efd913ca4cf880b8eeac5093fa27b0825906\n required: true\n description: Owner\n - in: path\n name: id\n schema:\n &a25\n type: string\n pattern: ^([A-Fa-f0-9]+)$\n example: cf880b8eeac5093fa27b0825906c600685\n required: true\n description: Id\n - in: query\n name: sig\n schema: *a25\n required: true\n description: Signature\n - *a10\n responses:\n \"201\":\n description: Created\n content:\n application/json:\n schema: *a17\n \"400\": *a3\n \"401\": *a4\n \"402\": *a13\n \"403\": *a14\n \"500\": *a5\n default:\n description: Default response\n \"/feeds/{owner}/{topic}\":\n post:\n summary: Create an initial feed root manifest\n tags:\n - Feed\n parameters:\n - in: path\n name: owner\n schema: *a26\n required: true\n description: Owner\n - in: path\n name: topic\n schema: *a25\n required: true\n description: Topic\n - in: query\n name: type\n schema:\n &a27\n type: string\n pattern: ^(sequence|epoch)$\n required: false\n description: \"Feed indexing scheme (default: sequence)\"\n - *a10\n - *a11\n responses:\n \"201\":\n description: Created\n content:\n application/json:\n schema: *a17\n \"400\": *a3\n \"401\": *a4\n \"402\": *a13\n \"403\": *a14\n \"500\": *a5\n default:\n description: Default response\n get:\n summary: Find feed update\n tags:\n - Feed\n parameters:\n - in: path\n name: owner\n schema: *a26\n required: true\n description: Owner\n - in: path\n name: topic\n schema: *a25\n required: true\n description: Topic\n - in: query\n name: at\n schema:\n type: integer\n required: false\n description: \"Timestamp of the update (default: now)\"\n - in: query\n name: type\n schema: *a27\n required: false\n description: \"Feed indexing scheme (default: sequence)\"\n responses:\n \"200\":\n description: Latest feed update\n headers:\n swarm-feed-index:\n description: The index of the found update\n schema:\n type: string\n pattern: ^([A-Fa-f0-9]+)$\n example: cf880b8eeac5093fa27b0825906c600685\n swarm-feed-index-next:\n description: The index of the next possible update\n schema:\n type: string\n pattern: ^([A-Fa-f0-9]+)$\n example: cf880b8eeac5093fa27b0825906c600685\n content:\n application/json:\n schema: *a17\n \"400\": *a3\n \"401\": *a4\n \"500\": *a5\n default:\n description: Default response\n \"/stewardship/{reference}\":\n get:\n summary: Check if content is available\n tags:\n - Stewardship\n parameters:\n - in: path\n name: reference\n schema: *a7\n required: true\n description: \"Root hash of content (can be of any type: collection, file, chunk)\"\n responses:\n \"200\":\n description: Returns if the content is retrievable\n content:\n application/json:\n schema:\n type: object\n properties:\n isRetrievable:\n type: boolean\n \"404\": *a8\n \"500\": *a5\n default:\n description: Default response\n put:\n summary: Reupload a root hash to the network\n tags:\n - Stewardship\n parameters:\n - in: path\n name: reference\n schema: *a7\n required: true\n description: \"Root hash of content (can be of any type: collection, file, chunk)\"\n responses:\n \"200\":\n description: Ok\n \"404\": *a8\n \"500\": *a5\n default:\n description: Default response\ncomponents:\n securitySchemes:\n basicAuth:\n type: http\n scheme: basic\n bearerAuth:\n type: http\n scheme: bearer\n bearerFormat: SecurityToken\n", + "json": "openapi: 3.0.3\ninfo:\n version: 3.0.0\n title: Bee API\n description: A list of the currently provided Interfaces to interact with the\n swarm, implementing file operations and sending messages\nsecurity:\n - {}\nexternalDocs:\n description: Browse the documentation @ the Swarm Docs\n url: https://docs.ethswarm.org\nservers:\n - url: http://{apiRoot}:{port}/v1\n variables:\n apiRoot:\n default: localhost\n description: Base address of the local bee node main API\n port:\n default: \"1633\"\n description: Service port provided in bee node config\n - url: http://{apiRoot}:{port}\n variables:\n apiRoot:\n default: localhost\n description: Base address of the local bee node main API\n port:\n default: \"1633\"\n description: Service port provided in bee node config\npaths:\n /auth:\n post:\n summary: Authenticate - This endpoint is experimental\n tags:\n - Auth\n security:\n - basicAuth: []\n requestBody:\n required: true\n content:\n application/json:\n schema:\n &a1\n type: object\n properties:\n role:\n type: string\n nullable: false\n expiry:\n type: integer\n nullable: false\n description: Expiration time in seconds\n responses:\n \"201\":\n description: Ok\n content:\n application/json:\n schema:\n &a2\n type: object\n properties:\n key:\n type: string\n nullable: false\n \"400\":\n &a3\n description: Bad request\n content:\n application/problem+json:\n schema:\n type: object\n properties:\n message:\n type: string\n code:\n type: integer\n \"401\":\n &a4\n description: Unauthorized\n content:\n application/problem+json:\n schema:\n type: object\n properties:\n message:\n type: string\n code:\n type: integer\n \"500\":\n &a5\n description: Internal Server Error\n content:\n application/problem+json:\n schema:\n type: object\n properties:\n message:\n type: string\n code:\n type: integer\n default:\n description: Default response\n /refresh:\n post:\n summary: Refresh the auth token - This endpoint is experimental\n tags:\n - Auth\n security:\n - bearerAuth: []\n requestBody:\n required: true\n content:\n application/json:\n schema: *a1\n responses:\n \"201\":\n description: Ok\n content:\n application/json:\n schema: *a2\n \"400\": *a3\n \"401\": *a4\n \"500\": *a5\n default:\n description: Default response\n /bytes:\n post:\n summary: Upload data\n tags:\n - Bytes\n parameters:\n - &a9\n in: header\n name: swarm-tag\n schema:\n &a6\n type: integer\n required: false\n description: Associate upload with an existing Tag UID\n - &a10\n in: header\n name: swarm-pin\n schema:\n type: boolean\n required: false\n description: >\n Represents if the uploaded data should be also locally pinned on the\n node.\n\n Warning! Not available for nodes that run in Gateway mode!\n - &a15\n in: header\n name: swarm-encrypt\n schema:\n type: boolean\n required: false\n description: |\n Represents the encrypting state of the file\n Warning! Not available for nodes that run in Gateway mode!\n - &a11\n in: header\n name: swarm-postage-batch-id\n description: ID of Postage Batch that is used to upload data with\n required: true\n schema:\n type: string\n pattern: ^[A-Fa-f0-9]{64}$\n example: 36b7efd913ca4cf880b8eeac5093fa27b0825906c600685b6abdd6566e6cfe8f\n - &a12\n in: header\n name: swarm-deferred-upload\n schema:\n type: boolean\n default: \"true\"\n required: false\n description: >\n Determines if the uploaded data should be sent to the network\n immediately or in a deferred fashion. By default the upload will be\n deferred.\n requestBody:\n content:\n application/octet-stream:\n schema:\n type: string\n format: binary\n responses:\n \"201\":\n description: Ok\n headers:\n swarm-tag:\n &a16\n description: Tag UID\n schema: *a6\n content:\n application/json:\n schema:\n &a17\n type: object\n properties:\n reference:\n oneOf:\n - type: string\n pattern: ^[A-Fa-f0-9]{64}$\n example: 36b7efd913ca4cf880b8eeac5093fa27b0825906c600685b6abdd6566e6cfe8f\n - type: string\n pattern: ^[A-Fa-f0-9]{128}$\n example: 36b7efd913ca4cf880b8eeac5093fa27b0825906c600685b6abdd6566e6cfe8f2d2810619d29b5dbefd5d74abce25d58b81b251baddb9c3871cf0d6967deaae2\n - type: string\n pattern: ^[A-Za-z0-9]+\\.[A-Za-z0-9]+$\n example: swarm.eth\n \"400\": *a3\n \"402\":\n &a13\n description: Payment Required\n content:\n application/problem+json:\n schema:\n type: object\n properties:\n message:\n type: string\n code:\n type: integer\n \"403\":\n &a14\n description: Endpoint or header (pinning or encryption headers) forbidden in\n Gateway mode\n content:\n application/problem+json:\n schema:\n type: object\n properties:\n message:\n type: string\n code:\n type: integer\n \"500\": *a5\n default:\n description: Default response\n \"/bytes/{reference}\":\n get:\n summary: Get referenced data\n tags:\n - Bytes\n parameters:\n - in: path\n name: reference\n schema:\n &a7\n oneOf:\n - type: string\n pattern: ^[A-Fa-f0-9]{64}$\n example: 36b7efd913ca4cf880b8eeac5093fa27b0825906c600685b6abdd6566e6cfe8f\n - type: string\n pattern: ^[A-Fa-f0-9]{128}$\n example: 36b7efd913ca4cf880b8eeac5093fa27b0825906c600685b6abdd6566e6cfe8f2d2810619d29b5dbefd5d74abce25d58b81b251baddb9c3871cf0d6967deaae2\n - type: string\n pattern: ^[A-Za-z0-9]+\\.[A-Za-z0-9]+$\n example: swarm.eth\n required: true\n description: Swarm address reference to content\n responses:\n \"200\":\n description: Retrieved content specified by reference\n content:\n application/octet-stream:\n schema:\n type: string\n format: binary\n \"404\":\n &a8\n description: Not Found\n content:\n application/problem+json:\n schema:\n type: object\n properties:\n message:\n type: string\n code:\n type: integer\n default:\n description: Default response\n \"/chunks/{reference}\":\n get:\n summary: Get Chunk\n tags:\n - Chunk\n parameters:\n - in: path\n name: reference\n schema: *a7\n required: true\n description: Swarm address of chunk\n - &a18\n in: query\n name: targets\n schema:\n type: string\n required: false\n description: Global pinning targets prefix\n responses:\n \"200\":\n description: Retrieved chunk content\n headers:\n swarm-recovery-targets:\n &a19\n description: The targets provided for recovery\n schema:\n type: string\n content:\n application/octet-stream:\n schema:\n type: string\n format: binary\n \"202\":\n description: chunk recovery initiated. retry after sometime.\n \"400\": *a3\n \"404\": *a8\n \"500\": *a5\n default:\n description: Default response\n /chunks:\n post:\n summary: Upload Chunk\n tags:\n - Chunk\n parameters:\n - *a9\n - *a10\n - *a11\n - *a12\n requestBody:\n description: Chunk binary data that has to have at least 8 bytes.\n content:\n application/octet-stream:\n schema:\n type: string\n format: binary\n responses:\n \"201\":\n description: Ok\n headers:\n swarm-tag:\n description: Tag UID if it was passed to the request `swarm-tag` header.\n schema: *a6\n content:\n application/json:\n schema:\n &a21\n type: object\n properties:\n status:\n type: string\n version:\n type: string\n apiVersion:\n type: string\n default: 0.0.0\n description: The default value is set in case the bee binary was not build\n correctly.\n debugApiVersion:\n type: string\n default: 0.0.0\n description: The default value is set in case the bee binary was not build\n correctly.\n \"400\": *a3\n \"402\": *a13\n \"403\": *a14\n \"500\": *a5\n default:\n description: Default response\n /chunks/stream:\n get:\n summary: Upload stream of chunks\n tags:\n - Chunk\n parameters:\n - *a9\n - *a10\n - *a11\n responses:\n \"200\":\n description: Returns a Websocket connection on which stream of chunks can be\n uploaded. Each chunk sent is acknowledged using a binary response\n `0` which serves as confirmation of upload of single chunk. Chunks\n should be packaged as binary messages for uploading.\n \"400\": *a3\n default:\n description: Default response\n /bzz:\n post:\n summary: Upload file or a collection of files\n description: >-\n In order to upload a collection, user can send a multipart request with\n all the files populated in the form data with appropriate headers.\n\n User can also upload a tar file along with the swarm-collection header. This will upload the tar file after extracting the entire directory structure.\n\n If the swarm-collection header is absent, all requests (including tar files) are considered as single file uploads.\n\n A multipart request is treated as a collection regardless of whether the swarm-collection header is present. This means in order to serve single files uploaded as a multipart request, the swarm-index-document header should be used with the name of the file.\n tags:\n - BZZ\n parameters:\n - in: query\n name: name\n schema:\n type: string\n required: false\n description: Filename when uploading single file\n - *a9\n - *a10\n - *a15\n - in: header\n name: Content-Type\n schema:\n type: string\n description: The specified content-type is preserved for download of the asset\n - in: header\n name: swarm-collection\n schema:\n type: boolean\n required: false\n description: Upload file/files as a collection\n - in: header\n name: swarm-index-document\n schema:\n type: string\n example: index.html\n required: false\n description: Default file to be referenced on path, if exists under that path\n - in: header\n name: swarm-error-document\n schema:\n type: string\n example: error.html\n required: false\n description: Configure custom error document to be returned when a specified\n path can not be found in collection\n - *a11\n - *a12\n requestBody:\n content:\n multipart/form-data:\n schema:\n properties:\n file:\n type: array\n items:\n type: string\n format: binary\n application/octet-stream:\n schema:\n type: string\n format: binary\n application/x-tar:\n schema:\n type: string\n format: binary\n responses:\n \"201\":\n description: Ok\n headers:\n swarm-tag: *a16\n etag:\n description: >\n The RFC7232 ETag header field in a response provides the current\n entity-\n\n tag for the selected resource. An entity-tag is an opaque identifier for\n\n different versions of a resource over time, regardless whether multiple\n\n versions are valid at the same time. An entity-tag consists of an opaque\n\n quoted string, possibly prefixed by a weakness indicator.\n schema:\n type: string\n content:\n application/json:\n schema: *a17\n \"400\": *a3\n \"402\": *a13\n \"403\": *a14\n \"500\": *a5\n default:\n description: Default response\n \"/bzz/{reference}\":\n patch:\n summary: \"Reupload a root hash to the network; deprecated: use\n /stewardship/{reference} instead\"\n deprecated: true\n tags:\n - BZZ\n parameters:\n - in: path\n name: reference\n schema: *a7\n required: true\n description: \"Root hash of content (can be of any type: collection, file, chunk)\"\n responses:\n \"200\":\n description: Ok\n \"500\": *a5\n default:\n description: Default response\n get:\n summary: Get file or index document from a collection of files\n tags:\n - BZZ\n parameters:\n - in: path\n name: reference\n schema: *a7\n required: true\n description: Swarm address of content\n - *a18\n responses:\n \"200\":\n description: Ok\n headers:\n swarm-recovery-targets: *a19\n content:\n application/octet-stream:\n schema:\n type: string\n format: binary\n \"400\": *a3\n \"404\": *a8\n \"500\": *a5\n default:\n description: Default response\n \"/bzz/{reference}/{path}\":\n get:\n summary: Get referenced file from a collection of files\n tags:\n - BZZ\n parameters:\n - in: path\n name: reference\n schema: *a7\n required: true\n description: Swarm address of content\n - in: path\n name: path\n schema:\n type: string\n required: true\n description: Path to the file in the collection.\n - *a18\n responses:\n \"200\":\n description: Ok\n headers:\n swarm-recovery-targets: *a19\n content:\n application/octet-stream:\n schema:\n type: string\n format: binary\n \"400\": *a3\n \"404\": *a8\n \"500\": *a5\n default:\n description: Default response\n /tags:\n get:\n summary: Get list of tags\n tags:\n - Tag\n parameters:\n - in: query\n name: offset\n schema:\n type: integer\n minimum: 0\n default: 0\n required: false\n description: The number of items to skip before starting to collect the result\n set.\n - in: query\n name: limit\n schema:\n type: integer\n minimum: 1\n maximum: 1000\n default: 100\n required: false\n description: The numbers of items to return.\n responses:\n \"200\":\n description: List of tags\n content:\n application/json:\n schema:\n type: object\n properties:\n tags:\n type: array\n nullable: true\n items:\n type: object\n properties:\n uid:\n type: integer\n startedAt:\n type: string\n format: date-time\n example: 2020-06-11T11:26:42.6969797+02:00\n total:\n type: integer\n processed:\n type: integer\n synced:\n type: integer\n \"403\": *a14\n \"500\": *a5\n default:\n description: Default response\n post:\n summary: Create Tag\n tags:\n - Tag\n requestBody:\n required: true\n content:\n application/json:\n schema:\n type: object\n properties:\n address:\n type: string\n pattern: ^[A-Fa-f0-9]{64}$\n example: 36b7efd913ca4cf880b8eeac5093fa27b0825906c600685b6abdd6566e6cfe8f\n responses:\n \"201\":\n description: New Tag Info\n content:\n application/json:\n schema:\n &a20\n type: object\n properties:\n uid:\n type: integer\n startedAt:\n type: string\n format: date-time\n example: 2020-06-11T11:26:42.6969797+02:00\n total:\n type: integer\n processed:\n type: integer\n synced:\n type: integer\n \"403\": *a14\n \"500\": *a5\n default:\n description: Default response\n \"/tags/{uid}\":\n get:\n summary: Get Tag information using Uid\n tags:\n - Tag\n parameters:\n - in: path\n name: uid\n schema: *a6\n required: true\n description: Uid\n responses:\n \"200\":\n description: Tag info\n content:\n application/json:\n schema: *a20\n \"400\": *a3\n \"403\": *a14\n \"404\": *a8\n \"500\": *a5\n default:\n description: Default response\n delete:\n summary: Delete Tag information using Uid\n tags:\n - Tag\n parameters:\n - in: path\n name: uid\n schema: *a6\n required: true\n description: Uid\n responses:\n \"204\":\n description: The resource was deleted successfully.\n \"400\": *a3\n \"403\": *a14\n \"404\": *a8\n \"500\": *a5\n default:\n description: Default response\n patch:\n summary: Update Total Count and swarm hash for a tag of an input stream of\n unknown size using Uid\n tags:\n - Tag\n parameters:\n - in: path\n name: uid\n schema: *a6\n required: true\n description: Uid\n requestBody:\n description: Can contain swarm hash to use for the tag\n required: false\n content:\n application/json:\n schema:\n type: object\n properties:\n address:\n type: string\n pattern: ^[A-Fa-f0-9]{64}$\n example: 36b7efd913ca4cf880b8eeac5093fa27b0825906c600685b6abdd6566e6cfe8f\n responses:\n \"200\":\n description: Ok\n content:\n application/json:\n schema: *a21\n \"403\": *a14\n \"404\": *a8\n \"500\": *a5\n default:\n description: Default response\n \"/pins/{reference}\":\n parameters:\n - in: path\n name: reference\n schema:\n &a23\n oneOf:\n - type: string\n pattern: ^[A-Fa-f0-9]{64}$\n example: 36b7efd913ca4cf880b8eeac5093fa27b0825906c600685b6abdd6566e6cfe8f\n - type: string\n pattern: ^[A-Fa-f0-9]{128}$\n example: 36b7efd913ca4cf880b8eeac5093fa27b0825906c600685b6abdd6566e6cfe8f2d2810619d29b5dbefd5d74abce25d58b81b251baddb9c3871cf0d6967deaae2\n required: true\n description: Swarm reference of the root hash\n post:\n summary: Pin the root hash with the given reference\n tags:\n - Pinning\n responses:\n \"200\":\n description: Pin already exists, so no operation\n content:\n application/json:\n schema:\n &a22\n type: object\n properties:\n message:\n type: string\n code:\n type: integer\n \"201\":\n description: New pin with root reference was created\n content:\n application/json:\n schema: *a22\n \"400\": *a3\n \"403\": *a14\n \"404\": *a8\n \"500\": *a5\n default:\n description: Default response\n delete:\n summary: Unpin the root hash with the given reference\n tags:\n - Pinning\n responses:\n \"200\":\n description: Unpinning root hash with reference\n content:\n application/json:\n schema: *a22\n \"400\": *a3\n \"403\": *a14\n \"500\": *a5\n default:\n description: Default response\n get:\n summary: Get pinning status of the root hash with the given reference\n tags:\n - Pinning\n responses:\n \"200\":\n description: Reference of the pinned root hash\n content:\n application/json:\n schema: *a23\n \"400\": *a3\n \"403\": *a14\n \"404\": *a8\n \"500\": *a5\n default:\n description: Default response\n /pins:\n get:\n summary: Get the list of pinned root hash references\n tags:\n - Pinning\n responses:\n \"200\":\n description: List of pinned root hash references\n content:\n application/json:\n schema:\n type: object\n properties:\n references:\n type: array\n nullable: false\n items:\n oneOf:\n - type: string\n pattern: ^[A-Fa-f0-9]{64}$\n example: 36b7efd913ca4cf880b8eeac5093fa27b0825906c600685b6abdd6566e6cfe8f\n - type: string\n pattern: ^[A-Fa-f0-9]{128}$\n example: 36b7efd913ca4cf880b8eeac5093fa27b0825906c600685b6abdd6566e6cfe8f2d2810619d29b5dbefd5d74abce25d58b81b251baddb9c3871cf0d6967deaae2\n \"403\": *a14\n \"500\": *a5\n default:\n description: Default response\n \"/pss/send/{topic}/{targets}\":\n post:\n summary: Send to recipient or target with Postal Service for Swarm\n tags:\n - Postal Service for Swarm\n parameters:\n - in: path\n name: topic\n schema:\n &a24\n type: string\n required: true\n description: Topic name\n - in: path\n name: targets\n schema:\n pattern: ^[0-9a-fA-F]{1,6}(,[0-9a-fA-F]{1,6})*$\n description: List of hex string targets that are comma seprated and can have\n maximum length of 6\n type: string\n required: true\n description: Target message address prefix. If multiple targets are specified,\n only one would be matched.\n - in: query\n name: recipient\n schema:\n type: string\n required: false\n description: Recipient publickey\n - *a11\n responses:\n \"201\":\n description: Subscribed to topic\n \"400\": *a3\n \"402\": *a13\n \"403\": *a14\n \"500\": *a5\n default:\n description: Default response\n \"/pss/subscribe/{topic}\":\n get:\n summary: Subscribe for messages on the given topic.\n tags:\n - Postal Service for Swarm\n parameters:\n - in: path\n name: topic\n schema: *a24\n required: true\n description: Topic name\n responses:\n \"200\":\n description: Returns a WebSocket with a subscription for incoming message data\n on the requested topic.\n \"403\": *a14\n \"500\": *a5\n default:\n description: Default response\n \"/soc/{owner}/{id}\":\n post:\n summary: Upload single owner chunk\n tags:\n - Single owner chunk\n parameters:\n - in: path\n name: owner\n schema:\n &a26\n type: string\n pattern: ^[A-Fa-f0-9]{40}$\n example: 36b7efd913ca4cf880b8eeac5093fa27b0825906\n required: true\n description: Owner\n - in: path\n name: id\n schema:\n &a25\n type: string\n pattern: ^([A-Fa-f0-9]+)$\n example: cf880b8eeac5093fa27b0825906c600685\n required: true\n description: Id\n - in: query\n name: sig\n schema: *a25\n required: true\n description: Signature\n - *a10\n responses:\n \"201\":\n description: Created\n content:\n application/json:\n schema: *a17\n \"400\": *a3\n \"401\": *a4\n \"402\": *a13\n \"403\": *a14\n \"500\": *a5\n default:\n description: Default response\n \"/feeds/{owner}/{topic}\":\n post:\n summary: Create an initial feed root manifest\n tags:\n - Feed\n parameters:\n - in: path\n name: owner\n schema: *a26\n required: true\n description: Owner\n - in: path\n name: topic\n schema: *a25\n required: true\n description: Topic\n - in: query\n name: type\n schema:\n &a27\n type: string\n pattern: ^(sequence|epoch)$\n required: false\n description: \"Feed indexing scheme (default: sequence)\"\n - *a10\n - *a11\n responses:\n \"201\":\n description: Created\n content:\n application/json:\n schema: *a17\n \"400\": *a3\n \"401\": *a4\n \"402\": *a13\n \"403\": *a14\n \"500\": *a5\n default:\n description: Default response\n get:\n summary: Find feed update\n tags:\n - Feed\n parameters:\n - in: path\n name: owner\n schema: *a26\n required: true\n description: Owner\n - in: path\n name: topic\n schema: *a25\n required: true\n description: Topic\n - in: query\n name: at\n schema:\n type: integer\n required: false\n description: \"Timestamp of the update (default: now)\"\n - in: query\n name: type\n schema: *a27\n required: false\n description: \"Feed indexing scheme (default: sequence)\"\n responses:\n \"200\":\n description: Latest feed update\n headers:\n swarm-feed-index:\n description: The index of the found update\n schema:\n type: string\n pattern: ^([A-Fa-f0-9]+)$\n example: cf880b8eeac5093fa27b0825906c600685\n swarm-feed-index-next:\n description: The index of the next possible update\n schema:\n type: string\n pattern: ^([A-Fa-f0-9]+)$\n example: cf880b8eeac5093fa27b0825906c600685\n content:\n application/json:\n schema: *a17\n \"400\": *a3\n \"401\": *a4\n \"500\": *a5\n default:\n description: Default response\n \"/stewardship/{reference}\":\n get:\n summary: Check if content is available\n tags:\n - Stewardship\n parameters:\n - in: path\n name: reference\n schema: *a7\n required: true\n description: \"Root hash of content (can be of any type: collection, file, chunk)\"\n responses:\n \"200\":\n description: Returns if the content is retrievable\n content:\n application/json:\n schema:\n type: object\n properties:\n isRetrievable:\n type: boolean\n \"404\": *a8\n \"500\": *a5\n default:\n description: Default response\n put:\n summary: Reupload a root hash to the network\n tags:\n - Stewardship\n parameters:\n - in: path\n name: reference\n schema: *a7\n required: true\n description: \"Root hash of content (can be of any type: collection, file, chunk)\"\n responses:\n \"200\":\n description: Ok\n \"404\": *a8\n \"500\": *a5\n default:\n description: Default response\ncomponents:\n securitySchemes:\n basicAuth:\n type: http\n scheme: basic\n bearerAuth:\n type: http\n scheme: bearer\n bearerFormat: SecurityToken\n", "url": "", "output": null, "newLineBehavior": "Auto" @@ -41,7 +41,7 @@ "useRequestAndResponseSerializationSettings": false, "serializeTypeInformation": false, "queryNullValue": "", - "className": "BeeGatewayClient_2_0_0", + "className": "BeeGatewayClient_3_0_0", "operationGenerationMode": "SingleClientFromPathSegments", "additionalNamespaceUsages": [ "Etherna.BeeNet.Exceptions" @@ -58,7 +58,7 @@ "wrapResponseMethods": [], "generateResponseClasses": true, "responseClass": "SwaggerResponse", - "namespace": "Etherna.BeeNet.Clients.GatewayApi.V2_0_0", + "namespace": "Etherna.BeeNet.Clients.GatewayApi.V3_0_0", "requiredPropertiesMustBeDefined": true, "dateType": "System.DateTimeOffset", "jsonConverters": null, @@ -95,7 +95,7 @@ "enumNameGeneratorType": null, "serviceHost": null, "serviceSchemes": null, - "output": "../src/BeeNet/Clients/GatewayApi/V2_0_0/BeeGatewayClient_2_0_0.cs", + "output": "../src/BeeNet/Clients/GatewayApi/v3_0_0/BeeGatewayClient_3_0_0.cs", "newLineBehavior": "Auto" } }