Struct IdentityApi

Source
pub struct IdentityApi<'a> { /* private fields */ }
Expand description

Identity API operations

Implementations§

Source§

impl<'a> IdentityApi<'a>

Source

pub fn new(client: &'a VeracodeClient) -> Self

Create a new IdentityApi instance

Source

pub async fn list_users( &self, query: Option<UserQuery>, ) -> Result<Vec<User>, IdentityError>

List users with optional filtering

§Arguments
  • query - Optional query parameters for filtering users
§Returns

A Result containing a list of users or an error

Source

pub async fn get_user(&self, user_id: &str) -> Result<User, IdentityError>

Get a specific user by ID

§Arguments
  • user_id - The ID of the user to retrieve
§Returns

A Result containing the user or an error

Source

pub async fn create_user( &self, request: CreateUserRequest, ) -> Result<User, IdentityError>

Create a new user

§Arguments
  • request - The user creation request
§Returns

A Result containing the created user or an error

Source

pub async fn update_user( &self, user_id: &str, request: UpdateUserRequest, ) -> Result<User, IdentityError>

Update an existing user

§Arguments
  • user_id - The ID of the user to update
  • request - The user update request
§Returns

A Result containing the updated user or an error

Source

pub async fn delete_user(&self, user_id: &str) -> Result<(), IdentityError>

Delete a user

§Arguments
  • user_id - The ID of the user to delete
§Returns

A Result indicating success or failure

Source

pub async fn list_roles(&self) -> Result<Vec<Role>, IdentityError>

List all roles

§Returns

A Result containing a list of roles or an error

Source

pub async fn list_teams(&self) -> Result<Vec<Team>, IdentityError>

List all teams with pagination support

§Returns

A Result containing a list of all teams across all pages or an error

Source

pub async fn create_team( &self, request: CreateTeamRequest, ) -> Result<Team, IdentityError>

Create a new team

§Arguments
  • request - The team creation request
§Returns

A Result containing the created team or an error

Source

pub async fn delete_team(&self, team_id: &str) -> Result<(), IdentityError>

Delete a team

§Arguments
  • team_id - The ID of the team to delete
§Returns

A Result indicating success or failure

Source

pub async fn create_api_credentials( &self, request: CreateApiCredentialRequest, ) -> Result<ApiCredential, IdentityError>

Create API credentials

§Arguments
  • request - The API credential creation request
§Returns

A Result containing the created API credentials or an error

Source

pub async fn revoke_api_credentials( &self, api_creds_id: &str, ) -> Result<(), IdentityError>

Revoke API credentials

§Arguments
  • api_creds_id - The ID of the API credentials to revoke
§Returns

A Result indicating success or failure

Source§

impl<'a> IdentityApi<'a>

Convenience methods for common operations

Source

pub async fn find_user_by_email( &self, email: &str, ) -> Result<Option<User>, IdentityError>

Find a user by email address

§Arguments
  • email - The email address to search for
§Returns

A Result containing the user if found, or None if not found

Source

pub async fn find_user_by_username( &self, username: &str, ) -> Result<Option<User>, IdentityError>

Find a user by username

§Arguments
  • username - The username to search for
§Returns

A Result containing the user if found, or None if not found

Source

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 address
  • username - User’s username
  • first_name - User’s first name
  • last_name - User’s last name
  • team_ids - List of team IDs to assign (at least one required)
§Returns

A Result containing the created user or an error

Source

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 address
  • username - Service account username
  • first_name - Service account first name
  • last_name - Service account last name
  • role_ids - List of role IDs to assign
  • team_ids - Optional list of team IDs to assign
§Returns

A Result containing the created user or an error

Auto Trait Implementations§

§

impl<'a> Freeze for IdentityApi<'a>

§

impl<'a> !RefUnwindSafe for IdentityApi<'a>

§

impl<'a> Send for IdentityApi<'a>

§

impl<'a> Sync for IdentityApi<'a>

§

impl<'a> Unpin for IdentityApi<'a>

§

impl<'a> !UnwindSafe for IdentityApi<'a>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> ErasedDestructor for T
where T: 'static,