-
Notifications
You must be signed in to change notification settings - Fork 302
/
email_messages.pb.setters.fm.go
66 lines (62 loc) · 1.5 KB
/
email_messages.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
// Code generated by protoc-gen-fieldmask. DO NOT EDIT.
package ttnpb
import fmt "fmt"
func (dst *CreateClientEmailMessage) SetFields(src *CreateClientEmailMessage, paths ...string) error {
for name, subs := range _processPaths(paths) {
switch name {
case "create_client_request":
if len(subs) > 0 {
var newDst, newSrc *CreateClientRequest
if (src == nil || src.CreateClientRequest == nil) && dst.CreateClientRequest == nil {
continue
}
if src != nil {
newSrc = src.CreateClientRequest
}
if dst.CreateClientRequest != nil {
newDst = dst.CreateClientRequest
} else {
newDst = &CreateClientRequest{}
dst.CreateClientRequest = newDst
}
if err := newDst.SetFields(newSrc, subs...); err != nil {
return err
}
} else {
if src != nil {
dst.CreateClientRequest = src.CreateClientRequest
} else {
dst.CreateClientRequest = nil
}
}
case "api_key":
if len(subs) > 0 {
var newDst, newSrc *APIKey
if (src == nil || src.ApiKey == nil) && dst.ApiKey == nil {
continue
}
if src != nil {
newSrc = src.ApiKey
}
if dst.ApiKey != nil {
newDst = dst.ApiKey
} else {
newDst = &APIKey{}
dst.ApiKey = newDst
}
if err := newDst.SetFields(newSrc, subs...); err != nil {
return err
}
} else {
if src != nil {
dst.ApiKey = src.ApiKey
} else {
dst.ApiKey = nil
}
}
default:
return fmt.Errorf("invalid field: '%s'", name)
}
}
return nil
}