diff --git a/pkg/clientmodel/action_definition.go b/pkg/clientmodel/action_definition.go
new file mode 100644
index 0000000..54ca9d2
--- /dev/null
+++ b/pkg/clientmodel/action_definition.go
@@ -0,0 +1,43 @@
+// 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/swag"
+)
+
+// ActionDefinition E2SM Octet string. ActionDefinition is an OPTIONAL IE
+// swagger:model ActionDefinition
+type ActionDefinition struct {
+
+	// octet string
+	OctetString string `json:"OctetString,omitempty"`
+}
+
+// Validate validates this action definition
+func (m *ActionDefinition) Validate(formats strfmt.Registry) error {
+	return nil
+}
+
+// MarshalBinary interface implementation
+func (m *ActionDefinition) MarshalBinary() ([]byte, error) {
+	if m == nil {
+		return nil, nil
+	}
+	return swag.WriteJSON(m)
+}
+
+// UnmarshalBinary interface implementation
+func (m *ActionDefinition) UnmarshalBinary(b []byte) error {
+	var res ActionDefinition
+	if err := swag.ReadJSON(b, &res); err != nil {
+		return err
+	}
+	*m = res
+	return nil
+}
diff --git a/pkg/clientmodel/action_parameters.go b/pkg/clientmodel/action_parameters.go
deleted file mode 100644
index c73f60b..0000000
--- a/pkg/clientmodel/action_parameters.go
+++ /dev/null
@@ -1,81 +0,0 @@
-// 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"
-)
-
-// ActionParameters action parameters
-// swagger:model ActionParameters
-type ActionParameters struct {
-
-	// action parameter ID
-	// Required: true
-	ActionParameterID *int64 `json:"ActionParameterID"`
-
-	// action parameter value
-	// Required: true
-	ActionParameterValue *bool `json:"ActionParameterValue"`
-}
-
-// Validate validates this action parameters
-func (m *ActionParameters) Validate(formats strfmt.Registry) error {
-	var res []error
-
-	if err := m.validateActionParameterID(formats); err != nil {
-		res = append(res, err)
-	}
-
-	if err := m.validateActionParameterValue(formats); err != nil {
-		res = append(res, err)
-	}
-
-	if len(res) > 0 {
-		return errors.CompositeValidationError(res...)
-	}
-	return nil
-}
-
-func (m *ActionParameters) validateActionParameterID(formats strfmt.Registry) error {
-
-	if err := validate.Required("ActionParameterID", "body", m.ActionParameterID); err != nil {
-		return err
-	}
-
-	return nil
-}
-
-func (m *ActionParameters) validateActionParameterValue(formats strfmt.Registry) error {
-
-	if err := validate.Required("ActionParameterValue", "body", m.ActionParameterValue); err != nil {
-		return err
-	}
-
-	return nil
-}
-
-// MarshalBinary interface implementation
-func (m *ActionParameters) MarshalBinary() ([]byte, error) {
-	if m == nil {
-		return nil, nil
-	}
-	return swag.WriteJSON(m)
-}
-
-// UnmarshalBinary interface implementation
-func (m *ActionParameters) UnmarshalBinary(b []byte) error {
-	var res ActionParameters
-	if err := swag.ReadJSON(b, &res); err != nil {
-		return err
-	}
-	*m = res
-	return nil
-}
diff --git a/pkg/clientmodel/action_to_be_setup.go b/pkg/clientmodel/action_to_be_setup.go
new file mode 100644
index 0000000..88a0b4b
--- /dev/null
+++ b/pkg/clientmodel/action_to_be_setup.go
@@ -0,0 +1,181 @@
+// 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 (
+	"encoding/json"
+
+	strfmt "github.com/go-openapi/strfmt"
+
+	"github.com/go-openapi/errors"
+	"github.com/go-openapi/swag"
+	"github.com/go-openapi/validate"
+)
+
+// ActionToBeSetup action to be setup
+// swagger:model ActionToBeSetup
+type ActionToBeSetup struct {
+
+	// action definition
+	ActionDefinition *ActionDefinition `json:"ActionDefinition,omitempty"`
+
+	// action ID
+	// Required: true
+	// Maximum: 255
+	// Minimum: 0
+	ActionID *int64 `json:"ActionID"`
+
+	// action type
+	// Required: true
+	// Enum: [insert policy report]
+	ActionType *string `json:"ActionType"`
+
+	// subsequent action
+	SubsequentAction *SubsequentAction `json:"SubsequentAction,omitempty"`
+}
+
+// Validate validates this action to be setup
+func (m *ActionToBeSetup) Validate(formats strfmt.Registry) error {
+	var res []error
+
+	if err := m.validateActionDefinition(formats); err != nil {
+		res = append(res, err)
+	}
+
+	if err := m.validateActionID(formats); err != nil {
+		res = append(res, err)
+	}
+
+	if err := m.validateActionType(formats); err != nil {
+		res = append(res, err)
+	}
+
+	if err := m.validateSubsequentAction(formats); err != nil {
+		res = append(res, err)
+	}
+
+	if len(res) > 0 {
+		return errors.CompositeValidationError(res...)
+	}
+	return nil
+}
+
+func (m *ActionToBeSetup) validateActionDefinition(formats strfmt.Registry) error {
+
+	if swag.IsZero(m.ActionDefinition) { // not required
+		return nil
+	}
+
+	if m.ActionDefinition != nil {
+		if err := m.ActionDefinition.Validate(formats); err != nil {
+			if ve, ok := err.(*errors.Validation); ok {
+				return ve.ValidateName("ActionDefinition")
+			}
+			return err
+		}
+	}
+
+	return nil
+}
+
+func (m *ActionToBeSetup) validateActionID(formats strfmt.Registry) error {
+
+	if err := validate.Required("ActionID", "body", m.ActionID); err != nil {
+		return err
+	}
+
+	if err := validate.MinimumInt("ActionID", "body", int64(*m.ActionID), 0, false); err != nil {
+		return err
+	}
+
+	if err := validate.MaximumInt("ActionID", "body", int64(*m.ActionID), 255, false); err != nil {
+		return err
+	}
+
+	return nil
+}
+
+var actionToBeSetupTypeActionTypePropEnum []interface{}
+
+func init() {
+	var res []string
+	if err := json.Unmarshal([]byte(`["insert","policy","report"]`), &res); err != nil {
+		panic(err)
+	}
+	for _, v := range res {
+		actionToBeSetupTypeActionTypePropEnum = append(actionToBeSetupTypeActionTypePropEnum, v)
+	}
+}
+
+const (
+
+	// ActionToBeSetupActionTypeInsert captures enum value "insert"
+	ActionToBeSetupActionTypeInsert string = "insert"
+
+	// ActionToBeSetupActionTypePolicy captures enum value "policy"
+	ActionToBeSetupActionTypePolicy string = "policy"
+
+	// ActionToBeSetupActionTypeReport captures enum value "report"
+	ActionToBeSetupActionTypeReport string = "report"
+)
+
+// prop value enum
+func (m *ActionToBeSetup) validateActionTypeEnum(path, location string, value string) error {
+	if err := validate.Enum(path, location, value, actionToBeSetupTypeActionTypePropEnum); err != nil {
+		return err
+	}
+	return nil
+}
+
+func (m *ActionToBeSetup) validateActionType(formats strfmt.Registry) error {
+
+	if err := validate.Required("ActionType", "body", m.ActionType); err != nil {
+		return err
+	}
+
+	// value enum
+	if err := m.validateActionTypeEnum("ActionType", "body", *m.ActionType); err != nil {
+		return err
+	}
+
+	return nil
+}
+
+func (m *ActionToBeSetup) validateSubsequentAction(formats strfmt.Registry) error {
+
+	if swag.IsZero(m.SubsequentAction) { // not required
+		return nil
+	}
+
+	if m.SubsequentAction != nil {
+		if err := m.SubsequentAction.Validate(formats); err != nil {
+			if ve, ok := err.(*errors.Validation); ok {
+				return ve.ValidateName("SubsequentAction")
+			}
+			return err
+		}
+	}
+
+	return nil
+}
+
+// MarshalBinary interface implementation
+func (m *ActionToBeSetup) MarshalBinary() ([]byte, error) {
+	if m == nil {
+		return nil, nil
+	}
+	return swag.WriteJSON(m)
+}
+
+// UnmarshalBinary interface implementation
+func (m *ActionToBeSetup) UnmarshalBinary(b []byte) error {
+	var res ActionToBeSetup
+	if err := swag.ReadJSON(b, &res); err != nil {
+		return err
+	}
+	*m = res
+	return nil
+}
diff --git a/pkg/clientmodel/event_trigger_list.go b/pkg/clientmodel/actions_to_be_setup.go
similarity index 75%
copy from pkg/clientmodel/event_trigger_list.go
copy to pkg/clientmodel/actions_to_be_setup.go
index f205322..397022e 100644
--- a/pkg/clientmodel/event_trigger_list.go
+++ b/pkg/clientmodel/actions_to_be_setup.go
@@ -14,12 +14,12 @@
 	"github.com/go-openapi/swag"
 )
 
