blob: b744f3f8514b525a4f36fd02144a2cfcc91fec2e [file] [log] [blame]
// Code generated by go-swagger; DO NOT EDIT.
package clientmodel
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
strfmt "github.com/go-openapi/strfmt"
"github.com/go-openapi/errors"
"github.com/go-openapi/swag"
"github.com/go-openapi/validate"
)
// XAppConfig x app config
// swagger:model XAppConfig
type XAppConfig struct {
// Configuration in JSON format
// Required: true
Config interface{} `json:"config"`
// metadata
// Required: true
Metadata *ConfigMetadata `json:"metadata"`
}
// Validate validates this x app config
func (m *XAppConfig) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateConfig(formats); err != nil {
res = append(res, err)
}
if err := m.validateMetadata(formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
func (m *XAppConfig) validateConfig(formats strfmt.Registry) error {
if err := validate.Required("config", "body", m.Config); err != nil {
return err
}
return nil
}
func (m *XAppConfig) validateMetadata(formats strfmt.Registry) error {
if err := validate.Required("metadata", "body", m.Metadata); err != nil {
return err
}
if m.Metadata != nil {
if err := m.Metadata.Validate(formats); err != nil {
if ve, ok := err.(*errors.Validation); ok {
return ve.ValidateName("metadata")
}
return err
}
}
return nil
}
// MarshalBinary interface implementation
func (m *XAppConfig) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *XAppConfig) UnmarshalBinary(b []byte) error {
var res XAppConfig
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}