github.com/ActiveState/cli@v0.0.0-20240508170324-6801f60cd051/pkg/platform/api/buildlogstream/buildlogstream_models/task_scheduled.go (about) 1 // Code generated by go-swagger; DO NOT EDIT. 2 3 package buildlogstream_models 4 5 // This file was generated by the swagger tool. 6 // Editing this file might prove futile when you re-run the swagger generate command 7 8 import ( 9 "github.com/go-openapi/errors" 10 "github.com/go-openapi/strfmt" 11 "github.com/go-openapi/swag" 12 "github.com/go-openapi/validate" 13 ) 14 15 // TaskScheduled Task Scheduled 16 // 17 // A message indicating that a task will run as part of a build. 18 // 19 // swagger:model taskScheduled 20 type TaskScheduled struct { 21 22 // task 23 // Required: true 24 Task *string `json:"task"` 25 } 26 27 // Validate validates this task scheduled 28 func (m *TaskScheduled) Validate(formats strfmt.Registry) error { 29 var res []error 30 31 if err := m.validateTask(formats); err != nil { 32 res = append(res, err) 33 } 34 35 if len(res) > 0 { 36 return errors.CompositeValidationError(res...) 37 } 38 return nil 39 } 40 41 func (m *TaskScheduled) validateTask(formats strfmt.Registry) error { 42 43 if err := validate.Required("task", "body", m.Task); err != nil { 44 return err 45 } 46 47 return nil 48 } 49 50 // MarshalBinary interface implementation 51 func (m *TaskScheduled) MarshalBinary() ([]byte, error) { 52 if m == nil { 53 return nil, nil 54 } 55 return swag.WriteJSON(m) 56 } 57 58 // UnmarshalBinary interface implementation 59 func (m *TaskScheduled) UnmarshalBinary(b []byte) error { 60 var res TaskScheduled 61 if err := swag.ReadJSON(b, &res); err != nil { 62 return err 63 } 64 *m = res 65 return nil 66 }