[#26] All: Remove V2 from naming
Rename project, namespaces and class names Signed-off-by: Pavel Gross <p.gross@yadro.com>
This commit is contained in:
parent
c406df1a78
commit
766f61a5f7
219 changed files with 219 additions and 974 deletions
40
src/FrostFS.SDK.Client/Services/AccountingServiceProvider.cs
Normal file
40
src/FrostFS.SDK.Client/Services/AccountingServiceProvider.cs
Normal file
|
@ -0,0 +1,40 @@
|
|||
using System.Threading.Tasks;
|
||||
|
||||
using FrostFS.Accounting;
|
||||
|
||||
namespace FrostFS.SDK.Client;
|
||||
|
||||
internal sealed class AccountingServiceProvider : ContextAccessor
|
||||
{
|
||||
private readonly AccountingService.AccountingServiceClient? _accountingServiceClient;
|
||||
|
||||
internal AccountingServiceProvider(
|
||||
AccountingService.AccountingServiceClient? accountingServiceClient,
|
||||
ClientContext context)
|
||||
: base(context)
|
||||
{
|
||||
_accountingServiceClient = accountingServiceClient;
|
||||
}
|
||||
|
||||
internal async Task<Decimal> GetBallance(PrmBalance args)
|
||||
{
|
||||
var ctx = args.Context!;
|
||||
|
||||
BalanceRequest request = new()
|
||||
{
|
||||
Body = new()
|
||||
{
|
||||
OwnerId = ctx.OwnerId!.OwnerID
|
||||
}
|
||||
};
|
||||
|
||||
request.AddMetaHeader(args.XHeaders);
|
||||
request.Sign(ctx.Key!);
|
||||
|
||||
var response = await _accountingServiceClient!.BalanceAsync(request, null, ctx.Deadline, ctx.CancellationToken);
|
||||
|
||||
Verifier.CheckResponse(response);
|
||||
|
||||
return response.Body.Balance;
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue