Class: ParserInput

Inherits:
Object
  • Object
show all
Includes:
Thrift::Struct, Thrift::Struct_Union
Defined in:
lib/parser_model_types.rb

Constant Summary collapse

ID =
1
NAME =
2
REQUIREDINPUT =
3
PARSERID =
4
TYPE =
5
FIELDS =
{
  ID => {:type => ::Thrift::Types::STRING, :name => 'id'},
  NAME => {:type => ::Thrift::Types::STRING, :name => 'name'},
  REQUIREDINPUT => {:type => ::Thrift::Types::BOOL, :name => 'requiredInput'},
  PARSERID => {:type => ::Thrift::Types::STRING, :name => 'parserId'},
  TYPE => {:type => ::Thrift::Types::I32, :name => 'type', :enum_class => ::IOType}
}

Instance Method Summary collapse

Instance Method Details

#struct_fieldsObject



32
# File 'lib/parser_model_types.rb', line 32

def struct_fields; FIELDS; end

#validateObject

Raises:

  • (::Thrift::ProtocolException)


34
35
36
37
38
39
40
41
42
43
# File 'lib/parser_model_types.rb', line 34

def validate
  raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field id is unset!') unless @id
  raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field name is unset!') unless @name
  raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field requiredInput is unset!') if @requiredInput.nil?
  raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field parserId is unset!') unless @parserId
  raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field type is unset!') unless @type
  unless @type.nil? || ::IOType::VALID_VALUES.include?(@type)
    raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Invalid value of field type!')
  end
end