-
Notifications
You must be signed in to change notification settings - Fork 310
/
applicationserver_integrations_storage.pb.setters.fm.go
122 lines (118 loc) · 2.79 KB
/
applicationserver_integrations_storage.pb.setters.fm.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
// Code generated by protoc-gen-fieldmask. DO NOT EDIT.
package ttnpb
import fmt "fmt"
func (dst *GetStoredApplicationUpRequest) SetFields(src *GetStoredApplicationUpRequest, paths ...string) error {
for name, subs := range _processPaths(paths) {
switch name {
case "application_ids":
if len(subs) > 0 {
var newDst, newSrc *ApplicationIdentifiers
if (src == nil || src.ApplicationIDs == nil) && dst.ApplicationIDs == nil {
continue
}
if src != nil {
newSrc = src.ApplicationIDs
}
if dst.ApplicationIDs != nil {
newDst = dst.ApplicationIDs
} else {
newDst = &ApplicationIdentifiers{}
dst.ApplicationIDs = newDst
}
if err := newDst.SetFields(newSrc, subs...); err != nil {
return err
}
} else {
if src != nil {
dst.ApplicationIDs = src.ApplicationIDs
} else {
dst.ApplicationIDs = nil
}
}
case "end_device_ids":
if len(subs) > 0 {
var newDst, newSrc *EndDeviceIdentifiers
if (src == nil || src.EndDeviceIDs == nil) && dst.EndDeviceIDs == nil {
continue
}
if src != nil {
newSrc = src.EndDeviceIDs
}
if dst.EndDeviceIDs != nil {
newDst = dst.EndDeviceIDs
} else {
newDst = &EndDeviceIdentifiers{}
dst.EndDeviceIDs = newDst
}
if err := newDst.SetFields(newSrc, subs...); err != nil {
return err
}
} else {
if src != nil {
dst.EndDeviceIDs = src.EndDeviceIDs
} else {
dst.EndDeviceIDs = nil
}
}
case "type":
if len(subs) > 0 {
return fmt.Errorf("'type' has no subfields, but %s were specified", subs)
}
if src != nil {
dst.Type = src.Type
} else {
var zero string
dst.Type = zero
}
case "limit":
if len(subs) > 0 {
return fmt.Errorf("'limit' has no subfields, but %s were specified", subs)
}
if src != nil {
dst.Limit = src.Limit
} else {
dst.Limit = nil
}
case "after":
if len(subs) > 0 {
return fmt.Errorf("'after' has no subfields, but %s were specified", subs)
}
if src != nil {
dst.After = src.After
} else {
dst.After = nil
}
case "before":
if len(subs) > 0 {
return fmt.Errorf("'before' has no subfields, but %s were specified", subs)
}
if src != nil {
dst.Before = src.Before
} else {
dst.Before = nil
}
case "f_port":
if len(subs) > 0 {
return fmt.Errorf("'f_port' has no subfields, but %s were specified", subs)
}
if src != nil {
dst.FPort = src.FPort
} else {
dst.FPort = nil
}
case "order":
if len(subs) > 0 {
return fmt.Errorf("'order' has no subfields, but %s were specified", subs)
}
if src != nil {
dst.Order = src.Order
} else {
var zero string
dst.Order = zero
}
default:
return fmt.Errorf("invalid field: '%s'", name)
}
}
return nil
}