#
# Autogenerated by Thrift Compiler (0.9.2)
#
# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
#

require 'thrift'
require 'concourse/thrift/shared_types'


module Concourse
  module Thrift
    module TSymbolType
      CONJUNCTION = 1
      KEY = 2
      VALUE = 3
      PARENTHESIS = 4
      OPERATOR = 5
      TIMESTAMP = 6
      VALUE_MAP = {1 => "CONJUNCTION", 2 => "KEY", 3 => "VALUE", 4 => "PARENTHESIS", 5 => "OPERATOR", 6 => "TIMESTAMP"}
      VALID_VALUES = Set.new([CONJUNCTION, KEY, VALUE, PARENTHESIS, OPERATOR, TIMESTAMP]).freeze
    end

    # A lightweight wrapper for a typed Object that has been encoded
# as binary data.
    class TObject
      include ::Thrift::Struct, ::Thrift::Struct_Union
      DATA = 1
      TYPE = 2

      FIELDS = {
        DATA => {:type => ::Thrift::Types::STRING, :name => 'data', :binary => true},
        TYPE => {:type => ::Thrift::Types::I32, :name => 'type', :default =>         7, :enum_class => ::Concourse::Thrift::Type}
      }

      def struct_fields; FIELDS; end

      def validate
        raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field data is unset!') unless @data
        raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field type is unset!') unless @type
        unless @type.nil? || ::Concourse::Thrift::Type::VALID_VALUES.include?(@type)
          raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Invalid value of field type!')
        end
      end

      ::Thrift::Struct.generate_accessors self
    end

    # A representation for a Symbol that can be passed over the wire via
# Thrift. Once passed over the wire, the server uses information
# about the symbol type to parse the string representation of the
# symbol to an actual object.
    class TSymbol
      include ::Thrift::Struct, ::Thrift::Struct_Union
      TYPE = 1
      SYMBOL = 2

      FIELDS = {
        TYPE => {:type => ::Thrift::Types::I32, :name => 'type', :enum_class => ::Concourse::Thrift::TSymbolType},
        SYMBOL => {:type => ::Thrift::Types::STRING, :name => 'symbol'}
      }

      def struct_fields; FIELDS; end

      def validate
        raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field type is unset!') unless @type
        raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field symbol is unset!') unless @symbol
        unless @type.nil? || ::Concourse::Thrift::TSymbolType::VALID_VALUES.include?(@type)
          raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Invalid value of field type!')
        end
      end

      ::Thrift::Struct.generate_accessors self
    end

    # A representation for a Criteria that can be passed over the wire via
# Thrift. Once passed over the write, the server goes through the list
# of TSymbols and converts them to actual Symbol objects which can then
# be used in the shunting-yard algorithm.
    class TCriteria
      include ::Thrift::Struct, ::Thrift::Struct_Union
      SYMBOLS = 1

      FIELDS = {
        SYMBOLS => {:type => ::Thrift::Types::LIST, :name => 'symbols', :element => {:type => ::Thrift::Types::STRUCT, :class => ::Concourse::Thrift::TSymbol}}
      }

      def struct_fields; FIELDS; end

      def validate
        raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field symbols is unset!') unless @symbols
      end

      ::Thrift::Struct.generate_accessors self
    end

  end
end