-// EventTriggerList event trigger list
-// swagger:model EventTriggerList
-type EventTriggerList []*EventTrigger
+// ActionsToBeSetup actions to be setup
+// swagger:model ActionsToBeSetup
+type ActionsToBeSetup []*ActionToBeSetup
 
-// Validate validates this event trigger list
-func (m EventTriggerList) Validate(formats strfmt.Registry) error {
+// Validate validates this actions to be setup
+func (m ActionsToBeSetup) Validate(formats strfmt.Registry) error {
 	var res []error
 
 	for i := 0; i < len(m); i++ {
diff --git a/pkg/clientmodel/config_metadata.go b/pkg/clientmodel/config_metadata.go
new file mode 100644
index 0000000..c75f0d1
--- /dev/null
+++ b/pkg/clientmodel/config_metadata.go
@@ -0,0 +1,121 @@
+// 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 (
+	"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
+}
diff --git a/pkg/clientmodel/event_trigger.go b/pkg/clientmodel/event_trigger.go
deleted file mode 100644
index 02955ce..0000000
--- a/pkg/clientmodel/event_trigger.go
+++ /dev/null
@@ -1,115 +0,0 @@
-// 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 (
-	"encoding/json"
-
-	strfmt "github.com/go-openapi/strfmt"
-
-	"github.com/go-openapi/errors"
-	"github.com/go-openapi/swag"
-	"github.com/go-openapi/validate"
-)
-
-// EventTrigger event trigger
-// swagger:model EventTrigger
-type EventTrigger struct {
-
-	// e n b Id
-	ENBID string `json:"ENBId,omitempty"`
-
-	// interface direction
-	InterfaceDirection int64 `json:"InterfaceDirection,omitempty"`
-
-	// plmn Id
-	PlmnID string `json:"PlmnId,omitempty"`
-
-	// procedure code
-	ProcedureCode int64 `json:"ProcedureCode,omitempty"`
-
-	// trigger nature
-	// Enum: [now on change]
-	TriggerNature string `json:"TriggerNature,omitempty"`
-
-	// type of message
-	TypeOfMessage int64 `json:"TypeOfMessage,omitempty"`
-}
-
-// Validate validates this event trigger
-func (m *EventTrigger) Validate(formats strfmt.Registry) error {
-	var res []error
-
-	if err := m.validateTriggerNature(formats); err != nil {
-		res = append(res, err)
-	}
-
-	if len(res) > 0 {
-		return errors.CompositeValidationError(res...)
-	}
-	return nil
-}
-
-var eventTriggerTypeTriggerNaturePropEnum []interface{}
-
-func init() {
-	var res []string
-	if err := json.Unmarshal([]byte(`["now","on change"]`), &res); err != nil {
-		panic(err)
-	}
-	for _, v := range res {
-		eventTriggerTypeTriggerNaturePropEnum = append(eventTriggerTypeTriggerNaturePropEnum, v)
-	}
-}
-
-const (
-
-	// EventTriggerTriggerNatureNow captures enum value "now"
-	EventTriggerTriggerNatureNow string = "now"
-
-	// EventTriggerTriggerNatureOnChange captures enum value "on change"
-	EventTriggerTriggerNatureOnChange string = "on change"
-)
-
-// prop value enum
-func (m *EventTrigger) validateTriggerNatureEnum(path, location string, value string) error {
-	if err := validate.Enum(path, location, value, eventTriggerTypeTriggerNaturePropEnum); err != nil {
-		return err
-	}
-	return nil
-}
-
-func (m *EventTrigger) validateTriggerNature(formats strfmt.Registry) error {
-
-	if swag.IsZero(m.TriggerNature) { // not required
-		return nil
-	}
-
-	// value enum
-	if err := m.validateTriggerNatureEnum("TriggerNature", "body", m.TriggerNature); err != nil {
-		return err
-	}
-
-	return nil
-}
-
-// MarshalBinary interface implementation
-func (m *EventTrigger) MarshalBinary() ([]byte, error) {
-	if m == nil {
-		return nil, nil
-	}
-	return swag.WriteJSON(m)
-}
-
-// UnmarshalBinary interface implementation
-func (m *EventTrigger) UnmarshalBinary(b []byte) error {
-	var res EventTrigger
-	if err := swag.ReadJSON(b, &res); err != nil {
-		return err
-	}
-	*m = res
-	return nil
-}
diff --git a/pkg/clientmodel/event_trigger_definition.go b/pkg/clientmodel/event_trigger_definition.go
new file mode 100644
index 0000000..b9c82a6
--- /dev/null
+++ b/pkg/clientmodel/event_trigger_definition.go
@@ -0,0 +1,43 @@
+// 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/swag"
+)
+
+// EventTriggerDefinition E2SM Octet string
+// swagger:model EventTriggerDefinition
+type EventTriggerDefinition struct {
+
+	// octet string
+	OctetString string `json:"OctetString,omitempty"`
+}
+
+// Validate validates this event trigger definition
+func (m *EventTriggerDefinition) Validate(formats strfmt.Registry) error {
+	return nil
+}
+
+// MarshalBinary interface implementation
+func (m *EventTriggerDefinition) MarshalBinary() ([]byte, error) {
+	if m == nil {
+		return nil, nil
+	}
+	return swag.WriteJSON(m)
+}
+
+// UnmarshalBinary interface implementation
+func (m *EventTriggerDefinition) UnmarshalBinary(b []byte) error {
+	var res EventTriggerDefinition
+	if err := swag.ReadJSON(b, &res); err != nil {
+		return err
+	}
+	*m = res
+	return nil
+}
diff --git a/pkg/clientmodel/format1_action_definition.go b/pkg/clientmodel/format1_action_definition.go
deleted file mode 100644
index f28039e..0000000
--- a/pkg/clientmodel/format1_action_definition.go
+++ /dev/null
@@ -1,99 +0,0 @@
-// 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 (
-	"strconv"
-
-	strfmt "github.com/go-openapi/strfmt"
-
-	"github.com/go-openapi/errors"
-	"github.com/go-openapi/swag"
-	"github.com/go-openapi/validate"
-)
-
-// Format1ActionDefinition format1 action definition
-// swagger:model Format1ActionDefinition
-type Format1ActionDefinition struct {
-
-	// action parameters
-	// Required: true
-	ActionParameters []*ActionParameters `json:"ActionParameters"`
-
-	// style ID
-	// Required: true
-	StyleID *int64 `json:"StyleID"`
-}
-
-// Validate validates this format1 action definition
-func (m *Format1ActionDefinition) Validate(formats strfmt.Registry) error {
-	var res []error
-
-	if err := m.validateActionParameters(formats); err != nil {
-		res = append(res, err)
-	}
-
-	if err := m.validateStyleID(formats); err != nil {
-		res = append(res, err)
-	}
-
-	if len(res) > 0 {
-		return errors.CompositeValidationError(res...)
-	}
-	return nil
-}
-
-func (m *Format1ActionDefinition) validateActionParameters(formats strfmt.Registry) error {
-
-	if err := validate.Required("ActionParameters", "body", m.ActionParameters); err != nil {
-		return err
-	}
-
-	for i := 0; i < len(m.ActionParameters); i++ {
-		if swag.IsZero(m.ActionParameters[i]) { // not required
-			continue
-		}
-
-		if m.ActionParameters[i] != nil {
-			if err := m.ActionParameters[i].Validate(formats); err != nil {
-				if ve, ok := err.(*errors.Validation); ok {
-					return ve.ValidateName("ActionParameters" + "." + strconv.Itoa(i))
-				}
-				return err
-			}
-		}
-
-	}
-
-	return nil
-}
-
-func (m *Format1ActionDefinition) validateStyleID(formats strfmt.Registry) error {
-
-	if err := validate.Required("StyleID", "body", m.StyleID); err != nil {
-		return err
-	}
-
-	return nil
-}
-
-// MarshalBinary interface implementation
-func (m *Format1ActionDefinition) MarshalBinary() ([]byte, error) {
-	if m == nil {
-		return nil, nil
-	}
-	return swag.WriteJSON(m)
-}
-
-// UnmarshalBinary interface implementation
-func (m *Format1ActionDefinition) UnmarshalBinary(b []byte) error {
-	var res Format1ActionDefinition
-	if err := swag.ReadJSON(b, &res); err != nil {
-		return err
-	}
-	*m = res
-	return nil
-}
diff --git a/pkg/clientmodel/format2_action_definition.go b/pkg/clientmodel/format2_action_definition.go
deleted file mode 100644
index 075d07f..0000000
--- a/pkg/clientmodel/format2_action_definition.go
+++ /dev/null
@@ -1,82 +0,0 @@
-// 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 (
-	"strconv"
-
-	strfmt "github.com/go-openapi/strfmt"
-
-	"github.com/go-openapi/errors"
-	"github.com/go-openapi/swag"
-	"github.com/go-openapi/validate"
-)
-
-// Format2ActionDefinition format2 action definition
-// swagger:model Format2ActionDefinition
-type Format2ActionDefinition struct {
-
-	// r a n ue group parameters
-	// Required: true
-	RANUeGroupParameters []*RANUeGroupList `json:"RANUeGroupParameters"`
-}
-
-// Validate validates this format2 action definition
-func (m *Format2ActionDefinition) Validate(formats strfmt.Registry) error {
-	var res []error
-
-	if err := m.validateRANUeGroupParameters(formats); err != nil {
-		res = append(res, err)
-	}
-
-	if len(res) > 0 {
-		return errors.CompositeValidationError(res...)
-	}
-	return nil
-}
-
-func (m *Format2ActionDefinition) validateRANUeGroupParameters(formats strfmt.Registry) error {
-
-	if err := validate.Required("RANUeGroupParameters", "body", m.RANUeGroupParameters); err != nil {
-		return err
-	}
-
-	for i := 0; i < len(m.RANUeGroupParameters); i++ {
-		if swag.IsZero(m.RANUeGroupParameters[i]) { // not required
-			continue
-		}
-
-		if m.RANUeGroupParameters[i] != nil {
-			if err := m.RANUeGroupParameters[i].Validate(formats); err != nil {
-				if ve, ok := err.(*errors.Validation); ok {
-					return ve.ValidateName("RANUeGroupParameters" + "." + strconv.Itoa(i))
-				}
-				return err
-			}
-		}
-
-	}
-
-	return nil
-}
-
-// MarshalBinary interface implementation
-func (m *Format2ActionDefinition) MarshalBinary() ([]byte, error) {
-	if m == nil {
-		return nil, nil
-	}
-	return swag.WriteJSON(m)
-}
-
-// UnmarshalBinary interface implementation
-func (m *Format2ActionDefinition) UnmarshalBinary(b []byte) error {
-	var res Format2ActionDefinition
-	if err := swag.ReadJSON(b, &res); err != nil {
-		return err
-	}
-	*m = res
-	return nil
-}
diff --git a/pkg/clientmodel/imperative_policy_definition.go b/pkg/clientmodel/imperative_policy_definition.go
deleted file mode 100644
index 3163bf9..0000000
--- a/pkg/clientmodel/imperative_policy_definition.go
+++ /dev/null
@@ -1,81 +0,0 @@
-// 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"
-)
-
-// ImperativePolicyDefinition imperative policy definition
-// swagger:model ImperativePolicyDefinition
-type ImperativePolicyDefinition struct {
-
-	// policy parameter ID
-	// Required: true
-	PolicyParameterID *int64 `json:"PolicyParameterID"`
-
-	// policy parameter value
-	// Required: true
-	PolicyParameterValue *int64 `json:"PolicyParameterValue"`
-}
-
-// Validate validates this imperative policy definition
-func (m *ImperativePolicyDefinition) Validate(formats strfmt.Registry) error {
-	var res []error
-
-	if err := m.validatePolicyParameterID(formats); err != nil {
-		res = append(res, err)
-	}
-
-	if err := m.validatePolicyParameterValue(formats); err != nil {
-		res = append(res, err)
-	}
-
-	if len(res) > 0 {
-		return errors.CompositeValidationError(res...)
-	}
-	return nil
-}
-
-func (m *ImperativePolicyDefinition) validatePolicyParameterID(formats strfmt.Registry) error {
-
-	if err := validate.Required("PolicyParameterID", "body", m.PolicyParameterID); err != nil {
-		return err
-	}
-
-	return nil
-}
-
-func (m *ImperativePolicyDefinition) validatePolicyParameterValue(formats strfmt.Registry) error {
-
-	if err := validate.Required("PolicyParameterValue", "body", m.PolicyParameterValue); err != nil {
-		return err
-	}
-
-	return nil
-}
-
-// MarshalBinary interface implementation
-func (m *ImperativePolicyDefinition) MarshalBinary() ([]byte, error) {
-	if m == nil {
-		return nil, nil
-	}
-	return swag.WriteJSON(m)
-}
-
-// UnmarshalBinary interface implementation
-func (m *ImperativePolicyDefinition) UnmarshalBinary(b []byte) error {
-	var res ImperativePolicyDefinition
-	if err := swag.ReadJSON(b, &res); err != nil {
-		return err
-	}
-	*m = res
-	return nil
-}
diff --git a/pkg/clientmodel/policy_action_definition.go b/pkg/clientmodel/policy_action_definition.go
deleted file mode 100644
index 4190913..0000000
--- a/pkg/clientmodel/policy_action_definition.go
+++ /dev/null
@@ -1,71 +0,0 @@
-// 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"
-)
-
-// PolicyActionDefinition policy action definition
-// swagger:model PolicyActionDefinition
-type PolicyActionDefinition struct {
-
-	// action definition format2
-	ActionDefinitionFormat2 *Format2ActionDefinition `json:"ActionDefinitionFormat2,omitempty"`
-}
-
-// Validate validates this policy action definition
-func (m *PolicyActionDefinition) Validate(formats strfmt.Registry) error {
-	var res []error
-
-	if err := m.validateActionDefinitionFormat2(formats); err != nil {
-		res = append(res, err)
-	}
-
-	if len(res) > 0 {
-		return errors.CompositeValidationError(res...)
-	}
-	return nil
-}
-
-func (m *PolicyActionDefinition) validateActionDefinitionFormat2(formats strfmt.Registry) error {
-
-	if swag.IsZero(m.ActionDefinitionFormat2) { // not required
-		return nil
-	}
-
-	if m.ActionDefinitionFormat2 != nil {
-		if err := m.ActionDefinitionFormat2.Validate(formats); err != nil {
-			if ve, ok := err.(*errors.Validation); ok {
-				return ve.ValidateName("ActionDefinitionFormat2")
-			}
-			return err
-		}
-	}
-
-	return nil
-}
-
-// MarshalBinary interface implementation
-func (m *PolicyActionDefinition) MarshalBinary() ([]byte, error) {
-	if m == nil {
-		return nil, nil
-	}
-	return swag.WriteJSON(m)
-}
-
-// UnmarshalBinary interface implementation
-func (m *PolicyActionDefinition) UnmarshalBinary(b []byte) error {
-	var res PolicyActionDefinition
-	if err := swag.ReadJSON(b, &res); err != nil {
-		return err
-	}
-	*m = res
-	return nil
-}
diff --git a/pkg/clientmodel/policy_params.go b/pkg/clientmodel/policy_params.go
deleted file mode 100644
index 210fba7..0000000
--- a/pkg/clientmodel/policy_params.go
+++ /dev/null
@@ -1,148 +0,0 @@
-// 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"
-)
-
-// PolicyParams policy params
-// swagger:model PolicyParams
-type PolicyParams struct {
-
-	// client endpoint
-	// Required: true
-	ClientEndpoint *string `json:"ClientEndpoint"`
-
-	// event triggers
-	// Required: true
-	EventTriggers EventTriggerList `json:"EventTriggers"`
-
-	// meid
-	// Required: true
-	Meid *string `json:"Meid"`
-
-	// policy action definitions
-	// Required: true
-	PolicyActionDefinitions *PolicyActionDefinition `json:"PolicyActionDefinitions"`
-
-	// r a n function ID
-	// Required: true
-	RANFunctionID *int64 `json:"RANFunctionID"`
-}
-
-// Validate validates this policy params
-func (m *PolicyParams) Validate(formats strfmt.Registry) error {
-	var res []error
-
-	if err := m.validateClientEndpoint(formats); err != nil {
-		res = append(res, err)
-	}
-
-	if err := m.validateEventTriggers(formats); err != nil {
-		res = append(res, err)
-	}
-
-	if err := m.validateMeid(formats); err != nil {
-		res = append(res, err)
-	}
-
-	if err := m.validatePolicyActionDefinitions(formats); err != nil {
-		res = append(res, err)
-	}
-
-	if err := m.validateRANFunctionID(formats); err != nil {
-		res = append(res, err)
-	}
-
-	if len(res) > 0 {
-		return errors.CompositeValidationError(res...)
-	}
-	return nil
-}
-
-func (m *PolicyParams) validateClientEndpoint(formats strfmt.Registry) error {
-
-	if err := validate.Required("ClientEndpoint", "body", m.ClientEndpoint); err != nil {
-		return err
-	}
-
-	return nil
-}
-
-func (m *PolicyParams) validateEventTriggers(formats strfmt.Registry) error {
-
-	if err := validate.Required("EventTriggers", "body", m.EventTriggers); err != nil {
-		return err
-	}
-
-	if err := m.EventTriggers.Validate(formats); err != nil {
-		if ve, ok := err.(*errors.Validation); ok {
-			return ve.ValidateName("EventTriggers")
-		}
-		return err
-	}
-
-	return nil
-}
-
-func (m *PolicyParams) validateMeid(formats strfmt.Registry) error {
-
-	if err := validate.Required("Meid", "body", m.Meid); err != nil {
-		return err
-	}
-
-	return nil
-}
-
-func (m *PolicyParams) validatePolicyActionDefinitions(formats strfmt.Registry) error {
-
-	if err := validate.Required("PolicyActionDefinitions", "body", m.PolicyActionDefinitions); err != nil {
-		return err
-	}
-
-	if m.PolicyActionDefinitions != nil {
-		if err := m.PolicyActionDefinitions.Validate(formats); err != nil {
-			if ve, ok := err.(*errors.Validation); ok {
-				return ve.ValidateName("PolicyActionDefinitions")
-			}
-			return err
-		}
-	}
-
-	return nil
-}
-
-func (m *PolicyParams) validateRANFunctionID(formats strfmt.Registry) error {
-
-	if err := validate.Required("RANFunctionID", "body", m.RANFunctionID); err != nil {
-		return err
-	}
-
-	return nil
-}
-
-// MarshalBinary interface implementation
-func (m *PolicyParams) MarshalBinary() ([]byte, error) {
-	if m == nil {
-		return nil, nil
-	}
-	return swag.WriteJSON(m)
-}
-
-// UnmarshalBinary interface implementation
-func (m *PolicyParams) UnmarshalBinary(b []byte) error {
-	var res PolicyParams
-	if err := swag.ReadJSON(b, &res); err != nil {
-		return err
-	}
-	*m = res
-	return nil
-}
diff --git a/pkg/clientmodel/r_a_n_ue_group_list.go b/pkg/clientmodel/r_a_n_ue_group_list.go
deleted file mode 100644
index d9d612f..0000000
--- a/pkg/clientmodel/r_a_n_ue_group_list.go
+++ /dev/null
@@ -1,116 +0,0 @@
-// 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"
-)
-
-// RANUeGroupList r a n ue group list
-// swagger:model RANUeGroupList
-type RANUeGroupList struct {
-
-	// r a n imperative policy
-	// Required: true
-	RANImperativePolicy *ImperativePolicyDefinition `json:"RANImperativePolicy"`
-
-	// r a n ue group definition
-	// Required: true
-	RANUeGroupDefinition *RANUeGroupParams `json:"RANUeGroupDefinition"`
-
-	// r a n ue group ID
-	// Required: true
-	RANUeGroupID *int64 `json:"RANUeGroupID"`
-}
-
-// Validate validates this r a n ue group list
-func (m *RANUeGroupList) Validate(formats strfmt.Registry) error {
-	var res []error
-
-	if err := m.validateRANImperativePolicy(formats); err != nil {
-		res = append(res, err)
-	}
-
-	if err := m.validateRANUeGroupDefinition(formats); err != nil {
-		res = append(res, err)
-	}
-
-	if err := m.validateRANUeGroupID(formats); err != nil {
-		res = append(res, err)
-	}
-
-	if len(res) > 0 {
-		return errors.CompositeValidationError(res...)
-	}
-	return nil
-}
-
-func (m *RANUeGroupList) validateRANImperativePolicy(formats strfmt.Registry) error {
-
-	if err := validate.Required("RANImperativePolicy", "body", m.RANImperativePolicy); err != nil {
-		return err
-	}
-
-	if m.RANImperativePolicy != nil {
-		if err := m.RANImperativePolicy.Validate(formats); err != nil {
-			if ve, ok := err.(*errors.Validation); ok {
-				return ve.ValidateName("RANImperativePolicy")
-			}
-			return err
-		}
-	}
-
-	return nil
-}
-
-func (m *RANUeGroupList) validateRANUeGroupDefinition(formats strfmt.Registry) error {
-
-	if err := validate.Required("RANUeGroupDefinition", "body", m.RANUeGroupDefinition); err != nil {
-		return err
-	}
-
-	if m.RANUeGroupDefinition != nil {
-		if err := m.RANUeGroupDefinition.Validate(formats); err != nil {
-			if ve, ok := err.(*errors.Validation); ok {
-				return ve.ValidateName("RANUeGroupDefinition")
-			}
-			return err
-		}
-	}
-
-	return nil
-}
-
-func (m *RANUeGroupList) validateRANUeGroupID(formats strfmt.Registry) error {
-
-	if err := validate.Required("RANUeGroupID", "body", m.RANUeGroupID); err != nil {
-		return err
-	}
-
-	return nil
-}
-
-// MarshalBinary interface implementation
-func (m *RANUeGroupList) MarshalBinary() ([]byte, error) {
-	if m == nil {
-		return nil, nil
-	}
-	return swag.WriteJSON(m)
-}
-
-// UnmarshalBinary interface implementation
-func (m *RANUeGroupList) UnmarshalBinary(b []byte) error {
-	var res RANUeGroupList
-	if err := swag.ReadJSON(b, &res); err != nil {
-		return err
-	}
-	*m = res
-	return nil
-}
diff --git a/pkg/clientmodel/r_a_n_ue_group_params.go b/pkg/clientmodel/r_a_n_ue_group_params.go
deleted file mode 100644
index ba24f98..0000000
--- a/pkg/clientmodel/r_a_n_ue_group_params.go
+++ /dev/null
@@ -1,143 +0,0 @@
-// 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 (
-	"encoding/json"
-
-	strfmt "github.com/go-openapi/strfmt"
-
-	"github.com/go-openapi/errors"
-	"github.com/go-openapi/swag"
-	"github.com/go-openapi/validate"
-)
-
-// RANUeGroupParams r a n ue group params
-// swagger:model RANUeGroupParams
-type RANUeGroupParams struct {
-
-	// r a n parameter ID
-	// Required: true
-	RANParameterID *int64 `json:"RANParameterID"`
-
-	// r a n parameter test condition
-	// Enum: [equal greaterthan lessthan contains present]
-	RANParameterTestCondition string `json:"RANParameterTestCondition,omitempty"`
-
-	// r a n parameter value
-	// Required: true
-	RANParameterValue *int64 `json:"RANParameterValue"`
-}
-
-// Validate validates this r a n ue group params
-func (m *RANUeGroupParams) Validate(formats strfmt.Registry) error {
-	var res []error
-
-	if err := m.validateRANParameterID(formats); err != nil {
-		res = append(res, err)
-	}
-
-	if err := m.validateRANParameterTestCondition(formats); err != nil {
-		res = append(res, err)
-	}
-
-	if err := m.validateRANParameterValue(formats); err != nil {
-		res = append(res, err)
-	}
-
-	if len(res) > 0 {
-		return errors.CompositeValidationError(res...)
-	}
-	return nil
-}
-
-func (m *RANUeGroupParams) validateRANParameterID(formats strfmt.Registry) error {
-
-	if err := validate.Required("RANParameterID", "body", m.RANParameterID); err != nil {
-		return err
-	}
-
-	return nil
-}
-
-var rANUeGroupParamsTypeRANParameterTestConditionPropEnum []interface{}
-
-func init() {
-	var res []string
-	if err := json.Unmarshal([]byte(`["equal","greaterthan","lessthan","contains","present"]`), &res); err != nil {
-		panic(err)
-	}
-	for _, v := range res {
-		rANUeGroupParamsTypeRANParameterTestConditionPropEnum = append(rANUeGroupParamsTypeRANParameterTestConditionPropEnum, v)
-	}
-}
-
-const (
-
-	// RANUeGroupParamsRANParameterTestConditionEqual captures enum value "equal"
-	RANUeGroupParamsRANParameterTestConditionEqual string = "equal"
-
-	// RANUeGroupParamsRANParameterTestConditionGreaterthan captures enum value "greaterthan"
-	RANUeGroupParamsRANParameterTestConditionGreaterthan string = "greaterthan"
-
-	// RANUeGroupParamsRANParameterTestConditionLessthan captures enum value "lessthan"
-	RANUeGroupParamsRANParameterTestConditionLessthan string = "lessthan"
-
-	// RANUeGroupParamsRANParameterTestConditionContains captures enum value "contains"
-	RANUeGroupParamsRANParameterTestConditionContains string = "contains"
-
-	// RANUeGroupParamsRANParameterTestConditionPresent captures enum value "present"
-	RANUeGroupParamsRANParameterTestConditionPresent string = "present"
-)
-
-// prop value enum
-func (m *RANUeGroupParams) validateRANParameterTestConditionEnum(path, location string, value string) error {
-	if err := validate.Enum(path, location, value, rANUeGroupParamsTypeRANParameterTestConditionPropEnum); err != nil {
-		return err
-	}
-	return nil
-}
-
-func (m *RANUeGroupParams) validateRANParameterTestCondition(formats strfmt.Registry) error {
-
-	if swag.IsZero(m.RANParameterTestCondition) { // not required
-		return nil
-	}
-
-	// value enum
-	if err := m.validateRANParameterTestConditionEnum("RANParameterTestCondition", "body", m.RANParameterTestCondition); err != nil {
-		return err
-	}
-
-	return nil
-}
-
-func (m *RANUeGroupParams) validateRANParameterValue(formats strfmt.Registry) error {
-
-	if err := validate.Required("RANParameterValue", "body", m.RANParameterValue); err != nil {
-		return err
-	}
-
-	return nil
-}
-
-// MarshalBinary interface implementation
-func (m *RANUeGroupParams) MarshalBinary() ([]byte, error) {
-	if m == nil {
-		return nil, nil
-	}
-	return swag.WriteJSON(m)
-}
-
-// UnmarshalBinary interface implementation
-func (m *RANUeGroupParams) UnmarshalBinary(b []byte) error {
-	var res RANUeGroupParams
-	if err := swag.ReadJSON(b, &res); err != nil {
-		return err
-	}
-	*m = res
-	return nil
-}
diff --git a/pkg/clientmodel/report_action_definition.go b/pkg/clientmodel/report_action_definition.go
deleted file mode 100644
index 1657b44..0000000
--- a/pkg/clientmodel/report_action_definition.go
+++ /dev/null
@@ -1,71 +0,0 @@
-// 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"
-)
-
-// ReportActionDefinition report action definition
-// swagger:model ReportActionDefinition
-type ReportActionDefinition struct {
-
-	// action definition format1
-	ActionDefinitionFormat1 *Format1ActionDefinition `json:"ActionDefinitionFormat1,omitempty"`
-}
-
-// Validate validates this report action definition
-func (m *ReportActionDefinition) Validate(formats strfmt.Registry) error {
-	var res []error
-
-	if err := m.validateActionDefinitionFormat1(formats); err != nil {
-		res = append(res, err)
-	}
-
-	if len(res) > 0 {
-		return errors.CompositeValidationError(res...)
-	}
-	return nil
-}
-
-func (m *ReportActionDefinition) validateActionDefinitionFormat1(formats strfmt.Registry) error {
-
-	if swag.IsZero(m.ActionDefinitionFormat1) { // not required
-		return nil
-	}
-
-	if m.ActionDefinitionFormat1 != nil {
-		if err := m.ActionDefinitionFormat1.Validate(formats); err != nil {
-			if ve, ok := err.(*errors.Validation); ok {
-				return ve.ValidateName("ActionDefinitionFormat1")
-			}
-			return err
-		}
-	}
-
-	return nil
-}
-
-// MarshalBinary interface implementation
-func (m *ReportActionDefinition) MarshalBinary() ([]byte, error) {
-	if m == nil {
-		return nil, nil
-	}
-	return swag.WriteJSON(m)
-}
-
-// UnmarshalBinary interface implementation
-func (m *ReportActionDefinition) UnmarshalBinary(b []byte) error {
-	var res ReportActionDefinition
-	if err := swag.ReadJSON(b, &res); err != nil {
-		return err
-	}
-	*m = res
-	return nil
-}
diff --git a/pkg/clientmodel/report_params.go b/pkg/clientmodel/report_params.go
deleted file mode 100644
index 151c2d0..0000000
--- a/pkg/clientmodel/report_params.go
+++ /dev/null
@@ -1,133 +0,0 @@
-// 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"
-)
-
-// ReportParams report params
-// swagger:model ReportParams
-type ReportParams struct {
-
-	// client endpoint
-	// Required: true
-	ClientEndpoint *string `json:"ClientEndpoint"`
-
-	// event triggers
-	// Required: true
-	EventTriggers EventTriggerList `json:"EventTriggers"`
-
-	// meid
-	Meid string `json:"Meid,omitempty"`
-
-	// r a n function ID
-	// Required: true
-	RANFunctionID *int64 `json:"RANFunctionID"`
-
-	// report action definitions
-	ReportActionDefinitions *ReportActionDefinition `json:"ReportActionDefinitions,omitempty"`
-}
-
-// Validate validates this report params
-func (m *ReportParams) Validate(formats strfmt.Registry) error {
-	var res []error
-
-	if err := m.validateClientEndpoint(formats); err != nil {
-		res = append(res, err)
-	}
-
-	if err := m.validateEventTriggers(formats); err != nil {
-		res = append(res, err)
-	}
-
-	if err := m.validateRANFunctionID(formats); err != nil {
-		res = append(res, err)
-	}
-
-	if err := m.validateReportActionDefinitions(formats); err != nil {
-		res = append(res, err)
-	}
-
-	if len(res) > 0 {
-		return errors.CompositeValidationError(res...)
-	}
-	return nil
-}
-
-func (m *ReportParams) validateClientEndpoint(formats strfmt.Registry) error {
-
-	if err := validate.Required("ClientEndpoint", "body", m.ClientEndpoint); err != nil {
-		return err
-	}
-
-	return nil
-}
-
-func (m *ReportParams) validateEventTriggers(formats strfmt.Registry) error {
-
-	if err := validate.Required("EventTriggers", "body", m.EventTriggers); err != nil {
-		return err
-	}
-
-	if err := m.EventTriggers.Validate(formats); err != nil {
-		if ve, ok := err.(*errors.Validation); ok {
-			return ve.ValidateName("EventTriggers")
-		}
-		return err
-	}
-
-	return nil
-}
-
-func (m *ReportParams) validateRANFunctionID(formats strfmt.Registry) error {
-
-	if err := validate.Required("RANFunctionID", "body", m.RANFunctionID); err != nil {
-		return err
-	}
-
-	return nil
-}
-
-func (m *ReportParams) validateReportActionDefinitions(formats strfmt.Registry) error {
-
-	if swag.IsZero(m.ReportActionDefinitions) { // not required
-		return nil
-	}
-
-	if m.ReportActionDefinitions != nil {
-		if err := m.ReportActionDefinitions.Validate(formats); err != nil {
-			if ve, ok := err.(*errors.Validation); ok {
-				return ve.ValidateName("ReportActionDefinitions")
-			}
-			return err
-		}
-	}
-
-	return nil
-}
-
-// MarshalBinary interface implementation
-func (m *ReportParams) MarshalBinary() ([]byte, error) {
-	if m == nil {
-		return nil, nil
-	}
-	return swag.WriteJSON(m)
-}
-
-// UnmarshalBinary interface implementation
-func (m *ReportParams) UnmarshalBinary(b []byte) error {
-	var res ReportParams
-	if err := swag.ReadJSON(b, &res); err != nil {
-		return err
-	}
-	*m = res
-	return nil
-}
diff --git a/pkg/clientmodel/subscription_details.go b/pkg/clientmodel/subscription_details.go
new file mode 100644
index 0000000..05677cd
--- /dev/null
+++ b/pkg/clientmodel/subscription_details.go
@@ -0,0 +1,97 @@
+// 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"
+)
+
+// SubscriptionDetails subscription details
+// swagger:model SubscriptionDetails
+type SubscriptionDetails struct {
+
+	// action to be setup list
+	// Required: true
+	ActionToBeSetupList ActionsToBeSetup `json:"ActionToBeSetupList"`
+
+	// event trigger list
+	// Required: true
+	EventTriggerList *EventTriggerDefinition `json:"EventTriggerList"`
+}
+
+// Validate validates this subscription details
+func (m *SubscriptionDetails) Validate(formats strfmt.Registry) error {
+	var res []error
+
+	if err := m.validateActionToBeSetupList(formats); err != nil {
+		res = append(res, err)
+	}
+
+	if err := m.validateEventTriggerList(formats); err != nil {
+		res = append(res, err)
+	}
+
+	if len(res) > 0 {
+		return errors.CompositeValidationError(res...)
+	}
+	return nil
+}
+
+func (m *SubscriptionDetails) validateActionToBeSetupList(formats strfmt.Registry) error {
+
+	if err := validate.Required("ActionToBeSetupList", "body", m.ActionToBeSetupList); err != nil {
+		return err
+	}
+
+	if err := m.ActionToBeSetupList.Validate(formats); err != nil {
+		if ve, ok := err.(*errors.Validation); ok {
+			return ve.ValidateName("ActionToBeSetupList")
+		}
+		return err
+	}
+
+	return nil
+}
+
+func (m *SubscriptionDetails) validateEventTriggerList(formats strfmt.Registry) error {
+
+	if err := validate.Required("EventTriggerList", "body", m.EventTriggerList); err != nil {
+		return err
+	}
+
+	if m.EventTriggerList != nil {
+		if err := m.EventTriggerList.Validate(formats); err != nil {
+			if ve, ok := err.(*errors.Validation); ok {
+				return ve.ValidateName("EventTriggerList")
+			}
+			return err
+		}
+	}
+
+	return nil
+}
+
+// MarshalBinary interface implementation
+func (m *SubscriptionDetails) MarshalBinary() ([]byte, error) {
+	if m == nil {
+		return nil, nil
+	}
+	return swag.WriteJSON(m)
+}
+
+// UnmarshalBinary interface implementation
+func (m *SubscriptionDetails) UnmarshalBinary(b []byte) error {
+	var res SubscriptionDetails
+	if err := swag.ReadJSON(b, &res); err != nil {
+		return err
+	}
+	*m = res
+	return nil
+}
diff --git a/pkg/clientmodel/event_trigger_list.go b/pkg/clientmodel/subscription_details_list.go
similarity index 72%
copy from pkg/clientmodel/event_trigger_list.go
copy to pkg/clientmodel/subscription_details_list.go
index f205322..450e08f 100644
--- a/pkg/clientmodel/event_trigger_list.go
+++ b/pkg/clientmodel/subscription_details_list.go
@@ -14,12 +14,12 @@
 	"github.com/go-openapi/swag"
 )
 
