naurt_api/models/input_filter.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/// InputFilter : Input filtering helps when you have addresses from sources you can't control. Sometimes, providers might miss out on important parts of addresses, like a street number or postcode. If Naurt detects that an address is missing too many fields to be likely to give a good match, it can be rejected by this feature `none` turns this feature off and does not do any input filtering. This may result in some poor responses `loose` is the default - it does filter out some poor inputs but allows some missing fields `strict` is our strictest, and only allows searches which are likely to produce good matches
15/// Input filtering helps when you have addresses from sources you can't control. Sometimes, providers might miss out on important parts of addresses, like a street number or postcode. If Naurt detects that an address is missing too many fields to be likely to give a good match, it can be rejected by this feature `none` turns this feature off and does not do any input filtering. This may result in some poor responses `loose` is the default - it does filter out some poor inputs but allows some missing fields `strict` is our strictest, and only allows searches which are likely to produce good matches
16#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
17pub enum InputFilter {
18 #[serde(rename = "none")]
19 None,
20 #[serde(rename = "loose")]
21 Loose,
22 #[serde(rename = "strict")]
23 Strict,
24
25}
26
27impl std::fmt::Display for InputFilter {
28 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
29 match self {
30 Self::None => write!(f, "none"),
31 Self::Loose => write!(f, "loose"),
32 Self::Strict => write!(f, "strict"),
33 }
34 }
35}
36
37impl Default for InputFilter {
38 fn default() -> InputFilter {
39 Self::None
40 }
41}
42