github.com/ActiveState/cli@v0.0.0-20240508170324-6801f60cd051/pkg/platform/api/buildlogstream/buildlogstream_models/task_skipped.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 // TaskSkipped Task Skipped 16 // 17 // A message indicating that a requested task for a build has been skipped. 18 // 19 // swagger:model taskSkipped 20 type TaskSkipped struct { 21 22 // reason 23 // Required: true 24 Reason *string `json:"reason"` 25 26 // task 27 // Required: true 28 Task *string `json:"task"` 29 } 30 31 // Validate validates this task skipped 32 func (m *TaskSkipped) Validate(formats strfmt.Registry) error { 33 var res []error 34 35 if err := m.validateReason(formats); err != nil { 36 res = append(res, err) 37 } 38 39 if err := m.validateTask(formats); err != nil { 40 res = append(res, err) 41 } 42 43 if len(res) > 0 { 44 return errors.CompositeValidationError(res...) 45 } 46 return nil 47 } 48 49 func (m *TaskSkipped) validateReason(formats strfmt.Registry) error { 50 51 if err := validate.Required("reason", "body", m.Reason); err != nil { 52 return err 53 } 54 55 return nil 56 } 57 58 func (m *TaskSkipped) validateTask(formats strfmt.Registry) error { 59 60 if err := validate.Required("task", "body", m.Task); err != nil { 61 return err 62 } 63 64 return nil 65 } 66 67 // MarshalBinary interface implementation 68 func (m *TaskSkipped) MarshalBinary() ([]byte, error) { 69 if m == nil { 70 return nil, nil 71 } 72 return swag.WriteJSON(m) 73 } 74 75 // UnmarshalBinary interface implementation 76 func (m *TaskSkipped) UnmarshalBinary(b []byte) error { 77 var res TaskSkipped 78 if err := swag.ReadJSON(b, &res); err != nil { 79 return err 80 } 81 *m = res 82 return nil 83 }