Skip to main content

proxmox_api/generated/access/
domains.rs

1pub mod realm;
2#[derive(Debug, Clone)]
3pub struct DomainsClient<T> {
4    client: T,
5    path: String,
6}
7impl<T> DomainsClient<T>
8where
9    T: crate::client::Client,
10{
11    pub fn new(client: T, parent_path: &str) -> Self {
12        Self {
13            client,
14            path: format!("{}{}", parent_path, "/domains"),
15        }
16    }
17}
18impl<T> DomainsClient<T>
19where
20    T: crate::client::Client,
21{
22    #[doc = "Authentication domain index."]
23    #[doc = ""]
24    #[doc = "Accessible without authentication."]
25    pub async fn get(&self) -> Result<Vec<GetOutputItems>, T::Error> {
26        let path = self.path.to_string();
27        let optional_vec: Option<Vec<GetOutputItems>> = self.client.get(&path, &()).await?;
28        Ok(optional_vec.unwrap_or_default())
29    }
30}
31impl<T> DomainsClient<T>
32where
33    T: crate::client::Client,
34{
35    #[doc = "Add an authentication server."]
36    #[doc = ""]
37    #[doc = "Permission check: perm(\"/access/realm\", [\"Realm.Allocate\"])"]
38    pub async fn post(&self, params: PostParams) -> Result<(), T::Error> {
39        let path = self.path.to_string();
40        self.client.post(&path, &params).await
41    }
42}
43impl GetOutputItems {
44    pub fn new(realm: String, ty: String) -> Self {
45        Self {
46            realm,
47            ty,
48            comment: ::std::default::Default::default(),
49            tfa: ::std::default::Default::default(),
50            additional_properties: ::std::default::Default::default(),
51        }
52    }
53}
54#[derive(Clone, Debug, :: serde :: Serialize, :: serde :: Deserialize)]
55pub struct GetOutputItems {
56    #[serde(skip_serializing_if = "Option::is_none", default)]
57    #[doc = "A comment. The GUI use this text when you select a domain (Realm) on the login window."]
58    #[doc = ""]
59    pub comment: Option<String>,
60    pub realm: String,
61    #[serde(skip_serializing_if = "Option::is_none", default)]
62    #[doc = "Two-factor authentication provider."]
63    #[doc = ""]
64    pub tfa: Option<Tfa>,
65    #[serde(rename = "type")]
66    pub ty: String,
67    #[serde(
68        flatten,
69        default,
70        skip_serializing_if = "::std::collections::HashMap::is_empty"
71    )]
72    pub additional_properties: ::std::collections::HashMap<String, ::serde_json::Value>,
73}
74impl PostParams {
75    pub fn new(realm: RealmStr, ty: Type) -> Self {
76        Self {
77            realm,
78            ty,
79            acr_values: ::std::default::Default::default(),
80            autocreate: ::std::default::Default::default(),
81            base_dn: ::std::default::Default::default(),
82            bind_dn: ::std::default::Default::default(),
83            capath: ::std::default::Default::default(),
84            case_sensitive: ::std::default::Default::default(),
85            cert: ::std::default::Default::default(),
86            certkey: ::std::default::Default::default(),
87            check_connection: ::std::default::Default::default(),
88            client_id: ::std::default::Default::default(),
89            client_key: ::std::default::Default::default(),
90            comment: ::std::default::Default::default(),
91            default: ::std::default::Default::default(),
92            domain: ::std::default::Default::default(),
93            filter: ::std::default::Default::default(),
94            group_classes: ::std::default::Default::default(),
95            group_dn: ::std::default::Default::default(),
96            group_filter: ::std::default::Default::default(),
97            group_name_attr: ::std::default::Default::default(),
98            groups_autocreate: ::std::default::Default::default(),
99            groups_claim: ::std::default::Default::default(),
100            groups_overwrite: ::std::default::Default::default(),
101            issuer_url: ::std::default::Default::default(),
102            mode: ::std::default::Default::default(),
103            password: ::std::default::Default::default(),
104            port: ::std::default::Default::default(),
105            prompt: ::std::default::Default::default(),
106            query_userinfo: ::std::default::Default::default(),
107            scopes: ::std::default::Default::default(),
108            secure: ::std::default::Default::default(),
109            server1: ::std::default::Default::default(),
110            server2: ::std::default::Default::default(),
111            sslversion: ::std::default::Default::default(),
112            sync_defaults_options: ::std::default::Default::default(),
113            sync_attributes: ::std::default::Default::default(),
114            tfa: ::std::default::Default::default(),
115            user_attr: ::std::default::Default::default(),
116            user_classes: ::std::default::Default::default(),
117            username_claim: ::std::default::Default::default(),
118            verify: ::std::default::Default::default(),
119            additional_properties: ::std::default::Default::default(),
120        }
121    }
122}
123#[derive(Clone, Debug, :: serde :: Serialize, :: serde :: Deserialize)]
124pub struct PostParams {
125    #[serde(rename = "acr-values")]
126    #[serde(skip_serializing_if = "Option::is_none", default)]
127    #[doc = "Specifies the Authentication Context Class Reference values that theAuthorization Server is being requested to use for the Auth Request."]
128    #[doc = ""]
129    pub acr_values: Option<AcrValuesStr>,
130    #[serde(
131        serialize_with = "crate::types::serialize_bool_optional",
132        deserialize_with = "crate::types::deserialize_bool_optional"
133    )]
134    #[serde(skip_serializing_if = "Option::is_none", default)]
135    #[doc = "Automatically create users if they do not exist."]
136    #[doc = ""]
137    pub autocreate: Option<bool>,
138    #[serde(skip_serializing_if = "Option::is_none", default)]
139    #[doc = "LDAP base domain name"]
140    #[doc = ""]
141    pub base_dn: Option<BaseDnStr>,
142    #[serde(skip_serializing_if = "Option::is_none", default)]
143    #[doc = "LDAP bind domain name"]
144    #[doc = ""]
145    pub bind_dn: Option<BindDnStr>,
146    #[serde(skip_serializing_if = "Option::is_none", default)]
147    #[doc = "Path to the CA certificate store"]
148    #[doc = ""]
149    pub capath: Option<String>,
150    #[serde(rename = "case-sensitive")]
151    #[serde(
152        serialize_with = "crate::types::serialize_bool_optional",
153        deserialize_with = "crate::types::deserialize_bool_optional"
154    )]
155    #[serde(skip_serializing_if = "Option::is_none", default)]
156    #[doc = "username is case-sensitive"]
157    #[doc = ""]
158    pub case_sensitive: Option<bool>,
159    #[serde(skip_serializing_if = "Option::is_none", default)]
160    #[doc = "Path to the client certificate"]
161    #[doc = ""]
162    pub cert: Option<String>,
163    #[serde(skip_serializing_if = "Option::is_none", default)]
164    #[doc = "Path to the client certificate key"]
165    #[doc = ""]
166    pub certkey: Option<String>,
167    #[serde(rename = "check-connection")]
168    #[serde(
169        serialize_with = "crate::types::serialize_bool_optional",
170        deserialize_with = "crate::types::deserialize_bool_optional"
171    )]
172    #[serde(skip_serializing_if = "Option::is_none", default)]
173    #[doc = "Check bind connection to the server."]
174    #[doc = ""]
175    pub check_connection: Option<bool>,
176    #[serde(rename = "client-id")]
177    #[serde(skip_serializing_if = "Option::is_none", default)]
178    #[doc = "OpenID Client ID"]
179    #[doc = ""]
180    pub client_id: Option<ClientIdStr>,
181    #[serde(rename = "client-key")]
182    #[serde(skip_serializing_if = "Option::is_none", default)]
183    #[doc = "OpenID Client Key"]
184    #[doc = ""]
185    pub client_key: Option<ClientKeyStr>,
186    #[serde(skip_serializing_if = "Option::is_none", default)]
187    #[doc = "Description."]
188    #[doc = ""]
189    pub comment: Option<CommentStr>,
190    #[serde(
191        serialize_with = "crate::types::serialize_bool_optional",
192        deserialize_with = "crate::types::deserialize_bool_optional"
193    )]
194    #[serde(skip_serializing_if = "Option::is_none", default)]
195    #[doc = "Use this as default realm"]
196    #[doc = ""]
197    pub default: Option<bool>,
198    #[serde(skip_serializing_if = "Option::is_none", default)]
199    #[doc = "AD domain name"]
200    #[doc = ""]
201    pub domain: Option<DomainStr>,
202    #[serde(skip_serializing_if = "Option::is_none", default)]
203    #[doc = "LDAP filter for user sync."]
204    #[doc = ""]
205    pub filter: Option<FilterStr>,
206    #[serde(skip_serializing_if = "Option::is_none", default)]
207    #[doc = "The objectclasses for groups."]
208    #[doc = ""]
209    pub group_classes: Option<String>,
210    #[serde(skip_serializing_if = "Option::is_none", default)]
211    #[doc = "LDAP base domain name for group sync. If not set, the base_dn will be used."]
212    #[doc = ""]
213    pub group_dn: Option<GroupDnStr>,
214    #[serde(skip_serializing_if = "Option::is_none", default)]
215    #[doc = "LDAP filter for group sync."]
216    #[doc = ""]
217    pub group_filter: Option<GroupFilterStr>,
218    #[serde(skip_serializing_if = "Option::is_none", default)]
219    #[doc = "LDAP attribute representing a groups name. If not set or found, the first value of the DN will be used as name."]
220    #[doc = ""]
221    pub group_name_attr: Option<GroupNameAttrStr>,
222    #[serde(rename = "groups-autocreate")]
223    #[serde(
224        serialize_with = "crate::types::serialize_bool_optional",
225        deserialize_with = "crate::types::deserialize_bool_optional"
226    )]
227    #[serde(skip_serializing_if = "Option::is_none", default)]
228    #[doc = "Automatically create groups if they do not exist."]
229    #[doc = ""]
230    pub groups_autocreate: Option<bool>,
231    #[serde(rename = "groups-claim")]
232    #[serde(skip_serializing_if = "Option::is_none", default)]
233    #[doc = "OpenID claim used to retrieve groups with."]
234    #[doc = ""]
235    pub groups_claim: Option<GroupsClaimStr>,
236    #[serde(rename = "groups-overwrite")]
237    #[serde(
238        serialize_with = "crate::types::serialize_bool_optional",
239        deserialize_with = "crate::types::deserialize_bool_optional"
240    )]
241    #[serde(skip_serializing_if = "Option::is_none", default)]
242    #[doc = "All groups will be overwritten for the user on login."]
243    #[doc = ""]
244    pub groups_overwrite: Option<bool>,
245    #[serde(rename = "issuer-url")]
246    #[serde(skip_serializing_if = "Option::is_none", default)]
247    #[doc = "OpenID Issuer Url"]
248    #[doc = ""]
249    pub issuer_url: Option<IssuerUrlStr>,
250    #[serde(skip_serializing_if = "Option::is_none", default)]
251    #[doc = "LDAP protocol mode."]
252    #[doc = ""]
253    pub mode: Option<Mode>,
254    #[serde(skip_serializing_if = "Option::is_none", default)]
255    #[doc = "LDAP bind password. Will be stored in '/etc/pve/priv/realm/\\\\<REALM\\\\>.pw'."]
256    #[doc = ""]
257    pub password: Option<String>,
258    #[serde(skip_serializing_if = "Option::is_none", default)]
259    #[doc = "Server port."]
260    #[doc = ""]
261    pub port: Option<PortInt>,
262    #[serde(skip_serializing_if = "Option::is_none", default)]
263    #[doc = "Specifies whether the Authorization Server prompts the End-User for reauthentication and consent."]
264    #[doc = ""]
265    pub prompt: Option<PromptStr>,
266    #[serde(rename = "query-userinfo")]
267    #[serde(
268        serialize_with = "crate::types::serialize_bool_optional",
269        deserialize_with = "crate::types::deserialize_bool_optional"
270    )]
271    #[serde(skip_serializing_if = "Option::is_none", default)]
272    #[doc = "Enables querying the userinfo endpoint for claims values."]
273    #[doc = ""]
274    pub query_userinfo: Option<bool>,
275    #[doc = "Authentication domain ID"]
276    #[doc = ""]
277    pub realm: RealmStr,
278    #[serde(skip_serializing_if = "Option::is_none", default)]
279    #[doc = "Specifies the scopes (user details) that should be authorized and returned, for example 'email' or 'profile'."]
280    #[doc = ""]
281    pub scopes: Option<String>,
282    #[serde(
283        serialize_with = "crate::types::serialize_bool_optional",
284        deserialize_with = "crate::types::deserialize_bool_optional"
285    )]
286    #[serde(skip_serializing_if = "Option::is_none", default)]
287    #[doc = "Use secure LDAPS protocol. DEPRECATED: use 'mode' instead."]
288    #[doc = ""]
289    pub secure: Option<bool>,
290    #[serde(skip_serializing_if = "Option::is_none", default)]
291    #[doc = "Server IP address (or DNS name)"]
292    #[doc = ""]
293    pub server1: Option<Server1Str>,
294    #[serde(skip_serializing_if = "Option::is_none", default)]
295    #[doc = "Fallback Server IP address (or DNS name)"]
296    #[doc = ""]
297    pub server2: Option<Server2Str>,
298    #[serde(skip_serializing_if = "Option::is_none", default)]
299    #[doc = "LDAPS TLS/SSL version. It's not recommended to use version older than 1.2!"]
300    #[doc = ""]
301    pub sslversion: Option<Sslversion>,
302    #[serde(rename = "sync-defaults-options")]
303    #[serde(skip_serializing_if = "Option::is_none", default)]
304    #[doc = "The default options for behavior of synchronizations."]
305    #[doc = ""]
306    pub sync_defaults_options: Option<String>,
307    #[serde(skip_serializing_if = "Option::is_none", default)]
308    #[doc = "Comma separated list of key=value pairs for specifying which LDAP attributes map to which PVE user field. For example, to map the LDAP attribute 'mail' to PVEs 'email', write  'email=mail'. By default, each PVE user field is represented  by an LDAP attribute of the same name."]
309    #[doc = ""]
310    pub sync_attributes: Option<SyncAttributesStr>,
311    #[serde(skip_serializing_if = "Option::is_none", default)]
312    #[doc = "Use Two-factor authentication."]
313    #[doc = ""]
314    pub tfa: Option<TfaStr>,
315    #[serde(rename = "type")]
316    #[doc = "Realm type."]
317    #[doc = ""]
318    pub ty: Type,
319    #[serde(skip_serializing_if = "Option::is_none", default)]
320    #[doc = "LDAP user attribute name"]
321    #[doc = ""]
322    pub user_attr: Option<UserAttrStr>,
323    #[serde(skip_serializing_if = "Option::is_none", default)]
324    #[doc = "The objectclasses for users."]
325    #[doc = ""]
326    pub user_classes: Option<String>,
327    #[serde(rename = "username-claim")]
328    #[serde(skip_serializing_if = "Option::is_none", default)]
329    #[doc = "OpenID claim used to generate the unique username."]
330    #[doc = ""]
331    pub username_claim: Option<String>,
332    #[serde(
333        serialize_with = "crate::types::serialize_bool_optional",
334        deserialize_with = "crate::types::deserialize_bool_optional"
335    )]
336    #[serde(skip_serializing_if = "Option::is_none", default)]
337    #[doc = "Verify the server's SSL certificate"]
338    #[doc = ""]
339    pub verify: Option<bool>,
340    #[serde(
341        flatten,
342        default,
343        skip_serializing_if = "::std::collections::HashMap::is_empty"
344    )]
345    pub additional_properties: ::std::collections::HashMap<String, ::serde_json::Value>,
346}
347#[derive(Clone, Debug, :: serde :: Serialize, :: serde :: Deserialize, PartialEq, Default)]
348#[doc = "LDAP protocol mode."]
349#[doc = ""]
350pub enum Mode {
351    #[serde(rename = "ldap")]
352    #[default]
353    Ldap,
354    #[serde(rename = "ldap+starttls")]
355    LdapStarttls,
356    #[serde(rename = "ldaps")]
357    Ldaps,
358}
359impl TryFrom<&str> for Mode {
360    type Error = String;
361    fn try_from(value: &str) -> Result<Self, <Self as TryFrom<&str>>::Error> {
362        match value {
363            "ldap" => Ok(Self::Ldap),
364            "ldap+starttls" => Ok(Self::LdapStarttls),
365            "ldaps" => Ok(Self::Ldaps),
366            v => Err(format!("Unknown variant {v}")),
367        }
368    }
369}
370#[derive(Clone, Debug, :: serde :: Serialize, :: serde :: Deserialize, PartialEq)]
371#[doc = "LDAPS TLS/SSL version. It's not recommended to use version older than 1.2!"]
372#[doc = ""]
373pub enum Sslversion {
374    #[serde(rename = "tlsv1")]
375    Tlsv1,
376    #[serde(rename = "tlsv1_1")]
377    Tlsv11,
378    #[serde(rename = "tlsv1_2")]
379    Tlsv12,
380    #[serde(rename = "tlsv1_3")]
381    Tlsv13,
382}
383impl TryFrom<&str> for Sslversion {
384    type Error = String;
385    fn try_from(value: &str) -> Result<Self, <Self as TryFrom<&str>>::Error> {
386        match value {
387            "tlsv1" => Ok(Self::Tlsv1),
388            "tlsv1_1" => Ok(Self::Tlsv11),
389            "tlsv1_2" => Ok(Self::Tlsv12),
390            "tlsv1_3" => Ok(Self::Tlsv13),
391            v => Err(format!("Unknown variant {v}")),
392        }
393    }
394}
395#[derive(Clone, Debug, :: serde :: Serialize, :: serde :: Deserialize, PartialEq)]
396#[doc = "Two-factor authentication provider."]
397#[doc = ""]
398pub enum Tfa {
399    #[serde(rename = "oath")]
400    Oath,
401    #[serde(rename = "yubico")]
402    Yubico,
403}
404impl TryFrom<&str> for Tfa {
405    type Error = String;
406    fn try_from(value: &str) -> Result<Self, <Self as TryFrom<&str>>::Error> {
407        match value {
408            "oath" => Ok(Self::Oath),
409            "yubico" => Ok(Self::Yubico),
410            v => Err(format!("Unknown variant {v}")),
411        }
412    }
413}
414#[derive(Clone, Debug, :: serde :: Serialize, :: serde :: Deserialize, PartialEq)]
415#[doc = "Realm type."]
416#[doc = ""]
417pub enum Type {
418    #[serde(rename = "ad")]
419    Ad,
420    #[serde(rename = "ldap")]
421    Ldap,
422    #[serde(rename = "openid")]
423    Openid,
424    #[serde(rename = "pam")]
425    Pam,
426    #[serde(rename = "pve")]
427    Pve,
428}
429impl TryFrom<&str> for Type {
430    type Error = String;
431    fn try_from(value: &str) -> Result<Self, <Self as TryFrom<&str>>::Error> {
432        match value {
433            "ad" => Ok(Self::Ad),
434            "ldap" => Ok(Self::Ldap),
435            "openid" => Ok(Self::Openid),
436            "pam" => Ok(Self::Pam),
437            "pve" => Ok(Self::Pve),
438            v => Err(format!("Unknown variant {v}")),
439        }
440    }
441}
442#[derive(Debug, Clone, Copy, PartialEq, PartialOrd)]
443pub struct PortInt(i128);
444impl crate::types::bounded_integer::BoundedInteger for PortInt {
445    const MIN: Option<i128> = Some(1i128);
446    const MAX: Option<i128> = Some(65535i128);
447    const DEFAULT: Option<i128> = None::<i128>;
448    const TYPE_DESCRIPTION: &'static str = "an integer between 1 and 65535";
449    fn get(&self) -> i128 {
450        self.0
451    }
452    fn new(value: i128) -> Result<Self, crate::types::bounded_integer::BoundedIntegerError> {
453        Self::validate(value)?;
454        Ok(Self(value))
455    }
456}
457impl std::convert::TryFrom<i128> for PortInt {
458    type Error = crate::types::bounded_integer::BoundedIntegerError;
459    fn try_from(value: i128) -> Result<Self, Self::Error> {
460        crate::types::bounded_integer::BoundedInteger::new(value)
461    }
462}
463impl ::serde::Serialize for PortInt {
464    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
465    where
466        S: ::serde::Serializer,
467    {
468        crate::types::bounded_integer::serialize_bounded_integer(self, serializer)
469    }
470}
471impl<'de> ::serde::Deserialize<'de> for PortInt {
472    fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
473    where
474        D: ::serde::Deserializer<'de>,
475    {
476        crate::types::bounded_integer::deserialize_bounded_integer(deserializer)
477    }
478}
479#[derive(Debug, Clone, PartialEq, PartialOrd)]
480pub struct AcrValuesStr {
481    value: String,
482}
483impl crate::types::bounded_string::BoundedString for AcrValuesStr {
484    const MIN_LENGTH: Option<usize> = None::<usize>;
485    const MAX_LENGTH: Option<usize> = None::<usize>;
486    const DEFAULT: Option<&'static str> = None::<&'static str>;
487    const PATTERN: Option<&'static str> = Some("^[^\\x00-\\x1F\\x7F <>#\"]*$");
488    const TYPE_DESCRIPTION: &'static str =
489        "a string with pattern r\"^[^\\x00-\\x1F\\x7F <>#\"]*$\" and no length constraints";
490    fn get_value(&self) -> &str {
491        &self.value
492    }
493    fn new(value: String) -> Result<Self, crate::types::bounded_string::BoundedStringError> {
494        Self::validate(&value)?;
495        Ok(Self { value })
496    }
497}
498impl std::convert::TryFrom<String> for AcrValuesStr {
499    type Error = crate::types::bounded_string::BoundedStringError;
500    fn try_from(value: String) -> Result<Self, Self::Error> {
501        crate::types::bounded_string::BoundedString::new(value)
502    }
503}
504impl ::serde::Serialize for AcrValuesStr {
505    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
506    where
507        S: ::serde::Serializer,
508    {
509        crate::types::bounded_string::serialize_bounded_string(self, serializer)
510    }
511}
512impl<'de> ::serde::Deserialize<'de> for AcrValuesStr {
513    fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
514    where
515        D: ::serde::Deserializer<'de>,
516    {
517        crate::types::bounded_string::deserialize_bounded_string(deserializer)
518    }
519}
520#[derive(Debug, Clone, PartialEq, PartialOrd)]
521pub struct BaseDnStr {
522    value: String,
523}
524impl crate::types::bounded_string::BoundedString for BaseDnStr {
525    const MIN_LENGTH: Option<usize> = None::<usize>;
526    const MAX_LENGTH: Option<usize> = Some(256usize);
527    const DEFAULT: Option<&'static str> = None::<&'static str>;
528    const PATTERN: Option<&'static str> = None::<&'static str>;
529    const TYPE_DESCRIPTION: &'static str = "a string with length at most 256";
530    fn get_value(&self) -> &str {
531        &self.value
532    }
533    fn new(value: String) -> Result<Self, crate::types::bounded_string::BoundedStringError> {
534        Self::validate(&value)?;
535        Ok(Self { value })
536    }
537}
538impl std::convert::TryFrom<String> for BaseDnStr {
539    type Error = crate::types::bounded_string::BoundedStringError;
540    fn try_from(value: String) -> Result<Self, Self::Error> {
541        crate::types::bounded_string::BoundedString::new(value)
542    }
543}
544impl ::serde::Serialize for BaseDnStr {
545    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
546    where
547        S: ::serde::Serializer,
548    {
549        crate::types::bounded_string::serialize_bounded_string(self, serializer)
550    }
551}
552impl<'de> ::serde::Deserialize<'de> for BaseDnStr {
553    fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
554    where
555        D: ::serde::Deserializer<'de>,
556    {
557        crate::types::bounded_string::deserialize_bounded_string(deserializer)
558    }
559}
560#[derive(Debug, Clone, PartialEq, PartialOrd)]
561pub struct BindDnStr {
562    value: String,
563}
564impl crate::types::bounded_string::BoundedString for BindDnStr {
565    const MIN_LENGTH: Option<usize> = None::<usize>;
566    const MAX_LENGTH: Option<usize> = Some(256usize);
567    const DEFAULT: Option<&'static str> = None::<&'static str>;
568    const PATTERN: Option<&'static str> = None::<&'static str>;
569    const TYPE_DESCRIPTION: &'static str = "a string with length at most 256";
570    fn get_value(&self) -> &str {
571        &self.value
572    }
573    fn new(value: String) -> Result<Self, crate::types::bounded_string::BoundedStringError> {
574        Self::validate(&value)?;
575        Ok(Self { value })
576    }
577}
578impl std::convert::TryFrom<String> for BindDnStr {
579    type Error = crate::types::bounded_string::BoundedStringError;
580    fn try_from(value: String) -> Result<Self, Self::Error> {
581        crate::types::bounded_string::BoundedString::new(value)
582    }
583}
584impl ::serde::Serialize for BindDnStr {
585    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
586    where
587        S: ::serde::Serializer,
588    {
589        crate::types::bounded_string::serialize_bounded_string(self, serializer)
590    }
591}
592impl<'de> ::serde::Deserialize<'de> for BindDnStr {
593    fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
594    where
595        D: ::serde::Deserializer<'de>,
596    {
597        crate::types::bounded_string::deserialize_bounded_string(deserializer)
598    }
599}
600#[derive(Debug, Clone, PartialEq, PartialOrd)]
601pub struct ClientIdStr {
602    value: String,
603}
604impl crate::types::bounded_string::BoundedString for ClientIdStr {
605    const MIN_LENGTH: Option<usize> = None::<usize>;
606    const MAX_LENGTH: Option<usize> = Some(256usize);
607    const DEFAULT: Option<&'static str> = None::<&'static str>;
608    const PATTERN: Option<&'static str> = None::<&'static str>;
609    const TYPE_DESCRIPTION: &'static str = "a string with length at most 256";
610    fn get_value(&self) -> &str {
611        &self.value
612    }
613    fn new(value: String) -> Result<Self, crate::types::bounded_string::BoundedStringError> {
614        Self::validate(&value)?;
615        Ok(Self { value })
616    }
617}
618impl std::convert::TryFrom<String> for ClientIdStr {
619    type Error = crate::types::bounded_string::BoundedStringError;
620    fn try_from(value: String) -> Result<Self, Self::Error> {
621        crate::types::bounded_string::BoundedString::new(value)
622    }
623}
624impl ::serde::Serialize for ClientIdStr {
625    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
626    where
627        S: ::serde::Serializer,
628    {
629        crate::types::bounded_string::serialize_bounded_string(self, serializer)
630    }
631}
632impl<'de> ::serde::Deserialize<'de> for ClientIdStr {
633    fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
634    where
635        D: ::serde::Deserializer<'de>,
636    {
637        crate::types::bounded_string::deserialize_bounded_string(deserializer)
638    }
639}
640#[derive(Debug, Clone, PartialEq, PartialOrd)]
641pub struct ClientKeyStr {
642    value: String,
643}
644impl crate::types::bounded_string::BoundedString for ClientKeyStr {
645    const MIN_LENGTH: Option<usize> = None::<usize>;
646    const MAX_LENGTH: Option<usize> = Some(256usize);
647    const DEFAULT: Option<&'static str> = None::<&'static str>;
648    const PATTERN: Option<&'static str> = None::<&'static str>;
649    const TYPE_DESCRIPTION: &'static str = "a string with length at most 256";
650    fn get_value(&self) -> &str {
651        &self.value
652    }
653    fn new(value: String) -> Result<Self, crate::types::bounded_string::BoundedStringError> {
654        Self::validate(&value)?;
655        Ok(Self { value })
656    }
657}
658impl std::convert::TryFrom<String> for ClientKeyStr {
659    type Error = crate::types::bounded_string::BoundedStringError;
660    fn try_from(value: String) -> Result<Self, Self::Error> {
661        crate::types::bounded_string::BoundedString::new(value)
662    }
663}
664impl ::serde::Serialize for ClientKeyStr {
665    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
666    where
667        S: ::serde::Serializer,
668    {
669        crate::types::bounded_string::serialize_bounded_string(self, serializer)
670    }
671}
672impl<'de> ::serde::Deserialize<'de> for ClientKeyStr {
673    fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
674    where
675        D: ::serde::Deserializer<'de>,
676    {
677        crate::types::bounded_string::deserialize_bounded_string(deserializer)
678    }
679}
680#[derive(Debug, Clone, PartialEq, PartialOrd)]
681pub struct CommentStr {
682    value: String,
683}
684impl crate::types::bounded_string::BoundedString for CommentStr {
685    const MIN_LENGTH: Option<usize> = None::<usize>;
686    const MAX_LENGTH: Option<usize> = Some(4096usize);
687    const DEFAULT: Option<&'static str> = None::<&'static str>;
688    const PATTERN: Option<&'static str> = None::<&'static str>;
689    const TYPE_DESCRIPTION: &'static str = "a string with length at most 4096";
690    fn get_value(&self) -> &str {
691        &self.value
692    }
693    fn new(value: String) -> Result<Self, crate::types::bounded_string::BoundedStringError> {
694        Self::validate(&value)?;
695        Ok(Self { value })
696    }
697}
698impl std::convert::TryFrom<String> for CommentStr {
699    type Error = crate::types::bounded_string::BoundedStringError;
700    fn try_from(value: String) -> Result<Self, Self::Error> {
701        crate::types::bounded_string::BoundedString::new(value)
702    }
703}
704impl ::serde::Serialize for CommentStr {
705    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
706    where
707        S: ::serde::Serializer,
708    {
709        crate::types::bounded_string::serialize_bounded_string(self, serializer)
710    }
711}
712impl<'de> ::serde::Deserialize<'de> for CommentStr {
713    fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
714    where
715        D: ::serde::Deserializer<'de>,
716    {
717        crate::types::bounded_string::deserialize_bounded_string(deserializer)
718    }
719}
720#[derive(Debug, Clone, PartialEq, PartialOrd)]
721pub struct DomainStr {
722    value: String,
723}
724impl crate::types::bounded_string::BoundedString for DomainStr {
725    const MIN_LENGTH: Option<usize> = None::<usize>;
726    const MAX_LENGTH: Option<usize> = Some(256usize);
727    const DEFAULT: Option<&'static str> = None::<&'static str>;
728    const PATTERN: Option<&'static str> = Some("\\S+");
729    const TYPE_DESCRIPTION: &'static str = "a string with pattern r\"\\S+\" and length at most 256";
730    fn get_value(&self) -> &str {
731        &self.value
732    }
733    fn new(value: String) -> Result<Self, crate::types::bounded_string::BoundedStringError> {
734        Self::validate(&value)?;
735        Ok(Self { value })
736    }
737}
738impl std::convert::TryFrom<String> for DomainStr {
739    type Error = crate::types::bounded_string::BoundedStringError;
740    fn try_from(value: String) -> Result<Self, Self::Error> {
741        crate::types::bounded_string::BoundedString::new(value)
742    }
743}
744impl ::serde::Serialize for DomainStr {
745    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
746    where
747        S: ::serde::Serializer,
748    {
749        crate::types::bounded_string::serialize_bounded_string(self, serializer)
750    }
751}
752impl<'de> ::serde::Deserialize<'de> for DomainStr {
753    fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
754    where
755        D: ::serde::Deserializer<'de>,
756    {
757        crate::types::bounded_string::deserialize_bounded_string(deserializer)
758    }
759}
760#[derive(Debug, Clone, PartialEq, PartialOrd)]
761pub struct FilterStr {
762    value: String,
763}
764impl crate::types::bounded_string::BoundedString for FilterStr {
765    const MIN_LENGTH: Option<usize> = None::<usize>;
766    const MAX_LENGTH: Option<usize> = Some(2048usize);
767    const DEFAULT: Option<&'static str> = None::<&'static str>;
768    const PATTERN: Option<&'static str> = None::<&'static str>;
769    const TYPE_DESCRIPTION: &'static str = "a string with length at most 2048";
770    fn get_value(&self) -> &str {
771        &self.value
772    }
773    fn new(value: String) -> Result<Self, crate::types::bounded_string::BoundedStringError> {
774        Self::validate(&value)?;
775        Ok(Self { value })
776    }
777}
778impl std::convert::TryFrom<String> for FilterStr {
779    type Error = crate::types::bounded_string::BoundedStringError;
780    fn try_from(value: String) -> Result<Self, Self::Error> {
781        crate::types::bounded_string::BoundedString::new(value)
782    }
783}
784impl ::serde::Serialize for FilterStr {
785    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
786    where
787        S: ::serde::Serializer,
788    {
789        crate::types::bounded_string::serialize_bounded_string(self, serializer)
790    }
791}
792impl<'de> ::serde::Deserialize<'de> for FilterStr {
793    fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
794    where
795        D: ::serde::Deserializer<'de>,
796    {
797        crate::types::bounded_string::deserialize_bounded_string(deserializer)
798    }
799}
800#[derive(Debug, Clone, PartialEq, PartialOrd)]
801pub struct GroupDnStr {
802    value: String,
803}
804impl crate::types::bounded_string::BoundedString for GroupDnStr {
805    const MIN_LENGTH: Option<usize> = None::<usize>;
806    const MAX_LENGTH: Option<usize> = Some(256usize);
807    const DEFAULT: Option<&'static str> = None::<&'static str>;
808    const PATTERN: Option<&'static str> = None::<&'static str>;
809    const TYPE_DESCRIPTION: &'static str = "a string with length at most 256";
810    fn get_value(&self) -> &str {
811        &self.value
812    }
813    fn new(value: String) -> Result<Self, crate::types::bounded_string::BoundedStringError> {
814        Self::validate(&value)?;
815        Ok(Self { value })
816    }
817}
818impl std::convert::TryFrom<String> for GroupDnStr {
819    type Error = crate::types::bounded_string::BoundedStringError;
820    fn try_from(value: String) -> Result<Self, Self::Error> {
821        crate::types::bounded_string::BoundedString::new(value)
822    }
823}
824impl ::serde::Serialize for GroupDnStr {
825    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
826    where
827        S: ::serde::Serializer,
828    {
829        crate::types::bounded_string::serialize_bounded_string(self, serializer)
830    }
831}
832impl<'de> ::serde::Deserialize<'de> for GroupDnStr {
833    fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
834    where
835        D: ::serde::Deserializer<'de>,
836    {
837        crate::types::bounded_string::deserialize_bounded_string(deserializer)
838    }
839}
840#[derive(Debug, Clone, PartialEq, PartialOrd)]
841pub struct GroupFilterStr {
842    value: String,
843}
844impl crate::types::bounded_string::BoundedString for GroupFilterStr {
845    const MIN_LENGTH: Option<usize> = None::<usize>;
846    const MAX_LENGTH: Option<usize> = Some(2048usize);
847    const DEFAULT: Option<&'static str> = None::<&'static str>;
848    const PATTERN: Option<&'static str> = None::<&'static str>;
849    const TYPE_DESCRIPTION: &'static str = "a string with length at most 2048";
850    fn get_value(&self) -> &str {
851        &self.value
852    }
853    fn new(value: String) -> Result<Self, crate::types::bounded_string::BoundedStringError> {
854        Self::validate(&value)?;
855        Ok(Self { value })
856    }
857}
858impl std::convert::TryFrom<String> for GroupFilterStr {
859    type Error = crate::types::bounded_string::BoundedStringError;
860    fn try_from(value: String) -> Result<Self, Self::Error> {
861        crate::types::bounded_string::BoundedString::new(value)
862    }
863}
864impl ::serde::Serialize for GroupFilterStr {
865    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
866    where
867        S: ::serde::Serializer,
868    {
869        crate::types::bounded_string::serialize_bounded_string(self, serializer)
870    }
871}
872impl<'de> ::serde::Deserialize<'de> for GroupFilterStr {
873    fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
874    where
875        D: ::serde::Deserializer<'de>,
876    {
877        crate::types::bounded_string::deserialize_bounded_string(deserializer)
878    }
879}
880#[derive(Debug, Clone, PartialEq, PartialOrd)]
881pub struct GroupNameAttrStr {
882    value: String,
883}
884impl crate::types::bounded_string::BoundedString for GroupNameAttrStr {
885    const MIN_LENGTH: Option<usize> = None::<usize>;
886    const MAX_LENGTH: Option<usize> = Some(256usize);
887    const DEFAULT: Option<&'static str> = None::<&'static str>;
888    const PATTERN: Option<&'static str> = None::<&'static str>;
889    const TYPE_DESCRIPTION: &'static str = "a string with length at most 256";
890    fn get_value(&self) -> &str {
891        &self.value
892    }
893    fn new(value: String) -> Result<Self, crate::types::bounded_string::BoundedStringError> {
894        Self::validate(&value)?;
895        Ok(Self { value })
896    }
897}
898impl std::convert::TryFrom<String> for GroupNameAttrStr {
899    type Error = crate::types::bounded_string::BoundedStringError;
900    fn try_from(value: String) -> Result<Self, Self::Error> {
901        crate::types::bounded_string::BoundedString::new(value)
902    }
903}
904impl ::serde::Serialize for GroupNameAttrStr {
905    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
906    where
907        S: ::serde::Serializer,
908    {
909        crate::types::bounded_string::serialize_bounded_string(self, serializer)
910    }
911}
912impl<'de> ::serde::Deserialize<'de> for GroupNameAttrStr {
913    fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
914    where
915        D: ::serde::Deserializer<'de>,
916    {
917        crate::types::bounded_string::deserialize_bounded_string(deserializer)
918    }
919}
920#[derive(Debug, Clone, PartialEq, PartialOrd)]
921pub struct GroupsClaimStr {
922    value: String,
923}
924impl crate::types::bounded_string::BoundedString for GroupsClaimStr {
925    const MIN_LENGTH: Option<usize> = None::<usize>;
926    const MAX_LENGTH: Option<usize> = Some(256usize);
927    const DEFAULT: Option<&'static str> = None::<&'static str>;
928    const PATTERN: Option<&'static str> = Some("(?^:[A-Za-z0-9\\.\\-_]+)");
929    const TYPE_DESCRIPTION: &'static str =
930        "a string with pattern r\"(?^:[A-Za-z0-9\\.\\-_]+)\" and length at most 256";
931    fn get_value(&self) -> &str {
932        &self.value
933    }
934    fn new(value: String) -> Result<Self, crate::types::bounded_string::BoundedStringError> {
935        Self::validate(&value)?;
936        Ok(Self { value })
937    }
938}
939impl std::convert::TryFrom<String> for GroupsClaimStr {
940    type Error = crate::types::bounded_string::BoundedStringError;
941    fn try_from(value: String) -> Result<Self, Self::Error> {
942        crate::types::bounded_string::BoundedString::new(value)
943    }
944}
945impl ::serde::Serialize for GroupsClaimStr {
946    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
947    where
948        S: ::serde::Serializer,
949    {
950        crate::types::bounded_string::serialize_bounded_string(self, serializer)
951    }
952}
953impl<'de> ::serde::Deserialize<'de> for GroupsClaimStr {
954    fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
955    where
956        D: ::serde::Deserializer<'de>,
957    {
958        crate::types::bounded_string::deserialize_bounded_string(deserializer)
959    }
960}
961#[derive(Debug, Clone, PartialEq, PartialOrd)]
962pub struct IssuerUrlStr {
963    value: String,
964}
965impl crate::types::bounded_string::BoundedString for IssuerUrlStr {
966    const MIN_LENGTH: Option<usize> = None::<usize>;
967    const MAX_LENGTH: Option<usize> = Some(256usize);
968    const DEFAULT: Option<&'static str> = None::<&'static str>;
969    const PATTERN: Option<&'static str> = None::<&'static str>;
970    const TYPE_DESCRIPTION: &'static str = "a string with length at most 256";
971    fn get_value(&self) -> &str {
972        &self.value
973    }
974    fn new(value: String) -> Result<Self, crate::types::bounded_string::BoundedStringError> {
975        Self::validate(&value)?;
976        Ok(Self { value })
977    }
978}
979impl std::convert::TryFrom<String> for IssuerUrlStr {
980    type Error = crate::types::bounded_string::BoundedStringError;
981    fn try_from(value: String) -> Result<Self, Self::Error> {
982        crate::types::bounded_string::BoundedString::new(value)
983    }
984}
985impl ::serde::Serialize for IssuerUrlStr {
986    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
987    where
988        S: ::serde::Serializer,
989    {
990        crate::types::bounded_string::serialize_bounded_string(self, serializer)
991    }
992}
993impl<'de> ::serde::Deserialize<'de> for IssuerUrlStr {
994    fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
995    where
996        D: ::serde::Deserializer<'de>,
997    {
998        crate::types::bounded_string::deserialize_bounded_string(deserializer)
999    }
1000}
1001#[derive(Debug, Clone, PartialEq, PartialOrd)]
1002pub struct PromptStr {
1003    value: String,
1004}
1005impl crate::types::bounded_string::BoundedString for PromptStr {
1006    const MIN_LENGTH: Option<usize> = None::<usize>;
1007    const MAX_LENGTH: Option<usize> = None::<usize>;
1008    const DEFAULT: Option<&'static str> = None::<&'static str>;
1009    const PATTERN: Option<&'static str> = Some("(?:none|login|consent|select_account|\\S+)");
1010    const TYPE_DESCRIPTION: &'static str = "a string with pattern r\"(?:none|login|consent|select_account|\\S+)\" and no length constraints";
1011    fn get_value(&self) -> &str {
1012        &self.value
1013    }
1014    fn new(value: String) -> Result<Self, crate::types::bounded_string::BoundedStringError> {
1015        Self::validate(&value)?;
1016        Ok(Self { value })
1017    }
1018}
1019impl std::convert::TryFrom<String> for PromptStr {
1020    type Error = crate::types::bounded_string::BoundedStringError;
1021    fn try_from(value: String) -> Result<Self, Self::Error> {
1022        crate::types::bounded_string::BoundedString::new(value)
1023    }
1024}
1025impl ::serde::Serialize for PromptStr {
1026    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
1027    where
1028        S: ::serde::Serializer,
1029    {
1030        crate::types::bounded_string::serialize_bounded_string(self, serializer)
1031    }
1032}
1033impl<'de> ::serde::Deserialize<'de> for PromptStr {
1034    fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
1035    where
1036        D: ::serde::Deserializer<'de>,
1037    {
1038        crate::types::bounded_string::deserialize_bounded_string(deserializer)
1039    }
1040}
1041#[derive(Debug, Clone, PartialEq, PartialOrd)]
1042pub struct RealmStr {
1043    value: String,
1044}
1045impl crate::types::bounded_string::BoundedString for RealmStr {
1046    const MIN_LENGTH: Option<usize> = None::<usize>;
1047    const MAX_LENGTH: Option<usize> = Some(32usize);
1048    const DEFAULT: Option<&'static str> = None::<&'static str>;
1049    const PATTERN: Option<&'static str> = None::<&'static str>;
1050    const TYPE_DESCRIPTION: &'static str = "a string with length at most 32";
1051    fn get_value(&self) -> &str {
1052        &self.value
1053    }
1054    fn new(value: String) -> Result<Self, crate::types::bounded_string::BoundedStringError> {
1055        Self::validate(&value)?;
1056        Ok(Self { value })
1057    }
1058}
1059impl std::convert::TryFrom<String> for RealmStr {
1060    type Error = crate::types::bounded_string::BoundedStringError;
1061    fn try_from(value: String) -> Result<Self, Self::Error> {
1062        crate::types::bounded_string::BoundedString::new(value)
1063    }
1064}
1065impl ::serde::Serialize for RealmStr {
1066    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
1067    where
1068        S: ::serde::Serializer,
1069    {
1070        crate::types::bounded_string::serialize_bounded_string(self, serializer)
1071    }
1072}
1073impl<'de> ::serde::Deserialize<'de> for RealmStr {
1074    fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
1075    where
1076        D: ::serde::Deserializer<'de>,
1077    {
1078        crate::types::bounded_string::deserialize_bounded_string(deserializer)
1079    }
1080}
1081#[derive(Debug, Clone, PartialEq, PartialOrd)]
1082pub struct Server1Str {
1083    value: String,
1084}
1085impl crate::types::bounded_string::BoundedString for Server1Str {
1086    const MIN_LENGTH: Option<usize> = None::<usize>;
1087    const MAX_LENGTH: Option<usize> = Some(256usize);
1088    const DEFAULT: Option<&'static str> = None::<&'static str>;
1089    const PATTERN: Option<&'static str> = None::<&'static str>;
1090    const TYPE_DESCRIPTION: &'static str = "a string with length at most 256";
1091    fn get_value(&self) -> &str {
1092        &self.value
1093    }
1094    fn new(value: String) -> Result<Self, crate::types::bounded_string::BoundedStringError> {
1095        Self::validate(&value)?;
1096        Ok(Self { value })
1097    }
1098}
1099impl std::convert::TryFrom<String> for Server1Str {
1100    type Error = crate::types::bounded_string::BoundedStringError;
1101    fn try_from(value: String) -> Result<Self, Self::Error> {
1102        crate::types::bounded_string::BoundedString::new(value)
1103    }
1104}
1105impl ::serde::Serialize for Server1Str {
1106    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
1107    where
1108        S: ::serde::Serializer,
1109    {
1110        crate::types::bounded_string::serialize_bounded_string(self, serializer)
1111    }
1112}
1113impl<'de> ::serde::Deserialize<'de> for Server1Str {
1114    fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
1115    where
1116        D: ::serde::Deserializer<'de>,
1117    {
1118        crate::types::bounded_string::deserialize_bounded_string(deserializer)
1119    }
1120}
1121#[derive(Debug, Clone, PartialEq, PartialOrd)]
1122pub struct Server2Str {
1123    value: String,
1124}
1125impl crate::types::bounded_string::BoundedString for Server2Str {
1126    const MIN_LENGTH: Option<usize> = None::<usize>;
1127    const MAX_LENGTH: Option<usize> = Some(256usize);
1128    const DEFAULT: Option<&'static str> = None::<&'static str>;
1129    const PATTERN: Option<&'static str> = None::<&'static str>;
1130    const TYPE_DESCRIPTION: &'static str = "a string with length at most 256";
1131    fn get_value(&self) -> &str {
1132        &self.value
1133    }
1134    fn new(value: String) -> Result<Self, crate::types::bounded_string::BoundedStringError> {
1135        Self::validate(&value)?;
1136        Ok(Self { value })
1137    }
1138}
1139impl std::convert::TryFrom<String> for Server2Str {
1140    type Error = crate::types::bounded_string::BoundedStringError;
1141    fn try_from(value: String) -> Result<Self, Self::Error> {
1142        crate::types::bounded_string::BoundedString::new(value)
1143    }
1144}
1145impl ::serde::Serialize for Server2Str {
1146    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
1147    where
1148        S: ::serde::Serializer,
1149    {
1150        crate::types::bounded_string::serialize_bounded_string(self, serializer)
1151    }
1152}
1153impl<'de> ::serde::Deserialize<'de> for Server2Str {
1154    fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
1155    where
1156        D: ::serde::Deserializer<'de>,
1157    {
1158        crate::types::bounded_string::deserialize_bounded_string(deserializer)
1159    }
1160}
1161#[derive(Debug, Clone, PartialEq, PartialOrd)]
1162pub struct SyncAttributesStr {
1163    value: String,
1164}
1165impl crate::types::bounded_string::BoundedString for SyncAttributesStr {
1166    const MIN_LENGTH: Option<usize> = None::<usize>;
1167    const MAX_LENGTH: Option<usize> = None::<usize>;
1168    const DEFAULT: Option<&'static str> = None::<&'static str>;
1169    const PATTERN: Option<&'static str> = Some("\\w+=[^,]+(,\\s*\\w+=[^,]+)*");
1170    const TYPE_DESCRIPTION: &'static str =
1171        "a string with pattern r\"\\w+=[^,]+(,\\s*\\w+=[^,]+)*\" and no length constraints";
1172    fn get_value(&self) -> &str {
1173        &self.value
1174    }
1175    fn new(value: String) -> Result<Self, crate::types::bounded_string::BoundedStringError> {
1176        Self::validate(&value)?;
1177        Ok(Self { value })
1178    }
1179}
1180impl std::convert::TryFrom<String> for SyncAttributesStr {
1181    type Error = crate::types::bounded_string::BoundedStringError;
1182    fn try_from(value: String) -> Result<Self, Self::Error> {
1183        crate::types::bounded_string::BoundedString::new(value)
1184    }
1185}
1186impl ::serde::Serialize for SyncAttributesStr {
1187    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
1188    where
1189        S: ::serde::Serializer,
1190    {
1191        crate::types::bounded_string::serialize_bounded_string(self, serializer)
1192    }
1193}
1194impl<'de> ::serde::Deserialize<'de> for SyncAttributesStr {
1195    fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
1196    where
1197        D: ::serde::Deserializer<'de>,
1198    {
1199        crate::types::bounded_string::deserialize_bounded_string(deserializer)
1200    }
1201}
1202#[derive(Debug, Clone, PartialEq, PartialOrd)]
1203pub struct TfaStr {
1204    value: String,
1205}
1206impl crate::types::bounded_string::BoundedString for TfaStr {
1207    const MIN_LENGTH: Option<usize> = None::<usize>;
1208    const MAX_LENGTH: Option<usize> = Some(128usize);
1209    const DEFAULT: Option<&'static str> = None::<&'static str>;
1210    const PATTERN: Option<&'static str> = None::<&'static str>;
1211    const TYPE_DESCRIPTION: &'static str = "a string with length at most 128";
1212    fn get_value(&self) -> &str {
1213        &self.value
1214    }
1215    fn new(value: String) -> Result<Self, crate::types::bounded_string::BoundedStringError> {
1216        Self::validate(&value)?;
1217        Ok(Self { value })
1218    }
1219}
1220impl std::convert::TryFrom<String> for TfaStr {
1221    type Error = crate::types::bounded_string::BoundedStringError;
1222    fn try_from(value: String) -> Result<Self, Self::Error> {
1223        crate::types::bounded_string::BoundedString::new(value)
1224    }
1225}
1226impl ::serde::Serialize for TfaStr {
1227    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
1228    where
1229        S: ::serde::Serializer,
1230    {
1231        crate::types::bounded_string::serialize_bounded_string(self, serializer)
1232    }
1233}
1234impl<'de> ::serde::Deserialize<'de> for TfaStr {
1235    fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
1236    where
1237        D: ::serde::Deserializer<'de>,
1238    {
1239        crate::types::bounded_string::deserialize_bounded_string(deserializer)
1240    }
1241}
1242#[derive(Debug, Clone, PartialEq, PartialOrd)]
1243pub struct UserAttrStr {
1244    value: String,
1245}
1246impl crate::types::bounded_string::BoundedString for UserAttrStr {
1247    const MIN_LENGTH: Option<usize> = None::<usize>;
1248    const MAX_LENGTH: Option<usize> = Some(256usize);
1249    const DEFAULT: Option<&'static str> = None::<&'static str>;
1250    const PATTERN: Option<&'static str> = Some("\\S{2,}");
1251    const TYPE_DESCRIPTION: &'static str =
1252        "a string with pattern r\"\\S{2,}\" and length at most 256";
1253    fn get_value(&self) -> &str {
1254        &self.value
1255    }
1256    fn new(value: String) -> Result<Self, crate::types::bounded_string::BoundedStringError> {
1257        Self::validate(&value)?;
1258        Ok(Self { value })
1259    }
1260}
1261impl std::convert::TryFrom<String> for UserAttrStr {
1262    type Error = crate::types::bounded_string::BoundedStringError;
1263    fn try_from(value: String) -> Result<Self, Self::Error> {
1264        crate::types::bounded_string::BoundedString::new(value)
1265    }
1266}
1267impl ::serde::Serialize for UserAttrStr {
1268    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
1269    where
1270        S: ::serde::Serializer,
1271    {
1272        crate::types::bounded_string::serialize_bounded_string(self, serializer)
1273    }
1274}
1275impl<'de> ::serde::Deserialize<'de> for UserAttrStr {
1276    fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
1277    where
1278        D: ::serde::Deserializer<'de>,
1279    {
1280        crate::types::bounded_string::deserialize_bounded_string(deserializer)
1281    }
1282}
1283impl<T> DomainsClient<T>
1284where
1285    T: crate::client::Client,
1286{
1287    pub fn realm(&self, realm: &str) -> realm::RealmClient<T> {
1288        realm::RealmClient::<T>::new(self.client.clone(), &self.path, realm)
1289    }
1290}