// Generated by ProtoGen, Version=2.3.0.277, Culture=neutral, PublicKeyToken=17b3b1f090c3ea48.  DO NOT EDIT!
#pragma warning disable 1591
#region Designer generated code
using pb = global::Google.ProtocolBuffers;
using pbc = global::Google.ProtocolBuffers.Collections;
using pbd = global::Google.ProtocolBuffers.Descriptors;
using scg = global::System.Collections.Generic;
namespace bnet.protocol.channel_invitation {
  
  [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
  [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
  [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.3.0.277")]
  public static partial class ChannelInvitationTypes {
  
    #region Extension registration
    public static void RegisterAllExtensions(pb::ExtensionRegistry registry) {
      registry.Add(global::bnet.protocol.channel_invitation.Invitation.ChannelInvitation);
      registry.Add(global::bnet.protocol.channel_invitation.SendInvitationRequest.ChannelInvitation);
    }
    #endregion
    #region Static variables
    internal static pbd::MessageDescriptor internal__static_bnet_protocol_channel_invitation_Invitation__Descriptor;
    internal static pb::FieldAccess.FieldAccessorTable<global::bnet.protocol.channel_invitation.Invitation, global::bnet.protocol.channel_invitation.Invitation.Builder> internal__static_bnet_protocol_channel_invitation_Invitation__FieldAccessorTable;
    internal static pbd::MessageDescriptor internal__static_bnet_protocol_channel_invitation_SendInvitationRequest__Descriptor;
    internal static pb::FieldAccess.FieldAccessorTable<global::bnet.protocol.channel_invitation.SendInvitationRequest, global::bnet.protocol.channel_invitation.SendInvitationRequest.Builder> internal__static_bnet_protocol_channel_invitation_SendInvitationRequest__FieldAccessorTable;
    internal static pbd::MessageDescriptor internal__static_bnet_protocol_channel_invitation_InvitationCollection__Descriptor;
    internal static pb::FieldAccess.FieldAccessorTable<global::bnet.protocol.channel_invitation.InvitationCollection, global::bnet.protocol.channel_invitation.InvitationCollection.Builder> internal__static_bnet_protocol_channel_invitation_InvitationCollection__FieldAccessorTable;
    #endregion
    #region Descriptor
    public static pbd::FileDescriptor Descriptor {
      get { return descriptor; }
    }
    private static pbd::FileDescriptor descriptor;
    
    static ChannelInvitationTypes() {
      byte[] descriptorData = global::System.Convert.FromBase64String(
          "CjlzZXJ2aWNlL2NoYW5uZWxfaW52aXRhdGlvbi9jaGFubmVsX2ludml0YXRp" + 
          "b25fdHlwZXMucHJvdG8SIGJuZXQucHJvdG9jb2wuY2hhbm5lbF9pbnZpdGF0" + 
          "aW9uGh1saWIvcHJvdG9jb2wvaW52aXRhdGlvbi5wcm90bxoZbGliL3Byb3Rv" + 
          "Y29sL2VudGl0eS5wcm90bxojc2VydmljZS9jaGFubmVsL2NoYW5uZWxfdHlw" + 
          "ZXMucHJvdG8iigIKCkludml0YXRpb24SRgoTY2hhbm5lbF9kZXNjcmlwdGlv" + 
          "bhgBIAIoCzIpLmJuZXQucHJvdG9jb2wuY2hhbm5lbC5DaGFubmVsRGVzY3Jp" + 
          "cHRpb24SFwoIcmVzZXJ2ZWQYAiABKAg6BWZhbHNlEhUKBnJlam9pbhgDIAEo" + 
          "CDoFZmFsc2USFAoMc2VydmljZV90eXBlGAQgASgNMm4KEmNoYW5uZWxfaW52" + 
          "aXRhdGlvbhIkLmJuZXQucHJvdG9jb2wuaW52aXRhdGlvbi5JbnZpdGF0aW9u" + 
          "GGkgASgLMiwuYm5ldC5wcm90b2NvbC5jaGFubmVsX2ludml0YXRpb24uSW52" + 
          "aXRhdGlvbiKDAgoVU2VuZEludml0YXRpb25SZXF1ZXN0EisKCmNoYW5uZWxf" + 
          "aWQYASABKAsyFy5ibmV0LnByb3RvY29sLkVudGl0eUlkEhAKCHJlc2VydmVk" + 
          "GAIgASgIEg4KBnJlam9pbhgDIAEoCBIUCgxzZXJ2aWNlX3R5cGUYBCABKA0y" + 
          "hAEKEmNoYW5uZWxfaW52aXRhdGlvbhIvLmJuZXQucHJvdG9jb2wuaW52aXRh" + 
          "dGlvbi5TZW5kSW52aXRhdGlvblJlcXVlc3QYaSABKAsyNy5ibmV0LnByb3Rv" + 
          "Y29sLmNoYW5uZWxfaW52aXRhdGlvbi5TZW5kSW52aXRhdGlvblJlcXVlc3Qi" + 
          "pAEKFEludml0YXRpb25Db2xsZWN0aW9uEhQKDHNlcnZpY2VfdHlwZRgBIAEo" + 
          "DRIgChhtYXhfcmVjZWl2ZWRfaW52aXRhdGlvbnMYAiABKA0SEQoJb2JqZWN0" + 
          "X2lkGAMgASgEEkEKE3JlY2VpdmVkX2ludml0YXRpb24YBCADKAsyJC5ibmV0" + 
          "LnByb3RvY29sLmludml0YXRpb24uSW52aXRhdGlvbg==");
      pbd::FileDescriptor.InternalDescriptorAssigner assigner = delegate(pbd::FileDescriptor root) {
        descriptor = root;
        internal__static_bnet_protocol_channel_invitation_Invitation__Descriptor = Descriptor.MessageTypes[0];
        internal__static_bnet_protocol_channel_invitation_Invitation__FieldAccessorTable = 
            new pb::FieldAccess.FieldAccessorTable<global::bnet.protocol.channel_invitation.Invitation, global::bnet.protocol.channel_invitation.Invitation.Builder>(internal__static_bnet_protocol_channel_invitation_Invitation__Descriptor,
                new string[] { "ChannelDescription", "Reserved", "Rejoin", "ServiceType", });
        global::bnet.protocol.channel_invitation.Invitation.ChannelInvitation = pb::GeneratedSingleExtension<global::bnet.protocol.channel_invitation.Invitation>.CreateInstance(global::bnet.protocol.channel_invitation.Invitation.Descriptor.Extensions[0]);
        internal__static_bnet_protocol_channel_invitation_SendInvitationRequest__Descriptor = Descriptor.MessageTypes[1];
        internal__static_bnet_protocol_channel_invitation_SendInvitationRequest__FieldAccessorTable = 
            new pb::FieldAccess.FieldAccessorTable<global::bnet.protocol.channel_invitation.SendInvitationRequest, global::bnet.protocol.channel_invitation.SendInvitationRequest.Builder>(internal__static_bnet_protocol_channel_invitation_SendInvitationRequest__Descriptor,
                new string[] { "ChannelId", "Reserved", "Rejoin", "ServiceType", });
        global::bnet.protocol.channel_invitation.SendInvitationRequest.ChannelInvitation = pb::GeneratedSingleExtension<global::bnet.protocol.channel_invitation.SendInvitationRequest>.CreateInstance(global::bnet.protocol.channel_invitation.SendInvitationRequest.Descriptor.Extensions[0]);
        internal__static_bnet_protocol_channel_invitation_InvitationCollection__Descriptor = Descriptor.MessageTypes[2];
        internal__static_bnet_protocol_channel_invitation_InvitationCollection__FieldAccessorTable = 
            new pb::FieldAccess.FieldAccessorTable<global::bnet.protocol.channel_invitation.InvitationCollection, global::bnet.protocol.channel_invitation.InvitationCollection.Builder>(internal__static_bnet_protocol_channel_invitation_InvitationCollection__Descriptor,
                new string[] { "ServiceType", "MaxReceivedInvitations", "ObjectId", "ReceivedInvitation", });
        return null;
      };
      pbd::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData,
          new pbd::FileDescriptor[] {
          global::bnet.protocol.invitation.Proto.Invitation.Descriptor, 
          global::bnet.protocol.Entity.Descriptor, 
          global::bnet.protocol.channel.ChannelTypes.Descriptor, 
          }, assigner);
    }
    #endregion
    
  }
  #region Messages
  [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
  [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
  [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.3.0.277")]
  public sealed partial class Invitation : pb::GeneratedMessage<Invitation, Invitation.Builder> {
    private static readonly Invitation defaultInstance = new Builder().BuildPartial();
    private static readonly string[] _invitationFieldNames = new string[] { "channel_description", "rejoin", "reserved", "service_type" };
    private static readonly uint[] _invitationFieldTags = new uint[] { 10, 24, 16, 32 };
    public static Invitation DefaultInstance {
      get { return defaultInstance; }
    }
    
    public override Invitation DefaultInstanceForType {
      get { return defaultInstance; }
    }
    
    protected override Invitation ThisMessage {
      get { return this; }
    }
    
    public static pbd::MessageDescriptor Descriptor {
      get { return global::bnet.protocol.channel_invitation.ChannelInvitationTypes.internal__static_bnet_protocol_channel_invitation_Invitation__Descriptor; }
    }
    
    protected override pb::FieldAccess.FieldAccessorTable<Invitation, Invitation.Builder> InternalFieldAccessors {
      get { return global::bnet.protocol.channel_invitation.ChannelInvitationTypes.internal__static_bnet_protocol_channel_invitation_Invitation__FieldAccessorTable; }
    }
    
    public const int ChannelInvitationFieldNumber = 105;
    public static pb::GeneratedExtensionBase<global::bnet.protocol.channel_invitation.Invitation> ChannelInvitation;
    public const int ChannelDescriptionFieldNumber = 1;
    private bool hasChannelDescription;
    private global::bnet.protocol.channel.ChannelDescription channelDescription_ = global::bnet.protocol.channel.ChannelDescription.DefaultInstance;
    public bool HasChannelDescription {
      get { return hasChannelDescription; }
    }
    public global::bnet.protocol.channel.ChannelDescription ChannelDescription {
      get { return channelDescription_; }
    }
    
    public const int ReservedFieldNumber = 2;
    private bool hasReserved;
    private bool reserved_;
    public bool HasReserved {
      get { return hasReserved; }
    }
    public bool Reserved {
      get { return reserved_; }
    }
    
    public const int RejoinFieldNumber = 3;
    private bool hasRejoin;
    private bool rejoin_;
    public bool HasRejoin {
      get { return hasRejoin; }
    }
    public bool Rejoin {
      get { return rejoin_; }
    }
    
    public const int ServiceTypeFieldNumber = 4;
    private bool hasServiceType;
    private uint serviceType_;
    public bool HasServiceType {
      get { return hasServiceType; }
    }
    public uint ServiceType {
      get { return serviceType_; }
    }
    
    public override bool IsInitialized {
      get {
        if (!hasChannelDescription) return false;
        if (!ChannelDescription.IsInitialized) return false;
        return true;
      }
    }
    
    public override void WriteTo(pb::ICodedOutputStream output) {
      int size = SerializedSize;
      string[] field_names = _invitationFieldNames;
      if (hasChannelDescription) {
        output.WriteMessage(1, field_names[0], ChannelDescription);
      }
      if (hasReserved) {
        output.WriteBool(2, field_names[2], Reserved);
      }
      if (hasRejoin) {
        output.WriteBool(3, field_names[1], Rejoin);
      }
      if (hasServiceType) {
        output.WriteUInt32(4, field_names[3], ServiceType);
      }
      UnknownFields.WriteTo(output);
    }
    
    private int memoizedSerializedSize = -1;
    public override int SerializedSize {
      get {
        int size = memoizedSerializedSize;
        if (size != -1) return size;
        
        size = 0;
        if (hasChannelDescription) {
          size += pb::CodedOutputStream.ComputeMessageSize(1, ChannelDescription);
        }
        if (hasReserved) {
          size += pb::CodedOutputStream.ComputeBoolSize(2, Reserved);
        }
        if (hasRejoin) {
          size += pb::CodedOutputStream.ComputeBoolSize(3, Rejoin);
        }
        if (hasServiceType) {
          size += pb::CodedOutputStream.ComputeUInt32Size(4, ServiceType);
        }
        size += UnknownFields.SerializedSize;
        memoizedSerializedSize = size;
        return size;
      }
    }
    
    public static Invitation ParseFrom(pb::ByteString data) {
      return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed();
    }
    public static Invitation ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) {
      return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed();
    }
    public static Invitation ParseFrom(byte[] data) {
      return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed();
    }
    public static Invitation ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) {
      return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed();
    }
    public static Invitation ParseFrom(global::System.IO.Stream input) {
      return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed();
    }
    public static Invitation ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) {
      return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed();
    }
    public static Invitation ParseDelimitedFrom(global::System.IO.Stream input) {
      return CreateBuilder().MergeDelimitedFrom(input).BuildParsed();
    }
    public static Invitation ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) {
      return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed();
    }
    public static Invitation ParseFrom(pb::ICodedInputStream input) {
      return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed();
    }
    public static Invitation ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
      return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed();
    }
    public static Builder CreateBuilder() { return new Builder(); }
    public override Builder ToBuilder() { return CreateBuilder(this); }
    public override Builder CreateBuilderForType() { return new Builder(); }
    public static Builder CreateBuilder(Invitation prototype) {
      return (Builder) new Builder().MergeFrom(prototype);
    }
    
    [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
    [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.3.0.277")]
    public sealed partial class Builder : pb::GeneratedBuilder<Invitation, Builder> {
      protected override Builder ThisBuilder {
        get { return this; }
      }
      public Builder() {}
      
      Invitation result = new Invitation();
      
      protected override Invitation MessageBeingBuilt {
        get { return result; }
      }
      
      public override Builder Clear() {
        result = new Invitation();
        return this;
      }
      
      public override Builder Clone() {
        return new Builder().MergeFrom(result);
      }
      
      public override pbd::MessageDescriptor DescriptorForType {
        get { return global::bnet.protocol.channel_invitation.Invitation.Descriptor; }
      }
      
      public override Invitation DefaultInstanceForType {
        get { return global::bnet.protocol.channel_invitation.Invitation.DefaultInstance; }
      }
      
      public override Invitation BuildPartial() {
        if (result == null) {
          throw new global::System.InvalidOperationException("build() has already been called on this Builder");
        }
        Invitation returnMe = result;
        result = null;
        return returnMe;
      }
      
      public override Builder MergeFrom(pb::IMessage other) {
        if (other is Invitation) {
          return MergeFrom((Invitation) other);
        } else {
          base.MergeFrom(other);
          return this;
        }
      }
      
      public override Builder MergeFrom(Invitation other) {
        if (other == global::bnet.protocol.channel_invitation.Invitation.DefaultInstance) return this;
        if (other.HasChannelDescription) {
          MergeChannelDescription(other.ChannelDescription);
        }
        if (other.HasReserved) {
          Reserved = other.Reserved;
        }
        if (other.HasRejoin) {
          Rejoin = other.Rejoin;
        }
        if (other.HasServiceType) {
          ServiceType = other.ServiceType;
        }
        this.MergeUnknownFields(other.UnknownFields);
        return this;
      }
      
      public override Builder MergeFrom(pb::ICodedInputStream input) {
        return MergeFrom(input, pb::ExtensionRegistry.Empty);
      }
      
      public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
        pb::UnknownFieldSet.Builder unknownFields = null;
        uint tag;
        string field_name;
        while (input.ReadTag(out tag, out field_name)) {
          if(tag == 0 && field_name != null) {
            int field_ordinal = global::System.Array.BinarySearch(_invitationFieldNames, field_name, global::System.StringComparer.Ordinal);
            if(field_ordinal >= 0)
              tag = _invitationFieldTags[field_ordinal];
            else {
              if (unknownFields == null) {
                unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields);
              }
              ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name);
              continue;
            }
          }
          switch (tag) {
            case 0: {
              throw pb::InvalidProtocolBufferException.InvalidTag();
            }
            default: {
              if (pb::WireFormat.IsEndGroupTag(tag)) {
                if (unknownFields != null) {
                  this.UnknownFields = unknownFields.Build();
                }
                return this;
              }
              if (unknownFields == null) {
                unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields);
              }
              ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name);
              break;
            }
            case 10: {
              global::bnet.protocol.channel.ChannelDescription.Builder subBuilder = global::bnet.protocol.channel.ChannelDescription.CreateBuilder();
              if (result.hasChannelDescription) {
                subBuilder.MergeFrom(ChannelDescription);
              }
              input.ReadMessage(subBuilder, extensionRegistry);
              ChannelDescription = subBuilder.BuildPartial();
              break;
            }
            case 16: {
              result.hasReserved = input.ReadBool(ref result.reserved_);
              break;
            }
            case 24: {
              result.hasRejoin = input.ReadBool(ref result.rejoin_);
              break;
            }
            case 32: {
              result.hasServiceType = input.ReadUInt32(ref result.serviceType_);
              break;
            }
          }
        }
        
