69 lines
1.1 KiB
Go
69 lines
1.1 KiB
Go
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 (
|
|
strfmt "github.com/go-openapi/strfmt"
|
|
|
|
"github.com/go-openapi/errors"
|
|
"github.com/go-openapi/validate"
|
|
)
|
|
|
|
/*Link URI of resource.
|
|
|
|
swagger:model Link
|
|
*/
|
|
type Link struct {
|
|
|
|
/* href
|
|
|
|
Required: true
|
|
*/
|
|
Href *string `json:"href"`
|
|
|
|
/* rel
|
|
|
|
Required: true
|
|
*/
|
|
Rel *string `json:"rel"`
|
|
}
|
|
|
|
// Validate validates this link
|
|
func (m *Link) Validate(formats strfmt.Registry) error {
|
|
var res []error
|
|
|
|
if err := m.validateHref(formats); err != nil {
|
|
// prop
|
|
res = append(res, err)
|
|
}
|
|
|
|
if err := m.validateRel(formats); err != nil {
|
|
// prop
|
|
res = append(res, err)
|
|
}
|
|
|
|
if len(res) > 0 {
|
|
return errors.CompositeValidationError(res...)
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func (m *Link) validateHref(formats strfmt.Registry) error {
|
|
|
|
if err := validate.Required("href", "body", m.Href); err != nil {
|
|
return err
|
|
}
|
|
|
|
return nil
|
|
}
|
|
|
|
func (m *Link) validateRel(formats strfmt.Registry) error {
|
|
|
|
if err := validate.Required("rel", "body", m.Rel); err != nil {
|
|
return err
|
|
}
|
|
|
|
return nil
|
|
}
|