// Code generated by protoc-gen-go-lite. DO NOT EDIT.
// protoc-gen-go-lite version: v0.11.0
// source: github.com/aperturerobotics/bifrost/pubsub/api/api.proto

package pubsub_api

import (
	base64 "encoding/base64"
	fmt "fmt"
	io "io"
	slices "slices"
	strconv "strconv"
	strings "strings"

	protobuf_go_lite "github.com/aperturerobotics/protobuf-go-lite"
	json "github.com/aperturerobotics/protobuf-go-lite/json"
)

// SubcribeRequest is a pubsub subscription request message.
type SubscribeRequest struct {
	unknownFields []byte
	// ChannelId is the channel id to subscribe to.
	// Must be sent before / with publish.
	// Cannot change the channel ID after first transmission.
	ChannelId string `protobuf:"bytes,1,opt,name=channel_id,json=channelId,proto3" json:"channelId,omitempty"`
	// PeerId is the peer identifier of the publisher/subscriber.
	// The peer ID will be used to acquire the peer private key.
	PeerId string `protobuf:"bytes,2,opt,name=peer_id,json=peerId,proto3" json:"peerId,omitempty"`
	// PrivKeyPem is an alternate to PeerId, specify private key inline.
	// Overrides PeerId if set.
	PrivKeyPem string `protobuf:"bytes,3,opt,name=priv_key_pem,json=privKeyPem,proto3" json:"privKeyPem,omitempty"`
	// PublishRequest contains a publish message request.
	PublishRequest *PublishRequest `protobuf:"bytes,4,opt,name=publish_request,json=publishRequest,proto3" json:"publishRequest,omitempty"`
}

func (x *SubscribeRequest) Reset() {
	*x = SubscribeRequest{}
}

func (*SubscribeRequest) ProtoMessage() {}

func (x *SubscribeRequest) GetChannelId() string {
	if x != nil {
		return x.ChannelId
	}
	return ""
}

func (x *SubscribeRequest) GetPeerId() string {
	if x != nil {
		return x.PeerId
	}
	return ""
}

func (x *SubscribeRequest) GetPrivKeyPem() string {
	if x != nil {
		return x.PrivKeyPem
	}
	return ""
}

func (x *SubscribeRequest) GetPublishRequest() *PublishRequest {
	if x != nil {
		return x.PublishRequest
	}
	return nil
}

// PublishRequest is a message published via the subscribe channel.
type PublishRequest struct {
	unknownFields []byte
	// Data is the published data.
	Data []byte `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"`
	// Identifier is a uint32 identifier to use for outgoing status.
	// If zero, no outgoing status response will be sent.
	Identifier uint32 `protobuf:"varint,2,opt,name=identifier,proto3" json:"identifier,omitempty"`
}

func (x *PublishRequest) Reset() {
	*x = PublishRequest{}
}

func (*PublishRequest) ProtoMessage() {}

func (x *PublishRequest) GetData() []byte {
	if x != nil {
		return x.Data
	}
	return nil
}

func (x *PublishRequest) GetIdentifier() uint32 {
	if x != nil {
		return x.Identifier
	}
	return 0
}

// SubcribeResponse is a pubsub subscription response message.
type SubscribeResponse struct {
	unknownFields []byte
	// IncomingMessage is an incoming message.
	IncomingMessage *IncomingMessage `protobuf:"bytes,1,opt,name=incoming_message,json=incomingMessage,proto3" json:"incomingMessage,omitempty"`
	// OutgoingStatus is status of an outgoing message.
	// Sent when a Publish request finishes.
	OutgoingStatus *OutgoingStatus `protobuf:"bytes,2,opt,name=outgoing_status,json=outgoingStatus,proto3" json:"outgoingStatus,omitempty"`
	// SubscriptionStatus is the status of the subscription
	SubscriptionStatus *SubscriptionStatus `protobuf:"bytes,3,opt,name=subscription_status,json=subscriptionStatus,proto3" json:"subscriptionStatus,omitempty"`
}

func (x *SubscribeResponse) Reset() {
	*x = SubscribeResponse{}
}

func (*SubscribeResponse) ProtoMessage() {}

func (x *SubscribeResponse) GetIncomingMessage() *IncomingMessage {
	if x != nil {
		return x.IncomingMessage
	}
	return nil
}

func (x *SubscribeResponse) GetOutgoingStatus() *OutgoingStatus {
	if x != nil {
		return x.OutgoingStatus
	}
	return nil
}

func (x *SubscribeResponse) GetSubscriptionStatus() *SubscriptionStatus {
	if x != nil {
		return x.SubscriptionStatus
	}
	return nil
}

// SubscripionStatus is the status of the subscription handle.
type SubscriptionStatus struct {
	unknownFields []byte
	// Subscribed indicates the subscription is established.
	Subscribed bool `protobuf:"varint,1,opt,name=subscribed,proto3" json:"subscribed,omitempty"`
}

func (x *SubscriptionStatus) Reset() {
	*x = SubscriptionStatus{}
}

func (*SubscriptionStatus) ProtoMessage() {}

func (x *SubscriptionStatus) GetSubscribed() bool {
	if x != nil {
		return x.Subscribed
	}
	return false
}

// OutgoingStatus is status of an outgoing message.
type OutgoingStatus struct {
	unknownFields []byte
	// Identifier is the request-provided identifier for the message.
	Identifier uint32 `protobuf:"varint,1,opt,name=identifier,proto3" json:"identifier,omitempty"`
	// Sent indicates if the message was sent.
	Sent bool `protobuf:"varint,2,opt,name=sent,proto3" json:"sent,omitempty"`
}

func (x *OutgoingStatus) Reset() {
	*x = OutgoingStatus{}
}

func (*OutgoingStatus) ProtoMessage() {}

func (x *OutgoingStatus) GetIdentifier() uint32 {
	if x != nil {
		return x.Identifier
	}
	return 0
}

func (x *OutgoingStatus) GetSent() bool {
	if x != nil {
		return x.Sent
	}
	return false
}

// IncomingMessage implements Message with a proto object.
type IncomingMessage struct {
	unknownFields []byte
	// FromPeerId is the peer identifier of the sender.
	FromPeerId string `protobuf:"bytes,1,opt,name=from_peer_id,json=fromPeerId,proto3" json:"fromPeerId,omitempty"`
	// Authenticated indicates if the message is verified to be from the sender.
	Authenticated bool `protobuf:"varint,2,opt,name=authenticated,proto3" json:"authenticated,omitempty"`
	// Data is the inner data.
	Data []byte `protobuf:"bytes,3,opt,name=data,proto3" json:"data,omitempty"`
}

func (x *IncomingMessage) Reset() {
	*x = IncomingMessage{}
}

func (*IncomingMessage) ProtoMessage() {}

func (x *IncomingMessage) GetFromPeerId() string {
	if x != nil {
		return x.FromPeerId
	}
	return ""
}

func (x *IncomingMessage) GetAuthenticated() bool {
	if x != nil {
		return x.Authenticated
	}
	return false
}

func (x *IncomingMessage) GetData() []byte {
	if x != nil {
		return x.Data
	}
	return nil
}

func (m *SubscribeRequest) CloneVT() *SubscribeRequest {
	if m == nil {
		return (*SubscribeRequest)(nil)
	}
	r := new(SubscribeRequest)
	r.ChannelId = m.ChannelId
	r.PeerId = m.PeerId
	r.PrivKeyPem = m.PrivKeyPem
	r.PublishRequest = m.PublishRequest.CloneVT()
	if len(m.unknownFields) > 0 {
		r.unknownFields = slices.Clone(m.unknownFields)
	}
	return r
}

func (m *SubscribeRequest) CloneMessageVT() protobuf_go_lite.CloneMessage {
	return m.CloneVT()
}

