Struct okta::groups::Groups

source ·
pub struct Groups {
    pub client: Client,
}

Fields§

§client: Client

Implementations§

source§

impl Groups

source

pub async fn list( &self, q: &str, search: &str, after: &str, limit: i64, expand: &str ) -> Result<Response<Vec<Group>>, ClientError>

List Groups.

This function performs a GET to the /api/v1/groups endpoint.

Enumerates groups in your organization with pagination. A subset of groups can be returned that match a supported filter expression or query.

Parameters:

  • q: &str – Searches the name property of groups for matching value.
  • search: &str – Filter expression for groups.
  • after: &str – Specifies the pagination cursor for the next page of groups.
  • limit: i64 – Specifies the number of group results in a page.
  • expand: &str – If specified, it causes additional metadata to be included in the response.
source

pub async fn list_all( &self, q: &str, search: &str, expand: &str ) -> Result<Response<Vec<Group>>, ClientError>

List Groups.

This function performs a GET to the /api/v1/groups endpoint.

As opposed to list, this function returns all the pages of the request at once.

Enumerates groups in your organization with pagination. A subset of groups can be returned that match a supported filter expression or query.

source

pub async fn create(&self, body: &Group) -> Result<Response<Group>, ClientError>

Add Group.

This function performs a POST to the /api/v1/groups endpoint.

Adds a new group with OKTA_GROUP type to your organization.

source

pub async fn list_rules( &self, limit: i64, after: &str, search: &str, expand: &str ) -> Result<Response<Vec<GroupRule>>, ClientError>

List Group Rules.

This function performs a GET to the /api/v1/groups/rules endpoint.

Lists all group rules for your organization.

Parameters:

  • limit: i64 – Specifies the number of rule results in a page.
  • after: &str – Specifies the pagination cursor for the next page of rules.
  • search: &str – Specifies the keyword to search fules for.
  • expand: &str – If specified as groupIdToGroupNameMap, then show group names.
source

pub async fn list_all_rules( &self, search: &str, expand: &str ) -> Result<Response<Vec<GroupRule>>, ClientError>

List Group Rules.

This function performs a GET to the /api/v1/groups/rules endpoint.

As opposed to list_rules, this function returns all the pages of the request at once.

Lists all group rules for your organization.

source

pub async fn create_rule( &self, body: &GroupRule ) -> Result<Response<GroupRule>, ClientError>

Create Group Rule.

This function performs a POST to the /api/v1/groups/rules endpoint.

Creates a group rule to dynamically add users to the specified group if they match the condition

source

pub async fn get_rule( &self, rule_id: &str, expand: &str ) -> Result<Response<GroupRule>, ClientError>

Get Group Rule.

This function performs a GET to the /api/v1/groups/rules/{ruleId} endpoint.

Fetches a specific group rule by id from your organization

Parameters:

  • rule_id: &str
  • expand: &str
source

pub async fn update_rule( &self, rule_id: &str, body: &GroupRule ) -> Result<Response<GroupRule>, ClientError>

This function performs a PUT to the /api/v1/groups/rules/{ruleId} endpoint.

Updates a group rule. Only INACTIVE rules can be updated.

Parameters:

  • rule_id: &str
source

pub async fn delete_rule( &self, rule_id: &str, remove_users: bool ) -> Result<Response<()>, ClientError>

Delete a group Rule.

This function performs a DELETE to the /api/v1/groups/rules/{ruleId} endpoint.

Removes a specific group rule by id from your organization

Parameters:

  • rule_id: &str
  • remove_users: bool – Indicates whether to keep or remove users from groups assigned by this rule.
source

pub async fn activate_rule( &self, rule_id: &str ) -> Result<Response<()>, ClientError>

Activate a group Rule.

This function performs a POST to the /api/v1/groups/rules/{ruleId}/lifecycle/activate endpoint.

Activates a specific group rule by id from your organization

Parameters:

  • rule_id: &str
source

pub async fn deactivate_rule( &self, rule_id: &str ) -> Result<Response<()>, ClientError>

Deactivate a group Rule.

This function performs a POST to the /api/v1/groups/rules/{ruleId}/lifecycle/deactivate endpoint.

Deactivates a specific group rule by id from your organization

Parameters:

  • rule_id: &str
source

pub async fn get(&self, group_id: &str) -> Result<Response<Group>, ClientError>

List Group Rules.

This function performs a GET to the /api/v1/groups/{groupId} endpoint.

Lists all group rules for your organization.

Parameters:

  • group_id: &str
source

pub async fn update( &self, group_id: &str, body: &Group ) -> Result<Response<Group>, ClientError>

Update Group.

