Add models
Change-Id: I97198a7a556457ee5448c964be509d106e9441c8
Signed-off-by: Mohamed Abukar <abukar.mohamed@nokia.com>
diff --git a/pkg/models/control_params.go b/pkg/models/control_params.go
new file mode 100644
index 0000000..17ce7cf
--- /dev/null
+++ b/pkg/models/control_params.go
@@ -0,0 +1,46 @@
+// 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/swag"
+)
+
+// ControlParams control params
+// swagger:model ControlParams
+type ControlParams struct {
+
+ // requestor Id
+ RequestorID int64 `json:"RequestorId,omitempty"`
+
+ // t b d
+ TBD string `json:"TBD,omitempty"`
+}
+
+// Validate validates this control params
+func (m *ControlParams) Validate(formats strfmt.Registry) error {
+ return nil
+}
+
+// MarshalBinary interface implementation
+func (m *ControlParams) MarshalBinary() ([]byte, error) {
+ if m == nil {
+ return nil, nil
+ }
+ return swag.WriteJSON(m)
+}
+
+// UnmarshalBinary interface implementation
+func (m *ControlParams) UnmarshalBinary(b []byte) error {
+ var res ControlParams
+ if err := swag.ReadJSON(b, &res); err != nil {
+ return err
+ }
+ *m = res
+ return nil
+}
diff --git a/pkg/models/event_trigger.go b/pkg/models/event_trigger.go
new file mode 100644
index 0000000..2567fc4
--- /dev/null
+++ b/pkg/models/event_trigger.go
@@ -0,0 +1,104 @@
+// 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"
+)
+
+// EventTrigger event trigger
+// swagger:model EventTrigger
+type EventTrigger struct {
+
+ // e n b Id
+ ENBID int64 `json:"ENBId,omitempty"`
+
+ // interface direction
+ // Required: true
+ InterfaceDirection *int64 `json:"InterfaceDirection"`
+
+ // plmn Id
+ PlmnID string `json:"PlmnId,omitempty"`
+
+ // procedure code
+ // Required: true
+ ProcedureCode *int64 `json:"ProcedureCode"`
+
+ // type of message
+ // Required: true
+ TypeOfMessage *int64 `json:"TypeOfMessage"`
+}
+
+// Validate validates this event trigger
+func (m *EventTrigger) Validate(formats strfmt.Registry) error {
+ var res []error
+
+ if err := m.validateInterfaceDirection(formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.validateProcedureCode(formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.validateTypeOfMessage(formats); err != nil {
+ res = append(res, err)
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *EventTrigger) validateInterfaceDirection(formats strfmt.Registry) error {
+
+ if err := validate.Required("InterfaceDirection", "body", m.InterfaceDirection); err != nil {
+ return err
+ }
+
+ return nil
+}
+
+func (m *EventTrigger) validateProcedureCode(formats strfmt.Registry) error {
+
+ if err := validate.Required("ProcedureCode", "body", m.ProcedureCode); err != nil {
+ return err
+ }
+
+ return nil
+}
+
+func (m *EventTrigger) validateTypeOfMessage(formats strfmt.Registry) error {
+
+ if err := validate.Required("TypeOfMessage", "body", m.TypeOfMessage); 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/models/event_trigger_list.go b/pkg/models/event_trigger_list.go
new file mode 100644
index 0000000..c3c3dbc
--- /dev/null
+++ b/pkg/models/event_trigger_list.go
@@ -0,0 +1,45 @@
+// 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 (
+ "strconv"
+
+ strfmt "github.com/go-openapi/strfmt"
+
+ "github.com/go-openapi/errors"
+ "github.com/go-openapi/swag"
+)
+
+// EventTriggerList event trigger list
+// swagger:model EventTriggerList
+type EventTriggerList []*EventTrigger
+
+// Validate validates this event trigger list
+func (m EventTriggerList) Validate(formats strfmt.Registry) error {
+ var res []error
+
+ for i := 0; i < len(m); i++ {
+ if swag.IsZero(m[i]) { // not required
+ continue
+ }
+
+ if m[i] != nil {
+ if err := m[i].Validate(formats); err != nil {
+ if ve, ok := err.(*errors.Validation); ok {
+ return ve.ValidateName(strconv.Itoa(i))
+ }
+ return err
+ }
+ }
+
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
diff --git a/pkg/models/policy_params.go b/pkg/models/policy_params.go
new file mode 100644
index 0000000..c8c7627
--- /dev/null
+++ b/pkg/models/policy_params.go
@@ -0,0 +1,46 @@
+// 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/swag"
+)
+
+// PolicyParams policy params
+// swagger:model PolicyParams
+type PolicyParams struct {
+
+ // requestor Id
+ RequestorID int64 `json:"RequestorId,omitempty"`
+
+ // t b d
+ TBD string `json:"TBD,omitempty"`
+}
+
+// Validate validates this policy params
+func (m *PolicyParams) Validate(formats strfmt.Registry) error {
+ 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/models/report_params.go b/pkg/models/report_params.go
new file mode 100644
index 0000000..c4c12d3
--- /dev/null
+++ b/pkg/models/report_params.go
@@ -0,0 +1,88 @@
+// 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"
+)
+
+// ReportParams report params
+// swagger:model ReportParams
+type ReportParams struct {
+
+ // event triggers
+ // Required: true
+ EventTriggers EventTriggerList `json:"EventTriggers"`
+
+ // requestor Id
+ // Required: true
+ RequestorID *int64 `json:"RequestorId"`
+}
+
+// Validate validates this report params
+func (m *ReportParams) Validate(formats strfmt.Registry) error {
+ var res []error
+
+ if err := m.validateEventTriggers(formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.validateRequestorID(formats); err != nil {
+ res = append(res, err)
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ 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) validateRequestorID(formats strfmt.Registry) error {
+
+ if err := validate.Required("RequestorId", "body", m.RequestorID); err != nil {
+ 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/models/subscription_result.go b/pkg/models/subscription_result.go
new file mode 100644
index 0000000..d92eff6
--- /dev/null
+++ b/pkg/models/subscription_result.go
@@ -0,0 +1,19 @@
+// 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"
+)
+
+// SubscriptionResult A list of unique IDs
+// swagger:model SubscriptionResult
+type SubscriptionResult []int64
+
+// Validate validates this subscription result
+func (m SubscriptionResult) Validate(formats strfmt.Registry) error {
+ return nil
+}
diff --git a/pkg/models/subscription_type.go b/pkg/models/subscription_type.go
new file mode 100644
index 0000000..8c6b7cf
--- /dev/null
+++ b/pkg/models/subscription_type.go
@@ -0,0 +1,69 @@
+// 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/validate"
+)
+
+// SubscriptionType subscription type
+// swagger:model SubscriptionType
+type SubscriptionType string
+
+const (
+
+ // SubscriptionTypeControl captures enum value "control"
+ SubscriptionTypeControl SubscriptionType = "control"
+
+ // 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(`["control","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
+}