pub struct Client { /* private fields */ }Expand description
An API client for Frontegg.
The API client is designed to be wrapped in an Arc and used from
multiple threads simultaneously. A successful authentication response is
shared by all threads.
Implementations§
source§impl Client
impl Client
sourcepub async fn list_tenants(&self) -> Result<Vec<Tenant>, Error>
pub async fn list_tenants(&self) -> Result<Vec<Tenant>, Error>
Lists all tenants in the workspace.
The returned vector is sorted by tenant ID.
sourcepub async fn create_tenant(
&self,
tenant: &TenantRequest<'_>
) -> Result<Tenant, Error>
pub async fn create_tenant( &self, tenant: &TenantRequest<'_> ) -> Result<Tenant, Error>
Creates a new tenant.
source§impl Client
impl Client
sourcepub fn list_users(
&self,
config: UserListConfig
) -> impl Stream<Item = Result<User, Error>> + '_
pub fn list_users( &self, config: UserListConfig ) -> impl Stream<Item = Result<User, Error>> + '_
Lists users, either for all tenants or for a single tenant.
The underlying API call is paginated. The returned stream will fetch additional pages as it is consumed.
sourcepub async fn create_user(
&self,
user: &UserRequest<'_>
) -> Result<CreatedUser, Error>
pub async fn create_user( &self, user: &UserRequest<'_> ) -> Result<CreatedUser, Error>
Creates a new user.
Only partial information about the created user is returned. To fetch
the full information about the user, call Client::get_user.
source§impl Client
impl Client
sourcepub fn new(config: ClientConfig) -> Client
pub fn new(config: ClientConfig) -> Client
Creates a new Client from its required configuration parameters.
sourcepub fn builder() -> ClientBuilder
pub fn builder() -> ClientBuilder
Creates a builder for a Client that allows for customization of
optional parameters.