1 // Code generated by go-swagger; DO NOT EDIT.
5 // This file was generated by the swagger tool.
6 // Editing this file might prove futile when you re-run the swagger generate command
9 strfmt "github.com/go-openapi/strfmt"
11 "github.com/go-openapi/errors"
12 "github.com/go-openapi/swag"
13 "github.com/go-openapi/validate"
16 // XAppConfig x app config
17 // swagger:model XAppConfig
18 type XAppConfig struct {
20 // Configuration in JSON format
22 Config interface{} `json:"config"`
26 Metadata *ConfigMetadata `json:"metadata"`
29 // Validate validates this x app config
30 func (m *XAppConfig) Validate(formats strfmt.Registry) error {
33 if err := m.validateConfig(formats); err != nil {
34 res = append(res, err)
37 if err := m.validateMetadata(formats); err != nil {
38 res = append(res, err)
42 return errors.CompositeValidationError(res...)
47 func (m *XAppConfig) validateConfig(formats strfmt.Registry) error {
49 if err := validate.Required("config", "body", m.Config); err != nil {
56 func (m *XAppConfig) validateMetadata(formats strfmt.Registry) error {
58 if err := validate.Required("metadata", "body", m.Metadata); err != nil {
62 if m.Metadata != nil {
63 if err := m.Metadata.Validate(formats); err != nil {
64 if ve, ok := err.(*errors.Validation); ok {
65 return ve.ValidateName("metadata")
74 // MarshalBinary interface implementation
75 func (m *XAppConfig) MarshalBinary() ([]byte, error) {
79 return swag.WriteJSON(m)
82 // UnmarshalBinary interface implementation
83 func (m *XAppConfig) UnmarshalBinary(b []byte) error {
85 if err := swag.ReadJSON(b, &res); err != nil {