// <auto-generated>
//     Generated by the protocol buffer compiler.  DO NOT EDIT!
//     source: mysqlx_expect.proto
// </auto-generated>
#pragma warning disable 1591, 0612, 3021
#region Designer generated code

using pb = global::Google.Protobuf;
using pbc = global::Google.Protobuf.Collections;
using pbr = global::Google.Protobuf.Reflection;
using scg = global::System.Collections.Generic;
namespace Mysqlx.Expect {

  /// <summary>Holder for reflection information generated from mysqlx_expect.proto</summary>
  internal static partial class MysqlxExpectReflection {

    #region Descriptor
    /// <summary>File descriptor for mysqlx_expect.proto</summary>
    public static pbr::FileDescriptor Descriptor {
      get { return descriptor; }
    }
    private static pbr::FileDescriptor descriptor;

    static MysqlxExpectReflection() {
      byte[] descriptorData = global::System.Convert.FromBase64String(
          string.Concat(
            "ChNteXNxbHhfZXhwZWN0LnByb3RvEg1NeXNxbHguRXhwZWN0IrUDCgRPcGVu",
            "EiwKAm9wGAEgASgOMiAuTXlzcWx4LkV4cGVjdC5PcGVuLkN0eE9wZXJhdGlv",
            "bhIrCgRjb25kGAIgAygLMh0uTXlzcWx4LkV4cGVjdC5PcGVuLkNvbmRpdGlv",
            "bhqRAgoJQ29uZGl0aW9uEhUKDWNvbmRpdGlvbl9rZXkYASABKA0SFwoPY29u",
            "ZGl0aW9uX3ZhbHVlGAIgASgMEjwKAm9wGAMgASgOMjAuTXlzcWx4LkV4cGVj",
            "dC5PcGVuLkNvbmRpdGlvbi5Db25kaXRpb25PcGVyYXRpb24iWAoDS2V5EggK",
            "BE5PTkUQABITCg9FWFBFQ1RfTk9fRVJST1IQARIWChJFWFBFQ1RfRklFTERf",
            "RVhJU1QQAhIaChZFWFBFQ1RfRE9DSURfR0VORVJBVEVEEAMiPAoSQ29uZGl0",
            "aW9uT3BlcmF0aW9uEhEKDUVYUEVDVF9PUF9TRVQQABITCg9FWFBFQ1RfT1Bf",
            "VU5TRVQQASI+CgxDdHhPcGVyYXRpb24SGAoURVhQRUNUX0NUWF9DT1BZX1BS",
            "RVYQABIUChBFWFBFQ1RfQ1RYX0VNUFRZEAEiBwoFQ2xvc2VCGQoXY29tLm15",
            "c3FsLmNqLngucHJvdG9idWZiBnByb3RvMw=="));
      descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData,
          new pbr::FileDescriptor[] { },
          new pbr::GeneratedClrTypeInfo(null, new pbr::GeneratedClrTypeInfo[] {
            new pbr::GeneratedClrTypeInfo(typeof(global::Mysqlx.Expect.Open), global::Mysqlx.Expect.Open.Parser, new[]{ "Op", "Cond" }, null, new[]{ typeof(global::Mysqlx.Expect.Open.Types.CtxOperation) }, new pbr::GeneratedClrTypeInfo[] { new pbr::GeneratedClrTypeInfo(typeof(global::Mysqlx.Expect.Open.Types.Condition), global::Mysqlx.Expect.Open.Types.Condition.Parser, new[]{ "ConditionKey", "ConditionValue", "Op" }, null, new[]{ typeof(global::Mysqlx.Expect.Open.Types.Condition.Types.Key), typeof(global::Mysqlx.Expect.Open.Types.Condition.Types.ConditionOperation) }, null)}),
            new pbr::GeneratedClrTypeInfo(typeof(global::Mysqlx.Expect.Close), global::Mysqlx.Expect.Close.Parser, null, null, null, null)
          }));
    }
    #endregion

  }
  #region Messages
  /// <summary>
  /// open an Expect block and set/unset the conditions that have to be fulfilled
  ///
  /// if any of the conditions fail, all enclosed messages will fail with
  /// a Mysqlx.Error message.
  ///
  /// :returns: :protobuf:msg:`Mysqlx::Ok` on success, :protobuf:msg:`Mysqlx::Error` on error
  /// </summary>
  internal sealed partial class Open : pb::IMessage<Open> {
    private static readonly pb::MessageParser<Open> _parser = new pb::MessageParser<Open>(() => new Open());
    private pb::UnknownFieldSet _unknownFields;
    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
    public static pb::MessageParser<Open> Parser { get { return _parser; } }

    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
    public static pbr::MessageDescriptor Descriptor {
      get { return global::Mysqlx.Expect.MysqlxExpectReflection.Descriptor.MessageTypes[0]; }
    }

    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
    pbr::MessageDescriptor pb::IMessage.Descriptor {
      get { return Descriptor; }
    }

    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
    public Open() {
      OnConstruction();
    }

    partial void OnConstruction();

    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
    public Open(Open other) : this() {
      op_ = other.op_;
      cond_ = other.cond_.Clone();
      _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
    }

    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
    public Open Clone() {
      return new Open(this);
    }

    /// <summary>Field number for the "op" field.</summary>
    public const int OpFieldNumber = 1;
    private global::Mysqlx.Expect.Open.Types.CtxOperation op_ = 0;
    /// <summary>
    ///[ default = EXPECT_CTX_COPY_PREV ];//optional
    /// </summary>
    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
    public global::Mysqlx.Expect.Open.Types.CtxOperation Op {
      get { return op_; }
      set {
        op_ = value;
      }
    }

    /// <summary>Field number for the "cond" field.</summary>
    public const int CondFieldNumber = 2;
    private static readonly pb::FieldCodec<global::Mysqlx.Expect.Open.Types.Condition> _repeated_cond_codec
        = pb::FieldCodec.ForMessage(18, global::Mysqlx.Expect.Open.Types.Condition.Parser);
    private readonly pbc::RepeatedField<global::Mysqlx.Expect.Open.Types.Condition> cond_ = new pbc::RepeatedField<global::Mysqlx.Expect.Open.Types.Condition>();
    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
    public pbc::RepeatedField<global::Mysqlx.Expect.Open.Types.Condition> Cond {
      get { return cond_; }
    }

    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
    public override bool Equals(object other) {
      return Equals(other as Open);
    }

    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
    public bool Equals(Open other) {
      if (ReferenceEquals(other, null)) {
        return false;
      }
      if (ReferenceEquals(other, this)) {
        return true;
      }
      if (Op != other.Op) return false;
      if(!cond_.Equals(other.cond_)) return false;
      return Equals(_unknownFields, other._unknownFields);
    }

    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
    public override int GetHashCode() {
      int hash = 1;
      if (Op != 0) hash ^= Op.GetHashCode();
      hash ^= cond_.GetHashCode();
      if (_unknownFields != null) {
        hash ^= _unknownFields.GetHashCode();
      }
      return hash;
    }

    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
    public override string ToString() {
      return pb::JsonFormatter.ToDiagnosticString(this);
    }

    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
    public void WriteTo(pb::CodedOutputStream output) {
      if (Op != 0) {
        output.WriteRawTag(8);
        output.WriteEnum((int) Op);
      }
      cond_.WriteTo(output, _repeated_cond_codec);
      if (_unknownFields != null) {
        _unknownFields.WriteTo(output);
      }
    }

    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
    public int CalculateSize() {
      int size = 0;
      if (Op != 0) {
        size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) Op);
      }
      size += cond_.CalculateSize(_repeated_cond_codec);
      if (_unknownFields != null) {
        size += _unknownFields.CalculateSize();
      }
      return size;
    }

    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
    public void MergeFrom(Open other) {
      if (other == null) {
        return;
      }
      if (other.Op != 0) {
        Op = other.Op;
      }
      cond_.Add(other.cond_);
      _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
    }

    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
    public void MergeFrom(pb::CodedInputStream input) {
      uint tag;
      while ((tag = input.ReadTag()) != 0) {
        switch(tag) {
          default:
            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
            break;
          case 8: {
            op_ = (global::Mysqlx.Expect.Open.Types.CtxOperation) input.ReadEnum();
            break;
          }
          case 18: {
            cond_.AddEntriesFrom(input, _repeated_cond_codec);
            break;
          }
        }
      }
    }

    #region Nested types
    /// <summary>Container for nested types declared in the Open message type.</summary>
    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
    internal static partial class Types {
      public enum CtxOperation {
        /// <summary>
        /// copy the operations from the parent Expect-block
        /// </summary>
        [pbr::OriginalName("EXPECT_CTX_COPY_PREV")] ExpectCtxCopyPrev = 0,
        /// <summary>
        /// start with a empty set of operations
        /// </summary>
        [pbr::OriginalName("EXPECT_CTX_EMPTY")] ExpectCtxEmpty = 1,
      }

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

        [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
        public static pbr::MessageDescriptor Descriptor {
          get { return global::Mysqlx.Expect.Open.Descriptor.NestedTypes[0]; }
        }

        [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
        pbr::MessageDescriptor pb::IMessage.Descriptor {
          get { return Descriptor; }
        }

        [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
        public Condition() {
          OnConstruction();
        }

        partial void OnConstruction();

        [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
        public Condition(Condition other) : this() {
          conditionKey_ = other.conditionKey_;
          conditionValue_ = other.conditionValue_;
          op_ = other.op_;
          _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
        }

        [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
        public Condition Clone() {
          return new Condition(this);
        }

        /// <summary>Field number for the "condition_key" field.</summary>
        public const int ConditionKeyFieldNumber = 1;
        private uint conditionKey_;
        /// <summary>
        ///required
        /// </summary>
        [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
        public uint ConditionKey {
          get { return conditionKey_; }
          set {
            conditionKey_ = value;
          }
        }

        /// <summary>Field number for the "condition_value" field.</summary>
        public const int ConditionValueFieldNumber = 2;
        private pb::ByteString conditionValue_ = pb::ByteString.Empty;
        /// <summary>
        ///optional
        /// </summary>
        [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
        public pb::ByteString ConditionValue {
          get { return conditionValue_; }
          set {
            conditionValue_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
          }
        }

        /// <summary>Field number for the "op" field.</summary>
        public const int OpFieldNumber = 3;
        private global::Mysqlx.Expect.Open.Types.Condition.Types.ConditionOperation op_ = 0;
        /// <summary>
        ///[ default = EXPECT_OP_SET ];//optional
        /// </summary>
        [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
        public global::Mysqlx.Expect.Open.Types.Condition.Types.ConditionOperation Op {
          get { return op_; }
          set {
            op_ = value;
          }
        }

        [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
        public override bool Equals(object other) {
          return Equals(other as Condition);
        }

        [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
        public bool Equals(Condition other) {
          if (ReferenceEquals(other, null)) {
            return false;
          }
          if (ReferenceEquals(other, this)) {
            return true;
          }
          if (ConditionKey != other.ConditionKey) return false;
          if (ConditionValue != other.ConditionValue) return false;
          if (Op != other.Op) return false;
          return Equals(_unknownFields, other._unknownFields);
        }

        [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
        public override int GetHashCode() {
          int hash = 1;
          if (ConditionKey != 0) hash ^= ConditionKey.GetHashCode();
          if (ConditionValue.Length != 0) hash ^= ConditionValue.GetHashCode();
          if (Op != 0) hash ^= Op.GetHashCode();
          if (_unknownFields != null) {
            hash ^= _unknownFields.GetHashCode();
          }
          return hash;
        }

        [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
        public override string ToString() {
          return pb::JsonFormatter.ToDiagnosticString(this);
        }

        [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
        public void WriteTo(pb::CodedOutputStream output) {
          if (ConditionKey != 0) {
            output.WriteRawTag(8);
            output.WriteUInt32(ConditionKey);
          }
          if (ConditionValue.Length != 0) {
            output.WriteRawTag(18);
            output.WriteBytes(ConditionValue);
          }
          if (Op != 0) {
            output.WriteRawTag(24);
            output.WriteEnum((int) Op);
          }
          if (_unknownFields != null) {
            _unknownFields.WriteTo(output);
          }
        }

        [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
        public int CalculateSize() {
          int size = 0;
          if (ConditionKey != 0) {
            size += 1 + pb::CodedOutputStream.ComputeUInt32Size(ConditionKey);
          }
          if (ConditionValue.Length != 0) {
            size += 1 + pb::CodedOutputStream.ComputeBytesSize(ConditionValue);
          }
          if (Op != 0) {
            size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) Op);
          }
          if (_unknownFields != null) {
            size += _unknownFields.CalculateSize();
          }
          return size;
        }

        [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
        public void MergeFrom(Condition other) {
          if (other == null) {
            return;
          }
          if (other.ConditionKey != 0) {
            ConditionKey = other.ConditionKey;
          }
          if (other.ConditionValue.Length != 0) {
            ConditionValue = other.ConditionValue;
          }
          if (other.Op != 0) {
            Op = other.Op;
          }
          _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
        }

        [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
        public void MergeFrom(pb::CodedInputStream input) {
          uint tag;
          while ((tag = input.ReadTag()) != 0) {
            switch(tag) {
              default:
                _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
                break;
              case 8: {
                ConditionKey = input.ReadUInt32();
                break;
              }
              case 18: {
                ConditionValue = input.ReadBytes();
                break;
              }
              case 24: {
                op_ = (global::Mysqlx.Expect.Open.Types.Condition.Types.ConditionOperation) input.ReadEnum();
                break;
              }
            }
          }
        }

        #region Nested types
        /// <summary>Container for nested types declared in the Condition message type.</summary>
        [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
        internal static partial class Types {
          public enum Key {
            [pbr::OriginalName("NONE")] None = 0,
            /// <summary>
            /// Change error propagation behaviour
            /// </summary>
            [pbr::OriginalName("EXPECT_NO_ERROR")] ExpectNoError = 1,
            /// <summary>
            /// Check if X Protocol field exists
            /// </summary>
            [pbr::OriginalName("EXPECT_FIELD_EXIST")] ExpectFieldExist = 2,
            /// <summary>
            /// Check if X Protocol support document _id generation
            /// </summary>
            [pbr::OriginalName("EXPECT_DOCID_GENERATED")] ExpectDocidGenerated = 3,
          }

          public enum ConditionOperation {
            /// <summary>
            /// set the condition
            ///
            /// set, if not set
            /// overwrite, if set
            /// </summary>
            [pbr::OriginalName("EXPECT_OP_SET")] ExpectOpSet = 0,
            /// <summary>
            /// unset the condition
            /// </summary>
            [pbr::OriginalName("EXPECT_OP_UNSET")] ExpectOpUnset = 1,
          }

        }
        #endregion

      }

    }
    #endregion

  }

  /// <summary>
  /// close a Expect block
  ///
  /// closing a Expect block restores the state of the previous Expect block
  /// for the following messages
  ///
  /// :returns: :protobuf:msg:`Mysqlx::Ok` on success, :protobuf:msg:`Mysqlx::Error` on error
  /// </summary>
  internal sealed partial class Close : pb::IMessage<Close> {
    private static readonly pb::MessageParser<Close> _parser = new pb::MessageParser<Close>(() => new Close());
    private pb::UnknownFieldSet _unknownFields;
    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
    public static pb::MessageParser<Close> Parser { get { return _parser; } }

    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
    public static pbr::MessageDescriptor Descriptor {
      get { return global::Mysqlx.Expect.MysqlxExpectReflection.Descriptor.MessageTypes[1]; }
    }

    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
    pbr::MessageDescriptor pb::IMessage.Descriptor {
      get { return Descriptor; }
    }

    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
    public Close() {
      OnConstruction();
    }

    partial void OnConstruction();

    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
    public Close(Close other) : this() {
      _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
    }

    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
    public Close Clone() {
      return new Close(this);
    }

    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
    public override bool Equals(object other) {
      return Equals(other as Close);
    }

    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
    public bool Equals(Close other) {
      if (ReferenceEquals(other, null)) {
        return false;
      }
      if (ReferenceEquals(other, this)) {
        return true;
      }
      return Equals(_unknownFields, other._unknownFields);
    }

    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
    public override int GetHashCode() {
      int hash = 1;
      if (_unknownFields != null) {
        hash ^= _unknownFields.GetHashCode();
      }
      return hash;
    }

    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
    public override string ToString() {
      return pb::JsonFormatter.ToDiagnosticString(this);
    }

    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
    public void WriteTo(pb::CodedOutputStream output) {
      if (_unknownFields != null) {
        _unknownFields.WriteTo(output);
      }
    }

    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
    public int CalculateSize() {
      int size = 0;
      if (_unknownFields != null) {
        size += _unknownFields.CalculateSize();
      }
      return size;
    }

    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
    public void MergeFrom(Close other) {
      if (other == null) {
        return;
      }
      _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
    }

    [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
    public void MergeFrom(pb::CodedInputStream input) {
      uint tag;
      while ((tag = input.ReadTag()) != 0) {
        switch(tag) {
          default:
            _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
            break;
        }
      }
    }

  }

  #endregion

}

#endregion Designer generated code
