From ca2e272d42bc779f01a20e6c0f5144b4101adcd2 Mon Sep 17 00:00:00 2001 From: Leonard Lyubich Date: Thu, 1 Apr 2021 17:24:38 +0300 Subject: [PATCH] [#265] reputation/grpc: Implement setters on generated messages Signed-off-by: Leonard Lyubich --- v2/reputation/grpc/service.go | 56 +++++++++++++++++++++++++++++++++++ v2/reputation/grpc/types.go | 48 +++++++++++++++++++++++++++++- 2 files changed, 103 insertions(+), 1 deletion(-) diff --git a/v2/reputation/grpc/service.go b/v2/reputation/grpc/service.go index 80147df..bf8626e 100644 --- a/v2/reputation/grpc/service.go +++ b/v2/reputation/grpc/service.go @@ -59,3 +59,59 @@ func (x *SendLocalTrustResponse) SetVerifyHeader(v *session.ResponseVerification x.VerifyHeader = v } } + +// SetIteration sets sequence number of the iteration. +func (x *SendIntermediateResultRequest_Body) SetIteration(v uint32) { + if x != nil { + x.Iteration = v + } +} + +// SetTrust sets current global trust value. +func (x *SendIntermediateResultRequest_Body) SetTrust(v *Trust) { + if x != nil { + x.Trust = v + } +} + +// SetBody sets body of the request. +func (x *SendIntermediateResultRequest) SetBody(v *SendIntermediateResultRequest_Body) { + if x != nil { + x.Body = v + } +} + +// SetMetaHeader sets meta header of the request. +func (x *SendIntermediateResultRequest) SetMetaHeader(v *session.RequestMetaHeader) { + if x != nil { + x.MetaHeader = v + } +} + +// SetVerifyHeader sets verification header of the request. +func (x *SendIntermediateResultRequest) SetVerifyHeader(v *session.RequestVerificationHeader) { + if x != nil { + x.VerifyHeader = v + } +} + +// SetBody sets body of the response. +func (x *SendIntermediateResultResponse) SetBody(v *SendIntermediateResultResponse_Body) { + if x != nil { + x.Body = v + } +} + +// SetMetaHeader sets meta header of the response. +func (x *SendIntermediateResultResponse) SetMetaHeader(v *session.ResponseMetaHeader) { + if x != nil { + x.MetaHeader = v + } +} + +// SetVerifyHeader sets verification header of the response. +func (x *SendIntermediateResultResponse) SetVerifyHeader(v *session.ResponseVerificationHeader) { + if x != nil { + x.VerifyHeader = v + } +} diff --git a/v2/reputation/grpc/types.go b/v2/reputation/grpc/types.go index 84facde..0a469bd 100644 --- a/v2/reputation/grpc/types.go +++ b/v2/reputation/grpc/types.go @@ -1,7 +1,18 @@ package reputation +import ( + refs "github.com/nspcc-dev/neofs-api-go/v2/refs/grpc" +) + +// SetValue sets binary ID. +func (x *PeerID) SetValue(v []byte) { + if x != nil { + x.Value = v + } +} + // SetPeer sets trusted peer's ID. -func (x *Trust) SetPeer(v []byte) { +func (x *Trust) SetPeer(v *PeerID) { if x != nil { x.Peer = v } @@ -13,3 +24,38 @@ func (x *Trust) SetValue(v float64) { x.Value = v } } + +// SetManager sets manager ID. +func (x *GlobalTrust_Body) SetManager(v *PeerID) { + if x != nil { + x.Manager = v + } +} + +// SetTrust sets global trust value. +func (x *GlobalTrust_Body) SetTrust(v *Trust) { + if x != nil { + x.Trust = v + } +} + +// SetVersion sets message format version. +func (x *GlobalTrust) SetVersion(v *refs.Version) { + if x != nil { + x.Version = v + } +} + +// SetBody sets message body. +func (x *GlobalTrust) SetBody(v *GlobalTrust_Body) { + if x != nil { + x.Body = v + } +} + +// SetSignature sets body signature. +func (x *GlobalTrust) SetSignature(v *refs.Signature) { + if x != nil { + x.Signature = v + } +}