pulsar_admin_sdk/models/
auth_policies.rs

1/*
2 * Pulsar Admin REST API
3 *
4 * This provides the REST API for admin operations
5 *
6 * The version of the OpenAPI document: v2
7 * 
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12
13#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
14pub struct AuthPolicies {
15    #[serde(rename = "namespaceAuthentication", skip_serializing_if = "Option::is_none")]
16    pub namespace_authentication: Option<NamespaceAuthentication>,
17    #[serde(rename = "subscriptionAuthentication", skip_serializing_if = "Option::is_none")]
18    pub subscription_authentication: Option<std::collections::HashMap<String, Vec<String>>>,
19    #[serde(rename = "topicAuthentication", skip_serializing_if = "Option::is_none")]
20    pub topic_authentication: Option<TopicAuthentication>,
21}
22
23impl AuthPolicies {
24    pub fn new() -> AuthPolicies {
25        AuthPolicies {
26            namespace_authentication: None,
27            subscription_authentication: None,
28            topic_authentication: None,
29        }
30    }
31}
32/// 
33#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
34pub enum NamespaceAuthentication {
35    #[serde(rename = "produce")]
36    Produce,
37    #[serde(rename = "consume")]
38    Consume,
39    #[serde(rename = "functions")]
40    Functions,
41    #[serde(rename = "sources")]
42    Sources,
43    #[serde(rename = "sinks")]
44    Sinks,
45    #[serde(rename = "packages")]
46    Packages,
47}
48
49impl Default for NamespaceAuthentication {
50    fn default() -> NamespaceAuthentication {
51        Self::Produce
52    }
53}
54/// 
55#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
56pub enum TopicAuthentication {
57    #[serde(rename = "produce")]
58    Produce,
59    #[serde(rename = "consume")]
60    Consume,
61    #[serde(rename = "functions")]
62    Functions,
63    #[serde(rename = "sources")]
64    Sources,
65    #[serde(rename = "sinks")]
66    Sinks,
67    #[serde(rename = "packages")]
68    Packages,
69}
70
71impl Default for TopicAuthentication {
72    fn default() -> TopicAuthentication {
73        Self::Produce
74    }
75}
76