// Generated by the protocol buffer compiler.  DO NOT EDIT!
// source: bgs/low/pb/client/channel_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.Channel.V1
{

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

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

    static ChannelServiceReflection() {
      byte[] descriptorData = System.Convert.FromBase64String(
          string.Concat(
            "CidiZ3MvbG93L3BiL2NsaWVudC9jaGFubmVsX3NlcnZpY2UucHJvdG8SF2Jn",
            "cy5wcm90b2NvbC5jaGFubmVsLnYxGiViZ3MvbG93L3BiL2NsaWVudC9hY2Nv",
            "dW50X3R5cGVzLnByb3RvGiRiZ3MvbG93L3BiL2NsaWVudC9lbnRpdHlfdHlw",
            "ZXMucHJvdG8aJWJncy9sb3cvcGIvY2xpZW50L2NoYW5uZWxfdHlwZXMucHJv",
            "dG8aIWJncy9sb3cvcGIvY2xpZW50L3JwY190eXBlcy5wcm90byLPAQoQQWRk",
            "TWVtYmVyUmVxdWVzdBIoCghhZ2VudF9pZBgBIAEoCzIWLmJncy5wcm90b2Nv",
            "bC5FbnRpdHlJZBIvCg9tZW1iZXJfaWRlbnRpdHkYAiABKAsyFi5iZ3MucHJv",
            "dG9jb2wuSWRlbnRpdHkSOgoMbWVtYmVyX3N0YXRlGAMgASgLMiQuYmdzLnBy",
            "b3RvY29sLmNoYW5uZWwudjEuTWVtYmVyU3RhdGUSEQoJb2JqZWN0X2lkGAQg",
            "ASgEEhEKCXN1YnNjcmliZRgFIAEoCCJ6ChNSZW1vdmVNZW1iZXJSZXF1ZXN0",
            "EigKCGFnZW50X2lkGAEgASgLMhYuYmdzLnByb3RvY29sLkVudGl0eUlkEikK",
            "CW1lbWJlcl9pZBgCIAEoCzIWLmJncy5wcm90b2NvbC5FbnRpdHlJZBIOCgZy",
            "ZWFzb24YAyABKA0ibwoYVW5zdWJzY3JpYmVNZW1iZXJSZXF1ZXN0EigKCGFn",
            "ZW50X2lkGAEgASgLMhYuYmdzLnByb3RvY29sLkVudGl0eUlkEikKCW1lbWJl",
            "cl9pZBgCIAEoCzIWLmJncy5wcm90b2NvbC5FbnRpdHlJZCKOAQoSU2VuZE1l",
            "c3NhZ2VSZXF1ZXN0EigKCGFnZW50X2lkGAEgASgLMhYuYmdzLnByb3RvY29s",
            "LkVudGl0eUlkEjEKB21lc3NhZ2UYAiABKAsyIC5iZ3MucHJvdG9jb2wuY2hh",
            "bm5lbC52MS5NZXNzYWdlEhsKE3JlcXVpcmVkX3ByaXZpbGVnZXMYAyABKAQi",
            "ggEKGVVwZGF0ZUNoYW5uZWxTdGF0ZVJlcXVlc3QSKAoIYWdlbnRfaWQYASAB",
            "KAsyFi5iZ3MucHJvdG9jb2wuRW50aXR5SWQSOwoMc3RhdGVfY2hhbmdlGAIg",
            "ASgLMiUuYmdzLnByb3RvY29sLmNoYW5uZWwudjEuQ2hhbm5lbFN0YXRlIpUB",
            "ChhVcGRhdGVNZW1iZXJTdGF0ZVJlcXVlc3QSKAoIYWdlbnRfaWQYASABKAsy",
            "Fi5iZ3MucHJvdG9jb2wuRW50aXR5SWQSNQoMc3RhdGVfY2hhbmdlGAIgAygL",
            "Mh8uYmdzLnByb3RvY29sLmNoYW5uZWwudjEuTWVtYmVyEhgKDHJlbW92ZWRf",
            "cm9sZRgDIAMoDUICEAEiSwoPRGlzc29sdmVSZXF1ZXN0EigKCGFnZW50X2lk",
            "GAEgASgLMhYuYmdzLnByb3RvY29sLkVudGl0eUlkEg4KBnJlYXNvbhgCIAEo",
            "DSJ4Cg9TZXRSb2xlc1JlcXVlc3QSKAoIYWdlbnRfaWQYASABKAsyFi5iZ3Mu",
            "cHJvdG9jb2wuRW50aXR5SWQSEAoEcm9sZRgCIAMoDUICEAESKQoJbWVtYmVy",
            "X2lkGAMgAygLMhYuYmdzLnByb3RvY29sLkVudGl0eUlkIp8CChBKb2luTm90",
            "aWZpY2F0aW9uEi0KBHNlbGYYASABKAsyHy5iZ3MucHJvdG9jb2wuY2hhbm5l",
            "bC52MS5NZW1iZXISLwoGbWVtYmVyGAIgAygLMh8uYmdzLnByb3RvY29sLmNo",
            "YW5uZWwudjEuTWVtYmVyEjwKDWNoYW5uZWxfc3RhdGUYAyABKAsyJS5iZ3Mu",
            "cHJvdG9jb2wuY2hhbm5lbC52MS5DaGFubmVsU3RhdGUSNgoKY2hhbm5lbF9p",
            "ZBgEIAEoCzIiLmJncy5wcm90b2NvbC5jaGFubmVsLnYxLkNoYW5uZWxJZBI1",
            "CgpzdWJzY3JpYmVyGAUgASgLMiEuYmdzLnByb3RvY29sLmFjY291bnQudjEu",
            "SWRlbnRpdHkiuQEKF01lbWJlckFkZGVkTm90aWZpY2F0aW9uEi8KBm1lbWJl",
            "chgBIAEoCzIfLmJncy5wcm90b2NvbC5jaGFubmVsLnYxLk1lbWJlchI2Cgpj",
            "aGFubmVsX2lkGAIgASgLMiIuYmdzLnByb3RvY29sLmNoYW5uZWwudjEuQ2hh",
            "bm5lbElkEjUKCnN1YnNjcmliZXIYAyABKAsyIS5iZ3MucHJvdG9jb2wuYWNj",
            "b3VudC52MS5JZGVudGl0eSLnAQoRTGVhdmVOb3RpZmljYXRpb24SKAoIYWdl",
            "bnRfaWQYASABKAsyFi5iZ3MucHJvdG9jb2wuRW50aXR5SWQSKQoJbWVtYmVy",
            "X2lkGAIgASgLMhYuYmdzLnByb3RvY29sLkVudGl0eUlkEg4KBnJlYXNvbhgD",
            "IAEoDRI2CgpjaGFubmVsX2lkGAQgASgLMiIuYmdzLnByb3RvY29sLmNoYW5u",
            "ZWwudjEuQ2hhbm5lbElkEjUKCnN1YnNjcmliZXIYBSABKAsyIS5iZ3MucHJv",
            "dG9jb2wuYWNjb3VudC52MS5JZGVudGl0eSLvAQoZTWVtYmVyUmVtb3ZlZE5v",
            "dGlmaWNhdGlvbhIoCghhZ2VudF9pZBgBIAEoCzIWLmJncy5wcm90b2NvbC5F",
            "bnRpdHlJZBIpCgltZW1iZXJfaWQYAiABKAsyFi5iZ3MucHJvdG9jb2wuRW50",
            "aXR5SWQSDgoGcmVhc29uGAMgASgNEjYKCmNoYW5uZWxfaWQYBCABKAsyIi5i",
            "Z3MucHJvdG9jb2wuY2hhbm5lbC52MS5DaGFubmVsSWQSNQoKc3Vic2NyaWJl",
            "chgFIAEoCzIhLmJncy5wcm90b2NvbC5hY2NvdW50LnYxLklkZW50aXR5IpQC",
            "ChdTZW5kTWVzc2FnZU5vdGlmaWNhdGlvbhIoCghhZ2VudF9pZBgBIAEoCzIW",
            "LmJncy5wcm90b2NvbC5FbnRpdHlJZBIxCgdtZXNzYWdlGAIgASgLMiAuYmdz",
            "LnByb3RvY29sLmNoYW5uZWwudjEuTWVzc2FnZRIbChNyZXF1aXJlZF9wcml2",
            "aWxlZ2VzGAMgASgEEhAKCGlkZW50aXR5GAQgASgJEjYKCmNoYW5uZWxfaWQY",
            "BSABKAsyIi5iZ3MucHJvdG9jb2wuY2hhbm5lbC52MS5DaGFubmVsSWQSNQoK",
            "c3Vic2NyaWJlchgGIAEoCzIhLmJncy5wcm90b2NvbC5hY2NvdW50LnYxLklk",
            "ZW50aXR5IvYBCh5VcGRhdGVDaGFubmVsU3RhdGVOb3RpZmljYXRpb24SKAoI",
            "YWdlbnRfaWQYASABKAsyFi5iZ3MucHJvdG9jb2wuRW50aXR5SWQSOwoMc3Rh",
            "dGVfY2hhbmdlGAIgASgLMiUuYmdzLnByb3RvY29sLmNoYW5uZWwudjEuQ2hh",
            "bm5lbFN0YXRlEjYKCmNoYW5uZWxfaWQYAyABKAsyIi5iZ3MucHJvdG9jb2wu",
            "Y2hhbm5lbC52MS5DaGFubmVsSWQSNQoKc3Vic2NyaWJlchgEIAEoCzIhLmJn",
            "cy5wcm90b2NvbC5hY2NvdW50LnYxLklkZW50aXR5IokCCh1VcGRhdGVNZW1i",
            "ZXJTdGF0ZU5vdGlmaWNhdGlvbhIoCghhZ2VudF9pZBgBIAEoCzIWLmJncy5w",
            "cm90b2NvbC5FbnRpdHlJZBI1CgxzdGF0ZV9jaGFuZ2UYAiADKAsyHy5iZ3Mu",
            "cHJvdG9jb2wuY2hhbm5lbC52MS5NZW1iZXISGAoMcmVtb3ZlZF9yb2xlGAMg",
            "AygNQgIQARI2CgpjaGFubmVsX2lkGAQgASgLMiIuYmdzLnByb3RvY29sLmNo",
            "YW5uZWwudjEuQ2hhbm5lbElkEjUKCnN1YnNjcmliZXIYBSABKAsyIS5iZ3Mu",
            "cHJvdG9jb2wuYWNjb3VudC52MS5JZGVudGl0eTK4BQoOQ2hhbm5lbFNlcnZp",
            "Y2USTAoJQWRkTWVtYmVyEikuYmdzLnByb3RvY29sLmNoYW5uZWwudjEuQWRk",
            "TWVtYmVyUmVxdWVzdBoULmJncy5wcm90b2NvbC5Ob0RhdGESUgoMUmVtb3Zl",
            "TWVtYmVyEiwuYmdzLnByb3RvY29sLmNoYW5uZWwudjEuUmVtb3ZlTWVtYmVy",
            "UmVxdWVzdBoULmJncy5wcm90b2NvbC5Ob0RhdGESUAoLU2VuZE1lc3NhZ2US",
            "Ky5iZ3MucHJvdG9jb2wuY2hhbm5lbC52MS5TZW5kTWVzc2FnZVJlcXVlc3Qa",
            "FC5iZ3MucHJvdG9jb2wuTm9EYXRhEl4KElVwZGF0ZUNoYW5uZWxTdGF0ZRIy",
            "LmJncy5wcm90b2NvbC5jaGFubmVsLnYxLlVwZGF0ZUNoYW5uZWxTdGF0ZVJl",
            "cXVlc3QaFC5iZ3MucHJvdG9jb2wuTm9EYXRhElwKEVVwZGF0ZU1lbWJlclN0",
            "YXRlEjEuYmdzLnByb3RvY29sLmNoYW5uZWwudjEuVXBkYXRlTWVtYmVyU3Rh",
            "dGVSZXF1ZXN0GhQuYmdzLnByb3RvY29sLk5vRGF0YRJKCghEaXNzb2x2ZRIo",
            "LmJncy5wcm90b2NvbC5jaGFubmVsLnYxLkRpc3NvbHZlUmVxdWVzdBoULmJn",
            "cy5wcm90b2NvbC5Ob0RhdGESSgoIU2V0Um9sZXMSKC5iZ3MucHJvdG9jb2wu",
            "Y2hhbm5lbC52MS5TZXRSb2xlc1JlcXVlc3QaFC5iZ3MucHJvdG9jb2wuTm9E",
            "YXRhElwKEVVuc3Vic2NyaWJlTWVtYmVyEjEuYmdzLnByb3RvY29sLmNoYW5u",
            "ZWwudjEuVW5zdWJzY3JpYmVNZW1iZXJSZXF1ZXN0GhQuYmdzLnByb3RvY29s",
            "Lk5vRGF0YTKnBQoPQ2hhbm5lbExpc3RlbmVyEk4KBk9uSm9pbhIpLmJncy5w",
            "cm90b2NvbC5jaGFubmVsLnYxLkpvaW5Ob3RpZmljYXRpb24aGS5iZ3MucHJv",
            "dG9jb2wuTk9fUkVTUE9OU0USXAoNT25NZW1iZXJBZGRlZBIwLmJncy5wcm90",
            "b2NvbC5jaGFubmVsLnYxLk1lbWJlckFkZGVkTm90aWZpY2F0aW9uGhkuYmdz",
            "LnByb3RvY29sLk5PX1JFU1BPTlNFElAKB09uTGVhdmUSKi5iZ3MucHJvdG9j",
            "b2wuY2hhbm5lbC52MS5MZWF2ZU5vdGlmaWNhdGlvbhoZLmJncy5wcm90b2Nv",
            "bC5OT19SRVNQT05TRRJgCg9Pbk1lbWJlclJlbW92ZWQSMi5iZ3MucHJvdG9j",
            "b2wuY2hhbm5lbC52MS5NZW1iZXJSZW1vdmVkTm90aWZpY2F0aW9uGhkuYmdz",
            "LnByb3RvY29sLk5PX1JFU1BPTlNFElwKDU9uU2VuZE1lc3NhZ2USMC5iZ3Mu",
            "cHJvdG9jb2wuY2hhbm5lbC52MS5TZW5kTWVzc2FnZU5vdGlmaWNhdGlvbhoZ",
            "LmJncy5wcm90b2NvbC5OT19SRVNQT05TRRJqChRPblVwZGF0ZUNoYW5uZWxT",
            "dGF0ZRI3LmJncy5wcm90b2NvbC5jaGFubmVsLnYxLlVwZGF0ZUNoYW5uZWxT",
            "dGF0ZU5vdGlmaWNhdGlvbhoZLmJncy5wcm90b2NvbC5OT19SRVNQT05TRRJo",
            "ChNPblVwZGF0ZU1lbWJlclN0YXRlEjYuYmdzLnByb3RvY29sLmNoYW5uZWwu",
            "djEuVXBkYXRlTWVtYmVyU3RhdGVOb3RpZmljYXRpb24aGS5iZ3MucHJvdG9j",
            "b2wuTk9fUkVTUE9OU0VCBUgCgAEAYgZwcm90bzM="));
      descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData,
          new pbr::FileDescriptor[] { Bgs.Protocol.Account.V1.AccountTypesReflection.Descriptor, Bgs.Protocol.EntityTypesReflection.Descriptor, Bgs.Protocol.Channel.V1.ChannelTypesReflection.Descriptor, Bgs.Protocol.RpcTypesReflection.Descriptor, },
          new pbr::GeneratedClrTypeInfo(null, new pbr::GeneratedClrTypeInfo[] {
            new pbr::GeneratedClrTypeInfo(typeof(Bgs.Protocol.Channel.V1.AddMemberRequest), Bgs.Protocol.Channel.V1.AddMemberRequest.Parser, new[]{ "AgentId", "MemberIdentity", "MemberState", "ObjectId", "Subscribe" }, null, null, null),
            new pbr::GeneratedClrTypeInfo(typeof(Bgs.Protocol.Channel.V1.RemoveMemberRequest), Bgs.Protocol.Channel.V1.RemoveMemberRequest.Parser, new[]{ "AgentId", "MemberId", "Reason" }, null, null, null),
            new pbr::GeneratedClrTypeInfo(typeof(Bgs.Protocol.Channel.V1.UnsubscribeMemberRequest), Bgs.Protocol.Channel.V1.UnsubscribeMemberRequest.Parser, new[]{ "AgentId", "MemberId" }, null, null, null),
            new pbr::GeneratedClrTypeInfo(typeof(Bgs.Protocol.Channel.V1.SendMessageRequest), Bgs.Protocol.Channel.V1.SendMessageRequest.Parser, new[]{ "AgentId", "Message", "RequiredPrivileges" }, null, null, null),
            new pbr::GeneratedClrTypeInfo(typeof(Bgs.Protocol.Channel.V1.UpdateChannelStateRequest), Bgs.Protocol.Channel.V1.UpdateChannelStateRequest.Parser, new[]{ "AgentId", "StateChange" }, null, null, null),
            new pbr::GeneratedClrTypeInfo(typeof(Bgs.Protocol.Channel.V1.UpdateMemberStateRequest), Bgs.Protocol.Channel.V1.UpdateMemberStateRequest.Parser, new[]{ "AgentId", "StateChange", "RemovedRole" }, null, null, null),
            new pbr::GeneratedClrTypeInfo(typeof(Bgs.Protocol.Channel.V1.DissolveRequest), Bgs.Protocol.Channel.V1.DissolveRequest.Parser, new[]{ "AgentId", "Reason" }, null, null, null),
            new pbr::GeneratedClrTypeInfo(typeof(Bgs.Protocol.Channel.V1.SetRolesRequest), Bgs.Protocol.Channel.V1.SetRolesRequest.Parser, new[]{ "AgentId", "Role", "MemberId" }, null, null, null),
            new pbr::GeneratedClrTypeInfo(typeof(Bgs.Protocol.Channel.V1.JoinNotification), Bgs.Protocol.Channel.V1.JoinNotification.Parser, new[]{ "Self", "Member", "ChannelState", "ChannelId", "Subscriber" }, null, null, null),
            new pbr::GeneratedClrTypeInfo(typeof(Bgs.Protocol.Channel.V1.MemberAddedNotification), Bgs.Protocol.Channel.V1.MemberAddedNotification.Parser, new[]{ "Member", "ChannelId", "Subscriber" }, null, null, null),
            new pbr::GeneratedClrTypeInfo(typeof(Bgs.Protocol.Channel.V1.LeaveNotification), Bgs.Protocol.Channel.V1.LeaveNotification.Parser, new[]{ "AgentId", "MemberId", "Reason", "ChannelId", "Subscriber" }, null, null, null),
            new pbr::GeneratedClrTypeInfo(typeof(Bgs.Protocol.Channel.V1.MemberRemovedNotification), Bgs.Protocol.Channel.V1.MemberRemovedNotification.Parser, new[]{ "AgentId", "MemberId", "Reason", "ChannelId", "Subscriber" }, null, null, null),
            new pbr::GeneratedClrTypeInfo(typeof(Bgs.Protocol.Channel.V1.SendMessageNotification), Bgs.Protocol.Channel.V1.SendMessageNotification.Parser, new[]{ "AgentId", "Message", "RequiredPrivileges", "Identity", "ChannelId", "Subscriber" }, null, null, null),
            new pbr::GeneratedClrTypeInfo(typeof(Bgs.Protocol.Channel.V1.UpdateChannelStateNotification), Bgs.Protocol.Channel.V1.UpdateChannelStateNotification.Parser, new[]{ "AgentId", "StateChange", "ChannelId", "Subscriber" }, null, null, null),
            new pbr::GeneratedClrTypeInfo(typeof(Bgs.Protocol.Channel.V1.UpdateMemberStateNotification), Bgs.Protocol.Channel.V1.UpdateMemberStateNotification.Parser, new[]{ "AgentId", "StateChange", "RemovedRole", "ChannelId", "Subscriber" }, null, null, null)
          }));
    }
    #endregion

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

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

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

    public AddMemberRequest() {
      OnConstruction();
    }

    partial void OnConstruction();

    public AddMemberRequest(AddMemberRequest other) : this() {
      AgentId = other.agentId_ != null ? other.AgentId.Clone() : null;
      MemberIdentity = other.memberIdentity_ != null ? other.MemberIdentity.Clone() : null;
      MemberState = other.memberState_ != null ? other.MemberState.Clone() : null;
      objectId_ = other.objectId_;
      subscribe_ = other.subscribe_;
    }

    public AddMemberRequest Clone() {
      return new AddMemberRequest(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 "member_identity" field.</summary>
    public const int MemberIdentityFieldNumber = 2;
    private Bgs.Protocol.Identity memberIdentity_;
    public Bgs.Protocol.Identity MemberIdentity {
      get { return memberIdentity_; }
      set {
        memberIdentity_ = value;
      }
    }

    /// <summary>Field number for the "member_state" field.</summary>
    public const int MemberStateFieldNumber = 3;
    private Bgs.Protocol.Channel.V1.MemberState memberState_;
    public Bgs.Protocol.Channel.V1.MemberState MemberState {
      get { return memberState_; }
      set {
        memberState_ = value;
      }
    }

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

    /// <summary>Field number for the "subscribe" field.</summary>
    public const int SubscribeFieldNumber = 5;
    private bool subscribe_;
    public bool Subscribe {
      get { return subscribe_; }
      set {
        subscribe_ = value;
      }
    }

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

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

    public override int GetHashCode() {
      int hash = 1;
      if (agentId_ != null) hash ^= AgentId.GetHashCode();
      if (memberIdentity_ != null) hash ^= MemberIdentity.GetHashCode();
      if (memberState_ != null) hash ^= MemberState.GetHashCode();
      if (ObjectId != 0UL) hash ^= ObjectId.GetHashCode();
      if (Subscribe != false) hash ^= Subscribe.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 (memberIdentity_ != null) {
        output.WriteRawTag(18);
        output.WriteMessage(MemberIdentity);
      }
      if (memberState_ != null) {
        output.WriteRawTag(26);
        output.WriteMessage(MemberState);
      }
      if (ObjectId != 0UL) {
        output.WriteRawTag(32);
        output.WriteUInt64(ObjectId);
      }
      if (Subscribe != false) {
        output.WriteRawTag(40);
        output.WriteBool(Subscribe);
      }
    }

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

    public void MergeFrom(AddMemberRequest other) {
      if (other == null) {
        return;
      }
      if (other.agentId_ != null) {
        if (agentId_ == null) {
          agentId_ = new Bgs.Protocol.EntityId();
        }
        AgentId.MergeFrom(other.AgentId);
      }
      if (other.memberIdentity_ != null) {
        if (memberIdentity_ == null) {
          memberIdentity_ = new Bgs.Protocol.Identity();
        }
        MemberIdentity.MergeFrom(other.MemberIdentity);
      }
      if (other.memberState_ != null) {
        if (memberState_ == null) {
          memberState_ = new Bgs.Protocol.Channel.V1.MemberState();
        }
        MemberState.MergeFrom(other.MemberState);
      }
      if (other.ObjectId != 0UL) {
        ObjectId = other.ObjectId;
      }
      if (other.Subscribe != false) {
        Subscribe = other.Subscribe;
      }
    }

    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 (memberIdentity_ == null) {
              memberIdentity_ = new Bgs.Protocol.Identity();
            }
            input.ReadMessage(memberIdentity_);
            break;
          }
          case 26: {
            if (memberState_ == null) {
              memberState_ = new Bgs.Protocol.Channel.V1.MemberState();
            }
            input.ReadMessage(memberState_);
            break;
          }
          case 32: {
            ObjectId = input.ReadUInt64();
            break;
          }
          case 40: {
            Subscribe = input.ReadBool();
            break;
          }
        }
      }
    }

  }

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

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

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

    public RemoveMemberRequest() {
      OnConstruction();
    }

    partial void OnConstruction();

    public RemoveMemberRequest(RemoveMemberRequest other) : this() {
      AgentId = other.agentId_ != null ? other.AgentId.Clone() : null;
      MemberId = other.memberId_ != null ? other.MemberId.Clone() : null;
      reason_ = other.reason_;
    }

    public RemoveMemberRequest Clone() {
      return new RemoveMemberRequest(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 "member_id" field.</summary>
    public const int MemberIdFieldNumber = 2;
    private Bgs.Protocol.EntityId memberId_;
    public Bgs.Protocol.EntityId MemberId {
      get { return memberId_; }
      set {
        memberId_ = 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;
      }
    }

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

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

    public override int GetHashCode() {
      int hash = 1;
      if (agentId_ != null) hash ^= AgentId.GetHashCode();
      if (memberId_ != null) hash ^= MemberId.GetHashCode();
      if (Reason != 0) hash ^= Reason.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 (memberId_ != null) {
        output.WriteRawTag(18);
        output.WriteMessage(MemberId);
      }
      if (Reason != 0) {
        output.WriteRawTag(24);
        output.WriteUInt32(Reason);
      }
    }

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

    public void MergeFrom(RemoveMemberRequest other) {
      if (other == null) {
        return;
      }
      if (other.agentId_ != null) {
        if (agentId_ == null) {
          agentId_ = new Bgs.Protocol.EntityId();
        }
        AgentId.MergeFrom(other.AgentId);
      }
      if (other.memberId_ != null) {
        if (memberId_ == null) {
          memberId_ = new Bgs.Protocol.EntityId();
        }
        MemberId.MergeFrom(other.MemberId);
      }
      if (other.Reason != 0) {
        Reason = other.Reason;
      }
    }

    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 (memberId_ == null) {
              memberId_ = new Bgs.Protocol.EntityId();
            }
            input.ReadMessage(memberId_);
            break;
          }
          case 24: {
            Reason = input.ReadUInt32();
            break;
          }
        }
      }
    }

  }

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

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

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

    public UnsubscribeMemberRequest() {
      OnConstruction();
    }

    partial void OnConstruction();

    public UnsubscribeMemberRequest(UnsubscribeMemberRequest other) : this() {
      AgentId = other.agentId_ != null ? other.AgentId.Clone() : null;
      MemberId = other.memberId_ != null ? other.MemberId.Clone() : null;
    }

    public UnsubscribeMemberRequest Clone() {
      return new UnsubscribeMemberRequest(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 "member_id" field.</summary>
    public const int MemberIdFieldNumber = 2;
    private Bgs.Protocol.EntityId memberId_;
    public Bgs.Protocol.EntityId MemberId {
      get { return memberId_; }
      set {
        memberId_ = value;
      }
    }

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

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

    public override int GetHashCode() {
      int hash = 1;
      if (agentId_ != null) hash ^= AgentId.GetHashCode();
      if (memberId_ != null) hash ^= MemberId.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 (memberId_ != null) {
        output.WriteRawTag(18);
        output.WriteMessage(MemberId);
      }
    }

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

    public void MergeFrom(UnsubscribeMemberRequest other) {
      if (other == null) {
        return;
      }
      if (other.agentId_ != null) {
        if (agentId_ == null) {
          agentId_ = new Bgs.Protocol.EntityId();
        }
        AgentId.MergeFrom(other.AgentId);
      }
      if (other.memberId_ != null) {
        if (memberId_ == null) {
          memberId_ = new Bgs.Protocol.EntityId();
        }
        MemberId.MergeFrom(other.MemberId);
      }
    }

    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 (memberId_ == null) {
              memberId_ = new Bgs.Protocol.EntityId();
            }
            input.ReadMessage(memberId_);
            break;
          }
        }
      }
    }

  }

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

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

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

    public SendMessageRequest() {
      OnConstruction();
    }

    partial void OnConstruction();

    public SendMessageRequest(SendMessageRequest other) : this() {
      AgentId = other.agentId_ != null ? other.AgentId.Clone() : null;
      Message = other.message_ != null ? other.Message.Clone() : null;
      requiredPrivileges_ = other.requiredPrivileges_;
    }

    public SendMessageRequest Clone() {
      return new SendMessageRequest(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 "message" field.</summary>
    public const int MessageFieldNumber = 2;
    private Bgs.Protocol.Channel.V1.Message message_;
    public Bgs.Protocol.Channel.V1.Message Message {
      get { return message_; }
      set {
        message_ = value;
      }
    }

    /// <summary>Field number for the "required_privileges" field.</summary>
    public const int RequiredPrivilegesFieldNumber = 3;
    private ulong requiredPrivileges_;
    public ulong RequiredPrivileges {
      get { return requiredPrivileges_; }
      set {
        requiredPrivileges_ = value;
      }
    }

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

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

    public override int GetHashCode() {
      int hash = 1;
      if (agentId_ != null) hash ^= AgentId.GetHashCode();
      if (message_ != null) hash ^= Message.GetHashCode();
      if (RequiredPrivileges != 0UL) hash ^= RequiredPrivileges.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 (message_ != null) {
        output.WriteRawTag(18);
        output.WriteMessage(Message);
      }
      if (RequiredPrivileges != 0UL) {
        output.WriteRawTag(24);
        output.WriteUInt64(RequiredPrivileges);
      }
    }

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

    public void MergeFrom(SendMessageRequest other) {
      if (other == null) {
        return;
      }
      if (other.agentId_ != null) {
        if (agentId_ == null) {
          agentId_ = new Bgs.Protocol.EntityId();
        }
        AgentId.MergeFrom(other.AgentId);
      }
      if (other.message_ != null) {
        if (message_ == null) {
          message_ = new Bgs.Protocol.Channel.V1.Message();
        }
        Message.MergeFrom(other.Message);
      }
      if (other.RequiredPrivileges != 0UL) {
        RequiredPrivileges = other.RequiredPrivileges;
      }
    }

    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 (message_ == null) {
              message_ = new Bgs.Protocol.Channel.V1.Message();
            }
            input.ReadMessage(message_);
            break;
          }
          case 24: {
            RequiredPrivileges = input.ReadUInt64();
            break;
          }
        }
      }
    }

  }

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

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

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

    public UpdateChannelStateRequest() {
      OnConstruction();
    }

    partial void OnConstruction();

    public UpdateChannelStateRequest(UpdateChannelStateRequest other) : this() {
      AgentId = other.agentId_ != null ? other.AgentId.Clone() : null;
      StateChange = other.stateChange_ != null ? other.StateChange.Clone() : null;
    }

    public UpdateChannelStateRequest Clone() {
      return new UpdateChannelStateRequest(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 "state_change" field.</summary>
    public const int StateChangeFieldNumber = 2;
    private Bgs.Protocol.Channel.V1.ChannelState stateChange_;
    public Bgs.Protocol.Channel.V1.ChannelState StateChange {
      get { return stateChange_; }
      set {
        stateChange_ = value;
      }
    }

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

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

    public override int GetHashCode() {
      int hash = 1;
      if (agentId_ != null) hash ^= AgentId.GetHashCode();
      if (stateChange_ != null) hash ^= StateChange.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 (stateChange_ != null) {
        output.WriteRawTag(18);
        output.WriteMessage(StateChange);
      }
    }

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

    public void MergeFrom(UpdateChannelStateRequest other) {
      if (other == null) {
        return;
      }
      if (other.agentId_ != null) {
        if (agentId_ == null) {
          agentId_ = new Bgs.Protocol.EntityId();
        }
        AgentId.MergeFrom(other.AgentId);
      }
      if (other.stateChange_ != null) {
        if (stateChange_ == null) {
          stateChange_ = new Bgs.Protocol.Channel.V1.ChannelState();
        }
        StateChange.MergeFrom(other.StateChange);
      }
    }

    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 (stateChange_ == null) {
              stateChange_ = new Bgs.Protocol.Channel.V1.ChannelState();
            }
            input.ReadMessage(stateChange_);
            break;
          }
        }
      }
    }

  }

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

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

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

    public UpdateMemberStateRequest() {
      OnConstruction();
    }

    partial void OnConstruction();

    public UpdateMemberStateRequest(UpdateMemberStateRequest other) : this() {
      AgentId = other.agentId_ != null ? other.AgentId.Clone() : null;
      stateChange_ = other.stateChange_.Clone();
      removedRole_ = other.removedRole_.Clone();
    }

    public UpdateMemberStateRequest Clone() {
      return new UpdateMemberStateRequest(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 "state_change" field.</summary>
    public const int StateChangeFieldNumber = 2;
    private static readonly pb::FieldCodec<Bgs.Protocol.Channel.V1.Member> _repeated_stateChange_codec
        = pb::FieldCodec.ForMessage(18, Bgs.Protocol.Channel.V1.Member.Parser);
    private readonly pbc::RepeatedField<Bgs.Protocol.Channel.V1.Member> stateChange_ = new pbc::RepeatedField<Bgs.Protocol.Channel.V1.Member>();
    public pbc::RepeatedField<Bgs.Protocol.Channel.V1.Member> StateChange {
      get { return stateChange_; }
    }

    /// <summary>Field number for the "removed_role" field.</summary>
    public const int RemovedRoleFieldNumber = 3;
    private static readonly pb::FieldCodec<uint> _repeated_removedRole_codec
        = pb::FieldCodec.ForUInt32(26);
    private readonly pbc::RepeatedField<uint> removedRole_ = new pbc::RepeatedField<uint>();
    public pbc::RepeatedField<uint> RemovedRole {
      get { return removedRole_; }
    }

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

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

    public override int GetHashCode() {
      int hash = 1;
      if (agentId_ != null) hash ^= AgentId.GetHashCode();
      hash ^= stateChange_.GetHashCode();
      hash ^= removedRole_.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);
      }
      stateChange_.WriteTo(output, _repeated_stateChange_codec);
      removedRole_.WriteTo(output, _repeated_removedRole_codec);
    }

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

    public void MergeFrom(UpdateMemberStateRequest other) {
      if (other == null) {
        return;
      }
      if (other.agentId_ != null) {
        if (agentId_ == null) {
          agentId_ = new Bgs.Protocol.EntityId();
        }
        AgentId.MergeFrom(other.AgentId);
      }
      stateChange_.Add(other.stateChange_);
      removedRole_.Add(other.removedRole_);
    }

    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: {
            stateChange_.AddEntriesFrom(input, _repeated_stateChange_codec);
            break;
          }
          case 26:
          case 24: {
            removedRole_.AddEntriesFrom(input, _repeated_removedRole_codec);
            break;
          }
        }
      }
    }

  }

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

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

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

    public DissolveRequest() {
      OnConstruction();
    }

    partial void OnConstruction();

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

    public DissolveRequest Clone() {
      return new DissolveRequest(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 "reason" field.</summary>
    public const int ReasonFieldNumber = 2;
    private uint reason_;
    public uint Reason {
      get { return reason_; }
      set {
        reason_ = value;
      }
    }

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

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

    public override int GetHashCode() {
      int hash = 1;
      if (agentId_ != null) hash ^= AgentId.GetHashCode();
      if (Reason != 0) hash ^= Reason.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 (Reason != 0) {
        output.WriteRawTag(16);
        output.WriteUInt32(Reason);
      }
    }

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

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

    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: {
            Reason = input.ReadUInt32();
            break;
          }
        }
      }
    }

  }

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

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

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

    public SetRolesRequest() {
      OnConstruction();
    }

    partial void OnConstruction();

    public SetRolesRequest(SetRolesRequest other) : this() {
      AgentId = other.agentId_ != null ? other.AgentId.Clone() : null;
      role_ = other.role_.Clone();
      memberId_ = other.memberId_.Clone();
    }

    public SetRolesRequest Clone() {
      return new SetRolesRequest(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 "role" field.</summary>
    public const int RoleFieldNumber = 2;
    private static readonly pb::FieldCodec<uint> _repeated_role_codec
        = pb::FieldCodec.ForUInt32(18);
    private readonly pbc::RepeatedField<uint> role_ = new pbc::RepeatedField<uint>();
    public pbc::RepeatedField<uint> Role {
      get { return role_; }
    }

    /// <summary>Field number for the "member_id" field.</summary>
    public const int MemberIdFieldNumber = 3;
    private static readonly pb::FieldCodec<Bgs.Protocol.EntityId> _repeated_memberId_codec
        = pb::FieldCodec.ForMessage(26, Bgs.Protocol.EntityId.Parser);
    private readonly pbc::RepeatedField<Bgs.Protocol.EntityId> memberId_ = new pbc::RepeatedField<Bgs.Protocol.EntityId>();
    public pbc::RepeatedField<Bgs.Protocol.EntityId> MemberId {
      get { return memberId_; }
    }

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

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

    public override int GetHashCode() {
      int hash = 1;
      if (agentId_ != null) hash ^= AgentId.GetHashCode();
      hash ^= role_.GetHashCode();
      hash ^= memberId_.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);
      }
      role_.WriteTo(output, _repeated_role_codec);
      memberId_.WriteTo(output, _repeated_memberId_codec);
    }

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

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

    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:
          case 16: {
            role_.AddEntriesFrom(input, _repeated_role_codec);
            break;
          }
          case 26: {
            memberId_.AddEntriesFrom(input, _repeated_memberId_codec);
            break;
          }
        }
      }
    }

  }

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

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

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

    public JoinNotification() {
      OnConstruction();
    }

    partial void OnConstruction();

    public JoinNotification(JoinNotification other) : this() {
      Self = other.self_ != null ? other.Self.Clone() : null;
      member_ = other.member_.Clone();
      ChannelState = other.channelState_ != null ? other.ChannelState.Clone() : null;
      ChannelId = other.channelId_ != null ? other.ChannelId.Clone() : null;
      Subscriber = other.subscriber_ != null ? other.Subscriber.Clone() : null;
    }

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

    /// <summary>Field number for the "self" field.</summary>
    public const int SelfFieldNumber = 1;
    private Bgs.Protocol.Channel.V1.Member self_;
    public Bgs.Protocol.Channel.V1.Member Self {
      get { return self_; }
      set {
        self_ = value;
      }
    }

    /// <summary>Field number for the "member" field.</summary>
    public const int MemberFieldNumber = 2;
    private static readonly pb::FieldCodec<Bgs.Protocol.Channel.V1.Member> _repeated_member_codec
        = pb::FieldCodec.ForMessage(18, Bgs.Protocol.Channel.V1.Member.Parser);
    private readonly pbc::RepeatedField<Bgs.Protocol.Channel.V1.Member> member_ = new pbc::RepeatedField<Bgs.Protocol.Channel.V1.Member>();
    public pbc::RepeatedField<Bgs.Protocol.Channel.V1.Member> Member {
      get { return member_; }
    }

    /// <summary>Field number for the "channel_state" field.</summary>
    public const int ChannelStateFieldNumber = 3;
    private Bgs.Protocol.Channel.V1.ChannelState channelState_;
    public Bgs.Protocol.Channel.V1.ChannelState ChannelState {
      get { return channelState_; }
      set {
        channelState_ = value;
      }
    }

    /// <summary>Field number for the "channel_id" field.</summary>
    public const int ChannelIdFieldNumber = 4;
    private Bgs.Protocol.Channel.V1.ChannelId channelId_;
    public Bgs.Protocol.Channel.V1.ChannelId ChannelId {
      get { return channelId_; }
      set {
        channelId_ = value;
      }
    }

    /// <summary>Field number for the "subscriber" field.</summary>
    public const int SubscriberFieldNumber = 5;
    private Bgs.Protocol.Account.V1.Identity subscriber_;
    public Bgs.Protocol.Account.V1.Identity Subscriber {
      get { return subscriber_; }
      set {
        subscriber_ = value;
      }
    }

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

    public bool Equals(JoinNotification other) {
      if (ReferenceEquals(other, null)) {
        return false;
      }
      if (ReferenceEquals(other, this)) {
        return true;
      }
      if (!object.Equals(Self, other.Self)) return false;
      if(!member_.Equals(other.member_)) return false;
      if (!object.Equals(ChannelState, other.ChannelState)) return false;
      if (!object.Equals(ChannelId, other.ChannelId)) return false;
      if (!object.Equals(Subscriber, other.Subscriber)) return false;
      return true;
    }

    public override int GetHashCode() {
      int hash = 1;
      if (self_ != null) hash ^= Self.GetHashCode();
      hash ^= member_.GetHashCode();
      if (channelState_ != null) hash ^= ChannelState.GetHashCode();
      if (channelId_ != null) hash ^= ChannelId.GetHashCode();
      if (subscriber_ != null) hash ^= Subscriber.GetHashCode();
      return hash;
    }

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

    public void WriteTo(pb::CodedOutputStream output) {
      if (self_ != null) {
        output.WriteRawTag(10);
        output.WriteMessage(Self);
      }
      member_.WriteTo(output, _repeated_member_codec);
      if (channelState_ != null) {
        output.WriteRawTag(26);
        output.WriteMessage(ChannelState);
      }
      if (channelId_ != null) {
        output.WriteRawTag(34);
        output.WriteMessage(ChannelId);
      }
      if (subscriber_ != null) {
        output.WriteRawTag(42);
        output.WriteMessage(Subscriber);
      }
    }

    public int CalculateSize() {
      int size = 0;
      if (self_ != null) {
        size += 1 + pb::CodedOutputStream.ComputeMessageSize(Self);
      }
      size += member_.CalculateSize(_repeated_member_codec);
      if (channelState_ != null) {
        size += 1 + pb::CodedOutputStream.ComputeMessageSize(ChannelState);
      }
      if (channelId_ != null) {
        size += 1 + pb::CodedOutputStream.ComputeMessageSize(ChannelId);
      }
      if (subscriber_ != null) {
        size += 1 + pb::CodedOutputStream.ComputeMessageSize(Subscriber);
      }
      return size;
    }

    public void MergeFrom(JoinNotification other) {
      if (other == null) {
        return;
      }
      if (other.self_ != null) {
        if (self_ == null) {
          self_ = new Bgs.Protocol.Channel.V1.Member();
        }
        Self.MergeFrom(other.Self);
      }
      member_.Add(other.member_);
      if (other.channelState_ != null) {
        if (channelState_ == null) {
          channelState_ = new Bgs.Protocol.Channel.V1.ChannelState();
        }
        ChannelState.MergeFrom(other.ChannelState);
      }
      if (other.channelId_ != null) {
        if (channelId_ == null) {
          channelId_ = new Bgs.Protocol.Channel.V1.ChannelId();
        }
        ChannelId.MergeFrom(other.ChannelId);
      }
      if (other.subscriber_ != null) {
        if (subscriber_ == null) {
          subscriber_ = new Bgs.Protocol.Account.V1.Identity();
        }
        Subscriber.MergeFrom(other.Subscriber);
      }
    }

    public void MergeFrom(pb::CodedInputStream input) {
      uint tag;
      while ((tag = input.ReadTag()) != 0) {
        switch(tag) {
          default:
            input.SkipLastField();
            break;
          case 10: {
            if (self_ == null) {
              self_ = new Bgs.Protocol.Channel.V1.Member();
            }
            input.ReadMessage(self_);
            break;
          }
          case 18: {
            member_.AddEntriesFrom(input, _repeated_member_codec);
            break;
          }
          case 26: {
            if (channelState_ == null) {
              channelState_ = new Bgs.Protocol.Channel.V1.ChannelState();
            }
            input.ReadMessage(channelState_);
            break;
          }
          case 34: {
            if (channelId_ == null) {
              channelId_ = new Bgs.Protocol.Channel.V1.ChannelId();
            }
            input.ReadMessage(channelId_);
            break;
          }
          case 42: {
            if (subscriber_ == null) {
              subscriber_ = new Bgs.Protocol.Account.V1.Identity();
            }
            input.ReadMessage(subscriber_);
            break;
          }
        }
      }
    }

  }

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

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

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

    public MemberAddedNotification() {
      OnConstruction();
    }

    partial void OnConstruction();

    public MemberAddedNotification(MemberAddedNotification other) : this() {
      Member = other.member_ != null ? other.Member.Clone() : null;
      ChannelId = other.channelId_ != null ? other.ChannelId.Clone() : null;
      Subscriber = other.subscriber_ != null ? other.Subscriber.Clone() : null;
    }

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

    /// <summary>Field number for the "member" field.</summary>
    public const int MemberFieldNumber = 1;
    private Bgs.Protocol.Channel.V1.Member member_;
    public Bgs.Protocol.Channel.V1.Member Member {
      get { return member_; }
      set {
        member_ = value;
      }
    }

    /// <summary>Field number for the "channel_id" field.</summary>
    public const int ChannelIdFieldNumber = 2;
    private Bgs.Protocol.Channel.V1.ChannelId channelId_;
    public Bgs.Protocol.Channel.V1.ChannelId ChannelId {
      get { return channelId_; }
      set {
        channelId_ = value;
      }
    }

    /// <summary>Field number for the "subscriber" field.</summary>
    public const int SubscriberFieldNumber = 3;
    private Bgs.Protocol.Account.V1.Identity subscriber_;
    public Bgs.Protocol.Account.V1.Identity Subscriber {
      get { return subscriber_; }
      set {
        subscriber_ = value;
      }
    }

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

    public bool Equals(MemberAddedNotification other) {
      if (ReferenceEquals(other, null)) {
        return false;
      }
      if (ReferenceEquals(other, this)) {
        return true;
      }
      if (!object.Equals(Member, other.Member)) return false;
      if (!object.Equals(ChannelId, other.ChannelId)) return false;
      if (!object.Equals(Subscriber, other.Subscriber)) return false;
      return true;
    }

    public override int GetHashCode() {
      int hash = 1;
      if (member_ != null) hash ^= Member.GetHashCode();
      if (channelId_ != null) hash ^= ChannelId.GetHashCode();
      if (subscriber_ != null) hash ^= Subscriber.GetHashCode();
      return hash;
    }

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

    public void WriteTo(pb::CodedOutputStream output) {
      if (member_ != null) {
        output.WriteRawTag(10);
        output.WriteMessage(Member);
      }
      if (channelId_ != null) {
        output.WriteRawTag(18);
        output.WriteMessage(ChannelId);
      }
      if (subscriber_ != null) {
        output.WriteRawTag(26);
        output.WriteMessage(Subscriber);
      }
    }

    public int CalculateSize() {
      int size = 0;
      if (member_ != null) {
        size += 1 + pb::CodedOutputStream.ComputeMessageSize(Member);
      }
      if (channelId_ != null) {
        size += 1 + pb::CodedOutputStream.ComputeMessageSize(ChannelId);
      }
      if (subscriber_ != null) {
        size += 1 + pb::CodedOutputStream.ComputeMessageSize(Subscriber);
      }
      return size;
    }

    public void MergeFrom(MemberAddedNotification other) {
      if (other == null) {
        return;
      }
      if (other.member_ != null) {
        if (member_ == null) {
          member_ = new Bgs.Protocol.Channel.V1.Member();
        }
        Member.MergeFrom(other.Member);
      }
      if (other.channelId_ != null) {
        if (channelId_ == null) {
          channelId_ = new Bgs.Protocol.Channel.V1.ChannelId();
        }
        ChannelId.MergeFrom(other.ChannelId);
      }
      if (other.subscriber_ != null) {
        if (subscriber_ == null) {
          subscriber_ = new Bgs.Protocol.Account.V1.Identity();
        }
        Subscriber.MergeFrom(other.Subscriber);
      }
    }

    public void MergeFrom(pb::CodedInputStream input) {
      uint tag;
      while ((tag = input.ReadTag()) != 0) {
        switch(tag) {
          default:
            input.SkipLastField();
            break;
          case 10: {
            if (member_ == null) {
              member_ = new Bgs.Protocol.Channel.V1.Member();
            }
            input.ReadMessage(member_);
            break;
          }
          case 18: {
            if (channelId_ == null) {
              channelId_ = new Bgs.Protocol.Channel.V1.ChannelId();
            }
            input.ReadMessage(channelId_);
            break;
          }
          case 26: {
            if (subscriber_ == null) {
              subscriber_ = new Bgs.Protocol.Account.V1.Identity();
            }
            input.ReadMessage(subscriber_);
            break;
          }
        }
      }
    }

  }

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

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

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

    public LeaveNotification() {
      OnConstruction();
    }

    partial void OnConstruction();

    public LeaveNotification(LeaveNotification other) : this() {
      AgentId = other.agentId_ != null ? other.AgentId.Clone() : null;
      MemberId = other.memberId_ != null ? other.MemberId.Clone() : null;
      reason_ = other.reason_;
      ChannelId = other.channelId_ != null ? other.ChannelId.Clone() : null;
      Subscriber = other.subscriber_ != null ? other.Subscriber.Clone() : null;
    }

    public LeaveNotification Clone() {
      return new LeaveNotification(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 "member_id" field.</summary>
    public const int MemberIdFieldNumber = 2;
    private Bgs.Protocol.EntityId memberId_;
    public Bgs.Protocol.EntityId MemberId {
      get { return memberId_; }
      set {
        memberId_ = 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 "channel_id" field.</summary>
    public const int ChannelIdFieldNumber = 4;
    private Bgs.Protocol.Channel.V1.ChannelId channelId_;
    public Bgs.Protocol.Channel.V1.ChannelId ChannelId {
      get { return channelId_; }
      set {
        channelId_ = value;
      }
    }

    /// <summary>Field number for the "subscriber" field.</summary>
    public const int SubscriberFieldNumber = 5;
    private Bgs.Protocol.Account.V1.Identity subscriber_;
    public Bgs.Protocol.Account.V1.Identity Subscriber {
      get { return subscriber_; }
      set {
        subscriber_ = value;
      }
    }

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

    public bool Equals(LeaveNotification other) {
      if (ReferenceEquals(other, null)) {
        return false;
      }
      if (ReferenceEquals(other, this)) {
        return true;
      }
      if (!object.Equals(AgentId, other.AgentId)) return false;
      if (!object.Equals(MemberId, other.MemberId)) return false;
      if (Reason != other.Reason) return false;
      if (!object.Equals(ChannelId, other.ChannelId)) return false;
      if (!object.Equals(Subscriber, other.Subscriber)) return false;
      return true;
    }

    public override int GetHashCode() {
      int hash = 1;
      if (agentId_ != null) hash ^= AgentId.GetHashCode();
      if (memberId_ != null) hash ^= MemberId.GetHashCode();
      if (Reason != 0) hash ^= Reason.GetHashCode();
      if (channelId_ != null) hash ^= ChannelId.GetHashCode();
      if (subscriber_ != null) hash ^= Subscriber.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 (memberId_ != null) {
        output.WriteRawTag(18);
        output.WriteMessage(MemberId);
      }
      if (Reason != 0) {
        output.WriteRawTag(24);
        output.WriteUInt32(Reason);
      }
      if (channelId_ != null) {
        output.WriteRawTag(34);
        output.WriteMessage(ChannelId);
      }
      if (subscriber_ != null) {
        output.WriteRawTag(42);
        output.WriteMessage(Subscriber);
      }
    }

    public int CalculateSize() {
      int size = 0;
      if (agentId_ != null) {
        size += 1 + pb::CodedOutputStream.ComputeMessageSize(AgentId);
      }
      if (memberId_ != null) {
        size += 1 + pb::CodedOutputStream.ComputeMessageSize(MemberId);
      }
      if (Reason != 0) {
        size += 1 + pb::CodedOutputStream.ComputeUInt32Size(Reason);
      }
      if (channelId_ != null) {
        size += 1 + pb::CodedOutputStream.ComputeMessageSize(ChannelId);
      }
      if (subscriber_ != null) {
        size += 1 + pb::CodedOutputStream.ComputeMessageSize(Subscriber);
      }
      return size;
    }

    public void MergeFrom(LeaveNotification other) {
      if (other == null) {
        return;
      }
      if (other.agentId_ != null) {
        if (agentId_ == null) {
          agentId_ = new Bgs.Protocol.EntityId();
        }
        AgentId.MergeFrom(other.AgentId);
      }
      if (other.memberId_ != null) {
        if (memberId_ == null) {
          memberId_ = new Bgs.Protocol.EntityId();
        }
        MemberId.MergeFrom(other.MemberId);
      }
      if (other.Reason != 0) {
        Reason = other.Reason;
      }
      if (other.channelId_ != null) {
        if (channelId_ == null) {
          channelId_ = new Bgs.Protocol.Channel.V1.ChannelId();
        }
        ChannelId.MergeFrom(other.ChannelId);
      }
      if (other.subscriber_ != null) {
        if (subscriber_ == null) {
          subscriber_ = new Bgs.Protocol.Account.V1.Identity();
        }
        Subscriber.MergeFrom(other.Subscriber);
      }
    }

    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 (memberId_ == null) {
              memberId_ = new Bgs.Protocol.EntityId();
            }
            input.ReadMessage(memberId_);
            break;
          }
          case 24: {
            Reason = input.ReadUInt32();
            break;
          }
          case 34: {
            if (channelId_ == null) {
              channelId_ = new Bgs.Protocol.Channel.V1.ChannelId();
            }
            input.ReadMessage(channelId_);
            break;
          }
          case 42: {
            if (subscriber_ == null) {
              subscriber_ = new Bgs.Protocol.Account.V1.Identity();
            }
            input.ReadMessage(subscriber_);
            break;
          }
        }
      }
    }

  }

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

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

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

    public MemberRemovedNotification() {
      OnConstruction();
    }

    partial void OnConstruction();

    public MemberRemovedNotification(MemberRemovedNotification other) : this() {
      AgentId = other.agentId_ != null ? other.AgentId.Clone() : null;
      MemberId = other.memberId_ != null ? other.MemberId.Clone() : null;
      reason_ = other.reason_;
      ChannelId = other.channelId_ != null ? other.ChannelId.Clone() : null;
      Subscriber = other.subscriber_ != null ? other.Subscriber.Clone() : null;
    }

    public MemberRemovedNotification Clone() {
      return new MemberRemovedNotification(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 "member_id" field.</summary>
    public const int MemberIdFieldNumber = 2;
    private Bgs.Protocol.EntityId memberId_;
    public Bgs.Protocol.EntityId MemberId {
      get { return memberId_; }
      set {
        memberId_ = 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 "channel_id" field.</summary>
    public const int ChannelIdFieldNumber = 4;
    private Bgs.Protocol.Channel.V1.ChannelId channelId_;
    public Bgs.Protocol.Channel.V1.ChannelId ChannelId {
      get { return channelId_; }
      set {
        channelId_ = value;
      }
    }

    /// <summary>Field number for the "subscriber" field.</summary>
    public const int SubscriberFieldNumber = 5;
    private Bgs.Protocol.Account.V1.Identity subscriber_;
    public Bgs.Protocol.Account.V1.Identity Subscriber {
      get { return subscriber_; }
      set {
        subscriber_ = value;
      }
    }

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

    public bool Equals(MemberRemovedNotification other) {
      if (ReferenceEquals(other, null)) {
        return false;
      }
      if (ReferenceEquals(other, this)) {
        return true;
      }
      if (!object.Equals(AgentId, other.AgentId)) return false;
      if (!object.Equals(MemberId, other.MemberId)) return false;
      if (Reason != other.Reason) return false;
      if (!object.Equals(ChannelId, other.ChannelId)) return false;
      if (!object.Equals(Subscriber, other.Subscriber)) return false;
      return true;
    }

    public override int GetHashCode() {
      int hash = 1;
      if (agentId_ != null) hash ^= AgentId.GetHashCode();
      if (memberId_ != null) hash ^= MemberId.GetHashCode();
      if (Reason != 0) hash ^= Reason.GetHashCode();
      if (channelId_ != null) hash ^= ChannelId.GetHashCode();
      if (subscriber_ != null) hash ^= Subscriber.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 (memberId_ != null) {
        output.WriteRawTag(18);
        output.WriteMessage(MemberId);
      }
      if (Reason != 0) {
        output.WriteRawTag(24);
        output.WriteUInt32(Reason);
      }
      if (channelId_ != null) {
        output.WriteRawTag(34);
        output.WriteMessage(ChannelId);
      }
      if (subscriber_ != null) {
        output.WriteRawTag(42);
        output.WriteMessage(Subscriber);
      }
    }

    public int CalculateSize() {
      int size = 0;
      if (agentId_ != null) {
        size += 1 + pb::CodedOutputStream.ComputeMessageSize(AgentId);
      }
      if (memberId_ != null) {
        size += 1 + pb::CodedOutputStream.ComputeMessageSize(MemberId);
      }
      if (Reason != 0) {
        size += 1 + pb::CodedOutputStream.ComputeUInt32Size(Reason);
      }
      if (channelId_ != null) {
        size += 1 + pb::CodedOutputStream.ComputeMessageSize(ChannelId);
      }
      if (subscriber_ != null) {
        size += 1 + pb::CodedOutputStream.ComputeMessageSize(Subscriber);
      }
      return size;
    }

    public void MergeFrom(MemberRemovedNotification other) {
      if (other == null) {
        return;
      }
      if (other.agentId_ != null) {
        if (agentId_ == null) {
          agentId_ = new Bgs.Protocol.EntityId();
        }
        AgentId.MergeFrom(other.AgentId);
      }
      if (other.memberId_ != null) {
        if (memberId_ == null) {
          memberId_ = new Bgs.Protocol.EntityId();
        }
        MemberId.MergeFrom(other.MemberId);
      }
      if (other.Reason != 0) {
        Reason = other.Reason;
      }
      if (other.channelId_ != null) {
        if (channelId_ == null) {
          channelId_ = new Bgs.Protocol.Channel.V1.ChannelId();
        }
        ChannelId.MergeFrom(other.ChannelId);
      }
      if (other.subscriber_ != null) {
        if (subscriber_ == null) {
          subscriber_ = new Bgs.Protocol.Account.V1.Identity();
        }
        Subscriber.MergeFrom(other.Subscriber);
      }
    }

    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 (memberId_ == null) {
              memberId_ = new Bgs.Protocol.EntityId();
            }
            input.ReadMessage(memberId_);
            break;
          }
          case 24: {
            Reason = input.ReadUInt32();
            break;
          }
          case 34: {
            if (channelId_ == null) {
              channelId_ = new Bgs.Protocol.Channel.V1.ChannelId();
            }
            input.ReadMessage(channelId_);
            break;
          }
          case 42: {
            if (subscriber_ == null) {
              subscriber_ = new Bgs.Protocol.Account.V1.Identity();
            }
            input.ReadMessage(subscriber_);
            break;
          }
        }
      }
    }

  }

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

    public static pbr::MessageDescriptor Descriptor {
      get { return Bgs.Protocol.Channel.V1.ChannelServiceReflection.Descriptor.MessageTypes[12]; }
    }

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

    public SendMessageNotification() {
      OnConstruction();
    }

    partial void OnConstruction();

    public SendMessageNotification(SendMessageNotification other) : this() {
      AgentId = other.agentId_ != null ? other.AgentId.Clone() : null;
      Message = other.message_ != null ? other.Message.Clone() : null;
      requiredPrivileges_ = other.requiredPrivileges_;
      identity_ = other.identity_;
      ChannelId = other.channelId_ != null ? other.ChannelId.Clone() : null;
      Subscriber = other.subscriber_ != null ? other.Subscriber.Clone() : null;
    }

    public SendMessageNotification Clone() {
      return new SendMessageNotification(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 "message" field.</summary>
    public const int MessageFieldNumber = 2;
    private Bgs.Protocol.Channel.V1.Message message_;
    public Bgs.Protocol.Channel.V1.Message Message {
      get { return message_; }
      set {
        message_ = value;
      }
    }

    /// <summary>Field number for the "required_privileges" field.</summary>
    public const int RequiredPrivilegesFieldNumber = 3;
    private ulong requiredPrivileges_;
    public ulong RequiredPrivileges {
      get { return requiredPrivileges_; }
      set {
        requiredPrivileges_ = value;
      }
    }

    /// <summary>Field number for the "identity" field.</summary>
    public const int IdentityFieldNumber = 4;
    private string identity_ = "";
    public string Identity {
      get { return identity_; }
      set {
        identity_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
      }
    }

    /// <summary>Field number for the "channel_id" field.</summary>
    public const int ChannelIdFieldNumber = 5;
    private Bgs.Protocol.Channel.V1.ChannelId channelId_;
    public Bgs.Protocol.Channel.V1.ChannelId ChannelId {
      get { return channelId_; }
      set {
        channelId_ = value;
      }
    }

    /// <summary>Field number for the "subscriber" field.</summary>
    public const int SubscriberFieldNumber = 6;
    private Bgs.Protocol.Account.V1.Identity subscriber_;
    public Bgs.Protocol.Account.V1.Identity Subscriber {
      get { return subscriber_; }
      set {
        subscriber_ = value;
      }
    }

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

    public bool Equals(SendMessageNotification other) {
      if (ReferenceEquals(other, null)) {
        return false;
      }
      if (ReferenceEquals(other, this)) {
        return true;
      }
      if (!object.Equals(AgentId, other.AgentId)) return false;
      if (!object.Equals(Message, other.Message)) return false;
      if (RequiredPrivileges != other.RequiredPrivileges) return false;
      if (Identity != other.Identity) return false;
      if (!object.Equals(ChannelId, other.ChannelId)) return false;
      if (!object.Equals(Subscriber, other.Subscriber)) return false;
      return true;
    }

    public override int GetHashCode() {
      int hash = 1;
      if (agentId_ != null) hash ^= AgentId.GetHashCode();
      if (message_ != null) hash ^= Message.GetHashCode();
      if (RequiredPrivileges != 0UL) hash ^= RequiredPrivileges.GetHashCode();
      if (Identity.Length != 0) hash ^= Identity.GetHashCode();
      if (channelId_ != null) hash ^= ChannelId.GetHashCode();
      if (subscriber_ != null) hash ^= Subscriber.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 (message_ != null) {
        output.WriteRawTag(18);
        output.WriteMessage(Message);
      }
      if (RequiredPrivileges != 0UL) {
        output.WriteRawTag(24);
        output.WriteUInt64(RequiredPrivileges);
      }
      if (Identity.Length != 0) {
        output.WriteRawTag(34);
        output.WriteString(Identity);
      }
      if (channelId_ != null) {
        output.WriteRawTag(42);
        output.WriteMessage(ChannelId);
      }
      if (subscriber_ != null) {
        output.WriteRawTag(50);
        output.WriteMessage(Subscriber);
      }
    }

    public int CalculateSize() {
      int size = 0;
      if (agentId_ != null) {
        size += 1 + pb::CodedOutputStream.ComputeMessageSize(AgentId);
      }
      if (message_ != null) {
        size += 1 + pb::CodedOutputStream.ComputeMessageSize(Message);
      }
      if (RequiredPrivileges != 0UL) {
        size += 1 + pb::CodedOutputStream.ComputeUInt64Size(RequiredPrivileges);
      }
      if (Identity.Length != 0) {
        size += 1 + pb::CodedOutputStream.ComputeStringSize(Identity);
      }
      if (channelId_ != null) {
        size += 1 + pb::CodedOutputStream.ComputeMessageSize(ChannelId);
      }
      if (subscriber_ != null) {
        size += 1 + pb::CodedOutputStream.ComputeMessageSize(Subscriber);
      }
      return size;
    }

    public void MergeFrom(SendMessageNotification other) {
      if (other == null) {
        return;
      }
      if (other.agentId_ != null) {
        if (agentId_ == null) {
          agentId_ = new Bgs.Protocol.EntityId();
        }
        AgentId.MergeFrom(other.AgentId);
      }
      if (other.message_ != null) {
        if (message_ == null) {
          message_ = new Bgs.Protocol.Channel.V1.Message();
        }
        Message.MergeFrom(other.Message);
      }
      if (other.RequiredPrivileges != 0UL) {
        RequiredPrivileges = other.RequiredPrivileges;
      }
      if (other.Identity.Length != 0) {
        Identity = other.Identity;
      }
      if (other.channelId_ != null) {
        if (channelId_ == null) {
          channelId_ = new Bgs.Protocol.Channel.V1.ChannelId();
        }
        ChannelId.MergeFrom(other.ChannelId);
      }
      if (other.subscriber_ != null) {
        if (subscriber_ == null) {
          subscriber_ = new Bgs.Protocol.Account.V1.Identity();
        }
        Subscriber.MergeFrom(other.Subscriber);
      }
    }

    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 (message_ == null) {
              message_ = new Bgs.Protocol.Channel.V1.Message();
            }
            input.ReadMessage(message_);
            break;
          }
          case 24: {
            RequiredPrivileges = input.ReadUInt64();
            break;
          }
          case 34: {
            Identity = input.ReadString();
            break;
          }
          case 42: {
            if (channelId_ == null) {
              channelId_ = new Bgs.Protocol.Channel.V1.ChannelId();
            }
            input.ReadMessage(channelId_);
            break;
          }
          case 50: {
            if (subscriber_ == null) {
              subscriber_ = new Bgs.Protocol.Account.V1.Identity();
            }
            input.ReadMessage(subscriber_);
            break;
          }
        }
      }
    }

  }

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

    public static pbr::MessageDescriptor Descriptor {
      get { return Bgs.Protocol.Channel.V1.ChannelServiceReflection.Descriptor.MessageTypes[13]; }
    }

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

    public UpdateChannelStateNotification() {
      OnConstruction();
    }

    partial void OnConstruction();

    public UpdateChannelStateNotification(UpdateChannelStateNotification other) : this() {
      AgentId = other.agentId_ != null ? other.AgentId.Clone() : null;
      StateChange = other.stateChange_ != null ? other.StateChange.Clone() : null;
      ChannelId = other.channelId_ != null ? other.ChannelId.Clone() : null;
      Subscriber = other.subscriber_ != null ? other.Subscriber.Clone() : null;
    }

    public UpdateChannelStateNotification Clone() {
      return new UpdateChannelStateNotification(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 "state_change" field.</summary>
    public const int StateChangeFieldNumber = 2;
    private Bgs.Protocol.Channel.V1.ChannelState stateChange_;
    public Bgs.Protocol.Channel.V1.ChannelState StateChange {
      get { return stateChange_; }
      set {
        stateChange_ = value;
      }
    }

    /// <summary>Field number for the "channel_id" field.</summary>
    public const int ChannelIdFieldNumber = 3;
    private Bgs.Protocol.Channel.V1.ChannelId channelId_;
    public Bgs.Protocol.Channel.V1.ChannelId ChannelId {
      get { return channelId_; }
      set {
        channelId_ = value;
      }
    }

    /// <summary>Field number for the "subscriber" field.</summary>
    public const int SubscriberFieldNumber = 4;
    private Bgs.Protocol.Account.V1.Identity subscriber_;
    public Bgs.Protocol.Account.V1.Identity Subscriber {
      get { return subscriber_; }
      set {
        subscriber_ = value;
      }
    }

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

    public bool Equals(UpdateChannelStateNotification other) {
      if (ReferenceEquals(other, null)) {
        return false;
      }
      if (ReferenceEquals(other, this)) {
        return true;
      }
      if (!object.Equals(AgentId, other.AgentId)) return false;
      if (!object.Equals(StateChange, other.StateChange)) return false;
      if (!object.Equals(ChannelId, other.ChannelId)) return false;
      if (!object.Equals(Subscriber, other.Subscriber)) return false;
      return true;
    }

    public override int GetHashCode() {
      int hash = 1;
      if (agentId_ != null) hash ^= AgentId.GetHashCode();
      if (stateChange_ != null) hash ^= StateChange.GetHashCode();
      if (channelId_ != null) hash ^= ChannelId.GetHashCode();
      if (subscriber_ != null) hash ^= Subscriber.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 (stateChange_ != null) {
        output.WriteRawTag(18);
        output.WriteMessage(StateChange);
      }
      if (channelId_ != null) {
        output.WriteRawTag(26);
        output.WriteMessage(ChannelId);
      }
      if (subscriber_ != null) {
        output.WriteRawTag(34);
        output.WriteMessage(Subscriber);
      }
    }

    public int CalculateSize() {
      int size = 0;
      if (agentId_ != null) {
        size += 1 + pb::CodedOutputStream.ComputeMessageSize(AgentId);
      }
      if (stateChange_ != null) {
        size += 1 + pb::CodedOutputStream.ComputeMessageSize(StateChange);
      }
      if (channelId_ != null) {
        size += 1 + pb::CodedOutputStream.ComputeMessageSize(ChannelId);
      }
      if (subscriber_ != null) {
        size += 1 + pb::CodedOutputStream.ComputeMessageSize(Subscriber);
      }
      return size;
    }

    public void MergeFrom(UpdateChannelStateNotification other) {
      if (other == null) {
        return;
      }
      if (other.agentId_ != null) {
        if (agentId_ == null) {
          agentId_ = new Bgs.Protocol.EntityId();
        }
        AgentId.MergeFrom(other.AgentId);
      }
      if (other.stateChange_ != null) {
        if (stateChange_ == null) {
          stateChange_ = new Bgs.Protocol.Channel.V1.ChannelState();
        }
        StateChange.MergeFrom(other.StateChange);
      }
      if (other.channelId_ != null) {
        if (channelId_ == null) {
          channelId_ = new Bgs.Protocol.Channel.V1.ChannelId();
        }
        ChannelId.MergeFrom(other.ChannelId);
      }
      if (other.subscriber_ != null) {
        if (subscriber_ == null) {
          subscriber_ = new Bgs.Protocol.Account.V1.Identity();
        }
        Subscriber.MergeFrom(other.Subscriber);
      }
    }

    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 (stateChange_ == null) {
              stateChange_ = new Bgs.Protocol.Channel.V1.ChannelState();
            }
            input.ReadMessage(stateChange_);
            break;
          }
          case 26: {
            if (channelId_ == null) {
              channelId_ = new Bgs.Protocol.Channel.V1.ChannelId();
            }
            input.ReadMessage(channelId_);
            break;
          }
          case 34: {
            if (subscriber_ == null) {
              subscriber_ = new Bgs.Protocol.Account.V1.Identity();
            }
            input.ReadMessage(subscriber_);
            break;
          }
        }
      }
    }

  }

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

    public static pbr::MessageDescriptor Descriptor {
      get { return Bgs.Protocol.Channel.V1.ChannelServiceReflection.Descriptor.MessageTypes[14]; }
    }

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

    public UpdateMemberStateNotification() {
      OnConstruction();
    }

    partial void OnConstruction();

    public UpdateMemberStateNotification(UpdateMemberStateNotification other) : this() {
      AgentId = other.agentId_ != null ? other.AgentId.Clone() : null;
      stateChange_ = other.stateChange_.Clone();
      removedRole_ = other.removedRole_.Clone();
      ChannelId = other.channelId_ != null ? other.ChannelId.Clone() : null;
      Subscriber = other.subscriber_ != null ? other.Subscriber.Clone() : null;
    }

    public UpdateMemberStateNotification Clone() {
      return new UpdateMemberStateNotification(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 "state_change" field.</summary>
    public const int StateChangeFieldNumber = 2;
    private static readonly pb::FieldCodec<Bgs.Protocol.Channel.V1.Member> _repeated_stateChange_codec
        = pb::FieldCodec.ForMessage(18, Bgs.Protocol.Channel.V1.Member.Parser);
    private readonly pbc::RepeatedField<Bgs.Protocol.Channel.V1.Member> stateChange_ = new pbc::RepeatedField<Bgs.Protocol.Channel.V1.Member>();
    public pbc::RepeatedField<Bgs.Protocol.Channel.V1.Member> StateChange {
      get { return stateChange_; }
    }

    /// <summary>Field number for the "removed_role" field.</summary>
    public const int RemovedRoleFieldNumber = 3;
    private static readonly pb::FieldCodec<uint> _repeated_removedRole_codec
        = pb::FieldCodec.ForUInt32(26);
    private readonly pbc::RepeatedField<uint> removedRole_ = new pbc::RepeatedField<uint>();
    public pbc::RepeatedField<uint> RemovedRole {
      get { return removedRole_; }
    }

    /// <summary>Field number for the "channel_id" field.</summary>
    public const int ChannelIdFieldNumber = 4;
    private Bgs.Protocol.Channel.V1.ChannelId channelId_;
    public Bgs.Protocol.Channel.V1.ChannelId ChannelId {
      get { return channelId_; }
      set {
        channelId_ = value;
      }
    }

    /// <summary>Field number for the "subscriber" field.</summary>
    public const int SubscriberFieldNumber = 5;
    private Bgs.Protocol.Account.V1.Identity subscriber_;
    public Bgs.Protocol.Account.V1.Identity Subscriber {
      get { return subscriber_; }
      set {
        subscriber_ = value;
      }
    }

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

    public bool Equals(UpdateMemberStateNotification other) {
      if (ReferenceEquals(other, null)) {
        return false;
      }
      if (ReferenceEquals(other, this)) {
        return true;
      }
      if (!object.Equals(AgentId, other.AgentId)) return false;
      if(!stateChange_.Equals(other.stateChange_)) return false;
      if(!removedRole_.Equals(other.removedRole_)) return false;
      if (!object.Equals(ChannelId, other.ChannelId)) return false;
      if (!object.Equals(Subscriber, other.Subscriber)) return false;
      return true;
    }

    public override int GetHashCode() {
      int hash = 1;
      if (agentId_ != null) hash ^= AgentId.GetHashCode();
      hash ^= stateChange_.GetHashCode();
      hash ^= removedRole_.GetHashCode();
      if (channelId_ != null) hash ^= ChannelId.GetHashCode();
      if (subscriber_ != null) hash ^= Subscriber.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);
      }
      stateChange_.WriteTo(output, _repeated_stateChange_codec);
      removedRole_.WriteTo(output, _repeated_removedRole_codec);
      if (channelId_ != null) {
        output.WriteRawTag(34);
        output.WriteMessage(ChannelId);
      }
      if (subscriber_ != null) {
        output.WriteRawTag(42);
        output.WriteMessage(Subscriber);
      }
    }

    public int CalculateSize() {
      int size = 0;
      if (agentId_ != null) {
        size += 1 + pb::CodedOutputStream.ComputeMessageSize(AgentId);
      }
      size += stateChange_.CalculateSize(_repeated_stateChange_codec);
      size += removedRole_.CalculateSize(_repeated_removedRole_codec);
      if (channelId_ != null) {
        size += 1 + pb::CodedOutputStream.ComputeMessageSize(ChannelId);
      }
      if (subscriber_ != null) {
        size += 1 + pb::CodedOutputStream.ComputeMessageSize(Subscriber);
      }
      return size;
    }

    public void MergeFrom(UpdateMemberStateNotification other) {
      if (other == null) {
        return;
      }
      if (other.agentId_ != null) {
        if (agentId_ == null) {
          agentId_ = new Bgs.Protocol.EntityId();
        }
        AgentId.MergeFrom(other.AgentId);
      }
      stateChange_.Add(other.stateChange_);
      removedRole_.Add(other.removedRole_);
      if (other.channelId_ != null) {
        if (channelId_ == null) {
          channelId_ = new Bgs.Protocol.Channel.V1.ChannelId();
        }
        ChannelId.MergeFrom(other.ChannelId);
      }
      if (other.subscriber_ != null) {
        if (subscriber_ == null) {
          subscriber_ = new Bgs.Protocol.Account.V1.Identity();
        }
        Subscriber.MergeFrom(other.Subscriber);
      }
    }

    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: {
            stateChange_.AddEntriesFrom(input, _repeated_stateChange_codec);
            break;
          }
          case 26:
          case 24: {
            removedRole_.AddEntriesFrom(input, _repeated_removedRole_codec);
            break;
          }
          case 34: {
            if (channelId_ == null) {
              channelId_ = new Bgs.Protocol.Channel.V1.ChannelId();
            }
            input.ReadMessage(channelId_);
            break;
          }
          case 42: {
            if (subscriber_ == null) {
              subscriber_ = new Bgs.Protocol.Account.V1.Identity();
            }
            input.ReadMessage(subscriber_);
            break;
          }
        }
      }
    }

  }

  #endregion

}

#endregion Designer generated code
