github.com/ActiveState/cli@v0.0.0-20240508170324-6801f60cd051/pkg/platform/api/mono/mono_models/address_info.go (about) 1 // Code generated by go-swagger; DO NOT EDIT. 2 3 package mono_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 "context" 10 11 "github.com/go-openapi/errors" 12 "github.com/go-openapi/strfmt" 13 "github.com/go-openapi/swag" 14 "github.com/go-openapi/validate" 15 ) 16 17 // AddressInfo address info 18 // 19 // swagger:model AddressInfo 20 type AddressInfo struct { 21 22 // address1 23 // Required: true 24 Address1 string `json:"address1"` 25 26 // address2 27 Address2 *string `json:"address2,omitempty"` 28 29 // city 30 City string `json:"city,omitempty"` 31 32 // country 33 Country string `json:"country,omitempty"` 34 35 // name 36 Name string `json:"name,omitempty"` 37 38 // state 39 State string `json:"state,omitempty"` 40 41 // zip 42 Zip string `json:"zip,omitempty"` 43 } 44 45 // Validate validates this address info 46 func (m *AddressInfo) Validate(formats strfmt.Registry) error { 47 var res []error 48 49 if err := m.validateAddress1(formats); err != nil { 50 res = append(res, err) 51 } 52 53 if len(res) > 0 { 54 return errors.CompositeValidationError(res...) 55 } 56 return nil 57 } 58 59 func (m *AddressInfo) validateAddress1(formats strfmt.Registry) error { 60 61 if err := validate.RequiredString("address1", "body", m.Address1); err != nil { 62 return err 63 } 64 65 return nil 66 } 67 68 // ContextValidate validates this address info based on context it is used 69 func (m *AddressInfo) ContextValidate(ctx context.Context, formats strfmt.Registry) error { 70 return nil 71 } 72 73 // MarshalBinary interface implementation 74 func (m *AddressInfo) MarshalBinary() ([]byte, error) { 75 if m == nil { 76 return nil, nil 77 } 78 return swag.WriteJSON(m) 79 } 80 81 // UnmarshalBinary interface implementation 82 func (m *AddressInfo) UnmarshalBinary(b []byte) error { 83 var res AddressInfo 84 if err := swag.ReadJSON(b, &res); err != nil { 85 return err 86 } 87 *m = res 88 return nil 89 }