-
Notifications
You must be signed in to change notification settings - Fork 310
/
gateway_configuration.pb.setters.fm.go
91 lines (85 loc) · 2.06 KB
/
gateway_configuration.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
// Code generated by protoc-gen-fieldmask. DO NOT EDIT.
package ttnpb
import fmt "fmt"
func (dst *GetGatewayConfigurationRequest) SetFields(src *GetGatewayConfigurationRequest, paths ...string) error {
for name, subs := range _processPaths(paths) {
switch name {
case "gateway_ids":
if len(subs) > 0 {
var newDst, newSrc *GatewayIdentifiers
if (src == nil || src.GatewayIds == nil) && dst.GatewayIds == nil {
continue
}
if src != nil {
newSrc = src.GatewayIds
}
if dst.GatewayIds != nil {
newDst = dst.GatewayIds
} else {
newDst = &GatewayIdentifiers{}
dst.GatewayIds = newDst
}
if err := newDst.SetFields(newSrc, subs...); err != nil {
return err
}
} else {
if src != nil {
dst.GatewayIds = src.GatewayIds
} else {
dst.GatewayIds = nil
}
}
case "format":
if len(subs) > 0 {
return fmt.Errorf("'format' has no subfields, but %s were specified", subs)
}
if src != nil {
dst.Format = src.Format
} else {
var zero string
dst.Format = zero
}
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 "filename":
if len(subs) > 0 {
return fmt.Errorf("'filename' has no subfields, but %s were specified", subs)
}
if src != nil {
dst.Filename = src.Filename
} else {
var zero string
dst.Filename = zero
}
default:
return fmt.Errorf("invalid field: '%s'", name)
}
}
return nil
}
func (dst *GetGatewayConfigurationResponse) SetFields(src *GetGatewayConfigurationResponse, paths ...string) error {
for name, subs := range _processPaths(paths) {
switch name {
case "contents":
if len(subs) > 0 {
return fmt.Errorf("'contents' has no subfields, but %s were specified", subs)
}
if src != nil {
dst.Contents = src.Contents
} else {
dst.Contents = nil
}
default:
return fmt.Errorf("invalid field: '%s'", name)
}
}
return nil
}