Add models
[ric-plt/xapp-frame.git] / pkg / clientmodel / subscription_type.go
diff --git a/pkg/clientmodel/subscription_type.go b/pkg/clientmodel/subscription_type.go
new file mode 100644 (file)
index 0000000..6a2574c
--- /dev/null
@@ -0,0 +1,69 @@
+// 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 (
+
+       // 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
+}