Skip to main content

hanzo_client/models/
config.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 Config {
16    /// MaxAge caps message age, e.g. \"24h\" or \"7d\"; \"0\" (default) is unlimited.
17    #[serde(rename = "max_age", skip_serializing_if = "Option::is_none")]
18    pub max_age: Option<String>,
19    /// MaxBytes caps the stream's total stored bytes; -1 (default) is unlimited.
20    #[serde(rename = "max_bytes", skip_serializing_if = "Option::is_none")]
21    pub max_bytes: Option<i32>,
22    /// MaxMsgSize caps one message's size in bytes; -1 (default) is the broker's limit.
23    #[serde(rename = "max_msg_size", skip_serializing_if = "Option::is_none")]
24    pub max_msg_size: Option<i32>,
25    /// MaxMsgs caps the number of stored messages; -1 (default) is unlimited.
26    #[serde(rename = "max_msgs", skip_serializing_if = "Option::is_none")]
27    pub max_msgs: Option<i32>,
28    /// Name is the stream name, unique within the org (alphanumeric, hyphens, underscores).
29    #[serde(rename = "name", skip_serializing_if = "Option::is_none")]
30    pub name: Option<String>,
31    /// Replicas is the number of stream replicas (1–5); this plane runs 1.
32    #[serde(rename = "num_replicas", skip_serializing_if = "Option::is_none")]
33    pub num_replicas: Option<i32>,
34    /// Retention is the retention policy: limits (default), interest, or workqueue.
35    #[serde(rename = "retention", skip_serializing_if = "Option::is_none")]
36    pub retention: Option<String>,
37    /// Storage is the storage backend: file (default) or memory.
38    #[serde(rename = "storage", skip_serializing_if = "Option::is_none")]
39    pub storage: Option<String>,
40    /// Subjects are the org-relative subjects bound to this stream (wildcards supported). Default: the stream name.
41    #[serde(rename = "subjects", skip_serializing_if = "Option::is_none")]
42    pub subjects: Option<Vec<String>>,
43}
44
45impl Config {
46    pub fn new() -> Config {
47        Config {
48            max_age: None,
49            max_bytes: None,
50            max_msg_size: None,
51            max_msgs: None,
52            name: None,
53            num_replicas: None,
54            retention: None,
55            storage: None,
56            subjects: None,
57        }
58    }
59}
60