-
Notifications
You must be signed in to change notification settings - Fork 1
/
permission.pb.object_ext.go
112 lines (93 loc) · 2.61 KB
/
permission.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
// Code generated by protoc-gen-goten-object
// File: edgelq/iam/proto/v1alpha/permission.proto
// DO NOT EDIT!!!
package permission
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 ()
// ensure the imports are used
var (
_ = new(fmt.Stringer)
_ = new(sort.Interface)
_ = new(proto.Message)
_ = fieldmaskpb.FieldMask{}
_ = new(gotenobject.FieldPath)
)
// make sure we're using proto imports
var ()
func (o *Permission) GotenObjectExt() {}
func (o *Permission) MakeFullFieldMask() *Permission_FieldMask {
return FullPermission_FieldMask()
}
func (o *Permission) MakeRawFullFieldMask() gotenobject.FieldMask {
return FullPermission_FieldMask()
}
func (o *Permission) MakeDiffFieldMask(other *Permission) *Permission_FieldMask {
if o == nil && other == nil {
return &Permission_FieldMask{}
}
if o == nil || other == nil {
return FullPermission_FieldMask()
}
res := &Permission_FieldMask{}
if o.GetName().String() != other.GetName().String() {
res.Paths = append(res.Paths, &Permission_FieldTerminalPath{selector: Permission_FieldPathSelectorName})
}
if o.GetTitle() != other.GetTitle() {
res.Paths = append(res.Paths, &Permission_FieldTerminalPath{selector: Permission_FieldPathSelectorTitle})
}
if o.GetDescription() != other.GetDescription() {
res.Paths = append(res.Paths, &Permission_FieldTerminalPath{selector: Permission_FieldPathSelectorDescription})
}
return res
}
func (o *Permission) MakeRawDiffFieldMask(other gotenobject.GotenObjectExt) gotenobject.FieldMask {
return o.MakeDiffFieldMask(other.(*Permission))
}
func (o *Permission) Clone() *Permission {
if o == nil {
return nil
}
result := &Permission{}
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.Title = o.Title
result.Description = o.Description
return result
}
func (o *Permission) CloneRaw() gotenobject.GotenObjectExt {
return o.Clone()
}
func (o *Permission) Merge(source *Permission) {
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
}
o.Title = source.GetTitle()
o.Description = source.GetDescription()
}
func (o *Permission) MergeRaw(source gotenobject.GotenObjectExt) {
o.Merge(source.(*Permission))
}