pub struct RegistrationsResource<'a> { /* private fields */ }Expand description
client.registrations()
Implementations§
Source§impl<'a> RegistrationsResource<'a>
impl<'a> RegistrationsResource<'a>
Sourcepub fn confirm(
&self,
registration_guid: impl Display,
body: &RegistrationConfirm,
) -> Result<Registration>
pub fn confirm( &self, registration_guid: impl Display, body: &RegistrationConfirm, ) -> Result<Registration>
Confirm self-registration email
POST /registrations/{registrationGuid}/confirm
Verifies the emailed token for an unconverted registration and records the confirmation time. Returns active persons with the same default email as possibleMatches, including configured form fields and hasPassword. Repeated confirmation is accepted while the registration is unconverted.
§Example
let body = models::RegistrationConfirm {
token: "abc123".into(),
..Default::default()
};
let registration = client.registrations().confirm("8c3bf5f0-305d-4e24-8e06-7c1d217fd3f1", &body)?;
println!("{}", registration.first_name);Sourcepub fn convert(
&self,
registration_guid: impl Display,
body: &RegistrationConvert,
) -> Result<()>
pub fn convert( &self, registration_guid: impl Display, body: &RegistrationConvert, ) -> Result<()>
Complete self-registration
POST /registrations/{registrationGuid}/convert
Completes an email-confirmed, unconverted registration using its token. Creates a new person or links personId to an active person with the same default email. Requires an active/complete configuration and enabled default login. formData supplies consent and configured fields by field ID or modern person field name (ID takes precedence); unknown/unconfigured fields are discarded. Required configured fields and person data are validated. A new person receives configured status, departments, tags and campus group memberships; a sole campus is selected automatically, otherwise formData.campusId must match a configured campus. Existing persons receive supplied fields, configured existing-person tags and the registration password. Success marks conversion complete and logs in that person in the current session.
§Example
let body = models::RegistrationConvert {
form_data: models::RegistrationConvertFormData {
accept_data_privacy: true,
..Default::default()
},
token: "abc123".into(),
..Default::default()
};
client.registrations().convert("8c3bf5f0-305d-4e24-8e06-7c1d217fd3f1", &body)?;Sourcepub fn create(&self, body: &RegistrationCreate) -> Result<Option<Registration>>
pub fn create(&self, body: &RegistrationCreate) -> Result<Option<Registration>>
Start self-registration
POST /registrations
Starts account self-registration for the configuration GUID and emails a confirmation link. Requires an active, complete configuration and an enabled default login. Blacklisted email addresses, blocked accounts and recognized existing login accounts receive an informational email and return 204 without creating a registration.
§Example
let body = models::RegistrationCreate {
config_id: "8c3bf5f0-305d-4e24-8e06-7c1d217fd3f1".into(),
email: "mara@example.org".into(),
first_name: "Mara".into(),
last_name: "Becker".into(),
password: "geheim".into(),
..Default::default()
};
let result = client.registrations().create(&body)?;
println!("{:?}", result);Sourcepub fn delete(&self, registration_guid: impl Display) -> Result<()>
pub fn delete(&self, registration_guid: impl Display) -> Result<()>
Delete self-registration
DELETE /registrations/{registrationGuid}
Deletes the registration record by GUID. This does not delete a person created by an earlier conversion.
§Example
client.registrations().delete("8c3bf5f0-305d-4e24-8e06-7c1d217fd3f1")?;