pub struct IdentitiesClient { /* private fields */ }Expand description
Access to the /v1/gate/identities endpoints.
Obtain via Gate::identities.
Implementations§
Source§impl IdentitiesClient
impl IdentitiesClient
Sourcepub async fn create(
&self,
params: CreateIdentityParams,
) -> Result<Identity, Error>
pub async fn create( &self, params: CreateIdentityParams, ) -> Result<Identity, Error>
Create a new identity.
Maps to POST /v1/gate/identities.
Sourcepub async fn get(&self, identity_id: &str) -> Result<Identity, Error>
pub async fn get(&self, identity_id: &str) -> Result<Identity, Error>
Fetch a single identity by ID.
Maps to GET /v1/gate/identities/{id}.
Sourcepub async fn patch(
&self,
identity_id: &str,
ops: Vec<JsonPatchOp>,
) -> Result<Identity, Error>
pub async fn patch( &self, identity_id: &str, ops: Vec<JsonPatchOp>, ) -> Result<Identity, Error>
Partially update an identity using RFC 6902 JSON Patch operations.
Maps to PATCH /v1/gate/identities/{id}.
Sourcepub async fn delete(&self, identity_id: &str) -> Result<(), Error>
pub async fn delete(&self, identity_id: &str) -> Result<(), Error>
Permanently delete an identity.
Maps to DELETE /v1/gate/identities/{id}.
Sourcepub async fn set_state(
&self,
identity_id: &str,
state: &str,
) -> Result<Identity, Error>
pub async fn set_state( &self, identity_id: &str, state: &str, ) -> Result<Identity, Error>
Activate or deactivate an identity.
An "inactive" identity cannot log in — Kratos rejects its credentials
automatically — until it is reactivated. The identity is not deleted.
Fires the identity.state_changed webhook event.
Maps to PATCH /v1/gate/identities/{id}/state. state must be
"active" or "inactive".
Sourcepub async fn activate(&self, identity_id: &str) -> Result<Identity, Error>
pub async fn activate(&self, identity_id: &str) -> Result<Identity, Error>
Activate an identity — convenience wrapper for set_state
with "active".
Sourcepub async fn deactivate(&self, identity_id: &str) -> Result<Identity, Error>
pub async fn deactivate(&self, identity_id: &str) -> Result<Identity, Error>
Deactivate an identity — convenience wrapper for set_state
with "inactive".
Sourcepub async fn resend_verification(&self, identity_id: &str) -> Result<(), Error>
pub async fn resend_verification(&self, identity_id: &str) -> Result<(), Error>
Trigger a new email verification flow for an identity.
Useful when the original verification email expired or was never received; the user receives a fresh verification email.
Maps to POST /v1/gate/identities/{id}/resend-verification.