Class: ElasticSearchThrift::RestResponse
- Inherits:
-
Object
- Object
- ElasticSearchThrift::RestResponse
- Includes:
- Thrift::Struct, Thrift::Struct_Union
- Defined in:
- lib/elastic_search_thrift/elasticsearch_types.rb
Constant Summary collapse
- STATUS =
1
- HEADERS =
2
- BODY =
3
- FIELDS =
{ STATUS => {:type => ::Thrift::Types::I32, :name => 'status', :enum_class => ::ElasticSearchThrift::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_fields ⇒ Object
111 |
# File 'lib/elastic_search_thrift/elasticsearch_types.rb', line 111 def struct_fields; FIELDS; end |
#validate ⇒ Object
113 114 115 116 117 118 |
# File 'lib/elastic_search_thrift/elasticsearch_types.rb', line 113 def validate raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Required field status is unset!') unless @status unless @status.nil? || ::ElasticSearchThrift::Status::VALID_VALUES.include?(@status) raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Invalid value of field status!') end end |