func (m *PublishRequest) CloneVT() *PublishRequest {
	if m == nil {
		return (*PublishRequest)(nil)
	}
	r := new(PublishRequest)
	r.Identifier = m.Identifier
	if rhs := m.Data; rhs != nil {
		r.Data = slices.Clone(rhs)
	}
	if len(m.unknownFields) > 0 {
		r.unknownFields = slices.Clone(m.unknownFields)
	}
	return r
}

func (m *PublishRequest) CloneMessageVT() protobuf_go_lite.CloneMessage {
	return m.CloneVT()
}

func (m *SubscribeResponse) CloneVT() *SubscribeResponse {
	if m == nil {
		return (*SubscribeResponse)(nil)
	}
	r := new(SubscribeResponse)
	r.IncomingMessage = m.IncomingMessage.CloneVT()
	r.OutgoingStatus = m.OutgoingStatus.CloneVT()
	r.SubscriptionStatus = m.SubscriptionStatus.CloneVT()
	if len(m.unknownFields) > 0 {
		r.unknownFields = slices.Clone(m.unknownFields)
	}
	return r
}

func (m *SubscribeResponse) CloneMessageVT() protobuf_go_lite.CloneMessage {
	return m.CloneVT()
}

func (m *SubscriptionStatus) CloneVT() *SubscriptionStatus {
	if m == nil {
		return (*SubscriptionStatus)(nil)
	}
	r := new(SubscriptionStatus)
	r.Subscribed = m.Subscribed
	if len(m.unknownFields) > 0 {
		r.unknownFields = slices.Clone(m.unknownFields)
	}
	return r
}

func (m *SubscriptionStatus) CloneMessageVT() protobuf_go_lite.CloneMessage {
	return m.CloneVT()
}

func (m *OutgoingStatus) CloneVT() *OutgoingStatus {
	if m == nil {
		return (*OutgoingStatus)(nil)
	}
	r := new(OutgoingStatus)
	r.Identifier = m.Identifier
	r.Sent = m.Sent
	if len(m.unknownFields) > 0 {
		r.unknownFields = slices.Clone(m.unknownFields)
	}
	return r
}

func (m *OutgoingStatus) CloneMessageVT() protobuf_go_lite.CloneMessage {
	return m.CloneVT()
}

func (m *IncomingMessage) CloneVT() *IncomingMessage {
	if m == nil {
		return (*IncomingMessage)(nil)
	}
	r := new(IncomingMessage)
	r.FromPeerId = m.FromPeerId
	r.Authenticated = m.Authenticated
	if rhs := m.Data; rhs != nil {
		r.Data = slices.Clone(rhs)
	}
	if len(m.unknownFields) > 0 {
		r.unknownFields = slices.Clone(m.unknownFields)
	}
	return r
}

func (m *IncomingMessage) CloneMessageVT() protobuf_go_lite.CloneMessage {
	return m.CloneVT()
}

func (this *SubscribeRequest) EqualVT(that *SubscribeRequest) bool {
	if this == that {
		return true
	} else if this == nil || that == nil {
		return false
	}
	if this.ChannelId != that.ChannelId {
		return false
	}
	if this.PeerId != that.PeerId {
		return false
	}
	if this.PrivKeyPem != that.PrivKeyPem {
		return false
	}
	if !this.PublishRequest.EqualVT(that.PublishRequest) {
		return false
	}
	return string(this.unknownFields) == string(that.unknownFields)
}

func (this *SubscribeRequest) EqualMessageVT(thatMsg any) bool {
	that, ok := thatMsg.(*SubscribeRequest)
	if !ok {
		return false
	}
	return this.EqualVT(that)
}
func (this *PublishRequest) EqualVT(that *PublishRequest) bool {
	if this == that {
		return true
	} else if this == nil || that == nil {
		return false
	}
	if string(this.Data) != string(that.Data) {
		return false
	}
	if this.Identifier != that.Identifier {
		return false
	}
	return string(this.unknownFields) == string(that.unknownFields)
}

func (this *PublishRequest) EqualMessageVT(thatMsg any) bool {
	that, ok := thatMsg.(*PublishRequest)
	if !ok {
		return false
	}
	return this.EqualVT(that)
}
func (this *SubscribeResponse) EqualVT(that *SubscribeResponse) bool {
	if this == that {
		return true
	} else if this == nil || that == nil {
		return false
	}
	if !this.IncomingMessage.EqualVT(that.IncomingMessage) {
		return false
	}
	if !this.OutgoingStatus.EqualVT(that.OutgoingStatus) {
		return false
	}
	if !this.SubscriptionStatus.EqualVT(that.SubscriptionStatus) {
		return false
	}
	return string(this.unknownFields) == string(that.unknownFields)
}

func (this *SubscribeResponse) EqualMessageVT(thatMsg any) bool {
	that, ok := thatMsg.(*SubscribeResponse)
	if !ok {
		return false
	}
	return this.EqualVT(that)
}
func (this *SubscriptionStatus) EqualVT(that *SubscriptionStatus) bool {
	if this == that {
		return true
	} else if this == nil || that == nil {
		return false
	}
	if this.Subscribed != that.Subscribed {
		return false
	}
	return string(this.unknownFields) == string(that.unknownFields)
}

func (this *SubscriptionStatus) EqualMessageVT(thatMsg any) bool {
	that, ok := thatMsg.(*SubscriptionStatus)
	if !ok {
		return false
	}
	return this.EqualVT(that)
}
func (this *OutgoingStatus) EqualVT(that *OutgoingStatus) bool {
	if this == that {
		return true
	} else if this == nil || that == nil {
		return false
	}
	if this.Identifier != that.Identifier {
		return false
	}
	if this.Sent != that.Sent {
		return false
	}
	return string(this.unknownFields) == string(that.unknownFields)
}

func (this *OutgoingStatus) EqualMessageVT(thatMsg any) bool {
	that, ok := thatMsg.(*OutgoingStatus)
	if !ok {
		return false
	}
	return this.EqualVT(that)
}
func (this *IncomingMessage) EqualVT(that *IncomingMessage) bool {
	if this == that {
		return true
	} else if this == nil || that == nil {
		return false
	}
	if this.FromPeerId != that.FromPeerId {
		return false
	}
	if this.Authenticated != that.Authenticated {
		return false
	}
	if string(this.Data) != string(that.Data) {
		return false
	}
	return string(this.unknownFields) == string(that.unknownFields)
}

func (this *IncomingMessage) EqualMessageVT(thatMsg any) bool {
	that, ok := thatMsg.(*IncomingMessage)
	if !ok {
		return false
	}
	return this.EqualVT(that)
}

// MarshalProtoJSON marshals the SubscribeRequest message to JSON.
func (x *SubscribeRequest) MarshalProtoJSON(s *json.MarshalState) {
	if x == nil {
		s.WriteNil()
		return
	}
	s.WriteObjectStart()
	var wroteField bool
	if x.ChannelId != "" || s.HasField("channelId") {
		s.WriteMoreIf(&wroteField)
		s.WriteObjectField("channelId")
		s.WriteString(x.ChannelId)
	}
	if x.PeerId != "" || s.HasField("peerId") {
		s.WriteMoreIf(&wroteField)
		s.WriteObjectField("peerId")
		s.WriteString(x.PeerId)
	}
	if x.PrivKeyPem != "" || s.HasField("privKeyPem") {
		s.WriteMoreIf(&wroteField)
		s.WriteObjectField("privKeyPem")
		s.WriteString(x.PrivKeyPem)
	}
	if x.PublishRequest != nil || s.HasField("publishRequest") {
		s.WriteMoreIf(&wroteField)
		s.WriteObjectField("publishRequest")
		x.PublishRequest.MarshalProtoJSON(s.WithField("publishRequest"))
	}
	s.WriteObjectEnd()
}

// MarshalJSON marshals the SubscribeRequest to JSON.
func (x *SubscribeRequest) MarshalJSON() ([]byte, error) {
	return json.DefaultMarshalerConfig.Marshal(x)
}

