// Generated by the protocol buffer compiler.  DO NOT EDIT!

using pb = global::Google.ProtocolBuffers;
using pbc = global::Google.ProtocolBuffers.Collections;
using pbd = global::Google.ProtocolBuffers.Descriptors;
using scg = global::System.Collections.Generic;
namespace Sirikata.Protocol._PBJ_Internal {
  
  public static partial class MessageHeader {
  
    #region Extension registration
    public static void RegisterAllExtensions(pb::ExtensionRegistry registry) {
    }
    #endregion
    #region Static variables
    internal static pbd::MessageDescriptor internal__static_Sirikata_Protocol__PBJ_Internal_Header__Descriptor;
    internal static pb::FieldAccess.FieldAccessorTable<global::Sirikata.Protocol._PBJ_Internal.Header, global::Sirikata.Protocol._PBJ_Internal.Header.Builder> internal__static_Sirikata_Protocol__PBJ_Internal_Header__FieldAccessorTable;
    #endregion
    #region Descriptor
    public static pbd::FileDescriptor Descriptor {
      get { return descriptor; }
    }
    private static pbd::FileDescriptor descriptor;
    
    static MessageHeader() {
      byte[] descriptorData = global::System.Convert.FromBase64String(
          "ChNNZXNzYWdlSGVhZGVyLnByb3RvEh9TaXJpa2F0YS5Qcm90b2NvbC5fUEJK" + 
          "X0ludGVybmFsIooDCgZIZWFkZXISFQoNc291cmNlX29iamVjdBgBIAEoDBIT" + 
          "Cgtzb3VyY2VfcG9ydBgDIAEoDRIVCgxzb3VyY2Vfc3BhY2UYgAwgASgMEhoK" + 
          "EmRlc3RpbmF0aW9uX29iamVjdBgCIAEoDBIYChBkZXN0aW5hdGlvbl9wb3J0" + 
          "GAQgASgNEhoKEWRlc3RpbmF0aW9uX3NwYWNlGIEMIAEoDBIKCgJpZBgHIAEo" + 
          "AxIQCghyZXBseV9pZBgIIAEoAxJMCg1yZXR1cm5fc3RhdHVzGIAOIAEoDjI0" + 
          "LlNpcmlrYXRhLlByb3RvY29sLl9QQkpfSW50ZXJuYWwuSGVhZGVyLlJldHVy" + 
          "blN0YXR1cyJ/CgxSZXR1cm5TdGF0dXMSCwoHU1VDQ0VTUxAAEhMKD05FVFdP" + 
          "UktfRkFJTFVSRRABEhMKD1RJTUVPVVRfRkFJTFVSRRADEhIKDlBST1RPQ09M" + 
          "X0VSUk9SEAQSEAoMUE9SVF9GQUlMVVJFEAUSEgoOVU5LTk9XTl9PQkpFQ1QQ" + 
          "Bg==");
      pbd::FileDescriptor.InternalDescriptorAssigner assigner = delegate(pbd::FileDescriptor root) {
        descriptor = root;
        internal__static_Sirikata_Protocol__PBJ_Internal_Header__Descriptor = Descriptor.MessageTypes[0];
        internal__static_Sirikata_Protocol__PBJ_Internal_Header__FieldAccessorTable = 
            new pb::FieldAccess.FieldAccessorTable<global::Sirikata.Protocol._PBJ_Internal.Header, global::Sirikata.Protocol._PBJ_Internal.Header.Builder>(internal__static_Sirikata_Protocol__PBJ_Internal_Header__Descriptor,
                new string[] { "SourceObject", "SourcePort", "SourceSpace", "DestinationObject", "DestinationPort", "DestinationSpace", "Id", "ReplyId", "ReturnStatus", });
        return null;
      };
      pbd::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData,
          new pbd::FileDescriptor[] {
          }, assigner);
    }
    #endregion
    
  }
  #region Messages
  public sealed partial class Header : pb::GeneratedMessage<Header, Header.Builder> {
    private static readonly Header defaultInstance = new Builder().BuildPartial();
    public static Header DefaultInstance {
      get { return defaultInstance; }
    }
    
    public override Header DefaultInstanceForType {
      get { return defaultInstance; }
    }
    
    protected override Header ThisMessage {
      get { return this; }
    }
    
    public static pbd::MessageDescriptor Descriptor {
      get { return global::Sirikata.Protocol._PBJ_Internal.MessageHeader.internal__static_Sirikata_Protocol__PBJ_Internal_Header__Descriptor; }
    }
    
    protected override pb::FieldAccess.FieldAccessorTable<Header, Header.Builder> InternalFieldAccessors {
      get { return global::Sirikata.Protocol._PBJ_Internal.MessageHeader.internal__static_Sirikata_Protocol__PBJ_Internal_Header__FieldAccessorTable; }
    }
    
    #region Nested types
    public static class Types {
      public enum ReturnStatus {
        SUCCESS = 0,
        NETWORK_FAILURE = 1,
        TIMEOUT_FAILURE = 3,
        PROTOCOL_ERROR = 4,
        PORT_FAILURE = 5,
        UNKNOWN_OBJECT = 6,
      }
      
    }
    #endregion
    
    public const int SourceObjectFieldNumber = 1;
    private bool hasSourceObject;
    private pb::ByteString sourceObject_ = pb::ByteString.Empty;
    public bool HasSourceObject {
      get { return hasSourceObject; }
    }
    public pb::ByteString SourceObject {
      get { return sourceObject_; }
    }
    
    public const int SourcePortFieldNumber = 3;
    private bool hasSourcePort;
    private uint sourcePort_ = 0;
    public bool HasSourcePort {
      get { return hasSourcePort; }
    }
    [global::System.CLSCompliant(false)]
    public uint SourcePort {
      get { return sourcePort_; }
    }
    
    public const int SourceSpaceFieldNumber = 1536;
    private bool hasSourceSpace;
    private pb::ByteString sourceSpace_ = pb::ByteString.Empty;
    public bool HasSourceSpace {
      get { return hasSourceSpace; }
    }
    public pb::ByteString SourceSpace {
      get { return sourceSpace_; }
    }
    
    public const int DestinationObjectFieldNumber = 2;
    private bool hasDestinationObject;
    private pb::ByteString destinationObject_ = pb::ByteString.Empty;
    public bool HasDestinationObject {
      get { return hasDestinationObject; }
    }
    public pb::ByteString DestinationObject {
      get { return destinationObject_; }
    }
    
    public const int DestinationPortFieldNumber = 4;
    private bool hasDestinationPort;
    private uint destinationPort_ = 0;
    public bool HasDestinationPort {
      get { return hasDestinationPort; }
    }
    [global::System.CLSCompliant(false)]
    public uint DestinationPort {
      get { return destinationPort_; }
    }
    
    public const int DestinationSpaceFieldNumber = 1537;
    private bool hasDestinationSpace;
    private pb::ByteString destinationSpace_ = pb::ByteString.Empty;
    public bool HasDestinationSpace {
      get { return hasDestinationSpace; }
    }
    public pb::ByteString DestinationSpace {
      get { return destinationSpace_; }
    }
    
    public const int IdFieldNumber = 7;
    private bool hasId;
    private long id_ = 0L;
    public bool HasId {
      get { return hasId; }
    }
    public long Id {
      get { return id_; }
    }
    
    public const int ReplyIdFieldNumber = 8;
    private bool hasReplyId;
    private long replyId_ = 0L;
    public bool HasReplyId {
      get { return hasReplyId; }
    }
    public long ReplyId {
      get { return replyId_; }
    }
    
    public const int ReturnStatusFieldNumber = 1792;
    private bool hasReturnStatus;
    private global::Sirikata.Protocol._PBJ_Internal.Header.Types.ReturnStatus returnStatus_ = global::Sirikata.Protocol._PBJ_Internal.Header.Types.ReturnStatus.SUCCESS;
    public bool HasReturnStatus {
      get { return hasReturnStatus; }
    }
    public global::Sirikata.Protocol._PBJ_Internal.Header.Types.ReturnStatus ReturnStatus {
      get { return returnStatus_; }
    }
    
    public override bool IsInitialized {
      get {
        return true;
      }
    }
    
    public override void WriteTo(pb::CodedOutputStream output) {
      if (HasSourceObject) {
        output.WriteBytes(1, SourceObject);
      }
      if (HasDestinationObject) {
        output.WriteBytes(2, DestinationObject);
      }
      if (HasSourcePort) {
        output.WriteUInt32(3, SourcePort);
      }
      if (HasDestinationPort) {
        output.WriteUInt32(4, DestinationPort);
      }
      if (HasId) {
        output.WriteInt64(7, Id);
      }
      if (HasReplyId) {
        output.WriteInt64(8, ReplyId);
      }
      if (HasSourceSpace) {
        output.WriteBytes(1536, SourceSpace);
      }
      if (HasDestinationSpace) {
        output.WriteBytes(1537, DestinationSpace);
      }
      if (HasReturnStatus) {
        output.WriteEnum(1792, (int) ReturnStatus);
      }
      UnknownFields.WriteTo(output);
    }
    
    private int memoizedSerializedSize = -1;
    public override int SerializedSize {
      get {
        int size = memoizedSerializedSize;
        if (size != -1) return size;
        
        size = 0;
        if (HasSourceObject) {
          size += pb::CodedOutputStream.ComputeBytesSize(1, SourceObject);
        }
        if (HasSourcePort) {
          size += pb::CodedOutputStream.ComputeUInt32Size(3, SourcePort);
        }
        if (HasSourceSpace) {
          size += pb::CodedOutputStream.ComputeBytesSize(1536, SourceSpace);
        }
        if (HasDestinationObject) {
          size += pb::CodedOutputStream.ComputeBytesSize(2, DestinationObject);
        }
        if (HasDestinationPort) {
          size += pb::CodedOutputStream.ComputeUInt32Size(4, DestinationPort);
        }
        if (HasDestinationSpace) {
          size += pb::CodedOutputStream.ComputeBytesSize(1537, DestinationSpace);
        }
        if (HasId) {
          size += pb::CodedOutputStream.ComputeInt64Size(7, Id);
        }
        if (HasReplyId) {
          size += pb::CodedOutputStream.ComputeInt64Size(8, ReplyId);
        }
        if (HasReturnStatus) {
          size += pb::CodedOutputStream.ComputeEnumSize(1792, (int) ReturnStatus);
        }
        size += UnknownFields.SerializedSize;
        memoizedSerializedSize = size;
        return size;
      }
    }
    
    public static Header ParseFrom(pb::ByteString data) {
      return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed();
    }
    public static Header ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) {
      return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed();
    }
    public static Header ParseFrom(byte[] data) {
      return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed();
    }
    public static Header ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) {
      return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed();
    }
    public static Header ParseFrom(global::System.IO.Stream input) {
      return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed();
    }
    public static Header ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) {
      return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed();
    }
    public static Header ParseDelimitedFrom(global::System.IO.Stream input) {
      return CreateBuilder().MergeDelimitedFrom(input).BuildParsed();
    }
    public static Header ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) {
      return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed();
    }
    public static Header ParseFrom(pb::CodedInputStream input) {
      return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed();
    }
    public static Header ParseFrom(pb::CodedInputStream 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(Header prototype) {
      return (Builder) new Builder().MergeFrom(prototype);
    }
    
    public sealed partial class Builder : pb::GeneratedBuilder<Header, Builder> {
      protected override Builder ThisBuilder {
        get { return this; }
      }
      public Builder() {}
      
      Header result = new Header();
      
      protected override Header MessageBeingBuilt {
        get { return result; }
      }
      
      public override Builder Clear() {
        result = new Header();
        return this;
      }
      
      public override Builder Clone() {
        return new Builder().MergeFrom(result);
      }
      
      public override pbd::MessageDescriptor DescriptorForType {
        get { return global::Sirikata.Protocol._PBJ_Internal.Header.Descriptor; }
      }
      
      public override Header DefaultInstanceForType {
        get { return global::Sirikata.Protocol._PBJ_Internal.Header.DefaultInstance; }
      }
      
      public override Header BuildPartial() {
        if (result == null) {
          throw new global::System.InvalidOperationException("build() has already been called on this Builder");
        }
        Header returnMe = result;
        result = null;
        return returnMe;
      }
      
      public override Builder MergeFrom(pb::IMessage other) {
        if (other is Header) {
          return MergeFrom((Header) other);
        } else {
          base.MergeFrom(other);
          return this;
        }
      }
      
      public override Builder MergeFrom(Header other) {
        if (other == global::Sirikata.Protocol._PBJ_Internal.Header.DefaultInstance) return this;
        if (other.HasSourceObject) {
          SourceObject = other.SourceObject;
        }
        if (other.HasSourcePort) {
          SourcePort = other.SourcePort;
        }
        if (other.HasSourceSpace) {
          SourceSpace = other.SourceSpace;
        }
        if (other.HasDestinationObject) {
          DestinationObject = other.DestinationObject;
        }
        if (other.HasDestinationPort) {
          DestinationPort = other.DestinationPort;
        }
        if (other.HasDestinationSpace) {
          DestinationSpace = other.DestinationSpace;
        }
        if (other.HasId) {
          Id = other.Id;
        }
        if (other.HasReplyId) {
          ReplyId = other.ReplyId;
        }
        if (other.HasReturnStatus) {
          ReturnStatus = other.ReturnStatus;
        }
        this.MergeUnknownFields(other.UnknownFields);
        return this;
      }
      
      public override Builder MergeFrom(pb::CodedInputStream input) {
        return MergeFrom(input, pb::ExtensionRegistry.Empty);
      }
      
      public override Builder MergeFrom(pb::CodedInputStream input, pb::ExtensionRegistry extensionRegistry) {
        pb::UnknownFieldSet.Builder unknownFields = null;
        while (true) {
          uint tag = input.ReadTag();
          switch (tag) {
            case 0: {
              if (unknownFields != null) {
                this.UnknownFields = unknownFields.Build();
              }
              return this;
            }
            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);
              break;
            }
            case 10: {
              SourceObject = input.ReadBytes();
              break;
            }
            case 18: {
              DestinationObject = input.ReadBytes();
              break;
            }
            case 24: {
              SourcePort = input.ReadUInt32();
              break;
            }
            case 32: {
              DestinationPort = input.ReadUInt32();
              break;
            }
            case 56: {
              Id = input.ReadInt64();
              break;
            }
            case 64: {
              ReplyId = input.ReadInt64();
              break;
            }
            case 12290: {
              SourceSpace = input.ReadBytes();
              break;
            }
            case 12298: {
              DestinationSpace = input.ReadBytes();
              break;
            }
            case 14336: {
              int rawValue = input.ReadEnum();
              if (!global::System.Enum.IsDefined(typeof(global::Sirikata.Protocol._PBJ_Internal.Header.Types.ReturnStatus), rawValue)) {
                if (unknownFields == null) {
                  unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields);
                }
                unknownFields.MergeVarintField(1792, (ulong) rawValue);
              } else {
                ReturnStatus = (global::Sirikata.Protocol._PBJ_Internal.Header.Types.ReturnStatus) rawValue;
              }
              break;
            }
          }
        }
      }
      
      
      public bool HasSourceObject {
        get { return result.HasSourceObject; }
      }
      public pb::ByteString SourceObject {
        get { return result.SourceObject; }
        set { SetSourceObject(value); }
      }
      public Builder SetSourceObject(pb::ByteString value) {
        pb::ThrowHelper.ThrowIfNull(value, "value");
        result.hasSourceObject = true;
        result.sourceObject_ = value;
        return this;
      }
      public Builder ClearSourceObject() {
        result.hasSourceObject = false;
        result.sourceObject_ = pb::ByteString.Empty;
        return this;
      }
      
      public bool HasSourcePort {
        get { return result.HasSourcePort; }
      }
      [global::System.CLSCompliant(false)]
      public uint SourcePort {
        get { return result.SourcePort; }
        set { SetSourcePort(value); }
      }
      [global::System.CLSCompliant(false)]
      public Builder SetSourcePort(uint value) {
        result.hasSourcePort = true;
        result.sourcePort_ = value;
        return this;
      }
      public Builder ClearSourcePort() {
        result.hasSourcePort = false;
        result.sourcePort_ = 0;
        return this;
      }
      
      public bool HasSourceSpace {
        get { return result.HasSourceSpace; }
      }
      public pb::ByteString SourceSpace {
        get { return result.SourceSpace; }
        set { SetSourceSpace(value); }
      }
      public Builder SetSourceSpace(pb::ByteString value) {
        pb::ThrowHelper.ThrowIfNull(value, "value");
        result.hasSourceSpace = true;
        result.sourceSpace_ = value;
        return this;
      }
      public Builder ClearSourceSpace() {
        result.hasSourceSpace = false;
        result.sourceSpace_ = pb::ByteString.Empty;
        return this;
      }
      
      public bool HasDestinationObject {
        get { return result.HasDestinationObject; }
      }
      public pb::ByteString DestinationObject {
        get { return result.DestinationObject; }
        set { SetDestinationObject(value); }
      }
      public Builder SetDestinationObject(pb::ByteString value) {
        pb::ThrowHelper.ThrowIfNull(value, "value");
        result.hasDestinationObject = true;
        result.destinationObject_ = value;
        return this;
      }
      public Builder ClearDestinationObject() {
        result.hasDestinationObject = false;
        result.destinationObject_ = pb::ByteString.Empty;
        return this;
      }
      
      public bool HasDestinationPort {
        get { return result.HasDestinationPort; }
      }
      [global::System.CLSCompliant(false)]
      public uint DestinationPort {
        get { return result.DestinationPort; }
        set { SetDestinationPort(value); }
      }
      [global::System.CLSCompliant(false)]
      public Builder SetDestinationPort(uint value) {
        result.hasDestinationPort = true;
        result.destinationPort_ = value;
        return this;
      }
      public Builder ClearDestinationPort() {
        result.hasDestinationPort = false;
        result.destinationPort_ = 0;
        return this;
      }
      
      public bool HasDestinationSpace {
        get { return result.HasDestinationSpace; }
      }
      public pb::ByteString DestinationSpace {
        get { return result.DestinationSpace; }
        set { SetDestinationSpace(value); }
      }
      public Builder SetDestinationSpace(pb::ByteString value) {
        pb::ThrowHelper.ThrowIfNull(value, "value");
        result.hasDestinationSpace = true;
        result.destinationSpace_ = value;
        return this;
      }
      public Builder ClearDestinationSpace() {
        result.hasDestinationSpace = false;
        result.destinationSpace_ = pb::ByteString.Empty;
        return this;
      }
      
      public bool HasId {
        get { return result.HasId; }
      }
      public long Id {
        get { return result.Id; }
        set { SetId(value); }
      }
      public Builder SetId(long value) {
        result.hasId = true;
        result.id_ = value;
        return this;
      }
      public Builder ClearId() {
        result.hasId = false;
        result.id_ = 0L;
        return this;
      }
      
      public bool HasReplyId {
        get { return result.HasReplyId; }
      }
      public long ReplyId {
        get { return result.ReplyId; }
        set { SetReplyId(value); }
      }
      public Builder SetReplyId(long value) {
        result.hasReplyId = true;
        result.replyId_ = value;
        return this;
      }
      public Builder ClearReplyId() {
        result.hasReplyId = false;
        result.replyId_ = 0L;
        return this;
      }
      
      public bool HasReturnStatus {
       get { return result.HasReturnStatus; }
      }
      public global::Sirikata.Protocol._PBJ_Internal.Header.Types.ReturnStatus ReturnStatus {
        get { return result.ReturnStatus; }
        set { SetReturnStatus(value); }
      }
      public Builder SetReturnStatus(global::Sirikata.Protocol._PBJ_Internal.Header.Types.ReturnStatus value) {
        result.hasReturnStatus = true;
        result.returnStatus_ = value;
        return this;
      }
      public Builder ClearReturnStatus() {
        result.hasReturnStatus = false;
        result.returnStatus_ = global::Sirikata.Protocol._PBJ_Internal.Header.Types.ReturnStatus.SUCCESS;
        return this;
      }
    }
    static Header() {
      object.ReferenceEquals(global::Sirikata.Protocol._PBJ_Internal.MessageHeader.Descriptor, null);
    }
  }
  
  #endregion
  
}
