Skip to main content

windmill_api/models/
http_store_settings.rs

1/*
2 * Windmill API
3 *
4 * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
5 *
6 * The version of the OpenAPI document: 1.864.0
7 * Contact: contact@windmill.dev
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14/// HttpStoreSettings : Read-only secret backend for any secret store with an HTTP API. A secret variable saved with an empty value references the store key derived from its workspace and path.
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct HttpStoreSettings {
17    /// Scheme, host and optional path prefix of the store
18    #[serde(rename = "base_url")]
19    pub base_url: String,
20    #[serde(rename = "read")]
21    pub read: Box<models::HttpStoreSettingsRead>,
22    /// How a variable path becomes a store key (default url)
23    #[serde(rename = "path_encoding", skip_serializing_if = "Option::is_none")]
24    pub path_encoding: Option<PathEncoding>,
25    #[serde(rename = "extra_headers", skip_serializing_if = "Option::is_none")]
26    pub extra_headers: Option<std::collections::HashMap<String, String>>,
27    #[serde(rename = "auth")]
28    pub auth: Box<models::HttpStoreAuth>,
29    /// PEM bundle of additional CA certificates trusted for the store
30    #[serde(rename = "ca_bundle_path", skip_serializing_if = "Option::is_none")]
31    pub ca_bundle_path: Option<String>,
32    #[serde(rename = "timeout_secs", skip_serializing_if = "Option::is_none")]
33    pub timeout_secs: Option<i32>,
34    #[serde(rename = "skip_ssl_verify", skip_serializing_if = "Option::is_none")]
35    pub skip_ssl_verify: Option<bool>,
36}
37
38impl HttpStoreSettings {
39    /// Read-only secret backend for any secret store with an HTTP API. A secret variable saved with an empty value references the store key derived from its workspace and path.
40    pub fn new(base_url: String, read: models::HttpStoreSettingsRead, auth: models::HttpStoreAuth) -> HttpStoreSettings {
41        HttpStoreSettings {
42            base_url,
43            read: Box::new(read),
44            path_encoding: None,
45            extra_headers: None,
46            auth: Box::new(auth),
47            ca_bundle_path: None,
48            timeout_secs: None,
49            skip_ssl_verify: None,
50        }
51    }
52}
53/// How a variable path becomes a store key (default url)
54#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
55pub enum PathEncoding {
56    #[serde(rename = "url")]
57    Url,
58    #[serde(rename = "double_dash")]
59    DoubleDash,
60    #[serde(rename = "raw")]
61    Raw,
62}
63
64impl Default for PathEncoding {
65    fn default() -> PathEncoding {
66        Self::Url
67    }
68}
69