-// EventTriggerList event trigger list
-// swagger:model EventTriggerList
-type EventTriggerList []*EventTrigger
+// SubscriptionDetailsList subscription details list
+// swagger:model SubscriptionDetailsList
+type SubscriptionDetailsList []*SubscriptionDetails
 
-// Validate validates this event trigger list
-func (m EventTriggerList) Validate(formats strfmt.Registry) error {
+// Validate validates this subscription details list
+func (m SubscriptionDetailsList) Validate(formats strfmt.Registry) error {
 	var res []error
 
 	for i := 0; i < len(m); i++ {
diff --git a/pkg/clientmodel/subscription_instance.go b/pkg/clientmodel/subscription_instance.go
index 4606479..7853a3b 100644
--- a/pkg/clientmodel/subscription_instance.go
+++ b/pkg/clientmodel/subscription_instance.go
@@ -17,12 +17,20 @@
 // swagger:model SubscriptionInstance
 type SubscriptionInstance struct {
 
+	// Empty string when no error.
+	// Required: true
+	ErrorCause *string `json:"ErrorCause"`
+
 	// instance Id
 	// Required: true
+	// Maximum: 65535
+	// Minimum: 0
 	InstanceID *int64 `json:"InstanceId"`
 
 	// requestor Id
 	// Required: true
+	// Maximum: 65535
+	// Minimum: 0
 	RequestorID *int64 `json:"RequestorId"`
 }
 
@@ -30,6 +38,10 @@
 func (m *SubscriptionInstance) Validate(formats strfmt.Registry) error {
 	var res []error
 
+	if err := m.validateErrorCause(formats); err != nil {
+		res = append(res, err)
+	}
+
 	if err := m.validateInstanceID(formats); err != nil {
 		res = append(res, err)
 	}
@@ -44,12 +56,29 @@
 	return nil
 }
 
+func (m *SubscriptionInstance) validateErrorCause(formats strfmt.Registry) error {
+
+	if err := validate.Required("ErrorCause", "body", m.ErrorCause); err != nil {
+		return err
+	}
+
+	return nil
+}
+
 func (m *SubscriptionInstance) validateInstanceID(formats strfmt.Registry) error {
 
 	if err := validate.Required("InstanceId", "body", m.InstanceID); err != nil {
 		return err
 	}
 
+	if err := validate.MinimumInt("InstanceId", "body", int64(*m.InstanceID), 0, false); err != nil {
+		return err
+	}
+
+	if err := validate.MaximumInt("InstanceId", "body", int64(*m.InstanceID), 65535, false); err != nil {
+		return err
+	}
+
 	return nil
 }
 
@@ -59,6 +88,14 @@
 		return err
 	}
 
+	if err := validate.MinimumInt("RequestorId", "body", int64(*m.RequestorID), 0, false); err != nil {
+		return err
+	}
+
+	if err := validate.MaximumInt("RequestorId", "body", int64(*m.RequestorID), 65535, false); err != nil {
+		return err
+	}
+
 	return nil
 }
 
diff --git a/pkg/clientmodel/subscription_params.go b/pkg/clientmodel/subscription_params.go
new file mode 100644
index 0000000..eb1d875
--- /dev/null
+++ b/pkg/clientmodel/subscription_params.go
@@ -0,0 +1,257 @@
+// 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"
+)
+
+// SubscriptionParams subscription params
+// swagger:model SubscriptionParams
+type SubscriptionParams struct {
+
+	// client endpoint
+	// Required: true
+	ClientEndpoint *SubscriptionParamsClientEndpoint `json:"ClientEndpoint"`
+
+	// instance Id
+	// Required: true
+	// Maximum: 65535
+	// Minimum: 0
+	InstanceID *int64 `json:"InstanceId"`
+
+	// meid
+	// Required: true
+	Meid *string `json:"Meid"`
+
+	// r a n function ID
+	// Required: true
+	// Maximum: 4095
+	// Minimum: 0
+	RANFunctionID *int64 `json:"RANFunctionID"`
+
+	// requestor Id
+	// Required: true
+	// Maximum: 65535
+	// Minimum: 0
+	RequestorID *int64 `json:"RequestorId"`
+
+	// subscription details
+	// Required: true
+	SubscriptionDetails SubscriptionDetailsList `json:"SubscriptionDetails"`
+}
+
+// Validate validates this subscription params
+func (m *SubscriptionParams) Validate(formats strfmt.Registry) error {
+	var res []error
+
+	if err := m.validateClientEndpoint(formats); err != nil {
+		res = append(res, err)
+	}
+
+	if err := m.validateInstanceID(formats); err != nil {
+		res = append(res, err)
+	}
+
+	if err := m.validateMeid(formats); err != nil {
+		res = append(res, err)
+	}
+
+	if err := m.validateRANFunctionID(formats); err != nil {
+		res = append(res, err)
+	}
+
+	if err := m.validateRequestorID(formats); err != nil {
+		res = append(res, err)
+	}
+
+	if err := m.validateSubscriptionDetails(formats); err != nil {
+		res = append(res, err)
+	}
+
+	if len(res) > 0 {
+		return errors.CompositeValidationError(res...)
+	}
+	return nil
+}
+
+func (m *SubscriptionParams) validateClientEndpoint(formats strfmt.Registry) error {
+
+	if err := validate.Required("ClientEndpoint", "body", m.ClientEndpoint); err != nil {
+		return err
+	}
+
+	if m.ClientEndpoint != nil {
+		if err := m.ClientEndpoint.Validate(formats); err != nil {
+			if ve, ok := err.(*errors.Validation); ok {
+				return ve.ValidateName("ClientEndpoint")
+			}
+			return err
+		}
+	}
+
+	return nil
+}
+
+func (m *SubscriptionParams) validateInstanceID(formats strfmt.Registry) error {
+
+	if err := validate.Required("InstanceId", "body", m.InstanceID); err != nil {
+		return err
+	}
+
+	if err := validate.MinimumInt("InstanceId", "body", int64(*m.InstanceID), 0, false); err != nil {
+		return err
+	}
+
+	if err := validate.MaximumInt("InstanceId", "body", int64(*m.InstanceID), 65535, false); err != nil {
+		return err
+	}
+
+	return nil
+}
+
+func (m *SubscriptionParams) validateMeid(formats strfmt.Registry) error {
+
+	if err := validate.Required("Meid", "body", m.Meid); err != nil {
+		return err
+	}
+
+	return nil
+}
+
+func (m *SubscriptionParams) validateRANFunctionID(formats strfmt.Registry) error {
+
+	if err := validate.Required("RANFunctionID", "body", m.RANFunctionID); err != nil {
+		return err
+	}
+
+	if err := validate.MinimumInt("RANFunctionID", "body", int64(*m.RANFunctionID), 0, false); err != nil {
+		return err
+	}
+
+	if err := validate.MaximumInt("RANFunctionID", "body", int64(*m.RANFunctionID), 4095, false); err != nil {
+		return err
+	}
+
+	return nil
+}
+
+func (m *SubscriptionParams) validateRequestorID(formats strfmt.Registry) error {
+
+	if err := validate.Required("RequestorId", "body", m.RequestorID); err != nil {
+		return err
+	}
+
+	if err := validate.MinimumInt("RequestorId", "body", int64(*m.RequestorID), 0, false); err != nil {
+		return err
+	}
+
+	if err := validate.MaximumInt("RequestorId", "body", int64(*m.RequestorID), 65535, false); err != nil {
+		return err
+	}
+
+	return nil
+}
+
+func (m *SubscriptionParams) validateSubscriptionDetails(formats strfmt.Registry) error {
+
+	if err := validate.Required("SubscriptionDetails", "body", m.SubscriptionDetails); err != nil {
+		return err
+	}
+
+	if err := m.SubscriptionDetails.Validate(formats); err != nil {
+		if ve, ok := err.(*errors.Validation); ok {
+			return ve.ValidateName("SubscriptionDetails")
+		}
+		return err
+	}
+
+	return nil
+}
+
+// MarshalBinary interface implementation
+func (m *SubscriptionParams) MarshalBinary() ([]byte, error) {
+	if m == nil {
+		return nil, nil
+	}
+	return swag.WriteJSON(m)
+}
+
+// UnmarshalBinary interface implementation
+func (m *SubscriptionParams) UnmarshalBinary(b []byte) error {
+	var res SubscriptionParams
+	if err := swag.ReadJSON(b, &res); err != nil {
+		return err
+	}
+	*m = res
+	return nil
+}
+
+// SubscriptionParamsClientEndpoint xApp service address and port
+// swagger:model SubscriptionParamsClientEndpoint
+type SubscriptionParamsClientEndpoint struct {
+
+	// xApp service address port
+	// Maximum: 65535
+	// Minimum: 0
+	Port *int64 `json:"Port,omitempty"`
+
+	// xApp service address name like 'service-ricxapp-xappname-http.ricxapp'
+	ServiceName string `json:"ServiceName,omitempty"`
+}
+
+// Validate validates this subscription params client endpoint
+func (m *SubscriptionParamsClientEndpoint) Validate(formats strfmt.Registry) error {
+	var res []error
+
+	if err := m.validatePort(formats); err != nil {
+		res = append(res, err)
+	}
+
+	if len(res) > 0 {
+		return errors.CompositeValidationError(res...)
+	}
+	return nil
+}
+
+func (m *SubscriptionParamsClientEndpoint) validatePort(formats strfmt.Registry) error {
+
+	if swag.IsZero(m.Port) { // not required
+		return nil
+	}
+
+	if err := validate.MinimumInt("ClientEndpoint"+"."+"Port", "body", int64(*m.Port), 0, false); err != nil {
+		return err
+	}
+
+	if err := validate.MaximumInt("ClientEndpoint"+"."+"Port", "body", int64(*m.Port), 65535, false); err != nil {
+		return err
+	}
+
+	return nil
+}
+
+// MarshalBinary interface implementation
+func (m *SubscriptionParamsClientEndpoint) MarshalBinary() ([]byte, error) {
+	if m == nil {
+		return nil, nil
+	}
+	return swag.WriteJSON(m)
+}
+
+// UnmarshalBinary interface implementation
+func (m *SubscriptionParamsClientEndpoint) UnmarshalBinary(b []byte) error {
+	var res SubscriptionParamsClientEndpoint
+	if err := swag.ReadJSON(b, &res); err != nil {
+		return err
+	}
+	*m = res
+	return nil
+}
diff --git a/pkg/clientmodel/subscription_response_item.go b/pkg/clientmodel/subscription_response_item.go
deleted file mode 100644
index 8237495..0000000
--- a/pkg/clientmodel/subscription_response_item.go
+++ /dev/null
@@ -1,98 +0,0 @@
-// 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"
-)
-
-// SubscriptionResponseItem subscription response item
-// swagger:model SubscriptionResponseItem
-type SubscriptionResponseItem struct {
-
-	// instance Id
-	// Required: true
-	InstanceID *int64 `json:"InstanceId"`
-
-	// requestor Id
-	// Required: true
-	RequestorID *int64 `json:"RequestorId"`
-
-	// subscription Id
-	// Required: true
-	SubscriptionID *string `json:"SubscriptionId"`
-}
-
-// Validate validates this subscription response item
-func (m *SubscriptionResponseItem) Validate(formats strfmt.Registry) error {
-	var res []error
-
-	if err := m.validateInstanceID(formats); err != nil {
-		res = append(res, err)
-	}
-
-	if err := m.validateRequestorID(formats); err != nil {
-		res = append(res, err)
-	}
-
-	if err := m.validateSubscriptionID(formats); err != nil {
-		res = append(res, err)
-	}
-
-	if len(res) > 0 {
-		return errors.CompositeValidationError(res...)
-	}
-	return nil
-}
-
-func (m *SubscriptionResponseItem) validateInstanceID(formats strfmt.Registry) error {
-
-	if err := validate.Required("InstanceId", "body", m.InstanceID); err != nil {
-		return err
-	}
-
-	return nil
-}
-
-func (m *SubscriptionResponseItem) validateRequestorID(formats strfmt.Registry) error {
-
-	if err := validate.Required("RequestorId", "body", m.RequestorID); err != nil {
-		return err
-	}
-
-	return nil
-}
-
-func (m *SubscriptionResponseItem) validateSubscriptionID(formats strfmt.Registry) error {
-
-	if err := validate.Required("SubscriptionId", "body", m.SubscriptionID); err != nil {
-		return err
-	}
-
-	return nil
-}
-
-// MarshalBinary interface implementation
-func (m *SubscriptionResponseItem) MarshalBinary() ([]byte, error) {
-	if m == nil {
-		return nil, nil
-	}
-	return swag.WriteJSON(m)
-}
-
-// UnmarshalBinary interface implementation
-func (m *SubscriptionResponseItem) UnmarshalBinary(b []byte) error {
-	var res SubscriptionResponseItem
-	if err := swag.ReadJSON(b, &res); err != nil {
-		return err
-	}
-	*m = res
-	return nil
-}
diff --git a/pkg/clientmodel/subscription_type.go b/pkg/clientmodel/subscription_type.go
deleted file mode 100644
index eafbe57..0000000
--- a/pkg/clientmodel/subscription_type.go
+++ /dev/null
@@ -1,66 +0,0 @@
-// 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 (
-	"encoding/json"
-
-	strfmt "github.com/go-openapi/strfmt"
-
-	"github.com/go-openapi/errors"
-	"github.com/go-openapi/validate"
-)
-
-// SubscriptionType subscription type
-// swagger:model SubscriptionType
-type SubscriptionType string
-
-const (
-
-	// SubscriptionTypeInsert captures enum value "insert"
-	SubscriptionTypeInsert SubscriptionType = "insert"
-
-	// SubscriptionTypePolicy captures enum value "policy"
-	SubscriptionTypePolicy SubscriptionType = "policy"
-
-	// SubscriptionTypeReport captures enum value "report"
-	SubscriptionTypeReport SubscriptionType = "report"
-)
-
-// for schema
-var subscriptionTypeEnum []interface{}
-
-func init() {
-	var res []SubscriptionType
-	if err := json.Unmarshal([]byte(`["insert","policy","report"]`), &res); err != nil {
-		panic(err)
-	}
-	for _, v := range res {
-		subscriptionTypeEnum = append(subscriptionTypeEnum, v)
-	}
-}
-
-func (m SubscriptionType) validateSubscriptionTypeEnum(path, location string, value SubscriptionType) error {
-	if err := validate.Enum(path, location, value, subscriptionTypeEnum); err != nil {
-		return err
-	}
-	return nil
-}
-
-// Validate validates this subscription type
-func (m SubscriptionType) Validate(formats strfmt.Registry) error {
-	var res []error
-
-	// value enum
-	if err := m.validateSubscriptionTypeEnum("", "body", m); err != nil {
-		return err
-	}
-
-	if len(res) > 0 {
-		return errors.CompositeValidationError(res...)
-	}
-	return nil
-}
diff --git a/pkg/clientmodel/subsequent_action.go b/pkg/clientmodel/subsequent_action.go
new file mode 100644
index 0000000..b0c8a0f
--- /dev/null
+++ b/pkg/clientmodel/subsequent_action.go
@@ -0,0 +1,201 @@
+// 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 (
+	"encoding/json"
+
+	strfmt "github.com/go-openapi/strfmt"
+
+	"github.com/go-openapi/errors"
+	"github.com/go-openapi/swag"
+	"github.com/go-openapi/validate"
+)
+
+// SubsequentAction SubsequentAction is an OPTIONAL IE
+// swagger:model SubsequentAction
+type SubsequentAction struct {
+
+	// subsequent action type
+	// Required: true
+	// Enum: [continue wait]
+	SubsequentActionType *string `json:"SubsequentActionType"`
+
+	// time to wait
+	// Required: true
+	// Enum: [zero w1ms w2ms w5ms w10ms w20ms w30ms w40ms w50ms w100ms w200ms w500ms w1s w2s w5s w10s w20s w60s]
+	TimeToWait *string `json:"TimeToWait"`
+}
+
+// Validate validates this subsequent action
+func (m *SubsequentAction) Validate(formats strfmt.Registry) error {
+	var res []error
+
+	if err := m.validateSubsequentActionType(formats); err != nil {
+		res = append(res, err)
+	}
+
+	if err := m.validateTimeToWait(formats); err != nil {
+		res = append(res, err)
+	}
+
+	if len(res) > 0 {
+		return errors.CompositeValidationError(res...)
+	}
+	return nil
+}
+
+var subsequentActionTypeSubsequentActionTypePropEnum []interface{}
+
+func init() {
+	var res []string
+	if err := json.Unmarshal([]byte(`["continue","wait"]`), &res); err != nil {
+		panic(err)
+	}
+	for _, v := range res {
+		subsequentActionTypeSubsequentActionTypePropEnum = append(subsequentActionTypeSubsequentActionTypePropEnum, v)
+	}
+}
+
+const (
+
+	// SubsequentActionSubsequentActionTypeContinue captures enum value "continue"
+	SubsequentActionSubsequentActionTypeContinue string = "continue"
+
+	// SubsequentActionSubsequentActionTypeWait captures enum value "wait"
+	SubsequentActionSubsequentActionTypeWait string = "wait"
+)
+
+// prop value enum
+func (m *SubsequentAction) validateSubsequentActionTypeEnum(path, location string, value string) error {
+	if err := validate.Enum(path, location, value, subsequentActionTypeSubsequentActionTypePropEnum); err != nil {
+		return err
+	}
+	return nil
+}
+
+func (m *SubsequentAction) validateSubsequentActionType(formats strfmt.Registry) error {
+
+	if err := validate.Required("SubsequentActionType", "body", m.SubsequentActionType); err != nil {
+		return err
+	}
+
+	// value enum
+	if err := m.validateSubsequentActionTypeEnum("SubsequentActionType", "body", *m.SubsequentActionType); err != nil {
+		return err
+	}
+
+	return nil
+}
+
+var subsequentActionTypeTimeToWaitPropEnum []interface{}
+
+func init() {
+	var res []string
+	if err := json.Unmarshal([]byte(`["zero","w1ms","w2ms","w5ms","w10ms","w20ms","w30ms","w40ms","w50ms","w100ms","w200ms","w500ms","w1s","w2s","w5s","w10s","w20s","w60s"]`), &res); err != nil {
+		panic(err)
+	}
+	for _, v := range res {
+		subsequentActionTypeTimeToWaitPropEnum = append(subsequentActionTypeTimeToWaitPropEnum, v)
+	}
+}
+
+const (
+
+	// SubsequentActionTimeToWaitZero captures enum value "zero"
+	SubsequentActionTimeToWaitZero string = "zero"
+
+	// SubsequentActionTimeToWaitW1ms captures enum value "w1ms"
+	SubsequentActionTimeToWaitW1ms string = "w1ms"
+
+	// SubsequentActionTimeToWaitW2ms captures enum value "w2ms"
+	SubsequentActionTimeToWaitW2ms string = "w2ms"
+
+	// SubsequentActionTimeToWaitW5ms captures enum value "w5ms"
+	SubsequentActionTimeToWaitW5ms string = "w5ms"
+
+	// SubsequentActionTimeToWaitW10ms captures enum value "w10ms"
+	SubsequentActionTimeToWaitW10ms string = "w10ms"
+
+	// SubsequentActionTimeToWaitW20ms captures enum value "w20ms"
+	SubsequentActionTimeToWaitW20ms string = "w20ms"
+
+	// SubsequentActionTimeToWaitW30ms captures enum value "w30ms"
+	SubsequentActionTimeToWaitW30ms string = "w30ms"
+
+	// SubsequentActionTimeToWaitW40ms captures enum value "w40ms"
+	SubsequentActionTimeToWaitW40ms string = "w40ms"
+
+	// SubsequentActionTimeToWaitW50ms captures enum value "w50ms"
+	SubsequentActionTimeToWaitW50ms string = "w50ms"
+
+	// SubsequentActionTimeToWaitW100ms captures enum value "w100ms"
+	SubsequentActionTimeToWaitW100ms string = "w100ms"
+
+	// SubsequentActionTimeToWaitW200ms captures enum value "w200ms"
+	SubsequentActionTimeToWaitW200ms string = "w200ms"
+
+	// SubsequentActionTimeToWaitW500ms captures enum value "w500ms"
+	SubsequentActionTimeToWaitW500ms string = "w500ms"
+
+	// SubsequentActionTimeToWaitW1s captures enum value "w1s"
+	SubsequentActionTimeToWaitW1s string = "w1s"
+
+	// SubsequentActionTimeToWaitW2s captures enum value "w2s"
+	SubsequentActionTimeToWaitW2s string = "w2s"
+
+	// SubsequentActionTimeToWaitW5s captures enum value "w5s"
+	SubsequentActionTimeToWaitW5s string = "w5s"
+
+	// SubsequentActionTimeToWaitW10s captures enum value "w10s"
+	SubsequentActionTimeToWaitW10s string = "w10s"
+
+	// SubsequentActionTimeToWaitW20s captures enum value "w20s"
+	SubsequentActionTimeToWaitW20s string = "w20s"
+
+	// SubsequentActionTimeToWaitW60s captures enum value "w60s"
+	SubsequentActionTimeToWaitW60s string = "w60s"
+)
+
+// prop value enum
+func (m *SubsequentAction) validateTimeToWaitEnum(path, location string, value string) error {
+	if err := validate.Enum(path, location, value, subsequentActionTypeTimeToWaitPropEnum); err != nil {
+		return err
+	}
+	return nil
+}
+
+func (m *SubsequentAction) validateTimeToWait(formats strfmt.Registry) error {
+
+	if err := validate.Required("TimeToWait", "body", m.TimeToWait); err != nil {
+		return err
+	}
+
+	// value enum
+	if err := m.validateTimeToWaitEnum("TimeToWait", "body", *m.TimeToWait); err != nil {
+		return err
+	}
+
+	return nil
+}
+
+// MarshalBinary interface implementation
+func (m *SubsequentAction) MarshalBinary() ([]byte, error) {
+	if m == nil {
+		return nil, nil
+	}
+	return swag.WriteJSON(m)
+}
+
+// UnmarshalBinary interface implementation
+func (m *SubsequentAction) UnmarshalBinary(b []byte) error {
+	var res SubsequentAction
+	if err := swag.ReadJSON(b, &res); err != nil {
+		return err
+	}
+	*m = res
+	return nil
+}
diff --git a/pkg/clientmodel/x_app_config.go b/pkg/clientmodel/x_app_config.go
new file mode 100644
index 0000000..b744f3f
--- /dev/null
+++ b/pkg/clientmodel/x_app_config.go
@@ -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
+}
diff --git a/pkg/clientmodel/event_trigger_list.go b/pkg/clientmodel/xapp_config_list.go
similarity index 76%
rename from pkg/clientmodel/event_trigger_list.go
rename to pkg/clientmodel/xapp_config_list.go
index f205322..758b7ec 100644
--- a/pkg/clientmodel/event_trigger_list.go
+++ b/pkg/clientmodel/xapp_config_list.go
@@ -14,12 +14,12 @@
 	"github.com/go-openapi/swag"
 )
 
-// EventTriggerList event trigger list
-// swagger:model EventTriggerList
-type EventTriggerList []*EventTrigger
+// XappConfigList xapp config list
+// swagger:model XappConfigList
+type XappConfigList []*XAppConfig
 
-// Validate validates this event trigger list
-func (m EventTriggerList) Validate(formats strfmt.Registry) error {
+// Validate validates this xapp config list
+func (m XappConfigList) Validate(formats strfmt.Registry) error {
 	var res []error
 
 	for i := 0; i < len(m); i++ {