        if (unknownFields != null) {
          this.UnknownFields = unknownFields.Build();
        }
        return this;
      }
      
      
      public bool HasChannelDescription {
       get { return result.hasChannelDescription; }
      }
      public global::bnet.protocol.channel.ChannelDescription ChannelDescription {
        get { return result.ChannelDescription; }
        set { SetChannelDescription(value); }
      }
      public Builder SetChannelDescription(global::bnet.protocol.channel.ChannelDescription value) {
        pb::ThrowHelper.ThrowIfNull(value, "value");
        result.hasChannelDescription = true;
        result.channelDescription_ = value;
        return this;
      }
      public Builder SetChannelDescription(global::bnet.protocol.channel.ChannelDescription.Builder builderForValue) {
        pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue");
        result.hasChannelDescription = true;
        result.channelDescription_ = builderForValue.Build();
        return this;
      }
      public Builder MergeChannelDescription(global::bnet.protocol.channel.ChannelDescription value) {
        pb::ThrowHelper.ThrowIfNull(value, "value");
        if (result.hasChannelDescription &&
            result.channelDescription_ != global::bnet.protocol.channel.ChannelDescription.DefaultInstance) {
            result.channelDescription_ = global::bnet.protocol.channel.ChannelDescription.CreateBuilder(result.channelDescription_).MergeFrom(value).BuildPartial();
        } else {
          result.channelDescription_ = value;
        }
        result.hasChannelDescription = true;
        return this;
      }
      public Builder ClearChannelDescription() {
        result.hasChannelDescription = false;
        result.channelDescription_ = global::bnet.protocol.channel.ChannelDescription.DefaultInstance;
        return this;
      }
      
      public bool HasReserved {
        get { return result.hasReserved; }
      }
      public bool Reserved {
        get { return result.Reserved; }
        set { SetReserved(value); }
      }
      public Builder SetReserved(bool value) {
        result.hasReserved = true;
        result.reserved_ = value;
        return this;
      }
      public Builder ClearReserved() {
        result.hasReserved = false;
        result.reserved_ = false;
        return this;
      }
      
      public bool HasRejoin {
        get { return result.hasRejoin; }
      }
      public bool Rejoin {
        get { return result.Rejoin; }
        set { SetRejoin(value); }
      }
      public Builder SetRejoin(bool value) {
        result.hasRejoin = true;
        result.rejoin_ = value;
        return this;
      }
      public Builder ClearRejoin() {
        result.hasRejoin = false;
        result.rejoin_ = false;
        return this;
      }
      
      public bool HasServiceType {
        get { return result.hasServiceType; }
      }
      public uint ServiceType {
        get { return result.ServiceType; }
        set { SetServiceType(value); }
      }
      public Builder SetServiceType(uint value) {
        result.hasServiceType = true;
        result.serviceType_ = value;
        return this;
      }
      public Builder ClearServiceType() {
        result.hasServiceType = false;
        result.serviceType_ = 0;
        return this;
      }
    }
    static Invitation() {
      object.ReferenceEquals(global::bnet.protocol.channel_invitation.ChannelInvitationTypes.Descriptor, null);
    }
  }
  
  [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
  [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
  [global::System.CodeDom.Compiler.GeneratedCodeAttribute("ProtoGen", "2.3.0.277")]
  public sealed partial class SendInvitationRequest : pb::GeneratedMessage<SendInvitationRequest, SendInvitationRequest.Builder> {
    private static readonly SendInvitationRequest defaultInstance = new Builder().BuildPartial();
    private static readonly string[] _sendInvitationRequestFieldNames = new string[] { "channel_id", "rejoin", "reserved", "service_type" };
    private static readonly uint[] _sendInvitationRequestFieldTags = new uint[] { 10, 24, 16, 32 };
    public static SendInvitationRequest DefaultInstance {
      get { return defaultInstance; }
    }
    
    public override SendInvitationRequest DefaultInstanceForType {
      get { return defaultInstance; }
    }
    
    protected override SendInvitationRequest ThisMessage {
      get { return this; }
    }
    
    public static pbd::MessageDescriptor Descriptor {
      get { return global::bnet.protocol.channel_invitation.ChannelInvitationTypes.internal__static_bnet_protocol_channel_invitation_SendInvitationRequest__Descriptor; }
    }
    
    protected override pb::FieldAccess.FieldAccessorTable<SendInvitationRequest, SendInvitationRequest.Builder> InternalFieldAccessors {
      get { return global::bnet.protocol.channel_invitation.ChannelInvitationTypes.internal__static_bnet_protocol_channel_invitation_SendInvitationRequest__FieldAccessorTable; }
    }
    
    public const int ChannelInvitationFieldNumber = 105;
    public static pb::GeneratedExtensionBase<global::bnet.protocol.channel_invitation.SendInvitationRequest> ChannelInvitation;
    public const int ChannelIdFieldNumber = 1;
    private bool hasChannelId;
    private global::bnet.protocol.EntityId channelId_ = global::bnet.protocol.EntityId.DefaultInstance;
    public bool HasChannelId {
      get { return hasChannelId; }
    }
    public global::bnet.protocol.EntityId ChannelId {
      get { return channelId_; }
    }
    
    public const int ReservedFieldNumber = 2;
    private bool hasReserved;
    private bool reserved_;
    public bool HasReserved {
      get { return hasReserved; }
    }
    public bool Reserved {
      get { return reserved_; }
    }
    
    public const int RejoinFieldNumber = 3;
    private bool hasRejoin;
    private bool rejoin_;
    public bool HasRejoin {
      get { return hasRejoin; }
    }
    public bool Rejoin {
      get { return rejoin_; }
    }
    
    public const int ServiceTypeFieldNumber = 4;
    private bool hasServiceType;
    private uint serviceType_;
    public bool HasServiceType {
      get { return hasServiceType; }
    }
    public uint ServiceType {
      get { return serviceType_; }
    }
    
    public override bool IsInitialized {
      get {
        if (HasChannelId) {
          if (!ChannelId.IsInitialized) return false;
        }
        return true;
      }
    }
    
    public override void WriteTo(pb::ICodedOutputStream output) {
      int size = SerializedSize;
      string[] field_names = _sendInvitationRequestFieldNames;
      if (hasChannelId) {
        output.WriteMessage(1, field_names[0], ChannelId);
      }
      if (hasReserved) {
        output.WriteBool(2, field_names[2], Reserved);
      }
      if (hasRejoin) {
        output.WriteBool(3, field_names[1], Rejoin);
      }
      if (hasServiceType) {
        output.WriteUInt32(4, field_names[3], ServiceType);
      }
      UnknownFields.WriteTo(output);
    }
    
    private int memoizedSerializedSize = -1;
    public override int SerializedSize {
      get {
        int size = memoizedSerializedSize;
        if (size != -1) return size;
        
        size = 0;
        if (hasChannelId) {
          size += pb::CodedOutputStream.ComputeMessageSize(1, ChannelId);
        }
        if (hasReserved) {
          size += pb::CodedOutputStream.ComputeBoolSize(2, Reserved);
        }
        if (hasRejoin) {
          size += pb::CodedOutputStream.ComputeBoolSize(3, Rejoin);
        }
        if (hasServiceType) {
          size += pb::CodedOutputStream.ComputeUInt32Size(4, ServiceType);
        }
        size += UnknownFields.SerializedSize;
        memoizedSerializedSize = size;
        return size;
      }
    }
    
    public static SendInvitationRequest ParseFrom(pb::ByteString data) {
      return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed();
    }
    public static SendInvitationRequest ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) {
      return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed();
    }
    public static SendInvitationRequest ParseFrom(byte[] data) {
      return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed();
    }
    public static SendInvitationRequest ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) {
      return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed();
    }
    public static SendInvitationRequest ParseFrom(global::System.IO.Stream input) {
      return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed();
    }
    public static SendInvitationRequest ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) {
      return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed();
    }
    public static SendInvitationRequest ParseDelimitedFrom(global::System.IO.Stream input) {
      return CreateBuilder().MergeDelimitedFrom(input).BuildParsed();
    }
    public static SendInvitationRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) {
      return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed();
    }
    public static SendInvitationRequest ParseFrom(pb::ICodedInputStream input) {
      return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed();
    }
    public static SendInvitationRequest ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
      return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed();
    }
    public static Builder CreateBuilder() { return new Builder(); }
    public override Builder ToBuilder() { return CreateBuilder(this); }
    public override Builder CreateBuilderForType() { return new Builder(); }
    public static Builder CreateBuilder(SendInvitationRequest prototype) {


Answer:       return (Builder) new Builder().MergeFrom(prototype);