#
# Autogenerated by Thrift
#
# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
#


module Flock
  module Edges
        module SelectOperationType
          SimpleQuery = 1
          Intersection = 2
          Union = 3
          Difference = 4
          VALUE_MAP = {1 => "SimpleQuery", 2 => "Intersection", 3 => "Union", 4 => "Difference"}
          VALID_VALUES = Set.new([SimpleQuery, Intersection, Union, Difference]).freeze
        end

        module ExecuteOperationType
          Add = 1
          Remove = 2
          Archive = 3
          Negate = 4
          VALUE_MAP = {1 => "Add", 2 => "Remove", 3 => "Archive", 4 => "Negate"}
          VALID_VALUES = Set.new([Add, Remove, Archive, Negate]).freeze
        end

        module EdgeState
          Positive = 0
          Negative = 3
          Removed = 1
          Archived = 2
          VALUE_MAP = {0 => "Positive", 3 => "Negative", 1 => "Removed", 2 => "Archived"}
          VALID_VALUES = Set.new([Positive, Negative, Removed, Archived]).freeze
        end

        module Priority
          Low = 1
          Medium = 2
          High = 3
          VALUE_MAP = {1 => "Low", 2 => "Medium", 3 => "High"}
          VALID_VALUES = Set.new([Low, Medium, High]).freeze
        end

        class FlockException < ::Thrift::Exception
          include ::Thrift::Struct, ::Thrift::Struct_Union
          def initialize(message=nil)
            super()
            self.description = message
          end

          def message; description end

          DESCRIPTION = 1

          FIELDS = {
            DESCRIPTION => {:type => ::Thrift::Types::STRING, :name => 'description'}
          }

          def struct_fields; FIELDS; end

          def validate
          end

          ::Thrift::Struct.generate_accessors self
        end

        class Results
          include ::Thrift::Struct, ::Thrift::Struct_Union
          IDS = 1
          NEXT_CURSOR = 2
          PREV_CURSOR = 3

          FIELDS = {
            IDS => {:type => ::Thrift::Types::STRING, :name => 'ids', :binary => true},
            NEXT_CURSOR => {:type => ::Thrift::Types::I64, :name => 'next_cursor'},
            PREV_CURSOR => {:type => ::Thrift::Types::I64, :name => 'prev_cursor'}
          }

          def struct_fields; FIELDS; end

          def validate
          end

          ::Thrift::Struct.generate_accessors self
        end

        class Page
          include ::Thrift::Struct, ::Thrift::Struct_Union
          COUNT = 1
          CURSOR = 2

          FIELDS = {
            COUNT => {:type => ::Thrift::Types::I32, :name => 'count'},
            CURSOR => {:type => ::Thrift::Types::I64, :name => 'cursor'}
          }

          def struct_fields; FIELDS; end

          def validate
          end

          ::Thrift::Struct.generate_accessors self
        end

        class Metadata
          include ::Thrift::Struct, ::Thrift::Struct_Union
          SOURCE_ID = 1
          STATE_ID = 2
          COUNT = 3
          UPDATED_AT = 4

          FIELDS = {
            SOURCE_ID => {:type => ::Thrift::Types::I64, :name => 'source_id'},
            STATE_ID => {:type => ::Thrift::Types::I32, :name => 'state_id'},
            COUNT => {:type => ::Thrift::Types::I32, :name => 'count'},
            UPDATED_AT => {:type => ::Thrift::Types::I32, :name => 'updated_at'}
          }

          def struct_fields; FIELDS; end

          def validate
          end

          ::Thrift::Struct.generate_accessors self
        end

        class Edge
          include ::Thrift::Struct, ::Thrift::Struct_Union
          SOURCE_ID = 1
          DESTINATION_ID = 2
          POSITION = 3
          UPDATED_AT = 4
          COUNT = 5
          STATE_ID = 6

          FIELDS = {
            SOURCE_ID => {:type => ::Thrift::Types::I64, :name => 'source_id'},
            DESTINATION_ID => {:type => ::Thrift::Types::I64, :name => 'destination_id'},
            POSITION => {:type => ::Thrift::Types::I64, :name => 'position'},
            UPDATED_AT => {:type => ::Thrift::Types::I32, :name => 'updated_at'},
            COUNT => {:type => ::Thrift::Types::I32, :name => 'count'},
            STATE_ID => {:type => ::Thrift::Types::I32, :name => 'state_id'}
          }

          def struct_fields; FIELDS; end

          def validate
          end

          ::Thrift::Struct.generate_accessors self
        end

        class QueryTerm
          include ::Thrift::Struct, ::Thrift::Struct_Union
          SOURCE_ID = 1
          GRAPH_ID = 2
          IS_FORWARD = 3
          DESTINATION_IDS = 4
          STATE_IDS = 5

          FIELDS = {
            SOURCE_ID => {:type => ::Thrift::Types::I64, :name => 'source_id'},
            GRAPH_ID => {:type => ::Thrift::Types::I32, :name => 'graph_id'},
            IS_FORWARD => {:type => ::Thrift::Types::BOOL, :name => 'is_forward'},
            DESTINATION_IDS => {:type => ::Thrift::Types::STRING, :name => 'destination_ids', :binary => true, :optional => true},
            STATE_IDS => {:type => ::Thrift::Types::LIST, :name => 'state_ids', :element => {:type => ::Thrift::Types::I32}, :optional => true}
          }

          def struct_fields; FIELDS; end

          def validate
          end

          ::Thrift::Struct.generate_accessors self
        end

        class SelectOperation
          include ::Thrift::Struct, ::Thrift::Struct_Union
          OPERATION_TYPE = 1
          TERM = 2

          FIELDS = {
            OPERATION_TYPE => {:type => ::Thrift::Types::I32, :name => 'operation_type', :enum_class => Flock::Edges::SelectOperationType},
            TERM => {:type => ::Thrift::Types::STRUCT, :name => 'term', :class => Flock::Edges::QueryTerm, :optional => true}
          }

          def struct_fields; FIELDS; end

          def validate
            unless @operation_type.nil? || Flock::Edges::SelectOperationType::VALID_VALUES.include?(@operation_type)
              raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Invalid value of field operation_type!')
            end
          end

          ::Thrift::Struct.generate_accessors self
        end

        class ExecuteOperation
          include ::Thrift::Struct, ::Thrift::Struct_Union
          OPERATION_TYPE = 1
          TERM = 2
          POSITION = 3

          FIELDS = {
            OPERATION_TYPE => {:type => ::Thrift::Types::I32, :name => 'operation_type', :enum_class => Flock::Edges::ExecuteOperationType},
            TERM => {:type => ::Thrift::Types::STRUCT, :name => 'term', :class => Flock::Edges::QueryTerm},
            POSITION => {:type => ::Thrift::Types::I64, :name => 'position', :optional => true}
          }

          def struct_fields; FIELDS; end

          def validate
            unless @operation_type.nil? || Flock::Edges::ExecuteOperationType::VALID_VALUES.include?(@operation_type)
              raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Invalid value of field operation_type!')
            end
          end

          ::Thrift::Struct.generate_accessors self
        end

        class ExecuteOperations
          include ::Thrift::Struct, ::Thrift::Struct_Union
          OPERATIONS = 1
          EXECUTE_AT = 2
          PRIORITY = 3

          FIELDS = {
            OPERATIONS => {:type => ::Thrift::Types::LIST, :name => 'operations', :element => {:type => ::Thrift::Types::STRUCT, :class => Flock::Edges::ExecuteOperation}},
            EXECUTE_AT => {:type => ::Thrift::Types::I32, :name => 'execute_at', :optional => true},
            PRIORITY => {:type => ::Thrift::Types::I32, :name => 'priority', :enum_class => Flock::Edges::Priority}
          }

          def struct_fields; FIELDS; end

          def validate
            unless @priority.nil? || Flock::Edges::Priority::VALID_VALUES.include?(@priority)
              raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Invalid value of field priority!')
            end
          end

          ::Thrift::Struct.generate_accessors self
        end

        class SelectQuery
          include ::Thrift::Struct, ::Thrift::Struct_Union
          OPERATIONS = 1
          PAGE = 2

          FIELDS = {
            OPERATIONS => {:type => ::Thrift::Types::LIST, :name => 'operations', :element => {:type => ::Thrift::Types::STRUCT, :class => Flock::Edges::SelectOperation}},
            PAGE => {:type => ::Thrift::Types::STRUCT, :name => 'page', :class => Flock::Edges::Page}
          }

          def struct_fields; FIELDS; end

          def validate
          end

          ::Thrift::Struct.generate_accessors self
        end

        class EdgeQuery
          include ::Thrift::Struct, ::Thrift::Struct_Union
          TERM = 1
          PAGE = 2

          FIELDS = {
            TERM => {:type => ::Thrift::Types::STRUCT, :name => 'term', :class => Flock::Edges::QueryTerm},
            PAGE => {:type => ::Thrift::Types::STRUCT, :name => 'page', :class => Flock::Edges::Page}
          }

          def struct_fields; FIELDS; end

          def validate
          end

          ::Thrift::Struct.generate_accessors self
        end

        class EdgeResults
          include ::Thrift::Struct, ::Thrift::Struct_Union
          EDGES = 1
          NEXT_CURSOR = 2
          PREV_CURSOR = 3

          FIELDS = {
            EDGES => {:type => ::Thrift::Types::LIST, :name => 'edges', :element => {:type => ::Thrift::Types::STRUCT, :class => Flock::Edges::Edge}},
            NEXT_CURSOR => {:type => ::Thrift::Types::I64, :name => 'next_cursor'},
            PREV_CURSOR => {:type => ::Thrift::Types::I64, :name => 'prev_cursor'}
          }

          def struct_fields; FIELDS; end

          def validate
          end

          ::Thrift::Struct.generate_accessors self
        end

      end
    end
