/* INFINITY CODE 2013-2019 */
/* http://www.infinity-code.com */
using InfinityCode.RealWorldTerrain.XML;
using UnityEngine;
namespace InfinityCode.RealWorldTerrain.Webservices.Results
{
///
/// Result of Google Maps Place Details query.
///
public class RealWorldTerrainGooglePlaceDetailsResult
{
///
/// Human-readable address of this place.\n
/// Often this address is equivalent to the "postal address," which sometimes differs from country to country.
///
public string formatted_address;
///
/// Phone number in its local format.\n
/// For example, the formatted_phone_number for Google's Sydney, Australia office is (02) 9374 4000.
///
public string formatted_phone_number;
///
/// Geographic coordinates of place.
///
public Vector2 location;
///
/// URL of a suggested icon which may be displayed to the user when indicating this result on a map.
///
public string icon;
///
/// unique stable identifier denoting this place.\n
/// This identifier may not be used to retrieve information about this place, but can be used to consolidate data about this place, and to verify the identity of a place across separate searches.\n
/// As IDs can occasionally change, it's recommended that the stored ID for a place be compared with the ID returned in later Details requests for the same place, and updated if necessary.\n
/// Note: The id is now deprecated in favor of place_id.
///
public string id;
///
/// Phone number in international format.\n
/// International format includes the country code, and is prefixed with the plus (+) sign.\n
/// For example, the international_phone_number for Google's Sydney, Australia office is +61 2 9374 4000.
///
public string international_phone_number;
///
/// Human-readable name for the returned result.\n
/// For establishment results, this is usually the canonicalized business name.
///
public string name;
///
/// Reference to XML node.
///
public RealWorldTerrainXML node;
///
/// Array of photo objects, each containing a reference to an image.\n
/// A Place Details request may return up to ten photos.
///
public RealWorldTerrainPlacesResult.Photo[] photos;
///
/// A textual identifier that uniquely identifies a place.
///
public string place_id;
///
/// The price level of the place, on a scale of 0 to 4.
/// The exact amount indicated by a specific value will vary from region to region.
/// Price levels are interpreted as follows:
/// -1 - Unknown
/// 0 — Free
/// 1 — Inexpensive
/// 2 — Moderate
/// 3 — Expensive
/// 4 — Very Expensive
///
public int price_level = -1;
///
/// Place's rating, from 1.0 to 5.0, based on aggregated user reviews.
///
public float rating;
///
/// Unique token that you can use to retrieve additional information about this place in a Place Details request. \n
/// Although this token uniquely identifies the place, the converse is not true. \n
/// A place may have many valid reference tokens. \n
/// It's not guaranteed that the same token will be returned for any given place across different searches. \n
/// Note: The reference is now deprecated in favor of place_id.
///
public string reference;
///
/// Array of feature types describing the given result. \n
/// XML responses include multiple type elements if more than one type is assigned to the result.
///
public string[] types;
///
/// URL of the official Google page for this place.\n
/// This will be the establishment's Google+ page if the Google+ page exists, otherwise it will be the Google-owned page that contains the best available information about the place.\n
/// Applications must link to or embed this page on any screen that shows detailed results about the place to the user.
///
public string url;
///
/// Number of minutes this place’s current timezone is offset from UTC.\n
/// For example, for places in Sydney, Australia during daylight saving time this would be 660 (+11 hours from UTC), and for places in California outside of daylight saving time this would be -480 (-8 hours from UTC).
///
public string utc_offset;
///
/// Lists a simplified address for the place, including the street name, street number, and locality, but not the province/state, postal code, or country.\n
/// For example, Google's Sydney, Australia office has a vicinity value of 48 Pirrama Road, Pyrmont.
///
public string vicinity;
///
/// Lists the authoritative website for this place, such as a business' homepage.
///
public string website;
public RealWorldTerrainGooglePlaceDetailsResult()
{
}
///
/// Constructor of RealWorldTerrainGooglePlaceDetailsResult.
///
/// Place node from response.
public RealWorldTerrainGooglePlaceDetailsResult(RealWorldTerrainXML node)
{
this.node = node;
formatted_address = node.Get("formatted_address");
formatted_phone_number = node.Get("formatted_phone_number");
RealWorldTerrainXML locationNode = node.Find("geometry/location");
if (!locationNode.isNull) location = new Vector2(locationNode.Get("lng"), locationNode.Get("lat"));
icon = node.Get("icon");
id = node.Get("id");
international_phone_number = node.Get("international_phone_number");
name = node.Get("name");
RealWorldTerrainXMLList photosList = node.FindAll("photo");
photos = new RealWorldTerrainPlacesResult.Photo[photosList.count];
for (int i = 0; i < photosList.count; i++) photos[i] = new RealWorldTerrainPlacesResult.Photo(photosList[i]);
place_id = node.Get("place_id");
price_level = node.Get("price_level", -1);
rating = node.Get("rating");
reference = node.Get("reference");
RealWorldTerrainXMLList typeNode = node.FindAll("type");
types = new string[typeNode.count];
for (int i = 0; i < typeNode.count; i++) types[i] = typeNode[i].Value();
url = node.Get("url");
utc_offset = node.Get("utc_offset");
vicinity = node.Get("vicinity");
website = node.Get("website");
}
}
}