New API version with additional structures and params
[ric-plt/xapp-frame.git] / pkg / models / subscription_type.go
1 // Code generated by go-swagger; DO NOT EDIT.
2
3 package models
4
5 // This file was generated by the swagger tool.
6 // Editing this file might prove futile when you re-run the swagger generate command
7
8 import (
9         "encoding/json"
10
11         strfmt "github.com/go-openapi/strfmt"
12
13         "github.com/go-openapi/errors"
14         "github.com/go-openapi/validate"
15 )
16
17 // SubscriptionType subscription type
18 // swagger:model SubscriptionType
19 type SubscriptionType string
20
21 const (
22
23         // SubscriptionTypeInsert captures enum value "insert"
24         SubscriptionTypeInsert SubscriptionType = "insert"
25
26         // SubscriptionTypePolicy captures enum value "policy"
27         SubscriptionTypePolicy SubscriptionType = "policy"
28
29         // SubscriptionTypeReport captures enum value "report"
30         SubscriptionTypeReport SubscriptionType = "report"
31 )
32
33 // for schema
34 var subscriptionTypeEnum []interface{}
35
36 func init() {
37         var res []SubscriptionType
38         if err := json.Unmarshal([]byte(`["insert","policy","report"]`), &res); err != nil {
39                 panic(err)
40         }
41         for _, v := range res {
42                 subscriptionTypeEnum = append(subscriptionTypeEnum, v)
43         }
44 }
45
46 func (m SubscriptionType) validateSubscriptionTypeEnum(path, location string, value SubscriptionType) error {
47         if err := validate.Enum(path, location, value, subscriptionTypeEnum); err != nil {
48                 return err
49         }
50         return nil
51 }
52
53 // Validate validates this subscription type
54 func (m SubscriptionType) Validate(formats strfmt.Registry) error {
55         var res []error
56
57         // value enum
58         if err := m.validateSubscriptionTypeEnum("", "body", m); err != nil {
59                 return err
60         }
61
62         if len(res) > 0 {
63                 return errors.CompositeValidationError(res...)
64         }
65         return nil
66 }