// UnmarshalProtoJSON unmarshals the SubscribeRequest message from JSON.
func (x *SubscribeRequest) UnmarshalProtoJSON(s *json.UnmarshalState) {
	if s.ReadNil() {
		return
	}
	s.ReadObject(func(key string) {
		switch key {
		default:
			s.Skip() // ignore unknown field
		case "channel_id", "channelId":
			s.AddField("channel_id")
			x.ChannelId = s.ReadString()
		case "peer_id", "peerId":
			s.AddField("peer_id")
			x.PeerId = s.ReadString()
		case "priv_key_pem", "privKeyPem":
			s.AddField("priv_key_pem")
			x.PrivKeyPem = s.ReadString()
		case "publish_request", "publishRequest":
			if s.ReadNil() {
				x.PublishRequest = nil
				return
			}
			x.PublishRequest = &PublishRequest{}
			x.PublishRequest.UnmarshalProtoJSON(s.WithField("publish_request", true))
		}
	})
}

// UnmarshalJSON unmarshals the SubscribeRequest from JSON.
func (x *SubscribeRequest) UnmarshalJSON(b []byte) error {
	return json.DefaultUnmarshalerConfig.Unmarshal(b, x)
}

// MarshalProtoJSON marshals the PublishRequest message to JSON.
func (x *PublishRequest) MarshalProtoJSON(s *json.MarshalState) {
	if x == nil {
		s.WriteNil()
		return
	}
	s.WriteObjectStart()
	var wroteField bool
	if len(x.Data) > 0 || s.HasField("data") {
		s.WriteMoreIf(&wroteField)
		s.WriteObjectField("data")
		s.WriteBytes(x.Data)
	}
	if x.Identifier != 0 || s.HasField("identifier") {
		s.WriteMoreIf(&wroteField)
		s.WriteObjectField("identifier")
		s.WriteUint32(x.Identifier)
	}
	s.WriteObjectEnd()
}

// MarshalJSON marshals the PublishRequest to JSON.
func (x *PublishRequest) MarshalJSON() ([]byte, error) {
	return json.DefaultMarshalerConfig.Marshal(x)
}

// UnmarshalProtoJSON unmarshals the PublishRequest message from JSON.
func (x *PublishRequest) UnmarshalProtoJSON(s *json.UnmarshalState) {
	if s.ReadNil() {
		return
	}
	s.ReadObject(func(key string) {
		switch key {
		default:
			s.Skip() // ignore unknown field
		case "data":
			s.AddField("data")
			x.Data = s.ReadBytes()
		case "identifier":
			s.AddField("identifier")
			x.Identifier = s.ReadUint32()
		}
	})
}

// UnmarshalJSON unmarshals the PublishRequest from JSON.
func (x *PublishRequest) UnmarshalJSON(b []byte) error {
	return json.DefaultUnmarshalerConfig.Unmarshal(b, x)
}

// MarshalProtoJSON marshals the SubscribeResponse message to JSON.
func (x *SubscribeResponse) MarshalProtoJSON(s *json.MarshalState) {
	if x == nil {
		s.WriteNil()
		return
	}
	s.WriteObjectStart()
	var wroteField bool
	if x.IncomingMessage != nil || s.HasField("incomingMessage") {
		s.WriteMoreIf(&wroteField)
		s.WriteObjectField("incomingMessage")
		x.IncomingMessage.MarshalProtoJSON(s.WithField("incomingMessage"))
	}
	if x.OutgoingStatus != nil || s.HasField("outgoingStatus") {
		s.WriteMoreIf(&wroteField)
		s.WriteObjectField("outgoingStatus")
		x.OutgoingStatus.MarshalProtoJSON(s.WithField("outgoingStatus"))
	}
	if x.SubscriptionStatus != nil || s.HasField("subscriptionStatus") {
		s.WriteMoreIf(&wroteField)
		s.WriteObjectField("subscriptionStatus")
		x.SubscriptionStatus.MarshalProtoJSON(s.WithField("subscriptionStatus"))
	}
	s.WriteObjectEnd()
}

// MarshalJSON marshals the SubscribeResponse to JSON.
func (x *SubscribeResponse) MarshalJSON() ([]byte, error) {
	return json.DefaultMarshalerConfig.Marshal(x)
}

// UnmarshalProtoJSON unmarshals the SubscribeResponse message from JSON.
func (x *SubscribeResponse) UnmarshalProtoJSON(s *json.UnmarshalState) {
	if s.ReadNil() {
		return
	}
	s.ReadObject(func(key string) {
		switch key {
		default:
			s.Skip() // ignore unknown field
		case "incoming_message", "incomingMessage":
			if s.ReadNil() {
				x.IncomingMessage = nil
				return
			}
			x.IncomingMessage = &IncomingMessage{}
			x.IncomingMessage.UnmarshalProtoJSON(s.WithField("incoming_message", true))
		case "outgoing_status", "outgoingStatus":
			if s.ReadNil() {
				x.OutgoingStatus = nil
				return
			}
			x.OutgoingStatus = &OutgoingStatus{}
			x.OutgoingStatus.UnmarshalProtoJSON(s.WithField("outgoing_status", true))
		case "subscription_status", "subscriptionStatus":
			if s.ReadNil() {
				x.SubscriptionStatus = nil
				return
			}
			x.SubscriptionStatus = &SubscriptionStatus{}
			x.SubscriptionStatus.UnmarshalProtoJSON(s.WithField("subscription_status", true))
		}
	})
}

// UnmarshalJSON unmarshals the SubscribeResponse from JSON.
func (x *SubscribeResponse) UnmarshalJSON(b []byte) error {
	return json.DefaultUnmarshalerConfig.Unmarshal(b, x)
}

// MarshalProtoJSON marshals the SubscriptionStatus message to JSON.
func (x *SubscriptionStatus) MarshalProtoJSON(s *json.MarshalState) {
	if x == nil {
		s.WriteNil()
		return
	}
	s.WriteObjectStart()
	var wroteField bool
	if x.Subscribed || s.HasField("subscribed") {
		s.WriteMoreIf(&wroteField)
		s.WriteObjectField("subscribed")
		s.WriteBool(x.Subscribed)
	}
	s.WriteObjectEnd()
}

// MarshalJSON marshals the SubscriptionStatus to JSON.
func (x *SubscriptionStatus) MarshalJSON() ([]byte, error) {
	return json.DefaultMarshalerConfig.Marshal(x)
}

// UnmarshalProtoJSON unmarshals the SubscriptionStatus message from JSON.
func (x *SubscriptionStatus) UnmarshalProtoJSON(s *json.UnmarshalState) {
	if s.ReadNil() {
		return
	}
	s.ReadObject(func(key string) {
		switch key {
		default:
			s.Skip() // ignore unknown field
		case "subscribed":
			s.AddField("subscribed")
			x.Subscribed = s.ReadBool()
		}
	})
}

// UnmarshalJSON unmarshals the SubscriptionStatus from JSON.
func (x *SubscriptionStatus) UnmarshalJSON(b []byte) error {
	return json.DefaultUnmarshalerConfig.Unmarshal(b, x)
}

// MarshalProtoJSON marshals the OutgoingStatus message to JSON.
func (x *OutgoingStatus) MarshalProtoJSON(s *json.MarshalState) {
	if x == nil {
		s.WriteNil()
		return
	}
	s.WriteObjectStart()
	var wroteField bool
	if x.Identifier != 0 || s.HasField("identifier") {
		s.WriteMoreIf(&wroteField)
		s.WriteObjectField("identifier")
		s.WriteUint32(x.Identifier)
	}
	if x.Sent || s.HasField("sent") {
		s.WriteMoreIf(&wroteField)
		s.WriteObjectField("sent")
		s.WriteBool(x.Sent)
	}
	s.WriteObjectEnd()
}

// MarshalJSON marshals the OutgoingStatus to JSON.
func (x *OutgoingStatus) MarshalJSON() ([]byte, error) {
	return json.DefaultMarshalerConfig.Marshal(x)
}

