Skip to main content

hanzo_client/models/
route.rs

1/*
2 * Hanzo Cloud API
3 *
4 * The Hanzo Cloud API as a customer calls it: every operation under /v1/ except the operator's admin product, relay routes, legacy spellings and capabilities still reached by flag. Tagged by product: the first path segment after /v1/.
5 *
6 * The version of the OpenAPI document: v1
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 Route {
16    /// Host is the exact hostname this route matches, lowercased with any trailing dot stripped. It is a GLOBALLY unique claim — one route across the whole edge may hold a host, so no tenant can hijack another's.
17    #[serde(rename = "host", skip_serializing_if = "Option::is_none")]
18    pub host: Option<String>,
19    /// ID identifies the route within the org: [A-Za-z0-9-_.], at most 128 chars. A create that omits it gets a generated one.
20    #[serde(rename = "id", skip_serializing_if = "Option::is_none")]
21    pub id: Option<String>,
22    /// Middlewares are the ids of the edge transforms to apply, in this order, before the request reaches the service. At most 16.
23    #[serde(rename = "middlewares", skip_serializing_if = "Option::is_none")]
24    pub middlewares: Option<Vec<String>>,
25    /// PathPrefix narrows the match to requests under this path; it must start with \"/\". Empty matches every path on the host.
26    #[serde(rename = "pathPrefix", skip_serializing_if = "Option::is_none")]
27    pub path_prefix: Option<String>,
28    /// Priority orders routes that share a host: higher wins, and equal priorities fall back to the longer PathPrefix.
29    #[serde(rename = "priority", skip_serializing_if = "Option::is_none")]
30    pub priority: Option<i32>,
31    /// Service is the id of the backend pool this route dispatches to. A route naming a service that does not exist is skipped at compile, not served.
32    #[serde(rename = "service", skip_serializing_if = "Option::is_none")]
33    pub service: Option<String>,
34    /// TLS asks the edge to terminate TLS for Host with an ACME-managed certificate.
35    #[serde(rename = "tls", skip_serializing_if = "Option::is_none")]
36    pub tls: Option<bool>,
37}
38
39impl Route {
40    pub fn new() -> Route {
41        Route {
42            host: None,
43            id: None,
44            middlewares: None,
45            path_prefix: None,
46            priority: None,
47            service: None,
48            tls: None,
49        }
50    }
51}
52