Add models
[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         // SubscriptionTypeControl captures enum value "control"
24         SubscriptionTypeControl SubscriptionType = "control"
25
26         // SubscriptionTypeInsert captures enum value "insert"
27         SubscriptionTypeInsert SubscriptionType = "insert"
28
29         // SubscriptionTypePolicy captures enum value "policy"
30         SubscriptionTypePolicy SubscriptionType = "policy"
31
32         // SubscriptionTypeReport captures enum value "report"
33         SubscriptionTypeReport SubscriptionType = "report"
34 )
35
36 // for schema
37 var subscriptionTypeEnum []interface{}
38
39 func init() {
40         var res []SubscriptionType
41         if err := json.Unmarshal([]byte(`["control","insert","policy","report"]`), &res); err != nil {
42                 panic(err)
43         }
44         for _, v := range res {
45                 subscriptionTypeEnum = append(subscriptionTypeEnum, v)
46         }
47 }
48
49 func (m SubscriptionType) validateSubscriptionTypeEnum(path, location string, value SubscriptionType) error {
50         if err := validate.Enum(path, location, value, subscriptionTypeEnum); err != nil {
51                 return err
52         }
53         return nil
54 }
55
56 // Validate validates this subscription type
57 func (m SubscriptionType) Validate(formats strfmt.Registry) error {
58         var res []error
59
60         // value enum
61         if err := m.validateSubscriptionTypeEnum("", "body", m); err != nil {
62                 return err
63         }
64
65         if len(res) > 0 {
66                 return errors.CompositeValidationError(res...)
67         }
68         return nil
69 }