github.com/aeternity/aepp-sdk-go@v1.0.3-0.20190606142815-1c0ffdc21fd9/generated/models/inline_response2002.go (about) 1 // Code generated by go-swagger; DO NOT EDIT. 2 3 package 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 strfmt "github.com/go-openapi/strfmt" 10 11 "github.com/go-openapi/errors" 12 "github.com/go-openapi/swag" 13 ) 14 15 // InlineResponse2002 inline response 200 2 16 // swagger:model inline_response_200_2 17 type InlineResponse2002 struct { 18 19 // Count 20 Count Uint32 `json:"count,omitempty"` 21 } 22 23 // Validate validates this inline response 200 2 24 func (m *InlineResponse2002) Validate(formats strfmt.Registry) error { 25 var res []error 26 27 if err := m.validateCount(formats); err != nil { 28 res = append(res, err) 29 } 30 31 if len(res) > 0 { 32 return errors.CompositeValidationError(res...) 33 } 34 return nil 35 } 36 37 func (m *InlineResponse2002) validateCount(formats strfmt.Registry) error { 38 39 if swag.IsZero(m.Count) { // not required 40 return nil 41 } 42 43 if err := m.Count.Validate(formats); err != nil { 44 if ve, ok := err.(*errors.Validation); ok { 45 return ve.ValidateName("count") 46 } 47 return err 48 } 49 50 return nil 51 } 52 53 // MarshalBinary interface implementation 54 func (m *InlineResponse2002) MarshalBinary() ([]byte, error) { 55 if m == nil { 56 return nil, nil 57 } 58 return swag.WriteJSON(m) 59 } 60 61 // UnmarshalBinary interface implementation 62 func (m *InlineResponse2002) UnmarshalBinary(b []byte) error { 63 var res InlineResponse2002 64 if err := swag.ReadJSON(b, &res); err != nil { 65 return err 66 } 67 *m = res 68 return nil 69 }