pub mod realm;
#[derive(Debug, Clone)]
pub struct DomainsClient<T> {
client: T,
path: String,
}
impl<T> DomainsClient<T>
where
T: crate::client::Client,
{
pub fn new(client: T, parent_path: &str) -> Self {
Self {
client,
path: format!("{}{}", parent_path, "/domains"),
}
}
}
impl<T> DomainsClient<T>
where
T: crate::client::Client,
{
#[doc = "Authentication domain index."]
#[doc = ""]
#[doc = "Accessible without authentication."]
pub async fn get(&self) -> Result<Vec<GetOutputItems>, T::Error> {
let path = self.path.to_string();
let optional_vec: Option<Vec<GetOutputItems>> = self.client.get(&path, &()).await?;
Ok(optional_vec.unwrap_or_default())
}
}
impl<T> DomainsClient<T>
where
T: crate::client::Client,
{
#[doc = "Add an authentication server."]
#[doc = ""]
#[doc = "Permission check: perm(\"/access/realm\", [\"Realm.Allocate\"])"]
pub async fn post(&self, params: PostParams) -> Result<(), T::Error> {
let path = self.path.to_string();
self.client.post(&path, ¶ms).await
}
}
impl GetOutputItems {
pub fn new(realm: String, ty: String) -> Self {
Self {
realm,
ty,
comment: ::std::default::Default::default(),
tfa: ::std::default::Default::default(),
additional_properties: ::std::default::Default::default(),
}
}
}
#[derive(Clone, Debug, :: serde :: Serialize, :: serde :: Deserialize)]
pub struct GetOutputItems {
#[serde(skip_serializing_if = "Option::is_none", default)]
#[doc = "A comment. The GUI use this text when you select a domain (Realm) on the login window."]
#[doc = ""]
pub comment: Option<String>,
pub realm: String,
#[serde(skip_serializing_if = "Option::is_none", default)]
#[doc = "Two-factor authentication provider."]
#[doc = ""]
pub tfa: Option<Tfa>,
#[serde(rename = "type")]
pub ty: String,
#[serde(
flatten,
default,
skip_serializing_if = "::std::collections::HashMap::is_empty"
)]
pub additional_properties: ::std::collections::HashMap<String, ::serde_json::Value>,
}
impl PostParams {
pub fn new(realm: RealmStr, ty: Type) -> Self {
Self {
realm,
ty,
acr_values: ::std::default::Default::default(),
autocreate: ::std::default::Default::default(),
base_dn: ::std::default::Default::default(),
bind_dn: ::std::default::Default::default(),
capath: ::std::default::Default::default(),
case_sensitive: ::std::default::Default::default(),
cert: ::std::default::Default::default(),
certkey: ::std::default::Default::default(),
check_connection: ::std::default::Default::default(),
client_id: ::std::default::Default::default(),
client_key: ::std::default::Default::default(),
comment: ::std::default::Default::default(),
default: ::std::default::Default::default(),
domain: ::std::default::Default::default(),
filter: ::std::default::Default::default(),
group_classes: ::std::default::Default::default(),
group_dn: ::std::default::Default::default(),
group_filter: ::std::default::Default::default(),
group_name_attr: ::std::default::Default::default(),
groups_autocreate: ::std::default::Default::default(),
groups_claim: ::std::default::Default::default(),
groups_overwrite: ::std::default::Default::default(),
issuer_url: ::std::default::Default::default(),
mode: ::std::default::Default::default(),
password: ::std::default::Default::default(),
port: ::std::default::Default::default(),
prompt: ::std::default::Default::default(),
query_userinfo: ::std::default::Default::default(),
scopes: ::std::default::Default::default(),
secure: ::std::default::Default::default(),
server1: ::std::default::Default::default(),
server2: ::std::default::Default::default(),
sslversion: ::std::default::Default::default(),
sync_defaults_options: ::std::default::Default::default(),
sync_attributes: ::std::default::Default::default(),
tfa: ::std::default::Default::default(),
user_attr: ::std::default::Default::default(),
user_classes: ::std::default::Default::default(),
username_claim: ::std::default::Default::default(),
verify: ::std::default::Default::default(),
additional_properties: ::std::default::Default::default(),
}
}
}
#[derive(Clone, Debug, :: serde :: Serialize, :: serde :: Deserialize)]
pub struct PostParams {
#[serde(rename = "acr-values")]
#[serde(skip_serializing_if = "Option::is_none", default)]
#[doc = "Specifies the Authentication Context Class Reference values that theAuthorization Server is being requested to use for the Auth Request."]
#[doc = ""]
pub acr_values: Option<AcrValuesStr>,
#[serde(
serialize_with = "crate::types::serialize_bool_optional",
deserialize_with = "crate::types::deserialize_bool_optional"
)]
#[serde(skip_serializing_if = "Option::is_none", default)]
#[doc = "Automatically create users if they do not exist."]
#[doc = ""]
pub autocreate: Option<bool>,
#[serde(skip_serializing_if = "Option::is_none", default)]
#[doc = "LDAP base domain name"]
#[doc = ""]
pub base_dn: Option<BaseDnStr>,
#[serde(skip_serializing_if = "Option::is_none", default)]
#[doc = "LDAP bind domain name"]
#[doc = ""]
pub bind_dn: Option<BindDnStr>,
#[serde(skip_serializing_if = "Option::is_none", default)]
#[doc = "Path to the CA certificate store"]
#[doc = ""]
pub capath: Option<String>,
#[serde(rename = "case-sensitive")]
#[serde(
serialize_with = "crate::types::serialize_bool_optional",
deserialize_with = "crate::types::deserialize_bool_optional"
)]
#[serde(skip_serializing_if = "Option::is_none", default)]
#[doc = "username is case-sensitive"]
#[doc = ""]
pub case_sensitive: Option<bool>,
#[serde(skip_serializing_if = "Option::is_none", default)]
#[doc = "Path to the client certificate"]
#[doc = ""]
pub cert: Option<String>,
#[serde(skip_serializing_if = "Option::is_none", default)]
#[doc = "Path to the client certificate key"]
#[doc = ""]
pub certkey: Option<String>,
#[serde(rename = "check-connection")]
#[serde(
serialize_with = "crate::types::serialize_bool_optional",
deserialize_with = "crate::types::deserialize_bool_optional"
)]
#[serde(skip_serializing_if = "Option::is_none", default)]
#[doc = "Check bind connection to the server."]
#[doc = ""]
pub check_connection: Option<bool>,
#[serde(rename = "client-id")]
#[serde(skip_serializing_if = "Option::is_none", default)]
#[doc = "OpenID Client ID"]
#[doc = ""]
pub client_id: Option<ClientIdStr>,
#[serde(rename = "client-key")]
#[serde(skip_serializing_if = "Option::is_none", default)]
#[doc = "OpenID Client Key"]
#[doc = ""]
pub client_key: Option<ClientKeyStr>,
#[serde(skip_serializing_if = "Option::is_none", default)]
#[doc = "Description."]
#[doc = ""]
pub comment: Option<CommentStr>,
#[serde(
serialize_with = "crate::types::serialize_bool_optional",
deserialize_with = "crate::types::deserialize_bool_optional"
)]
#[serde(skip_serializing_if = "Option::is_none", default)]
#[doc = "Use this as default realm"]
#[doc = ""]
pub default: Option<bool>,
#[serde(skip_serializing_if = "Option::is_none", default)]
#[doc = "AD domain name"]
#[doc = ""]
pub domain: Option<DomainStr>,
#[serde(skip_serializing_if = "Option::is_none", default)]
#[doc = "LDAP filter for user sync."]
#[doc = ""]
pub filter: Option<FilterStr>,
#[serde(skip_serializing_if = "Option::is_none", default)]
#[doc = "The objectclasses for groups."]
#[doc = ""]
pub group_classes: Option<String>,
#[serde(skip_serializing_if = "Option::is_none", default)]
#[doc = "LDAP base domain name for group sync. If not set, the base_dn will be used."]
#[doc = ""]
pub group_dn: Option<GroupDnStr>,
#[serde(skip_serializing_if = "Option::is_none", default)]
#[doc = "LDAP filter for group sync."]
#[doc = ""]
pub group_filter: Option<GroupFilterStr>,
#[serde(skip_serializing_if = "Option::is_none", default)]
#[doc = "LDAP attribute representing a groups name. If not set or found, the first value of the DN will be used as name."]
#[doc = ""]
pub group_name_attr: Option<GroupNameAttrStr>,
#[serde(rename = "groups-autocreate")]
#[serde(
serialize_with = "crate::types::serialize_bool_optional",
deserialize_with = "crate::types::deserialize_bool_optional"
)]
#[serde(skip_serializing_if = "Option::is_none", default)]
#[doc = "Automatically create groups if they do not exist."]
#[doc = ""]
pub groups_autocreate: Option<bool>,
#[serde(rename = "groups-claim")]
#[serde(skip_serializing_if = "Option::is_none", default)]
#[doc = "OpenID claim used to retrieve groups with."]
#[doc = ""]
pub groups_claim: Option<GroupsClaimStr>,
#[serde(rename = "groups-overwrite")]
#[serde(
serialize_with = "crate::types::serialize_bool_optional",
deserialize_with = "crate::types::deserialize_bool_optional"
)]
#[serde(skip_serializing_if = "Option::is_none", default)]
#[doc = "All groups will be overwritten for the user on login."]
#[doc = ""]
pub groups_overwrite: Option<bool>,
#[serde(rename = "issuer-url")]
#[serde(skip_serializing_if = "Option::is_none", default)]
#[doc = "OpenID Issuer Url"]
#[doc = ""]
pub issuer_url: Option<IssuerUrlStr>,
#[serde(skip_serializing_if = "Option::is_none", default)]
#[doc = "LDAP protocol mode."]
#[doc = ""]
pub mode: Option<Mode>,
#[serde(skip_serializing_if = "Option::is_none", default)]
#[doc = "LDAP bind password. Will be stored in '/etc/pve/priv/realm/\\\\<REALM\\\\>.pw'."]
#[doc = ""]
pub password: Option<String>,
#[serde(skip_serializing_if = "Option::is_none", default)]
#[doc = "Server port."]
#[doc = ""]
pub port: Option<PortInt>,
#[serde(skip_serializing_if = "Option::is_none", default)]
#[doc = "Specifies whether the Authorization Server prompts the End-User for reauthentication and consent."]
#[doc = ""]
pub prompt: Option<PromptStr>,
#[serde(rename = "query-userinfo")]
#[serde(
serialize_with = "crate::types::serialize_bool_optional",
deserialize_with = "crate::types::deserialize_bool_optional"
)]
#[serde(skip_serializing_if = "Option::is_none", default)]
#[doc = "Enables querying the userinfo endpoint for claims values."]
#[doc = ""]
pub query_userinfo: Option<bool>,
#[doc = "Authentication domain ID"]
#[doc = ""]
pub realm: RealmStr,
#[serde(skip_serializing_if = "Option::is_none", default)]
#[doc = "Specifies the scopes (user details) that should be authorized and returned, for example 'email' or 'profile'."]
#[doc = ""]
pub scopes: Option<String>,
#[serde(
serialize_with = "crate::types::serialize_bool_optional",
deserialize_with = "crate::types::deserialize_bool_optional"
)]
#[serde(skip_serializing_if = "Option::is_none", default)]
#[doc = "Use secure LDAPS protocol. DEPRECATED: use 'mode' instead."]
#[doc = ""]
pub secure: Option<bool>,
#[serde(skip_serializing_if = "Option::is_none", default)]
#[doc = "Server IP address (or DNS name)"]
#[doc = ""]
pub server1: Option<Server1Str>,
#[serde(skip_serializing_if = "Option::is_none", default)]
#[doc = "Fallback Server IP address (or DNS name)"]
#[doc = ""]
pub server2: Option<Server2Str>,
#[serde(skip_serializing_if = "Option::is_none", default)]
#[doc = "LDAPS TLS/SSL version. It's not recommended to use version older than 1.2!"]
#[doc = ""]
pub sslversion: Option<Sslversion>,
#[serde(rename = "sync-defaults-options")]
#[serde(skip_serializing_if = "Option::is_none", default)]
#[doc = "The default options for behavior of synchronizations."]
#[doc = ""]
pub sync_defaults_options: Option<String>,
#[serde(skip_serializing_if = "Option::is_none", default)]
#[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."]
#[doc = ""]
pub sync_attributes: Option<SyncAttributesStr>,
#[serde(skip_serializing_if = "Option::is_none", default)]
#[doc = "Use Two-factor authentication."]
#[doc = ""]
pub tfa: Option<TfaStr>,
#[serde(rename = "type")]
#[doc = "Realm type."]
#[doc = ""]
pub ty: Type,
#[serde(skip_serializing_if = "Option::is_none", default)]
#[doc = "LDAP user attribute name"]
#[doc = ""]
pub user_attr: Option<UserAttrStr>,
#[serde(skip_serializing_if = "Option::is_none", default)]
#[doc = "The objectclasses for users."]
#[doc = ""]
pub user_classes: Option<String>,
#[serde(rename = "username-claim")]
#[serde(skip_serializing_if = "Option::is_none", default)]
#[doc = "OpenID claim used to generate the unique username."]
#[doc = ""]
pub username_claim: Option<String>,
#[serde(
serialize_with = "crate::types::serialize_bool_optional",
deserialize_with = "crate::types::deserialize_bool_optional"
)]
#[serde(skip_serializing_if = "Option::is_none", default)]
#[doc = "Verify the server's SSL certificate"]
#[doc = ""]
pub verify: Option<bool>,
#[serde(
flatten,
default,
skip_serializing_if = "::std::collections::HashMap::is_empty"
)]
pub additional_properties: ::std::collections::HashMap<String, ::serde_json::Value>,
}
#[derive(Clone, Debug, :: serde :: Serialize, :: serde :: Deserialize, PartialEq, Default)]
#[doc = "LDAP protocol mode."]
#[doc = ""]
pub enum Mode {
#[serde(rename = "ldap")]
#[default]
Ldap,
#[serde(rename = "ldap+starttls")]
LdapStarttls,
#[serde(rename = "ldaps")]
Ldaps,
}
impl TryFrom<&str> for Mode {
type Error = String;
fn try_from(value: &str) -> Result<Self, <Self as TryFrom<&str>>::Error> {
match value {
"ldap" => Ok(Self::Ldap),
"ldap+starttls" => Ok(Self::LdapStarttls),
"ldaps" => Ok(Self::Ldaps),
v => Err(format!("Unknown variant {v}")),
}
}
}
#[derive(Clone, Debug, :: serde :: Serialize, :: serde :: Deserialize, PartialEq)]
#[doc = "LDAPS TLS/SSL version. It's not recommended to use version older than 1.2!"]
#[doc = ""]
pub enum Sslversion {
#[serde(rename = "tlsv1")]
Tlsv1,
#[serde(rename = "tlsv1_1")]
Tlsv11,
#[serde(rename = "tlsv1_2")]
Tlsv12,
#[serde(rename = "tlsv1_3")]
Tlsv13,
}
impl TryFrom<&str> for Sslversion {
type Error = String;
fn try_from(value: &str) -> Result<Self, <Self as TryFrom<&str>>::Error> {
match value {
"tlsv1" => Ok(Self::Tlsv1),
"tlsv1_1" => Ok(Self::Tlsv11),
"tlsv1_2" => Ok(Self::Tlsv12),
"tlsv1_3" => Ok(Self::Tlsv13),
v => Err(format!("Unknown variant {v}")),
}
}
}
#[derive(Clone, Debug, :: serde :: Serialize, :: serde :: Deserialize, PartialEq)]
#[doc = "Two-factor authentication provider."]
#[doc = ""]
pub enum Tfa {
#[serde(rename = "oath")]
Oath,
#[serde(rename = "yubico")]
Yubico,
}
impl TryFrom<&str> for Tfa {
type Error = String;
fn try_from(value: &str) -> Result<Self, <Self as TryFrom<&str>>::Error> {
match value {
"oath" => Ok(Self::Oath),
"yubico" => Ok(Self::Yubico),
v => Err(format!("Unknown variant {v}")),
}
}
}
#[derive(Clone, Debug, :: serde :: Serialize, :: serde :: Deserialize, PartialEq)]
#[doc = "Realm type."]
#[doc = ""]
pub enum Type {
#[serde(rename = "ad")]
Ad,
#[serde(rename = "ldap")]
Ldap,
#[serde(rename = "openid")]
Openid,
#[serde(rename = "pam")]
Pam,
#[serde(rename = "pve")]
Pve,
}
impl TryFrom<&str> for Type {
type Error = String;
fn try_from(value: &str) -> Result<Self, <Self as TryFrom<&str>>::Error> {
match value {
"ad" => Ok(Self::Ad),
"ldap" => Ok(Self::Ldap),
"openid" => Ok(Self::Openid),
"pam" => Ok(Self::Pam),
"pve" => Ok(Self::Pve),
v => Err(format!("Unknown variant {v}")),
}
}
}
#[derive(Debug, Clone, Copy, PartialEq, PartialOrd)]
pub struct PortInt(i128);
impl crate::types::bounded_integer::BoundedInteger for PortInt {
const MIN: Option<i128> = Some(1i128);
const MAX: Option<i128> = Some(65535i128);
const DEFAULT: Option<i128> = None::<i128>;
const TYPE_DESCRIPTION: &'static str = "an integer between 1 and 65535";
fn get(&self) -> i128 {
self.0
}
fn new(value: i128) -> Result<Self, crate::types::bounded_integer::BoundedIntegerError> {
Self::validate(value)?;
Ok(Self(value))
}
}
impl std::convert::TryFrom<i128> for PortInt {
type Error = crate::types::bounded_integer::BoundedIntegerError;
fn try_from(value: i128) -> Result<Self, Self::Error> {
crate::types::bounded_integer::BoundedInteger::new(value)
}
}
impl ::serde::Serialize for PortInt {
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where
S: ::serde::Serializer,
{
crate::types::bounded_integer::serialize_bounded_integer(self, serializer)
}
}
impl<'de> ::serde::Deserialize<'de> for PortInt {
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
where
D: ::serde::Deserializer<'de>,
{
crate::types::bounded_integer::deserialize_bounded_integer(deserializer)
}
}
#[derive(Debug, Clone, PartialEq, PartialOrd)]
pub struct AcrValuesStr {
value: String,
}
impl crate::types::bounded_string::BoundedString for AcrValuesStr {
const MIN_LENGTH: Option<usize> = None::<usize>;
const MAX_LENGTH: Option<usize> = None::<usize>;
const DEFAULT: Option<&'static str> = None::<&'static str>;
const PATTERN: Option<&'static str> = Some("^[^\\x00-\\x1F\\x7F <>#\"]*$");
const TYPE_DESCRIPTION: &'static str =
"a string with pattern r\"^[^\\x00-\\x1F\\x7F <>#\"]*$\" and no length constraints";
fn get_value(&self) -> &str {
&self.value
}
fn new(value: String) -> Result<Self, crate::types::bounded_string::BoundedStringError> {
Self::validate(&value)?;
Ok(Self { value })
}
}
impl std::convert::TryFrom<String> for AcrValuesStr {
type Error = crate::types::bounded_string::BoundedStringError;
fn try_from(value: String) -> Result<Self, Self::Error> {
crate::types::bounded_string::BoundedString::new(value)
}
}
impl ::serde::Serialize for AcrValuesStr {
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where
S: ::serde::Serializer,
{
crate::types::bounded_string::serialize_bounded_string(self, serializer)
}
}
impl<'de> ::serde::Deserialize<'de> for AcrValuesStr {
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
where
D: ::serde::Deserializer<'de>,
{
crate::types::bounded_string::deserialize_bounded_string(deserializer)
}
}
#[derive(Debug, Clone, PartialEq, PartialOrd)]
pub struct BaseDnStr {
value: String,
}
impl crate::types::bounded_string::BoundedString for BaseDnStr {
const MIN_LENGTH: Option<usize> = None::<usize>;
const MAX_LENGTH: Option<usize> = Some(256usize);
const DEFAULT: Option<&'static str> = None::<&'static str>;
const PATTERN: Option<&'static str> = None::<&'static str>;
const TYPE_DESCRIPTION: &'static str = "a string with length at most 256";
fn get_value(&self) -> &str {
&self.value
}
fn new(value: String) -> Result<Self, crate::types::bounded_string::BoundedStringError> {
Self::validate(&value)?;
Ok(Self { value })
}
}
impl std::convert::TryFrom<String> for BaseDnStr {
type Error = crate::types::bounded_string::BoundedStringError;
fn try_from(value: String) -> Result<Self, Self::Error> {
crate::types::bounded_string::BoundedString::new(value)
}
}
impl ::serde::Serialize for BaseDnStr {
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where
S: ::serde::Serializer,
{
crate::types::bounded_string::serialize_bounded_string(self, serializer)
}
}
impl<'de> ::serde::Deserialize<'de> for BaseDnStr {
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
where
D: ::serde::Deserializer<'de>,
{
crate::types::bounded_string::deserialize_bounded_string(deserializer)
}
}
#[derive(Debug, Clone, PartialEq, PartialOrd)]
pub struct BindDnStr {
value: String,
}
impl crate::types::bounded_string::BoundedString for BindDnStr {
const MIN_LENGTH: Option<usize> = None::<usize>;
const MAX_LENGTH: Option<usize> = Some(256usize);
const DEFAULT: Option<&'static str> = None::<&'static str>;
const PATTERN: Option<&'static str> = None::<&'static str>;
const TYPE_DESCRIPTION: &'static str = "a string with length at most 256";
fn get_value(&self) -> &str {
&self.value
}
fn new(value: String) -> Result<Self, crate::types::bounded_string::BoundedStringError> {
Self::validate(&value)?;
Ok(Self { value })
}
}
impl std::convert::TryFrom<String> for BindDnStr {
type Error = crate::types::bounded_string::BoundedStringError;
fn try_from(value: String) -> Result<Self, Self::Error> {
crate::types::bounded_string::BoundedString::new(value)
}
}
impl ::serde::Serialize for BindDnStr {
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where
S: ::serde::Serializer,
{
crate::types::bounded_string::serialize_bounded_string(self, serializer)
}
}
impl<'de> ::serde::Deserialize<'de> for BindDnStr {
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
where
D: ::serde::Deserializer<'de>,
{
crate::types::bounded_string::deserialize_bounded_string(deserializer)
}
}
#[derive(Debug, Clone, PartialEq, PartialOrd)]
pub struct ClientIdStr {
value: String,
}
impl crate::types::bounded_string::BoundedString for ClientIdStr {
const MIN_LENGTH: Option<usize> = None::<usize>;
const MAX_LENGTH: Option<usize> = Some(256usize);
const DEFAULT: Option<&'static str> = None::<&'static str>;
const PATTERN: Option<&'static str> = None::<&'static str>;
const TYPE_DESCRIPTION: &'static str = "a string with length at most 256";
fn get_value(&self) -> &str {
&self.value
}
fn new(value: String) -> Result<Self, crate::types::bounded_string::BoundedStringError> {
Self::validate(&value)?;
Ok(Self { value })
}
}
impl std::convert::TryFrom<String> for ClientIdStr {
type Error = crate::types::bounded_string::BoundedStringError;
fn try_from(value: String) -> Result<Self, Self::Error> {
crate::types::bounded_string::BoundedString::new(value)
}
}
impl ::serde::Serialize for ClientIdStr {
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where
S: ::serde::Serializer,
{
crate::types::bounded_string::serialize_bounded_string(self, serializer)
}
}
impl<'de> ::serde::Deserialize<'de> for ClientIdStr {
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
where
D: ::serde::Deserializer<'de>,
{
crate::types::bounded_string::deserialize_bounded_string(deserializer)
}
}
#[derive(Debug, Clone, PartialEq, PartialOrd)]
pub struct ClientKeyStr {
value: String,
}
impl crate::types::bounded_string::BoundedString for ClientKeyStr {
const MIN_LENGTH: Option<usize> = None::<usize>;
const MAX_LENGTH: Option<usize> = Some(256usize);
const DEFAULT: Option<&'static str> = None::<&'static str>;
const PATTERN: Option<&'static str> = None::<&'static str>;
const TYPE_DESCRIPTION: &'static str = "a string with length at most 256";
fn get_value(&self) -> &str {
&self.value
}
fn new(value: String) -> Result<Self, crate::types::bounded_string::BoundedStringError> {
Self::validate(&value)?;
Ok(Self { value })
}
}
impl std::convert::TryFrom<String> for ClientKeyStr {
type Error = crate::types::bounded_string::BoundedStringError;
fn try_from(value: String) -> Result<Self, Self::Error> {
crate::types::bounded_string::BoundedString::new(value)
}
}
impl ::serde::Serialize for ClientKeyStr {
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where
S: ::serde::Serializer,
{
crate::types::bounded_string::serialize_bounded_string(self, serializer)
}
}
impl<'de> ::serde::Deserialize<'de> for ClientKeyStr {
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
where
D: ::serde::Deserializer<'de>,
{
crate::types::bounded_string::deserialize_bounded_string(deserializer)
}
}
#[derive(Debug, Clone, PartialEq, PartialOrd)]
pub struct CommentStr {
value: String,
}
impl crate::types::bounded_string::BoundedString for CommentStr {
const MIN_LENGTH: Option<usize> = None::<usize>;
const MAX_LENGTH: Option<usize> = Some(4096usize);
const DEFAULT: Option<&'static str> = None::<&'static str>;
const PATTERN: Option<&'static str> = None::<&'static str>;
const TYPE_DESCRIPTION: &'static str = "a string with length at most 4096";
fn get_value(&self) -> &str {
&self.value
}
fn new(value: String) -> Result<Self, crate::types::bounded_string::BoundedStringError> {
Self::validate(&value)?;
Ok(Self { value })
}
}
impl std::convert::TryFrom<String> for CommentStr {
type Error = crate::types::bounded_string::BoundedStringError;
fn try_from(value: String) -> Result<Self, Self::Error> {
crate::types::bounded_string::BoundedString::new(value)
}
}
impl ::serde::Serialize for CommentStr {
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where
S: ::serde::Serializer,
{
crate::types::bounded_string::serialize_bounded_string(self, serializer)
}
}
impl<'de> ::serde::Deserialize<'de> for CommentStr {
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
where
D: ::serde::Deserializer<'de>,
{
crate::types::bounded_string::deserialize_bounded_string(deserializer)
}
}
#[derive(Debug, Clone, PartialEq, PartialOrd)]
pub struct DomainStr {
value: String,
}
impl crate::types::bounded_string::BoundedString for DomainStr {
const MIN_LENGTH: Option<usize> = None::<usize>;
const MAX_LENGTH: Option<usize> = Some(256usize);
const DEFAULT: Option<&'static str> = None::<&'static str>;
const PATTERN: Option<&'static str> = Some("\\S+");
const TYPE_DESCRIPTION: &'static str = "a string with pattern r\"\\S+\" and length at most 256";
fn get_value(&self) -> &str {
&self.value
}
fn new(value: String) -> Result<Self, crate::types::bounded_string::BoundedStringError> {
Self::validate(&value)?;
Ok(Self { value })
}
}
impl std::convert::TryFrom<String> for DomainStr {
type Error = crate::types::bounded_string::BoundedStringError;
fn try_from(value: String) -> Result<Self, Self::Error> {
crate::types::bounded_string::BoundedString::new(value)
}
}
impl ::serde::Serialize for DomainStr {
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where
S: ::serde::Serializer,
{
crate::types::bounded_string::serialize_bounded_string(self, serializer)
}
}
impl<'de> ::serde::Deserialize<'de> for DomainStr {
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
where
D: ::serde::Deserializer<'de>,
{
crate::types::bounded_string::deserialize_bounded_string(deserializer)
}
}
#[derive(Debug, Clone, PartialEq, PartialOrd)]
pub struct FilterStr {
value: String,
}
impl crate::types::bounded_string::BoundedString for FilterStr {
const MIN_LENGTH: Option<usize> = None::<usize>;
const MAX_LENGTH: Option<usize> = Some(2048usize);
const DEFAULT: Option<&'static str> = None::<&'static str>;
const PATTERN: Option<&'static str> = None::<&'static str>;
const TYPE_DESCRIPTION: &'static str = "a string with length at most 2048";
fn get_value(&self) -> &str {
&self.value
}
fn new(value: String) -> Result<Self, crate::types::bounded_string::BoundedStringError> {
Self::validate(&value)?;
Ok(Self { value })
}
}
impl std::convert::TryFrom<String> for FilterStr {
type Error = crate::types::bounded_string::BoundedStringError;
fn try_from(value: String) -> Result<Self, Self::Error> {
crate::types::bounded_string::BoundedString::new(value)
}
}
impl ::serde::Serialize for FilterStr {
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where
S: ::serde::Serializer,
{
crate::types::bounded_string::serialize_bounded_string(self, serializer)
}
}
impl<'de> ::serde::Deserialize<'de> for FilterStr {
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
where
D: ::serde::Deserializer<'de>,
{
crate::types::bounded_string::deserialize_bounded_string(deserializer)
}
}
#[derive(Debug, Clone, PartialEq, PartialOrd)]
pub struct GroupDnStr {
value: String,
}
impl crate::types::bounded_string::BoundedString for GroupDnStr {
const MIN_LENGTH: Option<usize> = None::<usize>;
const MAX_LENGTH: Option<usize> = Some(256usize);
const DEFAULT: Option<&'static str> = None::<&'static str>;
const PATTERN: Option<&'static str> = None::<&'static str>;
const TYPE_DESCRIPTION: &'static str = "a string with length at most 256";
fn get_value(&self) -> &str {
&self.value
}
fn new(value: String) -> Result<Self, crate::types::bounded_string::BoundedStringError> {
Self::validate(&value)?;
Ok(Self { value })
}
}
impl std::convert::TryFrom<String> for GroupDnStr {
type Error = crate::types::bounded_string::BoundedStringError;
fn try_from(value: String) -> Result<Self, Self::Error> {
crate::types::bounded_string::BoundedString::new(value)
}
}
impl ::serde::Serialize for GroupDnStr {
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where
S: ::serde::Serializer,
{
crate::types::bounded_string::serialize_bounded_string(self, serializer)
}
}
impl<'de> ::serde::Deserialize<'de> for GroupDnStr {
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
where
D: ::serde::Deserializer<'de>,
{
crate::types::bounded_string::deserialize_bounded_string(deserializer)
}
}
#[derive(Debug, Clone, PartialEq, PartialOrd)]
pub struct GroupFilterStr {
value: String,
}
impl crate::types::bounded_string::BoundedString for GroupFilterStr {
const MIN_LENGTH: Option<usize> = None::<usize>;
const MAX_LENGTH: Option<usize> = Some(2048usize);
const DEFAULT: Option<&'static str> = None::<&'static str>;
const PATTERN: Option<&'static str> = None::<&'static str>;
const TYPE_DESCRIPTION: &'static str = "a string with length at most 2048";
fn get_value(&self) -> &str {
&self.value
}
fn new(value: String) -> Result<Self, crate::types::bounded_string::BoundedStringError> {
Self::validate(&value)?;
Ok(Self { value })
}
}
impl std::convert::TryFrom<String> for GroupFilterStr {
type Error = crate::types::bounded_string::BoundedStringError;
fn try_from(value: String) -> Result<Self, Self::Error> {
crate::types::bounded_string::BoundedString::new(value)
}
}
impl ::serde::Serialize for GroupFilterStr {
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where
S: ::serde::Serializer,
{
crate::types::bounded_string::serialize_bounded_string(self, serializer)
}
}
impl<'de> ::serde::Deserialize<'de> for GroupFilterStr {
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
where
D: ::serde::Deserializer<'de>,
{
crate::types::bounded_string::deserialize_bounded_string(deserializer)
}
}
#[derive(Debug, Clone, PartialEq, PartialOrd)]
pub struct GroupNameAttrStr {
value: String,
}
impl crate::types::bounded_string::BoundedString for GroupNameAttrStr {
const MIN_LENGTH: Option<usize> = None::<usize>;
const MAX_LENGTH: Option<usize> = Some(256usize);
const DEFAULT: Option<&'static str> = None::<&'static str>;
const PATTERN: Option<&'static str> = None::<&'static str>;
const TYPE_DESCRIPTION: &'static str = "a string with length at most 256";
fn get_value(&self) -> &str {
&self.value
}
fn new(value: String) -> Result<Self, crate::types::bounded_string::BoundedStringError> {
Self::validate(&value)?;
Ok(Self { value })
}
}
impl std::convert::TryFrom<String> for GroupNameAttrStr {
type Error = crate::types::bounded_string::BoundedStringError;
fn try_from(value: String) -> Result<Self, Self::Error> {
crate::types::bounded_string::BoundedString::new(value)
}
}
impl ::serde::Serialize for GroupNameAttrStr {
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where
S: ::serde::Serializer,
{
crate::types::bounded_string::serialize_bounded_string(self, serializer)
}
}
impl<'de> ::serde::Deserialize<'de> for GroupNameAttrStr {
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
where
D: ::serde::Deserializer<'de>,
{
crate::types::bounded_string::deserialize_bounded_string(deserializer)
}
}
#[derive(Debug, Clone, PartialEq, PartialOrd)]
pub struct GroupsClaimStr {
value: String,
}
impl crate::types::bounded_string::BoundedString for GroupsClaimStr {
const MIN_LENGTH: Option<usize> = None::<usize>;
const MAX_LENGTH: Option<usize> = Some(256usize);
const DEFAULT: Option<&'static str> = None::<&'static str>;
const PATTERN: Option<&'static str> = Some("(?^:[A-Za-z0-9\\.\\-_]+)");
const TYPE_DESCRIPTION: &'static str =
"a string with pattern r\"(?^:[A-Za-z0-9\\.\\-_]+)\" and length at most 256";
fn get_value(&self) -> &str {
&self.value
}
fn new(value: String) -> Result<Self, crate::types::bounded_string::BoundedStringError> {
Self::validate(&value)?;
Ok(Self { value })
}
}
impl std::convert::TryFrom<String> for GroupsClaimStr {
type Error = crate::types::bounded_string::BoundedStringError;
fn try_from(value: String) -> Result<Self, Self::Error> {
crate::types::bounded_string::BoundedString::new(value)
}
}
impl ::serde::Serialize for GroupsClaimStr {
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where
S: ::serde::Serializer,
{
crate::types::bounded_string::serialize_bounded_string(self, serializer)
}
}
impl<'de> ::serde::Deserialize<'de> for GroupsClaimStr {
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
where
D: ::serde::Deserializer<'de>,
{
crate::types::bounded_string::deserialize_bounded_string(deserializer)
}
}
#[derive(Debug, Clone, PartialEq, PartialOrd)]
pub struct IssuerUrlStr {
value: String,
}
impl crate::types::bounded_string::BoundedString for IssuerUrlStr {
const MIN_LENGTH: Option<usize> = None::<usize>;
const MAX_LENGTH: Option<usize> = Some(256usize);
const DEFAULT: Option<&'static str> = None::<&'static str>;
const PATTERN: Option<&'static str> = None::<&'static str>;
const TYPE_DESCRIPTION: &'static str = "a string with length at most 256";
fn get_value(&self) -> &str {
&self.value
}
fn new(value: String) -> Result<Self, crate::types::bounded_string::BoundedStringError> {
Self::validate(&value)?;
Ok(Self { value })
}
}
impl std::convert::TryFrom<String> for IssuerUrlStr {
type Error = crate::types::bounded_string::BoundedStringError;
fn try_from(value: String) -> Result<Self, Self::Error> {
crate::types::bounded_string::BoundedString::new(value)
}
}
impl ::serde::Serialize for IssuerUrlStr {
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where
S: ::serde::Serializer,
{
crate::types::bounded_string::serialize_bounded_string(self, serializer)
}
}
impl<'de> ::serde::Deserialize<'de> for IssuerUrlStr {
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
where
D: ::serde::Deserializer<'de>,
{
crate::types::bounded_string::deserialize_bounded_string(deserializer)
}
}
#[derive(Debug, Clone, PartialEq, PartialOrd)]
pub struct PromptStr {
value: String,
}
impl crate::types::bounded_string::BoundedString for PromptStr {
const MIN_LENGTH: Option<usize> = None::<usize>;
const MAX_LENGTH: Option<usize> = None::<usize>;
const DEFAULT: Option<&'static str> = None::<&'static str>;
const PATTERN: Option<&'static str> = Some("(?:none|login|consent|select_account|\\S+)");
const TYPE_DESCRIPTION: &'static str = "a string with pattern r\"(?:none|login|consent|select_account|\\S+)\" and no length constraints";
fn get_value(&self) -> &str {
&self.value
}
fn new(value: String) -> Result<Self, crate::types::bounded_string::BoundedStringError> {
Self::validate(&value)?;
Ok(Self { value })
}
}
impl std::convert::TryFrom<String> for PromptStr {
type Error = crate::types::bounded_string::BoundedStringError;
fn try_from(value: String) -> Result<Self, Self::Error> {
crate::types::bounded_string::BoundedString::new(value)
}
}
impl ::serde::Serialize for PromptStr {
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where
S: ::serde::Serializer,
{
crate::types::bounded_string::serialize_bounded_string(self, serializer)
}
}
impl<'de> ::serde::Deserialize<'de> for PromptStr {
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
where
D: ::serde::Deserializer<'de>,
{
crate::types::bounded_string::deserialize_bounded_string(deserializer)
}
}
#[derive(Debug, Clone, PartialEq, PartialOrd)]
pub struct RealmStr {
value: String,
}
impl crate::types::bounded_string::BoundedString for RealmStr {
const MIN_LENGTH: Option<usize> = None::<usize>;
const MAX_LENGTH: Option<usize> = Some(32usize);
const DEFAULT: Option<&'static str> = None::<&'static str>;
const PATTERN: Option<&'static str> = None::<&'static str>;
const TYPE_DESCRIPTION: &'static str = "a string with length at most 32";
fn get_value(&self) -> &str {
&self.value
}
fn new(value: String) -> Result<Self, crate::types::bounded_string::BoundedStringError> {
Self::validate(&value)?;
Ok(Self { value })
}
}
impl std::convert::TryFrom<String> for RealmStr {
type Error = crate::types::bounded_string::BoundedStringError;
fn try_from(value: String) -> Result<Self, Self::Error> {
crate::types::bounded_string::BoundedString::new(value)
}
}
impl ::serde::Serialize for RealmStr {
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where
S: ::serde::Serializer,
{
crate::types::bounded_string::serialize_bounded_string(self, serializer)
}
}
impl<'de> ::serde::Deserialize<'de> for RealmStr {
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
where
D: ::serde::Deserializer<'de>,
{
crate::types::bounded_string::deserialize_bounded_string(deserializer)
}
}
#[derive(Debug, Clone, PartialEq, PartialOrd)]
pub struct Server1Str {
value: String,
}
impl crate::types::bounded_string::BoundedString for Server1Str {
const MIN_LENGTH: Option<usize> = None::<usize>;
const MAX_LENGTH: Option<usize> = Some(256usize);
const DEFAULT: Option<&'static str> = None::<&'static str>;
const PATTERN: Option<&'static str> = None::<&'static str>;
const TYPE_DESCRIPTION: &'static str = "a string with length at most 256";
fn get_value(&self) -> &str {
&self.value
}
fn new(value: String) -> Result<Self, crate::types::bounded_string::BoundedStringError> {
Self::validate(&value)?;
Ok(Self { value })
}
}
impl std::convert::TryFrom<String> for Server1Str {
type Error = crate::types::bounded_string::BoundedStringError;
fn try_from(value: String) -> Result<Self, Self::Error> {
crate::types::bounded_string::BoundedString::new(value)
}
}
impl ::serde::Serialize for Server1Str {
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where
S: ::serde::Serializer,
{
crate::types::bounded_string::serialize_bounded_string(self, serializer)
}
}
impl<'de> ::serde::Deserialize<'de> for Server1Str {
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
where
D: ::serde::Deserializer<'de>,
{
crate::types::bounded_string::deserialize_bounded_string(deserializer)
}
}
#[derive(Debug, Clone, PartialEq, PartialOrd)]
pub struct Server2Str {
value: String,
}
impl crate::types::bounded_string::BoundedString for Server2Str {
const MIN_LENGTH: Option<usize> = None::<usize>;
const MAX_LENGTH: Option<usize> = Some(256usize);
const DEFAULT: Option<&'static str> = None::<&'static str>;
const PATTERN: Option<&'static str> = None::<&'static str>;
const TYPE_DESCRIPTION: &'static str = "a string with length at most 256";
fn get_value(&self) -> &str {
&self.value
}
fn new(value: String) -> Result<Self, crate::types::bounded_string::BoundedStringError> {
Self::validate(&value)?;
Ok(Self { value })
}
}
impl std::convert::TryFrom<String> for Server2Str {
type Error = crate::types::bounded_string::BoundedStringError;
fn try_from(value: String) -> Result<Self, Self::Error> {
crate::types::bounded_string::BoundedString::new(value)
}
}
impl ::serde::Serialize for Server2Str {
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where
S: ::serde::Serializer,
{
crate::types::bounded_string::serialize_bounded_string(self, serializer)
}
}
impl<'de> ::serde::Deserialize<'de> for Server2Str {
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
where
D: ::serde::Deserializer<'de>,
{
crate::types::bounded_string::deserialize_bounded_string(deserializer)
}
}
#[derive(Debug, Clone, PartialEq, PartialOrd)]
pub struct SyncAttributesStr {
value: String,
}
impl crate::types::bounded_string::BoundedString for SyncAttributesStr {
const MIN_LENGTH: Option<usize> = None::<usize>;
const MAX_LENGTH: Option<usize> = None::<usize>;
const DEFAULT: Option<&'static str> = None::<&'static str>;
const PATTERN: Option<&'static str> = Some("\\w+=[^,]+(,\\s*\\w+=[^,]+)*");
const TYPE_DESCRIPTION: &'static str =
"a string with pattern r\"\\w+=[^,]+(,\\s*\\w+=[^,]+)*\" and no length constraints";
fn get_value(&self) -> &str {
&self.value
}
fn new(value: String) -> Result<Self, crate::types::bounded_string::BoundedStringError> {
Self::validate(&value)?;
Ok(Self { value })
}
}
impl std::convert::TryFrom<String> for SyncAttributesStr {
type Error = crate::types::bounded_string::BoundedStringError;
fn try_from(value: String) -> Result<Self, Self::Error> {
crate::types::bounded_string::BoundedString::new(value)
}
}
impl ::serde::Serialize for SyncAttributesStr {
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where
S: ::serde::Serializer,
{
crate::types::bounded_string::serialize_bounded_string(self, serializer)
}
}
impl<'de> ::serde::Deserialize<'de> for SyncAttributesStr {
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
where
D: ::serde::Deserializer<'de>,
{
crate::types::bounded_string::deserialize_bounded_string(deserializer)
}
}
#[derive(Debug, Clone, PartialEq, PartialOrd)]
pub struct TfaStr {
value: String,
}
impl crate::types::bounded_string::BoundedString for TfaStr {
const MIN_LENGTH: Option<usize> = None::<usize>;
const MAX_LENGTH: Option<usize> = Some(128usize);
const DEFAULT: Option<&'static str> = None::<&'static str>;
const PATTERN: Option<&'static str> = None::<&'static str>;
const TYPE_DESCRIPTION: &'static str = "a string with length at most 128";
fn get_value(&self) -> &str {
&self.value
}
fn new(value: String) -> Result<Self, crate::types::bounded_string::BoundedStringError> {
Self::validate(&value)?;
Ok(Self { value })
}
}
impl std::convert::TryFrom<String> for TfaStr {
type Error = crate::types::bounded_string::BoundedStringError;
fn try_from(value: String) -> Result<Self, Self::Error> {
crate::types::bounded_string::BoundedString::new(value)
}
}
impl ::serde::Serialize for TfaStr {
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where
S: ::serde::Serializer,
{
crate::types::bounded_string::serialize_bounded_string(self, serializer)
}
}
impl<'de> ::serde::Deserialize<'de> for TfaStr {
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
where
D: ::serde::Deserializer<'de>,
{
crate::types::bounded_string::deserialize_bounded_string(deserializer)
}
}
#[derive(Debug, Clone, PartialEq, PartialOrd)]
pub struct UserAttrStr {
value: String,
}
impl crate::types::bounded_string::BoundedString for UserAttrStr {
const MIN_LENGTH: Option<usize> = None::<usize>;
const MAX_LENGTH: Option<usize> = Some(256usize);
const DEFAULT: Option<&'static str> = None::<&'static str>;
const PATTERN: Option<&'static str> = Some("\\S{2,}");
const TYPE_DESCRIPTION: &'static str =
"a string with pattern r\"\\S{2,}\" and length at most 256";
fn get_value(&self) -> &str {
&self.value
}
fn new(value: String) -> Result<Self, crate::types::bounded_string::BoundedStringError> {
Self::validate(&value)?;
Ok(Self { value })
}
}
impl std::convert::TryFrom<String> for UserAttrStr {
type Error = crate::types::bounded_string::BoundedStringError;
fn try_from(value: String) -> Result<Self, Self::Error> {
crate::types::bounded_string::BoundedString::new(value)
}
}
impl ::serde::Serialize for UserAttrStr {
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where
S: ::serde::Serializer,
{
crate::types::bounded_string::serialize_bounded_string(self, serializer)
}
}
impl<'de> ::serde::Deserialize<'de> for UserAttrStr {
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
where
D: ::serde::Deserializer<'de>,
{
crate::types::bounded_string::deserialize_bounded_string(deserializer)
}
}
impl<T> DomainsClient<T>
where
T: crate::client::Client,
{
pub fn realm(&self, realm: &str) -> realm::RealmClient<T> {
realm::RealmClient::<T>::new(self.client.clone(), &self.path, realm)
}
}