Class: Elastictastic::Thrift::RestResponse

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

Constant Summary collapse

STATUS =
1
HEADERS =
2
BODY =
3
FIELDS =
{
  STATUS => {:type => ::Thrift::Types::I32, :name => 'status', :enum_class => Elastictastic::Thrift::Status},
  HEADERS => {:type => ::Thrift::Types::MAP, :name => 'headers', :key => {:type => ::Thrift::Types::STRING}, :value => {:type => ::Thrift::Types::STRING}, :optional => true},
  BODY => {:type => ::Thrift::Types::STRING, :name => 'body', :binary => true, :optional => true}
}

Instance Method Summary collapse

Instance Method Details

#struct_fieldsObject



111
# File 'lib/elastictastic/thrift/types.rb', line 111

def struct_fields; FIELDS; end

#validateObject

Raises:

  • (::Thrift::ProtocolException)


113
114
115
116
117
118
# File 'lib/elastictastic/thrift/types.rb', line 113

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