// UnmarshalProtoJSON unmarshals the OutgoingStatus message from JSON.
func (x *OutgoingStatus) UnmarshalProtoJSON(s *json.UnmarshalState) {
	if s.ReadNil() {
		return
	}
	s.ReadObject(func(key string) {
		switch key {
		default:
			s.Skip() // ignore unknown field
		case "identifier":
			s.AddField("identifier")
			x.Identifier = s.ReadUint32()
		case "sent":
			s.AddField("sent")
			x.Sent = s.ReadBool()
		}
	})
}

// UnmarshalJSON unmarshals the OutgoingStatus from JSON.
func (x *OutgoingStatus) UnmarshalJSON(b []byte) error {
	return json.DefaultUnmarshalerConfig.Unmarshal(b, x)
}

// MarshalProtoJSON marshals the IncomingMessage message to JSON.
func (x *IncomingMessage) MarshalProtoJSON(s *json.MarshalState) {
	if x == nil {
		s.WriteNil()
		return
	}
	s.WriteObjectStart()
	var wroteField bool
	if x.FromPeerId != "" || s.HasField("fromPeerId") {
		s.WriteMoreIf(&wroteField)
		s.WriteObjectField("fromPeerId")
		s.WriteString(x.FromPeerId)
	}
	if x.Authenticated || s.HasField("authenticated") {
		s.WriteMoreIf(&wroteField)
		s.WriteObjectField("authenticated")
		s.WriteBool(x.Authenticated)
	}
	if len(x.Data) > 0 || s.HasField("data") {
		s.WriteMoreIf(&wroteField)
		s.WriteObjectField("data")
		s.WriteBytes(x.Data)
	}
	s.WriteObjectEnd()
}

// MarshalJSON marshals the IncomingMessage to JSON.
func (x *IncomingMessage) MarshalJSON() ([]byte, error) {
	return json.DefaultMarshalerConfig.Marshal(x)
}

// UnmarshalProtoJSON unmarshals the IncomingMessage message from JSON.
func (x *IncomingMessage) UnmarshalProtoJSON(s *json.UnmarshalState) {
	if s.ReadNil() {
		return
	}
	s.ReadObject(func(key string) {
		switch key {
		default:
			s.Skip() // ignore unknown field
		case "from_peer_id", "fromPeerId":
			s.AddField("from_peer_id")
			x.FromPeerId = s.ReadString()
		case "authenticated":
			s.AddField("authenticated")
			x.Authenticated = s.ReadBool()
		case "data":
			s.AddField("data")
			x.Data = s.ReadBytes()
		}
	})
}

// UnmarshalJSON unmarshals the IncomingMessage from JSON.
func (x *IncomingMessage) UnmarshalJSON(b []byte) error {
	return json.DefaultUnmarshalerConfig.Unmarshal(b, x)
}

func (m *SubscribeRequest) MarshalVT() (dAtA []byte, err error) {
	if m == nil {
		return nil, nil
	}
	size := m.SizeVT()
	dAtA = make([]byte, size)
	n, err := m.MarshalToSizedBufferVT(dAtA[:size])
	if err != nil {
		return nil, err
	}
	return dAtA[:n], nil
}

func (m *SubscribeRequest) MarshalToVT(dAtA []byte) (int, error) {
	size := m.SizeVT()
	return m.MarshalToSizedBufferVT(dAtA[:size])
}

func (m *SubscribeRequest) MarshalToSizedBufferVT(dAtA []byte) (int, error) {
	if m == nil {
		return 0, nil
	}
	i := len(dAtA)
	_ = i
	var l int
	_ = l
	if m.unknownFields != nil {
		i -= len(m.unknownFields)
		copy(dAtA[i:], m.unknownFields)
	}
	if m.PublishRequest != nil {
		size, err := m.PublishRequest.MarshalToSizedBufferVT(dAtA[:i])
		if err != nil {
			return 0, err
		}
		i -= size
		i = protobuf_go_lite.EncodeVarint(dAtA, i, uint64(size))
		i--
		dAtA[i] = 0x22
	}
	if len(m.PrivKeyPem) > 0 {
		i -= len(m.PrivKeyPem)
		copy(dAtA[i:], m.PrivKeyPem)
		i = protobuf_go_lite.EncodeVarint(dAtA, i, uint64(len(m.PrivKeyPem)))
		i--
		dAtA[i] = 0x1a
	}
	if len(m.PeerId) > 0 {
		i -= len(m.PeerId)
		copy(dAtA[i:], m.PeerId)
		i = protobuf_go_lite.EncodeVarint(dAtA, i, uint64(len(m.PeerId)))
		i--
		dAtA[i] = 0x12
	}
	if len(m.ChannelId) > 0 {
		i -= len(m.ChannelId)
		copy(dAtA[i:], m.ChannelId)
		i = protobuf_go_lite.EncodeVarint(dAtA, i, uint64(len(m.ChannelId)))
		i--
		dAtA[i] = 0xa
	}
	return len(dAtA) - i, nil
}

func (m *PublishRequest) MarshalVT() (dAtA []byte, err error) {
	if m == nil {
		return nil, nil
	}
	size := m.SizeVT()
	dAtA = make([]byte, size)
	n, err := m.MarshalToSizedBufferVT(dAtA[:size])
	if err != nil {
		return nil, err
	}
	return dAtA[:n], nil
}

func (m *PublishRequest) MarshalToVT(dAtA []byte) (int, error) {
	size := m.SizeVT()
	return m.MarshalToSizedBufferVT(dAtA[:size])
}

func (m *PublishRequest) MarshalToSizedBufferVT(dAtA []byte) (int, error) {
	if m == nil {
		return 0, nil
	}
	i := len(dAtA)
	_ = i
	var l int
	_ = l
	if m.unknownFields != nil {
		i -= len(m.unknownFields)
		copy(dAtA[i:], m.unknownFields)
	}
	if m.Identifier != 0 {
		i = protobuf_go_lite.EncodeVarint(dAtA, i, uint64(m.Identifier))
		i--
		dAtA[i] = 0x10
	}
	if len(m.Data) > 0 {
		i -= len(m.Data)
		copy(dAtA[i:], m.Data)
		i = protobuf_go_lite.EncodeVarint(dAtA, i, uint64(len(m.Data)))
		i--
		dAtA[i] = 0xa
	}
	return len(dAtA) - i, nil
}

func (m *SubscribeResponse) MarshalVT() (dAtA []byte, err error) {
	if m == nil {
		return nil, nil
	}
	size := m.SizeVT()
	dAtA = make([]byte, size)
	n, err := m.MarshalToSizedBufferVT(dAtA[:size])
	if err != nil {
		return nil, err
	}
	return dAtA[:n], nil
}

func (m *SubscribeResponse) MarshalToVT(dAtA []byte) (int, error) {
	size := m.SizeVT()
	return m.MarshalToSizedBufferVT(dAtA[:size])
}

func (m *SubscribeResponse) MarshalToSizedBufferVT(dAtA []byte) (int, error) {
	if m == nil {
		return 0, nil
	}
	i := len(dAtA)
	_ = i
	var l int
	_ = l
	if m.unknownFields != nil {
		i -= len(m.unknownFields)
		copy(dAtA[i:], m.unknownFields)
	}
	if m.SubscriptionStatus != nil {
		size, err := m.SubscriptionStatus.MarshalToSizedBufferVT(dAtA[:i])
		if err != nil {
			return 0, err
		}
		i -= size
		i = protobuf_go_lite.EncodeVarint(dAtA, i, uint64(size))
		i--
		dAtA[i] = 0x1a
	}
	if m.OutgoingStatus != nil {
		size, err := m.OutgoingStatus.MarshalToSizedBufferVT(dAtA[:i])
		if err != nil {
			return 0, err
		}
		i -= size
		i = protobuf_go_lite.EncodeVarint(dAtA, i, uint64(size))
		i--
		dAtA[i] = 0x12
	}
	if m.IncomingMessage != nil {
		size, err := m.IncomingMessage.MarshalToSizedBufferVT(dAtA[:i])
		if err != nil {
			return 0, err
		}
		i -= size
		i = protobuf_go_lite.EncodeVarint(dAtA, i, uint64(size))
		i--
		dAtA[i] = 0xa
	}
	return len(dAtA) - i, nil
}

