forked from TrueCloudLab/frostfs-sdk-go
[#121] client: Make PrmBalanceGet fields public
Signed-off-by: Airat Arifullin <a.arifullin@yadro.com>
This commit is contained in:
parent
71335489ae
commit
84315fab6a
2 changed files with 10 additions and 9 deletions
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue