X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=pkg%2Fclientmodel%2Fsubscription_type.go;fp=pkg%2Fclientmodel%2Fsubscription_type.go;h=6a2574ca3719cb69d9c8bc9c9d42dc227683af47;hb=3895a8c8775ef96652e6473414fdd7366c59f404;hp=0000000000000000000000000000000000000000;hpb=5120ec103eead26427b977f4b2456c2ce57b36ac;p=ric-plt%2Fxapp-frame.git diff --git a/pkg/clientmodel/subscription_type.go b/pkg/clientmodel/subscription_type.go new file mode 100644 index 0000000..6a2574c --- /dev/null +++ b/pkg/clientmodel/subscription_type.go @@ -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 +}