func (m *SubscriptionStatus) MarshalVT() (dAtA []byte, err error) {
	if m == nil {
		return nil, nil
	}
	size := m.SizeVT()
	dAtA = make([]byte, size)
	n, err := m.MarshalToSizedBufferVT(dAtA[:size])
	if err != nil {
		return nil, err
	}
	return dAtA[:n], nil
}

func (m *SubscriptionStatus) MarshalToVT(dAtA []byte) (int, error) {
	size := m.SizeVT()
	return m.MarshalToSizedBufferVT(dAtA[:size])
}

func (m *SubscriptionStatus) MarshalToSizedBufferVT(dAtA []byte) (int, error) {
	if m == nil {
		return 0, nil
	}
	i := len(dAtA)
	_ = i
	var l int
	_ = l
	if m.unknownFields != nil {
		i -= len(m.unknownFields)
		copy(dAtA[i:], m.unknownFields)
	}
	if m.Subscribed {
		i--
		if m.Subscribed {
			dAtA[i] = 1
		} else {
			dAtA[i] = 0
		}
		i--
		dAtA[i] = 0x8
	}
	return len(dAtA) - i, nil
}

func (m *OutgoingStatus) MarshalVT() (dAtA []byte, err error) {
	if m == nil {
		return nil, nil
	}
	size := m.SizeVT()
	dAtA = make([]byte, size)
	n, err := m.MarshalToSizedBufferVT(dAtA[:size])
	if err != nil {
		return nil, err
	}
	return dAtA[:n], nil
}

func (m *OutgoingStatus) MarshalToVT(dAtA []byte) (int, error) {
	size := m.SizeVT()
	return m.MarshalToSizedBufferVT(dAtA[:size])
}

func (m *OutgoingStatus) MarshalToSizedBufferVT(dAtA []byte) (int, error) {
	if m == nil {
		return 0, nil
	}
	i := len(dAtA)
	_ = i
	var l int
	_ = l
	if m.unknownFields != nil {
		i -= len(m.unknownFields)
		copy(dAtA[i:], m.unknownFields)
	}
	if m.Sent {
		i--
		if m.Sent {
			dAtA[i] = 1
		} else {
			dAtA[i] = 0
		}
		i--
		dAtA[i] = 0x10
	}
	if m.Identifier != 0 {
		i = protobuf_go_lite.EncodeVarint(dAtA, i, uint64(m.Identifier))
		i--
		dAtA[i] = 0x8
	}
	return len(dAtA) - i, nil
}

func (m *IncomingMessage) MarshalVT() (dAtA []byte, err error) {
	if m == nil {
		return nil, nil
	}
	size := m.SizeVT()
	dAtA = make([]byte, size)
	n, err := m.MarshalToSizedBufferVT(dAtA[:size])
	if err != nil {
		return nil, err
	}
	return dAtA[:n], nil
}

func (m *IncomingMessage) MarshalToVT(dAtA []byte) (int, error) {
	size := m.SizeVT()
	return m.MarshalToSizedBufferVT(dAtA[:size])
}

func (m *IncomingMessage) MarshalToSizedBufferVT(dAtA []byte) (int, error) {
	if m == nil {
		return 0, nil
	}
	i := len(dAtA)
	_ = i
	var l int
	_ = l
	if m.unknownFields != nil {
		i -= len(m.unknownFields)
		copy(dAtA[i:], m.unknownFields)
	}
	if len(m.Data) > 0 {
		i -= len(m.Data)
		copy(dAtA[i:], m.Data)
		i = protobuf_go_lite.EncodeVarint(dAtA, i, uint64(len(m.Data)))
		i--
		dAtA[i] = 0x1a
	}
	if m.Authenticated {
		i--
		if m.Authenticated {
			dAtA[i] = 1
		} else {
			dAtA[i] = 0
		}
		i--
		dAtA[i] = 0x10
	}
	if len(m.FromPeerId) > 0 {
		i -= len(m.FromPeerId)
		copy(dAtA[i:], m.FromPeerId)
		i = protobuf_go_lite.EncodeVarint(dAtA, i, uint64(len(m.FromPeerId)))
		i--
		dAtA[i] = 0xa
	}
	return len(dAtA) - i, nil
}

func (m *SubscribeRequest) SizeVT() (n int) {
	if m == nil {
		return 0
	}
	var l int
	_ = l
	l = len(m.ChannelId)
	if l > 0 {
		n += 1 + l + protobuf_go_lite.SizeOfVarint(uint64(l))
	}
	l = len(m.PeerId)
	if l > 0 {
		n += 1 + l + protobuf_go_lite.SizeOfVarint(uint64(l))
	}
	l = len(m.PrivKeyPem)
	if l > 0 {
		n += 1 + l + protobuf_go_lite.SizeOfVarint(uint64(l))
	}
	if m.PublishRequest != nil {
		l = m.PublishRequest.SizeVT()
		n += 1 + l + protobuf_go_lite.SizeOfVarint(uint64(l))
	}
	n += len(m.unknownFields)
	return n
}

func (m *PublishRequest) SizeVT() (n int) {
	if m == nil {
		return 0
	}
	var l int
	_ = l
	l = len(m.Data)
	if l > 0 {
		n += 1 + l + protobuf_go_lite.SizeOfVarint(uint64(l))
	}
	if m.Identifier != 0 {
		n += 1 + protobuf_go_lite.SizeOfVarint(uint64(m.Identifier))
	}
	n += len(m.unknownFields)
	return n
}

func (m *SubscribeResponse) SizeVT() (n int) {
	if m == nil {
		return 0
	}
	var l int
	_ = l
	if m.IncomingMessage != nil {
		l = m.IncomingMessage.SizeVT()
		n += 1 + l + protobuf_go_lite.SizeOfVarint(uint64(l))
	}
	if m.OutgoingStatus != nil {
		l = m.OutgoingStatus.SizeVT()
		n += 1 + l + protobuf_go_lite.SizeOfVarint(uint64(l))
	}
	if m.SubscriptionStatus != nil {
		l = m.SubscriptionStatus.SizeVT()
		n += 1 + l + protobuf_go_lite.SizeOfVarint(uint64(l))
	}
	n += len(m.unknownFields)
	return n
}

func (m *SubscriptionStatus) SizeVT() (n int) {
	if m == nil {
		return 0
	}
	var l int
	_ = l
	if m.Subscribed {
		n += 2
	}
	n += len(m.unknownFields)
	return n
}

func (m *OutgoingStatus) SizeVT() (n int) {
	if m == nil {
		return 0
	}
	var l int
	_ = l
	if m.Identifier != 0 {
		n += 1 + protobuf_go_lite.SizeOfVarint(uint64(m.Identifier))
	}
	if m.Sent {
		n += 2
	}
	n += len(m.unknownFields)
	return n
}

func (m *IncomingMessage) SizeVT() (n int) {
	if m == nil {
		return 0
	}
	var l int
	_ = l
	l = len(m.FromPeerId)
	if l > 0 {
		n += 1 + l + protobuf_go_lite.SizeOfVarint(uint64(l))
	}
	if m.Authenticated {
		n += 2
	}
	l = len(m.Data)
	if l > 0 {
		n += 1 + l + protobuf_go_lite.SizeOfVarint(uint64(l))
	}
	n += len(m.unknownFields)
	return n
}

