This repository has been archived on 2024-09-11. You can view files and clone it, but cannot push or open issues or pull requests.
frostfs-rest-gw/gen/models/balance.go
Denis Kirillov 6e01a0ead7 [#33] Add route to get NeoFS balance
Signed-off-by: Denis Kirillov <denis@nspcc.ru>
2022-07-29 12:08:55 +03:00

105 lines
2.1 KiB
Go

// Code generated by go-swagger; DO NOT EDIT.
package models
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"context"
"github.com/go-openapi/errors"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
"github.com/go-openapi/validate"
)
// Balance balance
//
// swagger:model Balance
type Balance struct {
// address
// Required: true
Address *string `json:"address"`
// precision
// Required: true
Precision *int64 `json:"precision"`
// value
// Required: true
Value *string `json:"value"`
}
// Validate validates this balance
func (m *Balance) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateAddress(formats); err != nil {
res = append(res, err)
}
if err := m.validatePrecision(formats); err != nil {
res = append(res, err)
}
if err := m.validateValue(formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *Balance) validateAddress(formats strfmt.Registry) error {
if err := validate.Required("address", "body", m.Address); err != nil {
return err
}
return nil
}
func (m *Balance) validatePrecision(formats strfmt.Registry) error {
if err := validate.Required("precision", "body", m.Precision); err != nil {
return err
}
return nil
}
func (m *Balance) validateValue(formats strfmt.Registry) error {
if err := validate.Required("value", "body", m.Value); err != nil {
return err
}
return nil
}
// ContextValidate validates this balance based on context it is used
func (m *Balance) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
return nil
}
// MarshalBinary interface implementation
func (m *Balance) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *Balance) UnmarshalBinary(b []byte) error {
var res Balance
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}