1 Star 0 Fork 0

pengchengduan / goharbor-client

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
project_summary_quota.go 1.91 KB
一键复制 编辑 原始数据 按行查看 历史
pengchengduan 提交于 2024-02-01 17:28 . first commit
// Code generated by go-swagger; DO NOT EDIT.
package model
// 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"
)
// ProjectSummaryQuota project summary quota
//
// swagger:model ProjectSummaryQuota
type ProjectSummaryQuota struct {
// The hard limits of the quota
Hard ResourceList `json:"hard,omitempty"`
// The used status of the quota
Used ResourceList `json:"used,omitempty"`
}
// Validate validates this project summary quota
func (m *ProjectSummaryQuota) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateHard(formats); err != nil {
res = append(res, err)
}
if err := m.validateUsed(formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *ProjectSummaryQuota) validateHard(formats strfmt.Registry) error {
if swag.IsZero(m.Hard) { // not required
return nil
}
if err := m.Hard.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("hard")
}
return err
}
return nil
}
func (m *ProjectSummaryQuota) validateUsed(formats strfmt.Registry) error {
if swag.IsZero(m.Used) { // not required
return nil
}
if err := m.Used.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("used")
}
return err
}
return nil
}
// MarshalBinary interface implementation
func (m *ProjectSummaryQuota) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *ProjectSummaryQuota) UnmarshalBinary(b []byte) error {
var res ProjectSummaryQuota
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}
1
https://gitee.com/pengchengduan/goharbor-client.git
git@gitee.com:pengchengduan/goharbor-client.git
pengchengduan
goharbor-client
goharbor-client
41c6882efe91

搜索帮助