proxmox_api/generated/access/openid/
auth_url.rs1#[derive(Debug, Clone)]
2pub struct AuthUrlClient<T> {
3 client: T,
4 path: String,
5}
6impl<T> AuthUrlClient<T>
7where
8 T: crate::client::Client,
9{
10 pub fn new(client: T, parent_path: &str) -> Self {
11 Self {
12 client,
13 path: format!("{}{}", parent_path, "/auth-url"),
14 }
15 }
16}
17impl<T> AuthUrlClient<T>
18where
19 T: crate::client::Client,
20{
21 #[doc = "Get the OpenId Authorization Url for the specified realm."]
22 #[doc = ""]
23 #[doc = "Accessible without authentication."]
24 pub async fn post(&self, params: PostParams) -> Result<String, T::Error> {
25 let path = self.path.to_string();
26 self.client.post(&path, ¶ms).await
27 }
28}
29impl PostParams {
30 pub fn new(realm: RealmStr, redirect_url: RedirectUrlStr) -> Self {
31 Self {
32 realm,
33 redirect_url,
34 additional_properties: ::std::default::Default::default(),
35 }
36 }
37}
38#[derive(Clone, Debug, :: serde :: Serialize, :: serde :: Deserialize)]
39pub struct PostParams {
40 #[doc = "Authentication domain ID"]
41 #[doc = ""]
42 pub realm: RealmStr,
43 #[serde(rename = "redirect-url")]
44 #[doc = "Redirection Url. The client should set this to the used server url (location.origin)."]
45 #[doc = ""]
46 pub redirect_url: RedirectUrlStr,
47 #[serde(
48 flatten,
49 default,
50 skip_serializing_if = "::std::collections::HashMap::is_empty"
51 )]
52 pub additional_properties: ::std::collections::HashMap<String, ::serde_json::Value>,
53}
54#[derive(Debug, Clone, PartialEq, PartialOrd)]
55pub struct RealmStr {
56 value: String,
57}
58impl crate::types::bounded_string::BoundedString for RealmStr {
59 const MIN_LENGTH: Option<usize> = None::<usize>;
60 const MAX_LENGTH: Option<usize> = Some(32usize);
61 const DEFAULT: Option<&'static str> = None::<&'static str>;
62 const PATTERN: Option<&'static str> = None::<&'static str>;
63 const TYPE_DESCRIPTION: &'static str = "a string with length at most 32";
64 fn get_value(&self) -> &str {
65 &self.value
66 }
67 fn new(value: String) -> Result<Self, crate::types::bounded_string::BoundedStringError> {
68 Self::validate(&value)?;
69 Ok(Self { value })
70 }
71}
72impl std::convert::TryFrom<String> for RealmStr {
73 type Error = crate::types::bounded_string::BoundedStringError;
74 fn try_from(value: String) -> Result<Self, Self::Error> {
75 crate::types::bounded_string::BoundedString::new(value)
76 }
77}
78impl ::serde::Serialize for RealmStr {
79 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
80 where
81 S: ::serde::Serializer,
82 {
83 crate::types::bounded_string::serialize_bounded_string(self, serializer)
84 }
85}
86impl<'de> ::serde::Deserialize<'de> for RealmStr {
87 fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
88 where
89 D: ::serde::Deserializer<'de>,
90 {
91 crate::types::bounded_string::deserialize_bounded_string(deserializer)
92 }
93}
94#[derive(Debug, Clone, PartialEq, PartialOrd)]
95pub struct RedirectUrlStr {
96 value: String,
97}
98impl crate::types::bounded_string::BoundedString for RedirectUrlStr {
99 const MIN_LENGTH: Option<usize> = None::<usize>;
100 const MAX_LENGTH: Option<usize> = Some(255usize);
101 const DEFAULT: Option<&'static str> = None::<&'static str>;
102 const PATTERN: Option<&'static str> = None::<&'static str>;
103 const TYPE_DESCRIPTION: &'static str = "a string with length at most 255";
104 fn get_value(&self) -> &str {
105 &self.value
106 }
107 fn new(value: String) -> Result<Self, crate::types::bounded_string::BoundedStringError> {
108 Self::validate(&value)?;
109 Ok(Self { value })
110 }
111}
112impl std::convert::TryFrom<String> for RedirectUrlStr {
113 type Error = crate::types::bounded_string::BoundedStringError;
114 fn try_from(value: String) -> Result<Self, Self::Error> {
115 crate::types::bounded_string::BoundedString::new(value)
116 }
117}
118impl ::serde::Serialize for RedirectUrlStr {
119 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
120 where
121 S: ::serde::Serializer,
122 {
123 crate::types::bounded_string::serialize_bounded_string(self, serializer)
124 }
125}
126impl<'de> ::serde::Deserialize<'de> for RedirectUrlStr {
127 fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
128 where
129 D: ::serde::Deserializer<'de>,
130 {
131 crate::types::bounded_string::deserialize_bounded_string(deserializer)
132 }
133}