2020-08-14 16:00:16 +00:00
|
|
|
package accounting
|
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/nspcc-dev/neofs-api-go/v2/refs"
|
|
|
|
"github.com/nspcc-dev/neofs-api-go/v2/service"
|
|
|
|
)
|
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
|
|
|
}
|
|
|
|
|
|
|
|
type BalanceRequest struct {
|
|
|
|
body *BalanceRequestBody
|
|
|
|
|
2020-08-14 16:00:16 +00:00
|
|
|
metaHeader *service.RequestMetaHeader
|
2020-08-14 12:51:10 +00:00
|
|
|
|
2020-08-14 16:00:16 +00:00
|
|
|
verifyHeader *service.RequestVerificationHeader
|
2020-08-14 12:51:10 +00:00
|
|
|
}
|
|
|
|
|
2020-08-17 10:39:46 +00:00
|
|
|
type BalanceResponseBody struct {
|
|
|
|
bal *Decimal
|
|
|
|
}
|
|
|
|
|
|
|
|
type BalanceResponse struct {
|
|
|
|
body *BalanceResponseBody
|
|
|
|
|
|
|
|
metaHeader *service.ResponseMetaHeader
|
|
|
|
|
|
|
|
verifyHeader *service.ResponseVerificationHeader
|
|
|
|
}
|
|
|
|
|
2020-08-17 10:29:21 +00:00
|
|
|
type Decimal struct {
|
|
|
|
val int64
|
|
|
|
|
|
|
|
prec uint32
|
|
|
|
}
|
|
|
|
|
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) {
|
2020-08-14 12:51:10 +00:00
|
|
|
if b != nil {
|
|
|
|
b.ownerID = v
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
func (b *BalanceRequest) GetBody() *BalanceRequestBody {
|
|
|
|
if b != nil {
|
|
|
|
return b.body
|
|
|
|
}
|
|
|
|
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
func (b *BalanceRequest) SetBody(v *BalanceRequestBody) {
|
|
|
|
if b != nil {
|
|
|
|
b.body = v
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-08-17 10:43:17 +00:00
|
|
|
func (b *BalanceRequest) GetMetaHeader() *service.RequestMetaHeader {
|
2020-08-14 12:51:10 +00:00
|
|
|
if b != nil {
|
|
|
|
return b.metaHeader
|
|
|
|
}
|
|
|
|
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
2020-08-17 10:43:17 +00:00
|
|
|
func (b *BalanceRequest) SetMetaHeader(v *service.RequestMetaHeader) {
|
2020-08-14 12:51:10 +00:00
|
|
|
if b != nil {
|
|
|
|
b.metaHeader = v
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-08-17 10:43:17 +00:00
|
|
|
func (b *BalanceRequest) GetVerificationHeader() *service.RequestVerificationHeader {
|
2020-08-14 12:51:10 +00:00
|
|
|
if b != nil {
|
|
|
|
return b.verifyHeader
|
|
|
|
}
|
|
|
|
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
2020-08-17 10:43:17 +00:00
|
|
|
func (b *BalanceRequest) SetVerificationHeader(v *service.RequestVerificationHeader) {
|
2020-08-14 12:51:10 +00:00
|
|
|
if b != nil {
|
|
|
|
b.verifyHeader = v
|
|
|
|
}
|
|
|
|
}
|
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) {
|
|
|
|
if d != nil {
|
|
|
|
d.val = v
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
func (d *Decimal) GetPrecision() uint32 {
|
|
|
|
if d != nil {
|
|
|
|
return d.prec
|
|
|
|
}
|
|
|
|
|
|
|
|
return 0
|
|
|
|
}
|
|
|
|
|
|
|
|
func (d *Decimal) SetPrecision(v uint32) {
|
|
|
|
if d != nil {
|
|
|
|
d.prec = v
|
|
|
|
}
|
|
|
|
}
|
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) {
|
|
|
|
if br != nil {
|
2020-08-18 06:48:25 +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) {
|
|
|
|
if br != nil {
|
|
|
|
br.body = v
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-08-17 10:43:17 +00:00
|
|
|
func (br *BalanceResponse) GetMetaHeader() *service.ResponseMetaHeader {
|
2020-08-17 10:39:46 +00:00
|
|
|
if br != nil {
|
|
|
|
return br.metaHeader
|
|
|
|
}
|
|
|
|
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
2020-08-17 10:43:17 +00:00
|
|
|
func (br *BalanceResponse) SetMetaHeader(v *service.ResponseMetaHeader) {
|
2020-08-17 10:39:46 +00:00
|
|
|
if br != nil {
|
|
|
|
br.metaHeader = v
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-08-17 10:43:17 +00:00
|
|
|
func (br *BalanceResponse) GetVerificationHeader() *service.ResponseVerificationHeader {
|
2020-08-17 10:39:46 +00:00
|
|
|
if br != nil {
|
|
|
|
return br.verifyHeader
|
|
|
|
}
|
|
|
|
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
2020-08-17 10:43:17 +00:00
|
|
|
func (br *BalanceResponse) SetVerificationHeader(v *service.ResponseVerificationHeader) {
|
2020-08-17 10:39:46 +00:00
|
|
|
if br != nil {
|
|
|
|
br.verifyHeader = v
|
|
|
|
}
|
|
|
|
}
|