func (x *SubscribeRequest) MarshalProtoText() string {
	var sb strings.Builder
	sb.WriteString("SubscribeRequest {")
	if x.ChannelId != "" {
		if sb.Len() > 18 {
			sb.WriteString(" ")
		}
		sb.WriteString("channel_id: ")
		sb.WriteString(strconv.Quote(x.ChannelId))
	}
	if x.PeerId != "" {
		if sb.Len() > 18 {
			sb.WriteString(" ")
		}
		sb.WriteString("peer_id: ")
		sb.WriteString(strconv.Quote(x.PeerId))
	}
	if x.PrivKeyPem != "" {
		if sb.Len() > 18 {
			sb.WriteString(" ")
		}
		sb.WriteString("priv_key_pem: ")
		sb.WriteString(strconv.Quote(x.PrivKeyPem))
	}
	if x.PublishRequest != nil {
		if sb.Len() > 18 {
			sb.WriteString(" ")
		}
		sb.WriteString("publish_request: ")
		sb.WriteString(x.PublishRequest.MarshalProtoText())
	}
	sb.WriteString("}")
	return sb.String()
}

func (x *SubscribeRequest) String() string {
	return x.MarshalProtoText()
}
func (x *PublishRequest) MarshalProtoText() string {
	var sb strings.Builder
	sb.WriteString("PublishRequest {")
	if x.Data != nil {
		if sb.Len() > 16 {
			sb.WriteString(" ")
		}
		sb.WriteString("data: ")
		sb.WriteString("\"")
		sb.WriteString(base64.StdEncoding.EncodeToString(x.Data))
		sb.WriteString("\"")
	}
	if x.Identifier != 0 {
		if sb.Len() > 16 {
			sb.WriteString(" ")
		}
		sb.WriteString("identifier: ")
		sb.WriteString(strconv.FormatUint(uint64(x.Identifier), 10))
	}
	sb.WriteString("}")
	return sb.String()
}

func (x *PublishRequest) String() string {
	return x.MarshalProtoText()
}
func (x *SubscribeResponse) MarshalProtoText() string {
	var sb strings.Builder
	sb.WriteString("SubscribeResponse {")
	if x.IncomingMessage != nil {
		if sb.Len() > 19 {
			sb.WriteString(" ")
		}
		sb.WriteString("incoming_message: ")
		sb.WriteString(x.IncomingMessage.MarshalProtoText())
	}
	if x.OutgoingStatus != nil {
		if sb.Len() > 19 {
			sb.WriteString(" ")
		}
		sb.WriteString("outgoing_status: ")
		sb.WriteString(x.OutgoingStatus.MarshalProtoText())
	}
	if x.SubscriptionStatus != nil {
		if sb.Len() > 19 {
			sb.WriteString(" ")
		}
		sb.WriteString("subscription_status: ")
		sb.WriteString(x.SubscriptionStatus.MarshalProtoText())
	}
	sb.WriteString("}")
	return sb.String()
}

func (x *SubscribeResponse) String() string {
	return x.MarshalProtoText()
}
func (x *SubscriptionStatus) MarshalProtoText() string {
	var sb strings.Builder
	sb.WriteString("SubscriptionStatus {")
	if x.Subscribed != false {
		if sb.Len() > 20 {
			sb.WriteString(" ")
		}
		sb.WriteString("subscribed: ")
		sb.WriteString(strconv.FormatBool(x.Subscribed))
	}
	sb.WriteString("}")
	return sb.String()
}

func (x *SubscriptionStatus) String() string {
	return x.MarshalProtoText()
}
func (x *OutgoingStatus) MarshalProtoText() string {
	var sb strings.Builder
	sb.WriteString("OutgoingStatus {")
	if x.Identifier != 0 {
		if sb.Len() > 16 {
			sb.WriteString(" ")
		}
		sb.WriteString("identifier: ")
		sb.WriteString(strconv.FormatUint(uint64(x.Identifier), 10))
	}
	if x.Sent != false {
		if sb.Len() > 16 {
			sb.WriteString(" ")
		}
		sb.WriteString("sent: ")
		sb.WriteString(strconv.FormatBool(x.Sent))
	}
	sb.WriteString("}")
	return sb.String()
}

func (x *OutgoingStatus) String() string {
	return x.MarshalProtoText()
}
func (x *IncomingMessage) MarshalProtoText() string {
	var sb strings.Builder
	sb.WriteString("IncomingMessage {")
	if x.FromPeerId != "" {
		if sb.Len() > 17 {
			sb.WriteString(" ")
		}
		sb.WriteString("from_peer_id: ")
		sb.WriteString(strconv.Quote(x.FromPeerId))
	}
	if x.Authenticated != false {
		if sb.Len() > 17 {
			sb.WriteString(" ")
		}
		sb.WriteString("authenticated: ")
		sb.WriteString(strconv.FormatBool(x.Authenticated))
	}
	if x.Data != nil {
		if sb.Len() > 17 {
			sb.WriteString(" ")
		}
		sb.WriteString("data: ")
		sb.WriteString("\"")
		sb.WriteString(base64.StdEncoding.EncodeToString(x.Data))
		sb.WriteString("\"")
	}
	sb.WriteString("}")
	return sb.String()
}

