Skip to content

Commit

Permalink
Merge pull request #37 from Etherna/improve/BNET-72-fileresponse-disp…
Browse files Browse the repository at this point in the history
…osable

seal all model classes
  • Loading branch information
tmm360 authored Apr 2, 2024
2 parents 1404b10 + f45c0ac commit 81469aa
Show file tree
Hide file tree
Showing 42 changed files with 48 additions and 42 deletions.
2 changes: 1 addition & 1 deletion src/BeeNet/Models/Account.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

namespace Etherna.BeeNet.Models
{
public class Account
public sealed class Account
{
// Constructors.
internal Account(Clients.DebugApi.Anonymous anonymous)
Expand Down
2 changes: 1 addition & 1 deletion src/BeeNet/Models/AddressDetail.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

namespace Etherna.BeeNet.Models
{
public class AddressDetail
public sealed class AddressDetail
{
// Constructors.
internal AddressDetail(Clients.DebugApi.Response response)
Expand Down
2 changes: 1 addition & 1 deletion src/BeeNet/Models/Auth.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

namespace Etherna.BeeNet.Models
{
public class Auth
public sealed class Auth
{
// Constructors.
internal Auth(Clients.GatewayApi.Response response)
Expand Down
2 changes: 1 addition & 1 deletion src/BeeNet/Models/Bucket.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

namespace Etherna.BeeNet.Models
{
public class Bucket
public sealed class Bucket
{
// Constructors.
internal Bucket(Clients.DebugApi.Buckets bucket)
Expand Down
2 changes: 1 addition & 1 deletion src/BeeNet/Models/ChainState.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

namespace Etherna.BeeNet.Models
{
public class ChainState
public sealed class ChainState
{
// Constructors.
internal ChainState(Clients.DebugApi.Response13 response)
Expand Down
2 changes: 1 addition & 1 deletion src/BeeNet/Models/CheckPinsResult.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

namespace Etherna.BeeNet.Models
{
public class CheckPinsResult
public sealed class CheckPinsResult
{
internal CheckPinsResult(Response15 response)
{
Expand Down
2 changes: 1 addition & 1 deletion src/BeeNet/Models/ChequebookBalance.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

namespace Etherna.BeeNet.Models
{
public class ChequebookBalance
public sealed class ChequebookBalance
{
// Constructors.
internal ChequebookBalance(Clients.DebugApi.Response9 response)
Expand Down
2 changes: 1 addition & 1 deletion src/BeeNet/Models/ChequebookCashoutGet.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

namespace Etherna.BeeNet.Models
{
public class ChequebookCashoutGet
public sealed class ChequebookCashoutGet
{
// Constructors.
internal ChequebookCashoutGet(Clients.DebugApi.Response25 response)
Expand Down
2 changes: 1 addition & 1 deletion src/BeeNet/Models/ChequebookChequeGet.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

namespace Etherna.BeeNet.Models
{
public class ChequebookChequeGet
public sealed class ChequebookChequeGet
{
// Constructors
internal ChequebookChequeGet(Clients.DebugApi.Lastcheques response)
Expand Down
2 changes: 1 addition & 1 deletion src/BeeNet/Models/ConnectedPeers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

namespace Etherna.BeeNet.Models
{
public class ConnectedPeers
public sealed class ConnectedPeers
{
// Constructors.
internal ConnectedPeers(Clients.DebugApi.ConnectedPeers connectedPeers)
Expand Down
2 changes: 1 addition & 1 deletion src/BeeNet/Models/DisconnectedPeers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

namespace Etherna.BeeNet.Models
{
public class DisconnectedPeers
public sealed class DisconnectedPeers
{
// Constructors.
internal DisconnectedPeers(Clients.DebugApi.DisconnectedPeers disconnectedPeers)
Expand Down
8 changes: 7 additions & 1 deletion src/BeeNet/Models/FileResponse.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,11 @@

using System;
using System.IO;
using System.Threading.Tasks;

namespace Etherna.BeeNet.Models
{
public class FileResponse
public sealed class FileResponse : IDisposable, IAsyncDisposable
{
// Constructors.
internal FileResponse(Clients.GatewayApi.FileResponse response)
Expand All @@ -27,9 +28,14 @@ internal FileResponse(Clients.GatewayApi.FileResponse response)
Stream = response.Stream;
IsFeed = response.Headers.ContainsKey("Swarm-Feed-Index");
}

// Dispose.
public void Dispose() => Stream.Dispose();
public ValueTask DisposeAsync() => Stream.DisposeAsync();

// Properties.
public bool IsFeed { get; }
public Stream Stream { get; }

}
}
2 changes: 1 addition & 1 deletion src/BeeNet/Models/Health.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

namespace Etherna.BeeNet.Models
{
public class Health
public sealed class Health
{
// Constructors.
internal Health(Clients.DebugApi.Response18 response)
Expand Down
2 changes: 1 addition & 1 deletion src/BeeNet/Models/LastCashedCheque.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

namespace Etherna.BeeNet.Models
{
public class LastCashedCheque
public sealed class LastCashedCheque
{
// Constructors.
internal LastCashedCheque(Clients.DebugApi.LastCashedCheque lastCashedCheque)
Expand Down
2 changes: 1 addition & 1 deletion src/BeeNet/Models/LastReceived.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

namespace Etherna.BeeNet.Models
{
public class LastReceived
public sealed class LastReceived
{
// Constructors.
internal LastReceived(Clients.DebugApi.Lastreceived lastReceived)
Expand Down
2 changes: 1 addition & 1 deletion src/BeeNet/Models/LastSent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

namespace Etherna.BeeNet.Models
{
public class LastSent
public sealed class LastSent
{
// Constructors.
internal LastSent(Clients.DebugApi.Lastsent lastsent)
Expand Down
2 changes: 1 addition & 1 deletion src/BeeNet/Models/LogData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

namespace Etherna.BeeNet.Models
{
public class LogData
public sealed class LogData
{
// Constructors.
internal LogData(Clients.DebugApi.Response45 response)
Expand Down
2 changes: 1 addition & 1 deletion src/BeeNet/Models/Loggers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

namespace Etherna.BeeNet.Models
{
public class Loggers
public sealed class Loggers
{
// Constructors.
internal Loggers(Clients.DebugApi.Loggers loggers)
Expand Down
2 changes: 1 addition & 1 deletion src/BeeNet/Models/MessageResponse.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

namespace Etherna.BeeNet.Models
{
public class MessageResponse
public sealed class MessageResponse
{
// Constructors.
internal MessageResponse(Clients.DebugApi.Response16 response)
Expand Down
2 changes: 1 addition & 1 deletion src/BeeNet/Models/NodeInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

namespace Etherna.BeeNet.Models
{
public class NodeInfo
public sealed class NodeInfo
{
// Constructors.
internal NodeInfo(Clients.DebugApi.Response14 response)
Expand Down
2 changes: 1 addition & 1 deletion src/BeeNet/Models/PeerBalance.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

namespace Etherna.BeeNet.Models
{
public class PeerBalance
public sealed class PeerBalance
{
// Constructors.
internal PeerBalance(Clients.DebugApi.Balances balance)
Expand Down
2 changes: 1 addition & 1 deletion src/BeeNet/Models/PeerMetrics.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

namespace Etherna.BeeNet.Models
{
public class PeerMetrics
public sealed class PeerMetrics
{
// Constructors
internal PeerMetrics(Clients.DebugApi.Metrics metrics)
Expand Down
2 changes: 1 addition & 1 deletion src/BeeNet/Models/PeersAggregate.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

namespace Etherna.BeeNet.Models
{
public class PeersAggregate
public sealed class PeersAggregate
{
// Constructors.
internal PeersAggregate(Clients.DebugApi.Anonymous2 anonymous)
Expand Down
2 changes: 1 addition & 1 deletion src/BeeNet/Models/PendingTransaction.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

namespace Etherna.BeeNet.Models
{
public class PendingTransaction
public sealed class PendingTransaction
{
// Constructors.
internal PendingTransaction(Clients.DebugApi.PendingTransactions tx)
Expand Down
2 changes: 1 addition & 1 deletion src/BeeNet/Models/PostageBatch.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

namespace Etherna.BeeNet.Models
{
public class PostageBatch
public sealed class PostageBatch
{
// Constructors.
internal PostageBatch(Clients.DebugApi.Response39 batch)
Expand Down
2 changes: 1 addition & 1 deletion src/BeeNet/Models/PostageBatchShort.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

namespace Etherna.BeeNet.Models
{
public class PostageBatchShort
public sealed class PostageBatchShort
{
// Constructors.
internal PostageBatchShort(Clients.DebugApi.Batches batch)
Expand Down
2 changes: 1 addition & 1 deletion src/BeeNet/Models/PostageProof.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

namespace Etherna.BeeNet.Models
{
public class PostageProof
public sealed class PostageProof
{
internal PostageProof(Clients.GatewayApi.PostageProof postageProof)
{
Expand Down
2 changes: 1 addition & 1 deletion src/BeeNet/Models/RedistributionState.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

namespace Etherna.BeeNet.Models
{
public class RedistributionState
public sealed class RedistributionState
{
// Constructors.
internal RedistributionState(Clients.DebugApi.Response31 response)
Expand Down
2 changes: 1 addition & 1 deletion src/BeeNet/Models/ReserveCommitment.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

namespace Etherna.BeeNet.Models
{
public class ReserveCommitment
public sealed class ReserveCommitment
{
// Constructors.
internal ReserveCommitment(Response58 response)
Expand Down
2 changes: 1 addition & 1 deletion src/BeeNet/Models/ReserveCommitmentProof.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

namespace Etherna.BeeNet.Models
{
public class ReserveCommitmentProof
public sealed class ReserveCommitmentProof
{
// Constructors.
internal ReserveCommitmentProof(Proof1 proof)
Expand Down
2 changes: 1 addition & 1 deletion src/BeeNet/Models/ReserveState.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

namespace Etherna.BeeNet.Models
{
public class ReserveState
public sealed class ReserveState
{
// Constructors.
internal ReserveState(Clients.DebugApi.Response12 response)
Expand Down
2 changes: 1 addition & 1 deletion src/BeeNet/Models/ResultChequebook.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

namespace Etherna.BeeNet.Models
{
public class ResultChequebook
public sealed class ResultChequebook
{
// Constructors.
internal ResultChequebook(Clients.DebugApi.Result result)
Expand Down
2 changes: 1 addition & 1 deletion src/BeeNet/Models/Settlement.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

namespace Etherna.BeeNet.Models
{
public class Settlement
public sealed class Settlement
{
// Constructors.
internal Settlement(Clients.DebugApi.Response20 response)
Expand Down
2 changes: 1 addition & 1 deletion src/BeeNet/Models/SettlementData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

namespace Etherna.BeeNet.Models
{
public class SettlementData
public sealed class SettlementData
{
// Constructors.
internal SettlementData(Clients.DebugApi.Settlements settlements)
Expand Down
2 changes: 1 addition & 1 deletion src/BeeNet/Models/SocProof.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

namespace Etherna.BeeNet.Models
{
public class SocProof
public sealed class SocProof
{
// Constructors.
internal SocProof(Clients.GatewayApi.SocProof socProof)
Expand Down
2 changes: 1 addition & 1 deletion src/BeeNet/Models/StampsBuckets.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

namespace Etherna.BeeNet.Models
{
public class StampsBuckets
public sealed class StampsBuckets
{
// Constructors.
internal StampsBuckets(Clients.DebugApi.Response40 response)
Expand Down
2 changes: 1 addition & 1 deletion src/BeeNet/Models/StatusNode.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

namespace Etherna.BeeNet.Models
{
public class StatusNode
public sealed class StatusNode
{
// Constructors.
internal StatusNode(Response47 response)
Expand Down
2 changes: 1 addition & 1 deletion src/BeeNet/Models/StewardshipGet.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

namespace Etherna.BeeNet.Models
{
public class StewardshipGet
public sealed class StewardshipGet
{
// Constructors.
internal StewardshipGet(Clients.GatewayApi.Response19 response)
Expand Down
2 changes: 1 addition & 1 deletion src/BeeNet/Models/TagInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

namespace Etherna.BeeNet.Models
{
public class TagInfo
public sealed class TagInfo
{
// Constructors.
internal TagInfo(Clients.GatewayApi.Response7 response)
Expand Down
2 changes: 1 addition & 1 deletion src/BeeNet/Models/Topology.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

namespace Etherna.BeeNet.Models
{
public class Topology
public sealed class Topology
{
// Constructors.
internal Topology(Clients.DebugApi.Response22 response)
Expand Down
2 changes: 1 addition & 1 deletion src/BeeNet/Models/TransactionInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

namespace Etherna.BeeNet.Models
{
public class TransactionInfo
public sealed class TransactionInfo
{
// Constructors.
internal TransactionInfo(Clients.DebugApi.Response35 response)
Expand Down
2 changes: 1 addition & 1 deletion src/BeeNet/Models/Wallet.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

namespace Etherna.BeeNet.Models
{
public class Wallet
public sealed class Wallet
{
internal Wallet(Clients.DebugApi.Response32 response)
{
Expand Down

0 comments on commit 81469aa

Please sign in to comment.