/
os_image_profile.pb.object_ext.go
197 lines (178 loc) · 6.09 KB
/
os_image_profile.pb.object_ext.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
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
// Code generated by protoc-gen-goten-object
// File: edgelq/devices/proto/v1alpha2/os_image_profile.proto
// DO NOT EDIT!!!
package os_image_profile
import (
"fmt"
"sort"
"google.golang.org/protobuf/proto"
googlefieldmaskpb "google.golang.org/protobuf/types/known/fieldmaskpb"
gotenobject "github.com/cloudwan/goten-sdk/runtime/object"
)
// proto imports
import (
device_type "github.com/cloudwan/edgelq-sdk/devices/resources/v1alpha2/device_type"
project "github.com/cloudwan/edgelq-sdk/devices/resources/v1alpha2/project"
meta "github.com/cloudwan/goten-sdk/types/meta"
)
// ensure the imports are used
var (
_ = new(fmt.Stringer)
_ = new(sort.Interface)
_ = new(proto.Message)
_ = googlefieldmaskpb.FieldMask{}
_ = new(gotenobject.FieldPath)
)
// make sure we're using proto imports
var (
_ = &device_type.DeviceType{}
_ = &project.Project{}
_ = &meta.Meta{}
)
func (o *OsImageProfile) GotenObjectExt() {}
func (o *OsImageProfile) MakeFullFieldMask() *OsImageProfile_FieldMask {
return FullOsImageProfile_FieldMask()
}
func (o *OsImageProfile) MakeRawFullFieldMask() gotenobject.FieldMask {
return FullOsImageProfile_FieldMask()
}
func (o *OsImageProfile) MakeDiffFieldMask(other *OsImageProfile) *OsImageProfile_FieldMask {
if o == nil && other == nil {
return &OsImageProfile_FieldMask{}
}
if o == nil || other == nil {
return FullOsImageProfile_FieldMask()
}
res := &OsImageProfile_FieldMask{}
if o.GetName().String() != other.GetName().String() {
res.Paths = append(res.Paths, &OsImageProfile_FieldTerminalPath{selector: OsImageProfile_FieldPathSelectorName})
}
{
subMask := o.GetMetadata().MakeDiffFieldMask(other.GetMetadata())
if subMask.IsFull() {
res.Paths = append(res.Paths, &OsImageProfile_FieldTerminalPath{selector: OsImageProfile_FieldPathSelectorMetadata})
} else {
for _, subpath := range subMask.Paths {
res.Paths = append(res.Paths, &OsImageProfile_FieldSubPath{selector: OsImageProfile_FieldPathSelectorMetadata, subPath: subpath})
}
}
}
if o.GetDisplayName() != other.GetDisplayName() {
res.Paths = append(res.Paths, &OsImageProfile_FieldTerminalPath{selector: OsImageProfile_FieldPathSelectorDisplayName})
}
if o.GetDeviceType().String() != other.GetDeviceType().String() {
res.Paths = append(res.Paths, &OsImageProfile_FieldTerminalPath{selector: OsImageProfile_FieldPathSelectorDeviceType})
}
if o.GetInstallAiAccelerator() != other.GetInstallAiAccelerator() {
res.Paths = append(res.Paths, &OsImageProfile_FieldTerminalPath{selector: OsImageProfile_FieldPathSelectorInstallAiAccelerator})
}
if o.GetEncryption() != other.GetEncryption() {
res.Paths = append(res.Paths, &OsImageProfile_FieldTerminalPath{selector: OsImageProfile_FieldPathSelectorEncryption})
}
if o.GetDiskMapping() != other.GetDiskMapping() {
res.Paths = append(res.Paths, &OsImageProfile_FieldTerminalPath{selector: OsImageProfile_FieldPathSelectorDiskMapping})
}
if o.GetNetworkAgent() != other.GetNetworkAgent() {
res.Paths = append(res.Paths, &OsImageProfile_FieldTerminalPath{selector: OsImageProfile_FieldPathSelectorNetworkAgent})
}
if o.GetNtp() != other.GetNtp() {
res.Paths = append(res.Paths, &OsImageProfile_FieldTerminalPath{selector: OsImageProfile_FieldPathSelectorNtp})
}
if o.GetHttpProxy() != other.GetHttpProxy() {
res.Paths = append(res.Paths, &OsImageProfile_FieldTerminalPath{selector: OsImageProfile_FieldPathSelectorHttpProxy})
}
if o.GetHttpsProxy() != other.GetHttpsProxy() {
res.Paths = append(res.Paths, &OsImageProfile_FieldTerminalPath{selector: OsImageProfile_FieldPathSelectorHttpsProxy})
}
if o.GetNoProxy() != other.GetNoProxy() {
res.Paths = append(res.Paths, &OsImageProfile_FieldTerminalPath{selector: OsImageProfile_FieldPathSelectorNoProxy})
}
return res
}
func (o *OsImageProfile) MakeRawDiffFieldMask(other gotenobject.GotenObjectExt) gotenobject.FieldMask {
return o.MakeDiffFieldMask(other.(*OsImageProfile))
}
func (o *OsImageProfile) Clone() *OsImageProfile {
if o == nil {
return nil
}
result := &OsImageProfile{}
if o.Name == nil {
result.Name = nil
} else if data, err := o.Name.ProtoString(); err != nil {
panic(err)
} else {
result.Name = &Name{}
if err := result.Name.ParseProtoString(data); err != nil {
panic(err)
}
}
result.Metadata = o.Metadata.Clone()
result.DisplayName = o.DisplayName
if o.DeviceType == nil {
result.DeviceType = nil
} else if data, err := o.DeviceType.ProtoString(); err != nil {
panic(err)
} else {
result.DeviceType = &device_type.Reference{}
if err := result.DeviceType.ParseProtoString(data); err != nil {
panic(err)
}
}
result.InstallAiAccelerator = o.InstallAiAccelerator
result.Encryption = o.Encryption
result.DiskMapping = o.DiskMapping
result.NetworkAgent = o.NetworkAgent
result.Ntp = o.Ntp
result.HttpProxy = o.HttpProxy
result.HttpsProxy = o.HttpsProxy
result.NoProxy = o.NoProxy
return result
}
func (o *OsImageProfile) CloneRaw() gotenobject.GotenObjectExt {
return o.Clone()
}
func (o *OsImageProfile) Merge(source *OsImageProfile) {
if source.GetName() != nil {
if data, err := source.GetName().ProtoString(); err != nil {
panic(err)
} else {
o.Name = &Name{}
if err := o.Name.ParseProtoString(data); err != nil {
panic(err)
}
}
} else {
o.Name = nil
}
if source.GetMetadata() != nil {
if o.Metadata == nil {
o.Metadata = new(meta.Meta)
}
o.Metadata.Merge(source.GetMetadata())
}
o.DisplayName = source.GetDisplayName()
if source.GetDeviceType() != nil {
if data, err := source.GetDeviceType().ProtoString(); err != nil {
panic(err)
} else {
o.DeviceType = &device_type.Reference{}
if err := o.DeviceType.ParseProtoString(data); err != nil {
panic(err)
}
}
} else {
o.DeviceType = nil
}
o.InstallAiAccelerator = source.GetInstallAiAccelerator()
o.Encryption = source.GetEncryption()
o.DiskMapping = source.GetDiskMapping()
o.NetworkAgent = source.GetNetworkAgent()
o.Ntp = source.GetNtp()
o.HttpProxy = source.GetHttpProxy()
o.HttpsProxy = source.GetHttpsProxy()
o.NoProxy = source.GetNoProxy()
}
func (o *OsImageProfile) MergeRaw(source gotenobject.GotenObjectExt) {
o.Merge(source.(*OsImageProfile))
}