Skip to main content

hanzo_client/models/
middleware.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 Middleware {
16    /// Config is the transform's parameters: redirectScheme takes scheme (default https) and permanent (\"true\" ⇒ 301, else 302); stripPrefix REQUIRES prefixes (comma-separated, first match wins); addPrefix REQUIRES prefix; headers is a header→value map set on the response.
17    #[serde(rename = "config", skip_serializing_if = "Option::is_none")]
18    pub config: Option<std::collections::HashMap<String, String>>,
19    /// ID identifies the transform within the org: [A-Za-z0-9-_.], at most 128 chars. A create that omits it gets a generated one. Routes reference it by this id.
20    #[serde(rename = "id", skip_serializing_if = "Option::is_none")]
21    pub id: Option<String>,
22    /// Type is the transform: redirectScheme, stripPrefix, addPrefix or headers.
23    #[serde(rename = "type", skip_serializing_if = "Option::is_none")]
24    pub r#type: Option<String>,
25}
26
27impl Middleware {
28    pub fn new() -> Middleware {
29        Middleware {
30            config: None,
31            id: None,
32            r#type: None,
33        }
34    }
35}
36