Cyclops 4 HPC is the purpose built stack to support large HPC centers with resource accounting and billing of cluster as well as cloud resources.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
cyclops-4-hpc/services/credit-system/models/credit_status.go

78 lines
1.8 KiB

// 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 (
"github.com/go-openapi/errors"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
"github.com/go-openapi/validate"
)
// CreditStatus credit status
//
// swagger:model CreditStatus
type CreditStatus struct {
// account ID
AccountID string `json:"AccountID,omitempty" gorm:"primary_key"`
// available cash
AvailableCash float64 `json:"AvailableCash,omitempty" gorm:"type:numeric(23,13);default:0.0"`
// available credit
AvailableCredit float64 `json:"AvailableCredit,omitempty" gorm:"type:numeric(23,13);default:0.0"`
// last update
// Format: datetime
LastUpdate strfmt.DateTime `json:"LastUpdate,omitempty" gorm:"type:timestamptz"`
}
// Validate validates this credit status
func (m *CreditStatus) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateLastUpdate(formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *CreditStatus) validateLastUpdate(formats strfmt.Registry) error {
if swag.IsZero(m.LastUpdate) { // not required
return nil
}
if err := validate.FormatOf("LastUpdate", "body", "datetime", m.LastUpdate.String(), formats); err != nil {
return err
}
return nil
}
// MarshalBinary interface implementation
func (m *CreditStatus) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *CreditStatus) UnmarshalBinary(b []byte) error {
var res CreditStatus
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}