-
Notifications
You must be signed in to change notification settings - Fork 0
/
memo.pb.object_ext.go
111 lines (92 loc) · 2.72 KB
/
memo.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
// Code generated by protoc-gen-goten-object
// File: goten/types/memo.proto
// DO NOT EDIT!!!
package memo
import (
"fmt"
"sort"
"google.golang.org/protobuf/proto"
googlefieldmaskpb "google.golang.org/protobuf/types/known/fieldmaskpb"
gotenobject "github.com/cloudwan/goten-sdk/runtime/object"
)
// proto imports
import (
timestamppb "google.golang.org/protobuf/types/known/timestamppb"
)
// ensure the imports are used
var (
_ = new(fmt.Stringer)
_ = new(sort.Interface)
_ = new(proto.Message)
_ = googlefieldmaskpb.FieldMask{}
_ = new(gotenobject.FieldPath)
)
// make sure we're using proto imports
var (
_ = ×tamppb.Timestamp{}
)
func (o *Memo) GotenObjectExt() {}
func (o *Memo) MakeFullFieldMask() *Memo_FieldMask {
return FullMemo_FieldMask()
}
func (o *Memo) MakeRawFullFieldMask() gotenobject.FieldMask {
return FullMemo_FieldMask()
}
func (o *Memo) MakeDiffFieldMask(other *Memo) *Memo_FieldMask {
if o == nil && other == nil {
return &Memo_FieldMask{}
}
if o == nil || other == nil {
return FullMemo_FieldMask()
}
res := &Memo_FieldMask{}
if !proto.Equal(o.GetCreateTime(), other.GetCreateTime()) {
res.Paths = append(res.Paths, &Memo_FieldTerminalPath{selector: Memo_FieldPathSelectorCreateTime})
}
if !proto.Equal(o.GetUpdateTime(), other.GetUpdateTime()) {
res.Paths = append(res.Paths, &Memo_FieldTerminalPath{selector: Memo_FieldPathSelectorUpdateTime})
}
if o.GetMessage() != other.GetMessage() {
res.Paths = append(res.Paths, &Memo_FieldTerminalPath{selector: Memo_FieldPathSelectorMessage})
}
if o.GetCreatedBy() != other.GetCreatedBy() {
res.Paths = append(res.Paths, &Memo_FieldTerminalPath{selector: Memo_FieldPathSelectorCreatedBy})
}
return res
}
func (o *Memo) MakeRawDiffFieldMask(other gotenobject.GotenObjectExt) gotenobject.FieldMask {
return o.MakeDiffFieldMask(other.(*Memo))
}
func (o *Memo) Clone() *Memo {
if o == nil {
return nil
}
result := &Memo{}
result.CreateTime = proto.Clone(o.CreateTime).(*timestamppb.Timestamp)
result.UpdateTime = proto.Clone(o.UpdateTime).(*timestamppb.Timestamp)
result.Message = o.Message
result.CreatedBy = o.CreatedBy
return result
}
func (o *Memo) CloneRaw() gotenobject.GotenObjectExt {
return o.Clone()
}
func (o *Memo) Merge(source *Memo) {
if source.GetCreateTime() != nil {
if o.CreateTime == nil {
o.CreateTime = new(timestamppb.Timestamp)
}
proto.Merge(o.CreateTime, source.GetCreateTime())
}
if source.GetUpdateTime() != nil {
if o.UpdateTime == nil {
o.UpdateTime = new(timestamppb.Timestamp)
}
proto.Merge(o.UpdateTime, source.GetUpdateTime())
}
o.Message = source.GetMessage()
o.CreatedBy = source.GetCreatedBy()
}
func (o *Memo) MergeRaw(source gotenobject.GotenObjectExt) {
o.Merge(source.(*Memo))
}