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
11 "github.com/go-openapi/errors"
12 "github.com/go-openapi/strfmt"
13 "github.com/go-openapi/swag"
14 "github.com/go-openapi/validate"
17 // ConfigMetadata config metadata
19 // swagger:model ConfigMetadata
20 type ConfigMetadata struct {
22 // The type of the content
24 // Enum: [json xml other]
25 ConfigType *string `json:"configType"`
29 XappName *string `json:"xappName"`
32 // Validate validates this config metadata
33 func (m *ConfigMetadata) Validate(formats strfmt.Registry) error {
36 if err := m.validateConfigType(formats); err != nil {
37 res = append(res, err)
40 if err := m.validateXappName(formats); err != nil {
41 res = append(res, err)
45 return errors.CompositeValidationError(res...)
50 var configMetadataTypeConfigTypePropEnum []interface{}
54 if err := json.Unmarshal([]byte(`["json","xml","other"]`), &res); err != nil {
57 for _, v := range res {
58 configMetadataTypeConfigTypePropEnum = append(configMetadataTypeConfigTypePropEnum, v)
64 // ConfigMetadataConfigTypeJSON captures enum value "json"
65 ConfigMetadataConfigTypeJSON string = "json"
67 // ConfigMetadataConfigTypeXML captures enum value "xml"
68 ConfigMetadataConfigTypeXML string = "xml"
70 // ConfigMetadataConfigTypeOther captures enum value "other"
71 ConfigMetadataConfigTypeOther string = "other"
75 func (m *ConfigMetadata) validateConfigTypeEnum(path, location string, value string) error {
76 if err := validate.Enum(path, location, value, configMetadataTypeConfigTypePropEnum); err != nil {
82 func (m *ConfigMetadata) validateConfigType(formats strfmt.Registry) error {
84 if err := validate.Required("configType", "body", m.ConfigType); err != nil {
89 if err := m.validateConfigTypeEnum("configType", "body", *m.ConfigType); err != nil {
96 func (m *ConfigMetadata) validateXappName(formats strfmt.Registry) error {
98 if err := validate.Required("xappName", "body", m.XappName); err != nil {
105 // MarshalBinary interface implementation
106 func (m *ConfigMetadata) MarshalBinary() ([]byte, error) {
110 return swag.WriteJSON(m)
113 // UnmarshalBinary interface implementation
114 func (m *ConfigMetadata) UnmarshalBinary(b []byte) error {
115 var res ConfigMetadata
116 if err := swag.ReadJSON(b, &res); err != nil {