This function performs a PUT to the /api/v1/groups/{groupId} endpoint.

Updates the profile for a group with OKTA_GROUP type from your organization.

Parameters:

  • group_id: &str
source

pub async fn delete(&self, group_id: &str) -> Result<Response<()>, ClientError>

Remove Group.

This function performs a DELETE to the /api/v1/groups/{groupId} endpoint.

Removes a group with OKTA_GROUP type from your organization.

Parameters:

  • group_id: &str
source

pub async fn list_assigned_applications_fors( &self, group_id: &str, after: &str, limit: i64 ) -> Result<Response<Vec<Application>>, ClientError>

List Assigned Applications.

This function performs a GET to the /api/v1/groups/{groupId}/apps endpoint.

Enumerates all applications that are assigned to a group.

Parameters:

  • group_id: &str
  • after: &str – Specifies the pagination cursor for the next page of apps.
  • limit: i64 – Specifies the number of app results for a page.
source

pub async fn list_all_assigned_applications_fors( &self, group_id: &str ) -> Result<Response<Vec<Application>>, ClientError>

List Assigned Applications.

This function performs a GET to the /api/v1/groups/{groupId}/apps endpoint.

As opposed to list_assigned_applications_for, this function returns all the pages of the request at once.

Enumerates all applications that are assigned to a group.

source

pub async fn list_assigned_roles( &self, group_id: &str, expand: &str ) -> Result<Response<Vec<Role>>, ClientError>

This function performs a GET to the /api/v1/groups/{groupId}/roles endpoint.

Success

Parameters:

  • group_id: &str
  • expand: &str
source

pub async fn list_all_assigned_roles( &self, group_id: &str, expand: &str ) -> Result<Response<Vec<Role>>, ClientError>

This function performs a GET to the /api/v1/groups/{groupId}/roles endpoint.

As opposed to list_assigned_roles, this function returns all the pages of the request at once.

Success

source

pub async fn assign_role( &self, group_id: &str, disable_notifications: &str, body: &AssignRoleRequest ) -> Result<Response<Role>, ClientError>

This function performs a POST to the /api/v1/groups/{groupId}/roles endpoint.

Assigns a Role to a Group

Parameters:

  • group_id: &str
  • disable_notifications: &str
source

pub async fn get_role( &self, group_id: &str, role_id: &str ) -> Result<Response<Role>, ClientError>

This function performs a GET to the /api/v1/groups/{groupId}/roles/{roleId} endpoint.

Success

Parameters:

  • group_id: &str
  • role_id: &str
source

pub async fn remove_role_from( &self, group_id: &str, role_id: &str ) -> Result<Response<()>, ClientError>

This function performs a DELETE to the /api/v1/groups/{groupId}/roles/{roleId} endpoint.

Unassigns a Role from a Group

Parameters:

  • group_id: &str
  • role_id: &str
source

pub async fn list_application_targets_for_administrator_roles( &self, group_id: &str, role_id: &str, after: &str, limit: i64 ) -> Result<Response<Vec<CatalogApplication>>, ClientError>

This function performs a GET to the /api/v1/groups/{groupId}/roles/{roleId}/targets/catalog/apps endpoint.

Lists all App targets for an APP_ADMIN Role assigned to a Group. This methods return list may include full Applications or Instances. The response for an instance will have an ID value, while Application will not have an ID.

Parameters:

  • group_id: &str
  • role_id: &str
  • after: &str
  • limit: i64
source

pub async fn list_all_application_targets_for_administrator_roles( &self, group_id: &str, role_id: &str ) -> Result<Response<Vec<CatalogApplication>>, ClientError>

This function performs a GET to the /api/v1/groups/{groupId}/roles/{roleId}/targets/catalog/apps endpoint.

As opposed to list_application_targets_for_administrator_role, this function returns all the pages of the request at once.

Lists all App targets for an APP_ADMIN Role assigned to a Group. This methods return list may include full Applications or Instances. The response for an instance will have an ID value, while Application will not have an ID.

source

pub async fn add_application_target_admin_role_given( &self, group_id: &str, role_id: &str, app_name: &str ) -> Result<Response<()>, ClientError>

This function performs a PUT to the /api/v1/groups/{groupId}/roles/{roleId}/targets/catalog/apps/{appName} endpoint.

Success

Parameters:

  • group_id: &str
  • role_id: &str
  • app_name: &str
source

pub async fn remove_application_target_from_administrator_role_given( &self, group_id: &str, role_id: &str, app_name: &str ) -> Result<Response<()>, ClientError>

This function performs a DELETE to the /api/v1/groups/{groupId}/roles/{roleId}/targets/catalog/apps/{appName} endpoint.

