github.com/TrueCloudLab/frostfs-api-go/v2@v2.0.0-20230228134343-196241c4e79a/accounting/accounting.go (about)

     1  package accounting
     2  
     3  import (
     4  	"github.com/TrueCloudLab/frostfs-api-go/v2/refs"
     5  	"github.com/TrueCloudLab/frostfs-api-go/v2/session"
     6  )
     7  
     8  type BalanceRequestBody struct {
     9  	ownerID *refs.OwnerID
    10  }
    11  
    12  type BalanceResponseBody struct {
    13  	bal *Decimal
    14  }
    15  
    16  type Decimal struct {
    17  	val int64
    18  
    19  	prec uint32
    20  }
    21  
    22  type BalanceRequest struct {
    23  	body *BalanceRequestBody
    24  
    25  	session.RequestHeaders
    26  }
    27  
    28  type BalanceResponse struct {
    29  	body *BalanceResponseBody
    30  
    31  	session.ResponseHeaders
    32  }
    33  
    34  func (b *BalanceRequestBody) GetOwnerID() *refs.OwnerID {
    35  	if b != nil {
    36  		return b.ownerID
    37  	}
    38  
    39  	return nil
    40  }
    41  
    42  func (b *BalanceRequestBody) SetOwnerID(v *refs.OwnerID) {
    43  	b.ownerID = v
    44  }
    45  
    46  func (b *BalanceRequest) GetBody() *BalanceRequestBody {
    47  	if b != nil {
    48  		return b.body
    49  	}
    50  
    51  	return nil
    52  }
    53  
    54  func (b *BalanceRequest) SetBody(v *BalanceRequestBody) {
    55  	b.body = v
    56  }
    57  
    58  func (d *Decimal) GetValue() int64 {
    59  	if d != nil {
    60  		return d.val
    61  	}
    62  
    63  	return 0
    64  }
    65  
    66  func (d *Decimal) SetValue(v int64) {
    67  	d.val = v
    68  }
    69  
    70  func (d *Decimal) GetPrecision() uint32 {
    71  	if d != nil {
    72  		return d.prec
    73  	}
    74  
    75  	return 0
    76  }
    77  
    78  func (d *Decimal) SetPrecision(v uint32) {
    79  	d.prec = v
    80  }
    81  
    82  func (br *BalanceResponseBody) GetBalance() *Decimal {
    83  	if br != nil {
    84  		return br.bal
    85  	}
    86  
    87  	return nil
    88  }
    89  
    90  func (br *BalanceResponseBody) SetBalance(v *Decimal) {
    91  	br.bal = v
    92  }
    93  
    94  func (br *BalanceResponse) GetBody() *BalanceResponseBody {
    95  	if br != nil {
    96  		return br.body
    97  	}
    98  
    99  	return nil
   100  }
   101  
   102  func (br *BalanceResponse) SetBody(v *BalanceResponseBody) {
   103  	br.body = v
   104  }