Skip to main content

hanzo_client/models/
create_server_req.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 CreateServerReq {
16    /// AuthHeader is the request header the credential is injected into, e.g. \"Authorization\". Empty means the server needs no credential.
17    #[serde(rename = "authHeader", skip_serializing_if = "Option::is_none")]
18    pub auth_header: Option<String>,
19    /// Listing enables a CATALOG entry instead — the id from GET /v1/tools/catalog. The endpoint is the listing's own streamable-http remote, so a listing that only ships a stdio package is refused: there is nothing to reach yet.
20    #[serde(rename = "listing", skip_serializing_if = "Option::is_none")]
21    pub listing: Option<String>,
22    /// Name labels the server for the org. Required with URL; with Listing it defaults to the listing's own title.
23    #[serde(rename = "name", skip_serializing_if = "Option::is_none")]
24    pub name: Option<String>,
25    /// Secret is the credential VALUE. It is sealed into KMS under a per-org ref and never stored in SQLite, never listed, and never returned.
26    #[serde(rename = "secret", skip_serializing_if = "Option::is_none")]
27    pub secret: Option<String>,
28    /// URL is the server's JSON-RPC endpoint. It must be an http(s) URL naming a PUBLIC host: loopback, link-local, private and cloud-metadata addresses are refused here and again when the dialer connects.
29    #[serde(rename = "url", skip_serializing_if = "Option::is_none")]
30    pub url: Option<String>,
31}
32
33impl CreateServerReq {
34    pub fn new() -> CreateServerReq {
35        CreateServerReq {
36            auth_header: None,
37            listing: None,
38            name: None,
39            secret: None,
40            url: None,
41        }
42    }
43}
44