Enhancements of REST-based E2 subscription interface
[ric-plt/xapp-frame.git] / pkg / clientmodel / x_app_config.go
diff --git a/pkg/clientmodel/x_app_config.go b/pkg/clientmodel/x_app_config.go
new file mode 100644 (file)
index 0000000..b744f3f
--- /dev/null
@@ -0,0 +1,90 @@
+// 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
+}