generated from dogmatiq/template-go
-
Notifications
You must be signed in to change notification settings - Fork 0
/
identity_primo.pb.go
64 lines (54 loc) 路 1.75 KB
/
identity_primo.pb.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
// Code generated by protoc-gen-go-primo. DO NOT EDIT.
// versions:
// protoc-gen-go-primo v
// protoc v5.26.0
// source: github.com/dogmatiq/enginekit/protobuf/identitypb/identity.proto
package identitypb
import uuidpb "github.com/dogmatiq/enginekit/protobuf/uuidpb"
type IdentityBuilder struct {
prototype Identity
}
// NewIdentityBuilder returns a builder that constructs [Identity] messages.
func NewIdentityBuilder() *IdentityBuilder {
return &IdentityBuilder{}
}
// From configures the builder to use x as the prototype for new messages,
// then returns b.
//
// It performs a shallow copy of x, such that any changes made via the builder
// do not modify x. It does not make a copy of the field values themselves.
func (b *IdentityBuilder) From(x *Identity) *IdentityBuilder {
b.prototype.Name = x.Name
b.prototype.Key = x.Key
return b
}
// Build returns a new [Identity] containing the values configured via the builder.
//
// Each call returns a new message, such that future changes to the builder do
// not modify previously constructed messages.
func (b *IdentityBuilder) Build() *Identity {
return &Identity{
Name: b.prototype.Name,
Key: b.prototype.Key,
}
}
// WithName configures the builder to set the Name field to v,
// then returns b.
func (b *IdentityBuilder) WithName(v string) *IdentityBuilder {
b.prototype.Name = v
return b
}
// WithKey configures the builder to set the Key field to v,
// then returns b.
func (b *IdentityBuilder) WithKey(v *uuidpb.UUID) *IdentityBuilder {
b.prototype.Key = v
return b
}
// SetName sets the x.Name field to v, then returns x.
func (x *Identity) SetName(v string) {
x.Name = v
}
// SetKey sets the x.Key field to v, then returns x.
func (x *Identity) SetKey(v *uuidpb.UUID) {
x.Key = v
}