/
manager_network_protocol100_s_s_d_protocol.go
149 lines (113 loc) · 4.18 KB
/
manager_network_protocol100_s_s_d_protocol.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
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/swag"
"github.com/go-openapi/errors"
"github.com/go-openapi/validate"
)
// ManagerNetworkProtocol100SSDProtocol manager network protocol 1 0 0 s s d protocol
// swagger:model ManagerNetworkProtocol.1.0.0_SSDProtocol
type ManagerNetworkProtocol100SSDProtocol struct {
// Indicates the scope for the IPv6 Notify messages for SSDP.
NotifyIPV6Scope string `json:"NotifyIPv6Scope,omitempty"`
// Indicates how often the Multicast is done from this service for SSDP.
// Minimum: 0
NotifyMulticastIntervalSeconds *float64 `json:"NotifyMulticastIntervalSeconds,omitempty"`
// Indicates the time to live hop count for SSDPs Notify messages.
// Minimum: 1
NotifyTTL float64 `json:"NotifyTTL,omitempty"`
// Indicates the protocol port.
// Minimum: 0
Port *float64 `json:"Port,omitempty"`
// Indicates if the protocol is enabled or disabled
ProtocolEnabled bool `json:"ProtocolEnabled,omitempty"`
}
// Validate validates this manager network protocol 1 0 0 s s d protocol
func (m *ManagerNetworkProtocol100SSDProtocol) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateNotifyIPV6Scope(formats); err != nil {
// prop
res = append(res, err)
}
if err := m.validateNotifyMulticastIntervalSeconds(formats); err != nil {
// prop
res = append(res, err)
}
if err := m.validateNotifyTTL(formats); err != nil {
// prop
res = append(res, err)
}
if err := m.validatePort(formats); err != nil {
// prop
res = append(res, err)
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil
}
var managerNetworkProtocol100SSDProtocolTypeNotifyIPV6ScopePropEnum []interface{}
func init() {
var res []string
if err := json.Unmarshal([]byte(`["Link","Site","Organization"]`), &res); err != nil {
panic(err)
}
for _, v := range res {
managerNetworkProtocol100SSDProtocolTypeNotifyIPV6ScopePropEnum = append(managerNetworkProtocol100SSDProtocolTypeNotifyIPV6ScopePropEnum, v)
}
}
const (
// ManagerNetworkProtocol100SSDProtocolNotifyIPV6ScopeLink captures enum value "Link"
ManagerNetworkProtocol100SSDProtocolNotifyIPV6ScopeLink string = "Link"
// ManagerNetworkProtocol100SSDProtocolNotifyIPV6ScopeSite captures enum value "Site"
ManagerNetworkProtocol100SSDProtocolNotifyIPV6ScopeSite string = "Site"
// ManagerNetworkProtocol100SSDProtocolNotifyIPV6ScopeOrganization captures enum value "Organization"
ManagerNetworkProtocol100SSDProtocolNotifyIPV6ScopeOrganization string = "Organization"
)
// prop value enum
func (m *ManagerNetworkProtocol100SSDProtocol) validateNotifyIPV6ScopeEnum(path, location string, value string) error {
if err := validate.Enum(path, location, value, managerNetworkProtocol100SSDProtocolTypeNotifyIPV6ScopePropEnum); err != nil {
return err
}
return nil
}
func (m *ManagerNetworkProtocol100SSDProtocol) validateNotifyIPV6Scope(formats strfmt.Registry) error {
if swag.IsZero(m.NotifyIPV6Scope) { // not required
return nil
}
// value enum
if err := m.validateNotifyIPV6ScopeEnum("NotifyIPv6Scope", "body", m.NotifyIPV6Scope); err != nil {
return err
}
return nil
}
func (m *ManagerNetworkProtocol100SSDProtocol) validateNotifyMulticastIntervalSeconds(formats strfmt.Registry) error {
if swag.IsZero(m.NotifyMulticastIntervalSeconds) { // not required
return nil
}
if err := validate.Minimum("NotifyMulticastIntervalSeconds", "body", float64(*m.NotifyMulticastIntervalSeconds), 0, false); err != nil {
return err
}
return nil
}
func (m *ManagerNetworkProtocol100SSDProtocol) validateNotifyTTL(formats strfmt.Registry) error {
if swag.IsZero(m.NotifyTTL) { // not required
return nil
}
if err := validate.Minimum("NotifyTTL", "body", float64(m.NotifyTTL), 1, false); err != nil {
return err
}
return nil
}
func (m *ManagerNetworkProtocol100SSDProtocol) validatePort(formats strfmt.Registry) error {
if swag.IsZero(m.Port) { // not required
return nil
}
if err := validate.Minimum("Port", "body", float64(*m.Port), 0, false); err != nil {
return err
}
return nil
}