{ "protocol" : "Location", "namespace" : "Switchboard", "types" : [ { "type" : "record", "name" : "Location", "doc" : "The main class for this protocol", "fields" : [ { "name" : "id", "type" : "int", "doc" : "The primary key" }, { "name" : "type", "type" : "string", "doc" : "What type of record this is. (Gnomon::Country, Gnomon::State, Gnomon::County, Gnomon::City, Gnomon::PostalCode, Gnomon::Neighborhood)" }, { "name" : "county_name", "type" : "string", "doc" : "Name of the county this location is in (or nil)" }, { "name" : "state_name", "type" : "string", "doc" : "Name of the state this location is in (or nil)" }, { "name" : "state_code", "type" : "string", "doc" : "Short name of state *" }, { "name" : "country_name", "type" : "string", "doc" : "Name of the country this location is in (or nil)" }, { "name" : "city_name", "type" : "string", "doc" : "Name of the city this location is in (or nil)" }, { "name" : "neighborhood_name", "type" : "string", "doc" : "Name of the neighborhood this location is in (or nil)" }, { "name" : "postal_code_name", "type" : "string", "doc" : "Zip code of this location (or nil)" }, { "name" : "to_location", "type" : "string", "doc" : "Most common description of this location" }, { "name" : "to_short_location", "type" : "string", "doc" : "Shorter description of this location" }, { "name" : "to_long_location", "type" : "string", "doc" : "More verbose description of this location" }, { "name" : "to_location_with_region", "type" : "string", "doc" : "More verbose description of this location, usually with 3 levels of detail" }, { "name" : "latitude", "type" : "float", "doc" : "Latitude of the center of this location" }, { "name" : "longitude", "type" : "float", "doc" : "Longitude of the center of this location" }, { "name" : "population", "type" : "int", "doc" : "Approximate population of this location" }, { "name" : "updated_at", "type" : "string", "doc" : "Datetime string of when this location was last updated" } ] }, { "type" : "record", "name" : "LocationFetchOption", "doc" : "Options you can send for limiting Location results", "fields" : [ { "name" : "page", "type" : "int", "doc" : "Which page of records to fetch", "default" : 1 }, { "name" : "per_page", "type" : "int", "doc" : "How many records per page", "default" : 30 } ] } ], "messages" : { "index" : { "doc" : "Returns a list of Locations", "request" : [ { "name" : "options", "type" : "LocationFetchOption" } ], "response" : { "type" : "array", "items" : "Location" } }, "show" : { "doc" : "Return a single Location", "request" : [ { "name" : "id", "type" : "int" } ], "response" : { "type" : "array", "items" : "Location" } }, "resolve" : { "doc" : "Try to guess a location from a given string", "request" : [ { "name" : "q", "type" : "string" } ], "response" : { "type" : "array", "items" : "Location" } } } }