func (x *IncomingMessage) String() string {
	return x.MarshalProtoText()
}
func (m *SubscribeRequest) UnmarshalVT(dAtA []byte) error {
	l := len(dAtA)
	iNdEx := 0
	for iNdEx < l {
		preIndex := iNdEx
		var wire uint64
		for shift := uint(0); ; shift += 7 {
			if shift >= 64 {
				return protobuf_go_lite.ErrIntOverflow
			}
			if iNdEx >= l {
				return io.ErrUnexpectedEOF
			}
			b := dAtA[iNdEx]
			iNdEx++
			wire |= uint64(b&0x7F) << shift
			if b < 0x80 {
				break
			}
		}
		fieldNum := int32(wire >> 3)
		wireType := int(wire & 0x7)
		if wireType == 4 {
			return fmt.Errorf("proto: SubscribeRequest: wiretype end group for non-group")
		}
		if fieldNum <= 0 {
			return fmt.Errorf("proto: SubscribeRequest: illegal tag %d (wire type %d)", fieldNum, wire)
		}
		switch fieldNum {
		case 1:
			if wireType != 2 {
				return fmt.Errorf("proto: wrong wireType = %d for field ChannelId", wireType)
			}
			var stringLen uint64
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return protobuf_go_lite.ErrIntOverflow
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				stringLen |= uint64(b&0x7F) << shift
				if b < 0x80 {
					break
				}
			}
			intStringLen := int(stringLen)
			if intStringLen < 0 {
				return protobuf_go_lite.ErrInvalidLength
			}
			postIndex := iNdEx + intStringLen
			if postIndex < 0 {
				return protobuf_go_lite.ErrInvalidLength
			}
			if postIndex > l {
				return io.ErrUnexpectedEOF
			}
			m.ChannelId = string(dAtA[iNdEx:postIndex])
			iNdEx = postIndex
		case 2:
			if wireType != 2 {
				return fmt.Errorf("proto: wrong wireType = %d for field PeerId", wireType)
			}
			var stringLen uint64
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return protobuf_go_lite.ErrIntOverflow
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				stringLen |= uint64(b&0x7F) << shift
				if b < 0x80 {
					break
				}
			}
			intStringLen := int(stringLen)
			if intStringLen < 0 {
				return protobuf_go_lite.ErrInvalidLength
			}
			postIndex := iNdEx + intStringLen
			if postIndex < 0 {
				return protobuf_go_lite.ErrInvalidLength
			}
			if postIndex > l {
				return io.ErrUnexpectedEOF
			}
			m.PeerId = string(dAtA[iNdEx:postIndex])
			iNdEx = postIndex
		case 3:
			if wireType != 2 {
				return fmt.Errorf("proto: wrong wireType = %d for field PrivKeyPem", wireType)
			}
			var stringLen uint64
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return protobuf_go_lite.ErrIntOverflow
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				stringLen |= uint64(b&0x7F) << shift
				if b < 0x80 {
					break
				}
			}
			intStringLen := int(stringLen)
			if intStringLen < 0 {
				return protobuf_go_lite.ErrInvalidLength
			}
			postIndex := iNdEx + intStringLen
			if postIndex < 0 {
				return protobuf_go_lite.ErrInvalidLength
			}
			if postIndex > l {
				return io.ErrUnexpectedEOF
			}
			m.PrivKeyPem = string(dAtA[iNdEx:postIndex])
			iNdEx = postIndex
		case 4:
			if wireType != 2 {
				return fmt.Errorf("proto: wrong wireType = %d for field PublishRequest", wireType)
			}
			var msglen int
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return protobuf_go_lite.ErrIntOverflow
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				msglen |= int(b&0x7F) << shift
				if b < 0x80 {
					break
				}
			}
			if msglen < 0 {
				return protobuf_go_lite.ErrInvalidLength
			}
			postIndex := iNdEx + msglen
			if postIndex < 0 {
				return protobuf_go_lite.ErrInvalidLength
			}
			if postIndex > l {
				return io.ErrUnexpectedEOF
			}
			if m.PublishRequest == nil {
				m.PublishRequest = &PublishRequest{}
			}
			if err := m.PublishRequest.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil {
				return err
			}
			iNdEx = postIndex
		default:
			iNdEx = preIndex
			skippy, err := protobuf_go_lite.Skip(dAtA[iNdEx:])
			if err != nil {
				return err
			}
			if (skippy < 0) || (iNdEx+skippy) < 0 {
				return protobuf_go_lite.ErrInvalidLength
			}
			if (iNdEx + skippy) > l {
				return io.ErrUnexpectedEOF
			}
			m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...)
			iNdEx += skippy
		}
	}

	if iNdEx > l {
		return io.ErrUnexpectedEOF
	}
	return nil
}
func (m *PublishRequest) UnmarshalVT(dAtA []byte) error {
	l := len(dAtA)
	iNdEx := 0
	for iNdEx < l {
		preIndex := iNdEx
		var wire uint64
		for shift := uint(0); ; shift += 7 {
			if shift >= 64 {
				return protobuf_go_lite.ErrIntOverflow
			}
			if iNdEx >= l {
				return io.ErrUnexpectedEOF
			}
			b := dAtA[iNdEx]
			iNdEx++
			wire |= uint64(b&0x7F) << shift
			if b < 0x80 {
				break
			}
		}
		fieldNum := int32(wire >> 3)
		wireType := int(wire & 0x7)
		if wireType == 4 {
			return fmt.Errorf("proto: PublishRequest: wiretype end group for non-group")
		}
		if fieldNum <= 0 {
			return fmt.Errorf("proto: PublishRequest: illegal tag %d (wire type %d)", fieldNum, wire)
		}
		switch fieldNum {
		case 1:
			if wireType != 2 {
				return fmt.Errorf("proto: wrong wireType = %d for field Data", wireType)
			}
			var byteLen int
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return protobuf_go_lite.ErrIntOverflow
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				byteLen |= int(b&0x7F) << shift
				if b < 0x80 {
					break
				}
			}
			if byteLen < 0 {
				return protobuf_go_lite.ErrInvalidLength
			}
			postIndex := iNdEx + byteLen
			if postIndex < 0 {
				return protobuf_go_lite.ErrInvalidLength
			}
			if postIndex > l {
				return io.ErrUnexpectedEOF
			}
			m.Data = append(m.Data[:0], dAtA[iNdEx:postIndex]...)
			if m.Data == nil {
				m.Data = []byte{}
			}
			iNdEx = postIndex
		case 2:
			if wireType != 0 {
				return fmt.Errorf("proto: wrong wireType = %d for field Identifier", wireType)
			}
			m.Identifier = 0
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return protobuf_go_lite.ErrIntOverflow
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				m.Identifier |= uint32(b&0x7F) << shift
				if b < 0x80 {
					break
				}
			}
		default:
			iNdEx = preIndex
			skippy, err := protobuf_go_lite.Skip(dAtA[iNdEx:])
			if err != nil {
				return err
			}
			if (skippy < 0) || (iNdEx+skippy) < 0 {
				return protobuf_go_lite.ErrInvalidLength
			}
			if (iNdEx + skippy) > l {
				return io.ErrUnexpectedEOF
			}
			m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...)
			iNdEx += skippy
		}
	}

	if iNdEx > l {
		return io.ErrUnexpectedEOF
	}
	return nil
}
func (m *SubscribeResponse) UnmarshalVT(dAtA []byte) error {
	l := len(dAtA)
	iNdEx := 0
	for iNdEx < l {
		preIndex := iNdEx
		var wire uint64
		for shift := uint(0); ; shift += 7 {
			if shift >= 64 {
				return protobuf_go_lite.ErrIntOverflow
			}
			if iNdEx >= l {
				return io.ErrUnexpectedEOF
			}
			b := dAtA[iNdEx]
			iNdEx++
			wire |= uint64(b&0x7F) << shift
			if b < 0x80 {
				break
			}
		}
		fieldNum := int32(wire >> 3)
		wireType := int(wire & 0x7)
		if wireType == 4 {
			return fmt.Errorf("proto: SubscribeResponse: wiretype end group for non-group")
		}
		if fieldNum <= 0 {
			return fmt.Errorf("proto: SubscribeResponse: illegal tag %d (wire type %d)", fieldNum, wire)
		}
		switch fieldNum {
		case 1:
			if wireType != 2 {
				return fmt.Errorf("proto: wrong wireType = %d for field IncomingMessage", wireType)
			}
			var msglen int
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return protobuf_go_lite.ErrIntOverflow
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				msglen |= int(b&0x7F) << shift
				if b < 0x80 {
					break
				}
			}
			if msglen < 0 {
				return protobuf_go_lite.ErrInvalidLength
			}
			postIndex := iNdEx + msglen
			if postIndex < 0 {
				return protobuf_go_lite.ErrInvalidLength
			}
			if postIndex > l {
				return io.ErrUnexpectedEOF
			}
			if m.IncomingMessage == nil {
				m.IncomingMessage = &IncomingMessage{}
			}
			if err := m.IncomingMessage.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil {
				return err
			}
			iNdEx = postIndex
		case 2:
			if wireType != 2 {
				return fmt.Errorf("proto: wrong wireType = %d for field OutgoingStatus", wireType)
			}
			var msglen int
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return protobuf_go_lite.ErrIntOverflow
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				msglen |= int(b&0x7F) << shift
				if b < 0x80 {
					break
				}
			}
			if msglen < 0 {
				return protobuf_go_lite.ErrInvalidLength
			}
			postIndex := iNdEx + msglen
			if postIndex < 0 {
				return protobuf_go_lite.ErrInvalidLength
			}
			if postIndex > l {
				return io.ErrUnexpectedEOF
			}
			if m.OutgoingStatus == nil {
				m.OutgoingStatus = &OutgoingStatus{}
			}
			if err := m.OutgoingStatus.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil {
				return err
			}
			iNdEx = postIndex
		case 3:
			if wireType != 2 {
				return fmt.Errorf("proto: wrong wireType = %d for field SubscriptionStatus", wireType)
			}
			var msglen int
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return protobuf_go_lite.ErrIntOverflow
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				msglen |= int(b&0x7F) << shift
				if b < 0x80 {
					break
				}
			}
			if msglen < 0 {
				return protobuf_go_lite.ErrInvalidLength
			}
			postIndex := iNdEx + msglen
			if postIndex < 0 {
				return protobuf_go_lite.ErrInvalidLength
			}
			if postIndex > l {
				return io.ErrUnexpectedEOF
			}
			if m.SubscriptionStatus == nil {
				m.SubscriptionStatus = &SubscriptionStatus{}
			}
			if err := m.SubscriptionStatus.UnmarshalVT(dAtA[iNdEx:postIndex]); err != nil {
				return err
			}
			iNdEx = postIndex
		default:
			iNdEx = preIndex
			skippy, err := protobuf_go_lite.Skip(dAtA[iNdEx:])
			if err != nil {
				return err
			}
			if (skippy < 0) || (iNdEx+skippy) < 0 {
				return protobuf_go_lite.ErrInvalidLength
			}
			if (iNdEx + skippy) > l {
				return io.ErrUnexpectedEOF
			}
			m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...)
			iNdEx += skippy
		}
	}

	if iNdEx > l {
		return io.ErrUnexpectedEOF
	}
	return nil
}
func (m *SubscriptionStatus) UnmarshalVT(dAtA []byte) error {
	l := len(dAtA)
	iNdEx := 0
	for iNdEx < l {
		preIndex := iNdEx
		var wire uint64
		for shift := uint(0); ; shift += 7 {
			if shift >= 64 {
				return protobuf_go_lite.ErrIntOverflow
			}
			if iNdEx >= l {
				return io.ErrUnexpectedEOF
			}
			b := dAtA[iNdEx]
			iNdEx++
			wire |= uint64(b&0x7F) << shift
			if b < 0x80 {
				break
			}
		}
		fieldNum := int32(wire >> 3)
		wireType := int(wire & 0x7)
		if wireType == 4 {
			return fmt.Errorf("proto: SubscriptionStatus: wiretype end group for non-group")
		}
		if fieldNum <= 0 {
			return fmt.Errorf("proto: SubscriptionStatus: illegal tag %d (wire type %d)", fieldNum, wire)
		}
		switch fieldNum {
		case 1:
			if wireType != 0 {
				return fmt.Errorf("proto: wrong wireType = %d for field Subscribed", wireType)
			}
			var v int
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return protobuf_go_lite.ErrIntOverflow
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				v |= int(b&0x7F) << shift
				if b < 0x80 {
					break
				}
			}
			m.Subscribed = bool(v != 0)
		default:
			iNdEx = preIndex
			skippy, err := protobuf_go_lite.Skip(dAtA[iNdEx:])
			if err != nil {
				return err
			}
			if (skippy < 0) || (iNdEx+skippy) < 0 {
				return protobuf_go_lite.ErrInvalidLength
			}
			if (iNdEx + skippy) > l {
				return io.ErrUnexpectedEOF
			}
			m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...)
			iNdEx += skippy
		}
	}

	if iNdEx > l {
		return io.ErrUnexpectedEOF
	}
	return nil
}
func (m *OutgoingStatus) UnmarshalVT(dAtA []byte) error {
	l := len(dAtA)
	iNdEx := 0
	for iNdEx < l {
		preIndex := iNdEx
		var wire uint64
		for shift := uint(0); ; shift += 7 {
			if shift >= 64 {
				return protobuf_go_lite.ErrIntOverflow
			}
			if iNdEx >= l {
				return io.ErrUnexpectedEOF
			}
			b := dAtA[iNdEx]
			iNdEx++
			wire |= uint64(b&0x7F) << shift
			if b < 0x80 {
				break
			}
		}
		fieldNum := int32(wire >> 3)
		wireType := int(wire & 0x7)
		if wireType == 4 {
			return fmt.Errorf("proto: OutgoingStatus: wiretype end group for non-group")
		}
		if fieldNum <= 0 {
			return fmt.Errorf("proto: OutgoingStatus: illegal tag %d (wire type %d)", fieldNum, wire)
		}
		switch fieldNum {
		case 1:
			if wireType != 0 {
				return fmt.Errorf("proto: wrong wireType = %d for field Identifier", wireType)
			}
			m.Identifier = 0
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return protobuf_go_lite.ErrIntOverflow
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				m.Identifier |= uint32(b&0x7F) << shift
				if b < 0x80 {
					break
				}
			}
		case 2:
			if wireType != 0 {
				return fmt.Errorf("proto: wrong wireType = %d for field Sent", wireType)
			}
			var v int
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return protobuf_go_lite.ErrIntOverflow
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				v |= int(b&0x7F) << shift
				if b < 0x80 {
					break
				}
			}
			m.Sent = bool(v != 0)
		default:
			iNdEx = preIndex
			skippy, err := protobuf_go_lite.Skip(dAtA[iNdEx:])
			if err != nil {
				return err
			}
			if (skippy < 0) || (iNdEx+skippy) < 0 {
				return protobuf_go_lite.ErrInvalidLength
			}
			if (iNdEx + skippy) > l {
				return io.ErrUnexpectedEOF
			}
			m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...)
			iNdEx += skippy
		}
	}

	if iNdEx > l {
		return io.ErrUnexpectedEOF
	}
	return nil
}
func (m *IncomingMessage) UnmarshalVT(dAtA []byte) error {
	l := len(dAtA)
	iNdEx := 0
	for iNdEx < l {
		preIndex := iNdEx
		var wire uint64
		for shift := uint(0); ; shift += 7 {
			if shift >= 64 {
				return protobuf_go_lite.ErrIntOverflow
			}
			if iNdEx >= l {
				return io.ErrUnexpectedEOF
			}
			b := dAtA[iNdEx]
			iNdEx++
			wire |= uint64(b&0x7F) << shift
			if b < 0x80 {
				break
			}
		}
		fieldNum := int32(wire >> 3)
		wireType := int(wire & 0x7)
		if wireType == 4 {
			return fmt.Errorf("proto: IncomingMessage: wiretype end group for non-group")
		}
		if fieldNum <= 0 {
			return fmt.Errorf("proto: IncomingMessage: illegal tag %d (wire type %d)", fieldNum, wire)
		}
		switch fieldNum {
		case 1:
			if wireType != 2 {
				return fmt.Errorf("proto: wrong wireType = %d for field FromPeerId", wireType)
			}
			var stringLen uint64
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return protobuf_go_lite.ErrIntOverflow
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				stringLen |= uint64(b&0x7F) << shift
				if b < 0x80 {
					break
				}
			}
			intStringLen := int(stringLen)
			if intStringLen < 0 {
				return protobuf_go_lite.ErrInvalidLength
			}
			postIndex := iNdEx + intStringLen
			if postIndex < 0 {
				return protobuf_go_lite.ErrInvalidLength
			}
			if postIndex > l {
				return io.ErrUnexpectedEOF
			}
			m.FromPeerId = string(dAtA[iNdEx:postIndex])
			iNdEx = postIndex
		case 2:
			if wireType != 0 {
				return fmt.Errorf("proto: wrong wireType = %d for field Authenticated", wireType)
			}
			var v int
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return protobuf_go_lite.ErrIntOverflow
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				v |= int(b&0x7F) << shift
				if b < 0x80 {
					break
				}
			}
			m.Authenticated = bool(v != 0)
		case 3:
			if wireType != 2 {
				return fmt.Errorf("proto: wrong wireType = %d for field Data", wireType)
			}
			var byteLen int
			for shift := uint(0); ; shift += 7 {
				if shift >= 64 {
					return protobuf_go_lite.ErrIntOverflow
				}
				if iNdEx >= l {
					return io.ErrUnexpectedEOF
				}
				b := dAtA[iNdEx]
				iNdEx++
				byteLen |= int(b&0x7F) << shift
				if b < 0x80 {
					break
				}
			}
			if byteLen < 0 {
				return protobuf_go_lite.ErrInvalidLength
			}
			postIndex := iNdEx + byteLen
			if postIndex < 0 {
				return protobuf_go_lite.ErrInvalidLength
			}
			if postIndex > l {
				return io.ErrUnexpectedEOF
			}
			m.Data = append(m.Data[:0], dAtA[iNdEx:postIndex]...)
			if m.Data == nil {
				m.Data = []byte{}
			}
			iNdEx = postIndex
		default:
			iNdEx = preIndex
			skippy, err := protobuf_go_lite.Skip(dAtA[iNdEx:])
			if err != nil {
				return err
			}
			if (skippy < 0) || (iNdEx+skippy) < 0 {
				return protobuf_go_lite.ErrInvalidLength
			}
			if (iNdEx + skippy) > l {
				return io.ErrUnexpectedEOF
			}
			m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...)
			iNdEx += skippy
		}
	}

	if iNdEx > l {
		return io.ErrUnexpectedEOF
	}
	return nil
}
