// Generated by the protocol buffer compiler.  DO NOT EDIT!
// source: bgs/low/pb/client/friends_service.proto
#pragma warning disable 1591, 0612, 3021
#region Designer generated code

using pb = Google.Protobuf;
using pbc = Google.Protobuf.Collections;
using pbr = Google.Protobuf.Reflection;
namespace Bgs.Protocol.Friends.V1
{

    /// <summary>Holder for reflection information generated from bgs/low/pb/client/friends_service.proto</summary>
    [System.Diagnostics.DebuggerNonUserCodeAttribute()]
  public static partial class FriendsServiceReflection {

    #region Descriptor
    /// <summary>File descriptor for bgs/low/pb/client/friends_service.proto</summary>
    public static pbr::FileDescriptor Descriptor {
      get { return descriptor; }
    }
    private static pbr::FileDescriptor descriptor;

    static FriendsServiceReflection() {
      byte[] descriptorData = System.Convert.FromBase64String(
          string.Concat(
            "CidiZ3MvbG93L3BiL2NsaWVudC9mcmllbmRzX3NlcnZpY2UucHJvdG8SF2Jn",
            "cy5wcm90b2NvbC5mcmllbmRzLnYxGidiZ3MvbG93L3BiL2NsaWVudC9hdHRy",
            "aWJ1dGVfdHlwZXMucHJvdG8aJGJncy9sb3cvcGIvY2xpZW50L2VudGl0eV90",
            "eXBlcy5wcm90bxolYmdzL2xvdy9wYi9jbGllbnQvZnJpZW5kc190eXBlcy5w",
            "cm90bxooYmdzL2xvdy9wYi9jbGllbnQvaW52aXRhdGlvbl90eXBlcy5wcm90",
            "bxoiYmdzL2xvdy9wYi9jbGllbnQvcm9sZV90eXBlcy5wcm90bxohYmdzL2xv",
            "dy9wYi9jbGllbnQvcnBjX3R5cGVzLnByb3RvIk8KEFN1YnNjcmliZVJlcXVl",
            "c3QSKAoIYWdlbnRfaWQYASABKAsyFi5iZ3MucHJvdG9jb2wuRW50aXR5SWQS",
            "EQoJb2JqZWN0X2lkGAIgASgEIqgCChFTdWJzY3JpYmVSZXNwb25zZRITCgtt",
            "YXhfZnJpZW5kcxgBIAEoDRIgChhtYXhfcmVjZWl2ZWRfaW52aXRhdGlvbnMY",
            "AiABKA0SHAoUbWF4X3NlbnRfaW52aXRhdGlvbnMYAyABKA0SIAoEcm9sZRgE",
            "IAMoCzISLmJncy5wcm90b2NvbC5Sb2xlEjAKB2ZyaWVuZHMYBSADKAsyHy5i",
            "Z3MucHJvdG9jb2wuZnJpZW5kcy52MS5GcmllbmQSMgoQc2VudF9pbnZpdGF0",
            "aW9ucxgGIAMoCzIYLmJncy5wcm90b2NvbC5JbnZpdGF0aW9uEjYKFHJlY2Vp",
            "dmVkX2ludml0YXRpb25zGAcgAygLMhguYmdzLnByb3RvY29sLkludml0YXRp",
            "b24iUQoSVW5zdWJzY3JpYmVSZXF1ZXN0EigKCGFnZW50X2lkGAEgASgLMhYu",
            "YmdzLnByb3RvY29sLkVudGl0eUlkEhEKCW9iamVjdF9pZBgCIAEoBCJrChRH",
            "ZW5lcmljRnJpZW5kUmVxdWVzdBIoCghhZ2VudF9pZBgBIAEoCzIWLmJncy5w",
            "cm90b2NvbC5FbnRpdHlJZBIpCgl0YXJnZXRfaWQYAiABKAsyFi5iZ3MucHJv",
            "dG9jb2wuRW50aXR5SWQiTwoVR2VuZXJpY0ZyaWVuZFJlc3BvbnNlEjYKDXRh",
            "cmdldF9mcmllbmQYASABKAsyHy5iZ3MucHJvdG9jb2wuZnJpZW5kcy52MS5G",
            "cmllbmQidgoRQXNzaWduUm9sZVJlcXVlc3QSKAoIYWdlbnRfaWQYASABKAsy",
            "Fi5iZ3MucHJvdG9jb2wuRW50aXR5SWQSKQoJdGFyZ2V0X2lkGAIgASgLMhYu",
            "YmdzLnByb3RvY29sLkVudGl0eUlkEgwKBHJvbGUYAyADKAUiewoSVmlld0Zy",
            "aWVuZHNSZXF1ZXN0EigKCGFnZW50X2lkGAEgASgLMhYuYmdzLnByb3RvY29s",
            "LkVudGl0eUlkEikKCXRhcmdldF9pZBgCIAEoCzIWLmJncy5wcm90b2NvbC5F",
            "bnRpdHlJZBIQCgRyb2xlGAMgAygNQgIQASJHChNWaWV3RnJpZW5kc1Jlc3Bv",
            "bnNlEjAKB2ZyaWVuZHMYASADKAsyHy5iZ3MucHJvdG9jb2wuZnJpZW5kcy52",
            "MS5GcmllbmQitQEKGFVwZGF0ZUZyaWVuZFN0YXRlUmVxdWVzdBIoCghhZ2Vu",
            "dF9pZBgBIAEoCzIWLmJncy5wcm90b2NvbC5FbnRpdHlJZBIpCgl0YXJnZXRf",
            "aWQYAiABKAsyFi5iZ3MucHJvdG9jb2wuRW50aXR5SWQSKgoJYXR0cmlidXRl",
            "GAMgAygLMhcuYmdzLnByb3RvY29sLkF0dHJpYnV0ZRIYChBhdHRyaWJ1dGVz",
            "X2Vwb2NoGAQgASgEIskBChJGcmllbmROb3RpZmljYXRpb24SLwoGdGFyZ2V0",
            "GAEgASgLMh8uYmdzLnByb3RvY29sLmZyaWVuZHMudjEuRnJpZW5kEi8KD2dh",
            "bWVfYWNjb3VudF9pZBgCIAEoCzIWLmJncy5wcm90b2NvbC5FbnRpdHlJZBIl",
            "CgRwZWVyGAQgASgLMhcuYmdzLnByb3RvY29sLlByb2Nlc3NJZBIqCgphY2Nv",
            "dW50X2lkGAUgASgLMhYuYmdzLnByb3RvY29sLkVudGl0eUlkItwBCh1VcGRh",
            "dGVGcmllbmRTdGF0ZU5vdGlmaWNhdGlvbhI3Cg5jaGFuZ2VkX2ZyaWVuZBgB",
            "IAEoCzIfLmJncy5wcm90b2NvbC5mcmllbmRzLnYxLkZyaWVuZBIvCg9nYW1l",
            "X2FjY291bnRfaWQYAiABKAsyFi5iZ3MucHJvdG9jb2wuRW50aXR5SWQSJQoE",
            "cGVlchgEIAEoCzIXLmJncy5wcm90b2NvbC5Qcm9jZXNzSWQSKgoKYWNjb3Vu",
            "dF9pZBgFIAEoCzIWLmJncy5wcm90b2NvbC5FbnRpdHlJZCLaAQoWSW52aXRh",
            "dGlvbk5vdGlmaWNhdGlvbhIsCgppbnZpdGF0aW9uGAEgASgLMhguYmdzLnBy",
            "b3RvY29sLkludml0YXRpb24SLwoPZ2FtZV9hY2NvdW50X2lkGAIgASgLMhYu",
            "YmdzLnByb3RvY29sLkVudGl0eUlkEg4KBnJlYXNvbhgDIAEoDRIlCgRwZWVy",
            "GAQgASgLMhcuYmdzLnByb3RvY29sLlByb2Nlc3NJZBIqCgphY2NvdW50X2lk",
            "GAUgASgLMhYuYmdzLnByb3RvY29sLkVudGl0eUlkMsUICg5GcmllbmRzU2Vy",
            "dmljZRJiCglTdWJzY3JpYmUSKS5iZ3MucHJvdG9jb2wuZnJpZW5kcy52MS5T",
            "dWJzY3JpYmVSZXF1ZXN0GiouYmdzLnByb3RvY29sLmZyaWVuZHMudjEuU3Vi",
            "c2NyaWJlUmVzcG9uc2USSwoOU2VuZEludml0YXRpb24SIy5iZ3MucHJvdG9j",
            "b2wuU2VuZEludml0YXRpb25SZXF1ZXN0GhQuYmdzLnByb3RvY29sLk5vRGF0",
            "YRJQChBBY2NlcHRJbnZpdGF0aW9uEiYuYmdzLnByb3RvY29sLkdlbmVyaWNJ",
            "bnZpdGF0aW9uUmVxdWVzdBoULmJncy5wcm90b2NvbC5Ob0RhdGESVQoQUmV2",
            "b2tlSW52aXRhdGlvbhImLmJncy5wcm90b2NvbC5HZW5lcmljSW52aXRhdGlv",
            "blJlcXVlc3QaFC5iZ3MucHJvdG9jb2wuTm9EYXRhIgOIAgESUQoRRGVjbGlu",
            "ZUludml0YXRpb24SJi5iZ3MucHJvdG9jb2wuR2VuZXJpY0ludml0YXRpb25S",
            "ZXF1ZXN0GhQuYmdzLnByb3RvY29sLk5vRGF0YRJQChBJZ25vcmVJbnZpdGF0",
            "aW9uEiYuYmdzLnByb3RvY29sLkdlbmVyaWNJbnZpdGF0aW9uUmVxdWVzdBoU",
            "LmJncy5wcm90b2NvbC5Ob0RhdGESTgoKQXNzaWduUm9sZRIqLmJncy5wcm90",
            "b2NvbC5mcmllbmRzLnYxLkFzc2lnblJvbGVSZXF1ZXN0GhQuYmdzLnByb3Rv",
            "Y29sLk5vRGF0YRJtCgxSZW1vdmVGcmllbmQSLS5iZ3MucHJvdG9jb2wuZnJp",
            "ZW5kcy52MS5HZW5lcmljRnJpZW5kUmVxdWVzdBouLmJncy5wcm90b2NvbC5m",
            "cmllbmRzLnYxLkdlbmVyaWNGcmllbmRSZXNwb25zZRJoCgtWaWV3RnJpZW5k",
            "cxIrLmJncy5wcm90b2NvbC5mcmllbmRzLnYxLlZpZXdGcmllbmRzUmVxdWVz",
            "dBosLmJncy5wcm90b2NvbC5mcmllbmRzLnYxLlZpZXdGcmllbmRzUmVzcG9u",
            "c2USXAoRVXBkYXRlRnJpZW5kU3RhdGUSMS5iZ3MucHJvdG9jb2wuZnJpZW5k",
            "cy52MS5VcGRhdGVGcmllbmRTdGF0ZVJlcXVlc3QaFC5iZ3MucHJvdG9jb2wu",
            "Tm9EYXRhElAKC1Vuc3Vic2NyaWJlEisuYmdzLnByb3RvY29sLmZyaWVuZHMu",
            "djEuVW5zdWJzY3JpYmVSZXF1ZXN0GhQuYmdzLnByb3RvY29sLk5vRGF0YRJb",
            "ChRSZXZva2VBbGxJbnZpdGF0aW9ucxItLmJncy5wcm90b2NvbC5mcmllbmRz",
            "LnYxLkdlbmVyaWNGcmllbmRSZXF1ZXN0GhQuYmdzLnByb3RvY29sLk5vRGF0",
            "YTLZBQoPRnJpZW5kc0xpc3RlbmVyElcKDU9uRnJpZW5kQWRkZWQSKy5iZ3Mu",
            "cHJvdG9jb2wuZnJpZW5kcy52MS5GcmllbmROb3RpZmljYXRpb24aGS5iZ3Mu",
            "cHJvdG9jb2wuTk9fUkVTUE9OU0USWQoPT25GcmllbmRSZW1vdmVkEisuYmdz",
            "LnByb3RvY29sLmZyaWVuZHMudjEuRnJpZW5kTm90aWZpY2F0aW9uGhkuYmdz",
            "LnByb3RvY29sLk5PX1JFU1BPTlNFEmcKGU9uUmVjZWl2ZWRJbnZpdGF0aW9u",
            "QWRkZWQSLy5iZ3MucHJvdG9jb2wuZnJpZW5kcy52MS5JbnZpdGF0aW9uTm90",
            "aWZpY2F0aW9uGhkuYmdzLnByb3RvY29sLk5PX1JFU1BPTlNFEmkKG09uUmVj",
            "ZWl2ZWRJbnZpdGF0aW9uUmVtb3ZlZBIvLmJncy5wcm90b2NvbC5mcmllbmRz",
            "LnYxLkludml0YXRpb25Ob3RpZmljYXRpb24aGS5iZ3MucHJvdG9jb2wuTk9f",
            "UkVTUE9OU0USaAoVT25TZW50SW52aXRhdGlvbkFkZGVkEi8uYmdzLnByb3Rv",
            "Y29sLmZyaWVuZHMudjEuSW52aXRhdGlvbk5vdGlmaWNhdGlvbhoZLmJncy5w",
            "cm90b2NvbC5OT19SRVNQT05TRSIDiAIBEmoKF09uU2VudEludml0YXRpb25S",
            "ZW1vdmVkEi8uYmdzLnByb3RvY29sLmZyaWVuZHMudjEuSW52aXRhdGlvbk5v",
            "dGlmaWNhdGlvbhoZLmJncy5wcm90b2NvbC5OT19SRVNQT05TRSIDiAIBEmgK",
            "E09uVXBkYXRlRnJpZW5kU3RhdGUSNi5iZ3MucHJvdG9jb2wuZnJpZW5kcy52",
            "MS5VcGRhdGVGcmllbmRTdGF0ZU5vdGlmaWNhdGlvbhoZLmJncy5wcm90b2Nv",
            "bC5OT19SRVNQT05TRUI3ChhibmV0LnByb3RvY29sLmZyaWVuZHMudjFCE0Zy",
            "aWVuZHNTZXJ2aWNlUHJvdG9IAoABAIgBAWIGcHJvdG8z"));
      descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData,
          new pbr::FileDescriptor[] { Bgs.Protocol.AttributeTypesReflection.Descriptor, Bgs.Protocol.EntityTypesReflection.Descriptor, Bgs.Protocol.Friends.V1.FriendsTypesReflection.Descriptor, Bgs.Protocol.InvitationTypesReflection.Descriptor, Bgs.Protocol.RoleTypesReflection.Descriptor, Bgs.Protocol.RpcTypesReflection.Descriptor, },
          new pbr::GeneratedClrTypeInfo(null, new pbr::GeneratedClrTypeInfo[] {
            new pbr::GeneratedClrTypeInfo(typeof(Bgs.Protocol.Friends.V1.SubscribeRequest), Bgs.Protocol.Friends.V1.SubscribeRequest.Parser, new[]{ "AgentId", "ObjectId" }, null, null, null),
            new pbr::GeneratedClrTypeInfo(typeof(Bgs.Protocol.Friends.V1.SubscribeResponse), Bgs.Protocol.Friends.V1.SubscribeResponse.Parser, new[]{ "MaxFriends", "MaxReceivedInvitations", "MaxSentInvitations", "Role", "Friends", "SentInvitations", "ReceivedInvitations" }, null, null, null),
            new pbr::GeneratedClrTypeInfo(typeof(Bgs.Protocol.Friends.V1.UnsubscribeRequest), Bgs.Protocol.Friends.V1.UnsubscribeRequest.Parser, new[]{ "AgentId", "ObjectId" }, null, null, null),
            new pbr::GeneratedClrTypeInfo(typeof(Bgs.Protocol.Friends.V1.GenericFriendRequest), Bgs.Protocol.Friends.V1.GenericFriendRequest.Parser, new[]{ "AgentId", "TargetId" }, null, null, null),
            new pbr::GeneratedClrTypeInfo(typeof(Bgs.Protocol.Friends.V1.GenericFriendResponse), Bgs.Protocol.Friends.V1.GenericFriendResponse.Parser, new[]{ "TargetFriend" }, null, null, null),
            new pbr::GeneratedClrTypeInfo(typeof(Bgs.Protocol.Friends.V1.AssignRoleRequest), Bgs.Protocol.Friends.V1.AssignRoleRequest.Parser, new[]{ "AgentId", "TargetId", "Role" }, null, null, null),
            new pbr::GeneratedClrTypeInfo(typeof(Bgs.Protocol.Friends.V1.ViewFriendsRequest), Bgs.Protocol.Friends.V1.ViewFriendsRequest.Parser, new[]{ "AgentId", "TargetId", "Role" }, null, null, null),
            new pbr::GeneratedClrTypeInfo(typeof(Bgs.Protocol.Friends.V1.ViewFriendsResponse), Bgs.Protocol.Friends.V1.ViewFriendsResponse.Parser, new[]{ "Friends" }, null, null, null),
            new pbr::GeneratedClrTypeInfo(typeof(Bgs.Protocol.Friends.V1.UpdateFriendStateRequest), Bgs.Protocol.Friends.V1.UpdateFriendStateRequest.Parser, new[]{ "AgentId", "TargetId", "Attribute", "AttributesEpoch" }, null, null, null),
            new pbr::GeneratedClrTypeInfo(typeof(Bgs.Protocol.Friends.V1.FriendNotification), Bgs.Protocol.Friends.V1.FriendNotification.Parser, new[]{ "Target", "GameAccountId", "Peer", "AccountId" }, null, null, null),
            new pbr::GeneratedClrTypeInfo(typeof(Bgs.Protocol.Friends.V1.UpdateFriendStateNotification), Bgs.Protocol.Friends.V1.UpdateFriendStateNotification.Parser, new[]{ "ChangedFriend", "GameAccountId", "Peer", "AccountId" }, null, null, null),
            new pbr::GeneratedClrTypeInfo(typeof(Bgs.Protocol.Friends.V1.InvitationNotification), Bgs.Protocol.Friends.V1.InvitationNotification.Parser, new[]{ "Invitation", "GameAccountId", "Reason", "Peer", "AccountId" }, null, null, null)
          }));
    }
    #endregion

  }
  #region Messages
  [System.Diagnostics.DebuggerNonUserCodeAttribute()]
  public sealed partial class SubscribeRequest : pb::IMessage<SubscribeRequest> {
    private static readonly pb::MessageParser<SubscribeRequest> _parser = new pb::MessageParser<SubscribeRequest>(() => new SubscribeRequest());
    public static pb::MessageParser<SubscribeRequest> Parser { get { return _parser; } }

    public static pbr::MessageDescriptor Descriptor {
      get { return Bgs.Protocol.Friends.V1.FriendsServiceReflection.Descriptor.MessageTypes[0]; }
    }

    pbr::MessageDescriptor pb::IMessage.Descriptor {
      get { return Descriptor; }
    }

    public SubscribeRequest() {
      OnConstruction();
    }

    partial void OnConstruction();

    public SubscribeRequest(SubscribeRequest other) : this() {
      AgentId = other.agentId_ != null ? other.AgentId.Clone() : null;
      objectId_ = other.objectId_;
    }

    public SubscribeRequest Clone() {
      return new SubscribeRequest(this);
    }

    /// <summary>Field number for the "agent_id" field.</summary>
    public const int AgentIdFieldNumber = 1;
    private Bgs.Protocol.EntityId agentId_;
    public Bgs.Protocol.EntityId AgentId {
      get { return agentId_; }
      set {
        agentId_ = value;
      }
    }

    /// <summary>Field number for the "object_id" field.</summary>
    public const int ObjectIdFieldNumber = 2;
    private ulong objectId_;
    public ulong ObjectId {
      get { return objectId_; }
      set {
        objectId_ = value;
      }
    }

    public override bool Equals(object other) {
      return Equals(other as SubscribeRequest);
    }

    public bool Equals(SubscribeRequest other) {
      if (ReferenceEquals(other, null)) {
        return false;
      }
      if (ReferenceEquals(other, this)) {
        return true;
      }
      if (!object.Equals(AgentId, other.AgentId)) return false;
      if (ObjectId != other.ObjectId) return false;
      return true;
    }

    public override int GetHashCode() {
      int hash = 1;
      if (agentId_ != null) hash ^= AgentId.GetHashCode();
      if (ObjectId != 0UL) hash ^= ObjectId.GetHashCode();
      return hash;
    }

    public override string ToString() {
      return pb::JsonFormatter.ToDiagnosticString(this);
    }

    public void WriteTo(pb::CodedOutputStream output) {
      if (agentId_ != null) {
        output.WriteRawTag(10);
        output.WriteMessage(AgentId);
      }
      if (ObjectId != 0UL) {
        output.WriteRawTag(16);
        output.WriteUInt64(ObjectId);
      }
    }

    public int CalculateSize() {
      int size = 0;
      if (agentId_ != null) {
        size += 1 + pb::CodedOutputStream.ComputeMessageSize(AgentId);
      }
      if (ObjectId != 0UL) {
        size += 1 + pb::CodedOutputStream.ComputeUInt64Size(ObjectId);
      }
      return size;
    }

    public void MergeFrom(SubscribeRequest other) {
      if (other == null) {
        return;
      }
      if (other.agentId_ != null) {
        if (agentId_ == null) {
          agentId_ = new Bgs.Protocol.EntityId();
        }
        AgentId.MergeFrom(other.AgentId);
      }
      if (other.ObjectId != 0UL) {
        ObjectId = other.ObjectId;
      }
    }

    public void MergeFrom(pb::CodedInputStream input) {
      uint tag;
      while ((tag = input.ReadTag()) != 0) {
        switch(tag) {
          default:
            input.SkipLastField();
            break;
          case 10: {
            if (agentId_ == null) {
              agentId_ = new Bgs.Protocol.EntityId();
            }
            input.ReadMessage(agentId_);
            break;
          }
          case 16: {
            ObjectId = input.ReadUInt64();
            break;
          }
        }
      }
    }

  }

  [System.Diagnostics.DebuggerNonUserCodeAttribute()]
  public sealed partial class SubscribeResponse : pb::IMessage<SubscribeResponse> {
    private static readonly pb::MessageParser<SubscribeResponse> _parser = new pb::MessageParser<SubscribeResponse>(() => new SubscribeResponse());
    public static pb::MessageParser<SubscribeResponse> Parser { get { return _parser; } }

    public static pbr::MessageDescriptor Descriptor {
      get { return Bgs.Protocol.Friends.V1.FriendsServiceReflection.Descriptor.MessageTypes[1]; }
    }

    pbr::MessageDescriptor pb::IMessage.Descriptor {
      get { return Descriptor; }
    }

    public SubscribeResponse() {
      OnConstruction();
    }

    partial void OnConstruction();

    public SubscribeResponse(SubscribeResponse other) : this() {
      maxFriends_ = other.maxFriends_;
      maxReceivedInvitations_ = other.maxReceivedInvitations_;
      maxSentInvitations_ = other.maxSentInvitations_;
      role_ = other.role_.Clone();
      friends_ = other.friends_.Clone();
      sentInvitations_ = other.sentInvitations_.Clone();
      receivedInvitations_ = other.receivedInvitations_.Clone();
    }

    public SubscribeResponse Clone() {
      return new SubscribeResponse(this);
    }

    /// <summary>Field number for the "max_friends" field.</summary>
    public const int MaxFriendsFieldNumber = 1;
    private uint maxFriends_;
    public uint MaxFriends {
      get { return maxFriends_; }
      set {
        maxFriends_ = value;
      }
    }

    /// <summary>Field number for the "max_received_invitations" field.</summary>
    public const int MaxReceivedInvitationsFieldNumber = 2;
    private uint maxReceivedInvitations_;
    public uint MaxReceivedInvitations {
      get { return maxReceivedInvitations_; }
      set {
        maxReceivedInvitations_ = value;
      }
    }

    /// <summary>Field number for the "max_sent_invitations" field.</summary>
    public const int MaxSentInvitationsFieldNumber = 3;
    private uint maxSentInvitations_;
    public uint MaxSentInvitations {
      get { return maxSentInvitations_; }
      set {
        maxSentInvitations_ = value;
      }
    }

    /// <summary>Field number for the "role" field.</summary>
    public const int RoleFieldNumber = 4;
    private static readonly pb::FieldCodec<Bgs.Protocol.Role> _repeated_role_codec
        = pb::FieldCodec.ForMessage(34, Bgs.Protocol.Role.Parser);
    private readonly pbc::RepeatedField<Bgs.Protocol.Role> role_ = new pbc::RepeatedField<Bgs.Protocol.Role>();
    public pbc::RepeatedField<Bgs.Protocol.Role> Role {
      get { return role_; }
    }

    /// <summary>Field number for the "friends" field.</summary>
    public const int FriendsFieldNumber = 5;
    private static readonly pb::FieldCodec<Bgs.Protocol.Friends.V1.Friend> _repeated_friends_codec
        = pb::FieldCodec.ForMessage(42, Bgs.Protocol.Friends.V1.Friend.Parser);
    private readonly pbc::RepeatedField<Bgs.Protocol.Friends.V1.Friend> friends_ = new pbc::RepeatedField<Bgs.Protocol.Friends.V1.Friend>();
    public pbc::RepeatedField<Bgs.Protocol.Friends.V1.Friend> Friends {
      get { return friends_; }
    }

    /// <summary>Field number for the "sent_invitations" field.</summary>
    public const int SentInvitationsFieldNumber = 6;
    private static readonly pb::FieldCodec<Bgs.Protocol.Invitation> _repeated_sentInvitations_codec
        = pb::FieldCodec.ForMessage(50, Bgs.Protocol.Invitation.Parser);
    private readonly pbc::RepeatedField<Bgs.Protocol.Invitation> sentInvitations_ = new pbc::RepeatedField<Bgs.Protocol.Invitation>();
    public pbc::RepeatedField<Bgs.Protocol.Invitation> SentInvitations {
      get { return sentInvitations_; }
    }

    /// <summary>Field number for the "received_invitations" field.</summary>
    public const int ReceivedInvitationsFieldNumber = 7;
    private static readonly pb::FieldCodec<Bgs.Protocol.Invitation> _repeated_receivedInvitations_codec
        = pb::FieldCodec.ForMessage(58, Bgs.Protocol.Invitation.Parser);
    private readonly pbc::RepeatedField<Bgs.Protocol.Invitation> receivedInvitations_ = new pbc::RepeatedField<Bgs.Protocol.Invitation>();
    public pbc::RepeatedField<Bgs.Protocol.Invitation> ReceivedInvitations {
      get { return receivedInvitations_; }
    }

    public override bool Equals(object other) {
      return Equals(other as SubscribeResponse);
    }

    public bool Equals(SubscribeResponse other) {
      if (ReferenceEquals(other, null)) {
        return false;
      }
      if (ReferenceEquals(other, this)) {
        return true;
      }
      if (MaxFriends != other.MaxFriends) return false;
      if (MaxReceivedInvitations != other.MaxReceivedInvitations) return false;
      if (MaxSentInvitations != other.MaxSentInvitations) return false;
      if(!role_.Equals(other.role_)) return false;
      if(!friends_.Equals(other.friends_)) return false;
      if(!sentInvitations_.Equals(other.sentInvitations_)) return false;
      if(!receivedInvitations_.Equals(other.receivedInvitations_)) return false;
      return true;
    }

    public override int GetHashCode() {
      int hash = 1;
      if (MaxFriends != 0) hash ^= MaxFriends.GetHashCode();
      if (MaxReceivedInvitations != 0) hash ^= MaxReceivedInvitations.GetHashCode();
      if (MaxSentInvitations != 0) hash ^= MaxSentInvitations.GetHashCode();
      hash ^= role_.GetHashCode();
      hash ^= friends_.GetHashCode();
      hash ^= sentInvitations_.GetHashCode();
      hash ^= receivedInvitations_.GetHashCode();
      return hash;
    }

    public override string ToString() {
      return pb::JsonFormatter.ToDiagnosticString(this);
    }

    public void WriteTo(pb::CodedOutputStream output) {
      if (MaxFriends != 0) {
        output.WriteRawTag(8);
        output.WriteUInt32(MaxFriends);
      }
      if (MaxReceivedInvitations != 0) {
        output.WriteRawTag(16);
        output.WriteUInt32(MaxReceivedInvitations);
      }
      if (MaxSentInvitations != 0) {
        output.WriteRawTag(24);
        output.WriteUInt32(MaxSentInvitations);
      }
      role_.WriteTo(output, _repeated_role_codec);
      friends_.WriteTo(output, _repeated_friends_codec);
      sentInvitations_.WriteTo(output, _repeated_sentInvitations_codec);
      receivedInvitations_.WriteTo(output, _repeated_receivedInvitations_codec);
    }

    public int CalculateSize() {
      int size = 0;
      if (MaxFriends != 0) {
        size += 1 + pb::CodedOutputStream.ComputeUInt32Size(MaxFriends);
      }
      if (MaxReceivedInvitations != 0) {
        size += 1 + pb::CodedOutputStream.ComputeUInt32Size(MaxReceivedInvitations);
      }
      if (MaxSentInvitations != 0) {
        size += 1 + pb::CodedOutputStream.ComputeUInt32Size(MaxSentInvitations);
      }
      size += role_.CalculateSize(_repeated_role_codec);
      size += friends_.CalculateSize(_repeated_friends_codec);
      size += sentInvitations_.CalculateSize(_repeated_sentInvitations_codec);
      size += receivedInvitations_.CalculateSize(_repeated_receivedInvitations_codec);
      return size;
    }

    public void MergeFrom(SubscribeResponse other) {
      if (other == null) {
        return;
      }
      if (other.MaxFriends != 0) {
        MaxFriends = other.MaxFriends;
      }
      if (other.MaxReceivedInvitations != 0) {
        MaxReceivedInvitations = other.MaxReceivedInvitations;
      }
      if (other.MaxSentInvitations != 0) {
        MaxSentInvitations = other.MaxSentInvitations;
      }
      role_.Add(other.role_);
      friends_.Add(other.friends_);
      sentInvitations_.Add(other.sentInvitations_);
      receivedInvitations_.Add(other.receivedInvitations_);
    }

    public void MergeFrom(pb::CodedInputStream input) {
      uint tag;
      while ((tag = input.ReadTag()) != 0) {
        switch(tag) {
          default:
            input.SkipLastField();
            break;
          case 8: {
            MaxFriends = input.ReadUInt32();
            break;
          }
          case 16: {
            MaxReceivedInvitations = input.ReadUInt32();
            break;
          }
          case 24: {
            MaxSentInvitations = input.ReadUInt32();
            break;
          }
          case 34: {
            role_.AddEntriesFrom(input, _repeated_role_codec);
            break;
          }
          case 42: {
            friends_.AddEntriesFrom(input, _repeated_friends_codec);
            break;
          }
          case 50: {
            sentInvitations_.AddEntriesFrom(input, _repeated_sentInvitations_codec);
            break;
          }
          case 58: {
            receivedInvitations_.AddEntriesFrom(input, _repeated_receivedInvitations_codec);
            break;
          }
        }
      }
    }

  }

  [System.Diagnostics.DebuggerNonUserCodeAttribute()]
  public sealed partial class UnsubscribeRequest : pb::IMessage<UnsubscribeRequest> {
    private static readonly pb::MessageParser<UnsubscribeRequest> _parser = new pb::MessageParser<UnsubscribeRequest>(() => new UnsubscribeRequest());
    public static pb::MessageParser<UnsubscribeRequest> Parser { get { return _parser; } }

    public static pbr::MessageDescriptor Descriptor {
      get { return Bgs.Protocol.Friends.V1.FriendsServiceReflection.Descriptor.MessageTypes[2]; }
    }

    pbr::MessageDescriptor pb::IMessage.Descriptor {
      get { return Descriptor; }
    }

    public UnsubscribeRequest() {
      OnConstruction();
    }

    partial void OnConstruction();

    public UnsubscribeRequest(UnsubscribeRequest other) : this() {
      AgentId = other.agentId_ != null ? other.AgentId.Clone() : null;
      objectId_ = other.objectId_;
    }

    public UnsubscribeRequest Clone() {
      return new UnsubscribeRequest(this);
    }

    /// <summary>Field number for the "agent_id" field.</summary>
    public const int AgentIdFieldNumber = 1;
    private Bgs.Protocol.EntityId agentId_;
    public Bgs.Protocol.EntityId AgentId {
      get { return agentId_; }
      set {
        agentId_ = value;
      }
    }

    /// <summary>Field number for the "object_id" field.</summary>
    public const int ObjectIdFieldNumber = 2;
    private ulong objectId_;
    public ulong ObjectId {
      get { return objectId_; }
      set {
        objectId_ = value;
      }
    }

    public override bool Equals(object other) {
      return Equals(other as UnsubscribeRequest);
    }

    public bool Equals(UnsubscribeRequest other) {
      if (ReferenceEquals(other, null)) {
        return false;
      }
      if (ReferenceEquals(other, this)) {
        return true;
      }
      if (!object.Equals(AgentId, other.AgentId)) return false;
      if (ObjectId != other.ObjectId) return false;
      return true;
    }

    public override int GetHashCode() {
      int hash = 1;
      if (agentId_ != null) hash ^= AgentId.GetHashCode();
      if (ObjectId != 0UL) hash ^= ObjectId.GetHashCode();
      return hash;
    }

    public override string ToString() {
      return pb::JsonFormatter.ToDiagnosticString(this);
    }

    public void WriteTo(pb::CodedOutputStream output) {
      if (agentId_ != null) {
        output.WriteRawTag(10);
        output.WriteMessage(AgentId);
      }
      if (ObjectId != 0UL) {
        output.WriteRawTag(16);
        output.WriteUInt64(ObjectId);
      }
    }

    public int CalculateSize() {
      int size = 0;
      if (agentId_ != null) {
        size += 1 + pb::CodedOutputStream.ComputeMessageSize(AgentId);
      }
      if (ObjectId != 0UL) {
        size += 1 + pb::CodedOutputStream.ComputeUInt64Size(ObjectId);
      }
      return size;
    }

    public void MergeFrom(UnsubscribeRequest other) {
      if (other == null) {
        return;
      }
      if (other.agentId_ != null) {
        if (agentId_ == null) {
          agentId_ = new Bgs.Protocol.EntityId();
        }
        AgentId.MergeFrom(other.AgentId);
      }
      if (other.ObjectId != 0UL) {
        ObjectId = other.ObjectId;
      }
    }

    public void MergeFrom(pb::CodedInputStream input) {
      uint tag;
      while ((tag = input.ReadTag()) != 0) {
        switch(tag) {
          default:
            input.SkipLastField();
            break;
          case 10: {
            if (agentId_ == null) {
              agentId_ = new Bgs.Protocol.EntityId();
            }
            input.ReadMessage(agentId_);
            break;
          }
          case 16: {
            ObjectId = input.ReadUInt64();
            break;
          }
        }
      }
    }

  }

  [System.Diagnostics.DebuggerNonUserCodeAttribute()]
  public sealed partial class GenericFriendRequest : pb::IMessage<GenericFriendRequest> {
    private static readonly pb::MessageParser<GenericFriendRequest> _parser = new pb::MessageParser<GenericFriendRequest>(() => new GenericFriendRequest());
    public static pb::MessageParser<GenericFriendRequest> Parser { get { return _parser; } }

    public static pbr::MessageDescriptor Descriptor {
      get { return Bgs.Protocol.Friends.V1.FriendsServiceReflection.Descriptor.MessageTypes[3]; }
    }

    pbr::MessageDescriptor pb::IMessage.Descriptor {
      get { return Descriptor; }
    }

    public GenericFriendRequest() {
      OnConstruction();
    }

    partial void OnConstruction();

    public GenericFriendRequest(GenericFriendRequest other) : this() {
      AgentId = other.agentId_ != null ? other.AgentId.Clone() : null;
      TargetId = other.targetId_ != null ? other.TargetId.Clone() : null;
    }

    public GenericFriendRequest Clone() {
      return new GenericFriendRequest(this);
    }

    /// <summary>Field number for the "agent_id" field.</summary>
    public const int AgentIdFieldNumber = 1;
    private Bgs.Protocol.EntityId agentId_;
    public Bgs.Protocol.EntityId AgentId {
      get { return agentId_; }
      set {
        agentId_ = value;
      }
    }

    /// <summary>Field number for the "target_id" field.</summary>
    public const int TargetIdFieldNumber = 2;
    private Bgs.Protocol.EntityId targetId_;
    public Bgs.Protocol.EntityId TargetId {
      get { return targetId_; }
      set {
        targetId_ = value;
      }
    }

    public override bool Equals(object other) {
      return Equals(other as GenericFriendRequest);
    }

    public bool Equals(GenericFriendRequest other) {
      if (ReferenceEquals(other, null)) {
        return false;
      }
      if (ReferenceEquals(other, this)) {
        return true;
      }
      if (!object.Equals(AgentId, other.AgentId)) return false;
      if (!object.Equals(TargetId, other.TargetId)) return false;
      return true;
    }

    public override int GetHashCode() {
      int hash = 1;
      if (agentId_ != null) hash ^= AgentId.GetHashCode();
      if (targetId_ != null) hash ^= TargetId.GetHashCode();
      return hash;
    }

    public override string ToString() {
      return pb::JsonFormatter.ToDiagnosticString(this);
    }

    public void WriteTo(pb::CodedOutputStream output) {
      if (agentId_ != null) {
        output.WriteRawTag(10);
        output.WriteMessage(AgentId);
      }
      if (targetId_ != null) {
        output.WriteRawTag(18);
        output.WriteMessage(TargetId);
      }
    }

    public int CalculateSize() {
      int size = 0;
      if (agentId_ != null) {
        size += 1 + pb::CodedOutputStream.ComputeMessageSize(AgentId);
      }
      if (targetId_ != null) {
        size += 1 + pb::CodedOutputStream.ComputeMessageSize(TargetId);
      }
      return size;
    }

    public void MergeFrom(GenericFriendRequest other) {
      if (other == null) {
        return;
      }
      if (other.agentId_ != null) {
        if (agentId_ == null) {
          agentId_ = new Bgs.Protocol.EntityId();
        }
        AgentId.MergeFrom(other.AgentId);
      }
      if (other.targetId_ != null) {
        if (targetId_ == null) {
          targetId_ = new Bgs.Protocol.EntityId();
        }
        TargetId.MergeFrom(other.TargetId);
      }
    }

    public void MergeFrom(pb::CodedInputStream input) {
      uint tag;
      while ((tag = input.ReadTag()) != 0) {
        switch(tag) {
          default:
            input.SkipLastField();
            break;
          case 10: {
            if (agentId_ == null) {
              agentId_ = new Bgs.Protocol.EntityId();
            }
            input.ReadMessage(agentId_);
            break;
          }
          case 18: {
            if (targetId_ == null) {
              targetId_ = new Bgs.Protocol.EntityId();
            }
            input.ReadMessage(targetId_);
            break;
          }
        }
      }
    }

  }

  [System.Diagnostics.DebuggerNonUserCodeAttribute()]
  public sealed partial class GenericFriendResponse : pb::IMessage<GenericFriendResponse> {
    private static readonly pb::MessageParser<GenericFriendResponse> _parser = new pb::MessageParser<GenericFriendResponse>(() => new GenericFriendResponse());
    public static pb::MessageParser<GenericFriendResponse> Parser { get { return _parser; } }

    public static pbr::MessageDescriptor Descriptor {
      get { return Bgs.Protocol.Friends.V1.FriendsServiceReflection.Descriptor.MessageTypes[4]; }
    }

    pbr::MessageDescriptor pb::IMessage.Descriptor {
      get { return Descriptor; }
    }

    public GenericFriendResponse() {
      OnConstruction();
    }

    partial void OnConstruction();

    public GenericFriendResponse(GenericFriendResponse other) : this() {
      TargetFriend = other.targetFriend_ != null ? other.TargetFriend.Clone() : null;
    }

    public GenericFriendResponse Clone() {
      return new GenericFriendResponse(this);
    }

    /// <summary>Field number for the "target_friend" field.</summary>
    public const int TargetFriendFieldNumber = 1;
    private Bgs.Protocol.Friends.V1.Friend targetFriend_;
    public Bgs.Protocol.Friends.V1.Friend TargetFriend {
      get { return targetFriend_; }
      set {
        targetFriend_ = value;
      }
    }

    public override bool Equals(object other) {
      return Equals(other as GenericFriendResponse);
    }

    public bool Equals(GenericFriendResponse other) {
      if (ReferenceEquals(other, null)) {
        return false;
      }
      if (ReferenceEquals(other, this)) {
        return true;
      }
      if (!object.Equals(TargetFriend, other.TargetFriend)) return false;
      return true;
    }

    public override int GetHashCode() {
      int hash = 1;
      if (targetFriend_ != null) hash ^= TargetFriend.GetHashCode();
      return hash;
    }

    public override string ToString() {
      return pb::JsonFormatter.ToDiagnosticString(this);
    }

    public void WriteTo(pb::CodedOutputStream output) {
      if (targetFriend_ != null) {
        output.WriteRawTag(10);
        output.WriteMessage(TargetFriend);
      }
    }

    public int CalculateSize() {
      int size = 0;
      if (targetFriend_ != null) {
        size += 1 + pb::CodedOutputStream.ComputeMessageSize(TargetFriend);
      }
      return size;
    }

    public void MergeFrom(GenericFriendResponse other) {
      if (other == null) {
        return;
      }
      if (other.targetFriend_ != null) {
        if (targetFriend_ == null) {
          targetFriend_ = new Bgs.Protocol.Friends.V1.Friend();
        }
        TargetFriend.MergeFrom(other.TargetFriend);
      }
    }

    public void MergeFrom(pb::CodedInputStream input) {
      uint tag;
      while ((tag = input.ReadTag()) != 0) {
        switch(tag) {
          default:
            input.SkipLastField();
            break;
          case 10: {
            if (targetFriend_ == null) {
              targetFriend_ = new Bgs.Protocol.Friends.V1.Friend();
            }
            input.ReadMessage(targetFriend_);
            break;
          }
        }
      }
    }

  }

  [System.Diagnostics.DebuggerNonUserCodeAttribute()]
  public sealed partial class AssignRoleRequest : pb::IMessage<AssignRoleRequest> {
    private static readonly pb::MessageParser<AssignRoleRequest> _parser = new pb::MessageParser<AssignRoleRequest>(() => new AssignRoleRequest());
    public static pb::MessageParser<AssignRoleRequest> Parser { get { return _parser; } }

    public static pbr::MessageDescriptor Descriptor {
      get { return Bgs.Protocol.Friends.V1.FriendsServiceReflection.Descriptor.MessageTypes[5]; }
    }

    pbr::MessageDescriptor pb::IMessage.Descriptor {
      get { return Descriptor; }
    }

    public AssignRoleRequest() {
      OnConstruction();
    }

    partial void OnConstruction();

    public AssignRoleRequest(AssignRoleRequest other) : this() {
      AgentId = other.agentId_ != null ? other.AgentId.Clone() : null;
      TargetId = other.targetId_ != null ? other.TargetId.Clone() : null;
      role_ = other.role_.Clone();
    }

    public AssignRoleRequest Clone() {
      return new AssignRoleRequest(this);
    }

    /// <summary>Field number for the "agent_id" field.</summary>
    public const int AgentIdFieldNumber = 1;
    private Bgs.Protocol.EntityId agentId_;
    public Bgs.Protocol.EntityId AgentId {
      get { return agentId_; }
      set {
        agentId_ = value;
      }
    }

    /// <summary>Field number for the "target_id" field.</summary>
    public const int TargetIdFieldNumber = 2;
    private Bgs.Protocol.EntityId targetId_;
    public Bgs.Protocol.EntityId TargetId {
      get { return targetId_; }
      set {
        targetId_ = value;
      }
    }

    /// <summary>Field number for the "role" field.</summary>
    public const int RoleFieldNumber = 3;
    private static readonly pb::FieldCodec<int> _repeated_role_codec
        = pb::FieldCodec.ForInt32(26);
    private readonly pbc::RepeatedField<int> role_ = new pbc::RepeatedField<int>();
    public pbc::RepeatedField<int> Role {
      get { return role_; }
    }

    public override bool Equals(object other) {
      return Equals(other as AssignRoleRequest);
    }

    public bool Equals(AssignRoleRequest other) {
      if (ReferenceEquals(other, null)) {
        return false;
      }
      if (ReferenceEquals(other, this)) {
        return true;
      }
      if (!object.Equals(AgentId, other.AgentId)) return false;
      if (!object.Equals(TargetId, other.TargetId)) return false;
      if(!role_.Equals(other.role_)) return false;
      return true;
    }

    public override int GetHashCode() {
      int hash = 1;
      if (agentId_ != null) hash ^= AgentId.GetHashCode();
      if (targetId_ != null) hash ^= TargetId.GetHashCode();
      hash ^= role_.GetHashCode();
      return hash;
    }

    public override string ToString() {
      return pb::JsonFormatter.ToDiagnosticString(this);
    }

    public void WriteTo(pb::CodedOutputStream output) {
      if (agentId_ != null) {
        output.WriteRawTag(10);
        output.WriteMessage(AgentId);
      }
      if (targetId_ != null) {
        output.WriteRawTag(18);
        output.WriteMessage(TargetId);
      }
      role_.WriteTo(output, _repeated_role_codec);
    }

    public int CalculateSize() {
      int size = 0;
      if (agentId_ != null) {
        size += 1 + pb::CodedOutputStream.ComputeMessageSize(AgentId);
      }
      if (targetId_ != null) {
        size += 1 + pb::CodedOutputStream.ComputeMessageSize(TargetId);
      }
      size += role_.CalculateSize(_repeated_role_codec);
      return size;
    }

    public void MergeFrom(AssignRoleRequest other) {
      if (other == null) {
        return;
      }
      if (other.agentId_ != null) {
        if (agentId_ == null) {
          agentId_ = new Bgs.Protocol.EntityId();
        }
        AgentId.MergeFrom(other.AgentId);
      }
      if (other.targetId_ != null) {
        if (targetId_ == null) {
          targetId_ = new Bgs.Protocol.EntityId();
        }
        TargetId.MergeFrom(other.TargetId);
      }
      role_.Add(other.role_);
    }

    public void MergeFrom(pb::CodedInputStream input) {
      uint tag;
      while ((tag = input.ReadTag()) != 0) {
        switch(tag) {
          default:
            input.SkipLastField();
            break;
          case 10: {
            if (agentId_ == null) {
              agentId_ = new Bgs.Protocol.EntityId();
            }
            input.ReadMessage(agentId_);
            break;
          }
          case 18: {
            if (targetId_ == null) {
              targetId_ = new Bgs.Protocol.EntityId();
            }
            input.ReadMessage(targetId_);
            break;
          }
          case 26:
          case 24: {
            role_.AddEntriesFrom(input, _repeated_role_codec);
            break;
          }
        }
      }
    }

  }

  [System.Diagnostics.DebuggerNonUserCodeAttribute()]
  public sealed partial class ViewFriendsRequest : pb::IMessage<ViewFriendsRequest> {
    private static readonly pb::MessageParser<ViewFriendsRequest> _parser = new pb::MessageParser<ViewFriendsRequest>(() => new ViewFriendsRequest());
    public static pb::MessageParser<ViewFriendsRequest> Parser { get { return _parser; } }

    public static pbr::MessageDescriptor Descriptor {
      get { return Bgs.Protocol.Friends.V1.FriendsServiceReflection.Descriptor.MessageTypes[6]; }
    }

    pbr::MessageDescriptor pb::IMessage.Descriptor {
      get { return Descriptor; }
    }

    public ViewFriendsRequest() {
      OnConstruction();
    }

    partial void OnConstruction();

    public ViewFriendsRequest(ViewFriendsRequest other) : this() {
      AgentId = other.agentId_ != null ? other.AgentId.Clone() : null;
      TargetId = other.targetId_ != null ? other.TargetId.Clone() : null;
      role_ = other.role_.Clone();
    }

    public ViewFriendsRequest Clone() {
      return new ViewFriendsRequest(this);
    }

    /// <summary>Field number for the "agent_id" field.</summary>
    public const int AgentIdFieldNumber = 1;
    private Bgs.Protocol.EntityId agentId_;
    public Bgs.Protocol.EntityId AgentId {
      get { return agentId_; }
      set {
        agentId_ = value;
      }
    }

    /// <summary>Field number for the "target_id" field.</summary>
    public const int TargetIdFieldNumber = 2;
    private Bgs.Protocol.EntityId targetId_;
    public Bgs.Protocol.EntityId TargetId {
      get { return targetId_; }
      set {
        targetId_ = value;
      }
    }

    /// <summary>Field number for the "role" field.</summary>
    public const int RoleFieldNumber = 3;
    private static readonly pb::FieldCodec<uint> _repeated_role_codec
        = pb::FieldCodec.ForUInt32(26);
    private readonly pbc::RepeatedField<uint> role_ = new pbc::RepeatedField<uint>();
    public pbc::RepeatedField<uint> Role {
      get { return role_; }
    }

    public override bool Equals(object other) {
      return Equals(other as ViewFriendsRequest);
    }

    public bool Equals(ViewFriendsRequest other) {
      if (ReferenceEquals(other, null)) {
        return false;
      }
      if (ReferenceEquals(other, this)) {
        return true;
      }
      if (!object.Equals(AgentId, other.AgentId)) return false;
      if (!object.Equals(TargetId, other.TargetId)) return false;
      if(!role_.Equals(other.role_)) return false;
      return true;
    }

    public override int GetHashCode() {
      int hash = 1;
      if (agentId_ != null) hash ^= AgentId.GetHashCode();
      if (targetId_ != null) hash ^= TargetId.GetHashCode();
      hash ^= role_.GetHashCode();
      return hash;
    }

    public override string ToString() {
      return pb::JsonFormatter.ToDiagnosticString(this);
    }

    public void WriteTo(pb::CodedOutputStream output) {
      if (agentId_ != null) {
        output.WriteRawTag(10);
        output.WriteMessage(AgentId);
      }
      if (targetId_ != null) {
        output.WriteRawTag(18);
        output.WriteMessage(TargetId);
      }
      role_.WriteTo(output, _repeated_role_codec);
    }

    public int CalculateSize() {
      int size = 0;
      if (agentId_ != null) {
        size += 1 + pb::CodedOutputStream.ComputeMessageSize(AgentId);
      }
      if (targetId_ != null) {
        size += 1 + pb::CodedOutputStream.ComputeMessageSize(TargetId);
      }
      size += role_.CalculateSize(_repeated_role_codec);
      return size;
    }

    public void MergeFrom(ViewFriendsRequest other) {
      if (other == null) {
        return;
      }
      if (other.agentId_ != null) {
        if (agentId_ == null) {
          agentId_ = new Bgs.Protocol.EntityId();
        }
        AgentId.MergeFrom(other.AgentId);
      }
      if (other.targetId_ != null) {
        if (targetId_ == null) {
          targetId_ = new Bgs.Protocol.EntityId();
        }
        TargetId.MergeFrom(other.TargetId);
      }
      role_.Add(other.role_);
    }

    public void MergeFrom(pb::CodedInputStream input) {
      uint tag;
      while ((tag = input.ReadTag()) != 0) {
        switch(tag) {
          default:
            input.SkipLastField();
            break;
          case 10: {
            if (agentId_ == null) {
              agentId_ = new Bgs.Protocol.EntityId();
            }
            input.ReadMessage(agentId_);
            break;
          }
          case 18: {
            if (targetId_ == null) {
              targetId_ = new Bgs.Protocol.EntityId();
            }
            input.ReadMessage(targetId_);
            break;
          }
          case 26:
          case 24: {
            role_.AddEntriesFrom(input, _repeated_role_codec);
            break;
          }
        }
      }
    }

  }

  [System.Diagnostics.DebuggerNonUserCodeAttribute()]
  public sealed partial class ViewFriendsResponse : pb::IMessage<ViewFriendsResponse> {
    private static readonly pb::MessageParser<ViewFriendsResponse> _parser = new pb::MessageParser<ViewFriendsResponse>(() => new ViewFriendsResponse());
    public static pb::MessageParser<ViewFriendsResponse> Parser { get { return _parser; } }

    public static pbr::MessageDescriptor Descriptor {
      get { return Bgs.Protocol.Friends.V1.FriendsServiceReflection.Descriptor.MessageTypes[7]; }
    }

    pbr::MessageDescriptor pb::IMessage.Descriptor {
      get { return Descriptor; }
    }

    public ViewFriendsResponse() {
      OnConstruction();
    }

    partial void OnConstruction();

    public ViewFriendsResponse(ViewFriendsResponse other) : this() {
      friends_ = other.friends_.Clone();
    }

    public ViewFriendsResponse Clone() {
      return new ViewFriendsResponse(this);
    }

    /// <summary>Field number for the "friends" field.</summary>
    public const int FriendsFieldNumber = 1;
    private static readonly pb::FieldCodec<Bgs.Protocol.Friends.V1.Friend> _repeated_friends_codec
        = pb::FieldCodec.ForMessage(10, Bgs.Protocol.Friends.V1.Friend.Parser);
    private readonly pbc::RepeatedField<Bgs.Protocol.Friends.V1.Friend> friends_ = new pbc::RepeatedField<Bgs.Protocol.Friends.V1.Friend>();
    public pbc::RepeatedField<Bgs.Protocol.Friends.V1.Friend> Friends {
      get { return friends_; }
    }

    public override bool Equals(object other) {
      return Equals(other as ViewFriendsResponse);
    }

    public bool Equals(ViewFriendsResponse other) {
      if (ReferenceEquals(other, null)) {
        return false;
      }
      if (ReferenceEquals(other, this)) {
        return true;
      }
      if(!friends_.Equals(other.friends_)) return false;
      return true;
    }

    public override int GetHashCode() {
      int hash = 1;
      hash ^= friends_.GetHashCode();
      return hash;
    }

    public override string ToString() {
      return pb::JsonFormatter.ToDiagnosticString(this);
    }

    public void WriteTo(pb::CodedOutputStream output) {
      friends_.WriteTo(output, _repeated_friends_codec);
    }

    public int CalculateSize() {
      int size = 0;
      size += friends_.CalculateSize(_repeated_friends_codec);
      return size;
    }

    public void MergeFrom(ViewFriendsResponse other) {
      if (other == null) {
        return;
      }
      friends_.Add(other.friends_);
    }

    public void MergeFrom(pb::CodedInputStream input) {
      uint tag;
      while ((tag = input.ReadTag()) != 0) {
        switch(tag) {
          default:
            input.SkipLastField();
            break;
          case 10: {
            friends_.AddEntriesFrom(input, _repeated_friends_codec);
            break;
          }
        }
      }
    }

  }

  [System.Diagnostics.DebuggerNonUserCodeAttribute()]
  public sealed partial class UpdateFriendStateRequest : pb::IMessage<UpdateFriendStateRequest> {
    private static readonly pb::MessageParser<UpdateFriendStateRequest> _parser = new pb::MessageParser<UpdateFriendStateRequest>(() => new UpdateFriendStateRequest());
    public static pb::MessageParser<UpdateFriendStateRequest> Parser { get { return _parser; } }

    public static pbr::MessageDescriptor Descriptor {
      get { return Bgs.Protocol.Friends.V1.FriendsServiceReflection.Descriptor.MessageTypes[8]; }
    }

    pbr::MessageDescriptor pb::IMessage.Descriptor {
      get { return Descriptor; }
    }

    public UpdateFriendStateRequest() {
      OnConstruction();
    }

    partial void OnConstruction();

    public UpdateFriendStateRequest(UpdateFriendStateRequest other) : this() {
      AgentId = other.agentId_ != null ? other.AgentId.Clone() : null;
      TargetId = other.targetId_ != null ? other.TargetId.Clone() : null;
      attribute_ = other.attribute_.Clone();
      attributesEpoch_ = other.attributesEpoch_;
    }

    public UpdateFriendStateRequest Clone() {
      return new UpdateFriendStateRequest(this);
    }

    /// <summary>Field number for the "agent_id" field.</summary>
    public const int AgentIdFieldNumber = 1;
    private Bgs.Protocol.EntityId agentId_;
    public Bgs.Protocol.EntityId AgentId {
      get { return agentId_; }
      set {
        agentId_ = value;
      }
    }

    /// <summary>Field number for the "target_id" field.</summary>
    public const int TargetIdFieldNumber = 2;
    private Bgs.Protocol.EntityId targetId_;
    public Bgs.Protocol.EntityId TargetId {
      get { return targetId_; }
      set {
        targetId_ = value;
      }
    }

    /// <summary>Field number for the "attribute" field.</summary>
    public const int AttributeFieldNumber = 3;
    private static readonly pb::FieldCodec<Bgs.Protocol.Attribute> _repeated_attribute_codec
        = pb::FieldCodec.ForMessage(26, Bgs.Protocol.Attribute.Parser);
    private readonly pbc::RepeatedField<Bgs.Protocol.Attribute> attribute_ = new pbc::RepeatedField<Bgs.Protocol.Attribute>();
    public pbc::RepeatedField<Bgs.Protocol.Attribute> Attribute {
      get { return attribute_; }
    }

    /// <summary>Field number for the "attributes_epoch" field.</summary>
    public const int AttributesEpochFieldNumber = 4;
    private ulong attributesEpoch_;
    public ulong AttributesEpoch {
      get { return attributesEpoch_; }
      set {
        attributesEpoch_ = value;
      }
    }

    public override bool Equals(object other) {
      return Equals(other as UpdateFriendStateRequest);
    }

    public bool Equals(UpdateFriendStateRequest other) {
      if (ReferenceEquals(other, null)) {
        return false;
      }
      if (ReferenceEquals(other, this)) {
        return true;
      }
      if (!object.Equals(AgentId, other.AgentId)) return false;
      if (!object.Equals(TargetId, other.TargetId)) return false;
      if(!attribute_.Equals(other.attribute_)) return false;
      if (AttributesEpoch != other.AttributesEpoch) return false;
      return true;
    }

    public override int GetHashCode() {
      int hash = 1;
      if (agentId_ != null) hash ^= AgentId.GetHashCode();
      if (targetId_ != null) hash ^= TargetId.GetHashCode();
      hash ^= attribute_.GetHashCode();
      if (AttributesEpoch != 0UL) hash ^= AttributesEpoch.GetHashCode();
      return hash;
    }

    public override string ToString() {
      return pb::JsonFormatter.ToDiagnosticString(this);
    }

    public void WriteTo(pb::CodedOutputStream output) {
      if (agentId_ != null) {
        output.WriteRawTag(10);
        output.WriteMessage(AgentId);
      }
      if (targetId_ != null) {
        output.WriteRawTag(18);
        output.WriteMessage(TargetId);
      }
      attribute_.WriteTo(output, _repeated_attribute_codec);
      if (AttributesEpoch != 0UL) {
        output.WriteRawTag(32);
        output.WriteUInt64(AttributesEpoch);
      }
    }

    public int CalculateSize() {
      int size = 0;
      if (agentId_ != null) {
        size += 1 + pb::CodedOutputStream.ComputeMessageSize(AgentId);
      }
      if (targetId_ != null) {
        size += 1 + pb::CodedOutputStream.ComputeMessageSize(TargetId);
      }
      size += attribute_.CalculateSize(_repeated_attribute_codec);
      if (AttributesEpoch != 0UL) {
        size += 1 + pb::CodedOutputStream.ComputeUInt64Size(AttributesEpoch);
      }
      return size;
    }

    public void MergeFrom(UpdateFriendStateRequest other) {
      if (other == null) {
        return;
      }
      if (other.agentId_ != null) {
        if (agentId_ == null) {
          agentId_ = new Bgs.Protocol.EntityId();
        }
        AgentId.MergeFrom(other.AgentId);
      }
      if (other.targetId_ != null) {
        if (targetId_ == null) {
          targetId_ = new Bgs.Protocol.EntityId();
        }
        TargetId.MergeFrom(other.TargetId);
      }
      attribute_.Add(other.attribute_);
      if (other.AttributesEpoch != 0UL) {
        AttributesEpoch = other.AttributesEpoch;
      }
    }

    public void MergeFrom(pb::CodedInputStream input) {
      uint tag;
      while ((tag = input.ReadTag()) != 0) {
        switch(tag) {
          default:
            input.SkipLastField();
            break;
          case 10: {
            if (agentId_ == null) {
              agentId_ = new Bgs.Protocol.EntityId();
            }
            input.ReadMessage(agentId_);
            break;
          }
          case 18: {
            if (targetId_ == null) {
              targetId_ = new Bgs.Protocol.EntityId();
            }
            input.ReadMessage(targetId_);
            break;
          }
          case 26: {
            attribute_.AddEntriesFrom(input, _repeated_attribute_codec);
            break;
          }
          case 32: {
            AttributesEpoch = input.ReadUInt64();
            break;
          }
        }
      }
    }

  }

  [System.Diagnostics.DebuggerNonUserCodeAttribute()]
  public sealed partial class FriendNotification : pb::IMessage<FriendNotification> {
    private static readonly pb::MessageParser<FriendNotification> _parser = new pb::MessageParser<FriendNotification>(() => new FriendNotification());
    public static pb::MessageParser<FriendNotification> Parser { get { return _parser; } }

    public static pbr::MessageDescriptor Descriptor {
      get { return Bgs.Protocol.Friends.V1.FriendsServiceReflection.Descriptor.MessageTypes[9]; }
    }

    pbr::MessageDescriptor pb::IMessage.Descriptor {
      get { return Descriptor; }
    }

    public FriendNotification() {
      OnConstruction();
    }

    partial void OnConstruction();

    public FriendNotification(FriendNotification other) : this() {
      Target = other.target_ != null ? other.Target.Clone() : null;
      GameAccountId = other.gameAccountId_ != null ? other.GameAccountId.Clone() : null;
      Peer = other.peer_ != null ? other.Peer.Clone() : null;
      AccountId = other.accountId_ != null ? other.AccountId.Clone() : null;
    }

    public FriendNotification Clone() {
      return new FriendNotification(this);
    }

    /// <summary>Field number for the "target" field.</summary>
    public const int TargetFieldNumber = 1;
    private Bgs.Protocol.Friends.V1.Friend target_;
    public Bgs.Protocol.Friends.V1.Friend Target {
      get { return target_; }
      set {
        target_ = value;
      }
    }

    /// <summary>Field number for the "game_account_id" field.</summary>
    public const int GameAccountIdFieldNumber = 2;
    private Bgs.Protocol.EntityId gameAccountId_;
    public Bgs.Protocol.EntityId GameAccountId {
      get { return gameAccountId_; }
      set {
        gameAccountId_ = value;
      }
    }

    /// <summary>Field number for the "peer" field.</summary>
    public const int PeerFieldNumber = 4;
    private Bgs.Protocol.ProcessId peer_;
    public Bgs.Protocol.ProcessId Peer {
      get { return peer_; }
      set {
        peer_ = value;
      }
    }

    /// <summary>Field number for the "account_id" field.</summary>
    public const int AccountIdFieldNumber = 5;
    private Bgs.Protocol.EntityId accountId_;
    public Bgs.Protocol.EntityId AccountId {
      get { return accountId_; }
      set {
        accountId_ = value;
      }
    }

    public override bool Equals(object other) {
      return Equals(other as FriendNotification);
    }

    public bool Equals(FriendNotification other) {
      if (ReferenceEquals(other, null)) {
        return false;
      }
      if (ReferenceEquals(other, this)) {
        return true;
      }
      if (!object.Equals(Target, other.Target)) return false;
      if (!object.Equals(GameAccountId, other.GameAccountId)) return false;
      if (!object.Equals(Peer, other.Peer)) return false;
      if (!object.Equals(AccountId, other.AccountId)) return false;
      return true;
    }

    public override int GetHashCode() {
      int hash = 1;
      if (target_ != null) hash ^= Target.GetHashCode();
      if (gameAccountId_ != null) hash ^= GameAccountId.GetHashCode();
      if (peer_ != null) hash ^= Peer.GetHashCode();
      if (accountId_ != null) hash ^= AccountId.GetHashCode();
      return hash;
    }

    public override string ToString() {
      return pb::JsonFormatter.ToDiagnosticString(this);
    }

    public void WriteTo(pb::CodedOutputStream output) {
      if (target_ != null) {
        output.WriteRawTag(10);
        output.WriteMessage(Target);
      }
      if (gameAccountId_ != null) {
        output.WriteRawTag(18);
        output.WriteMessage(GameAccountId);
      }
      if (peer_ != null) {
        output.WriteRawTag(34);
        output.WriteMessage(Peer);
      }
      if (accountId_ != null) {
        output.WriteRawTag(42);
        output.WriteMessage(AccountId);
      }
    }

    public int CalculateSize() {
      int size = 0;
      if (target_ != null) {
        size += 1 + pb::CodedOutputStream.ComputeMessageSize(Target);
      }
      if (gameAccountId_ != null) {
        size += 1 + pb::CodedOutputStream.ComputeMessageSize(GameAccountId);
      }
      if (peer_ != null) {
        size += 1 + pb::CodedOutputStream.ComputeMessageSize(Peer);
      }
      if (accountId_ != null) {
        size += 1 + pb::CodedOutputStream.ComputeMessageSize(AccountId);
      }
      return size;
    }

    public void MergeFrom(FriendNotification other) {
      if (other == null) {
        return;
      }
      if (other.target_ != null) {
        if (target_ == null) {
          target_ = new Bgs.Protocol.Friends.V1.Friend();
        }
        Target.MergeFrom(other.Target);
      }
      if (other.gameAccountId_ != null) {
        if (gameAccountId_ == null) {
          gameAccountId_ = new Bgs.Protocol.EntityId();
        }
        GameAccountId.MergeFrom(other.GameAccountId);
      }
      if (other.peer_ != null) {
        if (peer_ == null) {
          peer_ = new Bgs.Protocol.ProcessId();
        }
        Peer.MergeFrom(other.Peer);
      }
      if (other.accountId_ != null) {
        if (accountId_ == null) {
          accountId_ = new Bgs.Protocol.EntityId();
        }
        AccountId.MergeFrom(other.AccountId);
      }
    }

    public void MergeFrom(pb::CodedInputStream input) {
      uint tag;
      while ((tag = input.ReadTag()) != 0) {
        switch(tag) {
          default:
            input.SkipLastField();
            break;
          case 10: {
            if (target_ == null) {
              target_ = new Bgs.Protocol.Friends.V1.Friend();
            }
            input.ReadMessage(target_);
            break;
          }
          case 18: {
            if (gameAccountId_ == null) {
              gameAccountId_ = new Bgs.Protocol.EntityId();
            }
            input.ReadMessage(gameAccountId_);
            break;
          }
          case 34: {
            if (peer_ == null) {
              peer_ = new Bgs.Protocol.ProcessId();
            }
            input.ReadMessage(peer_);
            break;
          }
          case 42: {
            if (accountId_ == null) {
              accountId_ = new Bgs.Protocol.EntityId();
            }
            input.ReadMessage(accountId_);
            break;
          }
        }
      }
    }

  }

  [System.Diagnostics.DebuggerNonUserCodeAttribute()]
  public sealed partial class UpdateFriendStateNotification : pb::IMessage<UpdateFriendStateNotification> {
    private static readonly pb::MessageParser<UpdateFriendStateNotification> _parser = new pb::MessageParser<UpdateFriendStateNotification>(() => new UpdateFriendStateNotification());
    public static pb::MessageParser<UpdateFriendStateNotification> Parser { get { return _parser; } }

    public static pbr::MessageDescriptor Descriptor {
      get { return Bgs.Protocol.Friends.V1.FriendsServiceReflection.Descriptor.MessageTypes[10]; }
    }

    pbr::MessageDescriptor pb::IMessage.Descriptor {
      get { return Descriptor; }
    }

    public UpdateFriendStateNotification() {
      OnConstruction();
    }

    partial void OnConstruction();

    public UpdateFriendStateNotification(UpdateFriendStateNotification other) : this() {
      ChangedFriend = other.changedFriend_ != null ? other.ChangedFriend.Clone() : null;
      GameAccountId = other.gameAccountId_ != null ? other.GameAccountId.Clone() : null;
      Peer = other.peer_ != null ? other.Peer.Clone() : null;
      AccountId = other.accountId_ != null ? other.AccountId.Clone() : null;
    }

    public UpdateFriendStateNotification Clone() {
      return new UpdateFriendStateNotification(this);
    }

    /// <summary>Field number for the "changed_friend" field.</summary>
    public const int ChangedFriendFieldNumber = 1;
    private Bgs.Protocol.Friends.V1.Friend changedFriend_;
    public Bgs.Protocol.Friends.V1.Friend ChangedFriend {
      get { return changedFriend_; }
      set {
        changedFriend_ = value;
      }
    }

    /// <summary>Field number for the "game_account_id" field.</summary>
    public const int GameAccountIdFieldNumber = 2;
    private Bgs.Protocol.EntityId gameAccountId_;
    public Bgs.Protocol.EntityId GameAccountId {
      get { return gameAccountId_; }
      set {
        gameAccountId_ = value;
      }
    }

    /// <summary>Field number for the "peer" field.</summary>
    public const int PeerFieldNumber = 4;
    private Bgs.Protocol.ProcessId peer_;
    public Bgs.Protocol.ProcessId Peer {
      get { return peer_; }
      set {
        peer_ = value;
      }
    }

    /// <summary>Field number for the "account_id" field.</summary>
    public const int AccountIdFieldNumber = 5;
    private Bgs.Protocol.EntityId accountId_;
    public Bgs.Protocol.EntityId AccountId {
      get { return accountId_; }
      set {
        accountId_ = value;
      }
    }

    public override bool Equals(object other) {
      return Equals(other as UpdateFriendStateNotification);
    }

    public bool Equals(UpdateFriendStateNotification other) {
      if (ReferenceEquals(other, null)) {
        return false;
      }
      if (ReferenceEquals(other, this)) {
        return true;
      }
      if (!object.Equals(ChangedFriend, other.ChangedFriend)) return false;
      if (!object.Equals(GameAccountId, other.GameAccountId)) return false;
      if (!object.Equals(Peer, other.Peer)) return false;
      if (!object.Equals(AccountId, other.AccountId)) return false;
      return true;
    }

    public override int GetHashCode() {
      int hash = 1;
      if (changedFriend_ != null) hash ^= ChangedFriend.GetHashCode();
      if (gameAccountId_ != null) hash ^= GameAccountId.GetHashCode();
      if (peer_ != null) hash ^= Peer.GetHashCode();
      if (accountId_ != null) hash ^= AccountId.GetHashCode();
      return hash;
    }

    public override string ToString() {
      return pb::JsonFormatter.ToDiagnosticString(this);
    }

    public void WriteTo(pb::CodedOutputStream output) {
      if (changedFriend_ != null) {
        output.WriteRawTag(10);
        output.WriteMessage(ChangedFriend);
      }
      if (gameAccountId_ != null) {
        output.WriteRawTag(18);
        output.WriteMessage(GameAccountId);
      }
      if (peer_ != null) {
        output.WriteRawTag(34);
        output.WriteMessage(Peer);
      }
      if (accountId_ != null) {
        output.WriteRawTag(42);
        output.WriteMessage(AccountId);
      }
    }

    public int CalculateSize() {
      int size = 0;
      if (changedFriend_ != null) {
        size += 1 + pb::CodedOutputStream.ComputeMessageSize(ChangedFriend);
      }
      if (gameAccountId_ != null) {
        size += 1 + pb::CodedOutputStream.ComputeMessageSize(GameAccountId);
      }
      if (peer_ != null) {
        size += 1 + pb::CodedOutputStream.ComputeMessageSize(Peer);
      }
      if (accountId_ != null) {
        size += 1 + pb::CodedOutputStream.ComputeMessageSize(AccountId);
      }
      return size;
    }

    public void MergeFrom(UpdateFriendStateNotification other) {
      if (other == null) {
        return;
      }
      if (other.changedFriend_ != null) {
        if (changedFriend_ == null) {
          changedFriend_ = new Bgs.Protocol.Friends.V1.Friend();
        }
        ChangedFriend.MergeFrom(other.ChangedFriend);
      }
      if (other.gameAccountId_ != null) {
        if (gameAccountId_ == null) {
          gameAccountId_ = new Bgs.Protocol.EntityId();
        }
        GameAccountId.MergeFrom(other.GameAccountId);
      }
      if (other.peer_ != null) {
        if (peer_ == null) {
          peer_ = new Bgs.Protocol.ProcessId();
        }
        Peer.MergeFrom(other.Peer);
      }
      if (other.accountId_ != null) {
        if (accountId_ == null) {
          accountId_ = new Bgs.Protocol.EntityId();
        }
        AccountId.MergeFrom(other.AccountId);
      }
    }

    public void MergeFrom(pb::CodedInputStream input) {
      uint tag;
      while ((tag = input.ReadTag()) != 0) {
        switch(tag) {
          default:
            input.SkipLastField();
            break;
          case 10: {
            if (changedFriend_ == null) {
              changedFriend_ = new Bgs.Protocol.Friends.V1.Friend();
            }
            input.ReadMessage(changedFriend_);
            break;
          }
          case 18: {
            if (gameAccountId_ == null) {
              gameAccountId_ = new Bgs.Protocol.EntityId();
            }
            input.ReadMessage(gameAccountId_);
            break;
          }
          case 34: {
            if (peer_ == null) {
              peer_ = new Bgs.Protocol.ProcessId();
            }
            input.ReadMessage(peer_);
            break;
          }
          case 42: {
            if (accountId_ == null) {
              accountId_ = new Bgs.Protocol.EntityId();
            }
            input.ReadMessage(accountId_);
            break;
          }
        }
      }
    }

  }

  [System.Diagnostics.DebuggerNonUserCodeAttribute()]
  public sealed partial class InvitationNotification : pb::IMessage<InvitationNotification> {
    private static readonly pb::MessageParser<InvitationNotification> _parser = new pb::MessageParser<InvitationNotification>(() => new InvitationNotification());
    public static pb::MessageParser<InvitationNotification> Parser { get { return _parser; } }

    public static pbr::MessageDescriptor Descriptor {
      get { return Bgs.Protocol.Friends.V1.FriendsServiceReflection.Descriptor.MessageTypes[11]; }
    }

    pbr::MessageDescriptor pb::IMessage.Descriptor {
      get { return Descriptor; }
    }

    public InvitationNotification() {
      OnConstruction();
    }

    partial void OnConstruction();

    public InvitationNotification(InvitationNotification other) : this() {
      Invitation = other.invitation_ != null ? other.Invitation.Clone() : null;
      GameAccountId = other.gameAccountId_ != null ? other.GameAccountId.Clone() : null;
      reason_ = other.reason_;
      Peer = other.peer_ != null ? other.Peer.Clone() : null;
      AccountId = other.accountId_ != null ? other.AccountId.Clone() : null;
    }

    public InvitationNotification Clone() {
      return new InvitationNotification(this);
    }

    /// <summary>Field number for the "invitation" field.</summary>
    public const int InvitationFieldNumber = 1;
    private Bgs.Protocol.Invitation invitation_;
    public Bgs.Protocol.Invitation Invitation {
      get { return invitation_; }
      set {
        invitation_ = value;
      }
    }

    /// <summary>Field number for the "game_account_id" field.</summary>
    public const int GameAccountIdFieldNumber = 2;
    private Bgs.Protocol.EntityId gameAccountId_;
    public Bgs.Protocol.EntityId GameAccountId {
      get { return gameAccountId_; }
      set {
        gameAccountId_ = value;
      }
    }

    /// <summary>Field number for the "reason" field.</summary>
    public const int ReasonFieldNumber = 3;
    private uint reason_;
    public uint Reason {
      get { return reason_; }
      set {
        reason_ = value;
      }
    }

    /// <summary>Field number for the "peer" field.</summary>
    public const int PeerFieldNumber = 4;
    private Bgs.Protocol.ProcessId peer_;
    public Bgs.Protocol.ProcessId Peer {
      get { return peer_; }
      set {
        peer_ = value;
      }
    }

    /// <summary>Field number for the "account_id" field.</summary>
    public const int AccountIdFieldNumber = 5;
    private Bgs.Protocol.EntityId accountId_;
    public Bgs.Protocol.EntityId AccountId {
      get { return accountId_; }
      set {
        accountId_ = value;
      }
    }

    public override bool Equals(object other) {
      return Equals(other as InvitationNotification);
    }

    public bool Equals(InvitationNotification other) {
      if (ReferenceEquals(other, null)) {
        return false;
      }
      if (ReferenceEquals(other, this)) {
        return true;
      }
      if (!object.Equals(Invitation, other.Invitation)) return false;
      if (!object.Equals(GameAccountId, other.GameAccountId)) return false;
      if (Reason != other.Reason) return false;
      if (!object.Equals(Peer, other.Peer)) return false;
      if (!object.Equals(AccountId, other.AccountId)) return false;
      return true;
    }

    public override int GetHashCode() {
      int hash = 1;
      if (invitation_ != null) hash ^= Invitation.GetHashCode();
      if (gameAccountId_ != null) hash ^= GameAccountId.GetHashCode();
      if (Reason != 0) hash ^= Reason.GetHashCode();
      if (peer_ != null) hash ^= Peer.GetHashCode();
      if (accountId_ != null) hash ^= AccountId.GetHashCode();
      return hash;
    }

    public override string ToString() {
      return pb::JsonFormatter.ToDiagnosticString(this);
    }

    public void WriteTo(pb::CodedOutputStream output) {
      if (invitation_ != null) {
        output.WriteRawTag(10);
        output.WriteMessage(Invitation);
      }
      if (gameAccountId_ != null) {
        output.WriteRawTag(18);
        output.WriteMessage(GameAccountId);
      }
      if (Reason != 0) {
        output.WriteRawTag(24);
        output.WriteUInt32(Reason);
      }
      if (peer_ != null) {
        output.WriteRawTag(34);
        output.WriteMessage(Peer);
      }
      if (accountId_ != null) {
        output.WriteRawTag(42);
        output.WriteMessage(AccountId);
      }
    }

    public int CalculateSize() {
      int size = 0;
      if (invitation_ != null) {
        size += 1 + pb::CodedOutputStream.ComputeMessageSize(Invitation);
      }
      if (gameAccountId_ != null) {
        size += 1 + pb::CodedOutputStream.ComputeMessageSize(GameAccountId);
      }
      if (Reason != 0) {
        size += 1 + pb::CodedOutputStream.ComputeUInt32Size(Reason);
      }
      if (peer_ != null) {
        size += 1 + pb::CodedOutputStream.ComputeMessageSize(Peer);
      }
      if (accountId_ != null) {
        size += 1 + pb::CodedOutputStream.ComputeMessageSize(AccountId);
      }
      return size;
    }

    public void MergeFrom(InvitationNotification other) {
      if (other == null) {
        return;
      }
      if (other.invitation_ != null) {
        if (invitation_ == null) {
          invitation_ = new Bgs.Protocol.Invitation();
        }
        Invitation.MergeFrom(other.Invitation);
      }
      if (other.gameAccountId_ != null) {
        if (gameAccountId_ == null) {
          gameAccountId_ = new Bgs.Protocol.EntityId();
        }
        GameAccountId.MergeFrom(other.GameAccountId);
      }
      if (other.Reason != 0) {
        Reason = other.Reason;
      }
      if (other.peer_ != null) {
        if (peer_ == null) {
          peer_ = new Bgs.Protocol.ProcessId();
        }
        Peer.MergeFrom(other.Peer);
      }
      if (other.accountId_ != null) {
        if (accountId_ == null) {
          accountId_ = new Bgs.Protocol.EntityId();
        }
        AccountId.MergeFrom(other.AccountId);
      }
    }

    public void MergeFrom(pb::CodedInputStream input) {
      uint tag;
      while ((tag = input.ReadTag()) != 0) {
        switch(tag) {
          default:
            input.SkipLastField();
            break;
          case 10: {
            if (invitation_ == null) {
              invitation_ = new Bgs.Protocol.Invitation();
            }
            input.ReadMessage(invitation_);
            break;
          }
          case 18: {
            if (gameAccountId_ == null) {
              gameAccountId_ = new Bgs.Protocol.EntityId();
            }
            input.ReadMessage(gameAccountId_);
            break;
          }
          case 24: {
            Reason = input.ReadUInt32();
            break;
          }
          case 34: {
            if (peer_ == null) {
              peer_ = new Bgs.Protocol.ProcessId();
            }
            input.ReadMessage(peer_);
            break;
          }
          case 42: {
            if (accountId_ == null) {
              accountId_ = new Bgs.Protocol.EntityId();
            }
            input.ReadMessage(accountId_);
            break;
          }
        }
      }
    }

  }

  #endregion

}

#endregion Designer generated code
