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.4
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. This is closely linked to match_level.  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 = "match_level", skip_serializing_if = "Option::is_none")]
28    pub match_level: Option<models::FinalDestinationMatchLevel>,
29    #[serde(rename = "structured_response", skip_serializing_if = "Option::is_none")]
30    pub structured_response: Option<Box<models::StructuredAddress>>,
31    #[serde(rename = "source_id", skip_serializing_if = "Option::is_none")]
32    pub source_id: Option<Box<models::FinalDestinationSourceIdResponse>>,
33}
34
35impl FinalDestinationHit {
36    pub fn new(id: uuid::Uuid, address: String, geojson: models::FinalDestinationHitGeojson) -> FinalDestinationHit {
37        FinalDestinationHit {
38            id,
39            address,
40            geojson: Box::new(geojson),
41            distance: None,
42            search_confidence: None,
43            match_level: None,
44            structured_response: None,
45            source_id: None,
46        }
47    }
48}
49