// Code generated by go-swagger; DO NOT EDIT. package pipeline_model // This file was generated by the swagger tool. // Editing this file might prove futile when you re-run the swagger generate command import ( "strconv" strfmt "github.com/go-openapi/strfmt" "github.com/go-openapi/errors" "github.com/go-openapi/swag" ) // APIStatus api status // swagger:model apiStatus type APIStatus struct { // code Code int32 `json:"code,omitempty"` // details Details []*ProtobufAny `json:"details"` // error Error string `json:"error,omitempty"` } // Validate validates this api status func (m *APIStatus) Validate(formats strfmt.Registry) error { var res []error if err := m.validateDetails(formats); err != nil { res = append(res, err) } if len(res) > 0 { return errors.CompositeValidationError(res...) } return nil } func (m *APIStatus) validateDetails(formats strfmt.Registry) error { if swag.IsZero(m.Details) { // not required return nil } for i := 0; i < len(m.Details); i++ { if swag.IsZero(m.Details[i]) { // not required continue } if m.Details[i] != nil { if err := m.Details[i].Validate(formats); err != nil { if ve, ok := err.(*errors.Validation); ok { return ve.ValidateName("details" + "." + strconv.Itoa(i)) } return err } } } return nil } // MarshalBinary interface implementation func (m *APIStatus) MarshalBinary() ([]byte, error) { if m == nil { return nil, nil } return swag.WriteJSON(m) } // UnmarshalBinary interface implementation func (m *APIStatus) UnmarshalBinary(b []byte) error { var res APIStatus if err := swag.ReadJSON(b, &res); err != nil { return err } *m = res return nil }