Class: JobStatus

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

Constant Summary collapse

JOBSTATE =
1
TIMEOFSTATECHANGE =
2
REASON =
3
STATUSID =
4
FIELDS =
{
  JOBSTATE => {:type => ::Thrift::Types::I32, :name => 'jobState', :enum_class => ::JobState},
  TIMEOFSTATECHANGE => {:type => ::Thrift::Types::I64, :name => 'timeOfStateChange', :optional => true},
  REASON => {:type => ::Thrift::Types::STRING, :name => 'reason', :optional => true},
  STATUSID => {:type => ::Thrift::Types::STRING, :name => 'statusId', :optional => true}
}

Instance Method Summary collapse

Instance Method Details

#struct_fieldsObject



169
# File 'lib/status_models_types.rb', line 169

def struct_fields; FIELDS; end

#validateObject

Raises:

  • (::Thrift::ProtocolException)


171
172
173
174
175
176
# File 'lib/status_models_types.rb', line 171

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