github.com/thetreep/go-swagger@v0.0.0-20240223100711-35af64f14f01/fixtures/bugs/1719/pkg/models/user_object_ref.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/swag" 12 ) 13 14 // ExtUserObjectRef user object ref 15 // swagger:model ExtUserObjectRef 16 type ExtUserObjectRef struct { 17 ExtUser 18 } 19 20 // UnmarshalJSON unmarshals this object from a JSON structure 21 func (m *ExtUserObjectRef) UnmarshalJSON(raw []byte) error { 22 // AO0 23 var aO0 ExtUser 24 if err := swag.ReadJSON(raw, &aO0); err != nil { 25 return err 26 } 27 m.ExtUser = aO0 28 29 return nil 30 } 31 32 // MarshalJSON marshals this object to a JSON structure 33 func (m ExtUserObjectRef) MarshalJSON() ([]byte, error) { 34 _parts := make([][]byte, 0, 1) 35 36 aO0, err := swag.WriteJSON(m.ExtUser) 37 if err != nil { 38 return nil, err 39 } 40 _parts = append(_parts, aO0) 41 42 return swag.ConcatJSON(_parts...), nil 43 } 44 45 // Validate validates this user object ref 46 func (m *ExtUserObjectRef) Validate(formats strfmt.Registry) error { 47 return nil 48 } 49 50 // MarshalBinary interface implementation 51 func (m *ExtUserObjectRef) 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 *ExtUserObjectRef) UnmarshalBinary(b []byte) error { 60 var res ExtUserObjectRef 61 if err := swag.ReadJSON(b, &res); err != nil { 62 return err 63 } 64 *m = res 65 return nil 66 }