Class: GeocodeRequest

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

Direct Known Subclasses

Twofishes::GeocodeRequest

Constant Summary collapse

QUERY =
1
CC =
2
LANG =
3
LL =
4
FULL_DEPRECATED =
5
DEBUG =
6
AUTOCOMPLETE =
7
WOEHINT =
8
WOERESTRICT =
9
BOUNDS =
10
SLUG =
11
INCLUDEPOLYGON_DEPRECATED =
12
RADIUS =
14
MAXINTERPRETATIONS =
16
ALLOWEDSOURCES =
17
RESPONSEINCLUDES =
18
STRICT =
19
AUTOCOMPLETEBIAS =
20
FIELDS =
{
  QUERY => {:type => ::Thrift::Types::STRING, :name => 'query', :optional => true},
  CC => {:type => ::Thrift::Types::STRING, :name => 'cc', :optional => true},
  LANG => {:type => ::Thrift::Types::STRING, :name => 'lang', :default => %q"en", :optional => true},
  LL => {:type => ::Thrift::Types::STRUCT, :name => 'll', :class => ::GeocodePoint, :optional => true},
  FULL_DEPRECATED => {:type => ::Thrift::Types::BOOL, :name => 'full_DEPRECATED', :default => false, :optional => true},
  DEBUG => {:type => ::Thrift::Types::I32, :name => 'debug', :default => 0, :optional => true},
  AUTOCOMPLETE => {:type => ::Thrift::Types::BOOL, :name => 'autocomplete', :default => false, :optional => true},
  WOEHINT => {:type => ::Thrift::Types::LIST, :name => 'woeHint', :default => [
  ], :element => {:type => ::Thrift::Types::I32, :enum_class => ::YahooWoeType}, :optional => true},
  WOERESTRICT => {:type => ::Thrift::Types::LIST, :name => 'woeRestrict', :default => [
  ], :element => {:type => ::Thrift::Types::I32, :enum_class => ::YahooWoeType}, :optional => true},
  BOUNDS => {:type => ::Thrift::Types::STRUCT, :name => 'bounds', :class => ::GeocodeBoundingBox, :optional => true},
  SLUG => {:type => ::Thrift::Types::STRING, :name => 'slug', :optional => true},
  INCLUDEPOLYGON_DEPRECATED => {:type => ::Thrift::Types::BOOL, :name => 'includePolygon_DEPRECATED', :default => false, :optional => true},
  RADIUS => {:type => ::Thrift::Types::I32, :name => 'radius', :default => 0, :optional => true},
  MAXINTERPRETATIONS => {:type => ::Thrift::Types::I32, :name => 'maxInterpretations', :default => 0, :optional => true},
  ALLOWEDSOURCES => {:type => ::Thrift::Types::LIST, :name => 'allowedSources', :element => {:type => ::Thrift::Types::STRING}, :optional => true},
  RESPONSEINCLUDES => {:type => ::Thrift::Types::LIST, :name => 'responseIncludes', :default => [
  ], :element => {:type => ::Thrift::Types::I32, :enum_class => ::ResponseIncludes}, :optional => true},
  STRICT => {:type => ::Thrift::Types::BOOL, :name => 'strict', :default => false, :optional => true},
  AUTOCOMPLETEBIAS => {:type => ::Thrift::Types::I32, :name => 'autocompleteBias', :default =>     1, :optional => true, :enum_class => ::AutocompleteBias}
}

Instance Method Summary collapse

Instance Method Details

#struct_fieldsObject



541
# File 'lib/thrift/geocoder_types.rb', line 541

def struct_fields; FIELDS; end

#validateObject



543
544
545
546
547
# File 'lib/thrift/geocoder_types.rb', line 543

def validate
  unless @autocompleteBias.nil? || ::AutocompleteBias::VALID_VALUES.include?(@autocompleteBias)
    raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, 'Invalid value of field autocompleteBias!')
  end
end