Class: Message

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

Constant Summary collapse

EVENT =
1
MESSAGEID =
2
MESSAGETYPE =
3
UPDATEDTIME =
4
MESSAGELEVEL =
5
FIELDS =
{
  EVENT => {:type => ::Thrift::Types::STRING, :name => 'event', :binary => true},
  MESSAGEID => {:type => ::Thrift::Types::STRING, :name => 'messageId', :default => %q"DO_NOT_SET_AT_CLIENTS"},
  MESSAGETYPE => {:type => ::Thrift::Types::I32, :name => 'messageType', :enum_class => ::MessageType},
  UPDATEDTIME => {:type => ::Thrift::Types::I64, :name => 'updatedTime', :optional => true},
  MESSAGELEVEL => {:type => ::Thrift::Types::I32, :name => 'messageLevel', :optional => true, :enum_class => ::MessageLevel}
}

Instance Method Summary collapse

Instance Method Details

#struct_fieldsObject



383
# File 'lib/messaging_events_types.rb', line 383

def struct_fields; FIELDS; end

#validateObject

Raises:

  • (::Thrift::ProtocolException)


385
386
387
388
389
390
391
392
393
394
395
# File 'lib/messaging_events_types.rb', line 385

def validate
  raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field event is unset!') unless @event
  raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field messageId is unset!') unless @messageId
  raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field messageType is unset!') unless @messageType
  unless @messageType.nil? || ::MessageType::VALID_VALUES.include?(@messageType)
    raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Invalid value of field messageType!')
  end
  unless @messageLevel.nil? || ::MessageLevel::VALID_VALUES.include?(@messageLevel)
    raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Invalid value of field messageLevel!')
  end
end