X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=pkg%2Fmodels%2Fx_app_config.go;fp=pkg%2Fmodels%2Fx_app_config.go;h=076e314f3b7b18bda109c0b985b9ca057e153fa4;hb=413abf5f6de7c1808a2dd716ef52ed586c04d8f6;hp=0000000000000000000000000000000000000000;hpb=f1ca2ba79cade327e192e691a4904fff11c88b26;p=ric-plt%2Fxapp-frame.git diff --git a/pkg/models/x_app_config.go b/pkg/models/x_app_config.go new file mode 100644 index 0000000..076e314 --- /dev/null +++ b/pkg/models/x_app_config.go @@ -0,0 +1,90 @@ +// 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 ( + 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 +}