87 lines
1.9 KiB
Go
87 lines
1.9 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"
|
||
|
)
|
||
|
|
||
|
// CreateReleaseOption CreateReleaseOption options when creating a release
|
||
|
//
|
||
|
// swagger:model CreateReleaseOption
|
||
|
type CreateReleaseOption struct {
|
||
|
|
||
|
// is draft
|
||
|
IsDraft bool `json:"draft,omitempty"`
|
||
|
|
||
|
// is prerelease
|
||
|
IsPrerelease bool `json:"prerelease,omitempty"`
|
||
|
|
||
|
// note
|
||
|
Note string `json:"body,omitempty"`
|
||
|
|
||
|
// tag name
|
||
|
// Required: true
|
||
|
TagName *string `json:"tag_name"`
|
||
|
|
||
|
// target
|
||
|
Target string `json:"target_commitish,omitempty"`
|
||
|
|
||
|
// title
|
||
|
Title string `json:"name,omitempty"`
|
||
|
}
|
||
|
|
||
|
// Validate validates this create release option
|
||
|
func (m *CreateReleaseOption) Validate(formats strfmt.Registry) error {
|
||
|
var res []error
|
||
|
|
||
|
if err := m.validateTagName(formats); err != nil {
|
||
|
res = append(res, err)
|
||
|
}
|
||
|
|
||
|
if len(res) > 0 {
|
||
|
return errors.CompositeValidationError(res...)
|
||
|
}
|
||
|
return nil
|
||
|
}
|
||
|
|
||
|
func (m *CreateReleaseOption) validateTagName(formats strfmt.Registry) error {
|
||
|
|
||
|
if err := validate.Required("tag_name", "body", m.TagName); err != nil {
|
||
|
return err
|
||
|
}
|
||
|
|
||
|
return nil
|
||
|
}
|
||
|
|
||
|
// ContextValidate validates this create release option based on context it is used
|
||
|
func (m *CreateReleaseOption) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
|
||
|
return nil
|
||
|
}
|
||
|
|
||
|
// MarshalBinary interface implementation
|
||
|
func (m *CreateReleaseOption) MarshalBinary() ([]byte, error) {
|
||
|
if m == nil {
|
||
|
return nil, nil
|
||
|
}
|
||
|
return swag.WriteJSON(m)
|
||
|
}
|
||
|
|
||
|
// UnmarshalBinary interface implementation
|
||
|
func (m *CreateReleaseOption) UnmarshalBinary(b []byte) error {
|
||
|
var res CreateReleaseOption
|
||
|
if err := swag.ReadJSON(b, &res); err != nil {
|
||
|
return err
|
||
|
}
|
||
|
*m = res
|
||
|
return nil
|
||
|
}
|