Skip to main content

naurt_api/models/
final_destination_hit.rs

1/*
2 * Naurt API
3 *
4 * OpenAPI specification for Naurt's APIs. 
5 *
6 * The version of the OpenAPI document: 0.1.2
7 * 
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
15pub struct FinalDestinationHit {
16    #[serde(rename = "id")]
17    pub id: uuid::Uuid,
18    #[serde(rename = "address")]
19    pub address: String,
20    #[serde(rename = "geojson")]
21    pub geojson: Box<models::FinalDestinationHitGeojson>,
22    #[serde(rename = "distance", skip_serializing_if = "Option::is_none")]
23    pub distance: Option<f64>,
24    /// Confidence score in the range 0.0 to 1.0 indicating how well the result  matches the query. Higher is better.  See: https://docs.naurt.com/reference/search-confidence  Not to be confused with Accuracy, which is how good the data itself is. This  is about the likelihood of a good match. 
25    #[serde(rename = "search_confidence", skip_serializing_if = "Option::is_none")]
26    pub search_confidence: Option<f64>,
27    #[serde(rename = "structured_response", skip_serializing_if = "Option::is_none")]
28    pub structured_response: Option<Box<models::StructuredAddress>>,
29    #[serde(rename = "source_id", skip_serializing_if = "Option::is_none")]
30    pub source_id: Option<Box<models::FinalDestinationSourceIdResponse>>,
31}
32
33impl FinalDestinationHit {
34    pub fn new(id: uuid::Uuid, address: String, geojson: models::FinalDestinationHitGeojson) -> FinalDestinationHit {
35        FinalDestinationHit {
36            id,
37            address,
38            geojson: Box::new(geojson),
39            distance: None,
40            search_confidence: None,
41            structured_response: None,
42            source_id: None,
43        }
44    }
45}
46