blob: f5642873077858987fd88478222af886c226d7a3 [file] [log] [blame]
// Code generated by go-swagger; DO NOT EDIT.
package models
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"encoding/json"
strfmt "github.com/go-openapi/strfmt"
"github.com/go-openapi/errors"
"github.com/go-openapi/swag"
"github.com/go-openapi/validate"
)
// ConfigMetadata config metadata
// swagger:model ConfigMetadata
type ConfigMetadata struct {
// The type of the content
// Required: true
// Enum: [json xml other]
ConfigType *string `json:"configType"`
// Name of the xApp
// Required: true
XappName *string `json:"xappName"`
}
// Validate validates this config metadata
func (m *ConfigMetadata) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateConfigType(formats); err != nil {
res = append(res, err)
}
if err := m.validateXappName(formats); err != nil {
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
var configMetadataTypeConfigTypePropEnum []interface{}
func init() {
var res []string
if err := json.Unmarshal([]byte(`["json","xml","other"]`), &res); err != nil {
panic(err)
}
for _, v := range res {
configMetadataTypeConfigTypePropEnum = append(configMetadataTypeConfigTypePropEnum, v)
}
}
const (
// ConfigMetadataConfigTypeJSON captures enum value "json"
ConfigMetadataConfigTypeJSON string = "json"
// ConfigMetadataConfigTypeXML captures enum value "xml"
ConfigMetadataConfigTypeXML string = "xml"
// ConfigMetadataConfigTypeOther captures enum value "other"
ConfigMetadataConfigTypeOther string = "other"
)
// prop value enum
func (m *ConfigMetadata) validateConfigTypeEnum(path, location string, value string) error {
if err := validate.Enum(path, location, value, configMetadataTypeConfigTypePropEnum); err != nil {
return err
}
return nil
}
func (m *ConfigMetadata) validateConfigType(formats strfmt.Registry) error {
if err := validate.Required("configType", "body", m.ConfigType); err != nil {
return err
}
// value enum
if err := m.validateConfigTypeEnum("configType", "body", *m.ConfigType); err != nil {
return err
}
return nil
}
func (m *ConfigMetadata) validateXappName(formats strfmt.Registry) error {
if err := validate.Required("xappName", "body", m.XappName); err != nil {
return err
}
return nil
}
// MarshalBinary interface implementation
func (m *ConfigMetadata) MarshalBinary() ([]byte, error) {
if m == nil {
return nil, nil
}
return swag.WriteJSON(m)
}
// UnmarshalBinary interface implementation
func (m *ConfigMetadata) UnmarshalBinary(b []byte) error {
var res ConfigMetadata
if err := swag.ReadJSON(b, &res); err != nil {
return err
}
*m = res
return nil
}