From 84315fab6aa21af8f1e69393597f803bae1fde27 Mon Sep 17 00:00:00 2001 From: aarifullin Date: Mon, 23 Oct 2023 17:16:13 +0300 Subject: [PATCH] [#121] client: Make PrmBalanceGet fields public Signed-off-by: Airat Arifullin --- client/accounting.go | 14 +++++++------- pool/pool.go | 5 +++-- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/client/accounting.go b/client/accounting.go index 021b26a4..a35fcb16 100644 --- a/client/accounting.go +++ b/client/accounting.go @@ -17,26 +17,26 @@ import ( // PrmBalanceGet groups parameters of BalanceGet operation. type PrmBalanceGet struct { - prmCommonMeta + XHeaders []string - accountSet bool - account user.ID + Account *user.ID } // SetAccount sets identifier of the FrostFS account for which the balance is requested. // Required parameter. +// +// Deprecated: Use PrmBalanceGet.Account instead. func (x *PrmBalanceGet) SetAccount(id user.ID) { - x.account = id - x.accountSet = true + x.Account = &id } func (x *PrmBalanceGet) buildRequest(c *Client) (*v2accounting.BalanceRequest, error) { - if !x.accountSet { + if x.Account == nil { return nil, errorAccountNotSet } var accountV2 refs.OwnerID - x.account.WriteToV2(&accountV2) + x.Account.WriteToV2(&accountV2) var body v2accounting.BalanceRequestBody body.SetOwnerID(&accountV2) diff --git a/pool/pool.go b/pool/pool.go index e4e6a057..a3337112 100644 --- a/pool/pool.go +++ b/pool/pool.go @@ -417,8 +417,9 @@ func (c *clientWrapper) balanceGet(ctx context.Context, prm PrmBalanceGet) (acco return accounting.Decimal{}, err } - var cliPrm sdkClient.PrmBalanceGet - cliPrm.SetAccount(prm.account) + cliPrm := sdkClient.PrmBalanceGet{ + Account: &prm.account, + } start := time.Now() res, err := cl.BalanceGet(ctx, cliPrm)