-
Notifications
You must be signed in to change notification settings - Fork 1
/
provisioning_approval_request.pb.object_ext.go
281 lines (242 loc) · 8.94 KB
/
provisioning_approval_request.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
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
// Code generated by protoc-gen-goten-object
// File: edgelq/devices/proto/v1alpha2/provisioning_approval_request.proto
// DO NOT EDIT!!!
package provisioning_approval_request
import (
"fmt"
"sort"
"google.golang.org/protobuf/proto"
"google.golang.org/protobuf/types/known/fieldmaskpb"
gotenobject "github.com/cloudwan/goten-sdk/runtime/object"
)
// proto imports
import (
ntt_meta "github.com/cloudwan/edgelq-sdk/common/types/meta"
provisioning_policy "github.com/cloudwan/edgelq-sdk/devices/resources/v1alpha2/provisioning_policy"
iam_service_account "github.com/cloudwan/edgelq-sdk/iam/resources/v1alpha2/service_account"
)
// ensure the imports are used
var (
_ = fmt.Stringer(nil)
_ = sort.Interface(nil)
_ = proto.Message(nil)
_ = fieldmaskpb.FieldMask{}
_ = gotenobject.FieldPath(nil)
)
// make sure we're using proto imports
var (
_ = &ntt_meta.Meta{}
_ = &provisioning_policy.ProvisioningPolicy{}
_ = &iam_service_account.ServiceAccount{}
)
func (o *ProvisioningApprovalRequest) GotenObjectExt() {}
func (o *ProvisioningApprovalRequest) MakeFullFieldMask() *ProvisioningApprovalRequest_FieldMask {
return FullProvisioningApprovalRequest_FieldMask()
}
func (o *ProvisioningApprovalRequest) MakeRawFullFieldMask() gotenobject.FieldMask {
return FullProvisioningApprovalRequest_FieldMask()
}
func (o *ProvisioningApprovalRequest) MakeDiffFieldMask(other *ProvisioningApprovalRequest) *ProvisioningApprovalRequest_FieldMask {
if o == nil && other == nil {
return &ProvisioningApprovalRequest_FieldMask{}
}
if o == nil || other == nil {
return FullProvisioningApprovalRequest_FieldMask()
}
res := &ProvisioningApprovalRequest_FieldMask{}
if o.GetName().String() != other.GetName().String() {
res.Paths = append(res.Paths, &ProvisioningApprovalRequest_FieldTerminalPath{selector: ProvisioningApprovalRequest_FieldPathSelectorName})
}
{
subMask := o.GetSpec().MakeDiffFieldMask(other.GetSpec())
if subMask.IsFull() {
res.Paths = append(res.Paths, &ProvisioningApprovalRequest_FieldTerminalPath{selector: ProvisioningApprovalRequest_FieldPathSelectorSpec})
} else {
for _, subpath := range subMask.Paths {
res.Paths = append(res.Paths, &ProvisioningApprovalRequest_FieldSubPath{selector: ProvisioningApprovalRequest_FieldPathSelectorSpec, subPath: subpath})
}
}
}
{
subMask := o.GetStatus().MakeDiffFieldMask(other.GetStatus())
if subMask.IsFull() {
res.Paths = append(res.Paths, &ProvisioningApprovalRequest_FieldTerminalPath{selector: ProvisioningApprovalRequest_FieldPathSelectorStatus})
} else {
for _, subpath := range subMask.Paths {
res.Paths = append(res.Paths, &ProvisioningApprovalRequest_FieldSubPath{selector: ProvisioningApprovalRequest_FieldPathSelectorStatus, subPath: subpath})
}
}
}
{
subMask := o.GetMetadata().MakeDiffFieldMask(other.GetMetadata())
if subMask.IsFull() {
res.Paths = append(res.Paths, &ProvisioningApprovalRequest_FieldTerminalPath{selector: ProvisioningApprovalRequest_FieldPathSelectorMetadata})
} else {
for _, subpath := range subMask.Paths {
res.Paths = append(res.Paths, &ProvisioningApprovalRequest_FieldSubPath{selector: ProvisioningApprovalRequest_FieldPathSelectorMetadata, subPath: subpath})
}
}
}
return res
}
func (o *ProvisioningApprovalRequest) MakeRawDiffFieldMask(other gotenobject.GotenObjectExt) gotenobject.FieldMask {
return o.MakeDiffFieldMask(other.(*ProvisioningApprovalRequest))
}
func (o *ProvisioningApprovalRequest) Clone() *ProvisioningApprovalRequest {
if o == nil {
return nil
}
result := &ProvisioningApprovalRequest{}
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.Spec = o.Spec.Clone()
result.Status = o.Status.Clone()
result.Metadata = o.Metadata.Clone()
return result
}
func (o *ProvisioningApprovalRequest) CloneRaw() gotenobject.GotenObjectExt {
return o.Clone()
}
func (o *ProvisioningApprovalRequest) Merge(source *ProvisioningApprovalRequest) {
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.GetSpec() != nil {
if o.Spec == nil {
o.Spec = new(ProvisioningApprovalRequest_Spec)
}
o.Spec.Merge(source.GetSpec())
}
if source.GetStatus() != nil {
if o.Status == nil {
o.Status = new(ProvisioningApprovalRequest_Status)
}
o.Status.Merge(source.GetStatus())
}
if source.GetMetadata() != nil {
if o.Metadata == nil {
o.Metadata = new(ntt_meta.Meta)
}
o.Metadata.Merge(source.GetMetadata())
}
}
func (o *ProvisioningApprovalRequest) MergeRaw(source gotenobject.GotenObjectExt) {
o.Merge(source.(*ProvisioningApprovalRequest))
}
func (o *ProvisioningApprovalRequest_Spec) GotenObjectExt() {}
func (o *ProvisioningApprovalRequest_Spec) MakeFullFieldMask() *ProvisioningApprovalRequest_Spec_FieldMask {
return FullProvisioningApprovalRequest_Spec_FieldMask()
}
func (o *ProvisioningApprovalRequest_Spec) MakeRawFullFieldMask() gotenobject.FieldMask {
return FullProvisioningApprovalRequest_Spec_FieldMask()
}
func (o *ProvisioningApprovalRequest_Spec) MakeDiffFieldMask(other *ProvisioningApprovalRequest_Spec) *ProvisioningApprovalRequest_Spec_FieldMask {
if o == nil && other == nil {
return &ProvisioningApprovalRequest_Spec_FieldMask{}
}
if o == nil || other == nil {
return FullProvisioningApprovalRequest_Spec_FieldMask()
}
res := &ProvisioningApprovalRequest_Spec_FieldMask{}
if o.GetConclusion() != other.GetConclusion() {
res.Paths = append(res.Paths, &ProvisioningApprovalRequestSpec_FieldTerminalPath{selector: ProvisioningApprovalRequestSpec_FieldPathSelectorConclusion})
}
if o.GetServiceAccount().String() != other.GetServiceAccount().String() {
res.Paths = append(res.Paths, &ProvisioningApprovalRequestSpec_FieldTerminalPath{selector: ProvisioningApprovalRequestSpec_FieldPathSelectorServiceAccount})
}
return res
}
func (o *ProvisioningApprovalRequest_Spec) MakeRawDiffFieldMask(other gotenobject.GotenObjectExt) gotenobject.FieldMask {
return o.MakeDiffFieldMask(other.(*ProvisioningApprovalRequest_Spec))
}
func (o *ProvisioningApprovalRequest_Spec) Clone() *ProvisioningApprovalRequest_Spec {
if o == nil {
return nil
}
result := &ProvisioningApprovalRequest_Spec{}
result.Conclusion = o.Conclusion
if o.ServiceAccount == nil {
result.ServiceAccount = nil
} else if data, err := o.ServiceAccount.ProtoString(); err != nil {
panic(err)
} else {
result.ServiceAccount = &iam_service_account.Reference{}
if err := result.ServiceAccount.ParseProtoString(data); err != nil {
panic(err)
}
}
return result
}
func (o *ProvisioningApprovalRequest_Spec) CloneRaw() gotenobject.GotenObjectExt {
return o.Clone()
}
func (o *ProvisioningApprovalRequest_Spec) Merge(source *ProvisioningApprovalRequest_Spec) {
o.Conclusion = source.GetConclusion()
if source.GetServiceAccount() != nil {
if data, err := source.GetServiceAccount().ProtoString(); err != nil {
panic(err)
} else {
o.ServiceAccount = &iam_service_account.Reference{}
if err := o.ServiceAccount.ParseProtoString(data); err != nil {
panic(err)
}
}
} else {
o.ServiceAccount = nil
}
}
func (o *ProvisioningApprovalRequest_Spec) MergeRaw(source gotenobject.GotenObjectExt) {
o.Merge(source.(*ProvisioningApprovalRequest_Spec))
}
func (o *ProvisioningApprovalRequest_Status) GotenObjectExt() {}
func (o *ProvisioningApprovalRequest_Status) MakeFullFieldMask() *ProvisioningApprovalRequest_Status_FieldMask {
return FullProvisioningApprovalRequest_Status_FieldMask()
}
func (o *ProvisioningApprovalRequest_Status) MakeRawFullFieldMask() gotenobject.FieldMask {
return FullProvisioningApprovalRequest_Status_FieldMask()
}
func (o *ProvisioningApprovalRequest_Status) MakeDiffFieldMask(other *ProvisioningApprovalRequest_Status) *ProvisioningApprovalRequest_Status_FieldMask {
if o == nil && other == nil {
return &ProvisioningApprovalRequest_Status_FieldMask{}
}
if o == nil || other == nil {
return FullProvisioningApprovalRequest_Status_FieldMask()
}
res := &ProvisioningApprovalRequest_Status_FieldMask{}
return res
}
func (o *ProvisioningApprovalRequest_Status) MakeRawDiffFieldMask(other gotenobject.GotenObjectExt) gotenobject.FieldMask {
return o.MakeDiffFieldMask(other.(*ProvisioningApprovalRequest_Status))
}
func (o *ProvisioningApprovalRequest_Status) Clone() *ProvisioningApprovalRequest_Status {
if o == nil {
return nil
}
result := &ProvisioningApprovalRequest_Status{}
return result
}
func (o *ProvisioningApprovalRequest_Status) CloneRaw() gotenobject.GotenObjectExt {
return o.Clone()
}
func (o *ProvisioningApprovalRequest_Status) Merge(source *ProvisioningApprovalRequest_Status) {
}
func (o *ProvisioningApprovalRequest_Status) MergeRaw(source gotenobject.GotenObjectExt) {
o.Merge(source.(*ProvisioningApprovalRequest_Status))
}