func (x *AnnounceLocalTrustResponseBody) ToGRPCMessage() grpc.Message {
	var m *reputation.AnnounceLocalTrustResponse_Body
	if x != nil {
		m = new(reputation.AnnounceLocalTrustResponse_Body)
	}
	return m
}
ToGRPCMessage converts AnnounceLocalTrustResponseBody to gRPC-generated
reputation.AnnounceLocalTrustResponse_Body message.
package reputation
import (
	"github.com/nspcc-dev/neofs-api-go/rpc/grpc"
	"github.com/nspcc-dev/neofs-api-go/rpc/message"
	"github.com/nspcc-dev/neofs-api-go/v2/refs"
	refsGRPC "github.com/nspcc-dev/neofs-api-go/v2/refs/grpc"
	reputation "github.com/nspcc-dev/neofs-api-go/v2/reputation/grpc"
)
func (x *PeerID) ToGRPCMessage() grpc.Message {
	var m *reputation.PeerID
	if x != nil {
		m = new(reputation.PeerID)
		m.SetPublicKey(x.publicKey)
	}
	return m
}
func (x *PeerID) FromGRPCMessage(m grpc.Message) error {
	v, ok := m.(*reputation.PeerID)
	if !ok {
		return message.NewUnexpectedMessageType(m, v)
	}
	x.publicKey = v.GetPublicKey()
	return nil
}
func (x *Trust) ToGRPCMessage() grpc.Message {
	var m *reputation.Trust
	if x != nil {
		m = new(reputation.Trust)
		m.SetValue(x.val)
		m.SetPeer(x.peer.ToGRPCMessage().(*reputation.PeerID))
	}
	return m
}
func (x *Trust) FromGRPCMessage(m grpc.Message) error {
	v, ok := m.(*reputation.Trust)
	if !ok {
		return message.NewUnexpectedMessageType(m, v)
	}
	peer := v.GetPeer()
	if peer == nil {
		x.peer = nil
	} else {
		if x.peer == nil {
			x.peer = new(PeerID)
		}
		err := x.peer.FromGRPCMessage(peer)
		if err != nil {
			return err
		}
	}
	x.val = v.GetValue()
	return nil
}
func (x *PeerToPeerTrust) ToGRPCMessage() grpc.Message {
	var m *reputation.PeerToPeerTrust
	if x != nil {
		m = new(reputation.PeerToPeerTrust)
		m.SetTrustingPeer(x.trusting.ToGRPCMessage().(*reputation.PeerID))
		m.SetTrust(x.trust.ToGRPCMessage().(*reputation.Trust))
	}
	return m
}
func (x *PeerToPeerTrust) FromGRPCMessage(m grpc.Message) error {
	v, ok := m.(*reputation.PeerToPeerTrust)
	if !ok {
		return message.NewUnexpectedMessageType(m, v)
	}
	var err error
	trusting := v.GetTrustingPeer()
	if trusting == nil {
		x.trusting = nil
	} else {
		if x.trusting == nil {
			x.trusting = new(PeerID)
		}
		err = x.trusting.FromGRPCMessage(trusting)
		if err != nil {
			return err
		}
	}
	trust := v.GetTrust()
	if trust == nil {
		x.trust = nil
	} else {
		if x.trust == nil {
			x.trust = new(Trust)
		}
		err = x.trust.FromGRPCMessage(trust)
	}
	return err
}
func TrustsToGRPC(xs []*Trust) (res []*reputation.Trust) {
	if xs != nil {
		res = make([]*reputation.Trust, 0, len(xs))
		for i := range xs {
			res = append(res, xs[i].ToGRPCMessage().(*reputation.Trust))
		}
	}
	return
}
func TrustsFromGRPC(xs []*reputation.Trust) (res []*Trust, err error) {
	if xs != nil {
		res = make([]*Trust, 0, len(xs))
		for i := range xs {
			var x *Trust
			if xs[i] != nil {
				x = new(Trust)
				err = x.FromGRPCMessage(xs[i])
				if err != nil {
					return
				}
			}
			res = append(res, x)
		}
	}
	return
}
func (x *GlobalTrustBody) ToGRPCMessage() grpc.Message {
	var m *reputation.GlobalTrust_Body
	if x != nil {
		m = new(reputation.GlobalTrust_Body)
		m.SetManager(x.manager.ToGRPCMessage().(*reputation.PeerID))
		m.SetTrust(x.trust.ToGRPCMessage().(*reputation.Trust))
	}
	return m
}
func (x *GlobalTrustBody) FromGRPCMessage(m grpc.Message) error {
	v, ok := m.(*reputation.GlobalTrust_Body)
	if !ok {
		return message.NewUnexpectedMessageType(m, v)
	}
	var err error
	manager := v.GetManager()
	if manager == nil {
		x.manager = nil
	} else {
		if x.manager == nil {
			x.manager = new(PeerID)
		}
		err = x.manager.FromGRPCMessage(manager)
		if err != nil {
			return err
		}
	}
	trust := v.GetTrust()
	if trust == nil {
		x.trust = nil
	} else {
		if x.trust == nil {
			x.trust = new(Trust)
		}
		err = x.trust.FromGRPCMessage(trust)
	}
	return err
}
func (x *GlobalTrust) ToGRPCMessage() grpc.Message {
	var m *reputation.GlobalTrust
	if x != nil {
		m = new(reputation.GlobalTrust)
		m.SetVersion(x.version.ToGRPCMessage().(*refsGRPC.Version))
		m.SetBody(x.body.ToGRPCMessage().(*reputation.GlobalTrust_Body))
		m.SetSignature(x.sig.ToGRPCMessage().(*refsGRPC.Signature))
	}
	return m
}
func (x *GlobalTrust) FromGRPCMessage(m grpc.Message) error {
	v, ok := m.(*reputation.GlobalTrust)
	if !ok {
		return message.NewUnexpectedMessageType(m, v)
	}
	var err error
	version := v.GetVersion()
	if version == nil {
		x.version = nil
	} else {
		if x.version == nil {
			x.version = new(refs.Version)
		}
		err = x.version.FromGRPCMessage(version)
		if err != nil {
			return err
		}
	}
	body := v.GetBody()
	if body == nil {
		x.body = nil
	} else {
		if x.body == nil {
			x.body = new(GlobalTrustBody)
		}
		err = x.body.FromGRPCMessage(body)
		if err != nil {
			return err
		}
	}
	sig := v.GetSignature()
	if sig == nil {
		x.sig = nil
	} else {
		if x.sig == nil {
			x.sig = new(refs.Signature)
		}
		err = x.sig.FromGRPCMessage(sig)
	}
	return err
}
func (x *AnnounceLocalTrustRequestBody) ToGRPCMessage() grpc.Message {
	var m *reputation.AnnounceLocalTrustRequest_Body
	if x != nil {
		m = new(reputation.AnnounceLocalTrustRequest_Body)
		m.SetEpoch(x.epoch)
		m.SetTrusts(TrustsToGRPC(x.trusts))
	}
	return m
}
func (x *AnnounceLocalTrustRequestBody) FromGRPCMessage(m grpc.Message) error {
	v, ok := m.(*reputation.AnnounceLocalTrustRequest_Body)
	if !ok {
		return message.NewUnexpectedMessageType(m, v)
	}
	var err error
	x.trusts, err = TrustsFromGRPC(v.GetTrusts())
	if err != nil {
		return err
	}
	x.epoch = v.GetEpoch()
	return nil
}
func (x *AnnounceLocalTrustRequest) ToGRPCMessage() grpc.Message {
	var m *reputation.AnnounceLocalTrustRequest
	if x != nil {
		m = new(reputation.AnnounceLocalTrustRequest)
		m.SetBody(x.body.ToGRPCMessage().(*reputation.AnnounceLocalTrustRequest_Body))
		x.RequestHeaders.ToMessage(m)
	}
	return m
}
func (x *AnnounceLocalTrustRequest) FromGRPCMessage(m grpc.Message) error {
	v, ok := m.(*reputation.AnnounceLocalTrustRequest)
	if !ok {
		return message.NewUnexpectedMessageType(m, v)
	}
	var err error
	body := v.GetBody()
	if body == nil {
		x.body = nil
	} else {
		if x.body == nil {
			x.body = new(AnnounceLocalTrustRequestBody)
		}
		err = x.body.FromGRPCMessage(body)
		if err != nil {
			return err
		}
	}
	return x.RequestHeaders.FromMessage(v)
}