func (x *GlobalTrust) MarshalJSON() ([]byte, error) {
	return (*reputation.GlobalTrust)(x).
		MarshalJSON()
}
MarshalJSON encodes GlobalTrust to protobuf JSON format.
package reputation
import (
	"crypto/ecdsa"
	"github.com/nspcc-dev/neofs-api-go/pkg"
	"github.com/nspcc-dev/neofs-api-go/util/signature"
	"github.com/nspcc-dev/neofs-api-go/v2/refs"
	"github.com/nspcc-dev/neofs-api-go/v2/reputation"
	signatureV2 "github.com/nspcc-dev/neofs-api-go/v2/signature"
)
type Trust reputation.Trust
func NewTrust() *Trust {
	return TrustFromV2(new(reputation.Trust))
}
func TrustFromV2(t *reputation.Trust) *Trust {
	return (*Trust)(t)
}
func (x *Trust) ToV2() *reputation.Trust {
	return (*reputation.Trust)(x)
}
func TrustsToV2(xs []*Trust) (res []*reputation.Trust) {
	if xs != nil {
		res = make([]*reputation.Trust, 0, len(xs))
		for i := range xs {
			res = append(res, xs[i].ToV2())
		}
	}
	return
}
func (x *Trust) SetPeer(id *PeerID) {
	(*reputation.Trust)(x).
		SetPeer(id.ToV2())
}
func (x *Trust) Peer() *PeerID {
	return PeerIDFromV2(
		(*reputation.Trust)(x).GetPeer(),
	)
}
func (x *Trust) SetValue(val float64) {
	(*reputation.Trust)(x).
		SetValue(val)
}
func (x *Trust) Value() float64 {
	return (*reputation.Trust)(x).
		GetValue()
}
func (x *Trust) Marshal(b ...[]byte) ([]byte, error) {
	var buf []byte
	if len(b) > 0 {
		buf = b[0]
	}
	return (*reputation.Trust)(x).StableMarshal(buf)
}
func (x *Trust) Unmarshal(data []byte) error {
	return (*reputation.Trust)(x).
		Unmarshal(data)
}
func (x *Trust) MarshalJSON() ([]byte, error) {
	return (*reputation.Trust)(x).
		MarshalJSON()
}
func (x *Trust) UnmarshalJSON(data []byte) error {
	return (*reputation.Trust)(x).
		UnmarshalJSON(data)
}
type PeerToPeerTrust reputation.PeerToPeerTrust
func NewPeerToPeerTrust() *PeerToPeerTrust {
	return PeerToPeerTrustFromV2(new(reputation.PeerToPeerTrust))
}
func PeerToPeerTrustFromV2(t *reputation.PeerToPeerTrust) *PeerToPeerTrust {
	return (*PeerToPeerTrust)(t)
}
func (x *PeerToPeerTrust) ToV2() *reputation.PeerToPeerTrust {
	return (*reputation.PeerToPeerTrust)(x)
}
func (x *PeerToPeerTrust) SetTrustingPeer(id *PeerID) {
	(*reputation.PeerToPeerTrust)(x).
		SetTrustingPeer(id.ToV2())
}
func (x *PeerToPeerTrust) TrustingPeer() *PeerID {
	return PeerIDFromV2(
		(*reputation.PeerToPeerTrust)(x).
			GetTrustingPeer(),
	)
}
func (x *PeerToPeerTrust) SetTrust(t *Trust) {
	(*reputation.PeerToPeerTrust)(x).
		SetTrust(t.ToV2())
}
func (x *PeerToPeerTrust) Trust() *Trust {
	return TrustFromV2(
		(*reputation.PeerToPeerTrust)(x).
			GetTrust(),
	)
}
func (x *PeerToPeerTrust) Marshal(b ...[]byte) ([]byte, error) {
	var buf []byte
	if len(b) > 0 {
		buf = b[0]
	}
	return (*reputation.PeerToPeerTrust)(x).StableMarshal(buf)
}
func (x *PeerToPeerTrust) Unmarshal(data []byte) error {
	return (*reputation.PeerToPeerTrust)(x).
		Unmarshal(data)
}
func (x *PeerToPeerTrust) MarshalJSON() ([]byte, error) {
	return (*reputation.PeerToPeerTrust)(x).
		MarshalJSON()
}
func (x *PeerToPeerTrust) UnmarshalJSON(data []byte) error {
	return (*reputation.PeerToPeerTrust)(x).
		UnmarshalJSON(data)
}
type GlobalTrust reputation.GlobalTrust
func NewGlobalTrust() *GlobalTrust {
	gt := GlobalTrustFromV2(new(reputation.GlobalTrust))
	gt.SetVersion(pkg.SDKVersion())
	return gt
}
func GlobalTrustFromV2(t *reputation.GlobalTrust) *GlobalTrust {
	return (*GlobalTrust)(t)
}
func (x *GlobalTrust) ToV2() *reputation.GlobalTrust {
	return (*reputation.GlobalTrust)(x)
}
func (x *GlobalTrust) SetVersion(version *pkg.Version) {
	(*reputation.GlobalTrust)(x).
		SetVersion(version.ToV2())
}
func (x *GlobalTrust) Version() *pkg.Version {
	return pkg.NewVersionFromV2(
		(*reputation.GlobalTrust)(x).
			GetVersion(),
	)
}
func (x *GlobalTrust) setBodyField(setter func(*reputation.GlobalTrustBody)) {
	if x != nil {
		v2 := (*reputation.GlobalTrust)(x)
		body := v2.GetBody()
		if body == nil {
			body = new(reputation.GlobalTrustBody)
			v2.SetBody(body)
		}
		setter(body)
	}
}
func (x *GlobalTrust) SetManager(id *PeerID) {
	x.setBodyField(func(body *reputation.GlobalTrustBody) {
		body.SetManager(id.ToV2())
	})
}
func (x *GlobalTrust) Manager() *PeerID {
	return PeerIDFromV2(
		(*reputation.GlobalTrust)(x).
			GetBody().
			GetManager(),
	)
}
func (x *GlobalTrust) SetTrust(trust *Trust) {
	x.setBodyField(func(body *reputation.GlobalTrustBody) {
		body.SetTrust(trust.ToV2())
	})
}
func (x *GlobalTrust) Trust() *Trust {
	return TrustFromV2(
		(*reputation.GlobalTrust)(x).
			GetBody().
			GetTrust(),
	)
}
func (x *GlobalTrust) Sign(key *ecdsa.PrivateKey) error {
	v2 := (*reputation.GlobalTrust)(x)
	sigV2 := v2.GetSignature()
	if sigV2 == nil {
		sigV2 = new(refs.Signature)
		v2.SetSignature(sigV2)
	}
	return signature.SignDataWithHandler(
		key,
		signatureV2.StableMarshalerWrapper{SM: v2.GetBody()},
		func(key, sig []byte) {
			sigV2.SetKey(key)
			sigV2.SetSign(sig)
		},
	)
}
func (x *GlobalTrust) VerifySignature() error {
	v2 := (*reputation.GlobalTrust)(x)
	sigV2 := v2.GetSignature()
	if sigV2 == nil {
		sigV2 = new(refs.Signature)
	}
	return signature.VerifyDataWithSource(
		signatureV2.StableMarshalerWrapper{SM: v2.GetBody()},
		func() ([]byte, []byte) {
			return sigV2.GetKey(), sigV2.GetSign()
		},
	)
}
func (x *GlobalTrust) Marshal(b ...[]byte) ([]byte, error) {
	var buf []byte
	if len(b) > 0 {
		buf = b[0]
	}
	return (*reputation.GlobalTrust)(x).StableMarshal(buf)
}
func (x *GlobalTrust) Unmarshal(data []byte) error {
	return (*reputation.GlobalTrust)(x).
		Unmarshal(data)
}