2020-08-14 16:00:16 +00:00
|
|
|
package accounting
|
|
|
|
|
|
|
|
import (
|
2023-03-07 10:38:56 +00:00
|
|
|
"git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs"
|
|
|
|
"git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/session"
|
2020-08-14 16:00:16 +00:00
|
|
|
)
|
2020-08-14 12:51:10 +00:00
|
|
|
|
|
|
|
type BalanceRequestBody struct {
|
2020-08-14 16:00:16 +00:00
|
|
|
ownerID *refs.OwnerID
|
2020-08-14 12:51:10 +00:00
|
|
|
}
|
|
|
|
|
2020-08-17 10:39:46 +00:00
|
|
|
type BalanceResponseBody struct {
|
|
|
|
bal *Decimal
|
|
|
|
}
|
|
|
|
|
2020-08-17 10:29:21 +00:00
|
|
|
type Decimal struct {
|
|
|
|
val int64
|
|
|
|
|
|
|
|
prec uint32
|
|
|
|
}
|
|
|
|
|
2021-03-12 12:57:23 +00:00
|
|
|
type BalanceRequest struct {
|
|
|
|
body *BalanceRequestBody
|
|
|
|
|
|
|
|
session.RequestHeaders
|
|
|
|
}
|
|
|
|
|
|
|
|
type BalanceResponse struct {
|
|
|
|
body *BalanceResponseBody
|
|
|
|
|
|
|
|
session.ResponseHeaders
|
|
|
|
}
|
|
|
|
|
2020-08-14 16:00:16 +00:00
|
|
|
func (b *BalanceRequestBody) GetOwnerID() *refs.OwnerID {
|
2020-08-14 12:51:10 +00:00
|
|
|
if b != nil {
|
|
|
|
return b.ownerID
|
|
|
|
}
|
|
|
|
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
2020-08-14 16:00:16 +00:00
|
|
|
func (b *BalanceRequestBody) SetOwnerID(v *refs.OwnerID) {
|
2022-03-23 11:42:57 +00:00
|
|
|
b.ownerID = v
|
2020-08-14 12:51:10 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (b *BalanceRequest) GetBody() *BalanceRequestBody {
|
|
|
|
if b != nil {
|
|
|
|
return b.body
|
|
|
|
}
|
|
|
|
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
func (b *BalanceRequest) SetBody(v *BalanceRequestBody) {
|
2022-03-23 11:42:57 +00:00
|
|
|
b.body = v
|
2020-08-14 12:51:10 +00:00
|
|
|
}
|
|
|
|
|
2020-08-17 10:29:21 +00:00
|
|
|
func (d *Decimal) GetValue() int64 {
|
|
|
|
if d != nil {
|
|
|
|
return d.val
|
|
|
|
}
|
|
|
|
|
|
|
|
return 0
|
|
|
|
}
|
|
|
|
|
|
|
|
func (d *Decimal) SetValue(v int64) {
|
2022-03-23 11:42:57 +00:00
|
|
|
d.val = v
|
2020-08-17 10:29:21 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (d *Decimal) GetPrecision() uint32 {
|
|
|
|
if d != nil {
|
|
|
|
return d.prec
|
|
|
|
}
|
|
|
|
|
|
|
|
return 0
|
|
|
|
}
|
|
|
|
|
|
|
|
func (d *Decimal) SetPrecision(v uint32) {
|
2022-03-23 11:42:57 +00:00
|
|
|
d.prec = v
|
2020-08-17 10:29:21 +00:00
|
|
|
}
|
2020-08-17 10:39:46 +00:00
|
|
|
|
|
|
|
func (br *BalanceResponseBody) GetBalance() *Decimal {
|
|
|
|
if br != nil {
|
|
|
|
return br.bal
|
|
|
|
}
|
|
|
|
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
func (br *BalanceResponseBody) SetBalance(v *Decimal) {
|
2022-03-23 11:42:57 +00:00
|
|
|
br.bal = v
|
2020-08-17 10:39:46 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (br *BalanceResponse) GetBody() *BalanceResponseBody {
|
|
|
|
if br != nil {
|
|
|
|
return br.body
|
|
|
|
}
|
|
|
|
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
func (br *BalanceResponse) SetBody(v *BalanceResponseBody) {
|
2022-03-23 11:42:57 +00:00
|
|
|
br.body = v
|
2020-08-17 10:39:46 +00:00
|
|
|
}
|