Files
autogits/common/gitea-generated/models/action_task.go

145 lines
3.5 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"
)
// ActionTask ActionTask represents a ActionTask
//
// swagger:model ActionTask
type ActionTask struct {
// created at
// Format: date-time
CreatedAt strfmt.DateTime `json:"created_at,omitempty"`
// DisplayTitle is the display title for the workflow run
DisplayTitle string `json:"display_title,omitempty"`
// Event is the type of event that triggered the workflow
Event string `json:"event,omitempty"`
// HeadBranch is the branch that triggered the workflow
HeadBranch string `json:"head_branch,omitempty"`
// HeadSHA is the commit SHA that triggered the workflow
HeadSHA string `json:"head_sha,omitempty"`
// ID is the unique identifier for the action task
ID int64 `json:"id,omitempty"`
// Name is the name of the workflow
Name string `json:"name,omitempty"`
// RunNumber is the sequential number of the workflow run
RunNumber int64 `json:"run_number,omitempty"`
// run started at
// Format: date-time
RunStartedAt strfmt.DateTime `json:"run_started_at,omitempty"`
// Status indicates the current status of the workflow run
Status string `json:"status,omitempty"`
// URL is the API URL for this workflow run
URL string `json:"url,omitempty"`
// updated at
// Format: date-time
UpdatedAt strfmt.DateTime `json:"updated_at,omitempty"`
// WorkflowID is the identifier of the workflow
WorkflowID string `json:"workflow_id,omitempty"`
}
// Validate validates this action task
func (m *ActionTask) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateCreatedAt(formats); err != nil {
res = append(res, err)
}
if err := m.validateRunStartedAt(formats); err != nil {
res = append(res, err)
}
if err := m.validateUpdatedAt(formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *ActionTask) validateCreatedAt(formats strfmt.Registry) error {
if swag.IsZero(m.CreatedAt) { // not required
return nil
}
if err := validate.FormatOf("created_at", "body", "date-time", m.CreatedAt.String(), formats); err != nil {
return err
}
return nil
}
func (m *ActionTask) validateRunStartedAt(formats strfmt.Registry) error {
if swag.IsZero(m.RunStartedAt) { // not required
return nil
}
if err := validate.FormatOf("run_started_at", "body", "date-time", m.RunStartedAt.String(), formats); err != nil {
return err
}
return nil
}
func (m *ActionTask) validateUpdatedAt(formats strfmt.Registry) error {
if swag.IsZero(m.UpdatedAt) { // not required
return nil
}
if err := validate.FormatOf("updated_at", "body", "date-time", m.UpdatedAt.String(), formats); err != nil {
return err
}
return nil
}
// ContextValidate validates this action task based on context it is used
func (m *ActionTask) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
return nil
}
// MarshalBinary interface implementation
func (m *ActionTask) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *ActionTask) UnmarshalBinary(b []byte) error {
var res ActionTask
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}