pub struct IdentityApi<'a> { /* private fields */ }Expand description
Identity API operations
Implementations§
Source§impl<'a> IdentityApi<'a>
impl<'a> IdentityApi<'a>
Sourcepub fn new(client: &'a VeracodeClient) -> Self
pub fn new(client: &'a VeracodeClient) -> Self
§Errors
Returns an error if the API request fails, the resource is not found,
or authentication/authorization fails.
Create a new IdentityApi instance
Sourcepub async fn list_users(
&self,
query: Option<UserQuery>,
) -> Result<Vec<User>, IdentityError>
pub async fn list_users( &self, query: Option<UserQuery>, ) -> Result<Vec<User>, IdentityError>
Sourcepub async fn create_user(
&self,
request: CreateUserRequest,
) -> Result<User, IdentityError>
pub async fn create_user( &self, request: CreateUserRequest, ) -> Result<User, IdentityError>
Sourcepub async fn update_user(
&self,
user_id: &str,
request: UpdateUserRequest,
) -> Result<User, IdentityError>
pub async fn update_user( &self, user_id: &str, request: UpdateUserRequest, ) -> Result<User, IdentityError>
Sourcepub async fn delete_user(&self, user_id: &str) -> Result<(), IdentityError>
pub async fn delete_user(&self, user_id: &str) -> Result<(), IdentityError>
Sourcepub async fn list_roles(&self) -> Result<Vec<Role>, IdentityError>
pub async fn list_roles(&self) -> Result<Vec<Role>, IdentityError>
Sourcepub async fn list_teams(&self) -> Result<Vec<Team>, IdentityError>
pub async fn list_teams(&self) -> Result<Vec<Team>, IdentityError>
Sourcepub async fn create_team(
&self,
request: CreateTeamRequest,
) -> Result<Team, IdentityError>
pub async fn create_team( &self, request: CreateTeamRequest, ) -> Result<Team, IdentityError>
Sourcepub async fn delete_team(&self, team_id: &str) -> Result<(), IdentityError>
pub async fn delete_team(&self, team_id: &str) -> Result<(), IdentityError>
Sourcepub async fn get_team_by_name(
&self,
team_name: &str,
) -> Result<Option<Team>, IdentityError>
pub async fn get_team_by_name( &self, team_name: &str, ) -> Result<Option<Team>, IdentityError>
Get a team by its name
Searches for a team by exact name match. The API may return multiple teams that match the search criteria, so this method performs an exact string comparison to find the specific team requested.
§Arguments
team_name- The exact name of the team to find
§Returns
A Result containing an Option<Team> if found, or an error
§Errors
Returns an error if the API request fails, the identity resource is not found, or authentication/authorization fails.
Sourcepub async fn get_team_guid_by_name(
&self,
team_name: &str,
) -> Result<Option<String>, IdentityError>
pub async fn get_team_guid_by_name( &self, team_name: &str, ) -> Result<Option<String>, IdentityError>
Get a team’s GUID by its name
This is a convenience method for application creation workflows where only the team GUID is needed.
§Arguments
team_name- The exact name of the team to find
§Returns
A Result containing an Option<String> with the team’s GUID if found, or an error
§Errors
Returns an error if the API request fails, the identity resource is not found, or authentication/authorization fails.
Sourcepub async fn create_api_credentials(
&self,
request: CreateApiCredentialRequest,
) -> Result<ApiCredential, IdentityError>
pub async fn create_api_credentials( &self, request: CreateApiCredentialRequest, ) -> Result<ApiCredential, IdentityError>
Sourcepub async fn revoke_api_credentials(
&self,
api_creds_id: &str,
) -> Result<(), IdentityError>
pub async fn revoke_api_credentials( &self, api_creds_id: &str, ) -> Result<(), IdentityError>
Source§impl<'a> IdentityApi<'a>
Convenience methods for common operations
impl<'a> IdentityApi<'a>
Convenience methods for common operations
Sourcepub async fn find_user_by_email(
&self,
email: &str,
) -> Result<Option<User>, IdentityError>
pub async fn find_user_by_email( &self, email: &str, ) -> Result<Option<User>, IdentityError>
Sourcepub async fn find_user_by_username(
&self,
username: &str,
) -> Result<Option<User>, IdentityError>
pub async fn find_user_by_username( &self, username: &str, ) -> Result<Option<User>, IdentityError>
Sourcepub async fn create_simple_user(
&self,
email: &str,
username: &str,
first_name: &str,
last_name: &str,
team_ids: Vec<String>,
) -> Result<User, IdentityError>
pub async fn create_simple_user( &self, email: &str, username: &str, first_name: &str, last_name: &str, team_ids: Vec<String>, ) -> Result<User, IdentityError>
Create a simple user with basic information
§Arguments
email- User’s email addressusername- User’s usernamefirst_name- User’s first namelast_name- User’s last nameteam_ids- List of team IDs to assign (at least one required)
§Returns
A Result containing the created user or an error
§Errors
Returns an error if the API request fails, the identity resource is not found, or authentication/authorization fails.
Sourcepub async fn create_api_service_account(
&self,
email: &str,
username: &str,
first_name: &str,
last_name: &str,
role_ids: Vec<String>,
team_ids: Option<Vec<String>>,
) -> Result<User, IdentityError>
pub async fn create_api_service_account( &self, email: &str, username: &str, first_name: &str, last_name: &str, role_ids: Vec<String>, team_ids: Option<Vec<String>>, ) -> Result<User, IdentityError>
Create an API service account
§Arguments
email- Service account email addressusername- Service account usernamefirst_name- Service account first namelast_name- Service account last namerole_ids- List of role IDs to assignteam_ids- Optional list of team IDs to assign
§Returns
A Result containing the created user or an error
§Errors
Returns an error if the API request fails, the identity resource is not found, or authentication/authorization fails.