Success

Parameters:

  • group_id: &str
  • role_id: &str
  • app_name: &str
source

pub async fn add_application_instance_target_app_admin_role_given( &self, group_id: &str, role_id: &str, app_name: &str, application_id: &str ) -> Result<Response<()>, ClientError>

Add App Instance Target to App Administrator Role given to a Group.

This function performs a PUT to the /api/v1/groups/{groupId}/roles/{roleId}/targets/catalog/apps/{appName}/{applicationId} endpoint.

Add App Instance Target to App Administrator Role given to a Group

Parameters:

  • group_id: &str
  • role_id: &str
  • app_name: &str
  • application_id: &str
source

pub async fn remove_application_target_from_administrator_role_given_groups( &self, group_id: &str, role_id: &str, app_name: &str, application_id: &str ) -> Result<Response<()>, ClientError>

Remove App Instance Target to App Administrator Role given to a Group.

This function performs a DELETE to the /api/v1/groups/{groupId}/roles/{roleId}/targets/catalog/apps/{appName}/{applicationId} endpoint.

Remove App Instance Target to App Administrator Role given to a Group

Parameters:

  • group_id: &str
  • role_id: &str
  • app_name: &str
  • application_id: &str
source

pub async fn list_targets_for_roles( &self, group_id: &str, role_id: &str, after: &str, limit: i64 ) -> Result<Response<Vec<Group>>, ClientError>

This function performs a GET to the /api/v1/groups/{groupId}/roles/{roleId}/targets/groups endpoint.

Success

Parameters:

  • group_id: &str
  • role_id: &str
  • after: &str
  • limit: i64
source

pub async fn list_all_targets_for_roles( &self, group_id: &str, role_id: &str ) -> Result<Response<Vec<Group>>, ClientError>

This function performs a GET to the /api/v1/groups/{groupId}/roles/{roleId}/targets/groups endpoint.

As opposed to list_targets_for_role, this function returns all the pages of the request at once.

Success

source

pub async fn add_target_administrator_role_for( &self, group_id: &str, role_id: &str, target_group_id: &str ) -> Result<Response<()>, ClientError>

This function performs a PUT to the /api/v1/groups/{groupId}/roles/{roleId}/targets/groups/{targetGroupId} endpoint.

Parameters:

  • group_id: &str
  • role_id: &str
  • target_group_id: &str
source

pub async fn remove_target_from_administrator_role_given( &self, group_id: &str, role_id: &str, target_group_id: &str ) -> Result<Response<()>, ClientError>

This function performs a DELETE to the /api/v1/groups/{groupId}/roles/{roleId}/targets/groups/{targetGroupId} endpoint.

Parameters:

  • group_id: &str
  • role_id: &str
  • target_group_id: &str
source

pub async fn list_users( &self, group_id: &str, after: &str, limit: i64 ) -> Result<Response<Vec<User>>, ClientError>

List Group Members.

This function performs a GET to the /api/v1/groups/{groupId}/users endpoint.

Enumerates all users that are a member of a group.

Parameters:

  • group_id: &str
  • after: &str – Specifies the pagination cursor for the next page of users.
  • limit: i64 – Specifies the number of user results in a page.
source

pub async fn list_all_users( &self, group_id: &str ) -> Result<Response<Vec<User>>, ClientError>

List Group Members.

This function performs a GET to the /api/v1/groups/{groupId}/users endpoint.

As opposed to list_users, this function returns all the pages of the request at once.

Enumerates all users that are a member of a group.

source

pub async fn add_user( &self, group_id: &str, user_id: &str ) -> Result<Response<()>, ClientError>

Add User to Group.

This function performs a PUT to the /api/v1/groups/{groupId}/users/{userId} endpoint.

Adds a user to a group with ‘OKTA_GROUP’ type.

Parameters:

  • group_id: &str
  • user_id: &str
source

pub async fn remove_user_from( &self, group_id: &str, user_id: &str ) -> Result<Response<()>, ClientError>

Remove User from Group.

This function performs a DELETE to the /api/v1/groups/{groupId}/users/{userId} endpoint.

Removes a user from a group with ‘OKTA_GROUP’ type.

Parameters:

  • group_id: &str
  • user_id: &str

Auto Trait Implementations§

§

impl !RefUnwindSafe for Groups

§

impl Send for Groups

§

impl Sync for Groups

§

impl Unpin for Groups

§

impl !UnwindSafe for Groups

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere 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 Twhere 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, U> TryFrom<U> for Twhere U: Into<T>,

§

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 Twhere U: TryFrom<T>,

§

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.
§

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

§

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